(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(el){
$(el).attr("unselectable","on").css("MozUserSelect","none");
},enableSelection:function(el){
$(el).attr("unselectable","off").css("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 _14=$.fn.remove;
$.fn.remove=function(){
$("*",this).add(this).triggerHandler("remove");
return _14.apply(this,arguments);
};
function getter(_15,_16,_17){
var _18=$[_15][_16].getter||[];
_18=(typeof _18=="string"?_18.split(/,?\s+/):_18);
return ($.inArray(_17,_18)!=-1);
}
$.widget=function(_19,_1a){
var _1b=_19.split(".")[0];
_19=_19.split(".")[1];
$.fn[_19]=function(_1c){
var _1d=(typeof _1c=="string"),_1e=Array.prototype.slice.call(arguments,1);
if(_1d&&getter(_1b,_19,_1c)){
var _1f=$.data(this[0],_19);
return (_1f?_1f[_1c].apply(_1f,_1e):undefined);
}
return this.each(function(){
var _20=$.data(this,_19);
if(_1d&&_20&&$.isFunction(_20[_1c])){
_20[_1c].apply(_20,_1e);
}else{
if(!_1d){
$.data(this,_19,new $[_1b][_19](this,_1c));
}
}
});
};
$[_1b][_19]=function(_21,_22){
var _23=this;
this.widgetName=_19;
this.widgetBaseClass=_1b+"-"+_19;
this.options=$.extend({},$.widget.defaults,$[_1b][_19].defaults,_22);
this.element=$(_21).bind("setData."+_19,function(e,key,_26){
return _23.setData(key,_26);
}).bind("getData."+_19,function(e,key){
return _23.getData(key);
}).bind("remove",function(){
return _23.destroy();
});
this.init();
};
$[_1b][_19].prototype=$.extend({},$.widget.prototype,_1a);
};
$.widget.prototype={init:function(){
},destroy:function(){
this.element.removeData(this.widgetName);
},getData:function(key){
return this.options[key];
},setData:function(key,_2b){
this.options[key]=_2b;
if(key=="disabled"){
this.element[_2b?"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 _2c=this;
this.element.bind("mousedown."+this.widgetName,function(e){
return _2c.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 _2f=this,_30=(e.which==1),_31=(typeof this.options.cancel=="string"?$(e.target).parents().add(e.target).filter(this.options.cancel).length:false);
if(!_30||_31||!this.mouseCapture(e)){
return true;
}
this._mouseDelayMet=!this.options.delay;
if(!this._mouseDelayMet){
this._mouseDelayTimer=setTimeout(function(){
_2f._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 _2f.mouseMove(e);
};
this._mouseUpDelegate=function(e){
return _2f.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);


