(function(c){function d(b,e,f){b=c[b][e].getter||[];b=typeof b=="string"?b.split(/,?\s+/):b;return c.inArray(f,b)!=-1}jQuery.extend(jQuery.expr[":"],{data:"jQuery.data(a, m[3])"});c.ui={plugin:{add:function(b,e,f){b=c.ui[b].prototype;for(var g in f){b.plugins[g]=b.plugins[g]||[];b.plugins[g].push([e,f[g]])}},call:function(b,e,f){if(e=b.plugins[e])for(var g=0;g<e.length;g++)b.options[e[g][0]]&&e[g][1].apply(b.element,f)}},cssCache:{},css:function(b){if(c.ui.cssCache[b])return c.ui.cssCache[b];var e=
c('<div class="ui-gen">').addClass(b).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");c.ui.cssCache[b]=!!(!/auto|default/.test(e.css("cursor"))||/^[1-9]/.test(e.css("height"))||/^[1-9]/.test(e.css("width"))||!/none/.test(e.css("backgroundImage"))||!/transparent|rgba\(0, 0, 0, 0\)/.test(e.css("backgroundColor")));try{c("body").get(0).removeChild(e.get(0))}catch(f){}return c.ui.cssCache[b]},disableSelection:function(b){c(b).attr("unselectable","on").css("MozUserSelect",
"none")},enableSelection:function(b){c(b).attr("unselectable","off").css("MozUserSelect","")},hasScroll:function(b,e){e=e&&e=="left"?"scrollLeft":"scrollTop";var f=false;if(b[e]>0)return true;b[e]=1;f=b[e]>0;b[e]=0;return f}};var a=c.fn.remove;c.fn.remove=function(){c("*",this).add(this).triggerHandler("remove");return a.apply(this,arguments)};c.widget=function(b,e){var f=b.split(".")[0];b=b.split(".")[1];c.fn[b]=function(g){var h=typeof g=="string",i=Array.prototype.slice.call(arguments,1);if(h&&
d(f,b,g)){var k=c.data(this[0],b);return k?k[g].apply(k,i):undefined}return this.each(function(){var j=c.data(this,b);if(h&&j&&c.isFunction(j[g]))j[g].apply(j,i);else h||c.data(this,b,new c[f][b](this,g))})};c[f][b]=function(g,h){var i=this;this.widgetName=b;this.widgetEventPrefix=c[f][b].eventPrefix||b;this.widgetBaseClass=f+"-"+b;this.options=c.extend({},c.widget.defaults,c[f][b].defaults,h);this.element=c(g).bind("setData."+b,function(k,j,n){return i.setData(j,n)}).bind("getData."+b,function(k,
j){return i.getData(j)}).bind("remove",function(){return i.destroy()});this.init()};c[f][b].prototype=c.extend({},c.widget.prototype,e)};c.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(b){return this.options[b]},setData:function(b,e){this.options[b]=e;if(b=="disabled")this.element[e?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")},enable:function(){this.setData("disabled",false)},disable:function(){this.setData("disabled",
true)},trigger:function(b,e,f){var g=b==this.widgetEventPrefix?b:this.widgetEventPrefix+b;e=e||c.event.fix({type:g,target:this.element[0]});return this.element.triggerHandler(g,[e,f],this.options[b])}};c.widget.defaults={disabled:false};c.ui.mouse={mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(e){return b.mouseDown(e)});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},mouseDestroy:function(){this.element.unbind("."+
this.widgetName);c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable)},mouseDown:function(b){this._mouseStarted&&this.mouseUp(b);this._mouseDownEvent=b;var e=this,f=b.which==1,g=typeof this.options.cancel=="string"?c(b.target).parents().add(b.target).filter(this.options.cancel).length:false;if(!f||g||!this.mouseCapture(b))return true;this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){e._mouseDelayMet=true},this.options.delay);
if(this.mouseDistanceMet(b)&&this.mouseDelayMet(b)){this._mouseStarted=this.mouseStart(b)!==false;if(!this._mouseStarted){b.preventDefault();return true}}this._mouseMoveDelegate=function(h){return e.mouseMove(h)};this._mouseUpDelegate=function(h){return e.mouseUp(h)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false},mouseMove:function(b){if(c.browser.msie&&!b.button)return this.mouseUp(b);if(this._mouseStarted){this.mouseDrag(b);
return false}if(this.mouseDistanceMet(b)&&this.mouseDelayMet(b))(this._mouseStarted=this.mouseStart(this._mouseDownEvent,b)!==false)?this.mouseDrag(b):this.mouseUp(b);return!this._mouseStarted},mouseUp:function(b){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(b)}return false},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(){return this._mouseDelayMet},mouseStart:function(){},mouseDrag:function(){},mouseStop:function(){},mouseCapture:function(){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);
(function(c){c.widget("ui.draggable",c.extend({},c.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.disabled&&this.element.addClass("ui-draggable-disabled");this.mouseInit()},mouseStart:function(d){var a=this.options;if(this.helper||a.disabled||c(d.target).is(".ui-resizable-handle"))return false;var b=!this.options.handle||!c(this.options.handle,this.element).length?true:false;c(this.options.handle,
this.element).find("*").andSelf().each(function(){if(this==d.target)b=true});if(!b)return false;if(c.ui.ddmanager)c.ui.ddmanager.current=this;this.helper=c.isFunction(a.helper)?c(a.helper.apply(this.element[0],[d])):a.helper=="clone"?this.element.clone():this.element;this.helper.parents("body").length||this.helper.appendTo(a.appendTo=="parent"?this.element[0].parentNode:a.appendTo);this.helper[0]!=this.element[0]&&!/(fixed|absolute)/.test(this.helper.css("position"))&&this.helper.css("position","absolute");
this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0};this.cssPosition=this.helper.css("position");this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:d.pageX-this.offset.left,top:d.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();if(this.offsetParent[0]==document.body&&c.browser.mozilla)e=
{top:0,left:0};this.offset.parent={top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};e=this.element.position();this.offset.relative=this.cssPosition=="relative"?{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.offsetParent[0].scrollTop,left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.offsetParent[0].scrollLeft}:{top:0,left:0};this.originalPosition=this.generatePosition(d);this.helperProportions=
{width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(a.cursorAt){if(a.cursorAt.left!=undefined)this.offset.click.left=a.cursorAt.left+this.margins.left;if(a.cursorAt.right!=undefined)this.offset.click.left=this.helperProportions.width-a.cursorAt.right+this.margins.left;if(a.cursorAt.top!=undefined)this.offset.click.top=a.cursorAt.top+this.margins.top;if(a.cursorAt.bottom!=undefined)this.offset.click.top=this.helperProportions.height-a.cursorAt.bottom+this.margins.top}if(a.containment){if(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,c(a.containment=="document"?document:window).width()-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),(c(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-
this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)];if(!/^(document|window|parent)$/.test(a.containment)){e=c(a.containment)[0];var f=c(a.containment).offset();this.containment=[f.left+(parseInt(c(e).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left,f.top+(parseInt(c(e).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top,f.left+Math.max(e.scrollWidth,
e.offsetWidth)-(parseInt(c(e).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),f.top+Math.max(e.scrollHeight,e.offsetHeight)-(parseInt(c(e).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}}this.propagate("start",d);this.helperProportions={width:this.helper.outerWidth(),
height:this.helper.outerHeight()};c.ui.ddmanager&&!a.dropBehaviour&&c.ui.ddmanager.prepareOffsets(this,d);this.helper.addClass("ui-draggable-dragging");this.mouseDrag(d);return true},convertPositionTo:function(d,a){if(!a)a=this.position;d=d=="absolute"?1:-1;return{top:a.top+this.offset.relative.top*d+this.offset.parent.top*d-(this.cssPosition=="fixed"||this.cssPosition=="absolute"&&this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)*d+(this.cssPosition=="fixed"?c(document).scrollTop():
0)*d+this.margins.top*d,left:a.left+this.offset.relative.left*d+this.offset.parent.left*d-(this.cssPosition=="fixed"||this.cssPosition=="absolute"&&this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)*d+(this.cssPosition=="fixed"?c(document).scrollLeft():0)*d+this.margins.left*d}},generatePosition:function(d){var a=this.options;d={top:d.pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"||this.cssPosition=="absolute"&&this.offsetParent[0]==
document.body?0:this.offsetParent[0].scrollTop)-(this.cssPosition=="fixed"?c(document).scrollTop():0),left:d.pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"||this.cssPosition=="absolute"&&this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)-(this.cssPosition=="fixed"?c(document).scrollLeft():0)};if(!this.originalPosition)return d;if(this.containment){if(d.left<this.containment[0])d.left=this.containment[0];if(d.top<this.containment[1])d.top=
this.containment[1];if(d.left>this.containment[2])d.left=this.containment[2];if(d.top>this.containment[3])d.top=this.containment[3]}if(a.grid){var b=this.originalPosition.top+Math.round((d.top-this.originalPosition.top)/a.grid[1])*a.grid[1];d.top=this.containment?!(b<this.containment[1]||b>this.containment[3])?b:!(b<this.containment[1])?b-a.grid[1]:b+a.grid[1]:b;b=this.originalPosition.left+Math.round((d.left-this.originalPosition.left)/a.grid[0])*a.grid[0];d.left=this.containment?!(b<this.containment[0]||
b>this.containment[2])?b:!(b<this.containment[0])?b-a.grid[0]:b+a.grid[0]:b}return d},mouseDrag:function(d){this.position=this.generatePosition(d);this.positionAbs=this.convertPositionTo("absolute");this.position=this.propagate("drag",d)||this.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";c.ui.ddmanager&&c.ui.ddmanager.drag(this,d);return false},
mouseStop:function(d){var a=false;if(c.ui.ddmanager&&!this.options.dropBehaviour)a=c.ui.ddmanager.drop(this,d);if(this.options.revert=="invalid"&&!a||this.options.revert=="valid"&&a||this.options.revert===true){var b=this;c(this.helper).animate(this.originalPosition,parseInt(this.options.revert,10)||500,function(){b.propagate("stop",d);b.clear()})}else{this.propagate("stop",d);this.clear()}return false},clear:function(){this.helper.removeClass("ui-draggable-dragging");this.options.helper!="original"&&
!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},plugins:{},uiHash:function(){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options}},propagate:function(d,a){c.ui.plugin.call(this,d,[a,this.uiHash()]);if(d=="drag")this.positionAbs=this.convertPositionTo("absolute");return this.element.triggerHandler(d=="drag"?d:"drag"+d,[a,this.uiHash()],this.options[d])},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable-dragging ui-draggable-disabled");
this.mouseDestroy()}}}));c.extend(c.ui.draggable,{defaults:{appendTo:"parent",axis:false,cancel:":input",delay:0,distance:1,helper:"original"}});c.ui.plugin.add("draggable","cursor",{start:function(d,a){d=c("body");if(d.css("cursor"))a.options._cursor=d.css("cursor");d.css("cursor",a.options.cursor)},stop:function(d,a){a.options._cursor&&c("body").css("cursor",a.options._cursor)}});c.ui.plugin.add("draggable","zIndex",{start:function(d,a){d=c(a.helper);if(d.css("zIndex"))a.options._zIndex=d.css("zIndex");
d.css("zIndex",a.options.zIndex)},stop:function(d,a){a.options._zIndex&&c(a.helper).css("zIndex",a.options._zIndex)}});c.ui.plugin.add("draggable","opacity",{start:function(d,a){d=c(a.helper);if(d.css("opacity"))a.options._opacity=d.css("opacity");d.css("opacity",a.options.opacity)},stop:function(d,a){a.options._opacity&&c(a.helper).css("opacity",a.options._opacity)}});c.ui.plugin.add("draggable","iframeFix",{start:function(d,a){c(a.options.iframeFix===true?"iframe":a.options.iframeFix).each(function(){c('<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(c(this).offset()).appendTo("body")})},stop:function(){c("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this)})}});c.ui.plugin.add("draggable","scroll",{start:function(d,a){d=a.options;a=c(this).data("draggable");d.scrollSensitivity=d.scrollSensitivity||20;d.scrollSpeed=d.scrollSpeed||20;a.overflowY=function(b){do{if(/auto|scroll/.test(b.css("overflow"))||/auto|scroll/.test(b.css("overflow-y")))return b;
b=b.parent()}while(b[0].parentNode);return c(document)}(this);a.overflowX=function(b){do{if(/auto|scroll/.test(b.css("overflow"))||/auto|scroll/.test(b.css("overflow-x")))return b;b=b.parent()}while(b[0].parentNode);return c(document)}(this);if(a.overflowY[0]!=document&&a.overflowY[0].tagName!="HTML")a.overflowYOffset=a.overflowY.offset();if(a.overflowX[0]!=document&&a.overflowX[0].tagName!="HTML")a.overflowXOffset=a.overflowX.offset()},drag:function(d,a){a=a.options;var b=c(this).data("draggable");
if(b.overflowY[0]!=document&&b.overflowY[0].tagName!="HTML"){if(b.overflowYOffset.top+b.overflowY[0].offsetHeight-d.pageY<a.scrollSensitivity)b.overflowY[0].scrollTop+=a.scrollSpeed;if(d.pageY-b.overflowYOffset.top<a.scrollSensitivity)b.overflowY[0].scrollTop-=a.scrollSpeed}else{d.pageY-c(document).scrollTop()<a.scrollSensitivity&&c(document).scrollTop(c(document).scrollTop()-a.scrollSpeed);c(window).height()-(d.pageY-c(document).scrollTop())<a.scrollSensitivity&&c(document).scrollTop(c(document).scrollTop()+
a.scrollSpeed)}if(b.overflowX[0]!=document&&b.overflowX[0].tagName!="HTML"){if(b.overflowXOffset.left+b.overflowX[0].offsetWidth-d.pageX<a.scrollSensitivity)b.overflowX[0].scrollLeft+=a.scrollSpeed;if(d.pageX-b.overflowXOffset.left<a.scrollSensitivity)b.overflowX[0].scrollLeft-=a.scrollSpeed}else{d.pageX-c(document).scrollLeft()<a.scrollSensitivity&&c(document).scrollLeft(c(document).scrollLeft()-a.scrollSpeed);c(window).width()-(d.pageX-c(document).scrollLeft())<a.scrollSensitivity&&c(document).scrollLeft(c(document).scrollLeft()+
a.scrollSpeed)}}});c.ui.plugin.add("draggable","snap",{start:function(d,a){var b=c(this).data("draggable");b.snapElements=[];c(a.options.snap.constructor!=String?a.options.snap.items||":data(draggable)":a.options.snap).each(function(){var e=c(this),f=e.offset();this!=b.element[0]&&b.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:f.top,left:f.left})})},drag:function(d,a){d=c(this).data("draggable");for(var b=a.options.snapTolerance||20,e=a.absolutePosition.left,f=e+d.helperProportions.width,
g=a.absolutePosition.top,h=g+d.helperProportions.height,i=d.snapElements.length-1;i>=0;i--){var k=d.snapElements[i].left,j=k+d.snapElements[i].width,n=d.snapElements[i].top,m=n+d.snapElements[i].height;if(k-b<e&&e<j+b&&n-b<g&&g<m+b||k-b<e&&e<j+b&&n-b<h&&h<m+b||k-b<f&&f<j+b&&n-b<g&&g<m+b||k-b<f&&f<j+b&&n-b<h&&h<m+b){if(a.options.snapMode!="inner"){var l=Math.abs(n-h)<=20,r=Math.abs(m-g)<=20,t=Math.abs(k-f)<=20,q=Math.abs(j-e)<=20;if(l)a.position.top=d.convertPositionTo("relative",{top:n-d.helperProportions.height,
left:0}).top;if(r)a.position.top=d.convertPositionTo("relative",{top:m,left:0}).top;if(t)a.position.left=d.convertPositionTo("relative",{top:0,left:k-d.helperProportions.width}).left;if(q)a.position.left=d.convertPositionTo("relative",{top:0,left:j}).left}var p=l||r||t||q;if(a.options.snapMode!="outer"){l=Math.abs(n-g)<=20;r=Math.abs(m-h)<=20;t=Math.abs(k-e)<=20;q=Math.abs(j-f)<=20;if(l)a.position.top=d.convertPositionTo("relative",{top:n,left:0}).top;if(r)a.position.top=d.convertPositionTo("relative",
{top:m-d.helperProportions.height,left:0}).top;if(t)a.position.left=d.convertPositionTo("relative",{top:0,left:k}).left;if(q)a.position.left=d.convertPositionTo("relative",{top:0,left:j-d.helperProportions.width}).left}if(!d.snapElements[i].snapping&&(l||r||t||q||p))d.options.snap.snap&&d.options.snap.snap.call(d.element,null,c.extend(d.uiHash(),{snapItem:d.snapElements[i].item}));d.snapElements[i].snapping=l||r||t||q||p}else{d.snapElements[i].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,
null,c.extend(d.uiHash(),{snapItem:d.snapElements[i].item}));d.snapElements[i].snapping=false}}}});c.ui.plugin.add("draggable","connectToSortable",{start:function(d,a){var b=c(this).data("draggable");b.sortables=[];c(a.options.connectToSortable).each(function(){if(c.data(this,"sortable")){var e=c.data(this,"sortable");b.sortables.push({instance:e,shouldRevert:e.options.revert});e.refreshItems();e.propagate("activate",d,b)}})},stop:function(d){var a=c(this).data("draggable");c.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.element.triggerHandler("sortreceive",[d,c.extend(this.instance.ui(),{sender:a.element})],this.instance.options.receive);this.instance.options.helper=this.instance.options._helper}else this.instance.propagate("deactivate",d,a)})},drag:function(d,a){var b=c(this).data("draggable"),e=this;function f(g){var h=g.left,i=h+g.width,k=g.top;g=
k+g.height;return h<this.positionAbs.left+this.offset.click.left&&this.positionAbs.left+this.offset.click.left<i&&k<this.positionAbs.top+this.offset.click.top&&this.positionAbs.top+this.offset.click.top<g}c.each(b.sortables,function(){if(f.call(b,this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=c(e).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=
function(){return a.helper[0]};d.target=this.instance.currentItem[0];this.instance.mouseCapture(d,true);this.instance.mouseStart(d,true,true);this.instance.offset.click.top=b.offset.click.top;this.instance.offset.click.left=b.offset.click.left;this.instance.offset.parent.left-=b.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=b.offset.parent.top-this.instance.offset.parent.top;b.propagate("toSortable",d)}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.mouseStop(d,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();b.propagate("fromSortable",d)}})}});c.ui.plugin.add("draggable","stack",{start:function(d,a){d=c.makeArray(c(a.options.stack.group)).sort(function(b,e){return(parseInt(c(b).css("zIndex"),10)||a.options.stack.min)-(parseInt(c(e).css("zIndex"),
10)||a.options.stack.min)});c(d).each(function(b){this.style.zIndex=a.options.stack.min+b});this[0].style.zIndex=a.options.stack.min+d.length}})})(jQuery);
(function(c){c.widget("ui.droppable",{init:function(){var d=this.options,a=d.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&this.options.accept.constructor==Function?this.options.accept:function(b){return b.is(a)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};c.ui.ddmanager.droppables.push(this)},plugins:{},ui:function(d){return{draggable:d.currentItem||d.element,helper:d.helper,position:d.position,absolutePosition:d.positionAbs,
options:this.options,element:this.element}},destroy:function(){for(var d=c.ui.ddmanager.droppables,a=0;a<d.length;a++)d[a]==this&&d.splice(a,1);this.element.removeClass("ui-droppable-disabled").removeData("droppable").unbind(".droppable")},over:function(d){var a=c.ui.ddmanager.current;if(!(!a||(a.currentItem||a.element)[0]==this.element[0]))if(this.options.accept.call(this.element,a.currentItem||a.element)){c.ui.plugin.call(this,"over",[d,this.ui(a)]);this.element.triggerHandler("dropover",[d,this.ui(a)],
this.options.over)}},out:function(d){var a=c.ui.ddmanager.current;if(!(!a||(a.currentItem||a.element)[0]==this.element[0]))if(this.options.accept.call(this.element,a.currentItem||a.element)){c.ui.plugin.call(this,"out",[d,this.ui(a)]);this.element.triggerHandler("dropout",[d,this.ui(a)],this.options.out)}},drop:function(d,a){var b=a||c.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var f=
c.data(this,"droppable");if(f.options.greedy&&c.ui.intersect(b,c.extend(f,{offset:f.element.offset()}),f.options.tolerance)){e=true;return false}});if(e)return false;if(this.options.accept.call(this.element,b.currentItem||b.element)){c.ui.plugin.call(this,"drop",[d,this.ui(b)]);this.element.triggerHandler("drop",[d,this.ui(b)],this.options.drop);return true}return false},activate:function(d){var a=c.ui.ddmanager.current;c.ui.plugin.call(this,"activate",[d,this.ui(a)]);a&&this.element.triggerHandler("dropactivate",
[d,this.ui(a)],this.options.activate)},deactivate:function(d){var a=c.ui.ddmanager.current;c.ui.plugin.call(this,"deactivate",[d,this.ui(a)]);a&&this.element.triggerHandler("dropdeactivate",[d,this.ui(a)],this.options.deactivate)}});c.extend(c.ui.droppable,{defaults:{disabled:false,tolerance:"intersect"}});c.ui.intersect=function(d,a,b){if(!a.offset)return false;var e=(d.positionAbs||d.position.absolute).left,f=e+d.helperProportions.width,g=(d.positionAbs||d.position.absolute).top,h=g+d.helperProportions.height,
i=a.offset.left,k=i+a.proportions.width,j=a.offset.top;a=j+a.proportions.height;switch(b){case "fit":return i<e&&f<k&&j<g&&h<a;case "intersect":return i<e+d.helperProportions.width/2&&f-d.helperProportions.width/2<k&&j<g+d.helperProportions.height/2&&h-d.helperProportions.height/2<a;case "pointer":return i<(d.positionAbs||d.position.absolute).left+(d.clickOffset||d.offset.click).left&&(d.positionAbs||d.position.absolute).left+(d.clickOffset||d.offset.click).left<k&&j<(d.positionAbs||d.position.absolute).top+
(d.clickOffset||d.offset.click).top&&(d.positionAbs||d.position.absolute).top+(d.clickOffset||d.offset.click).top<a;case "touch":return(g>=j&&g<=a||h>=j&&h<=a||g<j&&h>a)&&(e>=i&&e<=k||f>=i&&f<=k||e<i&&f>k);default:return false}};c.ui.ddmanager={current:null,droppables:[],prepareOffsets:function(d,a){for(var b=c.ui.ddmanager.droppables,e=a?a.type:null,f=0;f<b.length;f++)if(!(b[f].options.disabled||d&&!b[f].options.accept.call(b[f].element,d.currentItem||d.element))){b[f].visible=b[f].element.css("display")!=
"none";if(b[f].visible){b[f].offset=b[f].element.offset();b[f].proportions={width:b[f].element[0].offsetWidth,height:b[f].element[0].offsetHeight};if(e=="dragstart"||e=="sortactivate")b[f].activate.call(b[f],a)}}},drop:function(d,a){var b=false;c.each(c.ui.ddmanager.droppables,function(){if(this.options){if(!this.options.disabled&&this.visible&&c.ui.intersect(d,this,this.options.tolerance))b=this.drop.call(this,a);if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element,d.currentItem||
d.element)){this.isout=1;this.isover=0;this.deactivate.call(this,a)}}});return b},drag:function(d,a){c.ui.ddmanager.prepareOffsets(d,a);c.each(c.ui.ddmanager.droppables,function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var b=c.ui.intersect(d,this,this.options.tolerance);if(b=!b&&this.isover==1?"isout":b&&this.isover==0?"isover":null){var e;if(this.options.greedy){var f=this.element.parents(":data(droppable):eq(0)");if(f.length){e=c.data(f[0],"droppable");e.greedyChild=b=="isover"?
1:0}}if(e&&b=="isover"){e.isover=0;e.isout=1;e.out.call(e,a)}this[b]=1;this[b=="isout"?"isover":"isout"]=0;this[b=="isover"?"over":"out"].call(this,a);if(e&&b=="isout"){e.isout=0;e.isover=1;e.over.call(e,a)}}}})}};c.ui.plugin.add("droppable","activeClass",{activate:function(d,a){c(this).addClass(a.options.activeClass)},deactivate:function(d,a){c(this).removeClass(a.options.activeClass)},drop:function(d,a){c(this).removeClass(a.options.activeClass)}});c.ui.plugin.add("droppable","hoverClass",{over:function(d,
a){c(this).addClass(a.options.hoverClass)},out:function(d,a){c(this).removeClass(a.options.hoverClass)},drop:function(d,a){c(this).removeClass(a.options.hoverClass)}})})(jQuery);
(function(c){c.widget("ui.resizable",c.extend({},c.ui.mouse,{init:function(){var d=this,a=this.options,b=this.element.css("position");this.originalElement=this.element;this.element.addClass("ui-resizable").css({position:/static/.test(b)?"relative":b});c.extend(a,{_aspectRatio:!!a.aspectRatio,helper:a.helper||a.ghost||a.animate?a.helper||"proxy":null,knobHandles:a.knobHandles===true?"ui-resizable-knob-handle":a.knobHandles});b="1px solid #DEDEDE";a.defaultTheme={"ui-resizable":{display:"block"},"ui-resizable-handle":{position:"absolute",
background:"#F2F2F2",fontSize:"0.1px"},"ui-resizable-n":{cursor:"n-resize",height:"4px",left:"0px",right:"0px",borderTop:b},"ui-resizable-s":{cursor:"s-resize",height:"4px",left:"0px",right:"0px",borderBottom:b},"ui-resizable-e":{cursor:"e-resize",width:"4px",top:"0px",bottom:"0px",borderRight:b},"ui-resizable-w":{cursor:"w-resize",width:"4px",top:"0px",bottom:"0px",borderLeft:b},"ui-resizable-se":{cursor:"se-resize",width:"4px",height:"4px",borderRight:b,borderBottom:b},"ui-resizable-sw":{cursor:"sw-resize",
width:"4px",height:"4px",borderBottom:b,borderLeft:b},"ui-resizable-ne":{cursor:"ne-resize",width:"4px",height:"4px",borderRight:b,borderTop:b},"ui-resizable-nw":{cursor:"nw-resize",width:"4px",height:"4px",borderLeft:b,borderTop:b}};a.knobTheme={"ui-resizable-handle":{background:"#F2F2F2",border:"1px solid #808080",height:"8px",width:"8px"},"ui-resizable-n":{cursor:"n-resize",top:"0px",left:"45%"},"ui-resizable-s":{cursor:"s-resize",bottom:"0px",left:"45%"},"ui-resizable-e":{cursor:"e-resize",right:"0px",
top:"45%"},"ui-resizable-w":{cursor:"w-resize",left:"0px",top:"45%"},"ui-resizable-se":{cursor:"se-resize",right:"0px",bottom:"0px"},"ui-resizable-sw":{cursor:"sw-resize",left:"0px",bottom:"0px"},"ui-resizable-nw":{cursor:"nw-resize",left:"0px",top:"0px"},"ui-resizable-ne":{cursor:"ne-resize",right:"0px",top:"0px"}};a._nodeName=this.element[0].nodeName;if(a._nodeName.match(/canvas|textarea|input|select|button|img/i)){b=this.element;/relative/.test(b.css("position"))&&c.browser.opera&&b.css({position:"relative",
top:"auto",left:"auto"});b.wrap(c('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:b.css("position"),width:b.outerWidth(),height:b.outerHeight(),top:b.css("top"),left:b.css("left")}));b=this.element;this.element=this.element.parent();this.element.data("resizable",this);this.element.css({marginLeft:b.css("marginLeft"),marginTop:b.css("marginTop"),marginRight:b.css("marginRight"),marginBottom:b.css("marginBottom")});b.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});
c.browser.safari&&a.preventDefault&&b.css("resize","none");a.proportionallyResize=b.css({position:"static",zoom:1,display:"block"});this.element.css({margin:b.css("margin")});this._proportionallyResize()}if(!a.handles)a.handles=!c(".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(a.handles.constructor==String){a.zIndex=a.zIndex||
1E3;if(a.handles=="all")a.handles="n,e,s,w,se,sw,ne,nw";b=a.handles.split(",");a.handles={};for(var e={handle:"position: absolute; display: none; overflow:hidden;",n:"top: 0pt; width:100%;",e:"right: 0pt; height:100%;",s:"bottom: 0pt; width:100%;",w:"left: 0pt; height:100%;",se:"bottom: 0pt; right: 0px;",sw:"bottom: 0pt; left: 0px;",ne:"top: 0pt; right: 0px;",nw:"top: 0pt; left: 0px;"},f=0;f<b.length;f++){var g=c.trim(b[f]),h=a.defaultTheme,i="ui-resizable-"+g,k=!c.ui.css(i)&&!a.knobHandles,j=c.ui.css("ui-resizable-knob-handle");
h=c.extend(h[i],h["ui-resizable-handle"]);j=c.extend(a.knobTheme[i],!j?a.knobTheme["ui-resizable-handle"]:{});var n=/sw|se|ne|nw/.test(g)?{zIndex:++a.zIndex}:{},m=k?e[g]:"";i=c(['<div class="ui-resizable-handle ',i,'" style="',m,e.handle,'"></div>'].join("")).css(n);a.handles[g]=".ui-resizable-"+g;this.element.append(i.css(k?h:{}).css(a.knobHandles?j:{}).addClass(a.knobHandles?"ui-resizable-knob-handle":"").addClass(a.knobHandles))}if(a.knobHandles)this.element.addClass("ui-resizable-knob").css(!c.ui.css("ui-resizable-knob")?
{}:{})}this._renderAxis=function(l){l=l||this.element;for(var r in a.handles){if(a.handles[r].constructor==String)a.handles[r]=c(a.handles[r],this.element).show();a.transparent&&a.handles[r].css({opacity:0});if(this.element.is(".ui-wrapper")&&a._nodeName.match(/textarea|input|select|button/i)){var t=c(a.handles[r],this.element),q=0;q=/sw|ne|nw|se|n|s/.test(r)?t.outerHeight():t.outerWidth();t=["padding",/ne|nw|n/.test(r)?"Top":/se|sw|s/.test(r)?"Bottom":/^e$/.test(r)?"Right":"Left"].join("");a.transparent||
l.css(t,q);this._proportionallyResize()}c(a.handles[r])}};this._renderAxis(this.element);a._handles=c(".ui-resizable-handle",d.element);a.disableSelection&&a._handles.each(function(l,r){c.ui.disableSelection(r)});a._handles.mouseover(function(){if(!a.resizing){if(this.className)var l=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);d.axis=a.axis=l&&l[1]?l[1]:"se"}});if(a.autoHide){a._handles.hide();c(d.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");
a._handles.show()},function(){if(!a.resizing){c(this).addClass("ui-resizable-autohide");a._handles.hide()}})}this.mouseInit()},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,options:this.options,originalSize:this.originalSize,originalPosition:this.originalPosition}},propagate:function(d,a){c.ui.plugin.call(this,d,[a,this.ui()]);d!="resize"&&this.element.triggerHandler(["resize",d].join(""),[a,this.ui()],
this.options[d])},destroy:function(){var d=this.element,a=d.children(".ui-resizable").get(0);this.mouseDestroy();function b(e){c(e).removeClass("ui-resizable ui-resizable-disabled").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}b(d);if(d.is(".ui-wrapper")&&a){d.parent().append(c(a).css({position:d.css("position"),width:d.outerWidth(),height:d.outerHeight(),top:d.css("top"),left:d.css("left")})).end().remove();b(a)}},mouseStart:function(d){if(this.options.disabled)return false;
var a=false;for(var b in this.options.handles)if(c(this.options.handles[b])[0]==d.target)a=true;if(!a)return false;a=this.options;var e=this.element.position();b=this.element;function f(k){return parseInt(k,10)||0}var g=c.browser.msie&&c.browser.version<7;a.resizing=true;a.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(b.is(".ui-draggable")||/absolute/.test(b.css("position"))){var h=c.browser.msie&&!a.containment&&/absolute/.test(b.css("position"))&&!/relative/.test(b.parent().css("position")),
i=h?a.documentScroll.top:0;h=h?a.documentScroll.left:0;b.css({position:"absolute",top:e.top+i,left:e.left+h})}c.browser.opera&&/relative/.test(b.css("position"))&&b.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();e=f(this.helper.css("left"));i=f(this.helper.css("top"));if(a.containment){e+=c(a.containment).scrollLeft()||0;i+=c(a.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:e,top:i};this.size=a.helper||g?{width:b.outerWidth(),height:b.outerHeight()}:
{width:b.width(),height:b.height()};this.originalSize=a.helper||g?{width:b.outerWidth(),height:b.outerHeight()}:{width:b.width(),height:b.height()};this.originalPosition={left:e,top:i};this.sizeDiff={width:b.outerWidth()-b.width(),height:b.outerHeight()-b.height()};this.originalMousePosition={left:d.pageX,top:d.pageY};a.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:this.originalSize.height/this.originalSize.width||1;a.preserveCursor&&c("body").css("cursor",this.axis+"-resize");this.propagate("start",
d);return true},mouseDrag:function(d){var a=this.helper,b=this.options,e=this.originalMousePosition,f=this.axis,g=d.pageX-e.left||0;e=d.pageY-e.top||0;f=this._change[f];if(!f)return false;g=f.apply(this,[d,g,e]);if(b._aspectRatio||d.shiftKey)g=this._updateRatio(g,d);g=this._respectSize(g,d);this.propagate("resize",d);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!b.helper&&b.proportionallyResize&&this._proportionallyResize();
this._updateCache(g);this.element.triggerHandler("resize",[d,this.ui()],this.options.resize);return false},mouseStop:function(d){this.options.resizing=false;var a=this.options,b=this;if(a.helper){var e=a.proportionallyResize,f=e&&/textarea/i.test(e.get(0).nodeName);e=f&&c.ui.hasScroll(e.get(0),"left")?0:b.sizeDiff.height;f=f?0:b.sizeDiff.width;f={width:b.size.width-f,height:b.size.height-e};e=parseInt(b.element.css("left"),10)+(b.position.left-b.originalPosition.left)||null;b=parseInt(b.element.css("top"),
10)+(b.position.top-b.originalPosition.top)||null;a.animate||this.element.css(c.extend(f,{top:b,left:e}));a.helper&&!a.animate&&this._proportionallyResize()}a.preserveCursor&&c("body").css("cursor","auto");this.propagate("stop",d);a.helper&&this.helper.remove();return false},_updateCache:function(d){this.offset=this.helper.offset();if(d.left)this.position.left=d.left;if(d.top)this.position.top=d.top;if(d.height)this.size.height=d.height;if(d.width)this.size.width=d.width},_updateRatio:function(d){var a=
this.options,b=this.position,e=this.size,f=this.axis;if(d.height)d.width=e.height/a.aspectRatio;else if(d.width)d.height=e.width*a.aspectRatio;if(f=="sw"){d.left=b.left+(e.width-d.width);d.top=null}if(f=="nw"){d.top=b.top+(e.height-d.height);d.left=b.left+(e.width-d.width)}return d},_respectSize:function(d){var a=this.options,b=this.axis,e=d.width&&a.maxWidth&&a.maxWidth<d.width,f=d.height&&a.maxHeight&&a.maxHeight<d.height,g=d.width&&a.minWidth&&a.minWidth>d.width,h=d.height&&a.minHeight&&a.minHeight>
d.height;if(g)d.width=a.minWidth;if(h)d.height=a.minHeight;if(e)d.width=a.maxWidth;if(f)d.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,k=this.position.top+this.size.height,j=/sw|nw|w/.test(b);b=/nw|ne|n/.test(b);if(g&&j)d.left=i-a.minWidth;if(e&&j)d.left=i-a.maxWidth;if(h&&b)d.top=k-a.minHeight;if(f&&b)d.top=k-a.maxHeight;if((a=!d.width&&!d.height)&&!d.left&&d.top)d.top=null;else if(a&&!d.top&&d.left)d.left=null;return d},_proportionallyResize:function(){var d=this.options;
if(d.proportionallyResize){var a=d.proportionallyResize,b=this.helper||this.element;if(!d.borderDif){var e=[a.css("borderTopWidth"),a.css("borderRightWidth"),a.css("borderBottomWidth"),a.css("borderLeftWidth")],f=[a.css("paddingTop"),a.css("paddingRight"),a.css("paddingBottom"),a.css("paddingLeft")];d.borderDif=c.map(e,function(g,h){g=parseInt(g,10)||0;h=parseInt(f[h],10)||0;return g+h})}a.css({height:b.height()-d.borderDif[0]-d.borderDif[2]+"px",width:b.width()-d.borderDif[1]-d.borderDif[3]+"px"})}},
_renderProxy:function(){var d=this.element,a=this.options;this.elementOffset=d.offset();if(a.helper){this.helper=this.helper||c('<div style="overflow:hidden;"></div>');var b=c.browser.msie&&c.browser.version<7,e=b?1:0;b=b?2:-1;this.helper.addClass(a.helper).css({width:d.outerWidth()+b,height:d.outerHeight()+b,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++a.zIndex});this.helper.appendTo("body");a.disableSelection&&c.ui.disableSelection(this.helper.get(0))}else this.helper=
d},_change:{e:function(d,a){return{width:this.originalSize.width+a}},w:function(d,a){d=this.originalSize;var b=this.originalPosition;return{left:b.left+a,width:d.width-a}},n:function(d,a,b){d=this.originalSize;a=this.originalPosition;return{top:a.top+b,height:d.height-b}},s:function(d,a,b){return{height:this.originalSize.height+b}},se:function(d,a,b){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[d,a,b]))},sw:function(d,a,b){return c.extend(this._change.s.apply(this,
arguments),this._change.w.apply(this,[d,a,b]))},ne:function(d,a,b){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[d,a,b]))},nw:function(d,a,b){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[d,a,b]))}}}));c.extend(c.ui.resizable,{defaults:{cancel:":input",distance:1,delay:0,preventDefault:true,transparent:false,minWidth:10,minHeight:10,aspectRatio:false,disableSelection:true,preserveCursor:true,autoHide:false,knobHandles:false}});c.ui.plugin.add("resizable",
"containment",{start:function(d,a){var b=a.options;d=c(this).data("resizable");a=d.element;b=b.containment;if(a=b instanceof c?b.get(0):/parent/.test(b)?a.parent().get(0):b){d.containerElement=c(a);if(/document/.test(b)||b==document){d.containerOffset={left:0,top:0};d.containerPosition={left:0,top:0};d.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{d.containerOffset=c(a).offset();d.containerPosition=c(a).position();
d.containerSize={height:c(a).innerHeight(),width:c(a).innerWidth()};b=d.containerOffset;var e=d.containerSize.height,f=d.containerSize.width;f=c.ui.hasScroll(a,"left")?a.scrollWidth:f;e=c.ui.hasScroll(a)?a.scrollHeight:e;d.parentData={element:a,left:b.left,top:b.top,width:f,height:e}}}},resize:function(d,a){a=a.options;var b=c(this).data("resizable"),e=b.containerOffset,f=b.position;d=a._aspectRatio||d.shiftKey;var g={top:0,left:0},h=b.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=
b.containerPosition;if(f.left<(a.helper?e.left:g.left)){b.size.width+=a.helper?b.position.left-e.left:b.position.left-g.left;if(d)b.size.height=b.size.width*a.aspectRatio;b.position.left=a.helper?e.left:g.left}if(f.top<(a.helper?e.top:0)){b.size.height+=a.helper?b.position.top-e.top:b.position.top;if(d)b.size.width=b.size.height/a.aspectRatio;b.position.top=a.helper?e.top:0}f=(a.helper?b.offset.left-e.left:b.position.left-g.left)+b.sizeDiff.width;e=(a.helper?b.offset.top-e.top:b.position.top)+b.sizeDiff.height;
if(f+b.size.width>=b.parentData.width){b.size.width=b.parentData.width-f;if(d)b.size.height=b.size.width*a.aspectRatio}if(e+b.size.height>=b.parentData.height){b.size.height=b.parentData.height-e;if(d)b.size.width=b.size.height/a.aspectRatio}},stop:function(d,a){d=a.options;var b=c(this).data("resizable");a=b.containerOffset;var e=b.containerPosition,f=b.containerElement,g=c(b.helper);b=g.offset();var h=g.innerWidth();g=g.innerHeight();d.helper&&!d.animate&&/relative/.test(f.css("position"))&&c(this).css({left:b.left-
a.left,top:b.top-a.top,width:h,height:g});d.helper&&!d.animate&&/static/.test(f.css("position"))&&c(this).css({left:e.left+(b.left-a.left),top:e.top+(b.top-a.top),width:h,height:g})}});c.ui.plugin.add("resizable","grid",{resize:function(d,a){var b=a.options;d=c(this).data("resizable");var e=d.size;a=d.originalSize;var f=d.originalPosition,g=d.axis;b.grid=typeof b.grid=="number"?[b.grid,b.grid]:b.grid;var h=Math.round((e.width-a.width)/(b.grid[0]||1))*(b.grid[0]||1);b=Math.round((e.height-a.height)/
(b.grid[1]||1))*(b.grid[1]||1);if(/^(se|s|e)$/.test(g)){d.size.width=a.width+h;d.size.height=a.height+b}else if(/^(ne)$/.test(g)){d.size.width=a.width+h;d.size.height=a.height+b;d.position.top=f.top-b}else{if(/^(sw)$/.test(g)){d.size.width=a.width+h;d.size.height=a.height+b}else{d.size.width=a.width+h;d.size.height=a.height+b;d.position.top=f.top-b}d.position.left=f.left-h}}});c.ui.plugin.add("resizable","animate",{stop:function(d,a){a=a.options;var b=c(this).data("resizable"),e=a.proportionallyResize,
f=e&&/textarea/i.test(e.get(0).nodeName),g=f&&c.ui.hasScroll(e.get(0),"left")?0:b.sizeDiff.height;f=f?0:b.sizeDiff.width;g={width:b.size.width-f,height:b.size.height-g};f=parseInt(b.element.css("left"),10)+(b.position.left-b.originalPosition.left)||null;var h=parseInt(b.element.css("top"),10)+(b.position.top-b.originalPosition.top)||null;b.element.animate(c.extend(g,h&&f?{top:h,left:f}:{}),{duration:a.animateDuration||"slow",easing:a.animateEasing||"swing",step:function(){var i={width:parseInt(b.element.css("width"),
10),height:parseInt(b.element.css("height"),10),top:parseInt(b.element.css("top"),10),left:parseInt(b.element.css("left"),10)};e&&e.css({width:i.width,height:i.height});b._updateCache(i);b.propagate("animate",d)}})}});c.ui.plugin.add("resizable","ghost",{start:function(d,a){d=a.options;a=c(this).data("resizable");var b=d.proportionallyResize,e=a.size;a.ghost=b?b.clone():a.element.clone();a.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof d.ghost==
"string"?d.ghost:"");a.ghost.appendTo(a.helper)},resize:function(){var d=c(this).data("resizable");d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(){var d=c(this).data("resizable");d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}});c.ui.plugin.add("resizable","alsoResize",{start:function(d,a){d=a.options;c(this).data("resizable");function b(e){c(e).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),
10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})}if(typeof d.alsoResize=="object")if(d.alsoResize.length){d.alsoResize=d.alsoResize[0];b(d.alsoResize)}else c.each(d.alsoResize,function(e){b(e)});else b(d.alsoResize)},resize:function(d,a){d=a.options;a=c(this).data("resizable");var b=a.originalSize,e=a.originalPosition,f={height:a.size.height-b.height||0,width:a.size.width-b.width||0,top:a.position.top-e.top||0,left:a.position.left-
e.left||0};function g(h,i){c(h).each(function(){var k=c(this).data("resizable-alsoresize"),j={},n=i&&i.length?i:["width","height","top","left"];c.each(n||["width","height","top","left"],function(m,l){if((m=(k[l]||0)+(f[l]||0))&&m>=0)j[l]=m||null});c(this).css(j)})}typeof d.alsoResize=="object"?c.each(d.alsoResize,function(h,i){g(h,i)}):g(d.alsoResize)},stop:function(){c(this).removeData("resizable-alsoresize-start")}})})(jQuery);
(function(c){function d(a,b){var e=c.browser.safari&&c.browser.version<522;if(a.contains&&!e)return a.contains(b);if(a.compareDocumentPosition)return!!(a.compareDocumentPosition(b)&16);for(;b=b.parentNode;)if(b==a)return true;return false}c.widget("ui.sortable",c.extend({},c.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;/(relative|absolute|fixed)/.test(this.element.css("position"))||
this.element.css("position","relative");this.offset=this.element.offset();this.mouseInit()},plugins:{},ui:function(a){return{helper:(a||this).helper,placeholder:(a||this).placeholder||c([]),position:(a||this).position,absolutePosition:(a||this).positionAbs,options:this.options,element:this.element,item:(a||this).currentItem,sender:a?a.element:null}},propagate:function(a,b,e,f){c.ui.plugin.call(this,a,[b,this.ui(e)]);f||this.element.triggerHandler(a=="sort"?a:"sort"+a,[b,this.ui(e)],this.options[a])},
serialize:function(a){var b=this.getItemsAsjQuery(a&&a.connected),e=[];a=a||{};c(b).each(function(){var f=(c(this.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(f)e.push((a.key||f[1])+"[]="+(a.key&&a.expression?f[1]:f[2]))});return e.join("&")},toArray:function(a){var b=this.getItemsAsjQuery(o&&o.connected),e=[];b.each(function(){e.push(c(this).attr(a||"id"))});return e},intersectsWith:function(a){var b=this.positionAbs.left,e=b+this.helperProportions.width,f=this.positionAbs.top,
g=f+this.helperProportions.height,h=a.left,i=h+a.width,k=a.top,j=k+a.height,n=this.offset.click.top,m=this.offset.click.left;n=f+n>k&&f+n<j&&b+m>h&&b+m<i;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance=="guess"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?n:h<b+this.helperProportions.width/2&&e-this.helperProportions.width/2<i&&k<f+this.helperProportions.height/2&&g-this.helperProportions.height/
2<j},intersectsWithEdge:function(a){var b=this.positionAbs.left,e=b+this.helperProportions.width,f=this.positionAbs.top,g=f+this.helperProportions.height,h=a.left,i=h+a.width,k=a.top,j=k+a.height,n=this.offset.click.top,m=this.offset.click.left,l=f+n>k&&f+n<j&&b+m>h&&b+m<i;if(this.options.tolerance=="pointer"||this.options.tolerance=="guess"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]){if(!l)return false;if(this.floating){if(b+m>h&&b+m<h+a.width/2)return 2;
if(b+m>h+a.width/2&&b+m<i)return 1}else{a=a.height;b=f-this.updateOriginalPosition.top<0?2:1;if(b==1&&f+n<k+a/2)return 2;else if(b==2&&f+n>k+a/2)return 1}}else{if(!(h<b+this.helperProportions.width/2&&e-this.helperProportions.width/2<i&&k<f+this.helperProportions.height/2&&g-this.helperProportions.height/2<j))return false;if(this.floating){if(e>h&&b<h)return 2;if(b<i&&e>i)return 1}else{if(g>k&&f<k)return 1;if(f<j&&g>j)return 2}}return false},refresh:function(){this.refreshItems();this.refreshPositions()},
getItemsAsjQuery:function(a){var b=[],e=[];if(this.options.connectWith&&a)for(a=this.options.connectWith.length-1;a>=0;a--)for(var f=c(this.options.connectWith[a]),g=f.length-1;g>=0;g--){var h=c.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)e.push([c.isFunction(h.options.items)?h.options.items.call(h.element):c(h.options.items,h.element).not(".ui-sortable-helper"),h])}e.push([c.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):
c(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(a=e.length-1;a>=0;a--)e[a][0].each(function(){b.push(this)});return c(b)},refreshItems:function(){this.items=[];this.containers=[this];var a=this.items,b=[[c.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):c(this.options.items,this.element),this]];if(this.options.connectWith)for(var e=this.options.connectWith.length-1;e>=0;e--)for(var f=c(this.options.connectWith[e]),
g=f.length-1;g>=0;g--){var h=c.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled){b.push([c.isFunction(h.options.items)?h.options.items.call(h.element):c(h.options.items,h.element),h]);this.containers.push(h)}}for(e=b.length-1;e>=0;e--)b[e][0].each(function(){c.data(this,"sortable-item",b[e][1]);a.push({item:c(this),instance:b[e][1],width:0,height:0,left:0,top:0})})},refreshPositions:function(a){if(this.offsetParent){var b=this.offsetParent.offset();this.offset.parent={top:b.top+this.offsetParentBorders.top,
left:b.left+this.offsetParentBorders.left}}for(b=this.items.length-1;b>=0;b--)if(!(this.items[b].instance!=this.currentContainer&&this.currentContainer&&this.items[b].item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?c(this.options.toleranceElement,this.items[b].item):this.items[b].item;if(!a){this.items[b].width=e[0].offsetWidth;this.items[b].height=e[0].offsetHeight}e=e.offset();this.items[b].left=e.left;this.items[b].top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);
else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this.mouseDestroy();for(var a=this.items.length-
1;a>=0;a--)this.items[a].item.removeData("sortable-item")},createPlaceholder:function(a){var b=a||this;a=b.options;if(!a.placeholder||a.placeholder.constructor==String){var e=a.placeholder;a.placeholder={element:function(){var f=c(document.createElement(b.currentItem[0].nodeName)).addClass(e||"ui-sortable-placeholder")[0];if(!e){f.style.visibility="hidden";f.innerHTML=b.currentItem[0].innerHTML}return f},update:function(f,g){if(!e){g.height()||g.height(b.currentItem.innerHeight());g.width()||g.width(b.currentItem.innerWidth())}}}}b.placeholder=
c(a.placeholder.element.call(b.element,b.currentItem)).appendTo(b.currentItem.parent());b.currentItem.before(b.placeholder);a.placeholder.update(b,b.placeholder)},contactContainers:function(a){for(var b=this.containers.length-1;b>=0;b--)if(this.intersectsWith(this.containers[b].containerCache)){if(!this.containers[b].containerCache.over){if(this.currentContainer!=this.containers[b]){for(var e=1E4,f=null,g=this.positionAbs[this.containers[b].floating?"left":"top"],h=this.items.length-1;h>=0;h--)if(d(this.containers[b].element[0],
this.items[h].item[0])){var i=this.items[h][this.containers[b].floating?"left":"top"];if(Math.abs(i-g)<e){e=Math.abs(i-g);f=this.items[h]}}if(!f&&!this.options.dropOnEmpty)continue;this.currentContainer=this.containers[b];f?this.options.sortIndicator.call(this,a,f,null,true):this.options.sortIndicator.call(this,a,null,this.containers[b].element,true);this.propagate("change",a);this.containers[b].propagate("change",a,this);this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[b].propagate("over",
a,this);this.containers[b].containerCache.over=1}}else if(this.containers[b].containerCache.over){this.containers[b].propagate("out",a,this);this.containers[b].containerCache.over=0}},mouseCapture:function(a,b){if(this.options.disabled||this.options.type=="static")return false;this.refreshItems();var e=null,f=this;c(a.target).parents().each(function(){if(c.data(this,"sortable-item")==f){e=c(this);return false}});if(c.data(a.target,"sortable-item")==f)e=c(a.target);if(!e)return false;if(this.options.handle&&
!b){var g=false;c(this.options.handle,e).find("*").andSelf().each(function(){if(this==a.target)g=true});if(!g)return false}this.currentItem=e;return true},mouseStart:function(a,b,e){b=this.options;this.currentContainer=this;this.refreshPositions();this.helper=typeof b.helper=="function"?c(b.helper.apply(this.element[0],[a,this.currentItem])):b.helper=="original"?this.currentItem:this.currentItem.clone();this.helper.parents("body").length||c(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(this.helper[0]);
this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0};this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:a.pageX-this.offset.left,top:a.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var f=this.offsetParent.offset();this.offsetParentBorders={top:parseInt(this.offsetParent.css("borderTopWidth"),10)||0,left:parseInt(this.offsetParent.css("borderLeftWidth"),
10)||0};this.offset.parent={top:f.top+this.offsetParentBorders.top,left:f.left+this.offsetParentBorders.left};this.updateOriginalPosition=this.originalPosition=this.generatePosition(a);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(b.helper=="original")this._storedCSS={position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left"),
clear:this.currentItem.css("clear")};b.helper!="original"&&this.currentItem.hide();this.helper.css({position:"absolute",clear:"both"}).addClass("ui-sortable-helper");this.createPlaceholder();this.propagate("start",a);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(b.cursorAt){if(b.cursorAt.left!=undefined)this.offset.click.left=b.cursorAt.left;if(b.cursorAt.right!=undefined)this.offset.click.left=this.helperProportions.width-b.cursorAt.right;if(b.cursorAt.top!=
undefined)this.offset.click.top=b.cursorAt.top;if(b.cursorAt.bottom!=undefined)this.offset.click.top=this.helperProportions.height-b.cursorAt.bottom}if(b.containment){if(b.containment=="parent")b.containment=this.helper[0].parentNode;if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.parent.left,0-this.offset.parent.top,c(b.containment=="document"?document:window).width()-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),
10)||0),(c(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)];if(!/^(document|window|parent)$/.test(b.containment)){f=c(b.containment)[0];var g=c(b.containment).offset();this.containment=[g.left+(parseInt(c(f).css("borderLeftWidth"),10)||0)-this.offset.parent.left,g.top+(parseInt(c(f).css("borderTopWidth"),10)||0)-this.offset.parent.top,
g.left+Math.max(f.scrollWidth,f.offsetWidth)-(parseInt(c(f).css("borderLeftWidth"),10)||0)-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.currentItem.css("marginRight"),10)||0),g.top+Math.max(f.scrollHeight,f.offsetHeight)-(parseInt(c(f).css("borderTopWidth"),10)||0)-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.currentItem.css("marginBottom"),10)||0)]}}if(!e)for(e=this.containers.length-1;e>=0;e--)this.containers[e].propagate("activate",
a,this);if(c.ui.ddmanager)c.ui.ddmanager.current=this;c.ui.ddmanager&&!b.dropBehaviour&&c.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.mouseDrag(a);return true},convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;return{top:b.top+this.offset.parent.top*a-(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)*a+this.margins.top*a,left:b.left+this.offset.parent.left*a-(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)*a+this.margins.left*
a}},generatePosition:function(a){var b=this.options;a={top:a.pageY-this.offset.click.top-this.offset.parent.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop),left:a.pageX-this.offset.click.left-this.offset.parent.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)};if(!this.originalPosition)return a;if(this.containment){if(a.left<this.containment[0])a.left=this.containment[0];if(a.top<this.containment[1])a.top=this.containment[1];if(a.left>this.containment[2])a.left=
this.containment[2];if(a.top>this.containment[3])a.top=this.containment[3]}if(b.grid){var e=this.originalPosition.top+Math.round((a.top-this.originalPosition.top)/b.grid[1])*b.grid[1];a.top=this.containment?!(e<this.containment[1]||e>this.containment[3])?e:!(e<this.containment[1])?e-b.grid[1]:e+b.grid[1]:e;e=this.originalPosition.left+Math.round((a.left-this.originalPosition.left)/b.grid[0])*b.grid[0];a.left=this.containment?!(e<this.containment[0]||e>this.containment[2])?e:!(e<this.containment[0])?
e-b.grid[0]:e+b.grid[0]:e}return a},mouseDrag:function(a){this.position=this.generatePosition(a);this.positionAbs=this.convertPositionTo("absolute");c.ui.plugin.call(this,"sort",[a,this.ui()]);this.positionAbs=this.convertPositionTo("absolute");this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";for(var b=this.items.length-1;b>=0;b--){var e=this.intersectsWithEdge(this.items[b]);if(e)if(this.items[b].item[0]!=this.currentItem[0]&&this.placeholder[e==1?
"next":"prev"]()[0]!=this.items[b].item[0]&&!d(this.placeholder[0],this.items[b].item[0])&&(this.options.type=="semi-dynamic"?!d(this.element[0],this.items[b].item[0]):true)){this.updateOriginalPosition=this.generatePosition(a);this.direction=e==1?"down":"up";this.options.sortIndicator.call(this,a,this.items[b]);this.propagate("change",a);break}}this.contactContainers(a);c.ui.ddmanager&&c.ui.ddmanager.drag(this,a);this.element.triggerHandler("sort",[a,this.ui()],this.options.sort);return false},rearrange:function(a,
b,e,f){e?e[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var g=this,h=this.counter;window.setTimeout(function(){h==g.counter&&g.refreshPositions(!f)},0)},mouseStop:function(a,b){c.ui.ddmanager&&!this.options.dropBehaviour&&c.ui.ddmanager.drop(this,a);if(this.options.revert){var e=this;b=e.placeholder.offset();c(this.helper).animate({left:b.left-this.offset.parent.left-
e.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-e.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){e.clear(a)})}else this.clear(a,b);return false},clear:function(a,b){this._noFinalSort||this.placeholder.before(this.currentItem);this._noFinalSort=null;this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):
this.currentItem.show();if(this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])this.propagate("update",a,null,b);if(!d(this.element[0],this.currentItem[0])){this.propagate("remove",a,null,b);for(var e=this.containers.length-1;e>=0;e--)if(d(this.containers[e].element[0],this.currentItem[0])){this.containers[e].propagate("update",a,this,b);this.containers[e].propagate("receive",a,this,b)}}for(e=this.containers.length-1;e>=
0;e--){this.containers[e].propagate("deactivate",a,this,b);if(this.containers[e].containerCache.over){this.containers[e].propagate("out",a,this);this.containers[e].containerCache.over=0}}this.dragging=false;if(this.cancelHelperRemoval){this.propagate("stop",a,null,b);return false}this.propagate("beforeStop",a,null,b);this.placeholder.remove();this.options.helper!="original"&&this.helper.remove();this.helper=null;this.propagate("stop",a,null,b);return true}}));c.extend(c.ui.sortable,{getter:"serialize toArray",
defaults:{helper:"original",tolerance:"guess",distance:1,delay:0,scroll:true,scrollSensitivity:20,scrollSpeed:20,cancel:":input",items:"> *",zIndex:1E3,dropOnEmpty:true,appendTo:"parent",sortIndicator:c.ui.sortable.prototype.rearrange}});c.ui.plugin.add("sortable","cursor",{start:function(a,b){a=c("body");if(a.css("cursor"))b.options._cursor=a.css("cursor");a.css("cursor",b.options.cursor)},beforeStop:function(a,b){b.options._cursor&&c("body").css("cursor",b.options._cursor)}});c.ui.plugin.add("sortable",
"zIndex",{start:function(a,b){a=b.helper;if(a.css("zIndex"))b.options._zIndex=a.css("zIndex");a.css("zIndex",b.options.zIndex)},beforeStop:function(a,b){b.options._zIndex&&c(b.helper).css("zIndex",b.options._zIndex)}});c.ui.plugin.add("sortable","opacity",{start:function(a,b){a=b.helper;if(a.css("opacity"))b.options._opacity=a.css("opacity");a.css("opacity",b.options.opacity)},beforeStop:function(a,b){b.options._opacity&&c(b.helper).css("opacity",b.options._opacity)}});c.ui.plugin.add("sortable",
"scroll",{start:function(){var a=c(this).data("sortable");a.overflowY=function(b){do{if(/auto|scroll/.test(b.css("overflow"))||/auto|scroll/.test(b.css("overflow-y")))return b;b=b.parent()}while(b[0].parentNode);return c(document)}(a.currentItem);a.overflowX=function(b){do{if(/auto|scroll/.test(b.css("overflow"))||/auto|scroll/.test(b.css("overflow-x")))return b;b=b.parent()}while(b[0].parentNode);return c(document)}(a.currentItem);if(a.overflowY[0]!=document&&a.overflowY[0].tagName!="HTML")a.overflowYOffset=
a.overflowY.offset();if(a.overflowX[0]!=document&&a.overflowX[0].tagName!="HTML")a.overflowXOffset=a.overflowX.offset()},sort:function(a,b){b=b.options;var e=c(this).data("sortable");if(e.overflowY[0]!=document&&e.overflowY[0].tagName!="HTML"){if(e.overflowYOffset.top+e.overflowY[0].offsetHeight-a.pageY<b.scrollSensitivity)e.overflowY[0].scrollTop+=b.scrollSpeed;if(a.pageY-e.overflowYOffset.top<b.scrollSensitivity)e.overflowY[0].scrollTop-=b.scrollSpeed}else{a.pageY-c(document).scrollTop()<b.scrollSensitivity&&
c(document).scrollTop(c(document).scrollTop()-b.scrollSpeed);c(window).height()-(a.pageY-c(document).scrollTop())<b.scrollSensitivity&&c(document).scrollTop(c(document).scrollTop()+b.scrollSpeed)}if(e.overflowX[0]!=document&&e.overflowX[0].tagName!="HTML"){if(e.overflowXOffset.left+e.overflowX[0].offsetWidth-a.pageX<b.scrollSensitivity)e.overflowX[0].scrollLeft+=b.scrollSpeed;if(a.pageX-e.overflowXOffset.left<b.scrollSensitivity)e.overflowX[0].scrollLeft-=b.scrollSpeed}else{a.pageX-c(document).scrollLeft()<
b.scrollSensitivity&&c(document).scrollLeft(c(document).scrollLeft()-b.scrollSpeed);c(window).width()-(a.pageX-c(document).scrollLeft())<b.scrollSensitivity&&c(document).scrollLeft(c(document).scrollLeft()+b.scrollSpeed)}}});c.ui.plugin.add("sortable","axis",{sort:function(a,b){a=c(this).data("sortable");if(b.options.axis=="y")a.position.left=a.originalPosition.left;if(b.options.axis=="x")a.position.top=a.originalPosition.top}})})(jQuery);
$.widget("ui.tree",{init:function(){var c=this,d=this;this.element.sortable({items:this.options.sortOn,placeholder:"sort-placeholder",sortable:null,start:function(a,b){$(this).data("sortable").placeholder.hide();$(this).data("sortable").refreshPositions(true);$(b.item).addClass("sort-dragging")},stop:function(a,b){d.options.done();$(this).data("sortable");$(b.item).removeClass("sort-dragging")},sortIndicator:function(a,b,e){e?e[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],
this.direction=="down"?b.item[0]:b.item[0].nextSibling)}});$(this.options.dropOn,this.element).droppable({accept:this.options.sortOn,hoverClass:this.options.hoverClass,drop:function(a,b){if(!$(this).parent().hasClass("sort-dragging")){$(this).parent().find("ul").size()||$(this).parent().append(document.createElement("ul"));$(this).parent().find("ul:first").append(b.draggable);c.element.data("sortable")._noFinalSort=true}}})}});$.extend($.ui.tree,{defaults:{sortOn:"*",dropOn:"div",hoverClass:"ui-tree-hover"}});
(function(c){c.fn.autogrow=function(d){return this.each(function(){new c.autogrow(this,d)})};c.autogrow=function(d,a){if(a=="disable")return $(".autogrow-dummy").addClass("disabled");this.options=a||{};this.interval=this.dummy=null;this.line_height=this.options.lineHeight||parseInt(c(d).css("line-height"));this.min_height=this.options.minHeight||parseInt(c(d).css("min-height"));this.max_height=this.options.maxHeight||parseInt(c(d).css("max-height"));this.textarea=c(d);if(this.line_height==NaN)this.line_height=
0;this.init()};c.autogrow.fn=c.autogrow.prototype={autogrow:"1.2.2"};c.autogrow.fn.extend=c.autogrow.extend=c.extend;c.autogrow.fn.extend({init:function(){var d=this;this.textarea.css({overflow:"hidden",display:"block"});this.textarea.bind("focus",function(){d.startExpand()}).bind("blur",function(){d.stopExpand()});this.checkExpand()},startExpand:function(){var d=this;this.interval=window.setInterval(function(){d.checkExpand()},400)},stopExpand:function(){clearInterval(this.interval)},checkExpand:function(){if(this.dummy==
null){this.dummy=c("<div />");this.dummy.css({fontSize:this.textarea.css("font-size"),fontFamily:this.textarea.css("font-family"),width:this.textarea.css("width"),padding:this.textarea.css("padding"),lineHeight:this.line_height+"px",overflowX:"hidden",display:"none"}).addClass("autogrow-dummy").appendTo("body")}if(this.dummy.hasClass("disabled"))return clearInterval(this.interval);var d=this.textarea.val().replace(/(<|>|&)/g,"&#160;");d=$.browser.msie?d.replace(/\n/g,"<BR>new"):d.replace(/\n/g,"<br>new");
var a=d.replace(/&#160;/g,"&nbsp;");if(this.dummy.html()!=a){this.dummy.html(d);if(this.max_height>0&&this.dummy.height()+this.line_height>this.max_height)this.textarea.css("overflow-y","auto");else{this.textarea.css("overflow-y","hidden");if(this.textarea.height()<this.dummy.height()+this.line_height||this.dummy.height()<this.textarea.height())this.textarea.height(this.dummy.height()+this.line_height)}}}})})(jQuery);
(function(c){c.ifixpng=function(a){c.ifixpng.pixel=a};c.ifixpng.getPixel=function(){return c.ifixpng.pixel||"images/pixel.gif"};var d={ltie7:c.browser.msie&&c.browser.version<7,filter:function(a){return"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+a+"')"}};c.fn.ifixpng=d.ltie7?function(){return this.each(function(){var a=c(this),b=c("base").attr("href");if(b)b=b.replace(/\/[^\/]+$/,"/");if(a.is("img")||a.is("input")){if(a.attr("src"))if(a.attr("src").match(/.*\.png([?].*)?$/i)){b=
b&&a.attr("src").search(/^(\/|http:)/i)?b+a.attr("src"):a.attr("src");a.css({filter:d.filter(b),width:a.width(),height:a.height()}).attr({src:c.ifixpng.getPixel()}).positionFix()}}else{var e=a.css("backgroundImage");if(e.match(/^url\(["']?(.*\.png([?].*)?)["']?\)$/i)){e=RegExp.$1;e=b&&e.substring(0,1)!="/"?b+e:e;a.css({backgroundImage:"none",filter:d.filter(e)}).children().children().positionFix()}}})}:function(){return this};c.fn.iunfixpng=d.ltie7?function(){return this.each(function(){var a=c(this),
b=a.css("filter");if(b.match(/src=["']?(.*\.png([?].*)?)["']?/i)){b=RegExp.$1;a.is("img")||a.is("input")?a.attr({src:b}).css({filter:""}):a.css({filter:"",background:"url("+b+")"})}})}:function(){return this};c.fn.positionFix=function(){return this.each(function(){var a=c(this),b=a.css("position");b!="absolute"&&b!="relative"&&a.css({position:"relative"})})}})(jQuery);
(function(c){function d(){c.fn.ajaxSubmit.debug&&window.console&&window.console.log&&window.console.log("[jquery.form] "+Array.prototype.join.call(arguments,""))}c.fn.ajaxSubmit=function(a){function b(){function j(){if(!A++){q.detachEvent?q.detachEvent("onload",j):q.removeEventListener("load",j,false);var v=0,u=true;try{if(B)throw"timeout";var w,s;s=q.contentWindow?q.contentWindow.document:q.contentDocument?q.contentDocument:q.document;if(s.body==null&&!v&&c.browser.opera){v=1;A--;setTimeout(j,100);
return}p.responseText=s.body?s.body.innerHTML:null;p.responseXML=s.XMLDocument?s.XMLDocument:s;p.getResponseHeader=function(C){var D={"content-type":l.dataType};return D[C]};if(l.dataType=="json"||l.dataType=="script"){var z=s.getElementsByTagName("textarea")[0];p.responseText=z?z.value:p.responseText}else if(l.dataType=="xml"&&!p.responseXML&&p.responseText!=null)p.responseXML=n(p.responseText);w=c.httpData(p,l.dataType)}catch(x){u=false;c.handleError(l,p,"error",x)}if(u){l.success(w,"success");
y&&c.event.trigger("ajaxSuccess",[p,l])}y&&c.event.trigger("ajaxComplete",[p,l]);y&&!--c.active&&c.event.trigger("ajaxStop");if(l.complete)l.complete(p,u?"success":"error");setTimeout(function(){t.remove();p.responseXML=null},100)}}function n(v,u){if(window.ActiveXObject){u=new ActiveXObject("Microsoft.XMLDOM");u.async="false";u.loadXML(v)}else u=(new DOMParser).parseFromString(v,"text/xml");return u&&u.documentElement&&u.documentElement.tagName!="parsererror"?u:null}var m=h[0],l=c.extend({},c.ajaxSettings,
a),r="jqFormIO"+(new Date).getTime(),t=c('<iframe id="'+r+'" name="'+r+'" />'),q=t[0];if(c.browser.msie||c.browser.opera)q.src='javascript:false;document.write("");';t.css({position:"absolute",top:"-1000px",left:"-1000px"});var p={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}},y=l.global;y&&!c.active++&&c.event.trigger("ajaxStart");y&&c.event.trigger("ajaxSend",[p,l]);var A=0,B=0;setTimeout(function(){var v=
h.attr("target"),u=h.attr("action");h.attr({target:r,encoding:"multipart/form-data",enctype:"multipart/form-data",method:"POST",action:l.url});l.timeout&&setTimeout(function(){B=true;j()},l.timeout);var w=[];try{if(a.extraData)for(var s in a.extraData)w.push(c('<input type="hidden" name="'+s+'" value="'+a.extraData[s]+'" />').appendTo(m)[0]);t.appendTo("body");q.attachEvent?q.attachEvent("onload",j):q.addEventListener("load",j,false);m.submit()}finally{h.attr("action",u);v?h.attr("target",v):h.removeAttr("target");
c(w).remove()}},10)}if(!this.length){d("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof a=="function")a={success:a};a=c.extend({url:this.attr("action")||window.location.toString(),type:this.attr("method")||"GET"},a||{});var e={};this.trigger("form-pre-serialize",[this,a,e]);if(e.veto){d("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}var f=this.formToArray(a.semantic);if(a.data){a.extraData=a.data;for(var g in a.data)f.push({name:g,value:a.data[g]})}if(a.beforeSubmit&&
a.beforeSubmit(f,this,a)===false){d("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[f,this,a,e]);if(e.veto){d("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}e=c.param(f);if(a.type.toUpperCase()=="GET"){a.url+=(a.url.indexOf("?")>=0?"&":"?")+e;a.data=null}else a.data=e;var h=this,i=[];a.resetForm&&i.push(function(){h.resetForm()});a.clearForm&&i.push(function(){h.clearForm()});if(!a.dataType&&a.target){var k=a.success||
function(){};i.push(function(j){c(a.target).html(j).each(k,arguments)})}else a.success&&i.push(a.success);a.success=function(j,n){for(var m=0,l=i.length;m<l;m++)i[m](j,n,h)};e=c("input:file",this).fieldValue();f=false;for(g=0;g<e.length;g++)if(e[g])f=true;if(a.iframe||f)c.browser.safari&&a.closeKeepAlive?c.get(a.closeKeepAlive,b):b();else c.ajax(a);this.trigger("form-submit-notify",[this,a]);return this};c.fn.ajaxForm=function(a){return this.ajaxFormUnbind().bind("submit.form-plugin",function(){c(this).ajaxSubmit(a);
return false}).each(function(){c(":submit,input:image",this).bind("click.form-plugin",function(b){var e=this.form;e.clk=this;if(this.type=="image")if(b.offsetX!=undefined){e.clk_x=b.offsetX;e.clk_y=b.offsetY}else if(typeof c.fn.offset=="function"){var f=c(this).offset();e.clk_x=b.pageX-f.left;e.clk_y=b.pageY-f.top}else{e.clk_x=b.pageX-this.offsetLeft;e.clk_y=b.pageY-this.offsetTop}setTimeout(function(){e.clk=e.clk_x=e.clk_y=null},10)})})};c.fn.ajaxFormUnbind=function(){this.unbind("submit.form-plugin");
return this.each(function(){c(":submit,input:image",this).unbind("click.form-plugin")})};c.fn.formToArray=function(a){var b=[];if(this.length==0)return b;var e=this[0],f=a?e.getElementsByTagName("*"):e.elements;if(!f)return b;for(var g=0,h=f.length;g<h;g++){var i=f[g],k=i.name;if(k)if(a&&e.clk&&i.type=="image")!i.disabled&&e.clk==i&&b.push({name:k+".x",value:e.clk_x},{name:k+".y",value:e.clk_y});else if((i=c.fieldValue(i,true))&&i.constructor==Array)for(var j=0,n=i.length;j<n;j++)b.push({name:k,value:i[j]});
else i!==null&&typeof i!="undefined"&&b.push({name:k,value:i})}if(!a&&e.clk){a=e.getElementsByTagName("input");g=0;for(h=a.length;g<h;g++){f=a[g];(k=f.name)&&!f.disabled&&f.type=="image"&&e.clk==f&&b.push({name:k+".x",value:e.clk_x},{name:k+".y",value:e.clk_y})}}return b};c.fn.formSerialize=function(a){return c.param(this.formToArray(a))};c.fn.fieldSerialize=function(a){var b=[];this.each(function(){var e=this.name;if(e){var f=c.fieldValue(this,a);if(f&&f.constructor==Array)for(var g=0,h=f.length;g<
h;g++)b.push({name:e,value:f[g]});else f!==null&&typeof f!="undefined"&&b.push({name:this.name,value:f})}});return c.param(b)};c.fn.fieldValue=function(a){for(var b=[],e=0,f=this.length;e<f;e++){var g=this[e];g=c.fieldValue(g,a);g===null||typeof g=="undefined"||g.constructor==Array&&!g.length||(g.constructor==Array?c.merge(b,g):b.push(g))}return b};c.fieldValue=function(a,b){var e=a.name,f=a.type,g=a.tagName.toLowerCase();if(typeof b=="undefined")b=true;if(b&&(!e||a.disabled||f=="reset"||f=="button"||
(f=="checkbox"||f=="radio")&&!a.checked||(f=="submit"||f=="image")&&a.form&&a.form.clk!=a||g=="select"&&a.selectedIndex==-1))return null;if(g=="select"){g=a.selectedIndex;if(g<0)return null;b=[];a=a.options;e=(f=f=="select-one")?g+1:a.length;for(g=f?g:0;g<e;g++){var h=a[g];if(h.selected){h=c.browser.msie&&!h.attributes.value.specified?h.text:h.value;if(f)return h;b.push(h)}}return b}return a.value};c.fn.clearForm=function(){return this.each(function(){c("input,select,textarea",this).clearFields()})};
c.fn.clearFields=c.fn.clearInputs=function(){return this.each(function(){var a=this.type,b=this.tagName.toLowerCase();if(a=="text"||a=="password"||b=="textarea")this.value="";else if(a=="checkbox"||a=="radio")this.checked=false;else if(b=="select")this.selectedIndex=-1})};c.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||typeof this.reset=="object"&&!this.reset.nodeType)this.reset()})};c.fn.enable=function(a){if(a==undefined)a=true;return this.each(function(){this.disabled=
!a})};c.fn.select=function(a){if(a==undefined)a=true;return this.each(function(){var b=this.type;if(b=="checkbox"||b=="radio")this.checked=a;else if(this.tagName.toLowerCase()=="option"){b=c(this).parent("select");a&&b[0]&&b[0].type=="select-one"&&b.find("option").select(false);this.selected=a}})}})(jQuery);
(function(c){function d(){c.fn.ajaxSubmit.debug&&window.console&&window.console.log&&window.console.log("[jquery.form] "+Array.prototype.join.call(arguments,""))}c.fn.ajaxSubmit=function(a){function b(){function j(){if(!A++){q.detachEvent?q.detachEvent("onload",j):q.removeEventListener("load",j,false);var w=0,s=true;try{if(B)throw"timeout";var z,x;x=q.contentWindow?q.contentWindow.document:q.contentDocument?q.contentDocument:q.document;if(x.body==null&&!w&&c.browser.opera){w=1;A--;setTimeout(j,100);
return}p.responseText=x.body?x.body.innerHTML:null;p.responseXML=x.XMLDocument?x.XMLDocument:x;p.getResponseHeader=function(E){var F={"content-type":l.dataType};return F[E]};if(l.dataType=="json"||l.dataType=="script"){var C=x.getElementsByTagName("textarea")[0];p.responseText=C?C.value:p.responseText}else if(l.dataType=="xml"&&!p.responseXML&&p.responseText!=null)p.responseXML=n(p.responseText);z=c.httpData(p,l.dataType)}catch(D){s=false;c.handleError(l,p,"error",D)}if(s){l.success(z,"success");
y&&c.event.trigger("ajaxSuccess",[p,l])}y&&c.event.trigger("ajaxComplete",[p,l]);y&&!--c.active&&c.event.trigger("ajaxStop");if(l.complete)l.complete(p,s?"success":"error");setTimeout(function(){t.remove();p.responseXML=null},100)}}function n(w,s){if(window.ActiveXObject){s=new ActiveXObject("Microsoft.XMLDOM");s.async="false";s.loadXML(w)}else s=(new DOMParser).parseFromString(w,"text/xml");return s&&s.documentElement&&s.documentElement.tagName!="parsererror"?s:null}var m=h[0];if(c(":input[@name=submit]",
m).length)alert('Error: Form elements must not be named "submit".');else{var l=c.extend({},c.ajaxSettings,a),r="jqFormIO"+(new Date).getTime(),t=c('<iframe id="'+r+'" name="'+r+'" />'),q=t[0];if(c.browser.msie||c.browser.opera)q.src='javascript:false;document.write("");';t.css({position:"absolute",top:"-1000px",left:"-1000px"});var p={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}},y=l.global;
y&&!c.active++&&c.event.trigger("ajaxStart");y&&c.event.trigger("ajaxSend",[p,l]);var A=0,B=0,v=m.clk;if(v){var u=v.name;if(u&&!v.disabled){a.extraData=a.extraData||{};a.extraData[u]=v.value;if(v.type=="image"){a.extraData[name+".x"]=m.clk_x;a.extraData[name+".y"]=m.clk_y}}}setTimeout(function(){var w=h.attr("target"),s=h.attr("action");h.attr({target:r,encoding:"multipart/form-data",enctype:"multipart/form-data",method:"POST",action:l.url});l.timeout&&setTimeout(function(){B=true;j()},l.timeout);
var z=[];try{if(a.extraData)for(var x in a.extraData)z.push(c('<input type="hidden" name="'+x+'" value="'+a.extraData[x]+'" />').appendTo(m)[0]);t.appendTo("body");q.attachEvent?q.attachEvent("onload",j):q.addEventListener("load",j,false);m.submit()}finally{h.attr("action",s);w?h.attr("target",w):h.removeAttr("target");c(z).remove()}},10)}}if(!this.length){d("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof a=="function")a={success:a};a=c.extend({url:this.attr("action")||
window.location.toString(),type:this.attr("method")||"GET"},a||{});var e={};this.trigger("form-pre-serialize",[this,a,e]);if(e.veto){d("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}var f=this.formToArray(a.semantic);if(a.data){a.extraData=a.data;for(var g in a.data)f.push({name:g,value:a.data[g]})}if(a.beforeSubmit&&a.beforeSubmit(f,this,a)===false){d("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[f,this,a,e]);if(e.veto){d("ajaxSubmit: submit vetoed via form-submit-validate trigger");
return this}e=c.param(f);if(a.type.toUpperCase()=="GET"){a.url+=(a.url.indexOf("?")>=0?"&":"?")+e;a.data=null}else a.data=e;var h=this,i=[];a.resetForm&&i.push(function(){h.resetForm()});a.clearForm&&i.push(function(){h.clearForm()});if(!a.dataType&&a.target){var k=a.success||function(){};i.push(function(j){c(a.target).html(j).each(k,arguments)})}else a.success&&i.push(a.success);a.success=function(j,n){for(var m=0,l=i.length;m<l;m++)i[m](j,n,h)};e=c("input:file",this).fieldValue();f=false;for(g=
0;g<e.length;g++)if(e[g])f=true;if(a.iframe||f)c.browser.safari&&a.closeKeepAlive?c.get(a.closeKeepAlive,b):b();else c.ajax(a);this.trigger("form-submit-notify",[this,a]);return this};c.fn.ajaxForm=function(a){return this.ajaxFormUnbind().bind("submit.form-plugin",function(){c(this).ajaxSubmit(a);return false}).each(function(){c(":submit,input:image",this).bind("click.form-plugin",function(b){var e=this.form;e.clk=this;if(this.type=="image")if(b.offsetX!=undefined){e.clk_x=b.offsetX;e.clk_y=b.offsetY}else if(typeof c.fn.offset==
"function"){var f=c(this).offset();e.clk_x=b.pageX-f.left;e.clk_y=b.pageY-f.top}else{e.clk_x=b.pageX-this.offsetLeft;e.clk_y=b.pageY-this.offsetTop}setTimeout(function(){e.clk=e.clk_x=e.clk_y=null},10)})})};c.fn.ajaxFormUnbind=function(){this.unbind("submit.form-plugin");return this.each(function(){c(":submit,input:image",this).unbind("click.form-plugin")})};c.fn.formToArray=function(a){var b=[];if(this.length==0)return b;var e=this[0],f=a?e.getElementsByTagName("*"):e.elements;if(!f)return b;for(var g=
0,h=f.length;g<h;g++){var i=f[g],k=i.name;if(k)if(a&&e.clk&&i.type=="image")!i.disabled&&e.clk==i&&b.push({name:k+".x",value:e.clk_x},{name:k+".y",value:e.clk_y});else if((i=c.fieldValue(i,true))&&i.constructor==Array)for(var j=0,n=i.length;j<n;j++)b.push({name:k,value:i[j]});else i!==null&&typeof i!="undefined"&&b.push({name:k,value:i})}if(!a&&e.clk){a=e.getElementsByTagName("input");g=0;for(h=a.length;g<h;g++){f=a[g];(k=f.name)&&!f.disabled&&f.type=="image"&&e.clk==f&&b.push({name:k+".x",value:e.clk_x},
{name:k+".y",value:e.clk_y})}}return b};c.fn.formSerialize=function(a){return c.param(this.formToArray(a))};c.fn.fieldSerialize=function(a){var b=[];this.each(function(){var e=this.name;if(e){var f=c.fieldValue(this,a);if(f&&f.constructor==Array)for(var g=0,h=f.length;g<h;g++)b.push({name:e,value:f[g]});else f!==null&&typeof f!="undefined"&&b.push({name:this.name,value:f})}});return c.param(b)};c.fn.fieldValue=function(a){for(var b=[],e=0,f=this.length;e<f;e++){var g=this[e];g=c.fieldValue(g,a);g===
null||typeof g=="undefined"||g.constructor==Array&&!g.length||(g.constructor==Array?c.merge(b,g):b.push(g))}return b};c.fieldValue=function(a,b){var e=a.name,f=a.type,g=a.tagName.toLowerCase();if(typeof b=="undefined")b=true;if(b&&(!e||a.disabled||f=="reset"||f=="button"||(f=="checkbox"||f=="radio")&&!a.checked||(f=="submit"||f=="image")&&a.form&&a.form.clk!=a||g=="select"&&a.selectedIndex==-1))return null;if(g=="select"){g=a.selectedIndex;if(g<0)return null;b=[];a=a.options;e=(f=f=="select-one")?
g+1:a.length;for(g=f?g:0;g<e;g++){var h=a[g];if(h.selected){h=c.browser.msie&&!h.attributes.value.specified?h.text:h.value;if(f)return h;b.push(h)}}return b}return a.value};c.fn.clearForm=function(){return this.each(function(){c("input,select,textarea",this).clearFields()})};c.fn.clearFields=c.fn.clearInputs=function(){return this.each(function(){var a=this.type,b=this.tagName.toLowerCase();if(a=="text"||a=="password"||b=="textarea")this.value="";else if(a=="checkbox"||a=="radio")this.checked=false;
else if(b=="select")this.selectedIndex=-1})};c.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||typeof this.reset=="object"&&!this.reset.nodeType)this.reset()})};c.fn.enable=function(a){if(a==undefined)a=true;return this.each(function(){this.disabled=!a})};c.fn.select=function(a){if(a==undefined)a=true;return this.each(function(){var b=this.type;if(b=="checkbox"||b=="radio")this.checked=a;else if(this.tagName.toLowerCase()=="option"){b=c(this).parent("select");
a&&b[0]&&b[0].type=="select-one"&&b.find("option").select(false);this.selected=a}})}})(jQuery);
(function(c){c.extend(c.fn,{livequery:function(a,b,e){var f=this,g;if(c.isFunction(a)){e=b;b=a;a=undefined}c.each(c.livequery.queries,function(h,i){if(f.selector==i.selector&&f.context==i.context&&a==i.type&&(!b||b.$lqguid==i.fn.$lqguid)&&(!e||e.$lqguid==i.fn2.$lqguid))return(g=i)&&false});g=g||new c.livequery(this.selector,this.context,a,b,e);g.stopped=false;c.livequery.run(g.id);return this},expire:function(a,b,e){var f=this;if(c.isFunction(a)){e=b;b=a;a=undefined}c.each(c.livequery.queries,function(g,
h){if(f.selector==h.selector&&f.context==h.context&&(!a||a==h.type)&&(!b||b.$lqguid==h.fn.$lqguid)&&(!e||e.$lqguid==h.fn2.$lqguid)&&!this.stopped)c.livequery.stop(h.id)});return this}});c.livequery=function(a,b,e,f,g){this.selector=a;this.context=b||document;this.type=e;this.fn=f;this.fn2=g;this.elements=[];this.stopped=false;this.id=c.livequery.queries.push(this)-1;f.$lqguid=f.$lqguid||c.livequery.guid++;if(g)g.$lqguid=g.$lqguid||c.livequery.guid++;return this};c.livequery.prototype={stop:function(){var a=
this;if(this.type)this.elements.unbind(this.type,this.fn);else this.fn2&&this.elements.each(function(b,e){a.fn2.apply(e)});this.elements=[];this.stopped=true},run:function(){if(!this.stopped){var a=this,b=this.elements,e=c(this.selector,this.context),f=e.not(b);this.elements=e;if(this.type){f.bind(this.type,this.fn);b.length>0&&c.each(b,function(g,h){c.inArray(h,e)<0&&c.event.remove(h,a.type,a.fn)})}else{f.each(function(){a.fn.apply(this)});this.fn2&&b.length>0&&c.each(b,function(g,h){c.inArray(h,
e)<0&&a.fn2.apply(h)})}}}};c.extend(c.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if(c.livequery.running&&c.livequery.queue.length)for(var a=c.livequery.queue.length;a--;)c.livequery.queries[c.livequery.queue.shift()].run()},pause:function(){c.livequery.running=false},play:function(){c.livequery.running=true;c.livequery.run()},registerPlugin:function(){c.each(arguments,function(a,b){if(c.fn[b]){var e=c.fn[b];c.fn[b]=function(){var f=e.apply(this,arguments);
c.livequery.run();return f}}})},run:function(a){if(a!=undefined)c.inArray(a,c.livequery.queue)<0&&c.livequery.queue.push(a);else c.each(c.livequery.queries,function(b){c.inArray(b,c.livequery.queue)<0&&c.livequery.queue.push(b)});c.livequery.timeout&&clearTimeout(c.livequery.timeout);c.livequery.timeout=setTimeout(c.livequery.checkQueue,20)},stop:function(a){a!=undefined?c.livequery.queries[a].stop():c.each(c.livequery.queries,function(b){c.livequery.queries[b].stop()})}});c.livequery.registerPlugin("append",
"prepend","after","before","wrap","attr","removeAttr","addClass","removeClass","toggleClass","empty","remove");c(function(){c.livequery.play()});var d=c.prototype.init;c.prototype.init=function(a,b){var e=d.apply(this,arguments);if(a&&a.selector){e.context=a.context;e.selector=a.selector}if(typeof a=="string"){e.context=b||document;e.selector=a}return e};c.prototype.init.prototype=c.prototype})(jQuery);
$.fn.expand=function(){$(this).each(function(){if(!($(this).parent().parent().attr("class")=="more_options"||$.browser.msie)){var c=$(this).attr("id"),d=".dummy_"+c;$(this).css("min-width",$(this).width());$(this).css("max-width",$(this).parent().width()-8);$(document.createElement("span")).prependTo("body").addClass("dummy_"+c).css({fontSize:$(this).css("font-size"),fontFamily:$(this).css("font-family"),padding:$(this).css("padding"),position:"absolute",top:-9999}).text($(this).val());$(this).width($(d).width()+
20);$(this).keypress(function(a){$(d).text($(this).val()+String.fromCharCode(a.which));a.which==8&&$(d).text($(this).val().substring(0,$(this).val().length-1));$(this).width($(d).width()+20)});$.browser.safari&&$(this).keydown(function(a){$(d).text($(this).val()+String.fromCharCode(a.which));a.which==8&&$(d).text($(this).val().substring(0,$(this).val().length-1));$(this).width($(d).width()+20)})}})};
$.fn.loader=function(c){if(c){$(this).next().remove();return this}c=$(this).offset();var d=$(this).outerHeight()/2-11,a=$(this).outerWidth()/2-63;$(this).after('<div class="load_overlay"><img src="'+site_url+'/includes/close.png" style="display: none" class="close" /><img src="'+site_url+'/includes/loading.gif" style="display: none" class="loading" /></div>');$(".load_overlay .loading").css({position:"absolute",top:d+"px",left:a+"px",display:"inline"});$(".load_overlay .close").css({position:"absolute",
top:"3px",right:"3px",color:"#fff",cursor:"pointer",display:"inline"}).click(function(){$(this).parent().remove()});$(".load_overlay").css({position:"absolute",top:c.top,left:c.left,zIndex:100,width:$(this).outerWidth(),height:$(this).outerHeight(),background:$.browser.msie?"transparent":"transparent url('"+site_url+"/includes/trans.png')",textAlign:"center",filter:$.browser.msie?"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='"+site_url+"/includes/trans.png');":
""});return this};var Cookie={set:function(c,d,a){if(a){var b=new Date;b.setTime(b.getTime()+a*1E3*60*60*24);a="; expires="+b.toGMTString()}else a="";document.cookie=c+"="+d+a+"; path=/"},get:function(c){c=c+"=";for(var d=document.cookie.split(";"),a=0;a<d.length;a++){for(var b=d[a];b.charAt(0)==" ";)b=b.substring(1,b.length);if(b.indexOf(c)==0)return b.substring(c.length,b.length)}return null},destroy:function(c){Cookie.set(c,"",-1)}};
function isError(c){return/HEY_JAVASCRIPT_THIS_IS_AN_ERROR_JUST_SO_YOU_KNOW$/m.test(c)}Array.prototype.indicesOf=function(c){for(var d=[],a=0;a<this.length;a++)if(typeof c!="string")c.test(this[a])&&d.push(a);else this[a]==c&&d.push(a);return d};Array.prototype.find=function(c){for(var d=[],a=0;a<this.length;a++)c.test(this[a])&&d.push(this[a]);return d};
Array.prototype.remove=function(c){if(c instanceof Array)for(var d=0;d<c.length;d++)this.remove(c[d]);else{c=this.indicesOf(c);if(c.length!=0){for(d=0;d<c.length;d++)this.splice(c[d]-d,1);return this}}};
