You should probably look at making you widget an object. So that you can create multiple instances of the widget. In that way you'll include just 1 js file per widget type. But you'll create multiple widgets with it.
var widget=function(id) {
}
And then for the adding to your page
var activeWidgets=new Array();
function addWidget(someid) {
activeWidgets[activeWidgets.length]=new widget(someeid);
}