(function($){
$.ui={plugin:{add:function(_2,_3,_4){
var _5=$.ui[_2].prototype;
for(var i in _4){
_5.plugins[i]=_5.plugins[i]||[];
_5.plugins[i].push([_3,_4[i]]);
}
},call:function(_7,_8,_9){
var _a=_7.plugins[_8];
if(!_a){
return;
}
for(var i=0;i<_a.length;i++){
if(_7.options[_a[i][0]]){
_a[i][1].apply(_7.element,_9);
}
}
}},cssCache:{},css:function(_c){
if($.ui.cssCache[_c]){
return $.ui.cssCache[_c];
}
var _d=$("<div class=\"ui-gen\">").addClass(_c).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");
$.ui.cssCache[_c]=!!((!(/auto|default/).test(_d.css("cursor"))||(/^[1-9]/).test(_d.css("height"))||(/^[1-9]/).test(_d.css("width"))||!(/none/).test(_d.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(_d.css("backgroundColor"))));
try{
$("body").get(0).removeChild(_d.get(0));
}
catch(e){
}
return $.ui.cssCache[_c];
},disableSelection:function(e){
e.unselectable="on";
e.onselectstart=function(){
return false;
};
if(e.style){
e.style.MozUserSelect="none";
}
},enableSelection:function(e){
e.unselectable="off";
e.onselectstart=function(){
return true;
};
if(e.style){
e.style.MozUserSelect="";
}
},hasScroll:function(e,a){
var _12=/top/.test(a||"top")?"scrollTop":"scrollLeft",has=false;
if(e[_12]>0){
return true;
}
e[_12]=1;
has=e[_12]>0?true:false;
e[_12]=0;
return has;
}};
var _13=$.fn.remove;
$.fn.remove=function(){
$("*",this).add(this).trigger("remove");
return _13.apply(this,arguments);
};
function getter(_14,_15,_16){
var _17=$[_14][_15].getter||[];
_17=(typeof _17=="string"?_17.split(/,?\s+/):_17);
return ($.inArray(_16,_17)!=-1);
}
$.widget=function(_18,_19){
var _1a=_18.split(".")[0];
_18=_18.split(".")[1];
$.fn[_18]=function(_1b){
var _1c=(typeof _1b=="string"),args=Array.prototype.slice.call(arguments,1);
if(_1c&&getter(_1a,_18,_1b)){
var _1d=$.data(this[0],_18);
return (_1d?_1d[_1b].apply(_1d,args):undefined);
}
return this.each(function(){
var _1e=$.data(this,_18);
if(_1c&&_1e&&$.isFunction(_1e[_1b])){
_1e[_1b].apply(_1e,args);
}else{
if(!_1c){
$.data(this,_18,new $[_1a][_18](this,_1b));
}
}
});
};
$[_1a][_18]=function(_1f,_20){
var _21=this;
this.widgetName=_18;
this.widgetBaseClass=_1a+"-"+_18;
this.options=$.extend({},$.widget.defaults,$[_1a][_18].defaults,_20);
this.element=$(_1f).bind("setData."+_18,function(e,key,_24){
return _21.setData(key,_24);
}).bind("getData."+_18,function(e,key){
return _21.getData(key);
}).bind("remove",function(){
return _21.destroy();
});
this.init();
};
$[_1a][_18].prototype=$.extend({},$.widget.prototype,_19);
};
$.widget.prototype={init:function(){
},destroy:function(){
this.element.removeData(this.widgetName);
},getData:function(key){
return this.options[key];
},setData:function(key,_29){
this.options[key]=_29;
if(key=="disabled"){
this.element[_29?"addClass":"removeClass"](this.widgetBaseClass+"-disabled");
}
},enable:function(){
this.setData("disabled",false);
},disable:function(){
this.setData("disabled",true);
}};
$.widget.defaults={disabled:false};
$.ui.mouse={mouseInit:function(){
var _2a=this;
this.element.bind("mousedown."+this.widgetName,function(e){
return _2a.mouseDown(e);
});
if($.browser.msie){
this._mouseUnselectable=this.element.attr("unselectable");
this.element.attr("unselectable","on");
}
this.started=false;
},mouseDestroy:function(){
this.element.unbind("."+this.widgetName);
($.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable));
},mouseDown:function(e){
(this._mouseStarted&&this.mouseUp(e));
this._mouseDownEvent=e;
var _2d=this,btnIsLeft=(e.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(e.target).is(this.options.cancel):false);
if(!btnIsLeft||elIsCancel||!this.mouseCapture(e)){
return true;
}
this._mouseDelayMet=!this.options.delay;
if(!this._mouseDelayMet){
this._mouseDelayTimer=setTimeout(function(){
_2d._mouseDelayMet=true;
},this.options.delay);
}
if(this.mouseDistanceMet(e)&&this.mouseDelayMet(e)){
this._mouseStarted=(this.mouseStart(e)!==false);
if(!this._mouseStarted){
e.preventDefault();
return true;
}
}
this._mouseMoveDelegate=function(e){
return _2d.mouseMove(e);
};
this._mouseUpDelegate=function(e){
return _2d.mouseUp(e);
};
$(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);
return false;
},mouseMove:function(e){
if($.browser.msie&&!e.button){
return this.mouseUp(e);
}
if(this._mouseStarted){
this.mouseDrag(e);
return false;
}
if(this.mouseDistanceMet(e)&&this.mouseDelayMet(e)){
this._mouseStarted=(this.mouseStart(this._mouseDownEvent,e)!==false);
(this._mouseStarted?this.mouseDrag(e):this.mouseUp(e));
}
return !this._mouseStarted;
},mouseUp:function(e){
$(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);
if(this._mouseStarted){
this._mouseStarted=false;
this.mouseStop(e);
}
return false;
},mouseDistanceMet:function(e){
return (Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance);
},mouseDelayMet:function(e){
return this._mouseDelayMet;
},mouseStart:function(e){
},mouseDrag:function(e){
},mouseStop:function(e){
},mouseCapture:function(e){
return true;
}};
$.ui.mouse.defaults={cancel:null,distance:1,delay:0};
})(jQuery);
