/*!
 * jQuery UI 1.8.18
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(f,e){function g(a){return !f(a).parents().andSelf().filter(function(){return f.curCSS(this,"visibility")==="hidden"||f.expr.filters.hidden(this)}).length}function h(a,l){var k=a.nodeName.toLowerCase();if("area"===k){var j=a.parentNode,i=j.name,d;if(!a.href||!i||j.nodeName.toLowerCase()!=="map"){return !1}d=f("img[usemap=#"+i+"]")[0];return !!d&&g(d)}return(/input|select|textarea|button|object/.test(k)?!a.disabled:"a"==k?a.href||l:l)&&g(a)}f.ui=f.ui||{};f.ui.version||(f.extend(f.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,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,WINDOWS:91}}),f.fn.extend({propAttr:f.fn.prop||f.fn.attr,_focus:f.fn.focus,focus:function(a,d){return typeof a=="number"?this.each(function(){var b=this;setTimeout(function(){f(b).focus(),d&&d.call(b)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;f.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?a=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(f.curCSS(this,"position",1))&&/(auto|scroll)/.test(f.curCSS(this,"overflow",1)+f.curCSS(this,"overflow-y",1)+f.curCSS(this,"overflow-x",1))}).eq(0):a=this.parents().filter(function(){return/(auto|scroll)/.test(f.curCSS(this,"overflow",1)+f.curCSS(this,"overflow-y",1)+f.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?f(document):a},zIndex:function(j){if(j!==e){return this.css("zIndex",j)}if(this.length){var i=f(this[0]),b,a;while(i.length&&i[0]!==document){b=i.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){a=parseInt(i.css("zIndex"),10);if(!isNaN(a)&&a!==0){return a}}i=i.parent()}}return 0},disableSelection:function(){return this.bind((f.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(b){b.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),f.each(["Width","Height"],function(l,k){function a(m,p,o,n){f.each(j,function(){p-=parseFloat(f.curCSS(m,"padding"+this,!0))||0,o&&(p-=parseFloat(f.curCSS(m,"border"+this+"Width",!0))||0),n&&(p-=parseFloat(f.curCSS(m,"margin"+this,!0))||0)});return p}var j=k==="Width"?["Left","Right"]:["Top","Bottom"],i=k.toLowerCase(),b={innerWidth:f.fn.innerWidth,innerHeight:f.fn.innerHeight,outerWidth:f.fn.outerWidth,outerHeight:f.fn.outerHeight};f.fn["inner"+k]=function(d){if(d===e){return b["inner"+k].call(this)}return this.each(function(){f(this).css(i,a(this,d)+"px")})},f.fn["outer"+k]=function(d,m){if(typeof d!="number"){return b["outer"+k].call(this,d)}return this.each(function(){f(this).css(i,a(this,d,!0,m)+"px")})}}),f.extend(f.expr[":"],{data:function(a,j,i){return !!f.data(a,i[3])},focusable:function(a){return h(a,!isNaN(f.attr(a,"tabindex")))},tabbable:function(a){var i=f.attr(a,"tabindex"),c=isNaN(i);return(c||i>=0)&&h(a,!c)}}),f(function(){var a=document.body,d=a.appendChild(d=document.createElement("div"));d.offsetHeight,f.extend(d.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),f.support.minHeight=d.offsetHeight===100,f.support.selectstart="onselectstart" in d,a.removeChild(d).style.display="none"}),f.extend(f.ui,{plugin:{add:function(a,l,k){var j=f.ui[a].prototype;for(var i in k){j.plugins[i]=j.plugins[i]||[],j.plugins[i].push([l,k[i]])}},call:function(j,i,m){var l=j.plugins[i];if(!!l&&!!j.element[0].parentNode){for(var k=0;k<l.length;k++){j.options[l[k][0]]&&l[k][1].apply(j.element,m)}}}},contains:function(d,c){return document.compareDocumentPosition?d.compareDocumentPosition(c)&16:d!==c&&d.contains(c)},hasScroll:function(a,k){if(f(a).css("overflow")==="hidden"){return !1}var j=k&&k==="left"?"scrollLeft":"scrollTop",i=!1;if(a[j]>0){return !0}a[j]=1,i=a[j]>0,a[j]=0;return i},isOverAxis:function(i,d,j){return i>d&&i<d+j},isOver:function(a,m,l,k,j,i){return f.ui.isOverAxis(a,l,j)&&f.ui.isOverAxis(m,k,i)}}))})(jQuery);
/*!
 * jQuery UI Widget 1.8.18
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(f,e){if(f.cleanData){var h=f.cleanData;f.cleanData=function(a){for(var j=0,i;(i=a[j])!=null;j++){try{f(i).triggerHandler("remove")}catch(c){}}h(a)}}else{var g=f.fn.remove;f.fn.remove=function(a,d){return this.each(function(){d||(!a||f.filter(a,[this]).length)&&f("*",this).add([this]).each(function(){try{f(this).triggerHandler("remove")}catch(c){}});return g.call(f(this),a,d)})}}f.widget=function(a,m,l){var k=a.split(".")[0],j;a=a.split(".")[1],j=k+"-"+a,l||(l=m,m=f.Widget),f.expr[":"][j]=function(b){return !!f.data(b,a)},f[k]=f[k]||{},f[k][a]=function(d,c){arguments.length&&this._createWidget(d,c)};var i=new m;i.options=f.extend(!0,{},i.options),f[k][a].prototype=f.extend(!0,i,{namespace:k,widgetName:a,widgetEventPrefix:f[k][a].prototype.widgetEventPrefix||a,widgetBaseClass:j},l),f.widget.bridge(a,f[k][a])},f.widget.bridge=function(b,a){f.fn[b]=function(j){var i=typeof j=="string",d=Array.prototype.slice.call(arguments,1),c=this;j=!i&&d.length?f.extend.apply(null,[!0,j].concat(d)):j;if(i&&j.charAt(0)==="_"){return c}i?this.each(function(){var l=f.data(this,b),k=l&&f.isFunction(l[j])?l[j].apply(l,d):l;if(k!==l&&k!==e){c=k;return !1}}):this.each(function(){var k=f.data(this,b);k?k.option(j||{})._init():f.data(this,b,new a(j,this))});return c}},f.Widget=function(d,c){arguments.length&&this._createWidget(d,c)},f.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(a,j){f.data(j,this.widgetName,this),this.element=f(j),this.options=f.extend(!0,{},this.options,this._getCreateOptions(),a);var i=this;this.element.bind("remove."+this.widgetName,function(){i.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return f.metadata&&f.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(i,b){var a=i;if(arguments.length===0){return f.extend({},this.options)}if(typeof i=="string"){if(b===e){return this.options[i]}a={},a[i]=b}this._setOptions(a);return this},_setOptions:function(a){var d=this;f.each(a,function(i,c){d._setOption(i,c)});return this},_setOption:function(d,c){this.options[d]=c,d==="disabled"&&this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(a,m,l){var k,j,i=this.options[a];l=l||{},m=f.Event(m),m.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase(),m.target=this.element[0],j=m.originalEvent;if(j){for(k in j){k in m||(m[k]=j[k])}}this.element.trigger(m,l);return !(f.isFunction(i)&&i.call(this.element[0],m,l)===!1||m.isDefaultPrevented())}}})(jQuery);
/*!
 * jQuery UI Mouse 1.8.18
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(e,d){var f=!1;e(document).mouseup(function(b){f=!1}),e.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(!0===e.data(b.target,a.widgetName+".preventClickEvent")){e.removeData(b.target,a.widgetName+".preventClickEvent"),b.stopImmediatePropagation();return !1}}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){if(!f){this._mouseStarted&&this._mouseUp(a),this._mouseDownEvent=a;var h=this,g=a.which==1,c=typeof this.options.cancel=="string"&&a.target.nodeName?e(a.target).closest(this.options.cancel).length:!1;if(!g||c||!this._mouseCapture(a)){return !0}this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){h.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==!1;if(!this._mouseStarted){a.preventDefault();return !0}}!0===e.data(a.target,this.widgetName+".preventClickEvent")&&e.removeData(a.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(b){return h._mouseMove(b)},this._mouseUpDelegate=function(b){return h._mouseUp(b)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),a.preventDefault(),f=!0;return !0}},_mouseMove:function(a){if(e.browser.msie&&!(document.documentMode>=9)&&!a.button){return this._mouseUp(a)}if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}this._mouseDistanceMet(a)&&this._mouseDelayMet(a)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==!1,this._mouseStarted?this._mouseDrag(a):this._mouseUp(a));return !this._mouseStarted},_mouseUp:function(a){e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,a.target==this._mouseDownEvent.target&&e.data(a.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(a));return !1},_mouseDistanceMet:function(b){return Math.max(Math.abs(this._mouseDownEvent.pageX-b.pageX),Math.abs(this._mouseDownEvent.pageY-b.pageY))>=this.options.distance},_mouseDelayMet:function(b){return this.mouseDelayMet},_mouseStart:function(b){},_mouseDrag:function(b){},_mouseStop:function(b){},_mouseCapture:function(b){return !0}})})(jQuery);(function(j,i){j.ui=j.ui||{};var p=/left|center|right/,o=/top|center|bottom/,n="center",m={},l=j.fn.position,k=j.fn.offset;j.fn.position=function(c){if(!c||!c.of){return l.apply(this,arguments)}c=j.extend({},c);var q=j(c.of),g=q[0],f=(c.collision||"flip").split(" "),e=c.offset?c.offset.split(" "):[0,0],d,a,r;g.nodeType===9?(d=q.width(),a=q.height(),r={top:0,left:0}):g.setTimeout?(d=q.width(),a=q.height(),r={top:q.scrollTop(),left:q.scrollLeft()}):g.preventDefault?(c.at="left top",d=a=0,r={top:c.of.pageY,left:c.of.pageX}):(d=q.outerWidth(),a=q.outerHeight(),r=q.offset()),j.each(["my","at"],function(){var b=(c[this]||"").split(" ");b.length===1&&(b=p.test(b[0])?b.concat([n]):o.test(b[0])?[n].concat(b):[n,n]),b[0]=p.test(b[0])?b[0]:n,b[1]=o.test(b[1])?b[1]:n,c[this]=b}),f.length===1&&(f[1]=f[0]),e[0]=parseInt(e[0],10)||0,e.length===1&&(e[1]=e[0]),e[1]=parseInt(e[1],10)||0,c.at[0]==="right"?r.left+=d:c.at[0]===n&&(r.left+=d/2),c.at[1]==="bottom"?r.top+=a:c.at[1]===n&&(r.top+=a/2),r.left+=e[0],r.top+=e[1];return this.each(function(){var z=j(this),y=z.outerWidth(),x=z.outerHeight(),w=parseInt(j.curCSS(this,"marginLeft",!0))||0,v=parseInt(j.curCSS(this,"marginTop",!0))||0,u=y+w+(parseInt(j.curCSS(this,"marginRight",!0))||0),t=x+v+(parseInt(j.curCSS(this,"marginBottom",!0))||0),s=j.extend({},r),b;c.my[0]==="right"?s.left-=y:c.my[0]===n&&(s.left-=y/2),c.my[1]==="bottom"?s.top-=x:c.my[1]===n&&(s.top-=x/2),m.fractions||(s.left=Math.round(s.left),s.top=Math.round(s.top)),b={left:s.left-w,top:s.top-v},j.each(["left","top"],function(A,h){j.ui.position[f[A]]&&j.ui.position[f[A]][h](s,{targetWidth:d,targetHeight:a,elemWidth:y,elemHeight:x,collisionPosition:b,collisionWidth:u,collisionHeight:t,offset:e,my:c.my,at:c.at})}),j.fn.bgiframe&&z.bgiframe(),z.offset(j.extend(s,{using:c.using}))})},j.ui.position={fit:{left:function(a,h){var g=j(window),f=h.collisionPosition.left+h.collisionWidth-g.width()-g.scrollLeft();a.left=f>0?a.left-f:Math.max(a.left-h.collisionPosition.left,a.left)},top:function(a,h){var g=j(window),f=h.collisionPosition.top+h.collisionHeight-g.height()-g.scrollTop();a.top=f>0?a.top-f:Math.max(a.top-h.collisionPosition.top,a.top)}},flip:{left:function(a,u){if(u.at[0]!==n){var t=j(window),s=u.collisionPosition.left+u.collisionWidth-t.width()-t.scrollLeft(),r=u.my[0]==="left"?-u.elemWidth:u.my[0]==="right"?u.elemWidth:0,q=u.at[0]==="left"?u.targetWidth:-u.targetWidth,e=-2*u.offset[0];a.left+=u.collisionPosition.left<0?r+q+e:s>0?r+q+e:0}},top:function(a,u){if(u.at[1]!==n){var t=j(window),s=u.collisionPosition.top+u.collisionHeight-t.height()-t.scrollTop(),r=u.my[1]==="top"?-u.elemHeight:u.my[1]==="bottom"?u.elemHeight:0,q=u.at[1]==="top"?u.targetHeight:-u.targetHeight,e=-2*u.offset[1];a.top+=u.collisionPosition.top<0?r+q+e:s>0?r+q+e:0}}}},j.offset.setOffset||(j.offset.setOffset=function(a,v){/static/.test(j.curCSS(a,"position"))&&(a.style.position="relative");var u=j(a),t=u.offset(),s=parseInt(j.curCSS(a,"top",!0),10)||0,r=parseInt(j.curCSS(a,"left",!0),10)||0,q={top:v.top-t.top+s,left:v.left-t.left+r};"using" in v?v.using.call(a,q):u.css(q)},j.fn.offset=function(a){var d=this[0];if(!d||!d.ownerDocument){return null}if(a){return this.each(function(){j.offset.setOffset(this,a)})}return k.call(this)}),function(){var a=document.getElementsByTagName("body")[0],v=document.createElement("div"),u,t,s,r,q;u=document.createElement(a?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},a&&j.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(var f in s){u.style[f]=s[f]}u.appendChild(v),t=a||document.documentElement,t.insertBefore(u,t.firstChild),v.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",r=j(v).offset(function(d,c){return c}).offset(),u.innerHTML="",t.removeChild(u),q=r.top+r.left+(a?2000:0),m.fractions=q>21&&q<22}()})(jQuery);(function(d,c){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){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")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(a){var e=this.options;if(this.helper||e.disabled||d(a.target).is(".ui-resizable-handle")){return !1}this.handle=this._getHandle(a);if(!this.handle){return !1}e.iframeFix&&d(e.iframeFix===!0?"iframe":e.iframeFix).each(function(){d('<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(d(this).offset()).appendTo("body")});return !0},_mouseStart:function(a){if(fluid.viewMgr.getView().viewName!=="projectEditing"){return}var e=this.options;this.helper=this._createHelper(a),this._cacheHelperProportions(),d.ui.ddmanager&&(d.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(a),this.originalPageX=a.pageX,this.originalPageY=a.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),e.containment&&this._setContainment();if(this._trigger("start",a)===!1){this._clear();return !1}this._cacheHelperProportions(),d.ui.ddmanager&&!e.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(a,!0),d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return !0},_mouseDrag:function(a,f){if(fluid.viewMgr.getView().viewName!=="projectEditing"){return}this.position=this._generatePosition(a),this.positionAbs=this._convertPositionTo("absolute");if(!f){var e=this._uiHash();if(this._trigger("drag",a,e)===!1){this._mouseUp({});return !1}this.position=e.position}if(!this.options.axis||this.options.axis!="y"){if(this.options.adjustToZoom){this.helper[0].style.left=Math.round(this.position.left/fluid.zoom.getCurrentScale())+"px"}else{this.helper[0].style.left=this.position.left+"px"}}if(!this.options.axis||this.options.axis!="x"){if(this.options.adjustToZoom){this.helper[0].style.top=Math.round(this.position.top/fluid.zoom.getCurrentScale())+"px"}else{this.helper[0].style.top=this.position.top+"px"}}d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return !1},_mouseStop:function(a){if(fluid.viewMgr.getView().viewName!=="projectEditing"){return}var f=!1;d.ui.ddmanager&&!this.options.dropBehaviour&&(f=d.ui.ddmanager.drop(this,a)),this.dropped&&(f=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original"){return !1}if(this.options.revert=="invalid"&&!f||this.options.revert=="valid"&&f||this.options.revert===!0||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,f)){var e=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){e._trigger("stop",a)!==!1&&e._clear()})}else{this._trigger("stop",a)!==!1&&this._clear()}return !1},_mouseUp:function(a){this.options.iframeFix===!0&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var e=!this.options.handle||!d(this.options.handle,this.element).length?!0:!1;d(this.options.handle,this.element).find("*").andSelf().each(function(){this==a.target&&(e=!0)});return e},_createHelper:function(a){var f=this.options,e=d.isFunction(f.helper)?d(f.helper.apply(this.element[0],[a])):f.helper=="clone"?this.element.clone().removeAttr("id"):this.element;e.parents("body").length||e.appendTo(f.appendTo=="parent"?this.element[0].parentNode:f.appendTo),e[0]!=this.element[0]&&!/(fixed|absolute)/.test(e.css("position"))&&e.css("position","absolute");return e},_adjustOffsetFromHelper:function(a){typeof a=="string"&&(a=a.split(" ")),d.isArray(a)&&(a={left:+a[0],top:+a[1]||0}),"left" in a&&(this.offset.click.left=a.left+this.margins.left),"right" in a&&(this.offset.click.left=this.helperProportions.width-a.right+this.margins.left),"top" in a&&(this.offset.click.top=a.top+this.margins.top),"bottom" in a&&(this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(a.left+=this.scrollParent.scrollLeft(),a.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie){a={top:0,left:0}}return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.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()}}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,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;a.containment=="parent"&&(a.containment=this.helper[0].parentNode);if(a.containment=="document"||a.containment=="window"){this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var j=d(a.containment),i=j[0];if(!i){return}var h=j.offset(),g=d(i).css("overflow")!="hidden";this.containment=[(parseInt(d(i).css("borderLeftWidth"),10)||0)+(parseInt(d(i).css("paddingLeft"),10)||0),(parseInt(d(i).css("borderTopWidth"),10)||0)+(parseInt(d(i).css("paddingTop"),10)||0),(g?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(d(i).css("borderLeftWidth"),10)||0)-(parseInt(d(i).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(g?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(d(i).css("borderTopWidth"),10)||0)-(parseInt(d(i).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=j}else{a.containment.constructor==Array&&(this.containment=a.containment)}},_convertPositionTo:function(a,l){l||(l=this.position);var k=a=="absolute"?1:-1,j=this.options,i=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=/(html|body)/i.test(i[0].tagName);return{top:l.top+this.offset.relative.top*k+this.offset.parent.top*k-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():h?0:i.scrollTop())*k),left:l.left+this.offset.relative.left*k+this.offset.parent.left*k-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:i.scrollLeft())*k)}},_generatePosition:function(t){var s=this.options,r=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,q=/(html|body)/i.test(r[0].tagName),p=t.pageX,o=t.pageY;if(this.originalPosition){var n;if(this.containment){if(this.relative_container){var m=this.relative_container.offset();n=[this.containment[0]+m.left,this.containment[1]+m.top,this.containment[2]+m.left,this.containment[3]+m.top]}else{n=this.containment}t.pageX-this.offset.click.left<n[0]&&(p=n[0]+this.offset.click.left),t.pageY-this.offset.click.top<n[1]&&(o=n[1]+this.offset.click.top),t.pageX-this.offset.click.left>n[2]&&(p=n[2]+this.offset.click.left),t.pageY-this.offset.click.top>n[3]&&(o=n[3]+this.offset.click.top)}if(s.grid){var l=s.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY;o=n?l-this.offset.click.top<n[1]||l-this.offset.click.top>n[3]?l-this.offset.click.top<n[1]?l+s.grid[1]:l-s.grid[1]:l:l;var a=s.grid[0]?this.originalPageX+Math.round((p-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX;p=n?a-this.offset.click.left<n[0]||a-this.offset.click.left>n[2]?a-this.offset.click.left<n[0]?a+s.grid[0]:a-s.grid[0]:a:a}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():q?0:r.scrollTop()),left:p-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():q?0:r.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(a,f,e){e=e||this._uiHash(),d.ui.plugin.call(this,a,[f,e]),a=="drag"&&(this.positionAbs=this._convertPositionTo("absolute"));return d.Widget.prototype._trigger.call(this,a,f,e)},plugins:{},_uiHash:function(b){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),d.extend(d.ui.draggable,{version:"1.8.18"}),d.ui.plugin.add("draggable","connectToSortable",{start:function(a,j){var i=d(this).data("draggable"),h=i.options,g=d.extend({},j,{item:i.element});i.sortables=[],d(h.connectToSortable).each(function(){var b=d.data(this,"sortable");b&&!b.options.disabled&&(i.sortables.push({instance:b,shouldRevert:b.options.revert}),b.refreshPositions(),b._trigger("activate",a,g))})},stop:function(a,h){var g=d(this).data("draggable"),f=d.extend({},h,{item:g.element});d.each(g.sortables,function(){this.instance.isOver?(this.instance.isOver=0,g.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(a),this.instance.options.helper=this.instance.options._helper,g.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",a,f))})},drag:function(a,j){var i=d(this).data("draggable"),h=this,g=function(s){var r=this.offset.click.top,q=this.offset.click.left,p=this.positionAbs.top,o=this.positionAbs.left,n=s.height,m=s.width,l=s.top,k=s.left;return d.ui.isOver(p+r,o+q,l,k,n,m)};d.each(i.sortables,function(b){this.instance.positionAbs=i.positionAbs,this.instance.helperProportions=i.helperProportions,this.instance.offset.click=i.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=d(h).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return j.helper[0]},a.target=this.instance.currentItem[0],this.instance._mouseCapture(a,!0),this.instance._mouseStart(a,!0,!0),this.instance.offset.click.top=i.offset.click.top,this.instance.offset.click.left=i.offset.click.left,this.instance.offset.parent.left-=i.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=i.offset.parent.top-this.instance.offset.parent.top,i._trigger("toSortable",a),i.dropped=this.instance.element,i.currentItem=i.element,this.instance.fromOutside=i),this.instance.currentItem&&this.instance._mouseDrag(a)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",a,this.instance._uiHash(this.instance)),this.instance._mouseStop(a,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),i._trigger("fromSortable",a),i.dropped=!1)})}}),d.ui.plugin.add("draggable","cursor",{start:function(a,h){var g=d("body"),f=d(this).data("draggable").options;g.css("cursor")&&(f._cursor=g.css("cursor")),g.css("cursor",f.cursor)},stop:function(a,f){var e=d(this).data("draggable").options;e._cursor&&d("body").css("cursor",e._cursor)}}),d.ui.plugin.add("draggable","opacity",{start:function(a,h){var g=d(h.helper),f=d(this).data("draggable").options;g.css("opacity")&&(f._opacity=g.css("opacity")),g.css("opacity",f.opacity)},stop:function(a,f){var e=d(this).data("draggable").options;e._opacity&&d(f.helper).css("opacity",e._opacity)}}),d.ui.plugin.add("draggable","scroll",{start:function(a,f){var e=d(this).data("draggable");e.scrollParent[0]!=document&&e.scrollParent[0].tagName!="HTML"&&(e.overflowOffset=e.scrollParent.offset())},drag:function(a,j){var i=d(this).data("draggable"),h=i.options,g=!1;if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!="HTML"){if(!h.axis||h.axis!="x"){i.overflowOffset.top+i.scrollParent[0].offsetHeight-a.pageY<h.scrollSensitivity?i.scrollParent[0].scrollTop=g=i.scrollParent[0].scrollTop+h.scrollSpeed:a.pageY-i.overflowOffset.top<h.scrollSensitivity&&(i.scrollParent[0].scrollTop=g=i.scrollParent[0].scrollTop-h.scrollSpeed)}if(!h.axis||h.axis!="y"){i.overflowOffset.left+i.scrollParent[0].offsetWidth-a.pageX<h.scrollSensitivity?i.scrollParent[0].scrollLeft=g=i.scrollParent[0].scrollLeft+h.scrollSpeed:a.pageX-i.overflowOffset.left<h.scrollSensitivity&&(i.scrollParent[0].scrollLeft=g=i.scrollParent[0].scrollLeft-h.scrollSpeed)}}else{if(!h.axis||h.axis!="x"){a.pageY-d(document).scrollTop()<h.scrollSensitivity?g=d(document).scrollTop(d(document).scrollTop()-h.scrollSpeed):d(window).height()-(a.pageY-d(document).scrollTop())<h.scrollSensitivity&&(g=d(document).scrollTop(d(document).scrollTop()+h.scrollSpeed))}if(!h.axis||h.axis!="y"){a.pageX-d(document).scrollLeft()<h.scrollSensitivity?g=d(document).scrollLeft(d(document).scrollLeft()-h.scrollSpeed):d(window).width()-(a.pageX-d(document).scrollLeft())<h.scrollSensitivity&&(g=d(document).scrollLeft(d(document).scrollLeft()+h.scrollSpeed))}}g!==!1&&d.ui.ddmanager&&!h.dropBehaviour&&d.ui.ddmanager.prepareOffsets(i,a)}}),d.ui.plugin.add("draggable","snap",{start:function(a,h){var g=d(this).data("draggable"),f=g.options;g.snapElements=[],d(f.snap.constructor!=String?f.snap.items||":data(draggable)":f.snap).each(function(){var e=d(this),i=e.offset();this!=g.element[0]&&g.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})})},drag:function(L,K){var J=d(this).data("draggable"),I=J.options,H=I.snapTolerance,G=K.offset.left,F=G+J.helperProportions.width,E=K.offset.top,D=E+J.helperProportions.height;for(var C=J.snapElements.length-1;C>=0;C--){var B=J.snapElements[C].left,A=B+J.snapElements[C].width,z=J.snapElements[C].top,y=z+J.snapElements[C].height;if(!(B-H<G&&G<A+H&&z-H<E&&E<y+H||B-H<G&&G<A+H&&z-H<D&&D<y+H||B-H<F&&F<A+H&&z-H<E&&E<y+H||B-H<F&&F<A+H&&z-H<D&&D<y+H)){J.snapElements[C].snapping&&J.options.snap.release&&J.options.snap.release.call(J.element,L,d.extend(J._uiHash(),{snapItem:J.snapElements[C].item})),J.snapElements[C].snapping=!1;continue}if(I.snapMode!="inner"){var x=Math.abs(z-D)<=H,w=Math.abs(y-E)<=H,v=Math.abs(B-F)<=H,u=Math.abs(A-G)<=H;x&&(K.position.top=J._convertPositionTo("relative",{top:z-J.helperProportions.height,left:0}).top-J.margins.top),w&&(K.position.top=J._convertPositionTo("relative",{top:y,left:0}).top-J.margins.top),v&&(K.position.left=J._convertPositionTo("relative",{top:0,left:B-J.helperProportions.width}).left-J.margins.left),u&&(K.position.left=J._convertPositionTo("relative",{top:0,left:A}).left-J.margins.left)}var a=x||w||v||u;if(I.snapMode!="outer"){var x=Math.abs(z-E)<=H,w=Math.abs(y-D)<=H,v=Math.abs(B-G)<=H,u=Math.abs(A-F)<=H;x&&(K.position.top=J._convertPositionTo("relative",{top:z,left:0}).top-J.margins.top),w&&(K.position.top=J._convertPositionTo("relative",{top:y-J.helperProportions.height,left:0}).top-J.margins.top),v&&(K.position.left=J._convertPositionTo("relative",{top:0,left:B}).left-J.margins.left),u&&(K.position.left=J._convertPositionTo("relative",{top:0,left:A-J.helperProportions.width}).left-J.margins.left)}!J.snapElements[C].snapping&&(x||w||v||u||a)&&J.options.snap.snap&&J.options.snap.snap.call(J.element,L,d.extend(J._uiHash(),{snapItem:J.snapElements[C].item})),J.snapElements[C].snapping=x||w||v||u||a}}}),d.ui.plugin.add("draggable","stack",{start:function(a,j){var i=d(this).data("draggable").options,h=d.makeArray(d(i.stack)).sort(function(e,f){return(parseInt(d(e).css("zIndex"),10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(!!h.length){var g=parseInt(h[0].style.zIndex)||0;d(h).each(function(b){this.style.zIndex=g+b}),this[0].style.zIndex=g+h.length}}}),d.ui.plugin.add("draggable","zIndex",{start:function(a,h){var g=d(h.helper),f=d(this).data("draggable").options;g.css("zIndex")&&(f._zIndex=g.css("zIndex")),g.css("zIndex",f.zIndex)},stop:function(a,f){var e=d(this).data("draggable").options;e._zIndex&&d(f.helper).css("zIndex",e._zIndex)}})})(jQuery);(function(d,c){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,e=a.accept;this.isover=0,this.isout=1,this.accept=d.isFunction(e)?e:function(b){return b.is(e)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[],d.ui.ddmanager.droppables[a.scope].push(this),a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var a=d.ui.ddmanager.droppables[this.options.scope];for(var e=0;e<a.length;e++){a[e]==this&&a.splice(e,1)}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,e){a=="accept"&&(this.accept=d.isFunction(e)?e:function(b){return b.is(e)}),d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var e=d.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),e&&this._trigger("activate",a,this.ui(e))},_deactivate:function(a){var e=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),e&&this._trigger("deactivate",a,this.ui(e))},_over:function(a){var e=d.ui.ddmanager.current;!!e&&(e.currentItem||e.element)[0]!=this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",a,this.ui(e)))},_out:function(a){var e=d.ui.ddmanager.current;!!e&&(e.currentItem||e.element)[0]!=this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",a,this.ui(e)))},_drop:function(a,h){var g=h||d.ui.ddmanager.current;if(!g||(g.currentItem||g.element)[0]==this.element[0]){return !1}var f=!1;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var e=d.data(this,"droppable");if(e.options.greedy&&!e.options.disabled&&e.options.scope==g.options.scope&&e.accept.call(e.element[0],g.currentItem||g.element)&&d.ui.intersect(g,d.extend(e,{offset:e.element.offset()}),e.options.tolerance)){f=!0;return !1}});if(f){return !1}if(this.accept.call(this.element[0],g.currentItem||g.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",a,this.ui(g));return this.element}return !1},ui:function(b){return{draggable:b.currentItem||b.element,helper:b.helper,position:b.position,offset:b.positionAbs}}}),d.extend(d.ui.droppable,{version:"1.8.18"}),d.ui.intersect=function(B,A,z){if(!A.offset){return !1}var y=(B.positionAbs||B.position.absolute).left,x=y+B.helperProportions.width,w=(B.positionAbs||B.position.absolute).top,v=w+B.helperProportions.height,u=A.offset.left,t=u+A.proportions.width,s=A.offset.top,r=s+A.proportions.height;switch(z){case"fit":return u<=y&&x<=t&&s<=w&&v<=r;case"intersect":return u<y+B.helperProportions.width/2&&x-B.helperProportions.width/2<t&&s<w+B.helperProportions.height/2&&v-B.helperProportions.height/2<r;case"pointer":var q=(B.positionAbs||B.position.absolute).left+(B.clickOffset||B.offset.click).left,p=(B.positionAbs||B.position.absolute).top+(B.clickOffset||B.offset.click).top,a=d.ui.isOver(p,q,s,u,A.proportions.height,A.proportions.width);return a;case"touch":return(w>=s&&w<=r||v>=s&&v<=r||w<s&&v>r)&&(y>=u&&y<=t||x>=u&&x<=t||y<u&&x>t);default:return !1}},d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,n){var m=d.ui.ddmanager.droppables[a.options.scope]||[],l=n?n.type:null,k=(a.currentItem||a.element).find(":data(droppable)").andSelf();droppablesLoop:for(var j=0;j<m.length;j++){if(m[j].options.disabled||a&&!m[j].accept.call(m[j].element[0],a.currentItem||a.element)){continue}for(var i=0;i<k.length;i++){if(k[i]==m[j].element[0]){m[j].proportions.height=0;continue droppablesLoop}}m[j].visible=m[j].element.css("display")!="none";if(!m[j].visible){continue}l=="mousedown"&&m[j]._activate.call(m[j],n),m[j].offset=m[j].element.offset(),m[j].proportions={width:m[j].element[0].offsetWidth,height:m[j].element[0].offsetHeight}}},drop:function(a,f){var e=!1;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){!this.options||(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this.options.tolerance)&&(e=this._drop.call(this,f)||e),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem||a.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,f)))});return e},dragStart:function(a,e){a.element.parents(":not(body,html)").bind("scroll.droppable",function(){a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,e)})},drag:function(a,e){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,e),d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var j=d.ui.intersect(a,this,this.options.tolerance),i=!j&&this.isover==1?"isout":j&&this.isover==0?"isover":null;if(!i){return}var h;if(this.options.greedy){var b=this.element.parents(":data(droppable):eq(0)");b.length&&(h=d.data(b[0],"droppable"),h.greedyChild=i=="isover"?1:0)}h&&i=="isover"&&(h.isover=0,h.isout=1,h._out.call(h,e)),this[i]=1,this[i=="isout"?"isover":"isout"]=0,this[i=="isover"?"_over":"_out"].call(this,e),h&&i=="isout"&&(h.isout=0,h.isover=1,h._over.call(h,e))}})},dragStop:function(a,e){a.element.parents(":not(body,html)").unbind("scroll.droppable"),a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,e)}}})(jQuery);(function(f,e){f.widget("ui.resizable",f.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var a=this,n=this.options;this.element.addClass("ui-resizable"),f.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(f('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=n.handles||(f(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var m=this.handles.split(",");this.handles={};for(var l=0;l<m.length;l++){var k=f.trim(m[l]),j="ui-resizable-"+k,i=f('<div class="ui-resizable-handle '+j+'"></div>');/sw|se|ne|nw/.test(k)&&i.css({zIndex:++n.zIndex}),"se"==k&&i.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[k]=".ui-resizable-"+k,this.element.append(i)}}this._renderAxis=function(o){o=o||this.element;for(var s in this.handles){this.handles[s].constructor==String&&(this.handles[s]=f(this.handles[s],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var r=f(this.handles[s],this.element),q=0;q=/sw|ne|nw|se|n|s/.test(s)?r.outerHeight():r.outerWidth();var p=["padding",/ne|nw|n/.test(s)?"Top":/se|sw|s/.test(s)?"Bottom":/^e$/.test(s)?"Right":"Left"].join("");o.css(p,q),this._proportionallyResize()}if(!f(this.handles[s]).length){continue}}},this._renderAxis(this.element),this._handles=f(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!a.resizing){if(this.className){var b=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}a.axis=b&&b[1]?b[1]:"se"}}),n.autoHide&&(this._handles.hide(),f(this.element).addClass("ui-resizable-autohide").hover(function(){n.disabled||(f(this).removeClass("ui-resizable-autohide"),a._handles.show())},function(){n.disabled||a.resizing||(f(this).addClass("ui-resizable-autohide"),a._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var a=function(c){f(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){a(this.element);var d=this.element;d.after(this.originalElement.css({position:d.css("position"),width:d.outerWidth(),height:d.outerHeight(),top:d.css("top"),left:d.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle),a(this.originalElement);return this},_mouseCapture:function(a){var j=!1;for(var i in this.handles){f(this.handles[i])[0]==a.target&&(j=!0)}return !this.options.disabled&&j},_mouseStart:function(a){var n=this.options,m=this.element.position(),l=this.element;this.resizing=!0,this.documentScroll={top:f(document).scrollTop(),left:f(document).scrollLeft()},(l.is(".ui-draggable")||/absolute/.test(l.css("position")))&&l.css({position:"absolute",top:(m.top/fluid.zoom.getCurrentScale()),left:(m.left/fluid.zoom.getCurrentScale())}),this._renderProxy();var k=h(this.helper.css("left")),j=h(this.helper.css("top"));n.containment&&(k+=f(n.containment).scrollLeft()||0,j+=f(n.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:k,top:j},this.size=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()},this.originalSize=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()},this.originalPosition={left:k,top:j},this.sizeDiff={width:l.outerWidth()-l.width(),height:l.outerHeight()-l.height()},this.originalMousePosition={left:a.pageX,top:a.pageY},this.aspectRatio=typeof n.aspectRatio=="number"?n.aspectRatio:this.originalSize.width/this.originalSize.height||1;var c=f(".ui-resizable-"+this.axis).css("cursor");f("body").css("cursor",c=="auto"?this.axis+"-resize":c),l.addClass("ui-resizable-resizing"),this._propagate("start",a);return !0},_mouseDrag:function(z){var y=this.helper,x=this.options,w={},v=this,u=this.originalMousePosition,t=this.axis,s=z.pageX-u.left||0,r=z.pageY-u.top||0,q=this._change[t],A=fluid.zoom.getCurrentScale();if($(this.element).parents("#canvas").length){s=s/A;r=r/A}if(!q){return !1}var p=q.apply(this,[z,s,r]),o=f.browser.msie&&f.browser.version<7,a=this.sizeDiff;this._updateVirtualBoundaries(z.shiftKey);if(this._aspectRatio||z.shiftKey){p=this._updateRatio(p,z)}p=this._respectSize(p,z),this._propagate("resize",z),y.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(p),this._trigger("resize",z,this.ui());return !1},_mouseStop:function(t){this.resizing=!1;var s=this.options,r=this;if(this._helper){var q=this._proportionallyResizeElements,p=q.length&&/textarea/i.test(q[0].nodeName),o=p&&f.ui.hasScroll(q[0],"left")?0:r.sizeDiff.height,n=p?0:r.sizeDiff.width,m={width:r.helper.width()-n,height:r.helper.height()-o},l=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,a=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;s.animate||this.element.css(f.extend(m,{top:a,left:l})),r.helper.height(r.size.height),r.helper.width(r.size.width),this._helper&&!s.animate&&this._proportionallyResize()}f("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove();return !1},_updateVirtualBoundaries:function(i){var d=this.options,n,m,l,k,j;j={minWidth:g(d.minWidth)?d.minWidth:0,maxWidth:g(d.maxWidth)?d.maxWidth:Infinity,minHeight:g(d.minHeight)?d.minHeight:0,maxHeight:g(d.maxHeight)?d.maxHeight:Infinity};if(this._aspectRatio||i){n=j.minHeight*this.aspectRatio,l=j.minWidth/this.aspectRatio,m=j.maxHeight*this.aspectRatio,k=j.maxWidth/this.aspectRatio,n>j.minWidth&&(j.minWidth=n),l>j.minHeight&&(j.minHeight=l),m<j.maxWidth&&(j.maxWidth=m),k<j.maxHeight&&(j.maxHeight=k)}this._vBoundaries=j},_updateCache:function(d){var c=this.options;this.offset=this.helper.offset(),g(d.left)&&(this.position.left=d.left),g(d.top)&&(this.position.top=d.top),g(d.height)&&(this.size.height=d.height),g(d.width)&&(this.size.width=d.width)},_updateRatio:function(i,d){var m=this.options,l=this.position,k=this.size,j=this.axis;g(i.height)?i.width=i.height*this.aspectRatio:g(i.width)&&(i.height=i.width/this.aspectRatio),j=="sw"&&(i.left=l.left+(k.width-i.width),i.top=null),j=="nw"&&(i.top=l.top+(k.height-i.height),i.left=l.left+(k.width-i.width));return i},_respectSize:function(D,C){var B=this.helper,A=this._vBoundaries,z=this._aspectRatio||C.shiftKey,y=this.axis,x=g(D.width)&&A.maxWidth&&A.maxWidth<D.width,w=g(D.height)&&A.maxHeight&&A.maxHeight<D.height,v=g(D.width)&&A.minWidth&&A.minWidth>D.width,u=g(D.height)&&A.minHeight&&A.minHeight>D.height;v&&(D.width=A.minWidth),u&&(D.height=A.minHeight),x&&(D.width=A.maxWidth),w&&(D.height=A.maxHeight);var t=this.originalPosition.left+this.originalSize.width,s=this.position.top+this.size.height,r=/sw|nw|w/.test(y),q=/nw|ne|n/.test(y);v&&r&&(D.left=t-A.minWidth),x&&r&&(D.left=t-A.maxWidth),u&&q&&(D.top=s-A.minHeight),w&&q&&(D.top=s-A.maxHeight);var d=!D.width&&!D.height;d&&!D.left&&D.top?D.top=null:d&&!D.top&&D.left&&(D.left=null);return D},_proportionallyResize:function(){var a=this.options;if(!!this._proportionallyResizeElements.length){var m=this.helper||this.element;for(var l=0;l<this._proportionallyResizeElements.length;l++){var k=this._proportionallyResizeElements[l];if(!this.borderDif){var j=[k.css("borderTopWidth"),k.css("borderRightWidth"),k.css("borderBottomWidth"),k.css("borderLeftWidth")],i=[k.css("paddingTop"),k.css("paddingRight"),k.css("paddingBottom"),k.css("paddingLeft")];this.borderDif=f.map(j,function(o,n){var q=parseInt(o,10)||0,p=parseInt(i[n],10)||0;return q+p})}if(f.browser.msie&&(!!f(m).is(":hidden")||!!f(m).parents(":hidden").length)){continue}k.css({height:m.height()-this.borderDif[0]-this.borderDif[2]||0,width:m.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var a=this.element,l=this.options;this.elementOffset=a.offset();if(this._helper){this.helper=this.helper||f('<div style="overflow:hidden;"></div>');var k=f.browser.msie&&f.browser.version<7,j=k?1:0,i=k?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+i,height:this.element.outerHeight()+i,position:"absolute",left:this.elementOffset.left-j+"px",top:this.elementOffset.top-j+"px",zIndex:++l.zIndex}),this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(i,d,j){return{width:this.originalSize.width+d}},w:function(j,i,n){var m=this.options,l=this.originalSize,k=this.originalPosition;return{left:k.left+i,width:l.width-i}},n:function(j,i,n){var m=this.options,l=this.originalSize,k=this.originalPosition;return{top:k.top+n,height:l.height-n}},s:function(i,d,j){return{height:this.originalSize.height+j}},se:function(a,j,i){return f.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[a,j,i]))},sw:function(a,j,i){return f.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[a,j,i]))},ne:function(a,j,i){return f.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[a,j,i]))},nw:function(a,j,i){return f.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[a,j,i]))}},_propagate:function(a,d){f.ui.plugin.call(this,a,[d,this.ui()]),a!="resize"&&this._trigger(a,d,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),f.extend(f.ui.resizable,{version:"1.8.18"}),f.ui.plugin.add("resizable","alsoResize",{start:function(a,l){var k=f(this).data("resizable"),j=k.options,i=function(c){f(c).each(function(){var d=f(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10)})})};typeof j.alsoResize=="object"&&!j.alsoResize.parentNode?j.alsoResize.length?(j.alsoResize=j.alsoResize[0],i(j.alsoResize)):f.each(j.alsoResize,function(b){i(b)}):i(j.alsoResize)},resize:function(a,p){var o=f(this).data("resizable"),n=o.options,m=o.originalSize,l=o.originalPosition,k={height:o.size.height-m.height||0,width:o.size.width-m.width||0,top:o.position.top-l.top||0,left:o.position.left-l.left||0},j=function(c,i){f(c).each(function(){var d=f(this),s=f(this).data("resizable-alsoresize"),r={},q=i&&i.length?i:d.parents(p.originalElement[0]).length?["width","height"]:["width","height","top","left"];f.each(q,function(u,t){var v=(s[t]||0)+(k[t]||0);v&&v>=0&&(r[t]=v||null)}),d.css(r)})};typeof n.alsoResize=="object"&&!n.alsoResize.nodeType?f.each(n.alsoResize,function(d,c){j(d,c)}):j(n.alsoResize)},stop:function(a,d){f(this).removeData("resizable-alsoresize")}}),f.ui.plugin.add("resizable","animate",{stop:function(v,u){var t=f(this).data("resizable"),s=t.options,r=t._proportionallyResizeElements,q=r.length&&/textarea/i.test(r[0].nodeName),p=q&&f.ui.hasScroll(r[0],"left")?0:t.sizeDiff.height,o=q?0:t.sizeDiff.width,n={width:t.size.width-o,height:t.size.height-p},m=parseInt(t.element.css("left"),10)+(t.position.left-t.originalPosition.left)||null,a=parseInt(t.element.css("top"),10)+(t.position.top-t.originalPosition.top)||null;t.element.animate(f.extend(n,a&&m?{top:a,left:m}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var b={width:parseInt(t.element.css("width"),10),height:parseInt(t.element.css("height"),10),top:parseInt(t.element.css("top"),10),left:parseInt(t.element.css("left"),10)};r&&r.length&&f(r[0]).css({width:b.width,height:b.height}),t._updateCache(b),t._propagate("resize",v)}})}}),f.ui.plugin.add("resizable","containment",{start:function(B,A){var z=f(this).data("resizable"),y=z.options,x=z.element,w=y.containment,v=w instanceof f?w.get(0):/parent/.test(w)?x.parent().get(0):w;if(!!v){z.containerElement=f(v);if(/document/.test(w)||w==document){z.containerOffset={left:0,top:0},z.containerPosition={left:0,top:0},z.parentData={element:f(document),left:0,top:0,width:f(document).width(),height:f(document).height()||document.body.parentNode.scrollHeight}}else{var u=f(v),t=[];f(["Top","Right","Left","Bottom"]).each(function(i,d){t[i]=h(u.css("padding"+d))}),z.containerOffset=u.offset(),z.containerPosition=u.position(),z.containerSize={height:u.innerHeight()-t[3],width:u.innerWidth()-t[1]};var s=z.containerOffset,r=z.containerSize.height,q=z.containerSize.width,c=f.ui.hasScroll(v,"left")?v.scrollWidth:q,a=f.ui.hasScroll(v)?v.scrollHeight:r;z.parentData={element:v,left:s.left,top:s.top,width:c,height:a}}}},resize:function(D,C){var B=f(this).data("resizable"),A=B.options,z=B.containerSize,y=B.containerOffset,x=B.size,w=B.position,v=B._aspectRatio||D.shiftKey,u={top:0,left:0},t=B.containerElement;t[0]!=document&&/static/.test(t.css("position"))&&(u=y),w.left<(B._helper?y.left:0)&&(B.size.width=B.size.width+(B._helper?B.position.left-y.left:B.position.left-u.left),v&&(B.size.height=B.size.width/A.aspectRatio),B.position.left=A.helper?y.left:0),w.top<(B._helper?y.top:0)&&(B.size.height=B.size.height+(B._helper?B.position.top-y.top:B.position.top),v&&(B.size.width=B.size.height*A.aspectRatio),B.position.top=B._helper?y.top:0),B.offset.left=B.parentData.left+B.position.left,B.offset.top=B.parentData.top+B.position.top;var s=Math.abs((B._helper?B.offset.left-u.left:B.offset.left-u.left)+B.sizeDiff.width),r=Math.abs((B._helper?B.offset.top-u.top:B.offset.top-y.top)+B.sizeDiff.height),q=B.containerElement.get(0)==B.element.parent().get(0),a=/relative|absolute/.test(B.containerElement.css("position"));q&&a&&(s-=B.parentData.left),s+B.size.width>=B.parentData.width&&(B.size.width=B.parentData.width-s,v&&(B.size.height=B.size.width/B.aspectRatio)),r+B.size.height>=B.parentData.height&&(B.size.height=B.parentData.height-r,v&&(B.size.width=B.size.height*B.aspectRatio))},stop:function(x,w){var v=f(this).data("resizable"),u=v.options,t=v.position,s=v.containerOffset,r=v.containerPosition,q=v.containerElement,p=f(v.helper),o=p.offset(),n=p.outerWidth()-v.sizeDiff.width,a=p.outerHeight()-v.sizeDiff.height;v._helper&&!u.animate&&/relative/.test(q.css("position"))&&f(this).css({left:o.left-r.left-s.left,width:n,height:a}),v._helper&&!u.animate&&/static/.test(q.css("position"))&&f(this).css({left:o.left-r.left-s.left,width:n,height:a})}}),f.ui.plugin.add("resizable","ghost",{start:function(a,l){var k=f(this).data("resizable"),j=k.options,i=k.size;k.ghost=k.originalElement.clone(),k.ghost.css({opacity:0.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof j.ghost=="string"?j.ghost:""),k.ghost.appendTo(k.helper)},resize:function(a,k){var j=f(this).data("resizable"),i=j.options;j.ghost&&j.ghost.css({position:"relative",height:j.size.height,width:j.size.width})},stop:function(a,k){var j=f(this).data("resizable"),i=j.options;j.ghost&&j.helper&&j.helper.get(0).removeChild(j.ghost.get(0))}}),f.ui.plugin.add("resizable","grid",{resize:function(v,u){var t=f(this).data("resizable"),s=t.options,r=t.size,q=t.originalSize,p=t.originalPosition,o=t.axis,n=s._aspectRatio||v.shiftKey;s.grid=typeof s.grid=="number"?[s.grid,s.grid]:s.grid;var m=Math.round((r.width-q.width)/(s.grid[0]||1))*(s.grid[0]||1),a=Math.round((r.height-q.height)/(s.grid[1]||1))*(s.grid[1]||1);/^(se|s|e)$/.test(o)?(t.size.width=q.width+m,t.size.height=q.height+a):/^(ne)$/.test(o)?(t.size.width=q.width+m,t.size.height=q.height+a,t.position.top=p.top-a):/^(sw)$/.test(o)?(t.size.width=q.width+m,t.size.height=q.height+a,t.position.left=p.left-m):(t.size.width=q.width+m,t.size.height=q.height+a,t.position.top=p.top-a,t.position.left=p.left-m)}});var h=function(b){return parseInt(b,10)||0},g=function(b){return !isNaN(parseInt(b,10))}})(jQuery);(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var d;this.refresh=function(){var e=(this.element.hasClass("screen")&&typeof fluid!=="undefined"&&fluid.zoom?fluid.zoom.getCurrentScale():1);d=a(c.options.filter,c.element[0]);d.addClass("ui-selectee");d.each(function(){var f=a(this);var g=f.offset();a.data(this,"selectable-item",{element:this,$element:f,left:g.left,top:g.top,right:g.left+f.outerWidth()*e,bottom:g.top+f.outerHeight()*e,startselected:false,selected:f.hasClass("ui-selected"),selecting:f.hasClass("ui-selecting"),unselecting:f.hasClass("ui-unselecting")})})};this.refresh();this.selectees=d.addClass("ui-selectee");this._mouseInit();this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(e){var c=this;this.opos=[e.pageX,e.pageY];if(this.options.disabled||fluid.viewMgr.getView().viewName!=="projectEditing"){return}var d=this.options;this.selectees=a(d.filter,this.element[0]);this._trigger("start",e);a(d.appendTo).append(this.helper);this.helper.css({left:e.clientX,top:e.clientY,width:0,height:0});if(d.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var f=a.data(this,"selectable-item");f.startselected=true;if(!e.metaKey&&!e.ctrlKey&&!e.shiftKey){f.$element.removeClass("ui-selected");f.selected=false;f.$element.addClass("ui-unselecting");f.unselecting=true;c._trigger("unselecting",e,{unselecting:f.element})}});a(e.target).parents().andSelf().each(function(){var g=a.data(this,"selectable-item");if(g){var f=(!e.metaKey&&!e.ctrlKey&&!e.shiftKey)||!g.$element.hasClass("ui-selected");g.$element.removeClass(f?"ui-unselecting":"ui-selected").addClass(f?"ui-selecting":"ui-unselecting");g.unselecting=!f;g.selecting=f;g.selected=f;if(f){c._trigger("selecting",e,{selecting:g.element})}else{c._trigger("unselecting",e,{unselecting:g.element})}return false}})},_mouseDrag:function(j){if(fluid.viewMgr.getView().viewName!=="projectEditing"){return}var d=this;this.dragged=true;if(this.options.disabled){return}var f=this.options;var e=this.opos[0],i=this.opos[1],c=j.pageX,h=j.pageY;if(e>c){var g=c;c=e;e=g}if(i>h){var g=h;h=i;i=g}this.helper.css({left:e,top:i,width:c-e,height:h-i});this.selectees.each(function(){var k=a.data(this,"selectable-item");if(!k||k.element==d.element[0]){return}var l=false;if(f.tolerance=="touch"){l=(!(k.left>c||k.right<e||k.top>h||k.bottom<i))}else{if(f.tolerance=="fit"){l=(k.left>e&&k.right<c&&k.top>i&&k.bottom<h)}}if(l){if(k.selected){k.$element.removeClass("ui-selected");k.selected=false}if(k.unselecting){k.$element.removeClass("ui-unselecting");k.unselecting=false}if(!k.selecting){k.$element.addClass("ui-selecting");k.selecting=true;d._trigger("selecting",j,{selecting:k.element})}}else{if(k.selecting){if((j.metaKey||j.ctrlKey||j.shiftKey)&&k.startselected){k.$element.removeClass("ui-selecting");k.selecting=false;k.$element.addClass("ui-selected");k.selected=true}else{k.$element.removeClass("ui-selecting");k.selecting=false;if(k.startselected){k.$element.addClass("ui-unselecting");k.unselecting=true}d._trigger("unselecting",j,{unselecting:k.element})}}if(k.selected){if(!j.metaKey&&!j.ctrlKey&&!j.shiftKey&&!k.startselected){k.$element.removeClass("ui-selected");k.selected=false;k.$element.addClass("ui-unselecting");k.unselecting=true;d._trigger("unselecting",j,{unselecting:k.element})}}}});return false},_mouseStop:function(e){if(fluid.viewMgr.getView().viewName!=="projectEditing"){return}var c=this;this.dragged=false;var d=this.options;a(".ui-unselecting",this.element[0]).each(function(){var f=a.data(this,"selectable-item");f.$element.removeClass("ui-unselecting");f.unselecting=false;f.startselected=false;c._trigger("unselected",e,{unselected:f.element})});a(".ui-selecting",this.element[0]).each(function(){var f=a.data(this,"selectable-item");f.$element.removeClass("ui-selecting").addClass("ui-selected");f.selecting=false;f.selected=true;f.startselected=true;c._trigger("selected",e,{selected:f.element})});this._trigger("stop",e);this.helper.remove();return false}});a.extend(a.ui.selectable,{version:"1.8.18"})})(jQuery);(function(d,c){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000},_create:function(){var b=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?b.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){d.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--){this.items[a].item.removeData(this.widgetName+"-item")}return this},_setOption:function(a,e){a==="disabled"?(this.options[a]=e,this.widget()[e?"addClass":"removeClass"]("ui-sortable-disabled")):d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,n){var m=this;if(this.reverting){return !1}if(this.options.disabled||this.options.type=="static"){return !1}this._refreshItems(a);var l=null,k=this,j=d(a.target).parents().each(function(){if(d.data(this,m.widgetName+"-item")==k){l=d(this);return !1}});d.data(a.target,m.widgetName+"-item")==k&&(l=d(a.target));if(!l){return !1}if(this.options.handle&&!n){var i=!1;d(this.options.handle,l).find("*").andSelf().each(function(){this==a.target&&(i=!0)});if(!i){return !1}}this.currentItem=l,this._removeCurrentsFromItems();return !0},_mouseStart:function(a,l,k){var j=this.options,i=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(a),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"),d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this._generatePosition(a),this.originalPageX=a.pageX,this.originalPageY=a.pageY,j.cursorAt&&this._adjustOffsetFromHelper(j.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),j.containment&&this._setContainment(),j.cursor&&(d("body").css("cursor")&&(this._storedCursor=d("body").css("cursor")),d("body").css("cursor",j.cursor)),j.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",j.opacity)),j.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",j.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",a,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!k){for(var h=this.containers.length-1;h>=0;h--){this.containers[h]._trigger("activate",a,i._uiHash(this))}}d.ui.ddmanager&&(d.ui.ddmanager.current=this),d.ui.ddmanager&&!j.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(a);return !0},_mouseDrag:function(a){this.position=this._generatePosition(a),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var n=this.options,m=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<n.scrollSensitivity?this.scrollParent[0].scrollTop=m=this.scrollParent[0].scrollTop+n.scrollSpeed:a.pageY-this.overflowOffset.top<n.scrollSensitivity&&(this.scrollParent[0].scrollTop=m=this.scrollParent[0].scrollTop-n.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-a.pageX<n.scrollSensitivity?this.scrollParent[0].scrollLeft=m=this.scrollParent[0].scrollLeft+n.scrollSpeed:a.pageX-this.overflowOffset.left<n.scrollSensitivity&&(this.scrollParent[0].scrollLeft=m=this.scrollParent[0].scrollLeft-n.scrollSpeed)):(a.pageY-d(document).scrollTop()<n.scrollSensitivity?m=d(document).scrollTop(d(document).scrollTop()-n.scrollSpeed):d(window).height()-(a.pageY-d(document).scrollTop())<n.scrollSensitivity&&(m=d(document).scrollTop(d(document).scrollTop()+n.scrollSpeed)),a.pageX-d(document).scrollLeft()<n.scrollSensitivity?m=d(document).scrollLeft(d(document).scrollLeft()-n.scrollSpeed):d(window).width()-(a.pageX-d(document).scrollLeft())<n.scrollSensitivity&&(m=d(document).scrollLeft(d(document).scrollLeft()+n.scrollSpeed))),m!==!1&&d.ui.ddmanager&&!n.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a)}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 l=this.items.length-1;l>=0;l--){var k=this.items[l],j=k.item[0],i=this._intersectsWithPointer(k);if(!i){continue}if(j!=this.currentItem[0]&&this.placeholder[i==1?"next":"prev"]()[0]!=j&&!d.ui.contains(this.placeholder[0],j)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],j):!0)){this.direction=i==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(k)){this._rearrange(a,k)}else{break}this._trigger("change",a,this._uiHash());break}}this._contactContainers(a),d.ui.ddmanager&&d.ui.ddmanager.drag(this,a),this._trigger("sort",a,this._uiHash()),this.lastPositionAbs=this.positionAbs;return !1},_mouseStop:function(a,h){if(!!a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var g=this,f=g.placeholder.offset();g.reverting=!0,d(this.helper).animate({left:f.left-this.offset.parent.left-g.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:f.top-this.offset.parent.top-g.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){g._clear(a)})}else{this._clear(a,h)}return !1}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--){this.containers[e]._trigger("deactivate",null,a._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,a._uiHash(this)),this.containers[e].containerCache.over=0)}}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),d.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(a){var f=this._getItemsAsjQuery(a&&a.connected),e=[];a=a||{},d(f).each(function(){var b=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);b&&e.push((a.key||b[1]+"[]")+"="+(a.key&&a.expression?b[1]:b[2]))}),!e.length&&a.key&&e.push(a.key+"=");return e.join("&")},toArray:function(a){var f=this._getItemsAsjQuery(a&&a.connected),e=[];a=a||{},f.each(function(){e.push(d(a.item||this).attr(a.attribute||"id")||"")});return e},_intersectsWith:function(x){var w=this.positionAbs.left,v=w+this.helperProportions.width,u=this.positionAbs.top,t=u+this.helperProportions.height,s=x.left,r=s+x.width,q=x.top,p=q+x.height,o=this.offset.click.top,n=this.offset.click.left,m=u+o>q&&u+o<p&&w+n>s&&w+n<r;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>x[this.floating?"width":"height"]?m:s<w+this.helperProportions.width/2&&v-this.helperProportions.width/2<r&&q<u+this.helperProportions.height/2&&t-this.helperProportions.height/2<p},_intersectsWithPointer:function(a){var l=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height),k=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width),j=l&&k,i=this._getDragVerticalDirection(),h=this._getDragHorizontalDirection();if(!j){return !1}return this.floating?h&&h=="right"||i=="down"?2:1:i&&(i=="down"?2:1)},_intersectsWithSides:function(a){var j=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height),i=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width),h=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();return this.floating&&g?g=="right"&&i||g=="left"&&!i:h&&(h=="down"&&j||h=="up"&&!j)},_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();return this},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(r){var q=this,p=[],o=[],n=this._connectWith();if(n&&r){for(var m=n.length-1;m>=0;m--){var l=d(n[m]);for(var k=l.length-1;k>=0;k--){var a=d.data(l[k],this.widgetName);a&&a!=this&&!a.options.disabled&&o.push([d.isFunction(a.options.items)?a.options.items.call(a.element):d(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a])}}}o.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var m=o.length-1;m>=0;m--){o[m][0].each(function(){p.push(this)})}return d(p)},_removeCurrentsFromItems:function(){var f=this.currentItem.find(":data("+this.widgetName+"-item)");for(var e=0;e<this.items.length;e++){for(var g=0;g<f.length;g++){f[g]==this.items[e].item[0]&&this.items.splice(e,1)}}},_refreshItems:function(z){this.items=[],this.containers=[this];var y=this.items,x=this,w=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],z,{item:this.currentItem}):d(this.options.items,this.element),this]],v=this._connectWith();if(v&&this.ready){for(var u=v.length-1;u>=0;u--){var t=d(v[u]);for(var s=t.length-1;s>=0;s--){var r=d.data(t[s],this.widgetName);r&&r!=this&&!r.options.disabled&&(w.push([d.isFunction(r.options.items)?r.options.items.call(r.element[0],z,{item:this.currentItem}):d(r.options.items,r.element),r]),this.containers.push(r))}}}for(var u=w.length-1;u>=0;u--){var q=w[u][1],p=w[u][0];for(var s=0,o=p.length;s<o;s++){var a=d(p[s]);a.data(this.widgetName+"-item",q),y.push({item:a,instance:q,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var j=this.items.length-1;j>=0;j--){var i=this.items[j];if(i.instance!=this.currentContainer&&this.currentContainer&&i.item[0]!=this.currentItem[0]){continue}var h=this.options.toleranceElement?d(this.options.toleranceElement,i.item):i.item;a||(i.width=h.outerWidth(),i.height=h.outerHeight());var g=h.offset();i.left=g.left,i.top=g.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var j=this.containers.length-1;j>=0;j--){var g=this.containers[j].element.offset();this.containers[j].containerCache.left=g.left,this.containers[j].containerCache.top=g.top,this.containers[j].containerCache.width=this.containers[j].element.outerWidth(),this.containers[j].containerCache.height=this.containers[j].element.outerHeight()}}return this},_createPlaceholder:function(a){var h=a||this,g=h.options;if(!g.placeholder||g.placeholder.constructor==String){var f=g.placeholder;g.placeholder={element:function(){var e=d(document.createElement(h.currentItem[0].nodeName)).addClass(f||h.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];f||(e.style.visibility="hidden");return e},update:function(i,e){if(!f||!!g.forcePlaceholderSize){e.height()||e.height(h.currentItem.innerHeight()-parseInt(h.currentItem.css("paddingTop")||0,10)-parseInt(h.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(h.currentItem.innerWidth()-parseInt(h.currentItem.css("paddingLeft")||0,10)-parseInt(h.currentItem.css("paddingRight")||0,10))}}}}h.placeholder=d(g.placeholder.element.call(h.element,h.currentItem)),h.currentItem.after(h.placeholder),g.placeholder.update(h,h.placeholder)},_contactContainers:function(r){var q=null,p=null;for(var o=this.containers.length-1;o>=0;o--){if(d.ui.contains(this.currentItem[0],this.containers[o].element[0])){continue}if(this._intersectsWith(this.containers[o].containerCache)){if(q&&d.ui.contains(this.containers[o].element[0],q.element[0])){continue}q=this.containers[o],p=o}else{this.containers[o].containerCache.over&&(this.containers[o]._trigger("out",r,this._uiHash(this)),this.containers[o].containerCache.over=0)}}if(!!q){if(this.containers.length===1){this.containers[p]._trigger("over",r,this._uiHash(this)),this.containers[p].containerCache.over=1}else{if(this.currentContainer!=this.containers[p]){var n=10000,m=null,l=this.positionAbs[this.containers[p].floating?"left":"top"];for(var k=this.items.length-1;k>=0;k--){if(!d.ui.contains(this.containers[p].element[0],this.items[k].item[0])){continue}var a=this.items[k][this.containers[p].floating?"left":"top"];Math.abs(a-l)<n&&(n=Math.abs(a-l),m=this.items[k])}if(!m&&!this.options.dropOnEmpty){return}this.currentContainer=this.containers[p],m?this._rearrange(r,m,null,!0):this._rearrange(r,null,this.containers[p].element,!0),this._trigger("change",r,this._uiHash()),this.containers[p]._trigger("change",r,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",r,this._uiHash(this)),this.containers[p].containerCache.over=1}}}},_createHelper:function(a){var f=this.options,e=d.isFunction(f.helper)?d(f.helper.apply(this.element[0],[a,this.currentItem])):f.helper=="clone"?this.currentItem.clone():this.currentItem;e.parents("body").length||d(f.appendTo!="parent"?f.appendTo:this.currentItem[0].parentNode)[0].appendChild(e[0]),e[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")}),(e[0].style.width==""||f.forceHelperSize)&&e.width(this.currentItem.width()),(e[0].style.height==""||f.forceHelperSize)&&e.height(this.currentItem.height());return e},_adjustOffsetFromHelper:function(a){typeof a=="string"&&(a=a.split(" ")),d.isArray(a)&&(a={left:+a[0],top:+a[1]||0}),"left" in a&&(this.offset.click.left=a.left+this.margins.left),"right" in a&&(this.offset.click.left=this.helperProportions.width-a.right+this.margins.left),"top" in a&&(this.offset.click.top=a.top+this.margins.top),"bottom" in a&&(this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(a.left+=this.scrollParent.scrollLeft(),a.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie){a={top:0,left:0}}return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.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()}}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 a=this.options;a.containment=="parent"&&(a.containment=this.helper[0].parentNode);if(a.containment=="document"||a.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!/^(document|window|parent)$/.test(a.containment)){var h=d(a.containment)[0],g=d(a.containment).offset(),f=d(h).css("overflow")!="hidden";this.containment=[g.left+(parseInt(d(h).css("borderLeftWidth"),10)||0)+(parseInt(d(h).css("paddingLeft"),10)||0)-this.margins.left,g.top+(parseInt(d(h).css("borderTopWidth"),10)||0)+(parseInt(d(h).css("paddingTop"),10)||0)-this.margins.top,g.left+(f?Math.max(h.scrollWidth,h.offsetWidth):h.offsetWidth)-(parseInt(d(h).css("borderLeftWidth"),10)||0)-(parseInt(d(h).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,g.top+(f?Math.max(h.scrollHeight,h.offsetHeight):h.offsetHeight)-(parseInt(d(h).css("borderTopWidth"),10)||0)-(parseInt(d(h).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,l){l||(l=this.position);var k=a=="absolute"?1:-1,j=this.options,i=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=/(html|body)/i.test(i[0].tagName);return{top:l.top+this.offset.relative.top*k+this.offset.parent.top*k-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():h?0:i.scrollTop())*k),left:l.left+this.offset.relative.left*k+this.offset.parent.left*k-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:i.scrollLeft())*k)}},_generatePosition:function(a){var p=this.options,o=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,n=/(html|body)/i.test(o[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var m=a.pageX,l=a.pageY;if(this.originalPosition){this.containment&&(a.pageX-this.offset.click.left<this.containment[0]&&(m=this.containment[0]+this.offset.click.left),a.pageY-this.offset.click.top<this.containment[1]&&(l=this.containment[1]+this.offset.click.top),a.pageX-this.offset.click.left>this.containment[2]&&(m=this.containment[2]+this.offset.click.left),a.pageY-this.offset.click.top>this.containment[3]&&(l=this.containment[3]+this.offset.click.top));if(p.grid){var k=this.originalPageY+Math.round((l-this.originalPageY)/p.grid[1])*p.grid[1];l=this.containment?k-this.offset.click.top<this.containment[1]||k-this.offset.click.top>this.containment[3]?k-this.offset.click.top<this.containment[1]?k+p.grid[1]:k-p.grid[1]:k:k;var j=this.originalPageX+Math.round((m-this.originalPageX)/p.grid[0])*p.grid[0];m=this.containment?j-this.offset.click.left<this.containment[0]||j-this.offset.click.left>this.containment[2]?j-this.offset.click.left<this.containment[0]?j+p.grid[0]:j-p.grid[0]:j:j}}return{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():n?0:o.scrollTop()),left:m-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():n?0:o.scrollLeft())}},_rearrange:function(h,g,l,k){l?l[0].appendChild(this.placeholder[0]):g.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?g.item[0]:g.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var j=this,i=this.counter;window.setTimeout(function(){i==j.counter&&j.refreshPositions(!k)},0)},_clear:function(a,j){this.reverting=!1;var i=[],h=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var g in this._storedCSS){if(this._storedCSS[g]=="auto"||this._storedCSS[g]=="static"){this._storedCSS[g]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}this.fromOutside&&!j&&i.push(function(b){this._trigger("receive",b,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!j&&i.push(function(b){this._trigger("update",b,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){j||i.push(function(b){this._trigger("remove",b,this._uiHash())});for(var g=this.containers.length-1;g>=0;g--){d.ui.contains(this.containers[g].element[0],this.currentItem[0])&&!j&&(i.push(function(b){return function(e){b._trigger("receive",e,this._uiHash(this))}}.call(this,this.containers[g])),i.push(function(b){return function(e){b._trigger("update",e,this._uiHash(this))}}.call(this,this.containers[g])))}}for(var g=this.containers.length-1;g>=0;g--){j||i.push(function(b){return function(e){b._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[g])),this.containers[g].containerCache.over&&(i.push(function(b){return function(e){b._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[g])),this.containers[g].containerCache.over=0)}this._storedCursor&&d("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!j){this._trigger("beforeStop",a,this._uiHash());for(var g=0;g<i.length;g++){i[g].call(this,a)}this._trigger("stop",a,this._uiHash())}return !1}j||this._trigger("beforeStop",a,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!j){for(var g=0;g<i.length;g++){i[g].call(this,a)}this._trigger("stop",a,this._uiHash())}this.fromOutside=!1;return !0},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(a){var e=a||this;return{helper:e.helper,placeholder:e.placeholder||d([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:a?a.element:null}}}),d.extend(d.ui.sortable,{version:"1.8.18"})})(jQuery);jQuery.effects||function(x,w){function m(a){if(!a||typeof a=="number"||x.fx.speeds[a]){return !0}if(typeof a=="string"&&!x.effects[a]){return !0}return !1}function n(a,h,g,f){typeof a=="object"&&(f=h,g=null,h=a,a=h.effect),x.isFunction(h)&&(f=h,g=null,h={});if(typeof h=="number"||x.fx.speeds[h]){f=g,g=h,h={}}x.isFunction(g)&&(f=g,g=null),h=h||{},g=g||h.duration,g=x.fx.off?0:typeof g=="number"?g:g in x.fx.speeds?x.fx.speeds[g]:x.fx.speeds._default,f=f||h.complete;return[a,h,g,f]}function o(f,e){var h={_:0},g;for(g in e){f[g]!=e[g]&&(h[g]=e[g])}return h}function p(a){var f,e;for(f in a){e=a[f],(e==null||x.isFunction(e)||f in r||/scrollbar/.test(f)||!/color/i.test(f)&&isNaN(parseFloat(e)))&&delete a[f]}return a}function q(){var g=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,f={},j,i;if(g&&g.length&&g[0]&&g[g[0]]){var h=g.length;while(h--){j=g[h],typeof g[j]=="string"&&(i=j.replace(/\-(\w)/g,function(d,c){return c.toUpperCase()}),f[i]=g[j])}}else{for(j in g){typeof g[j]=="string"&&(f[j]=g[j])}}return f}function u(a,f){var c;do{c=x.curCSS(a,f);if(c!=""&&c!="transparent"||x.nodeName(a,"body")){break}f="backgroundColor"}while(a=a.parentNode);return v(c)}function v(a){var d;if(a&&a.constructor==Array&&a.length==3){return a}if(d=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(a)){return[parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10)]}if(d=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(a)){return[parseFloat(d[1])*2.55,parseFloat(d[2])*2.55,parseFloat(d[3])*2.55]}if(d=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(a)){return[parseInt(d[1],16),parseInt(d[2],16),parseInt(d[3],16)]}if(d=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(a)){return[parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16),parseInt(d[3]+d[3],16)]}if(d=/rgba\(0, 0, 0, 0\)/.exec(a)){return t.transparent}return t[x.trim(a).toLowerCase()]}x.effects={},x.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(a,c){x.fx.step[c]=function(b){b.colorInit||(b.start=u(b.elem,c),b.end=v(b.end),b.colorInit=!0),b.elem.style[c]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var t={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]},s=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};x.effects.animateClass=function(a,h,g,f){x.isFunction(g)&&(f=g,g=null);return this.queue(function(){var e=x(this),d=e.attr("style")||" ",c=p(q.call(this)),b,i=e.attr("class");x.each(s,function(j,k){a[k]&&e[k+"Class"](a[k])}),b=p(q.call(this)),e.attr("class",i),e.animate(o(c,b),{queue:!1,duration:h,easing:g,complete:function(){x.each(s,function(j,k){a[k]&&e[k+"Class"](a[k])}),typeof e.attr("style")=="object"?(e.attr("style").cssText="",e.attr("style").cssText=d):e.attr("style",d),f&&f.apply(this,arguments),x.dequeue(this)}})})},x.fn.extend({_addClass:x.fn.addClass,addClass:function(a,h,g,f){return h?x.effects.animateClass.apply(this,[{add:a},h,g,f]):this._addClass(a)},_removeClass:x.fn.removeClass,removeClass:function(a,h,g,f){return h?x.effects.animateClass.apply(this,[{remove:a},h,g,f]):this._removeClass(a)},_toggleClass:x.fn.toggleClass,toggleClass:function(j,i,h,b,a){return typeof i=="boolean"||i===w?h?x.effects.animateClass.apply(this,[i?{add:j}:{remove:j},h,b,a]):this._toggleClass(j,i):x.effects.animateClass.apply(this,[{toggle:j},i,h,b])},switchClass:function(a,j,i,h,g){return x.effects.animateClass.apply(this,[{add:j,remove:a},i,h,g])}}),x.extend(x.effects,{version:"1.8.18",save:function(e,d){for(var f=0;f<d.length;f++){d[f]!==null&&e.data("ec.storage."+d[f],e[0].style[d[f]])}},restore:function(e,d){for(var f=0;f<d.length;f++){d[f]!==null&&e.css(d[f],e.data("ec.storage."+d[f]))}},setMode:function(d,c){c=="toggle"&&(c=d.is(":hidden")?"show":"hide");return c},getBaseline:function(f,e){var h,g;switch(f[0]){case"top":h=0;break;case"middle":h=0.5;break;case"bottom":h=1;break;default:h=f[0]/e.height}switch(f[1]){case"left":g=0;break;case"center":g=0.5;break;case"right":g=1;break;default:g=f[1]/e.width}return{x:g,y:h}},createWrapper:function(a){if(a.parent().is(".ui-effects-wrapper")){return a.parent()}var h={width:a.outerWidth(!0),height:a.outerHeight(!0),"float":a.css("float")},g=x("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),f=document.activeElement;a.wrap(g),(a[0]===f||x.contains(a[0],f))&&x(f).focus(),g=a.parent(),a.css("position")=="static"?(g.css({position:"relative"}),a.css({position:"relative"})):(x.extend(h,{position:a.css("position"),zIndex:a.css("z-index")}),x.each(["top","left","bottom","right"],function(b,c){h[c]=a.css(c),isNaN(parseInt(h[c],10))&&(h[c]="auto")}),a.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return g.css(h).show()},removeWrapper:function(a){var f,e=document.activeElement;if(a.parent().is(".ui-effects-wrapper")){f=a.parent().replaceWith(a),(a[0]===e||x.contains(a[0],e))&&x(e).focus();return f}return a},setTransition:function(a,h,g,f){f=f||{},x.each(h,function(b,d){unit=a.cssUnit(d),unit[0]>0&&(f[d]=unit[0]*g+unit[1])});return f}}),x.fn.extend({effect:function(a,B,A,z){var y=n.apply(this,arguments),l={options:y[1],duration:y[2],callback:y[3]},k=l.options.mode,j=x.effects[a];if(x.fx.off||!j){return k?this[k](l.duration,l.callback):this.each(function(){l.callback&&l.callback.call(this)})}return j.call(this,l)},_show:x.fn.show,show:function(d){if(m(d)){return this._show.apply(this,arguments)}var c=n.apply(this,arguments);c[1].mode="show";return this.effect.apply(this,c)},_hide:x.fn.hide,hide:function(d){if(m(d)){return this._hide.apply(this,arguments)}var c=n.apply(this,arguments);c[1].mode="hide";return this.effect.apply(this,c)},__toggle:x.fn.toggle,toggle:function(a){if(m(a)||typeof a=="boolean"||x.isFunction(a)){return this.__toggle.apply(this,arguments)}var d=n.apply(this,arguments);d[1].mode="toggle";return this.effect.apply(this,d)},cssUnit:function(a){var f=this.css(a),e=[];x.each(["em","px","%","pt"],function(d,c){f.indexOf(c)>0&&(e=[parseFloat(f),c])});return e}}),x.easing.jswing=x.easing.swing,x.extend(x.easing,{def:"easeOutQuad",swing:function(a,j,i,h,g){return x.easing[x.easing.def](a,j,i,h,g)},easeInQuad:function(g,f,j,i,h){return i*(f/=h)*f+j},easeOutQuad:function(g,f,j,i,h){return -i*(f/=h)*(f-2)+j},easeInOutQuad:function(g,f,j,i,h){if((f/=h/2)<1){return i/2*f*f+j}return -i/2*(--f*(f-2)-1)+j},easeInCubic:function(g,f,j,i,h){return i*(f/=h)*f*f+j},easeOutCubic:function(g,f,j,i,h){return i*((f=f/h-1)*f*f+1)+j},easeInOutCubic:function(g,f,j,i,h){if((f/=h/2)<1){return i/2*f*f*f+j}return i/2*((f-=2)*f*f+2)+j},easeInQuart:function(g,f,j,i,h){return i*(f/=h)*f*f*f+j},easeOutQuart:function(g,f,j,i,h){return -i*((f=f/h-1)*f*f*f-1)+j},easeInOutQuart:function(g,f,j,i,h){if((f/=h/2)<1){return i/2*f*f*f*f+j}return -i/2*((f-=2)*f*f*f-2)+j},easeInQuint:function(g,f,j,i,h){return i*(f/=h)*f*f*f*f+j},easeOutQuint:function(g,f,j,i,h){return i*((f=f/h-1)*f*f*f*f+1)+j},easeInOutQuint:function(g,f,j,i,h){if((f/=h/2)<1){return i/2*f*f*f*f*f+j}return i/2*((f-=2)*f*f*f*f+2)+j},easeInSine:function(g,f,j,i,h){return -i*Math.cos(f/h*(Math.PI/2))+i+j},easeOutSine:function(g,f,j,i,h){return i*Math.sin(f/h*(Math.PI/2))+j},easeInOutSine:function(g,f,j,i,h){return -i/2*(Math.cos(Math.PI*f/h)-1)+j},easeInExpo:function(g,f,j,i,h){return f==0?j:i*Math.pow(2,10*(f/h-1))+j},easeOutExpo:function(g,f,j,i,h){return f==h?j+i:i*(-Math.pow(2,-10*f/h)+1)+j},easeInOutExpo:function(g,f,j,i,h){if(f==0){return j}if(f==h){return j+i}if((f/=h/2)<1){return i/2*Math.pow(2,10*(f-1))+j}return i/2*(-Math.pow(2,-10*--f)+2)+j},easeInCirc:function(g,f,j,i,h){return -i*(Math.sqrt(1-(f/=h)*f)-1)+j},easeOutCirc:function(g,f,j,i,h){return i*Math.sqrt(1-(f=f/h-1)*f)+j},easeInOutCirc:function(g,f,j,i,h){if((f/=h/2)<1){return -i/2*(Math.sqrt(1-f*f)-1)+j}return i/2*(Math.sqrt(1-(f-=2)*f)+1)+j},easeInElastic:function(j,i,B,A,z){var y=1.70158,l=0,k=A;if(i==0){return B}if((i/=z)==1){return B+A}l||(l=z*0.3);if(k<Math.abs(A)){k=A;var y=l/4}else{var y=l/(2*Math.PI)*Math.asin(A/k)}return -(k*Math.pow(2,10*(i-=1))*Math.sin((i*z-y)*2*Math.PI/l))+B},easeOutElastic:function(j,i,B,A,z){var y=1.70158,l=0,k=A;if(i==0){return B}if((i/=z)==1){return B+A}l||(l=z*0.3);if(k<Math.abs(A)){k=A;var y=l/4}else{var y=l/(2*Math.PI)*Math.asin(A/k)}return k*Math.pow(2,-10*i)*Math.sin((i*z-y)*2*Math.PI/l)+A+B},easeInOutElastic:function(j,i,B,A,z){var y=1.70158,l=0,k=A;if(i==0){return B}if((i/=z/2)==2){return B+A}l||(l=z*0.3*1.5);if(k<Math.abs(A)){k=A;var y=l/4}else{var y=l/(2*Math.PI)*Math.asin(A/k)}if(i<1){return -0.5*k*Math.pow(2,10*(i-=1))*Math.sin((i*z-y)*2*Math.PI/l)+B}return k*Math.pow(2,-10*(i-=1))*Math.sin((i*z-y)*2*Math.PI/l)*0.5+A+B},easeInBack:function(b,l,k,j,i,h){h==w&&(h=1.70158);return j*(l/=i)*l*((h+1)*l-h)+k},easeOutBack:function(b,l,k,j,i,h){h==w&&(h=1.70158);return j*((l=l/i-1)*l*((h+1)*l+h)+1)+k},easeInOutBack:function(b,l,k,j,i,h){h==w&&(h=1.70158);if((l/=i/2)<1){return j/2*l*l*(((h*=1.525)+1)*l-h)+k}return j/2*((l-=2)*l*(((h*=1.525)+1)*l+h)+2)+k},easeInBounce:function(a,j,i,h,g){return h-x.easing.easeOutBounce(a,g-j,0,h,g)+i},easeOutBounce:function(g,f,j,i,h){return(f/=h)<1/2.75?i*7.5625*f*f+j:f<2/2.75?i*(7.5625*(f-=1.5/2.75)*f+0.75)+j:f<2.5/2.75?i*(7.5625*(f-=2.25/2.75)*f+0.9375)+j:i*(7.5625*(f-=2.625/2.75)*f+0.984375)+j},easeInOutBounce:function(a,j,i,h,g){if(j<g/2){return x.easing.easeInBounce(a,j*2,0,h,g)*0.5+i}return x.easing.easeOutBounce(a,j*2-g,0,h,g)*0.5+h*0.5+i}})}(jQuery);(function(e,d){var f=5;e.widget("ui.slider",e.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var a=this,n=this.options,m=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),l="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",k=n.values&&n.values.length||1,j=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"+(n.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),n.range&&(n.range===!0&&(n.values||(n.values=[this._valueMin(),this._valueMin()]),n.values.length&&n.values.length!==2&&(n.values=[n.values[0],n.values[0]])),this.range=e("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(n.range==="min"||n.range==="max"?" ui-slider-range-"+n.range:"")));for(var c=m.length;c<k;c+=1){j.push(l)}this.handles=m.add(e(j.join("")).appendTo(a.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(b){b.preventDefault()}).hover(function(){n.disabled||e(this).addClass("ui-state-hover")},function(){e(this).removeClass("ui-state-hover")}).focus(function(){n.disabled?e(this).blur():(e(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),e(this).addClass("ui-state-focus"))}).blur(function(){e(this).removeClass("ui-state-focus")}),this.handles.each(function(g){e(this).data("index.ui-slider-handle",g)}),this.handles.keydown(function(s){var r=e(this).data("index.ui-slider-handle"),q,p,o,b;if(!a.options.disabled){switch(s.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:s.preventDefault();if(!a._keySliding){a._keySliding=!0,e(this).addClass("ui-state-active"),q=a._start(s,r);if(q===!1){return}}}b=a.options.step,a.options.values&&a.options.values.length?p=o=a.values(r):p=o=a.value();switch(s.keyCode){case e.ui.keyCode.HOME:o=a._valueMin();break;case e.ui.keyCode.END:o=a._valueMax();break;case e.ui.keyCode.PAGE_UP:o=a._trimAlignValue(p+(a._valueMax()-a._valueMin())/f);break;case e.ui.keyCode.PAGE_DOWN:o=a._trimAlignValue(p-(a._valueMax()-a._valueMin())/f);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(p===a._valueMax()){return}o=a._trimAlignValue(p+b);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(p===a._valueMin()){return}o=a._trimAlignValue(p-b)}a._slide(s,r,o)}}).keyup(function(g){var b=e(this).data("index.ui-slider-handle");a._keySliding&&(a._keySliding=!1,a._stop(g,b),a._change(g,b),e(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy();return this},_mouseCapture:function(v){var u=this.options,t,s,r,q,p,o,n,m,a;if(u.disabled){return !1}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),t={x:v.pageX,y:v.pageY},s=this._normValueFromMouse(t),r=this._valueMax()-this._valueMin()+1,p=this,this.handles.each(function(g){var h=Math.abs(s-p.values(g));r>h&&(r=h,q=e(this),o=g)}),u.range===!0&&this.values(1)===u.min&&(o+=1,q=e(this.handles[o])),n=this._start(v,o);if(n===!1){return !1}this._mouseSliding=!0,p._handleIndex=o,q.addClass("ui-state-active").focus(),m=q.offset(),a=!e(v.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=a?{left:0,top:0}:{left:v.pageX-m.left-q.width()/2,top:v.pageY-m.top-q.height()/2-(parseInt(q.css("borderTopWidth"),10)||0)-(parseInt(q.css("borderBottomWidth"),10)||0)+(parseInt(q.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(v,o,s),this._animateOff=!0;return !0},_mouseStart:function(b){return !0},_mouseDrag:function(h){var g={x:h.pageX,y:h.pageY},i=this._normValueFromMouse(g);this._slide(h,this._handleIndex,i);return !1},_mouseStop:function(b){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(b,this._handleIndex),this._change(b,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return !1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(h){var g,l,k,j,i;this.orientation==="horizontal"?(g=this.elementSize.width,l=h.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(g=this.elementSize.height,l=h.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),k=l/g,k>1&&(k=1),k<0&&(k=0),this.orientation==="vertical"&&(k=1-k),j=this._valueMax()-this._valueMin(),i=this._valueMin()+k*j;return this._trimAlignValue(i)},_start:function(h,g){var i={handle:this.handles[g],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(g),i.values=this.values());return this._trigger("start",h,i)},_slide:function(h,g,l){var k,j,i;this.options.values&&this.options.values.length?(k=this.values(g?0:1),this.options.values.length===2&&this.options.range===!0&&(g===0&&l>k||g===1&&l<k)&&(l=k),l!==this.values(g)&&(j=this.values(),j[g]=l,i=this._trigger("slide",h,{handle:this.handles[g],value:l,values:j}),k=this.values(g?0:1),i!==!1&&this.values(g,l,!0))):l!==this.value()&&(i=this._trigger("slide",h,{handle:this.handles[g],value:l}),i!==!1&&this.value(l))},_stop:function(h,g){var i={handle:this.handles[g],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(g),i.values=this.values()),this._trigger("stop",h,i)},_change:function(h,g){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[g],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(g),i.values=this.values()),this._trigger("change",h,i)}},value:function(b){if(arguments.length){this.options.value=this._trimAlignValue(b),this._refreshValue(),this._change(null,0)}else{return this._value()}},values:function(a,j){var i,h,g;if(arguments.length>1){this.options.values[a]=this._trimAlignValue(j),this._refreshValue(),this._change(null,a)}else{if(!arguments.length){return this._values()}if(!e.isArray(arguments[0])){return this.options.values&&this.options.values.length?this._values(a):this.value()}i=this.options.values,h=arguments[0];for(g=0;g<i.length;g+=1){i[g]=this._trimAlignValue(h[g]),this._change(null,g)}this._refreshValue()}},_setOption:function(a,i){var h,g=0;e.isArray(this.options.values)&&(g=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments);switch(a){case"disabled":i?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(h=0;h<g;h+=1){this._change(null,h)}this._animateOff=!1}},_value:function(){var b=this.options.value;b=this._trimAlignValue(b);return b},_values:function(h){var g,j,i;if(arguments.length){g=this.options.values[h],g=this._trimAlignValue(g);return g}j=this.options.values.slice();for(i=0;i<j.length;i+=1){j[i]=this._trimAlignValue(j[i])}return j},_trimAlignValue:function(h){if(h<=this._valueMin()){return this._valueMin()}if(h>=this._valueMax()){return this._valueMax()}var g=this.options.step>0?this.options.step:1,j=(h-this._valueMin())%g,i=h-j;Math.abs(j)*2>=g&&(i+=j>0?g:-g);return parseFloat(i.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t=this.options.range,s=this.options,r=this,q=this._animateOff?!1:s.animate,p,o={},n,m,l,a;this.options.values&&this.options.values.length?this.handles.each(function(c,g){p=(r.values(c)-r._valueMin())/(r._valueMax()-r._valueMin())*100,o[r.orientation==="horizontal"?"left":"bottom"]=p+"%",e(this).stop(1,1)[q?"animate":"css"](o,s.animate),r.options.range===!0&&(r.orientation==="horizontal"?(c===0&&r.range.stop(1,1)[q?"animate":"css"]({left:p+"%"},s.animate),c===1&&r.range[q?"animate":"css"]({width:p-n+"%"},{queue:!1,duration:s.animate})):(c===0&&r.range.stop(1,1)[q?"animate":"css"]({bottom:p+"%"},s.animate),c===1&&r.range[q?"animate":"css"]({height:p-n+"%"},{queue:!1,duration:s.animate}))),n=p}):(m=this.value(),l=this._valueMin(),a=this._valueMax(),p=a!==l?(m-l)/(a-l)*100:0,o[r.orientation==="horizontal"?"left":"bottom"]=p+"%",this.handle.stop(1,1)[q?"animate":"css"](o,s.animate),t==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[q?"animate":"css"]({width:p+"%"},s.animate),t==="max"&&this.orientation==="horizontal"&&this.range[q?"animate":"css"]({width:100-p+"%"},{queue:!1,duration:s.animate}),t==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[q?"animate":"css"]({height:p+"%"},s.animate),t==="max"&&this.orientation==="vertical"&&this.range[q?"animate":"css"]({height:100-p+"%"},{queue:!1,duration:s.animate}))}}),e.extend(e.ui.slider,{version:"1.8.18"})})(jQuery);