(function(jq){
  jq.extend({
    require: function(plugin, o){
      o = jq.extend({
        css: false,
        jsbase: '',
        cssbase: '',
        onload: null
      }, o || {});
      var src = o.jsbase + '/' + plugin + '.js';
      // Provide a callback function to the getScript function
      jq.getScript(src, o.onload);
      if(o.css){
        var c = document.createElement('link');
        c.type = 'text/css';
        c.rel = 'stylesheet';
        c.href = o.cssbase + '/' + plugin + '.css';
        jq('head')[0].appendChild(c);
      }
    }
  });
})(jQuery);