jQuery.ui||(function($){
var _2=$.fn.remove,_3=$.browser.mozilla&&(parseFloat($.browser.version)<1.9);
$.ui={version:"1.7.2",plugin:{add:function(_4,_5,_6){
var _7=$.ui[_4].prototype;
for(var i in _6){
_7.plugins[i]=_7.plugins[i]||[];
_7.plugins[i].push([_5,_6[i]]);
}
},call:function(_9,_a,_b){
var _c=_9.plugins[_a];
if(!_c||!_9.element[0].parentNode){
return;
}
for(var i=0;i<_c.length;i++){
if(_9.options[_c[i][0]]){
_c[i][1].apply(_9.element,_b);
}
}
}},contains:function(a,b){
return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b);
},hasScroll:function(el,a){
if($(el).css("overflow")=="hidden"){
return false;
}
var _12=(a&&a=="left")?"scrollLeft":"scrollTop",has=false;
if(el[_12]>0){
return true;
}
el[_12]=1;
has=(el[_12]>0);
el[_12]=0;
return has;
},isOverAxis:function(x,_15,_16){
return (x>_15)&&(x<(_15+_16));
},isOver:function(y,x,top,_1a,_1b,_1c){
return $.ui.isOverAxis(y,top,_1b)&&$.ui.isOverAxis(x,_1a,_1c);
},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};
if(_3){
var _1d=$.attr,_1e=$.fn.removeAttr,_1f="http://www.w3.org/2005/07/aaa",_20=/^aria-/,_21=/^wairole:/;
$.attr=function(_22,_23,_24){
var set=_24!==undefined;
return (_23=="role"?(set?_1d.call(this,_22,_23,"wairole:"+_24):(_1d.apply(this,arguments)||"").replace(_21,"")):(_20.test(_23)?(set?_22.setAttributeNS(_1f,_23.replace(_20,"aaa:"),_24):_1d.call(this,_22,_23.replace(_20,"aaa:"))):_1d.apply(this,arguments)));
};
$.fn.removeAttr=function(_26){
return (_20.test(_26)?this.each(function(){
this.removeAttributeNS(_1f,_26.replace(_20,""));
}):_1e.call(this,_26));
};
}
$.fn.extend({remove:function(){
$("*",this).add(this).each(function(){
$(this).triggerHandler("remove");
});
return _2.apply(this,arguments);
},enableSelection:function(){
return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui");
},disableSelection:function(){
return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){
return false;
});
},scrollParent:function(){
var _27;
if(($.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){
_27=this.parents().filter(function(){
return (/(relative|absolute|fixed)/).test($.curCSS(this,"position",1))&&(/(auto|scroll)/).test($.curCSS(this,"overflow",1)+$.curCSS(this,"overflow-y",1)+$.curCSS(this,"overflow-x",1));
}).eq(0);
}else{
_27=this.parents().filter(function(){
return (/(auto|scroll)/).test($.curCSS(this,"overflow",1)+$.curCSS(this,"overflow-y",1)+$.curCSS(this,"overflow-x",1));
}).eq(0);
}
return (/fixed/).test(this.css("position"))||!_27.length?$(document):_27;
}});
$.extend($.expr[":"],{data:function(_28,i,_2a){
return !!$.data(_28,_2a[3]);
},focusable:function(_2b){
var _2c=_2b.nodeName.toLowerCase(),_2d=$.attr(_2b,"tabindex");
return (/input|select|textarea|button|object/.test(_2c)?!_2b.disabled:"a"==_2c||"area"==_2c?_2b.href||!isNaN(_2d):!isNaN(_2d))&&!$(_2b)["area"==_2c?"parents":"closest"](":hidden").length;
},tabbable:function(_2e){
var _2f=$.attr(_2e,"tabindex");
return (isNaN(_2f)||_2f>=0)&&$(_2e).is(":focusable");
}});
function getter(_30,_31,_32,_33){
function getMethods(_34){
var _35=$[_30][_31][_34]||[];
return (typeof _35=="string"?_35.split(/,?\s+/):_35);
}
var _36=getMethods("getter");
if(_33.length==1&&typeof _33[0]=="string"){
_36=_36.concat(getMethods("getterSetter"));
}
return ($.inArray(_32,_36)!=-1);
}
$.widget=function(_37,_38){
var _39=_37.split(".")[0];
_37=_37.split(".")[1];
$.fn[_37]=function(_3a){
var _3b=(typeof _3a=="string"),_3c=Array.prototype.slice.call(arguments,1);
if(_3b&&_3a.substring(0,1)=="_"){
return this;
}
if(_3b&&getter(_39,_37,_3a,_3c)){
var _3d=$.data(this[0],_37);
return (_3d?_3d[_3a].apply(_3d,_3c):undefined);
}
return this.each(function(){
var _3e=$.data(this,_37);
(!_3e&&!_3b&&$.data(this,_37,new $[_39][_37](this,_3a))._init());
(_3e&&_3b&&$.isFunction(_3e[_3a])&&_3e[_3a].apply(_3e,_3c));
});
};
$[_39]=$[_39]||{};
$[_39][_37]=function(_3f,_40){
var _41=this;
this.namespace=_39;
this.widgetName=_37;
this.widgetEventPrefix=$[_39][_37].eventPrefix||_37;
this.widgetBaseClass=_39+"-"+_37;
this.options=$.extend({},$.widget.defaults,$[_39][_37].defaults,$.metadata&&$.metadata.get(_3f)[_37],_40);
this.element=$(_3f).bind("setData."+_37,function(_42,key,_44){
if(_42.target==_3f){
return _41._setData(key,_44);
}
}).bind("getData."+_37,function(_45,key){
if(_45.target==_3f){
return _41._getData(key);
}
}).bind("remove",function(){
return _41.destroy();
});
};
$[_39][_37].prototype=$.extend({},$.widget.prototype,_38);
$[_39][_37].getterSetter="option";
};
$.widget.prototype={_init:function(){
},destroy:function(){
this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled"+" "+this.namespace+"-state-disabled").removeAttr("aria-disabled");
},option:function(key,_48){
var _49=key,_4a=this;
if(typeof key=="string"){
if(_48===undefined){
return this._getData(key);
}
_49={};
_49[key]=_48;
}
$.each(_49,function(key,_4c){
_4a._setData(key,_4c);
});
},_getData:function(key){
return this.options[key];
},_setData:function(key,_4f){
this.options[key]=_4f;
if(key=="disabled"){
this.element[_4f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+this.namespace+"-state-disabled").attr("aria-disabled",_4f);
}
},enable:function(){
this._setData("disabled",false);
},disable:function(){
this._setData("disabled",true);
},_trigger:function(_50,_51,_52){
var _53=this.options[_50],_54=(_50==this.widgetEventPrefix?_50:this.widgetEventPrefix+_50);
_51=$.Event(_51);
_51.type=_54;
if(_51.originalEvent){
for(var i=$.event.props.length,_56;i;){
_56=$.event.props[--i];
_51[_56]=_51.originalEvent[_56];
}
}
this.element.trigger(_51,_52);
return !($.isFunction(_53)&&_53.call(this.element[0],_51,_52)===false||_51.isDefaultPrevented());
}};
$.widget.defaults={disabled:false};
$.ui.mouse={_mouseInit:function(){
var _57=this;
this.element.bind("mousedown."+this.widgetName,function(_58){
return _57._mouseDown(_58);
}).bind("click."+this.widgetName,function(_59){
if(_57._preventClickEvent){
_57._preventClickEvent=false;
_59.stopImmediatePropagation();
return false;
}
});
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(_5a){
_5a.originalEvent=_5a.originalEvent||{};
if(_5a.originalEvent.mouseHandled){
return;
}
(this._mouseStarted&&this._mouseUp(_5a));
this._mouseDownEvent=_5a;
var _5b=this,_5c=(_5a.which==1),_5d=(typeof this.options.cancel=="string"?$(_5a.target).parents().add(_5a.target).filter(this.options.cancel).length:false);
if(!_5c||_5d||!this._mouseCapture(_5a)){
return true;
}
this.mouseDelayMet=!this.options.delay;
if(!this.mouseDelayMet){
this._mouseDelayTimer=setTimeout(function(){
_5b.mouseDelayMet=true;
},this.options.delay);
}
if(this._mouseDistanceMet(_5a)&&this._mouseDelayMet(_5a)){
this._mouseStarted=(this._mouseStart(_5a)!==false);
if(!this._mouseStarted){
_5a.preventDefault();
return true;
}
}
this._mouseMoveDelegate=function(_5e){
return _5b._mouseMove(_5e);
};
this._mouseUpDelegate=function(_5f){
return _5b._mouseUp(_5f);
};
$(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);
($.browser.safari||_5a.preventDefault());
_5a.originalEvent.mouseHandled=true;
return true;
},_mouseMove:function(_60){
if($.browser.msie&&!_60.button){
return this._mouseUp(_60);
}
if(this._mouseStarted){
this._mouseDrag(_60);
return _60.preventDefault();
}
if(this._mouseDistanceMet(_60)&&this._mouseDelayMet(_60)){
this._mouseStarted=(this._mouseStart(this._mouseDownEvent,_60)!==false);
(this._mouseStarted?this._mouseDrag(_60):this._mouseUp(_60));
}
return !this._mouseStarted;
},_mouseUp:function(_61){
$(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);
if(this._mouseStarted){
this._mouseStarted=false;
this._preventClickEvent=(_61.target==this._mouseDownEvent.target);
this._mouseStop(_61);
}
return false;
},_mouseDistanceMet:function(_62){
return (Math.max(Math.abs(this._mouseDownEvent.pageX-_62.pageX),Math.abs(this._mouseDownEvent.pageY-_62.pageY))>=this.options.distance);
},_mouseDelayMet:function(_63){
return this.mouseDelayMet;
},_mouseStart:function(_64){
},_mouseDrag:function(_65){
},_mouseStop:function(_66){
},_mouseCapture:function(_67){
return true;
}};
$.ui.mouse.defaults={cancel:null,distance:1,delay:0};
})(jQuery);
(function($){
$.widget("ui.draggable",$.extend({},$.ui.mouse,{_init:function(){
if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){
this.element[0].style.position="relative";
}
(this.options.addClasses&&this.element.addClass("ui-draggable"));
(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));
this._mouseInit();
},destroy:function(){
if(!this.element.data("draggable")){
return;
}
this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable"+" ui-draggable-dragging"+" ui-draggable-disabled");
this._mouseDestroy();
},_mouseCapture:function(_69){
var o=this.options;
if(this.helper||o.disabled||$(_69.target).is(".ui-resizable-handle")){
return false;
}
this.handle=this._getHandle(_69);
if(!this.handle){
return false;
}
return true;
},_mouseStart:function(_6b){
var o=this.options;
this.helper=this._createHelper(_6b);
this._cacheHelperProportions();
if($.ui.ddmanager){
$.ui.ddmanager.current=this;
}
this._cacheMargins();
this.cssPosition=this.helper.css("position");
this.scrollParent=this.helper.scrollParent();
this.offset=this.element.offset();
this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};
$.extend(this.offset,{click:{left:_6b.pageX-this.offset.left,top:_6b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});
this.originalPosition=this._generatePosition(_6b);
this.originalPageX=_6b.pageX;
this.originalPageY=_6b.pageY;
if(o.cursorAt){
this._adjustOffsetFromHelper(o.cursorAt);
}
if(o.containment){
this._setContainment();
}
this._trigger("start",_6b);
this._cacheHelperProportions();
if($.ui.ddmanager&&!o.dropBehaviour){
$.ui.ddmanager.prepareOffsets(this,_6b);
}
this.helper.addClass("ui-draggable-dragging");
this._mouseDrag(_6b,true);
return true;
},_mouseDrag:function(_6d,_6e){
this.position=this._generatePosition(_6d);
this.positionAbs=this._convertPositionTo("absolute");
if(!_6e){
var ui=this._uiHash();
this._trigger("drag",_6d,ui);
this.position=ui.position;
}
if(!this.options.axis||this.options.axis!="y"){
this.helper[0].style.left=this.position.left+"px";
}
if(!this.options.axis||this.options.axis!="x"){
this.helper[0].style.top=this.position.top+"px";
}
if($.ui.ddmanager){
$.ui.ddmanager.drag(this,_6d);
}
return false;
},_mouseStop:function(_70){
var _71=false;
if($.ui.ddmanager&&!this.options.dropBehaviour){
_71=$.ui.ddmanager.drop(this,_70);
}
if(this.dropped){
_71=this.dropped;
this.dropped=false;
}
if((this.options.revert=="invalid"&&!_71)||(this.options.revert=="valid"&&_71)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element,_71))){
var _72=this;
$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){
_72._trigger("stop",_70);
_72._clear();
});
}else{
this._trigger("stop",_70);
this._clear();
}
return false;
},_getHandle:function(_73){
var _74=!this.options.handle||!$(this.options.handle,this.element).length?true:false;
$(this.options.handle,this.element).find("*").andSelf().each(function(){
if(this==_73.target){
_74=true;
}
});
return _74;
},_createHelper:function(_75){
var o=this.options;
var _77=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[_75])):(o.helper=="clone"?this.element.clone():this.element);
if(!_77.parents("body").length){
_77.appendTo((o.appendTo=="parent"?this.element[0].parentNode:o.appendTo));
}
if(_77[0]!=this.element[0]&&!(/(fixed|absolute)/).test(_77.css("position"))){
_77.css("position","absolute");
}
return _77;
},_adjustOffsetFromHelper:function(obj){
if(obj.left!=undefined){
this.offset.click.left=obj.left+this.margins.left;
}
if(obj.right!=undefined){
this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;
}
if(obj.top!=undefined){
this.offset.click.top=obj.top+this.margins.top;
}
if(obj.bottom!=undefined){
this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;
}
},_getParentOffset:function(){
this.offsetParent=this.helper.offsetParent();
var po=this.offsetParent.offset();
if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0])){
po.left+=this.scrollParent.scrollLeft();
po.top+=this.scrollParent.scrollTop();
}
if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&$.browser.msie)){
po={top:0,left:0};
}
return {top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};
},_getRelativeOffset:function(){
if(this.cssPosition=="relative"){
var p=this.element.position();
return {top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};
}else{
return {top:0,left:0};
}
},_cacheMargins:function(){
this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};
},_cacheHelperProportions:function(){
this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};
},_setContainment:function(){
var o=this.options;
if(o.containment=="parent"){
o.containment=this.helper[0].parentNode;
}
if(o.containment=="document"||o.containment=="window"){
this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,($(o.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];
}
if(!(/^(document|window|parent)$/).test(o.containment)&&o.containment.constructor!=Array){
var ce=$(o.containment)[0];
if(!ce){
return;
}
var co=$(o.containment).offset();
var _7e=($(ce).css("overflow")!="hidden");
this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(_7e?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(_7e?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];
}else{
if(o.containment.constructor==Array){
this.containment=o.containment;
}
}
},_convertPositionTo:function(d,pos){
if(!pos){
pos=this.position;
}
var mod=d=="absolute"?1:-1;
var o=this.options,_83=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,_84=(/(html|body)/i).test(_83[0].tagName);
return {top:(pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-($.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(_84?0:_83.scrollTop()))*mod)),left:(pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-($.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():_84?0:_83.scrollLeft())*mod))};
},_generatePosition:function(_85){
var o=this.options,_87=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,_88=(/(html|body)/i).test(_87[0].tagName);
if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){
this.offset.relative=this._getRelativeOffset();
}
var _89=_85.pageX;
var _8a=_85.pageY;
if(this.originalPosition){
if(this.containment){
if(_85.pageX-this.offset.click.left<this.containment[0]){
_89=this.containment[0]+this.offset.click.left;
}
if(_85.pageY-this.offset.click.top<this.containment[1]){
_8a=this.containment[1]+this.offset.click.top;
}
if(_85.pageX-this.offset.click.left>this.containment[2]){
_89=this.containment[2]+this.offset.click.left;
}
if(_85.pageY-this.offset.click.top>this.containment[3]){
_8a=this.containment[3]+this.offset.click.top;
}
}
if(o.grid){
var top=this.originalPageY+Math.round((_8a-this.originalPageY)/o.grid[1])*o.grid[1];
_8a=this.containment?(!(top-this.offset.click.top<this.containment[1]||top-this.offset.click.top>this.containment[3])?top:(!(top-this.offset.click.top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;
var _8c=this.originalPageX+Math.round((_89-this.originalPageX)/o.grid[0])*o.grid[0];
_89=this.containment?(!(_8c-this.offset.click.left<this.containment[0]||_8c-this.offset.click.left>this.containment[2])?_8c:(!(_8c-this.offset.click.left<this.containment[0])?_8c-o.grid[0]:_8c+o.grid[0])):_8c;
}
}
return {top:(_8a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+($.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(_88?0:_87.scrollTop())))),left:(_89-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+($.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():_88?0:_87.scrollLeft())))};
},_clear:function(){
this.helper.removeClass("ui-draggable-dragging");
if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){
this.helper.remove();
}
this.helper=null;
this.cancelHelperRemoval=false;
},_trigger:function(_8d,_8e,ui){
ui=ui||this._uiHash();
$.ui.plugin.call(this,_8d,[_8e,ui]);
if(_8d=="drag"){
this.positionAbs=this._convertPositionTo("absolute");
}
return $.widget.prototype._trigger.call(this,_8d,_8e,ui);
},plugins:{},_uiHash:function(_90){
return {helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs};
}}));
$.extend($.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});
$.ui.plugin.add("draggable","connectToSortable",{start:function(_91,ui){
var _93=$(this).data("draggable"),o=_93.options,_95=$.extend({},ui,{item:_93.element});
_93.sortables=[];
$(o.connectToSortable).each(function(){
var _96=$.data(this,"sortable");
if(_96&&!_96.options.disabled){
_93.sortables.push({instance:_96,shouldRevert:_96.options.revert});
_96._refreshItems();
_96._trigger("activate",_91,_95);
}
});
},stop:function(_97,ui){
var _99=$(this).data("draggable"),_9a=$.extend({},ui,{item:_99.element});
$.each(_99.sortables,function(){
if(this.instance.isOver){
this.instance.isOver=0;
_99.cancelHelperRemoval=true;
this.instance.cancelHelperRemoval=false;
if(this.shouldRevert){
this.instance.options.revert=true;
}
this.instance._mouseStop(_97);
this.instance.options.helper=this.instance.options._helper;
if(_99.options.helper=="original"){
this.instance.currentItem.css({top:"auto",left:"auto"});
}
}else{
this.instance.cancelHelperRemoval=false;
this.instance._trigger("deactivate",_97,_9a);
}
});
},drag:function(_9b,ui){
var _9d=$(this).data("draggable"),_9e=this;
var _9f=function(o){
var _a1=this.offset.click.top,_a2=this.offset.click.left;
var _a3=this.positionAbs.top,_a4=this.positionAbs.left;
var _a5=o.height,_a6=o.width;
var _a7=o.top,_a8=o.left;
return $.ui.isOver(_a3+_a1,_a4+_a2,_a7,_a8,_a5,_a6);
};
$.each(_9d.sortables,function(i){
this.instance.positionAbs=_9d.positionAbs;
this.instance.helperProportions=_9d.helperProportions;
this.instance.offset.click=_9d.offset.click;
if(this.instance._intersectsWith(this.instance.containerCache)){
if(!this.instance.isOver){
this.instance.isOver=1;
this.instance.currentItem=$(_9e).clone().appendTo(this.instance.element).data("sortable-item",true);
this.instance.options._helper=this.instance.options.helper;
this.instance.options.helper=function(){
return ui.helper[0];
};
_9b.target=this.instance.currentItem[0];
this.instance._mouseCapture(_9b,true);
this.instance._mouseStart(_9b,true,true);
this.instance.offset.click.top=_9d.offset.click.top;
this.instance.offset.click.left=_9d.offset.click.left;
this.instance.offset.parent.left-=_9d.offset.parent.left-this.instance.offset.parent.left;
this.instance.offset.parent.top-=_9d.offset.parent.top-this.instance.offset.parent.top;
_9d._trigger("toSortable",_9b);
_9d.dropped=this.instance.element;
_9d.currentItem=_9d.element;
this.instance.fromOutside=_9d;
}
if(this.instance.currentItem){
this.instance._mouseDrag(_9b);
}
}else{
if(this.instance.isOver){
this.instance.isOver=0;
this.instance.cancelHelperRemoval=true;
this.instance.options.revert=false;
this.instance._trigger("out",_9b,this.instance._uiHash(this.instance));
this.instance._mouseStop(_9b,true);
this.instance.options.helper=this.instance.options._helper;
this.instance.currentItem.remove();
if(this.instance.placeholder){
this.instance.placeholder.remove();
}
_9d._trigger("fromSortable",_9b);
_9d.dropped=false;
}
}
});
}});
$.ui.plugin.add("draggable","cursor",{start:function(_aa,ui){
var t=$("body"),o=$(this).data("draggable").options;
if(t.css("cursor")){
o._cursor=t.css("cursor");
}
t.css("cursor",o.cursor);
},stop:function(_ae,ui){
var o=$(this).data("draggable").options;
if(o._cursor){
$("body").css("cursor",o._cursor);
}
}});
$.ui.plugin.add("draggable","iframeFix",{start:function(_b1,ui){
var o=$(this).data("draggable").options;
$(o.iframeFix===true?"iframe":o.iframeFix).each(function(){
$("<div class=\"ui-draggable-iframeFix\" style=\"background: #fff;\"></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css($(this).offset()).appendTo("body");
});
},stop:function(_b4,ui){
$("div.ui-draggable-iframeFix").each(function(){
this.parentNode.removeChild(this);
});
}});
$.ui.plugin.add("draggable","opacity",{start:function(_b6,ui){
var t=$(ui.helper),o=$(this).data("draggable").options;
if(t.css("opacity")){
o._opacity=t.css("opacity");
}
t.css("opacity",o.opacity);
},stop:function(_ba,ui){
var o=$(this).data("draggable").options;
if(o._opacity){
$(ui.helper).css("opacity",o._opacity);
}
}});
$.ui.plugin.add("draggable","scroll",{start:function(_bd,ui){
var i=$(this).data("draggable");
if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!="HTML"){
i.overflowOffset=i.scrollParent.offset();
}
},drag:function(_c0,ui){
var i=$(this).data("draggable"),o=i.options,_c4=false;
if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!="HTML"){
if(!o.axis||o.axis!="x"){
if((i.overflowOffset.top+i.scrollParent[0].offsetHeight)-_c0.pageY<o.scrollSensitivity){
i.scrollParent[0].scrollTop=_c4=i.scrollParent[0].scrollTop+o.scrollSpeed;
}else{
if(_c0.pageY-i.overflowOffset.top<o.scrollSensitivity){
i.scrollParent[0].scrollTop=_c4=i.scrollParent[0].scrollTop-o.scrollSpeed;
}
}
}
if(!o.axis||o.axis!="y"){
if((i.overflowOffset.left+i.scrollParent[0].offsetWidth)-_c0.pageX<o.scrollSensitivity){
i.scrollParent[0].scrollLeft=_c4=i.scrollParent[0].scrollLeft+o.scrollSpeed;
}else{
if(_c0.pageX-i.overflowOffset.left<o.scrollSensitivity){
i.scrollParent[0].scrollLeft=_c4=i.scrollParent[0].scrollLeft-o.scrollSpeed;
}
}
}
}else{
if(!o.axis||o.axis!="x"){
if(_c0.pageY-$(document).scrollTop()<o.scrollSensitivity){
_c4=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);
}else{
if($(window).height()-(_c0.pageY-$(document).scrollTop())<o.scrollSensitivity){
_c4=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);
}
}
}
if(!o.axis||o.axis!="y"){
if(_c0.pageX-$(document).scrollLeft()<o.scrollSensitivity){
_c4=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);
}else{
if($(window).width()-(_c0.pageX-$(document).scrollLeft())<o.scrollSensitivity){
_c4=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);
}
}
}
}
if(_c4!==false&&$.ui.ddmanager&&!o.dropBehaviour){
$.ui.ddmanager.prepareOffsets(i,_c0);
}
}});
$.ui.plugin.add("draggable","snap",{start:function(_c5,ui){
var i=$(this).data("draggable"),o=i.options;
i.snapElements=[];
$(o.snap.constructor!=String?(o.snap.items||":data(draggable)"):o.snap).each(function(){
var $t=$(this);
var $o=$t.offset();
if(this!=i.element[0]){
i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left});
}
});
},drag:function(_cb,ui){
var _cd=$(this).data("draggable"),o=_cd.options;
var d=o.snapTolerance;
var x1=ui.offset.left,x2=x1+_cd.helperProportions.width,y1=ui.offset.top,y2=y1+_cd.helperProportions.height;
for(var i=_cd.snapElements.length-1;i>=0;i--){
var l=_cd.snapElements[i].left,r=l+_cd.snapElements[i].width,t=_cd.snapElements[i].top,b=t+_cd.snapElements[i].height;
if(!((l-d<x1&&x1<r+d&&t-d<y1&&y1<b+d)||(l-d<x1&&x1<r+d&&t-d<y2&&y2<b+d)||(l-d<x2&&x2<r+d&&t-d<y1&&y1<b+d)||(l-d<x2&&x2<r+d&&t-d<y2&&y2<b+d))){
if(_cd.snapElements[i].snapping){
(_cd.options.snap.release&&_cd.options.snap.release.call(_cd.element,_cb,$.extend(_cd._uiHash(),{snapItem:_cd.snapElements[i].item})));
}
_cd.snapElements[i].snapping=false;
continue;
}
if(o.snapMode!="inner"){
var ts=Math.abs(t-y2)<=d;
var bs=Math.abs(b-y1)<=d;
var ls=Math.abs(l-x2)<=d;
var rs=Math.abs(r-x1)<=d;
if(ts){
ui.position.top=_cd._convertPositionTo("relative",{top:t-_cd.helperProportions.height,left:0}).top-_cd.margins.top;
}
if(bs){
ui.position.top=_cd._convertPositionTo("relative",{top:b,left:0}).top-_cd.margins.top;
}
if(ls){
ui.position.left=_cd._convertPositionTo("relative",{top:0,left:l-_cd.helperProportions.width}).left-_cd.margins.left;
}
if(rs){
ui.position.left=_cd._convertPositionTo("relative",{top:0,left:r}).left-_cd.margins.left;
}
}
var _dd=(ts||bs||ls||rs);
if(o.snapMode!="outer"){
var ts=Math.abs(t-y1)<=d;
var bs=Math.abs(b-y2)<=d;
var ls=Math.abs(l-x1)<=d;
var rs=Math.abs(r-x2)<=d;
if(ts){
ui.position.top=_cd._convertPositionTo("relative",{top:t,left:0}).top-_cd.margins.top;
}
if(bs){
ui.position.top=_cd._convertPositionTo("relative",{top:b-_cd.helperProportions.height,left:0}).top-_cd.margins.top;
}
if(ls){
ui.position.left=_cd._convertPositionTo("relative",{top:0,left:l}).left-_cd.margins.left;
}
if(rs){
ui.position.left=_cd._convertPositionTo("relative",{top:0,left:r-_cd.helperProportions.width}).left-_cd.margins.left;
}
}
if(!_cd.snapElements[i].snapping&&(ts||bs||ls||rs||_dd)){
(_cd.options.snap.snap&&_cd.options.snap.snap.call(_cd.element,_cb,$.extend(_cd._uiHash(),{snapItem:_cd.snapElements[i].item})));
}
_cd.snapElements[i].snapping=(ts||bs||ls||rs||_dd);
}
}});
$.ui.plugin.add("draggable","stack",{start:function(_de,ui){
var o=$(this).data("draggable").options;
var _e1=$.makeArray($(o.stack.group)).sort(function(a,b){
return (parseInt($(a).css("zIndex"),10)||o.stack.min)-(parseInt($(b).css("zIndex"),10)||o.stack.min);
});
$(_e1).each(function(i){
this.style.zIndex=o.stack.min+i;
});
this[0].style.zIndex=o.stack.min+_e1.length;
}});
$.ui.plugin.add("draggable","zIndex",{start:function(_e5,ui){
var t=$(ui.helper),o=$(this).data("draggable").options;
if(t.css("zIndex")){
o._zIndex=t.css("zIndex");
}
t.css("zIndex",o.zIndex);
},stop:function(_e9,ui){
var o=$(this).data("draggable").options;
if(o._zIndex){
$(ui.helper).css("zIndex",o._zIndex);
}
}});
})(jQuery);

