(function(c){c.ui={plugin:{add:function(f,e,j){var h=c.ui[f].prototype;for(var g in j){h.plugins[g]=h.plugins[g]||[];h.plugins[g].push([e,j[g]])}},call:function(e,g,f){var j=e.plugins[g];if(!j){return}for(var h=0;h<j.length;h++){if(e.options[j[h][0]]){j[h][1].apply(e.element,f)}}}},cssCache:{},css:function(f){if(c.ui.cssCache[f]){return c.ui.cssCache[f]}var g=c('<div class="ui-resizable-gen">').addClass(f).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");c.ui.cssCache[f]=!!((!(/auto|default/).test(g.css("cursor"))||(/^[1-9]/).test(g.css("height"))||(/^[1-9]/).test(g.css("width"))||!(/none/).test(g.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(g.css("backgroundColor"))));try{c("body").get(0).removeChild(g.get(0))}catch(h){}return c.ui.cssCache[f]},disableSelection:function(f){f.unselectable="on";f.onselectstart=function(){return false};if(f.style){f.style.MozUserSelect="none"}},enableSelection:function(f){f.unselectable="off";f.onselectstart=function(){return true};if(f.style){f.style.MozUserSelect=""}},hasScroll:function(i,f){var h=/top/.test(f||"top")?"scrollTop":"scrollLeft",g=false;if(i[h]>0){return true}i[h]=1;g=i[h]>0?true:false;i[h]=0;return g}};var a=c.fn.remove;c.fn.remove=function(){c("*",this).add(this).trigger("remove");return a.apply(this,arguments)};function b(g,e,h){var f=c[g][e].getter||[];f=(typeof f=="string"?f.split(/,?\s+/):f);return(c.inArray(h,f)!=-1)}var d={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(e){return this.options[e]},setData:function(e,f){this.options[e]=f},enable:function(){this.setData("disabled",false)},disable:function(){this.setData("disabled",true)}};c.widget=function(e,f){var g=e.split(".")[0];e=e.split(".")[1];c.fn[e]=function(k){var i=(typeof k=="string"),j=Array.prototype.slice.call(arguments,1);if(i&&b(g,e,k)){var h=c.data(this[0],e);return(h?h[k].apply(h,j):undefined)}return this.each(function(){var l=c.data(this,e);if(!l){c.data(this,e,new c[g][e](this,k))}else{if(i){l[k].apply(l,j)}}})};c[g][e]=function(i,j){var h=this;this.widgetName=e;this.options=c.extend({},c[g][e].defaults,j);this.element=c(i).bind("setData."+e,function(m,k,l){return h.setData(k,l)}).bind("getData."+e,function(l,k){return h.getData(k)}).bind("remove",function(){return h.destroy()});this.init()};c[g][e].prototype=c.extend({},d,f)};c.ui.mouse={mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(f){return e.mouseDown(f)});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},mouseDown:function(h){(this._mouseStarted&&this.mouseUp(h));this._mouseDownEvent=h;var f=this,i=(h.which==1),g=(c(h.target).is(this.options.cancel));if(!i||g){return true}this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){f._mouseDelayMet=true},this.options.delay)}this._mouseMoveDelegate=function(j){return f.mouseMove(j)};this._mouseUpDelegate=function(j){return f.mouseUp(j)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false},mouseMove:function(f){if(c.browser.msie&&!f.button){return this.mouseUp(f)}if(this._mouseStarted){this.mouseDrag(f);return false}if(this.mouseDistanceMet(f)&&this.mouseDelayMet(f)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,f)!==false);(this._mouseStarted||this.mouseUp(f))}return !this._mouseStarted},mouseUp:function(f){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(f)}return false},mouseDistanceMet:function(f){return(Math.max(Math.abs(this._mouseDownEvent.pageX-f.pageX),Math.abs(this._mouseDownEvent.pageY-f.pageY))>=this.options.distance)},mouseDelayMet:function(f){return this._mouseDelayMet},mouseStart:function(f){},mouseDrag:function(f){},mouseStop:function(f){}};c.ui.mouse.defaults={cancel:null,distance:0,delay:0}})(jQuery);