(function(c){c.ui={plugin:{add:function(f,g,j){var h=c.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},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,g){var f=/top/.test(g||"top")?"scrollTop":"scrollLeft",h=false;if(i[f]>0){return true}i[f]=1;h=i[f]>0?true:false;i[f]=0;return h}};var b=c.fn.remove;c.fn.remove=function(){c("*",this).add(this).trigger("remove");return b.apply(this,arguments)};function a(f,g,h){var e=c[f][g].getter||[];e=(typeof e=="string"?e.split(/,?\s+/):e);return(c.inArray(h,e)!=-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(f,e){var g=f.split(".")[0];f=f.split(".")[1];c.fn[f]=function(k,l){var i=(typeof k=="string"),j=arguments;if(i&&a(g,f,k)){var h=c.data(this[0],f);return(h?h[k](l):undefined)}return this.each(function(){var m=c.data(this,f);if(!m){c.data(this,f,new c[g][f](this,k))}else{if(i){try{m[k].apply(m,c.makeArray(j).slice(1))}catch(n){}}}})};c[g][f]=function(j,i){var h=this;this.widgetName=f;this.options=c.extend({},c[g][f].defaults,i);this.element=c(j).bind("setData."+f,function(m,k,l){return h.setData(k,l)}).bind("getData."+f,function(l,k){return h.getData(k)}).bind("remove",function(){return h.destroy()});this.init()};c[g][f].prototype=c.extend({},d,e)};c.widget("ui.mouse",{init:function(){var e=this;this.element.bind("mousedown.mouse",function(){return e.click.apply(e,arguments)}).bind("mouseup.mouse",function(){(e.timer&&clearInterval(e.timer))}).bind("click.mouse",function(){if(e.initialized){e.initialized=false;return false}});if(c.browser.msie){this.unselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}},destroy:function(){this.element.unbind(".mouse").removeData("mouse");(c.browser.msie&&this.element.attr("unselectable",this.unselectable))},trigger:function(){return this.click.apply(this,arguments)},click:function(h){if(h.which!=1||c.inArray(h.target.nodeName.toLowerCase(),this.options.dragPrevention||[])!=-1||(this.options.condition&&!this.options.condition.apply(this.options.executor||this,[h,this.element]))){return true}var g=this;this.initialized=false;var f=function(){g._MP={left:h.pageX,top:h.pageY};c(document).bind("mouseup.mouse",function(){return g.stop.apply(g,arguments)});c(document).bind("mousemove.mouse",function(){return g.drag.apply(g,arguments)});if(!g.initalized&&Math.abs(g._MP.left-h.pageX)>=g.options.distance||Math.abs(g._MP.top-h.pageY)>=g.options.distance){(g.options.start&&g.options.start.call(g.options.executor||g,h,g.element));(g.options.drag&&g.options.drag.call(g.options.executor||g,h,this.element));g.initialized=true}};if(this.options.delay){if(this.timer){clearInterval(this.timer)}this.timer=setTimeout(f,this.options.delay)}else{f()}return false},stop:function(f){if(!this.initialized){return c(document).unbind("mouseup.mouse").unbind("mousemove.mouse")}(this.options.stop&&this.options.stop.call(this.options.executor||this,f,this.element));c(document).unbind("mouseup.mouse").unbind("mousemove.mouse");return false},drag:function(f){var g=this.options;if(c.browser.msie&&!f.button){return this.stop.call(this,f)}if(!this.initialized&&(Math.abs(this._MP.left-f.pageX)>=g.distance||Math.abs(this._MP.top-f.pageY)>=g.distance)){(g.start&&g.start.call(g.executor||this,f,this.element));this.initialized=true}else{if(!this.initialized){return false}}(g.drag&&g.drag.call(this.options.executor||this,f,this.element));return false}})})(jQuery);