This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/vendor/plugins/jrails/javascripts/jquery-ui.js

1 line
75 KiB
JavaScript

(function(B){var H=B.fn.remove,D=B.browser.mozilla&&(parseFloat(B.browser.version)<1.9);B.ui={version:"1.6rc5",plugin:{add:function(K,J,N){var M=B.ui[K].prototype;for(var L in N){M.plugins[L]=M.plugins[L]||[];M.plugins[L].push([J,N[L]])}},call:function(J,L,K){var N=J.plugins[L];if(!N){return }for(var M=0;M<N.length;M++){if(J.options[N[M][0]]){N[M][1].apply(J.element,K)}}}},contains:function(K,J){return document.compareDocumentPosition?K.compareDocumentPosition(J)&16:K!==J&&K.contains(J)},cssCache:{},css:function(J){if(B.ui.cssCache[J]){return B.ui.cssCache[J]}var K=B('<div class="ui-gen"></div>').addClass(J).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");B.ui.cssCache[J]=!!((!(/auto|default/).test(K.css("cursor"))||(/^[1-9]/).test(K.css("height"))||(/^[1-9]/).test(K.css("width"))||!(/none/).test(K.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(K.css("backgroundColor"))));try{B("body").get(0).removeChild(K.get(0))}catch(L){}return B.ui.cssCache[J]},hasScroll:function(L,J){if(B(L).css("overflow")=="hidden"){return false}var M=(J&&J=="left")?"scrollLeft":"scrollTop",K=false;if(L[M]>0){return true}L[M]=1;K=(L[M]>0);L[M]=0;return K},isOverAxis:function(J,L,K){return(J>L)&&(J<(L+K))},isOver:function(O,J,N,M,L,K){return B.ui.isOverAxis(O,N,L)&&B.ui.isOverAxis(J,M,K)},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(D){var E=B.attr,C=B.fn.removeAttr,I="http://www.w3.org/2005/07/aaa",F=/^aria-/,G=/^wairole:/;B.attr=function(K,J,L){var M=L!==undefined;return(J=="role"?(M?E.call(this,K,J,"wairole:"+L):(E.apply(this,arguments)||"").replace(G,"")):(F.test(J)?(M?K.setAttributeNS(I,J.replace(F,"aaa:"),L):E.call(this,K,J.replace(F,"aaa:"))):E.apply(this,arguments)))};B.fn.removeAttr=function(J){return(F.test(J)?this.each(function(){this.removeAttributeNS(I,J.replace(F,""))}):C.call(this,J))}}B.fn.extend({remove:function(){B("*",this).add(this).each(function(){B(this).triggerHandler("remove")});return H.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 J;if((B.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){J=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(B.curCSS(this,"position",1))&&(/(auto|scroll)/).test(B.curCSS(this,"overflow",1)+B.curCSS(this,"overflow-y",1)+B.curCSS(this,"overflow-x",1))}).eq(0)}else{J=this.parents().filter(function(){return(/(auto|scroll)/).test(B.curCSS(this,"overflow",1)+B.curCSS(this,"overflow-y",1)+B.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!J.length?B(document):J}});B.extend(B.expr[":"],{data:function(L,K,J){return !!B.data(L,J[3])},tabbable:function(J){var L=J.nodeName.toLowerCase();function K(M){return !(B(M).is(":hidden")||B(M).parents(":hidden").length)}return(J.tabIndex>=0&&(("a"==L&&J.href)||(/input|select|textarea|button/.test(L)&&"hidden"!=J.type&&!J.disabled))&&K(J))}});function A(N,J,O,M){function L(Q){var P=B[N][J][Q]||[];return(typeof P=="string"?P.split(/,?\s+/):P)}var K=L("getter");if(M.length==1&&typeof M[0]=="string"){K=K.concat(L("getterSetter"))}return(B.inArray(O,K)!=-1)}B.widget=function(J,K){var L=J.split(".")[0];J=J.split(".")[1];B.fn[J]=function(P){var N=(typeof P=="string"),O=Array.prototype.slice.call(arguments,1);if(N&&P.substring(0,1)=="_"){return this}if(N&&A(L,J,P,O)){var M=B.data(this[0],J);return(M?M[P].apply(M,O):undefined)}return this.each(function(){var Q=B.data(this,J);(!Q&&!N&&B.data(this,J,new B[L][J](this,P)));(Q&&N&&B.isFunction(Q[P])&&Q[P].apply(Q,O))})};B[L]=B[L]||{};B[L][J]=function(N,O){var M=this;this.namespace=L;this.widgetName=J;this.widgetEventPrefix=B[L][J].eventPrefix||J;this.widgetBaseClass=L+"-"+J;this.options=B.extend({},B.widget.defaults,B[L][J].defaults,B.metadata&&B.metadata.get(N)[J],O);this.element=B(N).bind("setData."+J,function(Q,P,R){if(Q.target==N){return M._setData(P,R)}}).bind("getData."+J,function(Q,P){if(Q.target==N){return M._getData(P)}}).bind("remove",function(){return M.destroy()});this._init()};B[L][J].prototype=B.extend({},B.widget.prototype,K);B[L][J].getterSetter="option"};B.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(L,M){var K=L,J=this;if(typeof L=="string"){if(M===undefined){return this._getData(L)}K={};K[L]=M}B.each(K,function(N,O){J._setData(N,O)})},_getData:function(J){return this.options[J]},_setData:function(J,K){this.options[J]=K;if(J=="disabled"){this.element[K?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",K)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(K,L,M){var N=this.options[K],J=(K==this.widgetEventPrefix?K:this.widgetEventPrefix+K);L=B.Event(L);L.type=J;this.element.trigger(L,M);return !(B.isFunction(N)&&N.call(this.element[0],L,M)===false||L.isDefaultPrevented())}};B.widget.defaults={disabled:false};B.ui.mouse={_mouseInit:function(){var J=this;this.element.bind("mousedown."+this.widgetName,function(K){return J._mouseDown(K)}).bind("click."+this.widgetName,function(K){if(J._preventClickEvent){J._preventClickEvent=false;return false}});if(B.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(B.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(L){(this._mouseStarted&&this._mouseUp(L));this._mouseDownEvent=L;var J=this,M=(L.which==1),K=(typeof this.options.cancel=="string"?B(L.target).parents().add(L.target).filter(this.options.cancel).length:false);if(!M||K||!this._mouseCapture(L)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){J.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(L)&&this._mouseDelayMet(L)){this._mouseStarted=(this._mouseStart(L)!==false);if(!this._mouseStarted){L.preventDefault();return true}}this._mouseMoveDelegate=function(N){return J._mouseMove(N)};this._mouseUpDelegate=function(N){return J._mouseUp(N)};B(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(B.browser.safari||L.preventDefault());return true},_mouseMove:function(J){if(B.browser.msie&&!J.button){return this._mouseUp(J)}if(this._mouseStarted){this._mouseDrag(J);return J.preventDefault()}if(this._mouseDistanceMet(J)&&this._mouseDelayMet(J)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,J)!==false);(this._mouseStarted?this._mouseDrag(J):this._mouseUp(J))}return !this._mouseStarted},_mouseUp:function(J){B(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=true;this._mouseStop(J)}return false},_mouseDistanceMet:function(J){return(Math.max(Math.abs(this._mouseDownEvent.pageX-J.pageX),Math.abs(this._mouseDownEvent.pageY-J.pageY))>=this.options.distance)},_mouseDelayMet:function(J){return this.mouseDelayMet},_mouseStart:function(J){},_mouseDrag:function(J){},_mouseStop:function(J){},_mouseCapture:function(J){return true}};B.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(A){A.widget("ui.draggable",A.extend({},A.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.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-draggable"));(this.options.disabled&&this.element.addClass(this.options.cssNamespace+"-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return }this.element.removeData("draggable").unbind(".draggable").removeClass(this.options.cssNamespace+"-draggable "+this.options.cssNamespace+"-draggable-dragging "+this.options.cssNamespace+"-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(B){var C=this.options;if(this.helper||C.disabled||A(B.target).is("."+this.options.cssNamespace+"-resizable-handle")){return false}this.handle=this._getHandle(B);if(!this.handle){return false}return true},_mouseStart:function(B){var C=this.options;this.helper=this._createHelper(B);this._cacheHelperProportions();if(A.ui.ddmanager){A.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};A.extend(this.offset,{click:{left:B.pageX-this.offset.left,top:B.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(B);this.originalPageX=B.pageX;this.originalPageY=B.pageY;if(C.cursorAt){this._adjustOffsetFromHelper(C.cursorAt)}if(C.containment){this._setContainment()}this._trigger("start",B);this._cacheHelperProportions();if(A.ui.ddmanager&&!C.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,B)}this.helper.addClass(C.cssNamespace+"-draggable-dragging");this._mouseDrag(B,true);return true},_mouseDrag:function(B,D){this.position=this._generatePosition(B);this.positionAbs=this._convertPositionTo("absolute");if(!D){var C=this._uiHash();this._trigger("drag",B,C);this.position=C.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(A.ui.ddmanager){A.ui.ddmanager.drag(this,B)}return false},_mouseStop:function(C){var D=false;if(A.ui.ddmanager&&!this.options.dropBehaviour){D=A.ui.ddmanager.drop(this,C)}if(this.dropped){D=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!D)||(this.options.revert=="valid"&&D)||this.options.revert===true||(A.isFunction(this.options.revert)&&this.options.revert.call(this.element,D))){var B=this;A(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){B._trigger("stop",C);B._clear()})}else{this._trigger("stop",C);this._clear()}return false},_getHandle:function(C){var B=!this.options.handle||!A(this.options.handle,this.element).length?true:false;A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==C.target){B=true}});return B},_createHelper:function(C){var D=this.options;var B=A.isFunction(D.helper)?A(D.helper.apply(this.element[0],[C])):(D.helper=="clone"?this.element.clone():this.element);if(!B.parents("body").length){B.appendTo((D.appendTo=="parent"?this.element[0].parentNode:D.appendTo))}if(B[0]!=this.element[0]&&!(/(fixed|absolute)/).test(B.css("position"))){B.css("position","absolute")}return B},_adjustOffsetFromHelper:function(B){if(B.left!=undefined){this.offset.click.left=B.left+this.margins.left}if(B.right!=undefined){this.offset.click.left=this.helperProportions.width-B.right+this.margins.left}if(B.top!=undefined){this.offset.click.top=B.top+this.margins.top}if(B.bottom!=undefined){this.offset.click.top=this.helperProportions.height-B.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0])){B.left+=this.scrollParent.scrollLeft();B.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body&&A.browser.mozilla)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&A.browser.msie)){B={top:0,left:0}}return{top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var B=this.element.position();return{top:B.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:B.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 E=this.options;if(E.containment=="parent"){E.containment=this.helper[0].parentNode}if(E.containment=="document"||E.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(E.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(A(E.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(E.containment)){var C=A(E.containment)[0];var D=A(E.containment).offset();var B=(A(C).css("overflow")!="hidden");this.containment=[D.left+(parseInt(A(C).css("borderLeftWidth"),10)||0)-this.margins.left,D.top+(parseInt(A(C).css("borderTopWidth"),10)||0)-this.margins.top,D.left+(B?Math.max(C.scrollWidth,C.offsetWidth):C.offsetWidth)-(parseInt(A(C).css("borderLeftWidth"),10)||0)-this.helperProportions.width-this.margins.left,D.top+(B?Math.max(C.scrollHeight,C.offsetHeight):C.offsetHeight)-(parseInt(A(C).css("borderTopWidth"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(E,G){if(!G){G=this.position}var B=E=="absolute"?1:-1;var D=this.options,C=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,F=(/(html|body)/i).test(C[0].tagName);return{top:(G.top+this.offset.relative.top*B+this.offset.parent.top*B-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(F?0:C.scrollTop()))*B),left:(G.left+this.offset.relative.left*B+this.offset.parent.left*B-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():F?0:C.scrollLeft())*B)}},_generatePosition:function(D){var H=this.options,E=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,I=(/(html|body)/i).test(E[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var C=D.pageX;var B=D.pageY;if(this.originalPosition){if(this.containment){if(D.pageX-this.offset.click.left<this.containment[0]){C=this.containment[0]+this.offset.click.left}if(D.pageY-this.offset.click.top<this.containment[1]){B=this.containment[1]+this.offset.click.top}if(D.pageX-this.offset.click.left>this.containment[2]){C=this.containment[2]+this.offset.click.left}if(D.pageY-this.offset.click.top>this.containment[3]){B=this.containment[3]+this.offset.click.top}}if(H.grid){var G=this.originalPageY+Math.round((B-this.originalPageY)/H.grid[1])*H.grid[1];B=this.containment?(!(G-this.offset.click.top<this.containment[1]||G-this.offset.click.top>this.containment[3])?G:(!(G-this.offset.click.top<this.containment[1])?G-H.grid[1]:G+H.grid[1])):G;var F=this.originalPageX+Math.round((C-this.originalPageX)/H.grid[0])*H.grid[0];C=this.containment?(!(F-this.offset.click.left<this.containment[0]||F-this.offset.click.left>this.containment[2])?F:(!(F-this.offset.click.left<this.containment[0])?F-H.grid[0]:F+H.grid[0])):F}}return{top:(B-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(I?0:E.scrollTop()))),left:(C-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():I?0:E.scrollLeft()))}},_clear:function(){this.helper.removeClass(this.options.cssNamespace+"-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(B,C,D){D=D||this._uiHash();A.ui.plugin.call(this,B,[C,D]);if(B=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return A.widget.prototype._trigger.call(this,B,C,D)},plugins:{},_uiHash:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options}}}));A.extend(A.ui.draggable,{version:"1.6rc5",eventPrefix:"drag",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cssNamespace:"ui",cursor:"default",cursorAt:null,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:null,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:null}});A.ui.plugin.add("draggable","connectToSortable",{start:function(B,D){var C=A(this).data("draggable");C.sortables=[];A(D.options.connectToSortable).each(function(){A(this+"").each(function(){if(A.data(this,"sortable")){var E=A.data(this,"sortable");C.sortables.push({instance:E,shouldRevert:E.options.revert});E._refreshItems();E._trigger("activate",B,C)}})})},stop:function(B,D){var C=A(this).data("draggable");A.each(C.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;C.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(B);this.instance.element.triggerHandler("sortreceive",[B,A.extend(this.instance._uiHash(),{sender:C.element})],this.instance.options.receive);this.instance.options.helper=this.instance.options._helper;if(C.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",B,C)}})},drag:function(C,F){var E=A(this).data("draggable"),B=this;var D=function(I){var O=this.offset.click.top,M=this.offset.click.left;var G=this.positionAbs.top,K=this.positionAbs.left;var J=I.height,L=I.width;var N=I.top,H=I.left;return A.ui.isOver(G+O,K+M,N,H,J,L)};A.each(E.sortables,function(G){if(D.call(E,this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=A(B).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return F.helper[0]};C.target=this.instance.currentItem[0];this.instance._mouseCapture(C,true);this.instance._mouseStart(C,true,true);this.instance.offset.click.top=E.offset.click.top;this.instance.offset.click.left=E.offset.click.left;this.instance.offset.parent.left-=E.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=E.offset.parent.top-this.instance.offset.parent.top;E._trigger("toSortable",C);E.dropped=this.instance.element;this.instance.fromOutside=true}if(this.instance.currentItem){this.instance._mouseDrag(C)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._mouseStop(C,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}E._trigger("fromSortable",C);E.dropped=false}}})}});A.ui.plugin.add("draggable","cursor",{start:function(C,D){var B=A("body");if(B.css("cursor")){D.options._cursor=B.css("cursor")}B.css("cursor",D.options.cursor)},stop:function(B,C){if(C.options._cursor){A("body").css("cursor",C.options._cursor)}}});A.ui.plugin.add("draggable","iframeFix",{start:function(B,C){A(C.options.iframeFix===true?"iframe":C.options.iframeFix).each(function(){A('<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(A(this).offset()).appendTo("body")})},stop:function(B,C){A("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});A.ui.plugin.add("draggable","opacity",{start:function(C,D){var B=A(D.helper);if(B.css("opacity")){D.options._opacity=B.css("opacity")}B.css("opacity",D.options.opacity)},stop:function(B,C){if(C.options._opacity){A(C.helper).css("opacity",C.options._opacity)}}});A.ui.plugin.add("draggable","scroll",{start:function(C,D){var E=D.options;var B=A(this).data("draggable");if(B.scrollParent[0]!=document&&B.scrollParent[0].tagName!="HTML"){B.overflowOffset=B.scrollParent.offset()}},drag:function(D,E){var F=E.options,C=false;var B=A(this).data("draggable");if(B.scrollParent[0]!=document&&B.scrollParent[0].tagName!="HTML"){if((B.overflowOffset.top+B.scrollParent[0].offsetHeight)-D.pageY<F.scrollSensitivity){B.scrollParent[0].scrollTop=C=B.scrollParent[0].scrollTop+F.scrollSpeed}else{if(D.pageY-B.overflowOffset.top<F.scrollSensitivity){B.scrollParent[0].scrollTop=C=B.scrollParent[0].scrollTop-F.scrollSpeed}}if((B.overflowOffset.left+B.scrollParent[0].offsetWidth)-D.pageX<F.scrollSensitivity){B.scrollParent[0].scrollLeft=C=B.scrollParent[0].scrollLeft+F.scrollSpeed}else{if(D.pageX-B.overflowOffset.left<F.scrollSensitivity){B.scrollParent[0].scrollLeft=C=B.scrollParent[0].scrollLeft-F.scrollSpeed}}}else{if(D.pageY-A(document).scrollTop()<F.scrollSensitivity){C=A(document).scrollTop(A(document).scrollTop()-F.scrollSpeed)}else{if(A(window).height()-(D.pageY-A(document).scrollTop())<F.scrollSensitivity){C=A(document).scrollTop(A(document).scrollTop()+F.scrollSpeed)}}if(D.pageX-A(document).scrollLeft()<F.scrollSensitivity){C=A(document).scrollLeft(A(document).scrollLeft()-F.scrollSpeed)}else{if(A(window).width()-(D.pageX-A(document).scrollLeft())<F.scrollSensitivity){C=A(document).scrollLeft(A(document).scrollLeft()+F.scrollSpeed)}}}if(C!==false&&A.ui.ddmanager&&!F.dropBehaviour){A.ui.ddmanager.prepareOffsets(B,D)}}});A.ui.plugin.add("draggable","snap",{start:function(B,D){var C=A(this).data("draggable");C.snapElements=[];A(D.options.snap.constructor!=String?(D.options.snap.items||":data(draggable)"):D.options.snap).each(function(){var F=A(this);var E=F.offset();if(this!=C.element[0]){C.snapElements.push({item:this,width:F.outerWidth(),height:F.outerHeight(),top:E.top,left:E.left})}})},drag:function(M,K){var E=A(this).data("draggable");var Q=K.options.snapTolerance;var P=K.absolutePosition.left,O=P+E.helperProportions.width,D=K.absolutePosition.top,C=D+E.helperProportions.height;for(var N=E.snapElements.length-1;N>=0;N--){var L=E.snapElements[N].left,J=L+E.snapElements[N].width,I=E.snapElements[N].top,R=I+E.snapElements[N].height;if(!((L-Q<P&&P<J+Q&&I-Q<D&&D<R+Q)||(L-Q<P&&P<J+Q&&I-Q<C&&C<R+Q)||(L-Q<O&&O<J+Q&&I-Q<D&&D<R+Q)||(L-Q<O&&O<J+Q&&I-Q<C&&C<R+Q))){if(E.snapElements[N].snapping){(E.options.snap.release&&E.options.snap.release.call(E.element,M,A.extend(E._uiHash(),{snapItem:E.snapElements[N].item})))}E.snapElements[N].snapping=false;continue}if(K.options.snapMode!="inner"){var B=Math.abs(I-C)<=Q;var S=Math.abs(R-D)<=Q;var G=Math.abs(L-O)<=Q;var H=Math.abs(J-P)<=Q;if(B){K.position.top=E._convertPositionTo("relative",{top:I-E.helperProportions.height,left:0}).top}if(S){K.position.top=E._convertPositionTo("relative",{top:R,left:0}).top}if(G){K.position.left=E._convertPositionTo("relative",{top:0,left:L-E.helperProportions.width}).left}if(H){K.position.left=E._convertPositionTo("relative",{top:0,left:J}).left}}var F=(B||S||G||H);if(K.options.snapMode!="outer"){var B=Math.abs(I-D)<=Q;var S=Math.abs(R-C)<=Q;var G=Math.abs(L-P)<=Q;var H=Math.abs(J-O)<=Q;if(B){K.position.top=E._convertPositionTo("relative",{top:I,left:0}).top}if(S){K.position.top=E._convertPositionTo("relative",{top:R-E.helperProportions.height,left:0}).top}if(G){K.position.left=E._convertPositionTo("relative",{top:0,left:L}).left}if(H){K.position.left=E._convertPositionTo("relative",{top:0,left:J-E.helperProportions.width}).left}}if(!E.snapElements[N].snapping&&(B||S||G||H||F)){(E.options.snap.snap&&E.options.snap.snap.call(E.element,M,A.extend(E._uiHash(),{snapItem:E.snapElements[N].item})))}E.snapElements[N].snapping=(B||S||G||H||F)}}});A.ui.plugin.add("draggable","stack",{start:function(B,C){var D=A.makeArray(A(C.options.stack.group)).sort(function(F,E){return(parseInt(A(F).css("zIndex"),10)||C.options.stack.min)-(parseInt(A(E).css("zIndex"),10)||C.options.stack.min)});A(D).each(function(E){this.style.zIndex=C.options.stack.min+E});this[0].style.zIndex=C.options.stack.min+D.length}});A.ui.plugin.add("draggable","zIndex",{start:function(C,D){var B=A(D.helper);if(B.css("zIndex")){D.options._zIndex=B.css("zIndex")}B.css("zIndex",D.options.zIndex)},stop:function(B,C){if(C.options._zIndex){A(C.helper).css("zIndex",C.options._zIndex)}}})})(jQuery);(function(A){A.widget("ui.droppable",{_init:function(){var C=this.options,B=C.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&A.isFunction(this.options.accept)?this.options.accept:function(D){return D.is(B)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};A.ui.ddmanager.droppables[this.options.scope]=A.ui.ddmanager.droppables[this.options.scope]||[];A.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-droppable"))},destroy:function(){var B=A.ui.ddmanager.droppables[this.options.scope];for(var C=0;C<B.length;C++){if(B[C]==this){B.splice(C,1)}}this.element.removeClass(this.options.cssNamespace+"-droppable "+this.options.cssNamespace+"-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(B,C){if(B=="accept"){this.options.accept=C&&A.isFunction(C)?C:function(D){return D.is(accept)}}else{A.widget.prototype._setData.apply(this,arguments)}},_activate:function(B){var C=A.ui.ddmanager.current;A.ui.plugin.call(this,"activate",[B,this.ui(C)]);(C&&this._trigger("activate",B,this.ui(C)))},_deactivate:function(B){var C=A.ui.ddmanager.current;A.ui.plugin.call(this,"deactivate",[B,this.ui(C)]);(C&&this._trigger("deactivate",B,this.ui(C)))},_over:function(B){var C=A.ui.ddmanager.current;if(!C||(C.currentItem||C.element)[0]==this.element[0]){return }if(this.options.accept.call(this.element,(C.currentItem||C.element))){A.ui.plugin.call(this,"over",[B,this.ui(C)]);this._trigger("over",B,this.ui(C))}},_out:function(B){var C=A.ui.ddmanager.current;if(!C||(C.currentItem||C.element)[0]==this.element[0]){return }if(this.options.accept.call(this.element,(C.currentItem||C.element))){A.ui.plugin.call(this,"out",[B,this.ui(C)]);this._trigger("out",B,this.ui(C))}},_drop:function(C,B){var D=B||A.ui.ddmanager.current;if(!D||(D.currentItem||D.element)[0]==this.element[0]){return false}var E=false;this.element.find(":data(droppable)").not("."+D.options.cssNamespace+"-draggable-dragging").each(function(){var F=A.data(this,"droppable");if(F.options.greedy&&A.ui.intersect(D,A.extend(F,{offset:F.element.offset()}),F.options.tolerance)){E=true;return false}});if(E){return false}if(this.options.accept.call(this.element,(D.currentItem||D.element))){A.ui.plugin.call(this,"drop",[C,this.ui(D)]);this._trigger("drop",C,this.ui(D));return this.element}return false},plugins:{},ui:function(B){return{draggable:(B.currentItem||B.element),helper:B.helper,position:B.position,absolutePosition:B.positionAbs,options:this.options,element:this.element}}});A.extend(A.ui.droppable,{version:"1.6rc5",eventPrefix:"drop",defaults:{accept:"*",activeClass:null,cssNamespace:"ui",greedy:false,hoverClass:null,scope:"default",tolerance:"intersect"}});A.ui.intersect=function(L,E,M){if(!E.offset){return false}var D=(L.positionAbs||L.position.absolute).left,C=D+L.helperProportions.width,N=(L.positionAbs||L.position.absolute).top,K=N+L.helperProportions.height;var F=E.offset.left,B=F+E.proportions.width,O=E.offset.top,J=O+E.proportions.height;switch(M){case"fit":return(F<D&&C<B&&O<N&&K<J);break;case"intersect":return(F<D+(L.helperProportions.width/2)&&C-(L.helperProportions.width/2)<B&&O<N+(L.helperProportions.height/2)&&K-(L.helperProportions.height/2)<J);break;case"pointer":var G=((L.positionAbs||L.position.absolute).left+(L.clickOffset||L.offset.click).left),H=((L.positionAbs||L.position.absolute).top+(L.clickOffset||L.offset.click).top),I=A.ui.isOver(H,G,O,F,E.proportions.height,E.proportions.width);return I;break;case"touch":return((N>=O&&N<=J)||(K>=O&&K<=J)||(N<O&&K>J))&&((D>=F&&D<=B)||(C>=F&&C<=B)||(D<F&&C>B));break;default:return false;break}};A.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(E,G){var B=A.ui.ddmanager.droppables[E.options.scope];var F=G?G.type:null;var H=(E.currentItem||E.element).find(":data(droppable)").andSelf();droppablesLoop:for(var D=0;D<B.length;D++){if(B[D].options.disabled||(E&&!B[D].options.accept.call(B[D].element,(E.currentItem||E.element)))){continue}for(var C=0;C<H.length;C++){if(H[C]==B[D].element[0]){B[D].proportions.height=0;continue droppablesLoop}}B[D].visible=B[D].element.css("display")!="none";if(!B[D].visible){continue}B[D].offset=B[D].element.offset();B[D].proportions={width:B[D].element[0].offsetWidth,height:B[D].element[0].offsetHeight};if(F=="dragstart"||F=="sortactivate"){B[D]._activate.call(B[D],G)}}},drop:function(C,B){var D=false;A.each(A.ui.ddmanager.droppables[C.options.scope],function(){if(!this.options){return }if(!this.options.disabled&&this.visible&&A.ui.intersect(C,this,this.options.tolerance)){D=this._drop.call(this,B)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element,(C.currentItem||C.element))){this.isout=1;this.isover=0;this._deactivate.call(this,B)}});return D},drag:function(C,B){if(C.options.refreshPositions){A.ui.ddmanager.prepareOffsets(C,B)}A.each(A.ui.ddmanager.droppables[C.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible){return }var D=A.ui.intersect(C,this,this.options.tolerance);var G=!D&&this.isover==1?"isout":(D&&this.isover==0?"isover":null);if(!G){return }var F;if(this.options.greedy){var E=this.element.parents(":data(droppable):eq(0)");if(E.length){F=A.data(E[0],"droppable");F.greedyChild=(G=="isover"?1:0)}}if(F&&G=="isover"){F.isover=0;F.isout=1;F._out.call(F,B)}this[G]=1;this[G=="isout"?"isover":"isout"]=0;this[G=="isover"?"_over":"_out"].call(this,B);if(F&&G=="isout"){F.isout=0;F.isover=1;F._over.call(F,B)}})}};A.ui.plugin.add("droppable","activeClass",{activate:function(B,C){A(this).addClass(C.options.activeClass)},deactivate:function(B,C){A(this).removeClass(C.options.activeClass)},drop:function(B,C){A(this).removeClass(C.options.activeClass)}});A.ui.plugin.add("droppable","hoverClass",{over:function(B,C){A(this).addClass(C.options.hoverClass)},out:function(B,C){A(this).removeClass(C.options.hoverClass)},drop:function(B,C){A(this).removeClass(C.options.hoverClass)}})})(jQuery);(function(A){A.widget("ui.sortable",A.extend({},A.ui.mouse,{_init:function(){var B=this.options;this.containerCache={};(this.options.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-sortable"));this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass(this.options.cssNamespace+"-sortable "+this.options.cssNamespace+"-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var B=this.items.length-1;B>=0;B--){this.items[B].item.removeData("sortable-item")}},_mouseCapture:function(F,B){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(F);var E=null,D=this,C=A(F.target).parents().each(function(){if(A.data(this,"sortable-item")==D){E=A(this);return false}});if(A.data(F.target,"sortable-item")==D){E=A(F.target)}if(!E){return false}if(this.options.handle&&!B){var G=false;A(this.options.handle,E).find("*").andSelf().each(function(){if(this==F.target){G=true}});if(!G){return false}}this.currentItem=E;this._removeCurrentsFromItems();return true},_mouseStart:function(E,B,D){var F=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(E);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");A.extend(this.offset,{click:{left:E.pageX-this.offset.left,top:E.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(E);this.originalPageX=E.pageX;this.originalPageY=E.pageY;if(F.cursorAt){this._adjustOffsetFromHelper(F.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(F.containment){this._setContainment()}this._trigger("start",E);if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!D){for(var C=this.containers.length-1;C>=0;C--){this.containers[C]._trigger("activate",E,this)}}if(A.ui.ddmanager){A.ui.ddmanager.current=this}if(A.ui.ddmanager&&!F.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,E)}this.dragging=true;this.helper.addClass(F.cssNamespace+"-sortable-helper");this._mouseDrag(E);return true},_mouseDrag:function(E){this.position=this._generatePosition(E);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}A.ui.plugin.call(this,"sort",[E,this._uiHash()]);this.positionAbs=this._convertPositionTo("absolute");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"}for(var C=this.items.length-1;C>=0;C--){var D=this.items[C],B=D.item[0],F=this._intersectsWithPointer(D);if(!F){continue}if(B!=this.currentItem[0]&&this.placeholder[F==1?"next":"prev"]()[0]!=B&&!A.ui.contains(this.placeholder[0],B)&&(this.options.type=="semi-dynamic"?!A.ui.contains(this.element[0],B):true)){this.direction=F==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(D)){this.options.sortIndicator.call(this,E,D)}else{break}this._trigger("change",E);break}}this._contactContainers(E);if(A.ui.ddmanager){A.ui.ddmanager.drag(this,E)}this._trigger("sort",E);this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(C,E){if(!C){return }if(A.ui.ddmanager&&!this.options.dropBehaviour){A.ui.ddmanager.drop(this,C)}if(this.options.revert){var B=this;var D=B.placeholder.offset();B.reverting=true;A(this.helper).animate({left:D.left-this.offset.parent.left-B.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:D.top-this.offset.parent.top-B.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){B._clear(C)})}else{this._clear(C,E)}return false},cancel:function(){if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass(this.options.cssNamespace+"-sortable-helper")}else{this.currentItem.show()}for(var B=this.containers.length-1;B>=0;B--){this.containers[B]._trigger("deactivate",null,this);if(this.containers[B].containerCache.over){this.containers[B]._trigger("out",null,this);this.containers[B].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}A.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){A(this.domPosition.prev).after(this.currentItem)}else{A(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(D){var B=this._getItemsAsjQuery(D&&D.connected);var C=[];D=D||{};A(B).each(function(){var E=(A(D.item||this).attr(D.attribute||"id")||"").match(D.expression||(/(.+)[-=_](.+)/));if(E){C.push((D.key||E[1]+"[]")+"="+(D.key&&D.expression?E[1]:E[2]))}});return C.join("&")},toArray:function(D){var B=this._getItemsAsjQuery(D&&D.connected);var C=[];D=D||{};B.each(function(){C.push(A(D.item||this).attr(D.attribute||"id")||"")});return C},_intersectsWith:function(L){var D=this.positionAbs.left,C=D+this.helperProportions.width,J=this.positionAbs.top,I=J+this.helperProportions.height;var E=L.left,B=E+L.width,K=L.top,H=K+L.height;var M=this.offset.click.top,G=this.offset.click.left;var F=(J+M)>K&&(J+M)<H&&(D+G)>E&&(D+G)<B;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>L[this.floating?"width":"height"])){return F}else{return(E<D+(this.helperProportions.width/2)&&C-(this.helperProportions.width/2)<B&&K<J+(this.helperProportions.height/2)&&I-(this.helperProportions.height/2)<H)}},_intersectsWithPointer:function(D){var G=A.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,D.top,D.height),C=A.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,D.left,D.width),F=G&&C,B=this._getDragVerticalDirection(),E=this._getDragHorizontalDirection();if(!F){return false}return this.floating?(((E&&E=="right")||B=="down")?2:1):(B&&(B=="down"?2:1))},_intersectsWithSides:function(E){var D=A.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,E.top+(E.height/2),E.height),C=A.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,E.left+(E.width/2),E.width),B=this._getDragVerticalDirection(),F=this._getDragHorizontalDirection();if(this.floating&&F){return((F=="right"&&C)||(F=="left"&&!C))}else{return B&&((B=="down"&&D)||(B=="up"&&!D))}},_getDragVerticalDirection:function(){var B=this.positionAbs.top-this.lastPositionAbs.top;return B!=0&&(B>0?"down":"up")},_getDragHorizontalDirection:function(){var B=this.positionAbs.left-this.lastPositionAbs.left;return B!=0&&(B>0?"right":"left")},refresh:function(B){this._refreshItems(B);this.refreshPositions()},_getItemsAsjQuery:function(B){var D=this;var C=[];var F=[];if(this.options.connectWith&&B){for(var G=this.options.connectWith.length-1;G>=0;G--){var I=A(this.options.connectWith[G]);for(var E=I.length-1;E>=0;E--){var H=A.data(I[E],"sortable");if(H&&H!=this&&!H.options.disabled){F.push([A.isFunction(H.options.items)?H.options.items.call(H.element):A(H.options.items,H.element).not("."+H.options.cssNamespace+"-sortable-helper"),H])}}}}F.push([A.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):A(this.options.items,this.element).not("."+this.options.cssNamespace+"-sortable-helper"),this]);for(var G=F.length-1;G>=0;G--){F[G][0].each(function(){C.push(this)})}return A(C)},_removeCurrentsFromItems:function(){var D=this.currentItem.find(":data(sortable-item)");for(var C=0;C<this.items.length;C++){for(var B=0;B<D.length;B++){if(D[B]==this.items[C].item[0]){this.items.splice(C,1)}}}},_refreshItems:function(B){this.items=[];this.containers=[this];var H=this.items;var M=this;var E=[[A.isFunction(this.options.items)?this.options.items.call(this.element[0],B,{item:this.currentItem}):A(this.options.items,this.element),this]];if(this.options.connectWith){for(var F=this.options.connectWith.length-1;F>=0;F--){var J=A(this.options.connectWith[F]);for(var D=J.length-1;D>=0;D--){var G=A.data(J[D],"sortable");if(G&&G!=this&&!G.options.disabled){E.push([A.isFunction(G.options.items)?G.options.items.call(G.element[0],B,{item:this.currentItem}):A(G.options.items,G.element),G]);this.containers.push(G)}}}}for(var F=E.length-1;F>=0;F--){var I=E[F][1];var C=E[F][0];for(var D=0,K=C.length;D<K;D++){var L=A(C[D]);L.data("sortable-item",I);H.push({item:L,instance:I,width:0,height:0,left:0,top:0})}}},refreshPositions:function(B){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var D=this.items.length-1;D>=0;D--){var E=this.items[D];if(E.instance!=this.currentContainer&&this.currentContainer&&E.item[0]!=this.currentItem[0]){continue}var C=this.options.toleranceElement?A(this.options.toleranceElement,E.item):E.item;if(!B){if(this.options.accurateIntersection){E.width=C.outerWidth();E.height=C.outerHeight()}else{E.width=C[0].offsetWidth;E.height=C[0].offsetHeight}}var F=C.offset();E.left=F.left;E.top=F.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var D=this.containers.length-1;D>=0;D--){var F=this.containers[D].element.offset();this.containers[D].containerCache.left=F.left;this.containers[D].containerCache.top=F.top;this.containers[D].containerCache.width=this.containers[D].element.outerWidth();this.containers[D].containerCache.height=this.containers[D].element.outerHeight()}}},_createPlaceholder:function(D){var C=D||this,E=C.options;if(!E.placeholder||E.placeholder.constructor==String){var B=E.placeholder;E.placeholder={element:function(){var F=A(document.createElement(C.currentItem[0].nodeName)).addClass(B||C.currentItem[0].className+" "+C.options.cssNamespace+"-sortable-placeholder").removeClass(C.options.cssNamespace+"-sortable-helper")[0];if(!B){F.style.visibility="hidden"}return F},update:function(F,G){if(B&&!E.forcePlaceholderSize){return }if(!G.height()){G.height(C.currentItem.innerHeight()-parseInt(C.currentItem.css("paddingTop")||0,10)-parseInt(C.currentItem.css("paddingBottom")||0,10))}if(!G.width()){G.width(C.currentItem.innerWidth()-parseInt(C.currentItem.css("paddingLeft")||0,10)-parseInt(C.currentItem.css("paddingRight")||0,10))}}}}C.placeholder=A(E.placeholder.element.call(C.element,C.currentItem));C.currentItem.after(C.placeholder);E.placeholder.update(C,C.placeholder)},_contactContainers:function(D){for(var C=this.containers.length-1;C>=0;C--){if(this._intersectsWith(this.containers[C].containerCache)){if(!this.containers[C].containerCache.over){if(this.currentContainer!=this.containers[C]){var H=10000;var G=null;var E=this.positionAbs[this.containers[C].floating?"left":"top"];for(var B=this.items.length-1;B>=0;B--){if(!A.ui.contains(this.containers[C].element[0],this.items[B].item[0])){continue}var F=this.items[B][this.containers[C].floating?"left":"top"];if(Math.abs(F-E)<H){H=Math.abs(F-E);G=this.items[B]}}if(!G&&!this.options.dropOnEmpty){continue}this.currentContainer=this.containers[C];G?this.options.sortIndicator.call(this,D,G,null,true):this.options.sortIndicator.call(this,D,null,this.containers[C].element,true);this._trigger("change",D);this.containers[C]._trigger("change",D,this);this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[C]._trigger("over",D,this);this.containers[C].containerCache.over=1}}else{if(this.containers[C].containerCache.over){this.containers[C]._trigger("out",D,this);this.containers[C].containerCache.over=0}}}},_createHelper:function(C){var D=this.options;var B=A.isFunction(D.helper)?A(D.helper.apply(this.element[0],[C,this.currentItem])):(D.helper=="clone"?this.currentItem.clone():this.currentItem);if(!B.parents("body").length){A(D.appendTo!="parent"?D.appendTo:this.currentItem[0].parentNode)[0].appendChild(B[0])}if(B[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(B[0].style.width==""||D.forceHelperSize){B.width(this.currentItem.width())}if(B[0].style.height==""||D.forceHelperSize){B.height(this.currentItem.height())}return B},_adjustOffsetFromHelper:function(B){if(B.left!=undefined){this.offset.click.left=B.left+this.margins.left}if(B.right!=undefined){this.offset.click.left=this.helperProportions.width-B.right+this.margins.left}if(B.top!=undefined){this.offset.click.top=B.top+this.margins.top}if(B.bottom!=undefined){this.offset.click.top=this.helperProportions.height-B.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0])){B.left+=this.scrollParent.scrollLeft();B.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body&&A.browser.mozilla)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&A.browser.msie)){B={top:0,left:0}}return{top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var B=this.currentItem.position();return{top:B.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:B.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var E=this.options;if(E.containment=="parent"){E.containment=this.helper[0].parentNode}if(E.containment=="document"||E.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(E.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(A(E.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(E.containment)){var C=A(E.containment)[0];var D=A(E.containment).offset();var B=(A(C).css("overflow")!="hidden");this.containment=[D.left+(parseInt(A(C).css("borderLeftWidth"),10)||0)-this.margins.left,D.top+(parseInt(A(C).css("borderTopWidth"),10)||0)-this.margins.top,D.left+(B?Math.max(C.scrollWidth,C.offsetWidth):C.offsetWidth)-(parseInt(A(C).css("borderLeftWidth"),10)||0)-this.helperProportions.width-this.margins.left,D.top+(B?Math.max(C.scrollHeight,C.offsetHeight):C.offsetHeight)-(parseInt(A(C).css("borderTopWidth"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(E,G){if(!G){G=this.position}var B=E=="absolute"?1:-1;var D=this.options,C=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,F=(/(html|body)/i).test(C[0].tagName);return{top:(G.top+this.offset.relative.top*B+this.offset.parent.top*B-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(F?0:C.scrollTop()))*B),left:(G.left+this.offset.relative.left*B+this.offset.parent.left*B-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():F?0:C.scrollLeft())*B)}},_generatePosition:function(D){var H=this.options,E=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,I=(/(html|body)/i).test(E[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var C=D.pageX;var B=D.pageY;if(this.originalPosition){if(this.containment){if(D.pageX-this.offset.click.left<this.containment[0]){C=this.containment[0]+this.offset.click.left}if(D.pageY-this.offset.click.top<this.containment[1]){B=this.containment[1]+this.offset.click.top}if(D.pageX-this.offset.click.left>this.containment[2]){C=this.containment[2]+this.offset.click.left}if(D.pageY-this.offset.click.top>this.containment[3]){B=this.containment[3]+this.offset.click.top}}if(H.grid){var G=this.originalPageY+Math.round((B-this.originalPageY)/H.grid[1])*H.grid[1];B=this.containment?(!(G-this.offset.click.top<this.containment[1]||G-this.offset.click.top>this.containment[3])?G:(!(G-this.offset.click.top<this.containment[1])?G-H.grid[1]:G+H.grid[1])):G;var F=this.originalPageX+Math.round((C-this.originalPageX)/H.grid[0])*H.grid[0];C=this.containment?(!(F-this.offset.click.left<this.containment[0]||F-this.offset.click.left>this.containment[2])?F:(!(F-this.offset.click.left<this.containment[0])?F-H.grid[0]:F+H.grid[0])):F}}return{top:(B-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(I?0:E.scrollTop()))),left:(C-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():I?0:E.scrollLeft()))}},_rearrange:function(G,F,C,E){C?C[0].appendChild(this.placeholder[0]):F.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?F.item[0]:F.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var D=this,B=this.counter;window.setTimeout(function(){if(B==D.counter){D.refreshPositions(!E)}},0)},_clear:function(C,D){this.reverting=false;if(!this._noFinalSort){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var B in this._storedCSS){if(this._storedCSS[B]=="auto"||this._storedCSS[B]=="static"){this._storedCSS[B]=""}}this.currentItem.css(this._storedCSS).removeClass(this.options.cssNamespace+"-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside){this._trigger("receive",C,this,D)}if(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not("."+this.options.cssNamespace+"-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0]){this._trigger("update",C,null,D)}if(!A.ui.contains(this.element[0],this.currentItem[0])){this._trigger("remove",C,null,D);for(var B=this.containers.length-1;B>=0;B--){if(A.ui.contains(this.containers[B].element[0],this.currentItem[0])){this.containers[B]._trigger("receive",C,this,D);this.containers[B]._trigger("update",C,this,D)}}}for(var B=this.containers.length-1;B>=0;B--){this.containers[B]._trigger("deactivate",C,this,D);if(this.containers[B].containerCache.over){this.containers[B]._trigger("out",C,this);this.containers[B].containerCache.over=0}}this.dragging=false;if(this.cancelHelperRemoval){this._trigger("beforeStop",C,null,D);this._trigger("stop",C,null,D);return false}this._trigger("beforeStop",C,null,D);this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;this._trigger("stop",C,null,D);this.fromOutside=false;return true},_trigger:function(B,C,D,E){A.ui.plugin.call(this,B,[C,this._uiHash(D)]);if(!E){if(A.widget.prototype._trigger.call(this,B,C,this._uiHash(D))===false){this.cancel()}}},plugins:{},_uiHash:function(C){var B=C||this;return{helper:B.helper,placeholder:B.placeholder||A([]),position:B.position,absolutePosition:B.positionAbs,item:B.currentItem,sender:C?C.element:null}}}));A.extend(A.ui.sortable,{getter:"serialize toArray",version:"1.6rc5",defaults:{accurateIntersection:true,appendTo:"parent",cancel:":input,option",cssNamespace:"ui",delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,helper:"original",items:"> *",scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,sortIndicator:A.ui.sortable.prototype._rearrange,tolerance:"default",zIndex:1000}});A.ui.plugin.add("sortable","cursor",{start:function(D,E){var C=A("body"),B=A(this).data("sortable");if(C.css("cursor")){B.options._cursor=C.css("cursor")}C.css("cursor",B.options.cursor)},beforeStop:function(C,D){var B=A(this).data("sortable");if(B.options._cursor){A("body").css("cursor",B.options._cursor)}}});A.ui.plugin.add("sortable","opacity",{start:function(D,E){var C=E.helper,B=A(this).data("sortable");if(C.css("opacity")){B.options._opacity=C.css("opacity")}C.css("opacity",B.options.opacity)},beforeStop:function(C,D){var B=A(this).data("sortable");if(B.options._opacity){A(D.helper).css("opacity",B.options._opacity)}}});A.ui.plugin.add("sortable","scroll",{start:function(C,D){var B=A(this).data("sortable"),E=B.options;if(B.scrollParent[0]!=document&&B.scrollParent[0].tagName!="HTML"){B.overflowOffset=B.scrollParent.offset()}},sort:function(D,E){var C=A(this).data("sortable"),F=C.options,B=false;if(C.scrollParent[0]!=document&&C.scrollParent[0].tagName!="HTML"){if((C.overflowOffset.top+C.scrollParent[0].offsetHeight)-D.pageY<F.scrollSensitivity){C.scrollParent[0].scrollTop=B=C.scrollParent[0].scrollTop+F.scrollSpeed}else{if(D.pageY-C.overflowOffset.top<F.scrollSensitivity){C.scrollParent[0].scrollTop=B=C.scrollParent[0].scrollTop-F.scrollSpeed}}if((C.overflowOffset.left+C.scrollParent[0].offsetWidth)-D.pageX<F.scrollSensitivity){C.scrollParent[0].scrollLeft=B=C.scrollParent[0].scrollLeft+F.scrollSpeed}else{if(D.pageX-C.overflowOffset.left<F.scrollSensitivity){C.scrollParent[0].scrollLeft=B=C.scrollParent[0].scrollLeft-F.scrollSpeed}}}else{if(D.pageY-A(document).scrollTop()<F.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()-F.scrollSpeed)}else{if(A(window).height()-(D.pageY-A(document).scrollTop())<F.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()+F.scrollSpeed)}}if(D.pageX-A(document).scrollLeft()<F.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()-F.scrollSpeed)}else{if(A(window).width()-(D.pageX-A(document).scrollLeft())<F.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()+F.scrollSpeed)}}}if(B!==false&&A.ui.ddmanager&&!F.dropBehaviour){A.ui.ddmanager.prepareOffsets(C,D)}}});A.ui.plugin.add("sortable","zIndex",{start:function(D,E){var C=E.helper,B=A(this).data("sortable");if(C.css("zIndex")){B.options._zIndex=C.css("zIndex")}C.css("zIndex",B.options.zIndex)},beforeStop:function(C,D){var B=A(this).data("sortable");if(B.options._zIndex){A(D.helper).css("zIndex",B.options._zIndex=="auto"?"":B.options._zIndex)}}})})(jQuery);(function(C){C.effects=C.effects||{};C.extend(C.effects,{version:"1.6rc5",save:function(E,G){for(var F=0;F<G.length;F++){if(G[F]!==null){E.data("ec.storage."+G[F],E[0].style[G[F]])}}},restore:function(E,G){for(var F=0;F<G.length;F++){if(G[F]!==null){E.css(G[F],E.data("ec.storage."+G[F]))}}},setMode:function(E,F){if(F=="toggle"){F=E.is(":hidden")?"show":"hide"}return F},getBaseline:function(G,F){var H,E;switch(G[0]){case"top":H=0;break;case"middle":H=0.5;break;case"bottom":H=1;break;default:H=G[0]/F.height}switch(G[1]){case"left":E=0;break;case"center":E=0.5;break;case"right":E=1;break;default:E=G[1]/F.width}return{x:E,y:H}},createWrapper:function(E){if(E.parent().is(".ui-effects-wrapper")){return E.parent()}var F={width:E.outerWidth(true),height:E.outerHeight(true),"float":E.css("float")};E.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var I=E.parent();if(E.css("position")=="static"){I.css({position:"relative"});E.css({position:"relative"})}else{var H=E.css("top");if(isNaN(parseInt(H,10))){H="auto"}var G=E.css("left");if(isNaN(parseInt(G,10))){G="auto"}I.css({position:E.css("position"),top:H,left:G,zIndex:E.css("z-index")}).show();E.css({position:"relative",top:0,left:0})}I.css(F);return I},removeWrapper:function(E){if(E.parent().is(".ui-effects-wrapper")){return E.parent().replaceWith(E)}return E},setTransition:function(F,H,E,G){G=G||{};C.each(H,function(J,I){unit=F.cssUnit(I);if(unit[0]>0){G[I]=unit[0]*E+unit[1]}});return G},animateClass:function(G,J,I,H){var E=(typeof I=="function"?I:(H?H:null));var F=(typeof I=="string"?I:null);return this.each(function(){var O={};var M=C(this);var N=M.attr("style")||"";if(typeof N=="object"){N=N.cssText}if(G.toggle){M.hasClass(G.toggle)?G.remove=G.toggle:G.add=G.toggle}var K=C.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(G.add){M.addClass(G.add)}if(G.remove){M.removeClass(G.remove)}var L=C.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(G.add){M.removeClass(G.add)}if(G.remove){M.addClass(G.remove)}for(var P in L){if(typeof L[P]!="function"&&L[P]&&P.indexOf("Moz")==-1&&P.indexOf("length")==-1&&L[P]!=K[P]&&(P.match(/color/i)||(!P.match(/color/i)&&!isNaN(parseInt(L[P],10))))&&(K.position!="static"||(K.position=="static"&&!P.match(/left|top|bottom|right/)))){O[P]=L[P]}}M.animate(O,J,F,function(){if(typeof C(this).attr("style")=="object"){C(this).attr("style")["cssText"]="";C(this).attr("style")["cssText"]=N}else{C(this).attr("style",N)}if(G.add){C(this).addClass(G.add)}if(G.remove){C(this).removeClass(G.remove)}if(E){E.apply(this,arguments)}})})}});C.fn.extend({_show:C.fn.show,_hide:C.fn.hide,__toggle:C.fn.toggle,_addClass:C.fn.addClass,_removeClass:C.fn.removeClass,_toggleClass:C.fn.toggleClass,effect:function(F,E,G,H){return C.effects[F]?C.effects[F].call(this,{method:F,options:E||{},duration:G,callback:H}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{var E=arguments[1]||{};E.mode="show";return this.effect.apply(this,[arguments[0],E,arguments[2]||E.duration,arguments[3]||E.callback])}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{var E=arguments[1]||{};E.mode="hide";return this.effect.apply(this,[arguments[0],E,arguments[2]||E.duration,arguments[3]||E.callback])}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(arguments[0].constructor==Function)){return this.__toggle.apply(this,arguments)}else{var E=arguments[1]||{};E.mode="toggle";return this.effect.apply(this,[arguments[0],E,arguments[2]||E.duration,arguments[3]||E.callback])}},addClass:function(H,E,G,F){return E?C.effects.animateClass.apply(this,[{add:H},E,G,F]):this._addClass(H)},removeClass:function(H,E,G,F){return E?C.effects.animateClass.apply(this,[{remove:H},E,G,F]):this._removeClass(H)},toggleClass:function(H,E,G,F){return E?C.effects.animateClass.apply(this,[{toggle:H},E,G,F]):this._toggleClass(H)},morph:function(F,I,E,H,G){return C.effects.animateClass.apply(this,[{add:I,remove:F},E,H,G])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(E){var F=this.css(E),G=[];C.each(["em","px","%","pt"],function(H,I){if(F.indexOf(I)>0){G=[parseFloat(F),I]}});return G}});C.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(F,E){C.fx.step[E]=function(G){if(G.state==0){G.start=D(G.elem,E);G.end=A(G.end)}G.elem.style[E]="rgb("+[Math.max(Math.min(parseInt((G.pos*(G.end[0]-G.start[0]))+G.start[0],10),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[1]-G.start[1]))+G.start[1],10),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[2]-G.start[2]))+G.start[2],10),255),0)].join(",")+")"}});function A(E){var F;if(E&&E.constructor==Array&&E.length==3){return E}if(F=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(E)){return[parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10)]}if(F=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(E)){return[parseFloat(F[1])*2.55,parseFloat(F[2])*2.55,parseFloat(F[3])*2.55]}if(F=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(E)){return[parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16)]}if(F=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(E)){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)]}if(F=/rgba\(0, 0, 0, 0\)/.exec(E)){return B.transparent}return B[C.trim(E).toLowerCase()]}function D(G,E){var F;do{F=C.curCSS(G,E);if(F!=""&&F!="transparent"||C.nodeName(G,"body")){break}E="backgroundColor"}while(G=G.parentNode);return A(F)}var B={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};C.easing.jswing=C.easing.swing;C.extend(C.easing,{def:"easeOutQuad",swing:function(F,G,E,I,H){return C.easing[C.easing.def](F,G,E,I,H)},easeInQuad:function(F,G,E,I,H){return I*(G/=H)*G+E},easeOutQuad:function(F,G,E,I,H){return -I*(G/=H)*(G-2)+E},easeInOutQuad:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G+E}return -I/2*((--G)*(G-2)-1)+E},easeInCubic:function(F,G,E,I,H){return I*(G/=H)*G*G+E},easeOutCubic:function(F,G,E,I,H){return I*((G=G/H-1)*G*G+1)+E},easeInOutCubic:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G*G+E}return I/2*((G-=2)*G*G+2)+E},easeInQuart:function(F,G,E,I,H){return I*(G/=H)*G*G*G+E},easeOutQuart:function(F,G,E,I,H){return -I*((G=G/H-1)*G*G*G-1)+E},easeInOutQuart:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G*G*G+E}return -I/2*((G-=2)*G*G*G-2)+E},easeInQuint:function(F,G,E,I,H){return I*(G/=H)*G*G*G*G+E},easeOutQuint:function(F,G,E,I,H){return I*((G=G/H-1)*G*G*G*G+1)+E},easeInOutQuint:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G*G*G*G+E}return I/2*((G-=2)*G*G*G*G+2)+E},easeInSine:function(F,G,E,I,H){return -I*Math.cos(G/H*(Math.PI/2))+I+E},easeOutSine:function(F,G,E,I,H){return I*Math.sin(G/H*(Math.PI/2))+E},easeInOutSine:function(F,G,E,I,H){return -I/2*(Math.cos(Math.PI*G/H)-1)+E},easeInExpo:function(F,G,E,I,H){return(G==0)?E:I*Math.pow(2,10*(G/H-1))+E},easeOutExpo:function(F,G,E,I,H){return(G==H)?E+I:I*(-Math.pow(2,-10*G/H)+1)+E},easeInOutExpo:function(F,G,E,I,H){if(G==0){return E}if(G==H){return E+I}if((G/=H/2)<1){return I/2*Math.pow(2,10*(G-1))+E}return I/2*(-Math.pow(2,-10*--G)+2)+E},easeInCirc:function(F,G,E,I,H){return -I*(Math.sqrt(1-(G/=H)*G)-1)+E},easeOutCirc:function(F,G,E,I,H){return I*Math.sqrt(1-(G=G/H-1)*G)+E},easeInOutCirc:function(F,G,E,I,H){if((G/=H/2)<1){return -I/2*(Math.sqrt(1-G*G)-1)+E}return I/2*(Math.sqrt(1-(G-=2)*G)+1)+E},easeInElastic:function(F,H,E,L,K){var I=1.70158;var J=0;var G=L;if(H==0){return E}if((H/=K)==1){return E+L}if(!J){J=K*0.3}if(G<Math.abs(L)){G=L;var I=J/4}else{var I=J/(2*Math.PI)*Math.asin(L/G)}return -(G*Math.pow(2,10*(H-=1))*Math.sin((H*K-I)*(2*Math.PI)/J))+E},easeOutElastic:function(F,H,E,L,K){var I=1.70158;var J=0;var G=L;if(H==0){return E}if((H/=K)==1){return E+L}if(!J){J=K*0.3}if(G<Math.abs(L)){G=L;var I=J/4}else{var I=J/(2*Math.PI)*Math.asin(L/G)}return G*Math.pow(2,-10*H)*Math.sin((H*K-I)*(2*Math.PI)/J)+L+E},easeInOutElastic:function(F,H,E,L,K){var I=1.70158;var J=0;var G=L;if(H==0){return E}if((H/=K/2)==2){return E+L}if(!J){J=K*(0.3*1.5)}if(G<Math.abs(L)){G=L;var I=J/4}else{var I=J/(2*Math.PI)*Math.asin(L/G)}if(H<1){return -0.5*(G*Math.pow(2,10*(H-=1))*Math.sin((H*K-I)*(2*Math.PI)/J))+E}return G*Math.pow(2,-10*(H-=1))*Math.sin((H*K-I)*(2*Math.PI)/J)*0.5+L+E},easeInBack:function(F,G,E,J,I,H){if(H==undefined){H=1.70158}return J*(G/=I)*G*((H+1)*G-H)+E},easeOutBack:function(F,G,E,J,I,H){if(H==undefined){H=1.70158}return J*((G=G/I-1)*G*((H+1)*G+H)+1)+E},easeInOutBack:function(F,G,E,J,I,H){if(H==undefined){H=1.70158}if((G/=I/2)<1){return J/2*(G*G*(((H*=(1.525))+1)*G-H))+E}return J/2*((G-=2)*G*(((H*=(1.525))+1)*G+H)+2)+E},easeInBounce:function(F,G,E,I,H){return I-C.easing.easeOutBounce(F,H-G,0,I,H)+E},easeOutBounce:function(F,G,E,I,H){if((G/=H)<(1/2.75)){return I*(7.5625*G*G)+E}else{if(G<(2/2.75)){return I*(7.5625*(G-=(1.5/2.75))*G+0.75)+E}else{if(G<(2.5/2.75)){return I*(7.5625*(G-=(2.25/2.75))*G+0.9375)+E}else{return I*(7.5625*(G-=(2.625/2.75))*G+0.984375)+E}}}},easeInOutBounce:function(F,G,E,I,H){if(G<H/2){return C.easing.easeInBounce(F,G*2,0,I,H)*0.5+E}return C.easing.easeOutBounce(F,G*2-H,0,I,H)*0.5+I*0.5+E}})})(jQuery);(function(A){A.effects.blind=function(B){return this.queue(function(){var D=A(this),C=["position","top","left"];var G=A.effects.setMode(D,B.options.mode||"hide");var J=B.options.direction||"vertical";A.effects.save(D,C);D.show();var I=A.effects.createWrapper(D).css({overflow:"hidden"});var E=(J=="vertical")?"height":"width";var H=(J=="vertical")?I.height():I.width();if(G=="show"){I.css(E,0)}var F={};F[E]=G=="show"?H:0;I.animate(F,B.duration,B.options.easing,function(){if(G=="hide"){D.hide()}A.effects.restore(D,C);A.effects.removeWrapper(D);if(B.callback){B.callback.apply(D[0],arguments)}D.dequeue()})})}})(jQuery);(function(A){A.effects.bounce=function(B){return this.queue(function(){var E=A(this),K=["position","top","left"];var J=A.effects.setMode(E,B.options.mode||"effect");var O=B.options.direction||"up";var D=B.options.distance||20;var C=B.options.times||5;var G=B.duration||250;if(/show|hide/.test(J)){K.push("opacity")}A.effects.save(E,K);E.show();A.effects.createWrapper(E);var F=(O=="up"||O=="down")?"top":"left";var M=(O=="up"||O=="left")?"pos":"neg";var D=B.options.distance||(F=="top"?E.outerHeight({margin:true})/3:E.outerWidth({margin:true})/3);if(J=="show"){E.css("opacity",0).css(F,M=="pos"?-D:D)}if(J=="hide"){D=D/(C*2)}if(J!="hide"){C--}if(J=="show"){var H={opacity:1};H[F]=(M=="pos"?"+=":"-=")+D;E.animate(H,G/2,B.options.easing);D=D/2;C--}for(var I=0;I<C;I++){var N={},L={};N[F]=(M=="pos"?"-=":"+=")+D;L[F]=(M=="pos"?"+=":"-=")+D;E.animate(N,G/2,B.options.easing).animate(L,G/2,B.options.easing);D=(J=="hide")?D*2:D/2}if(J=="hide"){var H={opacity:0};H[F]=(M=="pos"?"-=":"+=")+D;E.animate(H,G/2,B.options.easing,function(){E.hide();A.effects.restore(E,K);A.effects.removeWrapper(E);if(B.callback){B.callback.apply(this,arguments)}})}else{var N={},L={};N[F]=(M=="pos"?"-=":"+=")+D;L[F]=(M=="pos"?"+=":"-=")+D;E.animate(N,G/2,B.options.easing).animate(L,G/2,B.options.easing,function(){A.effects.restore(E,K);A.effects.removeWrapper(E);if(B.callback){B.callback.apply(this,arguments)}})}E.queue("fx",function(){E.dequeue()});E.dequeue()})}})(jQuery);(function(A){A.effects.clip=function(B){return this.queue(function(){var E=A(this),J=["position","top","left","height","width"];var H=A.effects.setMode(E,B.options.mode||"hide");var K=B.options.direction||"vertical";A.effects.save(E,J);E.show();var D=A.effects.createWrapper(E).css({overflow:"hidden"});var I=E[0].tagName=="IMG"?D:E;var F={size:(K=="vertical")?"height":"width",position:(K=="vertical")?"top":"left"};var C=(K=="vertical")?I.height():I.width();if(H=="show"){I.css(F.size,0);I.css(F.position,C/2)}var G={};G[F.size]=H=="show"?C:0;G[F.position]=H=="show"?0:C/2;I.animate(G,{queue:false,duration:B.duration,easing:B.options.easing,complete:function(){if(H=="hide"){E.hide()}A.effects.restore(E,J);A.effects.removeWrapper(E);if(B.callback){B.callback.apply(E[0],arguments)}E.dequeue()}})})}})(jQuery);(function(A){A.effects.drop=function(B){return this.queue(function(){var D=A(this),C=["position","top","left","opacity"];var H=A.effects.setMode(D,B.options.mode||"hide");var J=B.options.direction||"left";A.effects.save(D,C);D.show();A.effects.createWrapper(D);var F=(J=="up"||J=="down")?"top":"left";var E=(J=="up"||J=="left")?"pos":"neg";var I=B.options.distance||(F=="top"?D.outerHeight({margin:true})/2:D.outerWidth({margin:true})/2);if(H=="show"){D.css("opacity",0).css(F,E=="pos"?-I:I)}var G={opacity:H=="show"?1:0};G[F]=(H=="show"?(E=="pos"?"+=":"-="):(E=="pos"?"-=":"+="))+I;D.animate(G,{queue:false,duration:B.duration,easing:B.options.easing,complete:function(){if(H=="hide"){D.hide()}A.effects.restore(D,C);A.effects.removeWrapper(D);if(B.callback){B.callback.apply(this,arguments)}D.dequeue()}})})}})(jQuery);(function(A){A.effects.fold=function(B){return this.queue(function(){var F=A(this),K=["position","top","left"];var J=A.effects.setMode(F,B.options.mode||"hide");var O=B.options.size||15;var N=!(!B.options.horizFirst);var I=B.duration?B.duration/2:A.fx.speeds._default/2;A.effects.save(F,K);F.show();var D=A.effects.createWrapper(F).css({overflow:"hidden"});var H=((J=="show")!=N);var G=H?["width","height"]:["height","width"];var C=H?[D.width(),D.height()]:[D.height(),D.width()];var E=/([0-9]+)%/.exec(O);if(E){O=parseInt(E[1])/100*C[J=="hide"?0:1]}if(J=="show"){D.css(N?{height:0,width:O}:{height:O,width:0})}var M={},L={};M[G[0]]=J=="show"?C[0]:O;L[G[1]]=J=="show"?C[1]:0;D.animate(M,I,B.options.easing).animate(L,I,B.options.easing,function(){if(J=="hide"){F.hide()}A.effects.restore(F,K);A.effects.removeWrapper(F);if(B.callback){B.callback.apply(F[0],arguments)}F.dequeue()})})}})(jQuery);(function(A){A.effects.highlight=function(B){return this.queue(function(){var E=A(this),D=["backgroundImage","backgroundColor","opacity"];var H=A.effects.setMode(E,B.options.mode||"show");var C=B.options.color||"#ffff99";var G=E.css("backgroundColor");A.effects.save(E,D);E.show();E.css({backgroundImage:"none",backgroundColor:C});var F={backgroundColor:G};if(H=="hide"){F.opacity=0}E.animate(F,{queue:false,duration:B.duration,easing:B.options.easing,complete:function(){if(H=="hide"){E.hide()}A.effects.restore(E,D);if(H=="show"&&A.browser.msie){this.style.removeAttribute("filter")}if(B.callback){B.callback.apply(this,arguments)}E.dequeue()}})})}})(jQuery);(function(A){A.effects.pulsate=function(B){return this.queue(function(){var D=A(this);var F=A.effects.setMode(D,B.options.mode||"show");var E=B.options.times||5;var G=B.duration?B.duration/2:A.fx.speeds._default/2;if(F=="hide"){E--}if(D.is(":hidden")){D.css("opacity",0);D.show();D.animate({opacity:1},G,B.options.easing);E=E-2}for(var C=0;C<E;C++){D.animate({opacity:0},G,B.options.easing).animate({opacity:1},G,B.options.easing)}if(F=="hide"){D.animate({opacity:0},G,B.options.easing,function(){D.hide();if(B.callback){B.callback.apply(this,arguments)}})}else{D.animate({opacity:0},G,B.options.easing).animate({opacity:1},G,B.options.easing,function(){if(B.callback){B.callback.apply(this,arguments)}})}D.queue("fx",function(){D.dequeue()});D.dequeue()})}})(jQuery);(function(A){A.effects.puff=function(B){return this.queue(function(){var G=A(this);var F=A.extend(true,{},B.options);var H=A.effects.setMode(G,B.options.mode||"hide");var C=parseInt(B.options.percent)||150;F.fade=true;var E={height:G.height(),width:G.width()};var D=C/100;G.from=(H=="hide")?E:{height:E.height*D,width:E.width*D};F.from=G.from;F.percent=(H=="hide")?C:100;F.mode=H;G.effect("scale",F,B.duration,B.callback);G.dequeue()})};A.effects.scale=function(B){return this.queue(function(){var H=A(this);var F=A.extend(true,{},B.options);var I=A.effects.setMode(H,B.options.mode||"effect");var C=parseInt(B.options.percent)||(parseInt(B.options.percent)==0?0:(I=="hide"?0:100));var J=B.options.direction||"both";var G=B.options.origin;if(I!="effect"){F.origin=G||["middle","center"];F.restore=true}var E={height:H.height(),width:H.width()};H.from=B.options.from||(I=="show"?{height:0,width:0}:E);var D={y:J!="horizontal"?(C/100):1,x:J!="vertical"?(C/100):1};H.to={height:E.height*D.y,width:E.width*D.x};if(B.options.fade){if(I=="show"){H.from.opacity=0;H.to.opacity=1}if(I=="hide"){H.from.opacity=1;H.to.opacity=0}}F.from=H.from;F.to=H.to;F.mode=I;H.effect("size",F,B.duration,B.callback);H.dequeue()})};A.effects.size=function(B){return this.queue(function(){var H=A(this),N=["position","top","left","width","height","overflow","opacity"];var D=["position","top","left","overflow","opacity"];var F=["width","height","overflow"];var O=["fontSize"];var E=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var K=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];var L=A.effects.setMode(H,B.options.mode||"effect");var M=B.options.restore||false;var J=B.options.scale||"both";var P=B.options.origin;var I={height:H.height(),width:H.width()};H.from=B.options.from||I;H.to=B.options.to||I;if(P){var G=A.effects.getBaseline(P,I);H.from.top=(I.height-H.from.height)*G.y;H.from.left=(I.width-H.from.width)*G.x;H.to.top=(I.height-H.to.height)*G.y;H.to.left=(I.width-H.to.width)*G.x}var C={from:{y:H.from.height/I.height,x:H.from.width/I.width},to:{y:H.to.height/I.height,x:H.to.width/I.width}};if(J=="box"||J=="both"){if(C.from.y!=C.to.y){N=N.concat(E);H.from=A.effects.setTransition(H,E,C.from.y,H.from);H.to=A.effects.setTransition(H,E,C.to.y,H.to)}if(C.from.x!=C.to.x){N=N.concat(K);H.from=A.effects.setTransition(H,K,C.from.x,H.from);H.to=A.effects.setTransition(H,K,C.to.x,H.to)}}if(J=="content"||J=="both"){if(C.from.y!=C.to.y){N=N.concat(O);H.from=A.effects.setTransition(H,O,C.from.y,H.from);H.to=A.effects.setTransition(H,O,C.to.y,H.to)}}A.effects.save(H,M?N:D);H.show();A.effects.createWrapper(H);H.css("overflow","hidden").css(H.from);if(J=="content"||J=="both"){E=E.concat(["marginTop","marginBottom"]).concat(O);K=K.concat(["marginLeft","marginRight"]);F=N.concat(E).concat(K);H.find("*[width]").each(function(){child=A(this);if(M){A.effects.save(child,F)}var Q={height:child.height(),width:child.width()};child.from={height:Q.height*C.from.y,width:Q.width*C.from.x};child.to={height:Q.height*C.to.y,width:Q.width*C.to.x};if(C.from.y!=C.to.y){child.from=A.effects.setTransition(child,E,C.from.y,child.from);child.to=A.effects.setTransition(child,E,C.to.y,child.to)}if(C.from.x!=C.to.x){child.from=A.effects.setTransition(child,K,C.from.x,child.from);child.to=A.effects.setTransition(child,K,C.to.x,child.to)}child.css(child.from);child.animate(child.to,B.duration,B.options.easing,function(){if(M){A.effects.restore(child,F)}})})}H.animate(H.to,{queue:false,duration:B.duration,easing:B.options.easing,complete:function(){if(L=="hide"){H.hide()}A.effects.restore(H,M?N:D);A.effects.removeWrapper(H);if(B.callback){B.callback.apply(this,arguments)}H.dequeue()}})})}})(jQuery);(function(A){A.effects.shake=function(B){return this.queue(function(){var E=A(this),K=["position","top","left"];var J=A.effects.setMode(E,B.options.mode||"effect");var O=B.options.direction||"left";var D=B.options.distance||20;var C=B.options.times||3;var G=B.duration||B.options.duration||140;A.effects.save(E,K);E.show();A.effects.createWrapper(E);var F=(O=="up"||O=="down")?"top":"left";var M=(O=="up"||O=="left")?"pos":"neg";var H={},N={},L={};H[F]=(M=="pos"?"-=":"+=")+D;N[F]=(M=="pos"?"+=":"-=")+D*2;L[F]=(M=="pos"?"-=":"+=")+D*2;E.animate(H,G,B.options.easing);for(var I=1;I<C;I++){E.animate(N,G,B.options.easing).animate(L,G,B.options.easing)}E.animate(N,G,B.options.easing).animate(H,G/2,B.options.easing,function(){A.effects.restore(E,K);A.effects.removeWrapper(E);if(B.callback){B.callback.apply(this,arguments)}});E.queue("fx",function(){E.dequeue()});E.dequeue()})}})(jQuery);(function(A){A.effects.slide=function(B){return this.queue(function(){var D=A(this),C=["position","top","left"];var H=A.effects.setMode(D,B.options.mode||"show");var J=B.options.direction||"left";A.effects.save(D,C);D.show();A.effects.createWrapper(D).css({overflow:"hidden"});var F=(J=="up"||J=="down")?"top":"left";var E=(J=="up"||J=="left")?"pos":"neg";var I=B.options.distance||(F=="top"?D.outerHeight({margin:true}):D.outerWidth({margin:true}));if(H=="show"){D.css(F,E=="pos"?-I:I)}var G={};G[F]=(H=="show"?(E=="pos"?"+=":"-="):(E=="pos"?"-=":"+="))+I;D.animate(G,{queue:false,duration:B.duration,easing:B.options.easing,complete:function(){if(H=="hide"){D.hide()}A.effects.restore(D,C);A.effects.removeWrapper(D);if(B.callback){B.callback.apply(this,arguments)}D.dequeue()}})})}})(jQuery);