(function(C){C.ui=C.ui||{};C.extend(C.ui,{plugin:{add:function(E,F,H){var G=C.ui[E].prototype;for(var D in H){G.plugins[D]=G.plugins[D]||[];G.plugins[D].push([F,H[D]])}},call:function(D,E,G){var H=D.plugins[E];if(!H){return }for(var F=0;F').addClass(D).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[D]=!!((!/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[D]},disableSelection:function(D){D.unselectable="on";D.onselectstart=function(){return false};if(D.style){D.style.MozUserSelect="none"}},enableSelection:function(D){D.unselectable="off";D.onselectstart=function(){return true};if(D.style){D.style.MozUserSelect=""}},hasScroll:function(G,E){var D=/top/.test(E||"top")?"scrollTop":"scrollLeft",F=false;if(G[D]>0){return true}G[D]=1;F=G[D]>0?true:false;G[D]=0;return F}});C.each(["Left","Top"],function(E,D){if(!C.fn["scroll"+D]){C.fn["scroll"+D]=function(F){return F!=undefined?this.each(function(){this==window||this==document?window.scrollTo(D=="Left"?F:C(window)["scrollLeft"](),D=="Top"?F:C(window)["scrollTop"]()):this["scroll"+D]=F}):this[0]==window||this[0]==document?self[(D=="Left"?"pageXOffset":"pageYOffset")]||C.boxModel&&document.documentElement["scroll"+D]||document.body["scroll"+D]:this[0]["scroll"+D]}}});var B=C.fn.remove;C.fn.extend({position:function(){var F=this.offset();var E=this.offsetParent();var D=E.offset();return{top:F.top-A(this[0],"marginTop")-D.top-A(E,"borderTopWidth"),left:F.left-A(this[0],"marginLeft")-D.left-A(E,"borderLeftWidth")}},offsetParent:function(){var D=this[0].offsetParent;while(D&&(!/^body|html$/i.test(D.tagName)&&C.css(D,"position")=="static")){D=D.offsetParent}return C(D)},mouseInteraction:function(D){return this.each(function(){new C.ui.mouseInteraction(this,D)})},removeMouseInteraction:function(D){return this.each(function(){if(C.data(this,"ui-mouse")){C.data(this,"ui-mouse").destroy()}})},remove:function(){jQuery("*",this).add(this).trigger("remove");return B.apply(this,arguments)}});function A(D,E){return parseInt(C.curCSS(D.jquery?D[0]:D,E,true))||0}C.ui.mouseInteraction=function(F,E){var D=this;this.element=F;C.data(this.element,"ui-mouse",this);this.options=C.extend({},E);C(F).bind("mousedown.draggable",function(){return D.click.apply(D,arguments)});if(C.browser.msie){C(F).attr("unselectable","on")}C(F).mouseup(function(){if(D.timer){clearInterval(D.timer)}})};C.extend(C.ui.mouseInteraction.prototype,{destroy:function(){C(this.element).unbind("mousedown.draggable")},trigger:function(){return this.click.apply(this,arguments)},click:function(F){if(F.which!=1||C.inArray(F.target.nodeName.toLowerCase(),this.options.dragPrevention||[])!=-1||(this.options.condition&&!this.options.condition.apply(this.options.executor||this,[F,this.element]))){return true}var E=this;var D=function(){E._MP={left:F.pageX,top:F.pageY};C(document).bind("mouseup.draggable",function(){return E.stop.apply(E,arguments)});C(document).bind("mousemove.draggable",function(){return E.drag.apply(E,arguments)});if(!E.initalized&&Math.abs(E._MP.left-F.pageX)>=E.options.distance||Math.abs(E._MP.top-F.pageY)>=E.options.distance){if(E.options.start){E.options.start.call(E.options.executor||E,F,E.element)}if(E.options.drag){E.options.drag.call(E.options.executor||E,F,this.element)}E.initialized=true}};if(this.options.delay){if(this.timer){clearInterval(this.timer)}this.timer=setTimeout(D,this.options.delay)}else{D()}return false},stop:function(D){var E=this.options;if(!this.initialized){return C(document).unbind("mouseup.draggable").unbind("mousemove.draggable")}if(this.options.stop){this.options.stop.call(this.options.executor||this,D,this.element)}C(document).unbind("mouseup.draggable").unbind("mousemove.draggable");this.initialized=false;return false},drag:function(D){var E=this.options;if(C.browser.msie&&!D.button){return this.stop.apply(this,[D])}if(!this.initialized&&(Math.abs(this._MP.left-D.pageX)>=E.distance||Math.abs(this._MP.top-D.pageY)>=E.distance)){if(this.options.start){this.options.start.call(this.options.executor||this,D,this.element)}this.initialized=true}else{if(!this.initialized){return false}}if(E.drag){E.drag.call(this.options.executor||this,D,this.element)}return false}})})(jQuery);(function(A){A.fn.extend({draggable:function(C){var B=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof C=="string"){var D=A.data(this,"draggable");if(D){D[C].apply(D,B)}}else{if(!A.data(this,"draggable")){new A.ui.draggable(this,C)}}})}});A.ui.draggable=function(D,C){var B=this;this.element=A(D);A.data(D,"draggable",this);this.element.addClass("ui-draggable");this.options=A.extend({},C);var E=this.options;A.extend(E,{helper:E.ghosting==true?"clone":(E.helper||"original"),handle:E.handle?(A(E.handle,D)[0]?A(E.handle,D):this.element):this.element,appendTo:E.appendTo||"parent"});A(D).bind("setData.draggable",function(G,F,H){B.options[F]=H}).bind("getData.draggable",function(G,F){return B.options[F]});A(E.handle).mouseInteraction({executor:this,delay:E.delay,distance:E.distance||1,dragPrevention:E.cancel||E.cancel===""?E.cancel.toLowerCase().split(","):["input","textarea","button","select","option"],start:this.start,stop:this.stop,drag:this.drag,condition:function(F){return !(F.target.className.indexOf("ui-resizable-handle")!=-1||this.options.disabled)}});if(E.helper=="original"&&(this.element.css("position")=="static"||this.element.css("position")=="")){this.element.css("position","relative")}if(E.cursorAt&&E.cursorAt.constructor==Array){E.cursorAt={left:E.cursorAt[0],top:E.cursorAt[1]}}};A.extend(A.ui.draggable.prototype,{plugins:{},ui:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,instance:this,options:this.options,element:this.element}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.ui()]);return this.element.triggerHandler(C=="drag"?C:"drag"+C,[B,this.ui()],this.options[C])},destroy:function(){if(!A.data(this.element[0],"draggable")){return }this.options.handle.removeMouseInteraction();this.element.removeClass("ui-draggable ui-draggable-disabled").removeData("draggable").unbind(".draggable")},enable:function(){this.element.removeClass("ui-draggable-disabled");this.options.disabled=false},disable:function(){this.element.addClass("ui-draggable-disabled");this.options.disabled=true},setContrains:function(B,C,E,D){this.minLeft=B;this.maxLeft=C;this.minTop=E;this.maxTop=D;this.constrainsSet=true},checkConstrains:function(){if(!this.constrainsSet){return }if(this.position.leftthis.maxLeft-this.helperProportions.width){this.position.left=this.maxLeft-this.helperProportions.width}if(this.position.topthis.maxTop-this.helperProportions.height){this.position.top=this.maxTop-this.helperProportions.height}},recallOffset:function(D){var C={left:this.elementOffset.left-this.offsetParentOffset.left,top:this.elementOffset.top-this.offsetParentOffset.top};var B=this.helper.css("position")=="relative";this.originalPosition={left:(B?parseInt(this.helper.css("left"),10)||0:C.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)),top:(B?parseInt(this.helper.css("top"),10)||0:C.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop))};this.offset={left:this._pageX-this.originalPosition.left,top:this._pageY-this.originalPosition.top}},start:function(D){var E=this.options;if(A.ui.ddmanager){A.ui.ddmanager.current=this}this.helper=typeof E.helper=="function"?A(E.helper.apply(this.element[0],[D])):(E.helper=="clone"?this.element.clone().appendTo((E.appendTo=="parent"?this.element[0].parentNode:E.appendTo)):this.element);if(this.helper[0]!=this.element[0]){this.helper.css("position","absolute")}if(!this.helper.parents("body").length){this.helper.appendTo((E.appendTo=="parent"?this.element[0].parentNode:E.appendTo))}this.offsetParent=(function(F){while(F){if(F.style&&(/(absolute|relative|fixed)/).test(A.css(F,"position"))){return A(F)}F=F.parentNode?F.parentNode:null}return A("body")})(this.helper[0].parentNode);this.elementOffset=this.element.offset();this.offsetParentOffset=this.offsetParent.offset();var C={left:this.elementOffset.left-this.offsetParentOffset.left,top:this.elementOffset.top-this.offsetParentOffset.top};this._pageX=D.pageX;this._pageY=D.pageY;this.clickOffset={left:D.pageX-this.elementOffset.left,top:D.pageY-this.elementOffset.top};var B=this.helper.css("position")=="relative";this.originalPosition={left:(B?parseInt(this.helper.css("left"),10)||0:C.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)),top:(B?parseInt(this.helper.css("top"),10)||0:C.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop))};if(this.element.css("position")=="fixed"){this.originalPosition.top-=this.offsetParent[0]==document.body?A(document).scrollTop():this.offsetParent[0].scrollTop;this.originalPosition.left-=this.offsetParent[0]==document.body?A(document).scrollLeft():this.offsetParent[0].scrollLeft}this.offset={left:D.pageX-this.originalPosition.left,top:D.pageY-this.originalPosition.top};if(this.element[0]!=this.helper[0]){this.offset.left+=parseInt(this.element.css("marginLeft"),10)||0;this.offset.top+=parseInt(this.element.css("marginTop"),10)||0}this.propagate("start",D);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(A.ui.ddmanager&&!E.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,D)}if(E.cursorAt){if(E.cursorAt.top!=undefined||E.cursorAt.bottom!=undefined){this.offset.top-=this.clickOffset.top-(E.cursorAt.top!=undefined?E.cursorAt.top:(this.helperProportions.height-E.cursorAt.bottom));this.clickOffset.top=(E.cursorAt.top!=undefined?E.cursorAt.top:(this.helperProportions.height-E.cursorAt.bottom))}if(E.cursorAt.left!=undefined||E.cursorAt.right!=undefined){this.offset.left-=this.clickOffset.left-(E.cursorAt.left!=undefined?E.cursorAt.left:(this.helperProportions.width-E.cursorAt.right));this.clickOffset.left=(E.cursorAt.left!=undefined?E.cursorAt.left:(this.helperProportions.width-E.cursorAt.right))}}return false},clear:function(){if(A.ui.ddmanager){A.ui.ddmanager.current=null}this.helper=null},stop:function(B){if(A.ui.ddmanager&&!this.options.dropBehaviour){A.ui.ddmanager.drop(this,B)}this.propagate("stop",B);if(this.cancelHelperRemoval){return false}if(this.options.helper!="original"){this.helper.remove()}this.clear();return false},drag:function(B){this.position={top:B.pageY-this.offset.top,left:B.pageX-this.offset.left};this.positionAbs={left:B.pageX-this.clickOffset.left,top:B.pageY-this.clickOffset.top};this.checkConstrains();this.position=this.propagate("drag",B)||this.position;this.checkConstrains();A(this.helper).css({left:this.position.left+"px",top:this.position.top+"px"});if(A.ui.ddmanager){A.ui.ddmanager.drag(this,B)}return false}});A.ui.plugin.add("draggable","cursor",{start:function(D,C){var B=A("body");if(B.css("cursor")){C.options._cursor=B.css("cursor")}B.css("cursor",C.options.cursor)},stop:function(C,B){if(B.options._cursor){A("body").css("cursor",B.options._cursor)}}});A.ui.plugin.add("draggable","zIndex",{start:function(D,C){var B=A(C.helper);if(B.css("zIndex")){C.options._zIndex=B.css("zIndex")}B.css("zIndex",C.options.zIndex)},stop:function(C,B){if(B.options._zIndex){A(B.helper).css("zIndex",B.options._zIndex)}}});A.ui.plugin.add("draggable","opacity",{start:function(D,C){var B=A(C.helper);if(B.css("opacity")){C.options._opacity=B.css("opacity")}B.css("opacity",C.options.opacity)},stop:function(C,B){if(B.options._opacity){A(B.helper).css("opacity",B.options._opacity)}}});A.ui.plugin.add("draggable","revert",{stop:function(E,D){var B=D.instance,C=A(B.helper);B.cancelHelperRemoval=true;A(D.helper).animate({left:B.originalPosition.left,top:B.originalPosition.top},parseInt(D.options.revert,10)||500,function(){if(D.options.helper!="original"){C.remove()}if(!C){B.clear()}})}});A.ui.plugin.add("draggable","iframeFix",{start:function(D,C){var F=C.options;if(C.instance.slowMode){return }if(F.iframeFix.constructor==Array){for(var B=0;B').css("width",A(F.iframeFix[B])[0].offsetWidth+"px").css("height",A(F.iframeFix[B])[0].offsetHeight+"px").css("position","absolute").css("opacity","0.001").css("z-index","1000").css("top",E.top+"px").css("left",E.left+"px").appendTo("body")}}else{A("iframe").each(function(){var G=A(this).offset({border:false});A('
').css("width",this.offsetWidth+"px").css("height",this.offsetHeight+"px").css("position","absolute").css("opacity","0.001").css("z-index","1000").css("top",G.top+"px").css("left",G.left+"px").appendTo("body")})}},stop:function(C,B){if(B.options.iframeFix){A("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this)})}}});A.ui.plugin.add("draggable","containment",{start:function(E,C){var G=C.options;var B=C.instance;if((G.containment.left!=undefined||G.containment.constructor==Array)&&!G._containment){return }if(!G._containment){G._containment=G.containment}if(G._containment=="parent"){G._containment=this[0].parentNode}if(G._containment=="document"){G.containment=[0,0,A(document).width(),(A(document).height()||document.body.parentNode.scrollHeight)]}else{var D=A(G._containment)[0];var F=A(G._containment).offset();G.containment=[F.left,F.top,F.left+(D.offsetWidth||D.scrollWidth),F.top+(D.offsetHeight||D.scrollHeight)]}var H=G.containment;C.instance.setContrains(H[0]-(B.offset.left-B.clickOffset.left),H[2]-(B.offset.left-B.clickOffset.left),H[1]-(B.offset.top-B.clickOffset.top),H[3]-(B.offset.top-B.clickOffset.top))}});A.ui.plugin.add("draggable","grid",{drag:function(E,D){var F=D.options;var C=D.instance.originalPosition.left+Math.round((E.pageX-D.instance._pageX)/F.grid[0])*F.grid[0];var B=D.instance.originalPosition.top+Math.round((E.pageY-D.instance._pageY)/F.grid[1])*F.grid[1];D.instance.position.left=C;D.instance.position.top=B}});A.ui.plugin.add("draggable","axis",{drag:function(C,B){var D=B.options;if(D.constraint){D.axis=D.constraint}switch(D.axis){case"x":B.instance.position.top=B.instance.originalPosition.top;break;case"y":B.instance.position.left=B.instance.originalPosition.left;break}}});A.ui.plugin.add("draggable","scroll",{start:function(C,B){var D=B.options;D.scrollSensitivity=D.scrollSensitivity||20;D.scrollSpeed=D.scrollSpeed||20;B.instance.overflowY=function(E){do{if(/auto|scroll/.test(E.css("overflow"))||(/auto|scroll/).test(E.css("overflow-y"))){return E}E=E.parent()}while(E[0].parentNode);return A(document)}(this);B.instance.overflowX=function(E){do{if(/auto|scroll/.test(E.css("overflow"))||(/auto|scroll/).test(E.css("overflow-x"))){return E}E=E.parent()}while(E[0].parentNode);return A(document)}(this)},drag:function(D,C){var E=C.options;var B=C.instance;if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){if(B.overflowY[0].offsetHeight-(C.position.top-B.overflowY[0].scrollTop+B.clickOffset.top)=0;H--){var E=M.instance.snapElements[H].left,B=E+M.instance.snapElements[H].width,Q=M.instance.snapElements[H].top,L=Q+M.instance.snapElements[H].height;if(!((E-KK&&IG)||(C>E&&DB))){return false}if(H-(L.helperProportions.height/2)>K&&IG){return 2}if(C>E&&DB){return 2}break;case"intersect":return(E=K&&I<=G)||(H>=K&&H<=G)||(IG))&&((D>=E&&D<=B)||(C>=E&&C<=B)||(DB));break;default:return false;break}};A.ui.ddmanager={current:null,droppables:[],prepareOffsets:function(D,F){var B=A.ui.ddmanager.droppables;var E=F?F.type:null;for(var C=0;C').css({position:B.css("position"),width:B.outerWidth(),height:B.outerHeight(),top:B.css("top"),left:B.css("left")}));var L=this.element;E=E.parentNode;this.element=A(E);this.element.css({marginLeft:L.css("marginLeft"),marginTop:L.css("marginTop"),marginRight:L.css("marginRight"),marginBottom:L.css("marginBottom")});L.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});if(A.browser.safari&&P.preventDefault){L.css("resize","none")}P.proportionallyResize=L.css({position:"static",zoom:1,display:"block"});this.element.css({margin:L.css("margin")});this._proportionallyResize()}if(!P.handles){P.handles=!A(".ui-resizable-handle",E).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(P.handles.constructor==String){if(P.handles=="all"){P.handles="n,e,s,w,se,sw,ne,nw"}var Q=P.handles.split(",");P.handles={};P.zIndex=P.zIndex||1000;var I={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;"};for(var T=0;T'].join("")).css(M);P.handles[U]=".ui-resizable-"+U;this.element.append(F.css(D?V:{}).css(P.knobHandles?C:{}).addClass(P.knobHandles?"ui-resizable-knob-handle":"").addClass(P.knobHandles))}if(P.knobHandles){this.element.addClass("ui-resizable-knob").css(!A.ui.css("ui-resizable-knob")?{}:{})}}this._renderAxis=function(a){a=a||this.element;for(var X in P.handles){if(P.handles[X].constructor==String){P.handles[X]=A(P.handles[X],E).show()}if(P.transparent){P.handles[X].css({opacity:0})}if(this.element.is(".ui-wrapper")&&P._nodeName.match(/textarea|input|select|button/i)){var Y=A(P.handles[X],E),Z=0;Z=/sw|ne|nw|se|n|s/.test(X)?Y.outerHeight():Y.outerWidth();var W=["padding",/ne|nw|n/.test(X)?"Top":/se|sw|s/.test(X)?"Bottom":/^e$/.test(X)?"Right":"Left"].join("");if(!P.transparent){a.css(W,Z)}this._proportionallyResize()}if(!A(P.handles[X]).length){continue}}};this._renderAxis(this.element);P._handles=A(".ui-resizable-handle",O.element);if(P.disableSelection){P._handles.each(function(W,X){A.ui.disableSelection(X)})}P._handles.mouseover(function(){if(!P.resizing){if(this.className){var W=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}O.axis=P.axis=W&&W[1]?W[1]:"se"}});if(P.autohide){P._handles.hide();A(O.element).addClass("ui-resizable-autohide").hover(function(){A(this).removeClass("ui-resizable-autohide");P._handles.show()},function(){if(!P.resizing){A(this).addClass("ui-resizable-autohide");P._handles.hide()}})}this.element.mouseInteraction({executor:this,delay:0,distance:0,dragPrevention:["input","textarea","button","select","option"],start:this.start,stop:this.stop,drag:this.drag,condition:function(X){if(this.disabled){return false}for(var W in this.options.handles){if(A(this.options.handles[W])[0]==X.target){return true}}return false}})};A.extend(A.ui.resizable.prototype,{plugins:{},ui:function(){return{instance:this,axis:this.options.axis,options:this.options}},_renderProxy:function(){var C=this.element,F=this.options;this.elementOffset=C.offset();if(F.proxy){this.helper=this.helper||A('
');var B=A.browser.msie&&A.browser.version<7,D=(B?1:0),E=(B?2:-1);this.helper.addClass(F.proxy).css({width:C.outerWidth()+E,height:C.outerHeight()+E,position:"absolute",left:this.elementOffset.left-D+"px",top:this.elementOffset.top-D+"px",zIndex:++F.zIndex});this.helper.appendTo("body");if(F.disableSelection){A.ui.disableSelection(this.helper.get(0))}}else{this.helper=C}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.ui()]);this.element.triggerHandler(C=="resize"?C:["resize",C].join(""),[B,this.ui()],this.options[C])},destroy:function(){var D=this.element,C=D.children(".ui-resizable").get(0),B=function(E){A(E).removeClass("ui-resizable ui-resizable-disabled").removeMouseInteraction().removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};B(D);if(D.is(".ui-wrapper")&&C){D.parent().append(A(C).css({position:D.css("position"),width:D.outerWidth(),height:D.outerHeight(),top:D.css("top"),left:D.css("left")})).end().remove();B(C)}},enable:function(){this.element.removeClass("ui-resizable-disabled");this.disabled=false},disable:function(){this.element.addClass("ui-resizable-disabled");this.disabled=true},start:function(I){var C=this.options,B=this.element.position(),D=this.element,H=function(M){return parseInt(M,10)||0},G=A.browser.msie&&A.browser.version<7;C.resizing=true;C.documentScroll={top:A(document).scrollTop(),left:A(document).scrollLeft()};if(D.is(".ui-draggable")||(/absolute/).test(D.css("position"))){var J=A.browser.msie&&!C.containment&&(/absolute/).test(D.css("position"))&&!(/relative/).test(D.parent().css("position"));var K=J?C.documentScroll.top:0,F=J?C.documentScroll.left:0;D.css({position:"absolute",top:(B.top+K),left:(B.left+F)})}if(/relative/.test(D.css("position"))&&A.browser.opera){D.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var L=H(this.helper.css("left")),E=H(this.helper.css("top"));this.offset=this.helper.offset();this.position={left:L,top:E};this.size=C.proxy||G?{width:D.outerWidth(),height:D.outerHeight()}:{width:D.width(),height:D.height()};this.originalSize=C.proxy||G?{width:D.outerWidth(),height:D.outerHeight()}:{width:D.width(),height:D.height()};this.originalPosition={left:L,top:E};this.sizeDiff={width:D.outerWidth()-D.width(),height:D.outerHeight()-D.height()};this.originalMousePosition={left:I.pageX,top:I.pageY};C.aspectRatio=(typeof C.aspectRatio=="number")?C.aspectRatio:((this.originalSize.height/this.originalSize.width)||1);if(C.preserveCursor){A("body").css("cursor",this.axis+"-resize")}this.propagate("start",I);return false},stop:function(J){this.options.resizing=false;var F=this.options,I=function(M){return parseInt(M,10)||0},L=this;if(F.proxy){var E=F.proportionallyResize,B=E&&/textarea/i.test(E.get(0).nodeName),C=B&&A.ui.hasScroll(E.get(0),"left")?0:L.sizeDiff.height,H=B?0:L.sizeDiff.width;var D={width:(L.size.width-H),height:(L.size.height-C)},G=parseInt(L.element.css("left"),10)+(L.position.left-L.originalPosition.left),K=parseInt(L.element.css("top"),10)+(L.position.top-L.originalPosition.top);if(!F.animate){this.element.css(A.extend(D,{top:K,left:G}))}if(F.proxy&&!F.animate){this._proportionallyResize()}this.helper.remove()}if(F.preserveCursor){A("body").css("cursor","auto")}this.propagate("stop",J);return false},drag:function(I){var D=this.helper,C=this.options,J={},M=this,F=this.originalMousePosition,K=this.axis;var N=(I.pageX-F.left)||0,L=(I.pageY-F.top)||0;var E=this.change[K];if(!E){return false}var H=E.apply(this,[I,N,L]),G=A.browser.msie&&A.browser.version<7,B=this.sizeDiff;if(C._aspectRatio||I.shiftKey){H=this._updateRatio(H,I)}H=this._respectSize(H,I);this.propagate("resize",I);D.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!C.proxy&&C.proportionallyResize){this._proportionallyResize()}this._updateCache(H);return false},_updateCache:function(B){var C=this.options;this.offset=this.helper.offset();if(B.left){this.position.left=B.left}if(B.top){this.position.top=B.top}if(B.height){this.size.height=B.height}if(B.width){this.size.width=B.width}},_updateRatio:function(D,E){var F=this.options,G=this.position,C=this.size,B=this.axis;if(D.height){D.width=Math.round(C.height/F.aspectRatio)}else{if(D.width){D.height=Math.round(C.width*F.aspectRatio)}}if(B=="sw"){D.left=G.left+(C.width-D.width);D.top=null}if(B=="nw"){D.top=G.top+(C.height-D.height);D.left=G.left+(C.width-D.width)}return D},_respectSize:function(H,I){var F=this.helper,E=this.options,N=E._aspectRatio||I.shiftKey,M=this.axis,P=H.width&&E.maxWidth&&E.maxWidthH.width,O=H.height&&E.minHeight&&E.minHeight>H.height;if(D){H.width=E.minWidth}if(O){H.height=E.minHeight}if(P){H.width=E.maxWidth}if(J){H.height=E.maxHeight}var C=this.originalPosition.left+this.originalSize.width,L=this.position.top+this.size.height;var G=/sw|nw|w/.test(M),B=/nw|ne|n/.test(M);if(D&&G){H.left=C-E.minWidth}if(P&&G){H.left=C-E.maxWidth}if(O&&B){H.top=L-E.minHeight}if(J&&B){H.top=L-E.maxHeight}var K=!H.width&&!H.height;if(K&&!H.left&&H.top){H.top=null}else{if(K&&!H.top&&H.left){H.left=null}}return H},_proportionallyResize:function(){var F=this.options;if(!F.proportionallyResize){return }var D=F.proportionallyResize,C=this.helper||this.element;if(!F.borderDif){var B=[D.css("borderTopWidth"),D.css("borderRightWidth"),D.css("borderBottomWidth"),D.css("borderLeftWidth")],E=[D.css("paddingTop"),D.css("paddingRight"),D.css("paddingBottom"),D.css("paddingLeft")];F.borderDif=A.map(B,function(G,I){var H=parseInt(G,10)||0,J=parseInt(E[I],10)||0;return H+J})}D.css({height:(C.height()-F.borderDif[0]-F.borderDif[2])+"px",width:(C.width()-F.borderDif[1]-F.borderDif[3])+"px"})},change:{e:function(D,C,B){return{width:this.originalSize.width+C}},w:function(F,C,B){var G=this.options,D=this.originalSize,E=this.originalPosition;return{left:E.left+C,width:D.width-C}},n:function(F,C,B){var G=this.options,D=this.originalSize,E=this.originalPosition;return{top:E.top+B,height:D.height-B}},s:function(D,C,B){return{height:this.originalSize.height+B}},se:function(D,C,B){return A.extend(this.change.s.apply(this,arguments),this.change.e.apply(this,[D,C,B]))},sw:function(D,C,B){return A.extend(this.change.s.apply(this,arguments),this.change.w.apply(this,[D,C,B]))},ne:function(D,C,B){return A.extend(this.change.n.apply(this,arguments),this.change.e.apply(this,[D,C,B]))},nw:function(D,C,B){return A.extend(this.change.n.apply(this,arguments),this.change.w.apply(this,[D,C,B]))}}});A.ui.plugin.add("resizable","containment",{start:function(I,K){var E=K.options,M=K.instance,G=M.element;var C=E.containment,F=(C instanceof jQuery)?C.get(0):(/parent/.test(C))?G.parent().get(0):C;if(!F){return }if(/document/.test(C)||C==document){M.containerOffset={left:0,top:0};M.parentData={element:A(document),left:0,top:0,width:A(document).width(),height:A(document).height()||document.body.parentNode.scrollHeight}}else{M.containerOffset=A(F).offset(),M.containerSize={height:A(F).innerHeight(),width:A(F).innerWidth()};var J=M.containerOffset,B=M.containerSize.height,H=M.containerSize.width,D=(A.ui.hasScroll(F,"left")?F.scrollWidth:H),L=(A.ui.hasScroll(F)?F.scrollHeight:B);M.parentData={element:F,left:J.left,top:J.top,width:D,height:L}}},resize:function(F,I){var C=I.options,L=I.instance,B=L.containerSize,H=L.containerOffset,E=L.size,G=L.position,J=C._aspectRatio||F.shiftKey;if(G.left<(C.proxy?H.left:0)){L.size.width=L.size.width+(C.proxy?(L.position.left-H.left):L.position.left);if(J){L.size.height=L.size.width*C.aspectRatio}L.position.left=C.proxy?H.left:0}if(G.top<(C.proxy?H.top:0)){L.size.height=L.size.height+(C.proxy?(L.position.top-H.top):L.position.top);if(J){L.size.width=L.size.height/C.aspectRatio}L.position.top=C.proxy?H.top:0}var D=(C.proxy?L.offset.left-H.left:L.position.left)+L.sizeDiff.width,K=(C.proxy?L.offset.top-H.top:L.position.top)+L.sizeDiff.height;if(D+L.size.width>=L.parentData.width){L.size.width=L.parentData.width-D;if(J){L.size.height=L.size.width*C.aspectRatio}}if(K+L.size.height>=L.parentData.height){L.size.height=L.parentData.height-K;if(J){L.size.width=L.size.height/C.aspectRatio}}}});A.ui.plugin.add("resizable","grid",{resize:function(H,J){var D=J.options,L=J.instance,G=L.size,E=L.originalSize,F=L.originalPosition,K=L.axis,I=D._aspectRatio||H.shiftKey;D.grid=typeof D.grid=="number"?[D.grid,D.grid]:D.grid;var C=Math.round((G.width-E.width)/D.grid[0])*D.grid[0],B=Math.round((G.height-E.height)/D.grid[1])*D.grid[1];if(/^(se|s|e)$/.test(K)){L.size.width=E.width+C;L.size.height=E.height+B}else{if(/^(ne)$/.test(K)){L.size.width=E.width+C;L.size.height=E.height+B;L.position.top=F.top-B}else{if(/^(sw)$/.test(K)){L.size.width=E.width+C;L.size.height=E.height+B;L.position.left=F.left-C}else{L.size.width=E.width+C;L.size.height=E.height+B;L.position.top=F.top-B;L.position.left=F.left-C}}}}});A.ui.plugin.add("resizable","animate",{stop:function(I,K){var F=K.options,L=K.instance;var E=F.proportionallyResize,B=E&&/textarea/i.test(E.get(0).nodeName),C=B&&A.ui.hasScroll(E.get(0),"left")?0:L.sizeDiff.height,H=B?0:L.sizeDiff.width;var D={width:(L.size.width-H),height:(L.size.height-C)},G=parseInt(L.element.css("left"),10)+(L.position.left-L.originalPosition.left),J=parseInt(L.element.css("top"),10)+(L.position.top-L.originalPosition.top);L.element.animate(A.extend(D,{top:J,left:G}),{duration:F.animateDuration||"slow",easing:F.animateEasing||"swing",step:function(){if(E){E.css({width:L.element.css("width"),height:L.element.css("height")})}}})}});A.ui.plugin.add("resizable","ghost",{start:function(E,D){var F=D.options,B=D.instance,G=F.proportionallyResize,C=B.size;if(!G){B.ghost=B.element.clone()}else{B.ghost=G.clone()}B.ghost.css({opacity:0.25,display:"block",position:"relative",height:C.height,width:C.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof F.ghost=="string"?F.ghost:"");B.ghost.appendTo(B.helper)},resize:function(D,C){var E=C.options,B=C.instance,F=E.proportionallyResize;if(B.ghost){B.ghost.css({position:"relative",height:B.size.height,width:B.size.width})}},stop:function(D,C){var E=C.options,B=C.instance,F=E.proportionallyResize;if(B.ghost&&B.helper){B.helper.get(0).removeChild(B.ghost.get(0))}}})})(jQuery);(function(A){A.fn.extend({selectable:function(C){var B=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof C=="string"){var D=A.data(this,"selectable");if(D){D[C].apply(D,B)}}else{if(!A.data(this,"selectable")){new A.ui.selectable(this,C)}}})}});A.ui.selectable=function(D,C){var B=this;this.element=A(D);A.data(D,"selectable",this);this.element.addClass("ui-selectable");this.options=A.extend({appendTo:"body",autoRefresh:true,filter:"*",tolerance:"touch"},C);A(D).bind("setData.selectable",function(G,F,H){B.options[F]=H}).bind("getData.selectable",function(G,F){return B.options[F]});this.dragged=false;var E;this.refresh=function(){E=A(B.options.filter,B.element[0]);E.each(function(){var F=A(this);var G=F.offset();A.data(this,"selectable-item",{element:this,$element:F,left:G.left,top:G.top,right:G.left+F.width(),bottom:G.top+F.height(),startselected:false,selected:F.hasClass("ui-selected"),selecting:F.hasClass("ui-selecting"),unselecting:F.hasClass("ui-unselecting")})})};this.refresh();this.selectees=E.addClass("ui-selectee");this.element.mouseInteraction({executor:this,appendTo:"body",delay:0,distance:0,dragPrevention:["input","textarea","button","select","option"],start:this.start,stop:this.stop,drag:this.drag,condition:function(G){var F=false;A(G.target).parents().andSelf().each(function(){if(A.data(this,"selectable-item")){F=true}});return this.options.keyboard?!F:true}});this.helper=A(document.createElement("div")).css({border:"1px dotted black"})};A.extend(A.ui.selectable.prototype,{toggle:function(){if(this.disabled){this.enable()}else{this.disable()}},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable").removeMouseInteraction()},enable:function(){this.element.removeClass("ui-selectable-disabled");this.disabled=false},disable:function(){this.element.addClass("ui-selectable-disabled");this.disabled=true},start:function(D,C){this.opos=[D.pageX,D.pageY];if(this.disabled){return }var B=this.options;this.selectees=A(B.filter,C);this.element.triggerHandler("selectablestart",[D,{selectable:C,options:B}],B.start);A("body").append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:D.clientX,top:D.clientY,width:0,height:0});if(B.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var E=A.data(this,"selectable-item");E.startselected=true;if(!D.ctrlKey){E.$element.removeClass("ui-selected");E.selected=false;E.$element.addClass("ui-unselecting");E.unselecting=true;A(this.element).triggerHandler("selectableunselecting",[D,{selectable:C,unselecting:E.element,options:B}],B.unselecting)}})},drag:function(I,G){this.dragged=true;if(this.disabled){return }var D=this.options;var C=this.opos[0],H=this.opos[1],B=I.pageX,F=I.pageY;if(C>B){var E=B;B=C;C=E}if(H>F){var E=F;F=H;H=E}this.helper.css({left:C,top:H,width:B-C,height:F-H});this.selectees.each(function(){var J=A.data(this,"selectable-item");if(!J||J.element==G){return }var K=false;if(D.tolerance=="touch"){K=(!(J.left>B||J.rightF||J.bottomC&&J.rightH&&J.bottom *",zIndex:this.options.zIndex||1000,startCondition:function(){return !B.options.disabled}});A(D).bind("setData.sortable",function(G,F,H){B.options[F]=H}).bind("getData.sortable",function(G,F){return B.options[F]});this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;if(!(/(relative|absolute|fixed)/).test(this.element.css("position"))){this.element.css("position","relative")}this.offset=this.element.offset();this.element.mouseInteraction({executor:this,delay:E.delay,distance:E.distance||0,dragPrevention:E.prevention?E.prevention.toLowerCase().split(","):["input","textarea","button","select","option"],start:this.start,stop:this.stop,drag:this.drag,condition:function(H){if(this.options.disabled||this.options.type=="static"){return false}var G=null,F=A(H.target).parents().each(function(){if(A.data(this,"sortable-item")){G=A(this);return false}});if(A.data(H.target,"sortable-item")){G=A(H.target)}if(!G){return false}if(this.options.handle){var I=false;A(this.options.handle,G).each(function(){if(this==H.target){I=true}});if(!I){return false}}this.currentItem=G;return true}});if(E.cursorAt&&E.cursorAt.constructor==Array){E.cursorAt={left:E.cursorAt[0],top:E.cursorAt[1]}}};A.extend(A.ui.sortable.prototype,{plugins:{},ui:function(B){return{helper:(B||this)["helper"],placeholder:(B||this)["placeholder"]||A([]),position:(B||this)["position"].current,absolutePosition:(B||this)["position"].absolute,instance:this,options:this.options,element:this.element,item:(B||this)["currentItem"],sender:B?B.element:null}},propagate:function(D,C,B){A.ui.plugin.call(this,D,[C,this.ui(B)]);this.element.triggerHandler(D=="sort"?D:"sort"+D,[C,this.ui(B)],this.options[D])},serialize:function(D){var B=A(this.options.items,this.element).not(".ui-sortable-helper");var C=[];D=D||{};B.each(function(){var E=(A(this).attr(D.attribute||"id")||"").match(D.expression||(/(.+)[-=_](.+)/));if(E){C.push((D.key||E[1])+"[]="+(D.key?E[1]:E[2]))}});return C.join("&")},toArray:function(B){var C=A(this.options.items,this.element).not(".ui-sortable-helper");var D=[];C.each(function(){D.push(A(this).attr(B||"id"))});return D},enable:function(){this.element.removeClass("ui-sortable-disabled");this.options.disabled=false},disable:function(){this.element.addClass("ui-sortable-disabled");this.options.disabled=true},intersectsWith:function(I){var D=this.position.absolute.left,C=D+this.helperProportions.width,H=this.position.absolute.top,G=H+this.helperProportions.height;var E=I.left,B=E+I.width,J=I.top,F=J+I.height;return(EE&&DB){return 1}}else{if(G>J&&HF){return 2}}return false},inEmptyZone:function(B){if(!A(B.options.items,B.element).length){return B.options.dropOnEmpty?true:false}var C=A(B.options.items,B.element).not(".ui-sortable-helper");C=A(C[C.length-1]);var D=C.offset()[this.floating?"left":"top"]+C[0][this.floating?"offsetWidth":"offsetHeight"];return(this.position.absolute[this.floating?"left":"top"]>D)},refresh:function(){this.refreshItems();this.refreshPositions()},refreshItems:function(){this.items=[];this.containers=[this];var B=this.items;var D=[A(this.options.items,this.element)];if(this.options.connectWith){for(var E=this.options.connectWith.length-1;E>=0;E--){var G=A(this.options.connectWith[E]);for(var C=G.length-1;C>=0;C--){var F=A.data(G[C],"sortable");if(F&&!F.options.disabled){D.push(A(F.options.items,F.element));this.containers.push(F)}}}}for(var E=D.length-1;E>=0;E--){D[E].each(function(){A.data(this,"sortable-item",true);B.push({item:A(this),width:0,height:0,left:0,top:0})})}},refreshPositions:function(B){for(var C=this.items.length-1;C>=0;C--){if(!B){this.items[C].width=this.items[C].item.outerWidth()}if(!B){this.items[C].height=this.items[C].item.outerHeight()}var D=this.items[C].item.offset();this.items[C].left=D.left;this.items[C].top=D.top}for(var C=this.containers.length-1;C>=0;C--){var D=this.containers[C].element.offset();this.containers[C].containerCache.left=D.left;this.containers[C].containerCache.top=D.top;this.containers[C].containerCache.width=this.containers[C].element.outerWidth();this.containers[C].containerCache.height=this.containers[C].element.outerHeight()}},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable").removeMouseInteraction();for(var B=this.items.length-1;B>=0;B--){this.items[B].item.removeData("sortable-item")}},createPlaceholder:function(B){(B||this).placeholderElement=this.options.placeholderElement?A(this.options.placeholderElement,(B||this).currentItem):(B||this).currentItem;(B||this).placeholder=A("
").addClass(this.options.placeholder).appendTo("body").css({position:"absolute"}).css((B||this).placeholderElement.offset()).css({width:(B||this).placeholderElement.outerWidth(),height:(B||this).placeholderElement.outerHeight()})},contactContainers:function(E){for(var C=this.containers.length-1;C>=0;C--){if(this.intersectsWith(this.containers[C].containerCache)){if(!this.containers[C].containerCache.over){if(this.currentContainer!=this.containers[C]){var H=10000;var G=null;var D=this.position.absolute[this.containers[C].floating?"left":"top"];for(var B=this.items.length-1;B>=0;B--){if(!this.containers[C].element[0].contains(this.items[B].item[0])){continue}var F=this.items[B][this.containers[C].floating?"left":"top"];if(Math.abs(F-D)=0;B--){this.containers[B].propagate("activate",D,this)}if(A.ui.ddmanager){A.ui.ddmanager.current=this}if(A.ui.ddmanager&&!E.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,D)}this.dragging=true;return false},stop:function(C){this.propagate("stop",C);if(this.position.dom!=this.currentItem.prev()[0]){this.propagate("update",C)}if(!this.element[0].contains(this.currentItem[0])){this.propagate("remove",C);for(var B=this.containers.length-1;B>=0;B--){if(this.containers[B].element[0].contains(this.currentItem[0])){this.containers[B].propagate("update",C,this);this.containers[B].propagate("receive",C,this)}}}for(var B=this.containers.length-1;B>=0;B--){this.containers[B].propagate("deactivate",C,this);if(this.containers[B].containerCache.over){this.containers[B].propagate("out",C,this);this.containers[B].containerCache.over=0}}if(A.ui.ddmanager&&!this.options.dropBehaviour){A.ui.ddmanager.drop(this,C)}this.dragging=false;if(this.cancelHelperRemoval){return false}A(this.currentItem).css("visibility","");if(this.placeholder){this.placeholder.remove()}this.helper.remove();return false},drag:function(C){this.position.current={top:C.pageY-this.offset.top,left:C.pageX-this.offset.left};this.position.absolute={left:C.pageX-this.clickOffset.left,top:C.pageY-this.clickOffset.top};for(var B=this.items.length-1;B>=0;B--){var D=this.intersectsWithEdge(this.items[B]);if(!D){continue}if(this.items[B].item[0]!=this.currentItem[0]&&this.currentItem[D==1?"next":"prev"]()[0]!=this.items[B].item[0]&&!this.currentItem[0].contains(this.items[B].item[0])&&(this.options.type=="semi-dynamic"?!this.element[0].contains(this.items[B].item[0]):true)){this.direction=D==1?"down":"up";this.rearrange(C,this.items[B]);this.propagate("change",C);break}}this.contactContainers(C);if(A.ui.ddmanager){A.ui.ddmanager.drag(this,C)}this.propagate("sort",C);this.helper.css({left:this.position.current.left+"px",top:this.position.current.top+"px"});return false},rearrange:function(D,C,B){B?B.append(this.currentItem):C.item[this.direction=="down"?"before":"after"](this.currentItem);this.refreshPositions(true);if(this.placeholderElement){this.placeholder.css(this.placeholderElement.offset())}}});A.ui.plugin.add("sortable","cursor",{start:function(D,C){var B=A("body");if(B.css("cursor")){C.options._cursor=B.css("cursor")}B.css("cursor",C.options.cursor)},stop:function(C,B){if(B.options._cursor){A("body").css("cursor",B.options._cursor)}}});A.ui.plugin.add("sortable","zIndex",{start:function(D,C){var B=C.helper;if(B.css("zIndex")){C.options._zIndex=B.css("zIndex")}B.css("zIndex",C.options.zIndex)},stop:function(C,B){if(B.options._zIndex){A(B.helper).css("zIndex",B.options._zIndex)}}});A.ui.plugin.add("sortable","opacity",{start:function(D,C){var B=C.helper;if(B.css("opacity")){C.options._opacity=B.css("opacity")}B.css("opacity",C.options.opacity)},stop:function(C,B){if(B.options._opacity){A(B.helper).css("opacity",B.options._opacity)}}});A.ui.plugin.add("sortable","revert",{stop:function(D,C){var B=C.instance;B.cancelHelperRemoval=true;var E=B.currentItem.offset();var F=B.helper.offsetParent().offset();if(C.instance.options.zIndex){C.helper.css("zIndex",C.instance.options.zIndex)}if(C.instance.placeholder){C.instance.placeholder.animate({opacity:"hide"},parseInt(C.options.revert,10)||500)}C.helper.animate({left:E.left-F.left-B.margins.left,top:E.top-F.top-B.margins.top},parseInt(C.options.revert,10)||500,function(){B.currentItem.css("visibility","visible");window.setTimeout(function(){if(B.placeholder){B.placeholder.remove()}B.helper.remove();if(C.options._zIndex){C.helper.css("zIndex",C.options._zIndex)}},50)})}});A.ui.plugin.add("sortable","containment",{start:function(D,B){var F=B.options;if((F.containment.left!=undefined||F.containment.constructor==Array)&&!F._containment){return }if(!F._containment){F._containment=F.containment}if(F._containment=="parent"){F._containment=this[0].parentNode}if(F._containment=="sortable"){F._containment=this[0]}if(F._containment=="document"){F.containment=[0,0,A(document).width(),(A(document).height()||document.body.parentNode.scrollHeight)]}else{var C=A(F._containment);var E=C.offset();F.containment=[E.left,E.top,E.left+(C.outerWidth()||C[0].scrollWidth),E.top+(C.outerHeight()||C[0].scrollHeight)]}},sort:function(E,I){var B=I.options;var D=I.helper;var H=B.containment;var K=I.instance;var F=(parseInt(K.offsetParent.css("borderLeftWidth"),10)||0);var J=(parseInt(K.offsetParent.css("borderRightWidth"),10)||0);var C=(parseInt(K.offsetParent.css("borderTopWidth"),10)||0);var G=(parseInt(K.offsetParent.css("borderBottomWidth"),10)||0);if(H.constructor==Array){if((K.position.absolute.left=0){K.position.current.left=H[2]-K.offsets.parent.left-K.helperProportions.width-K.margins.left-F-J}if(K.position.absolute.top-H[3]+K.helperProportions.height>=0){K.position.current.top=H[3]-K.offsets.parent.top-K.helperProportions.height-K.margins.top-C-G}}else{if((I.position.left=0){K.position.current.left=K.offsetParent.innerWidth()-K.helperProportions.width-H.right-F-J}if(I.position.top-K.offsetParent.innerHeight()+K.helperProportions.height+H.bottom+C+G>=0){K.position.current.top=K.offsetParent.innerHeight()-K.helperProportions.height-H.bottom-C-G}}}});A.ui.plugin.add("sortable","axis",{sort:function(C,B){var D=B.options;if(D.constraint){D.axis=D.constraint}D.axis=="x"?B.instance.position.top=B.instance.originalPosition.top:B.instance.position.left=B.instance.originalPosition.left}});A.ui.plugin.add("sortable","scroll",{start:function(C,B){var D=B.options;D.scrollSensitivity=D.scrollSensitivity||20;D.scrollSpeed=D.scrollSpeed||20;B.instance.overflowY=function(E){do{if((/auto|scroll/).test(E.css("overflow"))||(/auto|scroll/).test(E.css("overflow-y"))){return E}E=E.parent()}while(E[0].parentNode);return A(document)}(this);B.instance.overflowX=function(E){do{if((/auto|scroll/).test(E.css("overflow"))||(/auto|scroll/).test(E.css("overflow-x"))){return E}E=E.parent()}while(E[0].parentNode);return A(document)}(this);if(B.instance.overflowY[0]!=document&&B.instance.overflowY[0].tagName!="HTML"){B.instance.overflowYstart=B.instance.overflowY[0].scrollTop}if(B.instance.overflowX[0]!=document&&B.instance.overflowX[0].tagName!="HTML"){B.instance.overflowXstart=B.instance.overflowX[0].scrollLeft}},sort:function(D,C){var E=C.options;var B=C.instance;if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){if(B.overflowY[0].offsetHeight-(C.position.top-B.overflowY[0].scrollTop+B.clickOffset.top)").insertBefore(H.headers);E("").appendTo(H.headers);H.headers.addClass("ui-accordion-header").attr("tabindex","0")}if(H.fillSpace){var J=this.element.parent().height();H.headers.each(function(){J-=E(this).outerHeight()});var I=0;H.headers.next().each(function(){I=Math.max(I,E(this).innerHeight()-E(this).height())}).height(J-I)}else{if(H.autoHeight){var J=0;H.headers.next().each(function(){J=Math.max(J,E(this).outerHeight())}).height(J)}}H.headers.not(H.active||"").next().hide();H.active.parent().andSelf().addClass(H.selectedClass);if(H.event){this.element.bind((H.event)+".accordion",F)}};E.ui.accordion.prototype={activate:function(G){F.call(this.element[0],{target:C(this.options.headers,G)[0]})},enable:function(){this.options.disabled=false},disable:function(){this.options.disabled=true},destroy:function(){this.options.headers.next().css("display","");if(this.options.fillSpace||this.options.autoHeight){this.options.headers.next().css("height","")}E.removeData(this.element[0],"accordion");this.element.removeClass("ui-accordion").unbind(".accordion")}};function B(H,G){return function(){return H.apply(G,arguments)}}function D(I){if(!E.data(this,"accordion")){return }var G=E.data(this,"accordion");var H=G.options;H.running=I?0:--H.running;if(H.running){return }if(H.clearStyle){H.toShow.add(H.toHide).css({height:"",overflow:""})}E(this).triggerHandler("accordionchange",[H.data],H.change)}function A(G,K,L,J,M){var I=E.data(this,"accordion").options;I.toShow=G;I.toHide=K;I.data=L;var H=B(D,this);I.running=K.size()==0?G.size():K.size();if(I.animated){if(!I.alwaysOpen&&J){E.ui.accordion.animations[I.animated]({toShow:jQuery([]),toHide:K,complete:H,down:M,autoHeight:I.autoHeight})}else{E.ui.accordion.animations[I.animated]({toShow:G,toHide:K,complete:H,down:M,autoHeight:I.autoHeight})}}else{if(!I.alwaysOpen&&J){G.toggle()}else{K.hide();G.show()}H(true)}}function F(L){var J=E.data(this,"accordion").options;if(J.disabled){return false}if(!L.target&&!J.alwaysOpen){J.active.parent().andSelf().toggleClass(J.selectedClass);var I=J.active.next(),M={instance:this,options:J,newHeader:jQuery([]),oldHeader:J.active,newContent:jQuery([]),oldContent:I},G=J.active=E([]);A.call(this,G,I,M);return false}var K=E(L.target);if(K.parents(J.header).length){while(!K.is(J.header)){K=K.parent()}}var H=K[0]==J.active[0];if(J.running||(J.alwaysOpen&&H)){return false}if(!K.is(J.header)){return }J.active.parent().andSelf().toggleClass(J.selectedClass);if(!H){K.parent().andSelf().addClass(J.selectedClass)}var G=K.next(),I=J.active.next(),M={instance:this,options:J,newHeader:K,oldHeader:J.active,newContent:G,oldContent:I},N=J.headers.index(J.active[0])>J.headers.index(K[0]);J.active=H?E([]):K;A.call(this,G,I,M,H,N);return false}function C(H,G){return G!=undefined?typeof G=="number"?H.filter(":eq("+G+")"):H.not(H.not(G)):G===false?E([]):H.filter(":eq(0)")}E.extend(E.ui.accordion,{defaults:{selectedClass:"selected",alwaysOpen:true,animated:"slide",event:"click",header:"a",autoHeight:true,running:0,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(G,I){G=E.extend({easing:"swing",duration:300},G,I);if(!G.toHide.size()){G.toShow.animate({height:"show"},G);return }var H=G.toHide.height(),J=G.toShow.height(),K=J/H;G.toShow.css({height:0,overflow:"hidden"}).show();G.toHide.filter(":hidden").each(G.complete).end().filter(":visible").animate({height:"hide"},{step:function(L){var M=(H-L)*K;if(E.browser.msie||E.browser.opera){M=Math.ceil(M)}G.toShow.height(M)},duration:G.duration,easing:G.easing,complete:function(){if(!G.autoHeight){G.toShow.css("height","auto")}G.complete()}})},bounceslide:function(G){this.slide(G,{easing:G.down?"bounceout":"swing",duration:G.down?1000:200})},easeslide:function(G){this.slide(G,{easing:"easeinout",duration:700})}}});E.fn.activate=function(G){return this.accordion("activate",G)}})(jQuery);(function(A){A.fn.extend({dialog:function(C){var B=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof C=="string"){var E=A(this).is(".ui-dialog")?this:A(this).parents(".ui-dialog:first").find(".ui-dialog-content")[0];var D=E?A.data(E,"dialog"):{};if(D[C]){D[C].apply(D,B)}}else{if(!A(this).is(".ui-dialog-content")){new A.ui.dialog(this,C)}}})}});A.ui.dialog=function(D,L){this.options=L=A.extend({},A.ui.dialog.defaults,L);this.element=D;var K=this;A.data(this.element,"dialog",this);A(D).bind("remove",function(){K.destroy()});A(D).bind("setData.dialog",function(N,M,O){switch(M){case"draggable":J.draggable(O?"enable":"disable");break;case"dragStart":J.data("start.draggable",O);break;case"drag":J.data("drag.draggable",O);break;case"dragStop":J.data("stop.draggable",O);break;case"height":J.height(O);break;case"maxHeight":case"minHeight":case"maxWidth":case"minWidth":J.data(M+".resizable",O);break;case"position":K.position(O);break;case"resizable":J.resizable(O?"enable":"disable");break;case"resizeStart":J.data("start.resizable",O);break;case"resize":J.data("resize.resizable",O);break;case"resizeStop":J.data("stop.resizable",O);break;case"title":A(".ui-dialog-title",C).text(O);break;case"width":break}L[M]=O}).bind("getData.dialog",function(N,M){return L[M]});var E=A(D).addClass("ui-dialog-content");if(!E.parent().length){E.appendTo("body")}E.wrap(document.createElement("div")).wrap(document.createElement("div"));var H=E.parent().addClass("ui-dialog-container").css({position:"relative"});var J=this.uiDialog=H.parent().hide().addClass("ui-dialog").css({position:"absolute",width:L.width,height:L.height,overflow:"hidden"});var B=E.attr("className").split(" ");A.each(B,function(M,N){if(N!="ui-dialog-content"){J.addClass(N)}});if(A.fn.resizable){J.append('
').append('
').append('
').append('
').append('
').append('
').append('
').append('
');J.resizable({maxWidth:L.maxWidth,maxHeight:L.maxHeight,minWidth:L.minWidth,minHeight:L.minHeight,start:L.resizeStart,resize:L.resize,stop:function(N,M){L.resizeStop&&L.resizeStop.apply(this,arguments);A.ui.dialog.overlay.resize()}});if(!L.resizable){J.resizable("disable")}}H.prepend('
');var C=A(".ui-dialog-titlebar",H);var I=(L.title)?L.title:(E.attr("title"))?E.attr("title"):"";C.append(''+I+"");C.append('X');this.uiDialogTitlebarClose=A(".ui-dialog-titlebar-close",C).hover(function(){A(this).addClass("ui-dialog-titlebar-close-hover")},function(){A(this).removeClass("ui-dialog-titlebar-close-hover")}).mousedown(function(M){M.stopPropagation()}).click(function(){K.close();return false}).keydown(function(M){var N=27;M.keyCode&&M.keyCode==N&&K.close()});var F=0;A.each(L.buttons,function(){F=1;return false});if(F==1){J.append('
');var G=A(".ui-dialog-buttonpane",J);A.each(L.buttons,function(M,O){var N=A(document.createElement("button")).text(M).click(O);G.append(N)})}if(A.fn.draggable){J.draggable({handle:".ui-dialog-titlebar",start:function(N,M){K.activate();L.dragStart&&L.dragStart.apply(this,arguments)},drag:L.drag,stop:function(N,M){L.dragStop&&L.dragStop.apply(this,arguments);A.ui.dialog.overlay.resize()}});if(!L.draggable){J.draggable("disable")}}J.mousedown(function(){K.activate()});C.click(function(){K.activate()});L.bgiframe&&A.fn.bgiframe&&J.bgiframe();this.position=function(Q){var M=A(window),P=A(document),O=P.scrollTop(),N=P.scrollLeft();if(Q.constructor==Array){O+=Q[1];N+=Q[0]}else{switch(Q){case"center":O+=(M.height()/2)-(J.height()/2);N+=(M.width()/2)-(J.width()/2);break;case"top":O+=0;N+=(M.width()/2)-(J.width()/2);break;case"right":O+=(M.height()/2)-(J.height()/2);N+=(M.width())-(J.width());break;case"bottom":O+=(M.height())-(J.height());N+=(M.width()/2)-(J.width()/2);break;case"left":O+=(M.height()/2)-(J.height()/2);N+=0;break;default:O+=(M.height()/2)-(J.height()/2);N+=(M.width()/2)-(J.width()/2)}}O=OF}else{E=true}}return E});A(document).bind("keydown.dialog-overlay",function(D){var E=27;D.keyCode&&D.keyCode==E&&C.close()});A(window).bind("resize.dialog-overlay",A.ui.dialog.overlay.resize)}var B=A("
").appendTo(document.body).addClass("ui-dialog-overlay").css(A.extend({borderWidth:0,margin:0,padding:0,position:"absolute",top:0,left:0,width:this.width(),height:this.height()},C.options.overlay));C.options.bgiframe&&A.fn.bgiframe&&B.bgiframe();this.instances.push(B);return B},destroy:function(B){this.instances.splice(A.inArray(this.instances,B),1);if(this.instances.length===0){A("a, :input").add([document,window]).unbind(".dialog-overlay")}B.remove()},height:function(){if(A.browser.msie&&A.browser.version<7){var C=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var B=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(C").addClass("ui-slider-handle").appendTo(D);if(this.id){F.attr("id",this.id)}return F[0]})}A(this.handle).mouseInteraction({executor:this,delay:E.delay,distance:E.distance!=undefined?E.distance:1,dragPrevention:E.prevention?E.prevention.toLowerCase().split(","):["input","textarea","button","select","option"],start:this.start,stop:this.stop,drag:this.drag,condition:function(G,F){if(!this.disabled){if(this.currentHandle){this.blur(this.currentHandle)}this.focus(F,1);return !this.disabled}}}).wrap('').parent().bind("focus",function(F){B.focus(this.firstChild)}).bind("blur",function(F){B.blur(this.firstChild)}).bind("keydown",function(F){if(/(37|38|39|40)/.test(F.keyCode)){B.moveTo({x:/(37|39)/.test(F.keyCode)?(F.keyCode==37?"-":"+")+"="+B.oneStep(1):null,y:/(38|40)/.test(F.keyCode)?(F.keyCode==38?"-":"+")+"="+B.oneStep(2):null},this.firstChild)}});this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.element.bind("mousedown.slider",function(F){B.click.apply(B,[F]);B.currentHandle.data("ui-mouse").trigger(F);B.firstValue=B.firstValue+1});A.each(E.handles||[],function(F,G){B.moveTo(G.start,F,true)});if(!isNaN(E.startValue)){this.moveTo(E.startValue,0,true)}if(this.handle.length==1){this.previousHandle=this.handle}if(this.handle.length==2&&E.range){this.createRange()}};A.extend(A.ui.slider.prototype,{plugins:{},createRange:function(){this.rangeElement=A("
").addClass("ui-slider-range").css({position:"absolute"}).appendTo(this.element);this.updateRange()},updateRange:function(){var C=this.options.axis=="vertical"?"top":"left";var B=this.options.axis=="vertical"?"height":"width";this.rangeElement.css(C,parseInt(A(this.handle[0]).css(C),10)+this.handleSize(0,this.options.axis=="vertical"?2:1)/2);this.rangeElement.css(B,parseInt(A(this.handle[1]).css(C),10)-parseInt(A(this.handle[0]).css(C),10))},getRange:function(){return this.rangeElement?this.convertValue(parseInt(this.rangeElement.css(this.options.axis=="vertical"?"height":"width"),10)):null},ui:function(B){return{instance:this,options:this.options,handle:this.currentHandle,value:this.options.axis!="both"||!this.options.axis?Math.round(this.value(null,this.options.axis=="vertical"?2:1)):{x:Math.round(this.value(null,1)),y:Math.round(this.value(null,2))},range:this.getRange()}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.ui()]);this.element.triggerHandler(C=="slide"?C:"slide"+C,[B,this.ui()],this.options[C])},destroy:function(){this.element.removeClass("ui-slider ui-slider-disabled").removeData("slider").unbind(".slider");this.handle.removeMouseInteraction();this.generated&&this.generated.remove()},enable:function(){this.element.removeClass("ui-slider-disabled");this.disabled=false},disable:function(){this.element.addClass("ui-slider-disabled");this.disabled=true},focus:function(B,C){this.currentHandle=A(B).addClass("ui-slider-handle-active");if(C){this.currentHandle.parent()[0].focus()}},blur:function(B){A(B).removeClass("ui-slider-handle-active");if(this.currentHandle&&this.currentHandle[0]==B){this.previousHandle=this.currentHandle;this.currentHandle=null}},value:function(D,B){if(this.handle.length==1){this.currentHandle=this.handle}if(!B){B=this.options.axis=="vertical"?2:1}var C=((parseInt(A(D!=undefined&&D!==null?this.handle[D]||D:this.currentHandle).css(B==1?"left":"top"),10)/(this.actualSize[B==1?"width":"height"]-this.handleSize(null,B)))*this.options.realMax[B==1?"x":"y"])+this.options.min[B==1?"x":"y"];var E=this.options;if(E.stepping[B==1?"x":"y"]){C=Math.round(C/E.stepping[B==1?"x":"y"])*E.stepping[B==1?"x":"y"]}return C},convertValue:function(C,B){if(!B){B=this.options.axis=="vertical"?2:1}return this.options.min[B==1?"x":"y"]+(C/(this.actualSize[B==1?"width":"height"]-this.handleSize(null,B)))*this.options.realMax[B==1?"x":"y"]},translateValue:function(C,B){if(!B){B=this.options.axis=="vertical"?2:1}return((C-this.options.min[B==1?"x":"y"])/this.options.realMax[B==1?"x":"y"])*(this.actualSize[B==1?"width":"height"]-this.handleSize(null,B))},handleSize:function(C,B){if(!B){B=this.options.axis=="vertical"?2:1}return A(C!=undefined&&C!==null?this.handle[C]:this.currentHandle)[B==1?"outerWidth":"outerHeight"]()},click:function(C){var D=[C.pageX,C.pageY];var B=false;this.handle.each(function(){if(this==C.target){B=true}});if(B||this.disabled||!(this.currentHandle||this.previousHandle)){return }if(this.previousHandle){this.focus(this.previousHandle,1)}this.offset=this.element.offset();this.moveTo({y:this.convertValue(C.pageY-this.offset.top-this.currentHandle.outerHeight()/2),x:this.convertValue(C.pageX-this.offset.left-this.currentHandle.outerWidth()/2)},null,true)},start:function(C,B){var D=this.options;if(!this.currentHandle){this.focus(this.previousHandle,true)}this.offset=this.element.offset();this.handleOffset=this.currentHandle.offset();this.clickOffset={top:C.pageY-this.handleOffset.top,left:C.pageX-this.handleOffset.left};this.firstValue=this.value();this.propagate("start",C);return false},stop:function(B){this.propagate("stop",B);if(this.firstValue!=this.value()){this.propagate("change",B)}this.focus(this.currentHandle,true);return false},oneStep:function(B){if(!B){B=this.options.axis=="vertical"?2:1}return this.options.stepping[B==1?"x":"y"]?this.options.stepping[B==1?"x":"y"]:(this.options.realMax[B==1?"x":"y"]/this.actualSize[B==1?"width":"height"])*5},translateRange:function(D,B){if(this.rangeElement){if(this.currentHandle[0]==this.handle[0]&&D>=this.translateValue(this.value(1),B)){D=this.translateValue(this.value(1,B)-this.oneStep(B),B)}if(this.currentHandle[0]==this.handle[1]&&D<=this.translateValue(this.value(0),B)){D=this.translateValue(this.value(0,B)+this.oneStep(B))}}if(this.options.handles){var C=this.options.handles[this.handleIndex()];if(Dthis.translateValue(C.max,B)){D=this.translateValue(C.max,B)}}}return D},handleIndex:function(){return this.handle.index(this.currentHandle[0])},translateLimits:function(C,B){if(!B){B=this.options.axis=="vertical"?2:1}if(C>=this.actualSize[B==1?"width":"height"]-this.handleSize(null,B)){C=this.actualSize[B==1?"width":"height"]-this.handleSize(null,B)}if(C<=0){C=0}return C},drag:function(E,D){var F=this.options;var B={top:E.pageY-this.offset.top-this.clickOffset.top,left:E.pageX-this.offset.left-this.clickOffset.left};if(!this.currentHandle){this.focus(this.previousHandle,true)}B.left=this.translateLimits(B.left,1);B.top=this.translateLimits(B.top,2);if(F.stepping.x){var C=this.convertValue(B.left,1);C=Math.round(C/F.stepping.x)*F.stepping.x;B.left=this.translateValue(C,1)}if(F.stepping.y){var C=this.convertValue(B.top,2);C=Math.round(C/F.stepping.y)*F.stepping.y;B.top=this.translateValue(C,2)}B.left=this.translateRange(B.left,1);B.top=this.translateRange(B.top,2);if(F.axis!="vertical"){this.currentHandle.css({left:B.left})}if(F.axis!="horizontal"){this.currentHandle.css({top:B.top})}if(this.rangeElement){this.updateRange()}this.propagate("slide",E);return false},moveTo:function(F,E,G){var H=this.options;if(E==undefined&&!this.currentHandle&&this.handle.length!=1){return false}if(E==undefined&&!this.currentHandle){E=0}if(E!=undefined){this.currentHandle=this.previousHandle=A(this.handle[E]||E)}if(F.x!==undefined&&F.y!==undefined){var B=F.x;var I=F.y}else{var B=F,I=F}if(B&&B.constructor!=Number){var D=/^\-\=/.test(B),C=/^\+\=/.test(B);if(D){B=this.value(null,1)-parseInt(B.replace("-=",""),10)}else{if(C){B=this.value(null,1)+parseInt(B.replace("+=",""),10)}}}if(I&&I.constructor!=Number){var D=/^\-\=/.test(I),C=/^\+\=/.test(I);if(D){I=this.value(null,2)-parseInt(I.replace("-=",""),10)}else{if(C){I=this.value(null,2)+parseInt(I.replace("+=",""),10)}}}if(H.axis!="vertical"&&B){if(H.stepping.x){B=Math.round(B/H.stepping.x)*H.stepping.x}B=this.translateValue(B,1);B=this.translateLimits(B,1);B=this.translateRange(B,1);this.currentHandle.css({left:B})}if(H.axis!="horizontal"&&I){if(H.stepping.y){I=Math.round(I/H.stepping.y)*H.stepping.y}I=this.translateValue(I,2);I=this.translateLimits(I,2);I=this.translateRange(I,2);this.currentHandle.css({top:I})}if(this.rangeElement){this.updateRange()}if(!G){this.propagate("start",null);this.propagate("stop",null);this.propagate("change",null);this.propagate("slide",null)}}});A.ui.slider.defaults={handle:".ui-slider-handle"}})(jQuery);(function(A){A.fn.tabs=function(){var C=typeof arguments[0]=="string"&&arguments[0];var B=C&&Array.prototype.slice.call(arguments,1)||arguments;return C=="length"?A.data(this[0],"tabs").$tabs.length:this.each(function(){if(C){var D=A.data(this,"tabs");if(D){D[C].apply(D,B)}}else{new A.ui.tabs(this,B[0]||{})}})};A.ui.tabs=function(D,C){var B=this;this.options=A.extend({},A.ui.tabs.defaults,C);this.element=D;if(C.selected===null){this.options.selected=null}this.options.event+=".tabs";A(D).bind("setData.tabs",function(F,E,G){if((/^selected/).test(E)){B.select(G)}else{B.options[E]=G;B.tabify()}}).bind("getData.tabs",function(F,E){return B.options[E]});A.data(D,"tabs",this);this.tabify(true)};A.ui.tabs.defaults={selected:0,unselect:false,event:"click",disabled:[],cookie:null,spinner:"Loading…",cache:false,idPrefix:"ui-tabs-",ajaxOptions:{},fx:null,tabTemplate:'
  • #{label}
  • ',panelTemplate:"
    ",navClass:"ui-tabs-nav",selectedClass:"ui-tabs-selected",unselectClass:"ui-tabs-unselect",disabledClass:"ui-tabs-disabled",panelClass:"ui-tabs-panel",hideClass:"ui-tabs-hide",loadingClass:"ui-tabs-loading"};A.extend(A.ui.tabs.prototype,{tabId:function(B){return B.title&&B.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+A.data(B)},ui:function(C,B){return{instance:this,options:this.options,tab:C,panel:B}},tabify:function(N){this.$lis=A("li:has(a[href])",this.element);this.$tabs=this.$lis.map(function(){return A("a",this)[0]});this.$panels=A([]);var O=this,E=this.options;this.$tabs.each(function(Q,P){if(P.hash&&P.hash.replace("#","")){O.$panels=O.$panels.add(P.hash)}else{if(A(P).attr("href")!="#"){A.data(P,"href.tabs",P.href);A.data(P,"load.tabs",P.href);var S=O.tabId(P);P.href="#"+S;var R=A("#"+S);if(!R.length){R=A(E.panelTemplate).attr("id",S).addClass(E.panelClass).insertAfter(O.$panels[Q-1]||O.element);R.data("destroy.tabs",true)}O.$panels=O.$panels.add(R)}else{E.disabled.push(Q+1)}}});if(N){A(this.element).hasClass(E.navClass)||A(this.element).addClass(E.navClass);this.$panels.each(function(){var P=A(this);P.hasClass(E.panelClass)||P.addClass(E.panelClass)});this.$tabs.each(function(S,P){if(location.hash){if(P.hash==location.hash){E.selected=S;if(A.browser.msie||A.browser.opera){var R=A(location.hash),T=R.attr("id");R.attr("id","");setTimeout(function(){R.attr("id",T)},500)}scrollTo(0,0);return false}}else{if(E.cookie){var Q=parseInt(A.cookie("ui-tabs"+A.data(O.element)),10);if(Q&&O.$tabs[Q]){E.selected=Q;return false}}else{if(O.$lis.eq(S).hasClass(E.selectedClass)){E.selected=S;return false}}}});this.$panels.addClass(E.hideClass);this.$lis.removeClass(E.selectedClass);if(E.selected!==null){this.$panels.eq(E.selected).show().removeClass(E.hideClass);this.$lis.eq(E.selected).addClass(E.selectedClass)}var D=E.selected!==null&&A.data(this.$tabs[E.selected],"load.tabs");if(D){this.load(E.selected)}E.disabled=A.unique(E.disabled.concat(A.map(this.$lis.filter("."+E.disabledClass),function(Q,P){return O.$lis.index(Q)}))).sort();A(window).bind("unload",function(){O.$tabs.unbind(".tabs");O.$lis=O.$tabs=O.$panels=null})}for(var H=0,M;M=this.$lis[H];H++){A(M)[A.inArray(H,E.disabled)!=-1&&!A(M).hasClass(E.selectedClass)?"addClass":"removeClass"](E.disabledClass)}if(E.cache===false){this.$tabs.removeData("cache.tabs")}var C,J,B={"min-width":0,duration:1},F="normal";if(E.fx&&E.fx.constructor==Array){C=E.fx[0]||B,J=E.fx[1]||B}else{C=J=E.fx||B}var I={display:"",overflow:"",height:""};if(!A.browser.msie){I.opacity=""}function L(Q,P,R){P.animate(C,C.duration||F,function(){P.addClass(E.hideClass).css(I);if(A.browser.msie&&C.opacity){P[0].style.filter=""}if(R){K(Q,R,P)}})}function K(Q,R,P){if(J===B){R.css("display","block")}R.animate(J,J.duration||F,function(){R.removeClass(E.hideClass).css(I);if(A.browser.msie&&J.opacity){R[0].style.filter=""}A(O.element).triggerHandler("tabsshow",[O.ui(Q,R[0])],E.show)})}function G(Q,S,P,R){S.addClass(E.selectedClass).siblings().removeClass(E.selectedClass);L(Q,P,R)}this.$tabs.unbind(".tabs").bind(E.event,function(){var S=A(this).parents("li:eq(0)"),P=O.$panels.filter(":visible"),R=A(this.hash);if((S.hasClass(E.selectedClass)&&!E.unselect)||S.hasClass(E.disabledClass)||A(this).hasClass(E.loadingClass)||A(O.element).triggerHandler("tabsselect",[O.ui(this,R[0])],E.select)===false){this.blur();return false}O.options.selected=O.$tabs.index(this);if(E.unselect){if(S.hasClass(E.selectedClass)){O.options.selected=null;S.removeClass(E.selectedClass);O.$panels.stop();L(this,P);this.blur();return false}else{if(!P.length){O.$panels.stop();var Q=this;O.load(O.$tabs.index(this),function(){S.addClass(E.selectedClass).addClass(E.unselectClass);K(Q,R)});this.blur();return false}}}if(E.cookie){A.cookie("ui-tabs"+A.data(O.element),O.options.selected,E.cookie)}O.$panels.stop();if(R.length){var Q=this;O.load(O.$tabs.index(this),P.length?function(){G(Q,S,P,R)}:function(){S.addClass(E.selectedClass);K(Q,R)})}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(A.browser.msie){this.blur()}return false});if(!(/^click/).test(E.event)){this.$tabs.bind("click.tabs",function(){return false})}},add:function(E,D,C){if(C==undefined){C=this.$tabs.length}var G=this.options;var I=A(G.tabTemplate.replace(/#\{href\}/,E).replace(/#\{label\}/,D));I.data("destroy.tabs",true);var H=E.indexOf("#")==0?E.replace("#",""):this.tabId(A("a:first-child",I)[0]);var F=A("#"+H);if(!F.length){F=A(G.panelTemplate).attr("id",H).addClass(G.panelClass).addClass(G.hideClass);F.data("destroy.tabs",true)}if(C>=this.$lis.length){I.appendTo(this.element);F.appendTo(this.element.parentNode)}else{I.insertBefore(this.$lis[C]);F.insertBefore(this.$panels[C])}G.disabled=A.map(G.disabled,function(K,J){return K>=C?++K:K});this.tabify();if(this.$tabs.length==1){I.addClass(G.selectedClass);F.removeClass(G.hideClass);var B=A.data(this.$tabs[0],"load.tabs");if(B){this.load(C,B)}}A(this.element).triggerHandler("tabsadd",[this.ui(this.$tabs[C],this.$panels[C])],G.add)},remove:function(B){var D=this.options,E=this.$lis.eq(B).remove(),C=this.$panels.eq(B).remove();if(E.hasClass(D.selectedClass)&&this.$tabs.length>1){this.select(B+(B+1=B?--G:G});this.tabify();A(this.element).triggerHandler("tabsremove",[this.ui(E.find("a")[0],C[0])],D.remove)},enable:function(B){var C=this.options;if(A.inArray(B,C.disabled)==-1){return }var D=this.$lis.eq(B).removeClass(C.disabledClass);if(A.browser.safari){D.css("display","inline-block");setTimeout(function(){D.css("display","block")},0)}C.disabled=A.grep(C.disabled,function(F,E){return F!=B});A(this.element).triggerHandler("tabsenable",[this.ui(this.$tabs[B],this.$panels[B])],C.enable)},disable:function(C){var B=this,D=this.options;if(C!=D.selected){this.$lis.eq(C).addClass(D.disabledClass);D.disabled.push(C);D.disabled.sort();A(this.element).triggerHandler("tabsdisable",[this.ui(this.$tabs[C],this.$panels[C])],D.disable)}},select:function(B){if(typeof B=="string"){B=this.$tabs.index(this.$tabs.filter("[href$="+B+"]")[0])}this.$tabs.eq(B).trigger(this.options.event)},load:function(F,K){var L=this,C=this.options,D=this.$tabs.eq(F),J=D[0],G=K==undefined||K===false,B=D.data("load.tabs");K=K||function(){};if(!B||(A.data(J,"cache.tabs")&&!G)){K();return }if(C.spinner){var H=A("span",J);H.data("label.tabs",H.html()).html(""+C.spinner+"")}var I=function(){L.$tabs.filter("."+C.loadingClass).each(function(){A(this).removeClass(C.loadingClass);if(C.spinner){var M=A("span",this);M.html(M.data("label.tabs")).removeData("label.tabs")}});L.xhr=null};var E=A.extend({},C.ajaxOptions,{url:B,success:function(N,M){A(J.hash).html(N);I();K();if(C.cache){A.data(J,"cache.tabs",true)}A(L.element).triggerHandler("tabsload",[L.ui(L.$tabs[F],L.$panels[F])],C.load);C.ajaxOptions.success&&C.ajaxOptions.success(N,M)}});if(this.xhr){this.xhr.abort();I()}D.addClass(C.loadingClass);setTimeout(function(){L.xhr=A.ajax(E)},0)},url:function(C,B){this.$tabs.eq(C).removeData("cache.tabs").data("load.tabs",B)},destroy:function(){var B=this.options;A(this.element).unbind(".tabs").removeClass(B.navClass).removeData("tabs");this.$tabs.each(function(){var C=A.data(this,"href.tabs");if(C){this.href=C}var D=A(this).unbind(".tabs");A.each(["href","load","cache"],function(E,F){D.removeData(F+".tabs")})});this.$lis.add(this.$panels).each(function(){if(A.data(this,"destroy.tabs")){A(this).remove()}else{A(this).removeClass([B.selectedClass,B.unselectClass,B.disabledClass,B.panelClass,B.hideClass].join(" "))}})}});A.extend(A.ui.tabs.prototype,{rotation:null,rotate:function(C,F){F=F||false;var B=this,E=this.options.selected;function G(){B.rotation=setInterval(function(){E=++E')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},_register:function(inst){var id=this._nextId++;this._inst[id]=inst;return id},_getInst:function(id){return this._inst[id]||id},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var instSettings=(inlineSettings?$.extend(settings||{},inlineSettings||{}):settings);if(nodeName=="input"){var inst=(inst&&!inlineSettings?inst:new DatepickerInstance(instSettings,false));this._connectDatepicker(target,inst)}else{if(nodeName=="div"||nodeName=="span"){var inst=new DatepickerInstance(instSettings,true);this._inlineDatepicker(target,inst)}}},_destroyDatepicker:function(target){var nodeName=target.nodeName.toLowerCase();var calId=target._calId;target._calId=null;var $target=$(target);if(nodeName=="input"){$target.siblings(".datepicker_append").replaceWith("").end().siblings(".datepicker_trigger").replaceWith("").end().removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress);var wrapper=$target.parents(".datepicker_wrap");if(wrapper){wrapper.replaceWith(wrapper.html())}}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}if($("input[_calId="+calId+"]").length==0){this._inst[calId]=null}},_enableDatepicker:function(target){target.disabled=false;$(target).siblings("button.datepicker_trigger").each(function(){this.disabled=false}).end().siblings("img.datepicker_trigger").css({opacity:"1.0",cursor:""});this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){target.disabled=true;$(target).siblings("button.datepicker_trigger").each(function(){this.disabled=true}).end().siblings("img.datepicker_trigger").css({opacity:"0.5",cursor:"default"});this._disabledInputs=$.map($.datepicker._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[$.datepicker._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i-1)},_connectDatepicker:function(target,inst){var input=$(target);if(input.is("."+this.markerClassName)){return }var appendText=inst._get("appendText");var isRTL=inst._get("isRTL");if(appendText){if(isRTL){input.before(''+appendText)}else{input.after(''+appendText)}}var showOn=inst._get("showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){input.wrap('');var buttonText=inst._get("buttonText");var buttonImage=inst._get("buttonImage");var trigger=$(inst._get("buttonImageOnly")?$("").addClass("datepicker_trigger").attr({src:buttonImage,alt:buttonText,title:buttonText}):$("
    "}}html+=(showStatus?'
    '+(this._get("initStatus")||" ")+"
    ":"")+(!closeAtTop&&!this._inline?controls:"")+'
    '+($.browser.msie&&parseInt($.browser.version)<7&&!this._inline?'':"");return html},_generateMonthYearHeader:function(drawMonth,drawYear,minDate,maxDate,selectedDate,secondary){minDate=(this._rangeStart&&minDate&&selectedDate";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){html+='"}}html+=""}if(secondary||!this._get("changeYear")){html+=drawYear}else{var years=this._get("yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='"}html+="";return html},_addStatus:function(text){return" onmouseover=\"jQuery('#datepicker_status_"+this._id+"').html('"+text+"');\" onmouseout=\"jQuery('#datepicker_status_"+this._id+"').html(' ');\""},_adjustDate:function(offset,period){var year=this._drawYear+(period=="Y"?offset:0);var month=this._drawMonth+(period=="M"?offset:0);var day=Math.min(this._selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=new Date(year,month,day);var minDate=this._getMinMaxDate("min",true);var maxDate=this._getMinMaxDate("max");date=(minDate&&datemaxDate?maxDate:date);this._selectedDay=date.getDate();this._drawMonth=this._selectedMonth=date.getMonth();this._drawYear=this._selectedYear=date.getFullYear()},_getNumberOfMonths:function(){var numMonths=this._get("numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(minMax,checkRange){var date=this._determineDate(minMax+"Date",null);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return date||(checkRange?this._rangeStart:null)},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(offset,curYear,curMonth){var numMonths=this._getNumberOfMonths();var date=new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1);if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(date)},_isInRange:function(date){var newMinDate=(!this._rangeStart?null:new Date(this._selectedYear,this._selectedMonth,this._selectedDay));newMinDate=(newMinDate&&this._rangeStart=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(){var shortYearCutoff=this._get("shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get("dayNamesShort"),dayNames:this._get("dayNames"),monthNamesShort:this._get("monthNamesShort"),monthNames:this._get("monthNames")}},_formatDate:function(day,month,year){if(!day){this._currentDay=this._selectedDay;this._currentMonth=this._selectedMonth;this._currentYear=this._selectedYear}var date=(day?(typeof day=="object"?day:new Date(year,month,day)):new Date(this._currentYear,this._currentMonth,this._currentDay));return $.datepicker.formatDate(this._get("dateFormat"),date,this._getFormatConfig())}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null){target[name]=null}}return target}$.fn.datepicker=function(options){var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$(document).ready(function(){$(document.body).append($.datepicker._datepickerDiv).mousedown($.datepicker._checkExternalClick)});$.datepicker=new Datepicker()})(jQuery);