jQuery.ui||function(b){function d(g,i,j,l){function m(o){o=b[g][i][o]||[];return typeof o=="string"?o.split(/,?\s+/):o}var n=m("getter");if(l.length==1&&typeof l[0]=="string")n=n.concat(m("getterSetter"));return b.inArray(j,n)!=-1}var c=b.fn.remove,a=b.browser.mozilla&&parseFloat(b.browser.version)<1.9;b.ui={version:"1.7.2",plugin:{add:function(g,i,j){g=b.ui[g].prototype;for(var l in j){g.plugins[l]=g.plugins[l]||[];g.plugins[l].push([i,j[l]])}},call:function(g,i,j){if((i=g.plugins[i])&&g.element[0].parentNode)for(var l=
0;l<i.length;l++)g.options[i[l][0]]&&i[l][1].apply(g.element,j)}},contains:function(g,i){return document.compareDocumentPosition?g.compareDocumentPosition(i)&16:g!==i&&g.contains(i)},hasScroll:function(g,i){if(b(g).css("overflow")=="hidden")return false;var j=i&&i=="left"?"scrollLeft":"scrollTop",l=false;if(g[j]>0)return true;g[j]=1;l=g[j]>0;g[j]=0;return l},isOverAxis:function(g,i,j){return g>i&&g<i+j},isOver:function(g,i,j,l,m,n){return b.ui.isOverAxis(g,j,m)&&b.ui.isOverAxis(i,l,n)},keyCode:{BACKSPACE:8,
CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(a){var e=b.attr,f=b.fn.removeAttr,h=/^aria-/,k=/^wairole:/;b.attr=function(g,i,j){var l=j!==undefined;return i=="role"?l?e.call(this,g,i,"wairole:"+j):(e.apply(this,arguments)||"").replace(k,""):h.test(i)?l?g.setAttributeNS("http://www.w3.org/2005/07/aaa",
i.replace(h,"aaa:"),j):e.call(this,g,i.replace(h,"aaa:")):e.apply(this,arguments)};b.fn.removeAttr=function(g){return h.test(g)?this.each(function(){this.removeAttributeNS("http://www.w3.org/2005/07/aaa",g.replace(h,""))}):f.call(this,g)}}b.fn.extend({remove:function(){b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return c.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable",
"on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var g;g=b.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(b.curCSS(this,"position",1))&&/(auto|scroll)/.test(b.curCSS(this,"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(b.curCSS(this,
"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!g.length?b(document):g}});b.extend(b.expr[":"],{data:function(g,i,j){return!!b.data(g,j[3])},focusable:function(g){var i=g.nodeName.toLowerCase(),j=b.attr(g,"tabindex");return(/input|select|textarea|button|object/.test(i)?!g.disabled:"a"==i||"area"==i?g.href||!isNaN(j):!isNaN(j))&&!b(g)["area"==i?"parents":"closest"](":hidden").length},tabbable:function(g){var i=b.attr(g,"tabindex");
return(isNaN(i)||i>=0)&&b(g).is(":focusable")}});b.widget=function(g,i){var j=g.split(".")[0];g=g.split(".")[1];b.fn[g]=function(l){var m=typeof l=="string",n=Array.prototype.slice.call(arguments,1);if(m&&l.substring(0,1)=="_")return this;if(m&&d(j,g,l,n)){var o=b.data(this[0],g);return o?o[l].apply(o,n):undefined}return this.each(function(){var p=b.data(this,g);!p&&!m&&b.data(this,g,new b[j][g](this,l))._init();p&&m&&b.isFunction(p[l])&&p[l].apply(p,n)})};b[j]=b[j]||{};b[j][g]=function(l,m){var n=
this;this.namespace=j;this.widgetName=g;this.widgetEventPrefix=b[j][g].eventPrefix||g;this.widgetBaseClass=j+"-"+g;this.options=b.extend({},b.widget.defaults,b[j][g].defaults,b.metadata&&b.metadata.get(l)[g],m);this.element=b(l).bind("setData."+g,function(o,p,q){if(o.target==l)return n._setData(p,q)}).bind("getData."+g,function(o,p){if(o.target==l)return n._getData(p)}).bind("remove",function(){return n.destroy()})};b[j][g].prototype=b.extend({},b.widget.prototype,i);b[j][g].getterSetter="option"};
b.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(g,i){var j=g,l=this;if(typeof g=="string"){if(i===undefined)return this._getData(g);j={};j[g]=i}b.each(j,function(m,n){l._setData(m,n)})},_getData:function(g){return this.options[g]},_setData:function(g,i){this.options[g]=i;if(g=="disabled")this.element[i?"addClass":"removeClass"](this.widgetBaseClass+
"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",i)},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(g,i,j){var l=this.options[g];g=g==this.widgetEventPrefix?g:this.widgetEventPrefix+g;i=b.Event(i);i.type=g;if(i.originalEvent){g=b.event.props.length;for(var m;g;){m=b.event.props[--g];i[m]=i.originalEvent[m]}}this.element.trigger(i,j);return!(b.isFunction(l)&&l.call(this.element[0],i,j)===false||i.isDefaultPrevented())}};
b.widget.defaults={disabled:false};b.ui.mouse={_mouseInit:function(){var g=this;this.element.bind("mousedown."+this.widgetName,function(i){return g._mouseDown(i)}).bind("click."+this.widgetName,function(i){if(g._preventClickEvent){g._preventClickEvent=false;i.stopImmediatePropagation();return false}});if(b.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);
b.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable)},_mouseDown:function(g){g.originalEvent=g.originalEvent||{};if(!g.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(g);this._mouseDownEvent=g;var i=this,j=g.which==1,l=typeof this.options.cancel=="string"?b(g.target).parents().add(g.target).filter(this.options.cancel).length:false;if(!j||l||!this._mouseCapture(g))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=
true},this.options.delay);if(this._mouseDistanceMet(g)&&this._mouseDelayMet(g)){this._mouseStarted=this._mouseStart(g)!==false;if(!this._mouseStarted){g.preventDefault();return true}}this._mouseMoveDelegate=function(m){return i._mouseMove(m)};this._mouseUpDelegate=function(m){return i._mouseUp(m)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);b.browser.safari||g.preventDefault();return g.originalEvent.mouseHandled=true}},
_mouseMove:function(g){if(b.browser.msie&&!g.button)return this._mouseUp(g);if(this._mouseStarted){this._mouseDrag(g);return g.preventDefault()}if(this._mouseDistanceMet(g)&&this._mouseDelayMet(g))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,g)!==false)?this._mouseDrag(g):this._mouseUp(g);return!this._mouseStarted},_mouseUp:function(g){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
false;this._preventClickEvent=g.target==this._mouseDownEvent.target;this._mouseStop(g)}return false},_mouseDistanceMet:function(g){return Math.max(Math.abs(this._mouseDownEvent.pageX-g.pageX),Math.abs(this._mouseDownEvent.pageY-g.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}};b.ui.mouse.defaults={cancel:null,distance:1,delay:0}}(jQuery);
(function(b){b.widget("ui.draggable",b.extend({},b.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");
this._mouseDestroy()}},_mouseCapture:function(d){var c=this.options;if(this.helper||c.disabled||b(d.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(d);if(!this.handle)return false;return true},_mouseStart:function(d){var c=this.options;this.helper=this._createHelper(d);this._cacheHelperProportions();if(b.ui.ddmanager)b.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();
this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};b.extend(this.offset,{click:{left:d.pageX-this.offset.left,top:d.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(d);this.originalPageX=d.pageX;this.originalPageY=d.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);c.containment&&this._setContainment();this._trigger("start",d);this._cacheHelperProportions();b.ui.ddmanager&&
!c.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,d);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(d,true);return true},_mouseDrag:function(d,c){this.position=this._generatePosition(d);this.positionAbs=this._convertPositionTo("absolute");if(!c){var a=this._uiHash();this._trigger("drag",d,a);this.position=a.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=
this.position.top+"px";b.ui.ddmanager&&b.ui.ddmanager.drag(this,d);return false},_mouseStop:function(d){var c=false;if(b.ui.ddmanager&&!this.options.dropBehaviour)c=b.ui.ddmanager.drop(this,d);if(this.dropped){c=this.dropped;this.dropped=false}if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===true||b.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var a=this;b(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,
10),function(){a._trigger("stop",d);a._clear()})}else{this._trigger("stop",d);this._clear()}return false},_getHandle:function(d){var c=!this.options.handle||!b(this.options.handle,this.element).length?true:false;b(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==d.target)c=true});return c},_createHelper:function(d){var c=this.options;d=b.isFunction(c.helper)?b(c.helper.apply(this.element[0],[d])):c.helper=="clone"?this.element.clone():this.element;d.parents("body").length||
d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo);d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(d){if(d.left!=undefined)this.offset.click.left=d.left+this.margins.left;if(d.right!=undefined)this.offset.click.left=this.helperProportions.width-d.right+this.margins.left;if(d.top!=undefined)this.offset.click.top=d.top+this.margins.top;if(d.bottom!=undefined)this.offset.click.top=this.helperProportions.height-
d.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var d=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0])){d.left+=this.scrollParent.scrollLeft();d.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&b.browser.msie)d={top:0,left:0};return{top:d.top+
(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:d.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var d=this.element.position();return{top:d.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:d.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),
10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var d=this.options;if(d.containment=="parent")d.containment=this.helper[0].parentNode;if(d.containment=="document"||d.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,b(d.containment=="document"?document:
window).width()-this.helperProportions.width-this.margins.left,(b(d.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(d.containment)&&d.containment.constructor!=Array){var c=b(d.containment)[0];if(c){d=b(d.containment).offset();var a=b(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(b(c).css("borderLeftWidth"),10)||0)+(parseInt(b(c).css("paddingLeft"),10)||
0)-this.margins.left,d.top+(parseInt(b(c).css("borderTopWidth"),10)||0)+(parseInt(b(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(a?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(b(c).css("borderLeftWidth"),10)||0)-(parseInt(b(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(a?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(b(c).css("borderTopWidth"),10)||0)-(parseInt(b(c).css("paddingBottom"),10)||0)-this.helperProportions.height-
this.margins.top]}}else if(d.containment.constructor==Array)this.containment=d.containment},_convertPositionTo:function(d,c){if(!c)c=this.position;var a=d=="absolute"?1:-1,e=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(e[0].tagName);return{top:c.top+this.offset.relative.top*a+this.offset.parent.top*a-(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition==
"fixed"?-this.scrollParent.scrollTop():f?0:e.scrollTop())*a),left:c.left+this.offset.relative.left*a+this.offset.parent.left*a-(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:e.scrollLeft())*a)}},_generatePosition:function(d){var c=this.options,a=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(a[0].tagName);
if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var f=d.pageX,h=d.pageY;if(this.originalPosition){if(this.containment){if(d.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(d.pageY-this.offset.click.top<this.containment[1])h=this.containment[1]+this.offset.click.top;if(d.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+
this.offset.click.left;if(d.pageY-this.offset.click.top>this.containment[3])h=this.containment[3]+this.offset.click.top}if(c.grid){h=this.originalPageY+Math.round((h-this.originalPageY)/c.grid[1])*c.grid[1];h=this.containment?!(h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3])?h:!(h-this.offset.click.top<this.containment[1])?h-c.grid[1]:h+c.grid[1]:h;f=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?!(f-this.offset.click.left<
this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-c.grid[0]:f+c.grid[0]:f}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(b.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:a.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(b.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?
-this.scrollParent.scrollLeft():e?0:a.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=false},_trigger:function(d,c,a){a=a||this._uiHash();b.ui.plugin.call(this,d,[c,a]);if(d=="drag")this.positionAbs=this._convertPositionTo("absolute");return b.widget.prototype._trigger.call(this,d,c,a)},plugins:{},_uiHash:function(){return{helper:this.helper,
position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));b.extend(b.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,
snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});b.ui.plugin.add("draggable","connectToSortable",{start:function(d,c){var a=b(this).data("draggable"),e=a.options,f=b.extend({},c,{item:a.element});a.sortables=[];b(e.connectToSortable).each(function(){var h=b.data(this,"sortable");if(h&&!h.options.disabled){a.sortables.push({instance:h,shouldRevert:h.options.revert});h._refreshItems();h._trigger("activate",d,f)}})},stop:function(d,c){var a=b(this).data("draggable"),e=b.extend({},
c,{item:a.element});b.each(a.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;a.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(d);this.instance.options.helper=this.instance.options._helper;a.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",d,e)}})},drag:function(d,c){var a=
b(this).data("draggable"),e=this;b.each(a.sortables,function(){this.instance.positionAbs=a.positionAbs;this.instance.helperProportions=a.helperProportions;this.instance.offset.click=a.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=b(e).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return c.helper[0]};
d.target=this.instance.currentItem[0];this.instance._mouseCapture(d,true);this.instance._mouseStart(d,true,true);this.instance.offset.click.top=a.offset.click.top;this.instance.offset.click.left=a.offset.click.left;this.instance.offset.parent.left-=a.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=a.offset.parent.top-this.instance.offset.parent.top;a._trigger("toSortable",d);a.dropped=this.instance.element;a.currentItem=a.element;this.instance.fromOutside=a}this.instance.currentItem&&
this.instance._mouseDrag(d)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",d,this.instance._uiHash(this.instance));this.instance._mouseStop(d,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();a._trigger("fromSortable",d);a.dropped=false}})}});b.ui.plugin.add("draggable","cursor",
{start:function(){var d=b("body"),c=b(this).data("draggable").options;if(d.css("cursor"))c._cursor=d.css("cursor");d.css("cursor",c.cursor)},stop:function(){var d=b(this).data("draggable").options;d._cursor&&b("body").css("cursor",d._cursor)}});b.ui.plugin.add("draggable","iframeFix",{start:function(){var d=b(this).data("draggable").options;b(d.iframeFix===true?"iframe":d.iframeFix).each(function(){b('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+
"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(b(this).offset()).appendTo("body")})},stop:function(){b("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});b.ui.plugin.add("draggable","opacity",{start:function(d,c){var a=b(c.helper),e=b(this).data("draggable").options;if(a.css("opacity"))e._opacity=a.css("opacity");a.css("opacity",e.opacity)},stop:function(d,c){var a=b(this).data("draggable").options;a._opacity&&b(c.helper).css("opacity",
a._opacity)}});b.ui.plugin.add("draggable","scroll",{start:function(){var d=b(this).data("draggable");if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML")d.overflowOffset=d.scrollParent.offset()},drag:function(d){var c=b(this).data("draggable"),a=c.options,e=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!a.axis||a.axis!="x")if(c.overflowOffset.top+c.scrollParent[0].offsetHeight-d.pageY<a.scrollSensitivity)c.scrollParent[0].scrollTop=e=c.scrollParent[0].scrollTop+
a.scrollSpeed;else if(d.pageY-c.overflowOffset.top<a.scrollSensitivity)c.scrollParent[0].scrollTop=e=c.scrollParent[0].scrollTop-a.scrollSpeed;if(!a.axis||a.axis!="y")if(c.overflowOffset.left+c.scrollParent[0].offsetWidth-d.pageX<a.scrollSensitivity)c.scrollParent[0].scrollLeft=e=c.scrollParent[0].scrollLeft+a.scrollSpeed;else if(d.pageX-c.overflowOffset.left<a.scrollSensitivity)c.scrollParent[0].scrollLeft=e=c.scrollParent[0].scrollLeft-a.scrollSpeed}else{if(!a.axis||a.axis!="x")if(d.pageY-b(document).scrollTop()<
a.scrollSensitivity)e=b(document).scrollTop(b(document).scrollTop()-a.scrollSpeed);else if(b(window).height()-(d.pageY-b(document).scrollTop())<a.scrollSensitivity)e=b(document).scrollTop(b(document).scrollTop()+a.scrollSpeed);if(!a.axis||a.axis!="y")if(d.pageX-b(document).scrollLeft()<a.scrollSensitivity)e=b(document).scrollLeft(b(document).scrollLeft()-a.scrollSpeed);else if(b(window).width()-(d.pageX-b(document).scrollLeft())<a.scrollSensitivity)e=b(document).scrollLeft(b(document).scrollLeft()+
a.scrollSpeed)}e!==false&&b.ui.ddmanager&&!a.dropBehaviour&&b.ui.ddmanager.prepareOffsets(c,d)}});b.ui.plugin.add("draggable","snap",{start:function(){var d=b(this).data("draggable"),c=d.options;d.snapElements=[];b(c.snap.constructor!=String?c.snap.items||":data(draggable)":c.snap).each(function(){var a=b(this),e=a.offset();this!=d.element[0]&&d.snapElements.push({item:this,width:a.outerWidth(),height:a.outerHeight(),top:e.top,left:e.left})})},drag:function(d,c){for(var a=b(this).data("draggable"),
e=a.options,f=e.snapTolerance,h=c.offset.left,k=h+a.helperProportions.width,g=c.offset.top,i=g+a.helperProportions.height,j=a.snapElements.length-1;j>=0;j--){var l=a.snapElements[j].left,m=l+a.snapElements[j].width,n=a.snapElements[j].top,o=n+a.snapElements[j].height;if(l-f<h&&h<m+f&&n-f<g&&g<o+f||l-f<h&&h<m+f&&n-f<i&&i<o+f||l-f<k&&k<m+f&&n-f<g&&g<o+f||l-f<k&&k<m+f&&n-f<i&&i<o+f){if(e.snapMode!="inner"){var p=Math.abs(n-i)<=f,q=Math.abs(o-g)<=f,r=Math.abs(l-k)<=f,s=Math.abs(m-h)<=f;if(p)c.position.top=
a._convertPositionTo("relative",{top:n-a.helperProportions.height,left:0}).top-a.margins.top;if(q)c.position.top=a._convertPositionTo("relative",{top:o,left:0}).top-a.margins.top;if(r)c.position.left=a._convertPositionTo("relative",{top:0,left:l-a.helperProportions.width}).left-a.margins.left;if(s)c.position.left=a._convertPositionTo("relative",{top:0,left:m}).left-a.margins.left}var t=p||q||r||s;if(e.snapMode!="outer"){p=Math.abs(n-g)<=f;q=Math.abs(o-i)<=f;r=Math.abs(l-h)<=f;s=Math.abs(m-k)<=f;if(p)c.position.top=
a._convertPositionTo("relative",{top:n,left:0}).top-a.margins.top;if(q)c.position.top=a._convertPositionTo("relative",{top:o-a.helperProportions.height,left:0}).top-a.margins.top;if(r)c.position.left=a._convertPositionTo("relative",{top:0,left:l}).left-a.margins.left;if(s)c.position.left=a._convertPositionTo("relative",{top:0,left:m-a.helperProportions.width}).left-a.margins.left}if(!a.snapElements[j].snapping&&(p||q||r||s||t))a.options.snap.snap&&a.options.snap.snap.call(a.element,d,b.extend(a._uiHash(),
{snapItem:a.snapElements[j].item}));a.snapElements[j].snapping=p||q||r||s||t}else{a.snapElements[j].snapping&&a.options.snap.release&&a.options.snap.release.call(a.element,d,b.extend(a._uiHash(),{snapItem:a.snapElements[j].item}));a.snapElements[j].snapping=false}}}});b.ui.plugin.add("draggable","stack",{start:function(){var d=b(this).data("draggable").options,c=b.makeArray(b(d.stack.group)).sort(function(a,e){return(parseInt(b(a).css("zIndex"),10)||d.stack.min)-(parseInt(b(e).css("zIndex"),10)||
d.stack.min)});b(c).each(function(a){this.style.zIndex=d.stack.min+a});this[0].style.zIndex=d.stack.min+c.length}});b.ui.plugin.add("draggable","zIndex",{start:function(d,c){var a=b(c.helper),e=b(this).data("draggable").options;if(a.css("zIndex"))e._zIndex=a.css("zIndex");a.css("zIndex",e.zIndex)},stop:function(d,c){var a=b(this).data("draggable").options;a._zIndex&&b(c.helper).css("zIndex",a._zIndex)}})})(jQuery);
(function(b){b.widget("ui.droppable",{_init:function(){var d=this.options.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&b.isFunction(this.options.accept)?this.options.accept:function(c){return c.is(d)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};b.ui.ddmanager.droppables[this.options.scope]=b.ui.ddmanager.droppables[this.options.scope]||[];b.ui.ddmanager.droppables[this.options.scope].push(this);this.options.addClasses&&this.element.addClass("ui-droppable")},
destroy:function(){for(var d=b.ui.ddmanager.droppables[this.options.scope],c=0;c<d.length;c++)d[c]==this&&d.splice(c,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(d,c){if(d=="accept")this.options.accept=c&&b.isFunction(c)?c:function(a){return a.is(c)};else b.widget.prototype._setData.apply(this,arguments)},_activate:function(d){var c=b.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass);
c&&this._trigger("activate",d,this.ui(c))},_deactivate:function(d){var c=b.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);c&&this._trigger("deactivate",d,this.ui(c))},_over:function(d){var c=b.ui.ddmanager.current;if(!(!c||(c.currentItem||c.element)[0]==this.element[0]))if(this.options.accept.call(this.element[0],c.currentItem||c.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);this._trigger("over",d,this.ui(c))}},
_out:function(d){var c=b.ui.ddmanager.current;if(!(!c||(c.currentItem||c.element)[0]==this.element[0]))if(this.options.accept.call(this.element[0],c.currentItem||c.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",d,this.ui(c))}},_drop:function(d,c){var a=c||b.ui.ddmanager.current;if(!a||(a.currentItem||a.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var f=
b.data(this,"droppable");if(f.options.greedy&&b.ui.intersect(a,b.extend(f,{offset:f.element.offset()}),f.options.tolerance)){e=true;return false}});if(e)return false;if(this.options.accept.call(this.element[0],a.currentItem||a.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",d,this.ui(a));return this.element}return false},ui:function(d){return{draggable:d.currentItem||
d.element,helper:d.helper,position:d.position,absolutePosition:d.positionAbs,offset:d.positionAbs}}});b.extend(b.ui.droppable,{version:"1.7.2",eventPrefix:"drop",defaults:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"}});b.ui.intersect=function(d,c,a){if(!c.offset)return false;var e=(d.positionAbs||d.position.absolute).left,f=e+d.helperProportions.width,h=(d.positionAbs||d.position.absolute).top,k=h+d.helperProportions.height,g=c.offset.left,
i=g+c.proportions.width,j=c.offset.top,l=j+c.proportions.height;switch(a){case "fit":return g<e&&f<i&&j<h&&k<l;case "intersect":return g<e+d.helperProportions.width/2&&f-d.helperProportions.width/2<i&&j<h+d.helperProportions.height/2&&k-d.helperProportions.height/2<l;case "pointer":return b.ui.isOver((d.positionAbs||d.position.absolute).top+(d.clickOffset||d.offset.click).top,(d.positionAbs||d.position.absolute).left+(d.clickOffset||d.offset.click).left,j,g,c.proportions.height,c.proportions.width);
case "touch":return(h>=j&&h<=l||k>=j&&k<=l||h<j&&k>l)&&(e>=g&&e<=i||f>=g&&f<=i||e<g&&f>i);default:return false}};b.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(d,c){var a=b.ui.ddmanager.droppables[d.options.scope],e=c?c.type:null,f=(d.currentItem||d.element).find(":data(droppable)").andSelf(),h=0;a:for(;h<a.length;h++)if(!(a[h].options.disabled||d&&!a[h].options.accept.call(a[h].element[0],d.currentItem||d.element))){for(var k=0;k<f.length;k++)if(f[k]==a[h].element[0]){a[h].proportions.height=
0;continue a}a[h].visible=a[h].element.css("display")!="none";if(a[h].visible){a[h].offset=a[h].element.offset();a[h].proportions={width:a[h].element[0].offsetWidth,height:a[h].element[0].offsetHeight};e=="mousedown"&&a[h]._activate.call(a[h],c)}}},drop:function(d,c){var a=false;b.each(b.ui.ddmanager.droppables[d.options.scope],function(){if(this.options){if(!this.options.disabled&&this.visible&&b.ui.intersect(d,this,this.options.tolerance))a=this._drop.call(this,c);if(!this.options.disabled&&this.visible&&
this.options.accept.call(this.element[0],d.currentItem||d.element)){this.isout=1;this.isover=0;this._deactivate.call(this,c)}}});return a},drag:function(d,c){d.options.refreshPositions&&b.ui.ddmanager.prepareOffsets(d,c);b.each(b.ui.ddmanager.droppables[d.options.scope],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var a=b.ui.intersect(d,this,this.options.tolerance);if(a=!a&&this.isover==1?"isout":a&&this.isover==0?"isover":null){var e;if(this.options.greedy){var f=this.element.parents(":data(droppable):eq(0)");
if(f.length){e=b.data(f[0],"droppable");e.greedyChild=a=="isover"?1:0}}if(e&&a=="isover"){e.isover=0;e.isout=1;e._out.call(e,c)}this[a]=1;this[a=="isout"?"isover":"isout"]=0;this[a=="isover"?"_over":"_out"].call(this,c);if(e&&a=="isout"){e.isout=0;e.isover=1;e._over.call(e,c)}}}})}}})(jQuery);
(function(b){b.widget("ui.resizable",b.extend({},b.ui.mouse,{_init:function(){var a=this,e=this.options;this.element.addClass("ui-resizable");b.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&b.browser.opera&&this.element.css({position:"relative",
top:"auto",left:"auto"});this.element.wrap(b('<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=true;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=
e.handles||(!b(".ui-resizable-handle",this.element).length?"e,s,se":{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"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var f=this.handles.split(",");this.handles={};for(var h=0;h<f.length;h++){var k=b.trim(f[h]),g=b('<div class="ui-resizable-handle '+("ui-resizable-"+k)+'"></div>');/sw|se|ne|nw/.test(k)&&
g.css({zIndex:++e.zIndex});"se"==k&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[k]=".ui-resizable-"+k;this.element.append(g)}}this._renderAxis=function(i){i=i||this.element;for(var j in this.handles){if(this.handles[j].constructor==String)this.handles[j]=b(this.handles[j],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var l=b(this.handles[j],this.element),m=0;m=/sw|ne|nw|se|n|s/.test(j)?l.outerHeight():l.outerWidth();
l=["padding",/ne|nw|n/.test(j)?"Top":/se|sw|s/.test(j)?"Bottom":/^e$/.test(j)?"Right":"Left"].join("");i.css(l,m);this._proportionallyResize()}b(this.handles[j])}};this._renderAxis(this.element);this._handles=b(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!a.resizing){if(this.className)var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);a.axis=i&&i[1]?i[1]:"se"}});if(e.autoHide){this._handles.hide();b(this.element).addClass("ui-resizable-autohide").hover(function(){b(this).removeClass("ui-resizable-autohide");
a._handles.show()},function(){if(!a.resizing){b(this).addClass("ui-resizable-autohide");a._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var a=function(f){b(f).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 e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),
top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);a(this.originalElement)},_mouseCapture:function(a){var e=false;for(var f in this.handles)if(b(this.handles[f])[0]==a.target)e=true;return this.options.disabled||!!e},_mouseStart:function(a){var e=this.options,f=this.element.position(),h=this.element;this.resizing=true;this.documentScroll={top:b(document).scrollTop(),left:b(document).scrollLeft()};if(h.is(".ui-draggable")||/absolute/.test(h.css("position")))h.css({position:"absolute",
top:f.top,left:f.left});b.browser.opera&&/relative/.test(h.css("position"))&&h.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();f=d(this.helper.css("left"));var k=d(this.helper.css("top"));if(e.containment){f+=b(e.containment).scrollLeft()||0;k+=b(e.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:f,top:k};this.size=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()};this.originalSize=this._helper?{width:h.outerWidth(),
height:h.outerHeight()}:{width:h.width(),height:h.height()};this.originalPosition={left:f,top:k};this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()};this.originalMousePosition={left:a.pageX,top:a.pageY};this.aspectRatio=typeof e.aspectRatio=="number"?e.aspectRatio:this.originalSize.width/this.originalSize.height||1;e=b(".ui-resizable-"+this.axis).css("cursor");b("body").css("cursor",e=="auto"?this.axis+"-resize":e);h.addClass("ui-resizable-resizing");this._propagate("start",
a);return true},_mouseDrag:function(a){var e=this.helper,f=this.originalMousePosition,h=this._change[this.axis];if(!h)return false;f=h.apply(this,[a,a.pageX-f.left||0,a.pageY-f.top||0]);if(this._aspectRatio||a.shiftKey)f=this._updateRatio(f,a);f=this._respectSize(f,a);this._propagate("resize",a);e.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(f);this._trigger("resize",a,this.ui());return false},_mouseStop:function(a){this.resizing=false;var e=this.options;if(this._helper){var f=this._proportionallyResizeElements,h=f.length&&/textarea/i.test(f[0].nodeName);f=h&&b.ui.hasScroll(f[0],"left")?0:this.sizeDiff.height;h={width:this.size.width-(h?0:this.sizeDiff.width),height:this.size.height-f};f=parseInt(this.element.css("left"),10)+(this.position.left-this.originalPosition.left)||null;var k=parseInt(this.element.css("top"),
10)+(this.position.top-this.originalPosition.top)||null;e.animate||this.element.css(b.extend(h,{top:k,left:f}));this.helper.height(this.size.height);this.helper.width(this.size.width);this._helper&&!e.animate&&this._proportionallyResize()}b("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",a);this._helper&&this.helper.remove();return false},_updateCache:function(a){this.offset=this.helper.offset();if(c(a.left))this.position.left=a.left;if(c(a.top))this.position.top=
a.top;if(c(a.height))this.size.height=a.height;if(c(a.width))this.size.width=a.width},_updateRatio:function(a){var e=this.position,f=this.size,h=this.axis;if(a.height)a.width=f.height*this.aspectRatio;else if(a.width)a.height=f.width/this.aspectRatio;if(h=="sw"){a.left=e.left+(f.width-a.width);a.top=null}if(h=="nw"){a.top=e.top+(f.height-a.height);a.left=e.left+(f.width-a.width)}return a},_respectSize:function(a){var e=this.options,f=this.axis,h=c(a.width)&&e.maxWidth&&e.maxWidth<a.width,k=c(a.height)&&
e.maxHeight&&e.maxHeight<a.height,g=c(a.width)&&e.minWidth&&e.minWidth>a.width,i=c(a.height)&&e.minHeight&&e.minHeight>a.height;if(g)a.width=e.minWidth;if(i)a.height=e.minHeight;if(h)a.width=e.maxWidth;if(k)a.height=e.maxHeight;var j=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,m=/sw|nw|w/.test(f);f=/nw|ne|n/.test(f);if(g&&m)a.left=j-e.minWidth;if(h&&m)a.left=j-e.maxWidth;if(i&&f)a.top=l-e.minHeight;if(k&&f)a.top=l-e.maxHeight;if((e=!a.width&&!a.height)&&
!a.left&&a.top)a.top=null;else if(e&&!a.top&&a.left)a.left=null;return a},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var a=this.helper||this.element,e=0;e<this._proportionallyResizeElements.length;e++){var f=this._proportionallyResizeElements[e];if(!this.borderDif){var h=[f.css("borderTopWidth"),f.css("borderRightWidth"),f.css("borderBottomWidth"),f.css("borderLeftWidth")],k=[f.css("paddingTop"),f.css("paddingRight"),f.css("paddingBottom"),f.css("paddingLeft")];
this.borderDif=b.map(h,function(g,i){var j=parseInt(g,10)||0,l=parseInt(k[i],10)||0;return j+l})}b.browser.msie&&(b(a).is(":hidden")||b(a).parents(":hidden").length)||f.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var a=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||b('<div style="overflow:hidden;"></div>');var e=b.browser.msie&&b.browser.version<7,f=
e?1:0;e=e?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+e,height:this.element.outerHeight()+e,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++a.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,e){return{width:this.originalSize.width+e}},w:function(a,e){return{left:this.originalPosition.left+e,width:this.originalSize.width-e}},n:function(a,e,f){return{top:this.originalPosition.top+
f,height:this.originalSize.height-f}},s:function(a,e,f){return{height:this.originalSize.height+f}},se:function(a,e,f){return b.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[a,e,f]))},sw:function(a,e,f){return b.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[a,e,f]))},ne:function(a,e,f){return b.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[a,e,f]))},nw:function(a,e,f){return b.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,
[a,e,f]))}},_propagate:function(a,e){b.ui.plugin.call(this,a,[e,this.ui()]);a!="resize"&&this._trigger(a,e,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}}}));b.extend(b.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,
autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3}});b.ui.plugin.add("resizable","alsoResize",{start:function(){var a=b(this).data("resizable").options;_store=function(e){b(e).each(function(){b(this).data("resizable-alsoresize",{width:parseInt(b(this).width(),10),height:parseInt(b(this).height(),10),left:parseInt(b(this).css("left"),10),top:parseInt(b(this).css("top"),
10)})})};if(typeof a.alsoResize=="object"&&!a.alsoResize.parentNode)if(a.alsoResize.length){a.alsoResize=a.alsoResize[0];_store(a.alsoResize)}else b.each(a.alsoResize,function(e){_store(e)});else _store(a.alsoResize)},resize:function(){var a=b(this).data("resizable"),e=a.options,f=a.originalSize,h=a.originalPosition,k={height:a.size.height-f.height||0,width:a.size.width-f.width||0,top:a.position.top-h.top||0,left:a.position.left-h.left||0},g=function(i,j){b(i).each(function(){var l=b(this),m=b(this).data("resizable-alsoresize"),
n={};b.each((j&&j.length?j:["width","height","top","left"])||["width","height","top","left"],function(o,p){var q=(m[p]||0)+(k[p]||0);if(q&&q>=0)n[p]=q||null});if(/relative/.test(l.css("position"))&&b.browser.opera){a._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(n)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?b.each(e.alsoResize,function(i,j){g(i,j)}):g(e.alsoResize)},stop:function(){var a=b(this).data("resizable");if(a._revertToRelativePosition&&
b.browser.opera){a._revertToRelativePosition=false;el.css({position:"relative"})}b(this).removeData("resizable-alsoresize-start")}});b.ui.plugin.add("resizable","animate",{stop:function(a){var e=b(this).data("resizable"),f=e.options,h=e._proportionallyResizeElements,k=h.length&&/textarea/i.test(h[0].nodeName),g=k&&b.ui.hasScroll(h[0],"left")?0:e.sizeDiff.height;k={width:e.size.width-(k?0:e.sizeDiff.width),height:e.size.height-g};g=parseInt(e.element.css("left"),10)+(e.position.left-e.originalPosition.left)||
null;var i=parseInt(e.element.css("top"),10)+(e.position.top-e.originalPosition.top)||null;e.element.animate(b.extend(k,i&&g?{top:i,left:g}:{}),{duration:f.animateDuration,easing:f.animateEasing,step:function(){var j={width:parseInt(e.element.css("width"),10),height:parseInt(e.element.css("height"),10),top:parseInt(e.element.css("top"),10),left:parseInt(e.element.css("left"),10)};h&&h.length&&b(h[0]).css({width:j.width,height:j.height});e._updateCache(j);e._propagate("resize",a)}})}});b.ui.plugin.add("resizable",
"containment",{start:function(){var a=b(this).data("resizable"),e=a.element,f=a.options.containment;if(e=f instanceof b?f.get(0):/parent/.test(f)?e.parent().get(0):f){a.containerElement=b(e);if(/document/.test(f)||f==document){a.containerOffset={left:0,top:0};a.containerPosition={left:0,top:0};a.parentData={element:b(document),left:0,top:0,width:b(document).width(),height:b(document).height()||document.body.parentNode.scrollHeight}}else{var h=b(e),k=[];b(["Top","Right","Left","Bottom"]).each(function(j,
l){k[j]=d(h.css("padding"+l))});a.containerOffset=h.offset();a.containerPosition=h.position();a.containerSize={height:h.innerHeight()-k[3],width:h.innerWidth()-k[1]};f=a.containerOffset;var g=a.containerSize.height,i=a.containerSize.width;i=b.ui.hasScroll(e,"left")?e.scrollWidth:i;g=b.ui.hasScroll(e)?e.scrollHeight:g;a.parentData={element:e,left:f.left,top:f.top,width:i,height:g}}}},resize:function(a){var e=b(this).data("resizable"),f=e.options,h=e.containerOffset,k=e.position;a=e._aspectRatio||a.shiftKey;
var g={top:0,left:0},i=e.containerElement;if(i[0]!=document&&/static/.test(i.css("position")))g=h;if(k.left<(e._helper?h.left:0)){e.size.width+=e._helper?e.position.left-h.left:e.position.left-g.left;if(a)e.size.height=e.size.width/f.aspectRatio;e.position.left=f.helper?h.left:0}if(k.top<(e._helper?h.top:0)){e.size.height+=e._helper?e.position.top-h.top:e.position.top;if(a)e.size.width=e.size.height*f.aspectRatio;e.position.top=e._helper?h.top:0}e.offset.left=e.parentData.left+e.position.left;e.offset.top=
e.parentData.top+e.position.top;f=Math.abs((e._helper?e.offset.left-g.left:e.offset.left-g.left)+e.sizeDiff.width);h=Math.abs((e._helper?e.offset.top-g.top:e.offset.top-h.top)+e.sizeDiff.height);k=e.containerElement.get(0)==e.element.parent().get(0);g=/relative|absolute/.test(e.containerElement.css("position"));if(k&&g)f-=e.parentData.left;if(f+e.size.width>=e.parentData.width){e.size.width=e.parentData.width-f;if(a)e.size.height=e.size.width/e.aspectRatio}if(h+e.size.height>=e.parentData.height){e.size.height=
e.parentData.height-h;if(a)e.size.width=e.size.height*e.aspectRatio}},stop:function(){var a=b(this).data("resizable"),e=a.options,f=a.containerOffset,h=a.containerPosition,k=a.containerElement,g=b(a.helper),i=g.offset(),j=g.outerWidth()-a.sizeDiff.width;g=g.outerHeight()-a.sizeDiff.height;a._helper&&!e.animate&&/relative/.test(k.css("position"))&&b(this).css({left:i.left-h.left-f.left,width:j,height:g});a._helper&&!e.animate&&/static/.test(k.css("position"))&&b(this).css({left:i.left-h.left-f.left,
width:j,height:g})}});b.ui.plugin.add("resizable","ghost",{start:function(){var a=b(this).data("resizable"),e=a.options,f=a.size;a.ghost=a.originalElement.clone();a.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:"");a.ghost.appendTo(a.helper)},resize:function(){var a=b(this).data("resizable");a.ghost&&a.ghost.css({position:"relative",height:a.size.height,width:a.size.width})},
stop:function(){var a=b(this).data("resizable");a.ghost&&a.helper&&a.helper.get(0).removeChild(a.ghost.get(0))}});b.ui.plugin.add("resizable","grid",{resize:function(){var a=b(this).data("resizable"),e=a.options,f=a.size,h=a.originalSize,k=a.originalPosition,g=a.axis;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var i=Math.round((f.width-h.width)/(e.grid[0]||1))*(e.grid[0]||1);e=Math.round((f.height-h.height)/(e.grid[1]||1))*(e.grid[1]||1);if(/^(se|s|e)$/.test(g)){a.size.width=h.width+i;a.size.height=
h.height+e}else if(/^(ne)$/.test(g)){a.size.width=h.width+i;a.size.height=h.height+e;a.position.top=k.top-e}else{if(/^(sw)$/.test(g)){a.size.width=h.width+i;a.size.height=h.height+e}else{a.size.width=h.width+i;a.size.height=h.height+e;a.position.top=k.top-e}a.position.left=k.left-i}}});var d=function(a){return parseInt(a,10)||0},c=function(a){return!isNaN(parseInt(a,10))}})(jQuery);
(function(b){b.widget("ui.sortable",b.extend({},b.ui.mouse,{_init:function(){this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var d=this.items.length-1;d>=0;d--)this.items[d].item.removeData("sortable-item")},
_mouseCapture:function(d,c){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(d);var a=null,e=this;b(d.target).parents().each(function(){if(b.data(this,"sortable-item")==e){a=b(this);return false}});if(b.data(d.target,"sortable-item")==e)a=b(d.target);if(!a)return false;if(this.options.handle&&!c){var f=false;b(this.options.handle,a).find("*").andSelf().each(function(){if(this==d.target)f=true});if(!f)return false}this.currentItem=
a;this._removeCurrentsFromItems();return true},_mouseStart:function(d,c,a){c=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(d);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");b.extend(this.offset,
{click:{left:d.pageX-this.offset.left,top:d.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(d);this.originalPageX=d.pageX;this.originalPageY=d.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();c.containment&&this._setContainment();
if(c.cursor){if(b("body").css("cursor"))this._storedCursor=b("body").css("cursor");b("body").css("cursor",c.cursor)}if(c.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",c.opacity)}if(c.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",c.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",
d,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!a)for(a=this.containers.length-1;a>=0;a--)this.containers[a]._trigger("activate",d,this._uiHash(this));if(b.ui.ddmanager)b.ui.ddmanager.current=this;b.ui.ddmanager&&!c.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,d);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(d);return true},_mouseDrag:function(d){this.position=this._generatePosition(d);this.positionAbs=this._convertPositionTo("absolute");
if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var c=this.options,a=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-d.pageY<c.scrollSensitivity)this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop+c.scrollSpeed;else if(d.pageY-this.overflowOffset.top<c.scrollSensitivity)this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop-c.scrollSpeed;if(this.overflowOffset.left+
this.scrollParent[0].offsetWidth-d.pageX<c.scrollSensitivity)this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft+c.scrollSpeed;else if(d.pageX-this.overflowOffset.left<c.scrollSensitivity)this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(d.pageY-b(document).scrollTop()<c.scrollSensitivity)a=b(document).scrollTop(b(document).scrollTop()-c.scrollSpeed);else if(b(window).height()-(d.pageY-b(document).scrollTop())<c.scrollSensitivity)a=b(document).scrollTop(b(document).scrollTop()+
c.scrollSpeed);if(d.pageX-b(document).scrollLeft()<c.scrollSensitivity)a=b(document).scrollLeft(b(document).scrollLeft()-c.scrollSpeed);else if(b(window).width()-(d.pageX-b(document).scrollLeft())<c.scrollSensitivity)a=b(document).scrollLeft(b(document).scrollLeft()+c.scrollSpeed)}a!==false&&b.ui.ddmanager&&!c.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,d)}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(c=this.items.length-1;c>=0;c--){a=this.items[c];var e=a.item[0],f=this._intersectsWithPointer(a);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!b.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!b.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(a))this._rearrange(d,
a);else break;this._trigger("change",d,this._uiHash());break}}this._contactContainers(d);b.ui.ddmanager&&b.ui.ddmanager.drag(this,d);this._trigger("sort",d,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(d,c){if(d){b.ui.ddmanager&&!this.options.dropBehaviour&&b.ui.ddmanager.drop(this,d);if(this.options.revert){var a=this,e=a.placeholder.offset();a.reverting=true;b(this.helper).animate({left:e.left-this.offset.parent.left-a.margins.left+(this.offsetParent[0]==
document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-a.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){a._clear(d)})}else this._clear(d,c);return false}},cancel:function(){if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("deactivate",
null,this._uiHash(this));if(this.containers[d].containerCache.over){this.containers[d]._trigger("out",null,this._uiHash(this));this.containers[d].containerCache.over=0}}}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();b.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?b(this.domPosition.prev).after(this.currentItem):
b(this.domPosition.parent).prepend(this.currentItem);return true},serialize:function(d){var c=this._getItemsAsjQuery(d&&d.connected),a=[];d=d||{};b(c).each(function(){var e=(b(d.item||this).attr(d.attribute||"id")||"").match(d.expression||/(.+)[-=_](.+)/);if(e)a.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))});return a.join("&")},toArray:function(d){var c=this._getItemsAsjQuery(d&&d.connected),a=[];d=d||{};c.each(function(){a.push(b(d.item||this).attr(d.attribute||"id")||"")});return a},
_intersectsWith:function(d){var c=this.positionAbs.left,a=c+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,h=d.left,k=h+d.width,g=d.top,i=g+d.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>g&&e+j<i&&c+l>h&&c+l<k;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>d[this.floating?"width":"height"]?j:h<c+this.helperProportions.width/
2&&a-this.helperProportions.width/2<k&&g<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<i},_intersectsWithPointer:function(d){var c=b.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,d.top,d.height);d=b.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,d.left,d.width);c=c&&d;d=this._getDragVerticalDirection();var a=this._getDragHorizontalDirection();if(!c)return false;return this.floating?a&&a=="right"||d=="down"?2:1:d&&(d=="down"?2:1)},_intersectsWithSides:function(d){var c=
b.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,d.top+d.height/2,d.height);d=b.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,d.left+d.width/2,d.width);var a=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&d||e=="left"&&!d:a&&(a=="down"&&c||a=="up"&&!c)},_getDragVerticalDirection:function(){var d=this.positionAbs.top-this.lastPositionAbs.top;return d!=0&&(d>0?"down":"up")},_getDragHorizontalDirection:function(){var d=
this.positionAbs.left-this.lastPositionAbs.left;return d!=0&&(d>0?"right":"left")},refresh:function(d){this._refreshItems(d);this.refreshPositions()},_connectWith:function(){var d=this.options;return d.connectWith.constructor==String?[d.connectWith]:d.connectWith},_getItemsAsjQuery:function(d){var c=[],a=[],e=this._connectWith();if(e&&d)for(d=e.length-1;d>=0;d--)for(var f=b(e[d]),h=f.length-1;h>=0;h--){var k=b.data(f[h],"sortable");if(k&&k!=this&&!k.options.disabled)a.push([b.isFunction(k.options.items)?
k.options.items.call(k.element):b(k.options.items,k.element).not(".ui-sortable-helper"),k])}a.push([b.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):b(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(d=a.length-1;d>=0;d--)a[d][0].each(function(){c.push(this)});return b(c)},_removeCurrentsFromItems:function(){for(var d=this.currentItem.find(":data(sortable-item)"),c=0;c<this.items.length;c++)for(var a=0;a<
d.length;a++)d[a]==this.items[c].item[0]&&this.items.splice(c,1)},_refreshItems:function(d){this.items=[];this.containers=[this];var c=this.items,a=[[b.isFunction(this.options.items)?this.options.items.call(this.element[0],d,{item:this.currentItem}):b(this.options.items,this.element),this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var h=b(e[f]),k=h.length-1;k>=0;k--){var g=b.data(h[k],"sortable");if(g&&g!=this&&!g.options.disabled){a.push([b.isFunction(g.options.items)?g.options.items.call(g.element[0],
d,{item:this.currentItem}):b(g.options.items,g.element),g]);this.containers.push(g)}}for(f=a.length-1;f>=0;f--){d=a[f][1];e=a[f][0];k=0;for(h=e.length;k<h;k++){g=b(e[k]);g.data("sortable-item",d);c.push({item:g,instance:d,width:0,height:0,left:0,top:0})}}},refreshPositions:function(d){if(this.offsetParent&&this.helper)this.offset.parent=this._getParentOffset();for(var c=this.items.length-1;c>=0;c--){var a=this.items[c];if(!(a.instance!=this.currentContainer&&this.currentContainer&&a.item[0]!=this.currentItem[0])){var e=
this.options.toleranceElement?b(this.options.toleranceElement,a.item):a.item;if(!d){a.width=e.outerWidth();a.height=e.outerHeight()}e=e.offset();a.left=e.left;a.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(c=this.containers.length-1;c>=0;c--){e=this.containers[c].element.offset();this.containers[c].containerCache.left=e.left;this.containers[c].containerCache.top=e.top;this.containers[c].containerCache.width=this.containers[c].element.outerWidth();
this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}},_createPlaceholder:function(d){var c=d||this,a=c.options;if(!a.placeholder||a.placeholder.constructor==String){var e=a.placeholder;a.placeholder={element:function(){var f=b(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,h){if(!(e&&!a.forcePlaceholderSize)){h.height()||
h.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10));h.width()||h.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}}c.placeholder=b(a.placeholder.element.call(c.element,c.currentItem));c.currentItem.after(c.placeholder);a.placeholder.update(c,c.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--)if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=
this.containers[c]){for(var a=1E4,e=null,f=this.positionAbs[this.containers[c].floating?"left":"top"],h=this.items.length-1;h>=0;h--)if(b.ui.contains(this.containers[c].element[0],this.items[h].item[0])){var k=this.items[h][this.containers[c].floating?"left":"top"];if(Math.abs(k-f)<a){a=Math.abs(k-f);e=this.items[h]}}if(!e&&!this.options.dropOnEmpty)continue;this.currentContainer=this.containers[c];e?this._rearrange(d,e,null,true):this._rearrange(d,null,this.containers[c].element,true);this._trigger("change",
d,this._uiHash());this.containers[c]._trigger("change",d,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[c]._trigger("over",d,this._uiHash(this));this.containers[c].containerCache.over=1}}else if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",d,this._uiHash(this));this.containers[c].containerCache.over=0}},_createHelper:function(d){var c=this.options;d=b.isFunction(c.helper)?b(c.helper.apply(this.element[0],[d,
this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;d.parents("body").length||b(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]);if(d[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(d[0].style.width==""||c.forceHelperSize)d.width(this.currentItem.width());
if(d[0].style.height==""||c.forceHelperSize)d.height(this.currentItem.height());return d},_adjustOffsetFromHelper:function(d){if(d.left!=undefined)this.offset.click.left=d.left+this.margins.left;if(d.right!=undefined)this.offset.click.left=this.helperProportions.width-d.right+this.margins.left;if(d.top!=undefined)this.offset.click.top=d.top+this.margins.top;if(d.bottom!=undefined)this.offset.click.top=this.helperProportions.height-d.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=
this.helper.offsetParent();var d=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0])){d.left+=this.scrollParent.scrollLeft();d.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&b.browser.msie)d={top:0,left:0};return{top:d.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:d.left+(parseInt(this.offsetParent.css("borderLeftWidth"),
10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var d=this.currentItem.position();return{top:d.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:d.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions=
{width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var d=this.options;if(d.containment=="parent")d.containment=this.helper[0].parentNode;if(d.containment=="document"||d.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,b(d.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b(d.containment=="document"?document:window).height()||
document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(d.containment)){var c=b(d.containment)[0];d=b(d.containment).offset();var a=b(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(b(c).css("borderLeftWidth"),10)||0)+(parseInt(b(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(b(c).css("borderTopWidth"),10)||0)+(parseInt(b(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(a?Math.max(c.scrollWidth,
c.offsetWidth):c.offsetWidth)-(parseInt(b(c).css("borderLeftWidth"),10)||0)-(parseInt(b(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(a?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(b(c).css("borderTopWidth"),10)||0)-(parseInt(b(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(d,c){if(!c)c=this.position;var a=d=="absolute"?1:-1,e=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=
document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(e[0].tagName);return{top:c.top+this.offset.relative.top*a+this.offset.parent.top*a-(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:e.scrollTop())*a),left:c.left+this.offset.relative.left*a+this.offset.parent.left*a-(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():
f?0:e.scrollLeft())*a)}},_generatePosition:function(d){var c=this.options,a=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(a[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var f=d.pageX,h=d.pageY;if(this.originalPosition){if(this.containment){if(d.pageX-
this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(d.pageY-this.offset.click.top<this.containment[1])h=this.containment[1]+this.offset.click.top;if(d.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(d.pageY-this.offset.click.top>this.containment[3])h=this.containment[3]+this.offset.click.top}if(c.grid){h=this.originalPageY+Math.round((h-this.originalPageY)/c.grid[1])*c.grid[1];h=this.containment?!(h-this.offset.click.top<
this.containment[1]||h-this.offset.click.top>this.containment[3])?h:!(h-this.offset.click.top<this.containment[1])?h-c.grid[1]:h+c.grid[1]:h;f=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-c.grid[0]:f+c.grid[0]:f}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(b.browser.safari&&
this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:a.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(b.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:a.scrollLeft())}},_rearrange:function(d,c,a,e){a?a[0].appendChild(this.placeholder[0]):c.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?c.item[0]:c.item[0].nextSibling);this.counter=
this.counter?++this.counter:1;var f=this,h=this.counter;window.setTimeout(function(){h==f.counter&&f.refreshPositions(!e)},0)},_clear:function(d,c){this.reverting=false;var a=[];!this._noFinalSort&&this.currentItem[0].parentNode&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();
this.fromOutside&&!c&&a.push(function(f){this._trigger("receive",f,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c)a.push(function(f){this._trigger("update",f,this._uiHash())});if(!b.ui.contains(this.element[0],this.currentItem[0])){c||a.push(function(f){this._trigger("remove",f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(b.ui.contains(this.containers[e].element[0],
this.currentItem[0])&&!c){a.push(function(f){return function(h){f._trigger("receive",h,this._uiHash(this))}}.call(this,this.containers[e]));a.push(function(f){return function(h){f._trigger("update",h,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){c||a.push(function(f){return function(h){f._trigger("deactivate",h,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){a.push(function(f){return function(h){f._trigger("out",
h,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&b("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",d,this._uiHash());for(e=0;e<a.length;e++)a[e].call(this,d);this._trigger("stop",d,this._uiHash())}return false}c||
this._trigger("beforeStop",d,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!c){for(e=0;e<a.length;e++)a[e].call(this,d);this._trigger("stop",d,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){b.widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},_uiHash:function(d){var c=d||this;return{helper:c.helper,placeholder:c.placeholder||b([]),position:c.position,
absolutePosition:c.positionAbs,offset:c.positionAbs,item:c.currentItem,sender:d?d.element:null}}}));b.extend(b.ui.sortable,{getter:"serialize toArray",version:"1.7.2",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,
scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3}})})(jQuery);
(function(b){var d={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"};b.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var c=this,a=this.options,e=a.title||this.originalTitle||"&nbsp;",f=b.ui.dialog.getTitleId(this.element),h=(this.uiDialog=
b("<div/>")).appendTo(document.body).hide().addClass("dialog-box"+a.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:a.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){a.closeOnEscape&&i.keyCode&&i.keyCode==b.ui.keyCode.ESCAPE&&c.close(i)}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(i){c.moveToTop(false,i)}),k=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").css("overflow","auto").appendTo(h),g=(this.uiDialogTitlebar=
$('<div class="titlebar"></div>')).prependTo(h);b("<span></span>").addClass("close").attr("role","button").mousedown(function(i){i.stopPropagation()}).click(function(i){c.close(i);return false}).appendTo(g);b("<span/>").addClass("pop_title").attr("id",f).html(e).prependTo(g);g.find("*").add(g).disableSelection();a.maxHeight&&k.css("maxHeight",a.maxHeight);a.draggable&&b.fn.draggable&&this._makeDraggable();a.resizable&&b.fn.resizable&&this._makeResizable();this._createButtons(a.buttons);this._isOpen=
false;a.bgiframe&&b.fn.bgiframe&&h.bgiframe();a.autoOpen&&this.open()},destroy:function(){this.overlay&&this.overlay.destroy();this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();this.originalTitle&&this.element.attr("title",this.originalTitle)},close:function(c){var a=this;if(false!==a._trigger("beforeclose",c)){a.overlay&&a.overlay.destroy();a.uiDialog.unbind("keypress.ui-dialog");
a.options.hide?a.uiDialog.hide(a.options.hide,function(){a._trigger("close",c)}):a.uiDialog.hide()&&a._trigger("close",c);b.ui.dialog.overlay.resize();a._isOpen=false;if(a.options.modal){var e=0;b(".ui-dialog").each(function(){if(this!=a.uiDialog[0])e=Math.max(e,b(this).css("z-index"))});b.ui.dialog.maxZ=e}}},isOpen:function(){return this._isOpen},moveToTop:function(c,a){if(this.options.modal&&!c||!this.options.stack&&!this.options.modal)return this._trigger("focus",a);if(this.options.zIndex>b.ui.dialog.maxZ)b.ui.dialog.maxZ=
this.options.zIndex;this.overlay&&this.overlay.$el.css("z-index",b.ui.dialog.overlay.maxZ=++b.ui.dialog.maxZ);var e={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++b.ui.dialog.maxZ);this.element.attr(e);this._trigger("focus",a)},open:function(){if(!this._isOpen){var c=this.options,a=this.uiDialog;this.overlay=c.modal?new b.ui.dialog.overlay(this):null;a.next().length&&a.appendTo("body");this._size();this._position(c.position);a.show(c.show);
this.moveToTop(true);c.modal&&a.bind("keypress.ui-dialog",function(e){if(e.keyCode==b.ui.keyCode.TAB){var f=b(":tabbable",this),h=f.filter(":first")[0],k=f.filter(":last")[0];if(e.target==k&&!e.shiftKey)setTimeout(function(){h.focus()},1);else e.target==h&&e.shiftKey&&setTimeout(function(){k.focus()},1)}});b([]).add(a.find(".ui-dialog-content :tabbable:first")).add(a.find(".ui-dialog-buttonpane :tabbable:first")).add(a).filter(":first").focus();this._trigger("open");this._isOpen=true}},_createButtons:function(c){var a=
this,e=false,f=b("<div></div>").addClass("btn_area");this.uiDialog.find(".btn_area").remove();typeof c=="object"&&c!==null&&b.each(c,function(){return!(e=true)});if(e){b.each(c,function(h,k){b('<button type="button"></button>').text(h).click(function(){k.apply(a.element[0],arguments)}).appendTo(f)});f.appendTo(this.uiDialog)}},_makeDraggable:function(){var c=this,a=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content",containment:"document",start:function(){b(this).addClass("ui-dialog-dragging");
a.dragStart&&a.dragStart.apply(c.element[0],arguments)},drag:function(){a.drag&&a.drag.apply(c.element[0],arguments)},stop:function(){b(this).removeClass("ui-dialog-dragging");a.dragStop&&a.dragStop.apply(c.element[0],arguments);b.ui.dialog.overlay.resize()}})},_makeResizable:function(c){c=c===undefined?this.options.resizable:c;var a=this,e=this.options;this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:e.minHeight,
start:function(){b(this).addClass("ui-dialog-resizing");e.resizeStart&&e.resizeStart.apply(a.element[0],arguments)},resize:function(){e.resize&&e.resize.apply(a.element[0],arguments)},handles:typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw",stop:function(){b(this).removeClass("ui-dialog-resizing");e.height=b(this).height();e.width=b(this).width();e.resizeStop&&e.resizeStop.apply(a.element[0],arguments);b.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},
_position:function(c){var a=b(window),e=b(document),f=e.scrollTop();e=e.scrollLeft();var h=f;if(b.inArray(c,["center","top","right","bottom","left"])>=0)c=[c=="right"||c=="left"?c:"center",c=="top"||c=="bottom"?c:"middle"];if(c.constructor!=Array)c=["center","middle"];if(c[0].constructor==Number)e+=c[0];else switch(c[0]){case "left":e+=0;break;case "right":e+=a.width()-this.uiDialog.outerWidth();break;default:case "center":e+=(a.width()-this.uiDialog.outerWidth())/2}if(c[1].constructor==Number)f+=
c[1];else switch(c[1]){case "top":f+=0;break;case "bottom":f+=a.height()-this.uiDialog.outerHeight();break;default:case "middle":f+=(a.height()-this.uiDialog.outerHeight())*0.37}f=Math.max(f,h);this.uiDialog.css({top:f,left:e})},_createModal:function(){if(!(!this._isOpen||this.overlay)){this.overlay=new b.ui.dialog.overlay(this);this.uiDialog.bind("keypress.ui-dialog",function(c){if(c.keyCode==b.ui.keyCode.TAB){var a=b(":tabbable",this),e=a.filter(":first")[0],f=a.filter(":last")[0];if(c.target==
f&&!c.shiftKey)setTimeout(function(){e.focus()},1);else c.target==e&&c.shiftKey&&setTimeout(function(){f.focus()},1)}})}},_setData:function(c,a){d[c]&&this.uiDialog.data(d[c],a);switch(c){case "buttons":this._createButtons(a);break;case "modal":this._createModal();break;case "dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass("dialog-box"+a);break;case "draggable":a?this._makeDraggable():this.uiDialog.draggable("destroy");break;case "height":this.uiDialog.height(a);break;case "position":this._position(a);
break;case "resizable":var e=this.uiDialog,f=this.uiDialog.is(":data(resizable)");f&&!a&&e.resizable("destroy");f&&typeof a=="string"&&e.resizable("option","handles",a);f||this._makeResizable(a);break;case "title":b(".ui-dialog-title",this.uiDialogTitlebar).html(a||"&nbsp;");break;case "width":this.uiDialog.width(a);break}b.widget.prototype._setData.apply(this,arguments)},_size:function(){var c=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var a=this.uiDialog.css({height:"auto",
width:c.width}).height();this.element.css({minHeight:Math.max(c.minHeight-a,0),height:c.height=="auto"?"auto":Math.max(c.height-a,0),width:c.width})}});b.extend(b.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},getter:"isOpen",
uuid:0,maxZ:0,getTitleId:function(c){return"ui-dialog-title-"+(c.attr("id")||++this.uuid)},overlay:function(c){this.$el=b.ui.dialog.overlay.create(c)}});b.extend(b.ui.dialog.overlay,{instances:[],maxZ:0,events:"click_temp.dialog-overlay",create:function(c){if(this.instances.length===0){setTimeout(function(){b.ui.dialog.overlay.instances.length&&b(document).bind(b.ui.dialog.overlay.events,function(f){return(b(f.target).parents(".ui-dialog").css("zIndex")||0)>b.ui.dialog.overlay.maxZ})},1);b(document).bind("keydown.dialog-overlay",
function(f){c.options.closeOnEscape&&f.keyCode&&f.keyCode==b.ui.keyCode.ESCAPE&&c.close(f)});b(window).bind("resize.dialog-overlay",b.ui.dialog.overlay.resize)}var a=b("<div></div>").appendTo(document.body).addClass("ui-widget-overlay");if(b.browser.msie&&b.browser.version<7){var e=a.css("position","absolute")[0];e.style.setExpression("width",'(_=$.ui.dialog.overlay.width())+"px"');e.style.setExpression("height",'(_=$.ui.dialog.overlay.height())+"px"')}c.options.bgiframe&&b.fn.bgiframe&&a.bgiframe();
this.instances.push(a);return a},destroy:function(c){this.instances.splice(b.inArray(this.instances,c),1);this.instances.length===0&&b([document,window]).unbind(".dialog-overlay");c.remove();var a=0;b.each(this.instances,function(){a=Math.max(a,this.css("z-index"))});this.maxZ=a},height:function(){var c=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return c<Math.max(document.documentElement.offsetHeight,document.body.offsetHeight)?b(window).height()+"px":c+"px"},width:function(){var c=
Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);return c<Math.max(document.documentElement.offsetWidth,document.body.offsetWidth)?b(window).width()+"px":c+"px"},resize:function(){}});b.extend(b.ui.dialog.overlay.prototype,{destroy:function(){b.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
(function(b){b.widget("ui.progressbar",{_init:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=b('<div class="ui-progressbar-value ui-widget-header ui-corner-left"></div>').appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");
this.valueDiv.remove();b.widget.prototype.destroy.apply(this,arguments)},value:function(d){if(d===undefined)return this._value();this._setData("value",d);return this},_setData:function(d,c){switch(d){case "value":this.options.value=c;this._refreshValue();this._trigger("change",null,{});break}b.widget.prototype._setData.apply(this,arguments)},_value:function(){var d=this.options.value;if(d<this._valueMin())d=this._valueMin();if(d>this._valueMax())d=this._valueMax();return d},_valueMin:function(){return 0},
_valueMax:function(){return 100},_refreshValue:function(){var d=this.value();this.valueDiv[d==this._valueMax()?"addClass":"removeClass"]("ui-corner-right");this.valueDiv.width(d+"%");this.element.attr("aria-valuenow",d)}});b.extend(b.ui.progressbar,{version:"1.7.2",defaults:{value:0}})})(jQuery);
