(function(a){a.fn.request=function(b){return this.each(function(){if(a(this).is("form")){var f=a(this).attr("method");var e=a(this).attr("action");var d=a(this).attr("encoding")||"application/x-www-form-urlencoded";var c=a.extend({type:f,url:e,contentType:d,data:a.param(a(":input",this))},b);a.ajax(c)}})};a.fn.select=function(b){return this.each(function(){if(a(this).is("select")){for(i=0;i<this.options.length;i++){if(this.options[i].value==b){this.selectedIndex=i}}}})};a.fn.loadOptions=function(c,b,d){return this.each(function(){if(a(this).is("select")){var f=this;var e=a.extend({url:c,type:"post",dataType:"json",data:{},success:function(g){a(f).empty();a.each(g.items,function(h,k){var j=a("<option></option>").attr("value",k.id);a(j).append(k.name);a(f).append(j);a(f).trigger("change")})},complete:function(){if(a.isFunction(d)){d()}}},b);a.ajax(e)}})};a.fn.disable=function(){return this.each(function(){a(this).attr("disabled","disabled")})};a.fn.enable=function(){return this.each(function(){a(this).attr("disabled","")})}})(jQuery);