/* /\/\ -|- ]\[ */
(function(B){B.ui={plugin:{add:function(F,G,D){var E=B.ui[F].prototype;for(var H in D){E.plugins[H]=E.plugins[H]||[];
E.plugins[H].push([G,D[H]])}},call:function(G,E,F){var D=G.plugins[E];if(!D){return
}for(var H=0;H<D.length;H++){if(G.options[D[H][0]]){D[H][1].apply(G.element,F)}}}},cssCache:{},css:function(D){if(B.ui.cssCache[D]){return B.ui.cssCache[D]
}var E=B('<div class="ui-gen">').addClass(D).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");
B.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{B("body").get(0).removeChild(E.get(0))}catch(F){}return B.ui.cssCache[D]},disableSelection:function(D){B(D).attr("unselectable","on").css("MozUserSelect","none")
},enableSelection:function(D){B(D).attr("unselectable","off").css("MozUserSelect","")
},hasScroll:function(F,D){var E=/top/.test(D||"top")?"scrollTop":"scrollLeft",G=false;
if(F[E]>0){return true}F[E]=1;G=F[E]>0?true:false;F[E]=0;return G}};var A=B.fn.remove;
B.fn.remove=function(){B("*",this).add(this).triggerHandler("remove");return A.apply(this,arguments)
};function C(D,G,E){var F=B[D][G].getter||[];F=(typeof F=="string"?F.split(/,?\s+/):F);
return(B.inArray(E,F)!=-1)}B.widget=function(E,F){var D=E.split(".")[0];E=E.split(".")[1];
B.fn[E]=function(J){var H=(typeof J=="string"),G=Array.prototype.slice.call(arguments,1);
if(H&&C(D,E,J)){var I=B.data(this[0],E);return(I?I[J].apply(I,G):undefined)}return this.each(function(){var K=B.data(this,E);
if(H&&K&&B.isFunction(K[J])){K[J].apply(K,G)}else{if(!H){B.data(this,E,new B[D][E](this,J))
}}})};B[D][E]=function(H,I){var G=this;this.widgetName=E;this.widgetBaseClass=D+"-"+E;
this.options=B.extend({},B.widget.defaults,B[D][E].defaults,I);this.element=B(H).bind("setData."+E,function(L,K,J){return G.setData(K,J)
}).bind("getData."+E,function(K,J){return G.getData(J)}).bind("remove",function(){return G.destroy()
});this.init()};B[D][E].prototype=B.extend({},B.widget.prototype,F)};B.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)
},getData:function(D){return this.options[D]},setData:function(E,D){this.options[E]=D;
if(E=="disabled"){this.element[D?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")
}},enable:function(){this.setData("disabled",false)},disable:function(){this.setData("disabled",true)
}};B.widget.defaults={disabled:false};B.ui.mouse={mouseInit:function(){var D=this;
this.element.bind("mousedown."+this.widgetName,function(E){return D.mouseDown(E)});
if(B.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")
}this.started=false},mouseDestroy:function(){this.element.unbind("."+this.widgetName);
(B.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},mouseDown:function(F){(this._mouseStarted&&this.mouseUp(F));
this._mouseDownEvent=F;var E=this,D=(F.which==1),G=(typeof this.options.cancel=="string"?B(F.target).parents().add(F.target).filter(this.options.cancel).length:false);
if(!D||G||!this.mouseCapture(F)){return true}this._mouseDelayMet=!this.options.delay;
if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){E._mouseDelayMet=true
},this.options.delay)}if(this.mouseDistanceMet(F)&&this.mouseDelayMet(F)){this._mouseStarted=(this.mouseStart(F)!==false);
if(!this._mouseStarted){F.preventDefault();return true}}this._mouseMoveDelegate=function(H){return E.mouseMove(H)
};this._mouseUpDelegate=function(H){return E.mouseUp(H)};B(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);
return false},mouseMove:function(D){if(B.browser.msie&&!D.button){return this.mouseUp(D)
}if(this._mouseStarted){this.mouseDrag(D);return false}if(this.mouseDistanceMet(D)&&this.mouseDelayMet(D)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,D)!==false);
(this._mouseStarted?this.mouseDrag(D):this.mouseUp(D))}return !this._mouseStarted
},mouseUp:function(D){B(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);
if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(D)}return false},mouseDistanceMet:function(D){return(Math.max(Math.abs(this._mouseDownEvent.pageX-D.pageX),Math.abs(this._mouseDownEvent.pageY-D.pageY))>=this.options.distance)
},mouseDelayMet:function(D){return this._mouseDelayMet},mouseStart:function(D){},mouseDrag:function(D){},mouseStop:function(D){},mouseCapture:function(D){return true
}};B.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(A){A.widget("ui.draggable",A.extend({},A.ui.mouse,{init:function(){var B=this.options;
if(B.helper=="original"&&!(/(relative|absolute|fixed)/).test(this.element.css("position"))){this.element.css("position","relative")
}this.element.addClass("ui-draggable");(B.disabled&&this.element.addClass("ui-draggable-disabled"));
this.mouseInit()},mouseStart:function(F){var B=this.options;if(this.helper||B.disabled||A(F.target).is(".ui-resizable-handle")){return false
}var H=!this.options.handle||!A(this.options.handle,this.element).length?true:false;
A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==F.target){H=true
}});if(!H){return false}if(A.ui.ddmanager){A.ui.ddmanager.current=this}this.helper=A.isFunction(B.helper)?A(B.helper.apply(this.element[0],[F])):(B.helper=="clone"?this.element.clone():this.element);
if(!this.helper.parents("body").length){this.helper.appendTo((B.appendTo=="parent"?this.element[0].parentNode:B.appendTo))
}if(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:F.pageX-this.offset.left,top:F.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();
var G=this.offsetParent.offset();if(this.offsetParent[0]==document.body&&A.browser.mozilla){G={top:0,left:0}
}this.offset.parent={top:G.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:G.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};
var C=this.element.position();this.offset.relative=this.cssPosition=="relative"?{top:C.top-(parseInt(this.helper.css("top"),10)||0)+this.offsetParent[0].scrollTop,left:C.left-(parseInt(this.helper.css("left"),10)||0)+this.offsetParent[0].scrollLeft}:{top:0,left:0};
this.originalPosition=this.generatePosition(F);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+this.margins.left
}if(B.cursorAt.right!=undefined){this.offset.click.left=this.helperProportions.width-B.cursorAt.right+this.margins.left
}if(B.cursorAt.top!=undefined){this.offset.click.top=B.cursorAt.top+this.margins.top
}if(B.cursorAt.bottom!=undefined){this.offset.click.top=this.helperProportions.height-B.cursorAt.bottom+this.margins.top
}}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.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(B.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),(A(B.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(B.containment)){var E=A(B.containment)[0];
var D=A(B.containment).offset();this.containment=[D.left+(parseInt(A(E).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left,D.top+(parseInt(A(E).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top,D.left+Math.max(E.scrollWidth,E.offsetWidth)-(parseInt(A(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),D.top+Math.max(E.scrollHeight,E.offsetHeight)-(parseInt(A(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",F);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};
if(A.ui.ddmanager&&!B.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,F)}this.helper.addClass("ui-draggable-dragging");
this.mouseDrag(F);return true},convertPositionTo:function(C,B){if(!B){B=this.position
}var D=C=="absolute"?1:-1;return{top:(B.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"?A(document).scrollTop():0)*D+this.margins.top*D),left:(B.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"?A(document).scrollLeft():0)*D+this.margins.left*D)}
},generatePosition:function(E){var B=this.options;var F={top:(E.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"?A(document).scrollTop():0)),left:(E.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"?A(document).scrollLeft():0))};
if(!this.originalPosition){return F}if(this.containment){if(F.left<this.containment[0]){F.left=this.containment[0]
}if(F.top<this.containment[1]){F.top=this.containment[1]}if(F.left>this.containment[2]){F.left=this.containment[2]
}if(F.top>this.containment[3]){F.top=this.containment[3]}}if(B.grid){var C=this.originalPosition.top+Math.round((F.top-this.originalPosition.top)/B.grid[1])*B.grid[1];
F.top=this.containment?(!(C<this.containment[1]||C>this.containment[3])?C:(!(C<this.containment[1])?C-B.grid[1]:C+B.grid[1])):C;
var D=this.originalPosition.left+Math.round((F.left-this.originalPosition.left)/B.grid[0])*B.grid[0];
F.left=this.containment?(!(D<this.containment[0]||D>this.containment[2])?D:(!(D<this.containment[0])?D-B.grid[0]:D+B.grid[0])):D
}return F},mouseDrag:function(B){this.position=this.generatePosition(B);this.positionAbs=this.convertPositionTo("absolute");
this.position=this.propagate("drag",B)||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"
}if(A.ui.ddmanager){A.ui.ddmanager.drag(this,B)}return false},mouseStop:function(C){var D=false;
if(A.ui.ddmanager&&!this.options.dropBehaviour){var D=A.ui.ddmanager.drop(this,C)
}if((this.options.revert=="invalid"&&!D)||(this.options.revert=="valid"&&D)||this.options.revert===true){var B=this;
A(this.helper).animate(this.originalPosition,parseInt(this.options.revert,10)||500,function(){B.propagate("stop",C);
B.clear()})}else{this.propagate("stop",C);this.clear()}return false},clear:function(){this.helper.removeClass("ui-draggable-dragging");
if(this.options.helper!="original"&&!this.cancelHelperRemoval){this.helper.remove()
}this.helper=null;this.cancelHelperRemoval=false},plugins:{},uiHash:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options}
},propagate:function(B,C){A.ui.plugin.call(this,B,[C,this.uiHash()]);if(B=="drag"){this.positionAbs=this.convertPositionTo("absolute")
}return this.element.triggerHandler(B=="drag"?B:"drag"+B,[C,this.uiHash()],this.options[B])
},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable");
this.mouseDestroy()}}));A.extend(A.ui.draggable,{defaults:{appendTo:"parent",axis:false,cancel:":input",delay:0,distance:1,helper:"original"}});
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","iframeFix",{start:function(C,B){A(B.options.iframeFix===true?"iframe":B.options.iframeFix).each(function(){A('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body")
})},stop:function(C,B){A("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this)
})}});A.ui.plugin.add("draggable","scroll",{start:function(E,C){var B=C.options;var D=A(this).data("draggable");
B.scrollSensitivity=B.scrollSensitivity||20;B.scrollSpeed=B.scrollSpeed||20;D.overflowY=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-y"))){return F
}F=F.parent()}while(F[0].parentNode);return A(document)}(this);D.overflowX=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-x"))){return F
}F=F.parent()}while(F[0].parentNode);return A(document)}(this);if(D.overflowY[0]!=document&&D.overflowY[0].tagName!="HTML"){D.overflowYOffset=D.overflowY.offset()
}if(D.overflowX[0]!=document&&D.overflowX[0].tagName!="HTML"){D.overflowXOffset=D.overflowX.offset()
}},drag:function(E,C){var B=C.options;var D=A(this).data("draggable");if(D.overflowY[0]!=document&&D.overflowY[0].tagName!="HTML"){if((D.overflowYOffset.top+D.overflowY[0].offsetHeight)-E.pageY<B.scrollSensitivity){D.overflowY[0].scrollTop=D.overflowY[0].scrollTop+B.scrollSpeed
}if(E.pageY-D.overflowYOffset.top<B.scrollSensitivity){D.overflowY[0].scrollTop=D.overflowY[0].scrollTop-B.scrollSpeed
}}else{if(E.pageY-A(document).scrollTop()<B.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()-B.scrollSpeed)
}if(A(window).height()-(E.pageY-A(document).scrollTop())<B.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()+B.scrollSpeed)
}}if(D.overflowX[0]!=document&&D.overflowX[0].tagName!="HTML"){if((D.overflowXOffset.left+D.overflowX[0].offsetWidth)-E.pageX<B.scrollSensitivity){D.overflowX[0].scrollLeft=D.overflowX[0].scrollLeft+B.scrollSpeed
}if(E.pageX-D.overflowXOffset.left<B.scrollSensitivity){D.overflowX[0].scrollLeft=D.overflowX[0].scrollLeft-B.scrollSpeed
}}else{if(E.pageX-A(document).scrollLeft()<B.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()-B.scrollSpeed)
}if(A(window).width()-(E.pageX-A(document).scrollLeft())<B.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()+B.scrollSpeed)
}}}});A.ui.plugin.add("draggable","snap",{start:function(D,C){var B=A(this).data("draggable");
B.snapElements=[];A(C.options.snap===true?".ui-draggable":C.options.snap).each(function(){var F=A(this);
var E=F.offset();if(this!=B.element[0]){B.snapElements.push({item:this,width:F.outerWidth(),height:F.outerHeight(),top:E.top,left:E.left})
}})},drag:function(N,G){var R=A(this).data("draggable");var M=G.options.snapTolerance||20;
var J=G.absolutePosition.left,O=J+R.helperProportions.width,K=G.absolutePosition.top,P=K+R.helperProportions.height;
for(var H=R.snapElements.length-1;H>=0;H--){var I=R.snapElements[H].left,D=I+R.snapElements[H].width,E=R.snapElements[H].top,L=E+R.snapElements[H].height;
if(!((I-M<J&&J<D+M&&E-M<K&&K<L+M)||(I-M<J&&J<D+M&&E-M<P&&P<L+M)||(I-M<O&&O<D+M&&E-M<K&&K<L+M)||(I-M<O&&O<D+M&&E-M<P&&P<L+M))){continue
}if(G.options.snapMode!="inner"){var B=Math.abs(E-P)<=20;var F=Math.abs(L-K)<=20;
var C=Math.abs(I-O)<=20;var Q=Math.abs(D-J)<=20;if(B){G.position.top=R.convertPositionTo("relative",{top:E-R.helperProportions.height,left:0}).top
}if(F){G.position.top=R.convertPositionTo("relative",{top:L,left:0}).top}if(C){G.position.left=R.convertPositionTo("relative",{top:0,left:I-R.helperProportions.width}).left
}if(Q){G.position.left=R.convertPositionTo("relative",{top:0,left:D}).left}}if(G.options.snapMode!="outer"){var B=Math.abs(E-K)<=20;
var F=Math.abs(L-P)<=20;var C=Math.abs(I-J)<=20;var Q=Math.abs(D-O)<=20;if(B){G.position.top=R.convertPositionTo("relative",{top:E,left:0}).top
}if(F){G.position.top=R.convertPositionTo("relative",{top:L-R.helperProportions.height,left:0}).top
}if(C){G.position.left=R.convertPositionTo("relative",{top:0,left:I}).left}if(Q){G.position.left=R.convertPositionTo("relative",{top:0,left:D-R.helperProportions.width}).left
}}}}});A.ui.plugin.add("draggable","connectToSortable",{start:function(D,C){var B=A(this).data("draggable");
B.sortables=[];A(C.options.connectToSortable).each(function(){if(A.data(this,"sortable")){var E=A.data(this,"sortable");
B.sortables.push({instance:E,shouldRevert:E.options.revert});E.refreshItems();E.propagate("activate",D,B)
}})},stop:function(D,C){var B=A(this).data("draggable");A.each(B.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;
B.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true
}this.instance.mouseStop(D);this.instance.element.triggerHandler("sortreceive",[D,A.extend(this.instance.ui(),{sender:B.element})],this.instance.options["receive"]);
this.instance.options.helper=this.instance.options._helper}else{this.instance.propagate("deactivate",D,B)
}})},drag:function(F,C){var B=A(this).data("draggable"),E=this;var D=function(H){var K=H.left,G=K+H.width,J=H.top,I=J+H.height;
return(K<(this.positionAbs.left+this.offset.click.left)&&(this.positionAbs.left+this.offset.click.left)<G&&J<(this.positionAbs.top+this.offset.click.top)&&(this.positionAbs.top+this.offset.click.top)<I)
};A.each(B.sortables,function(G){if(D.call(B,this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;
this.instance.currentItem=A(E).clone().appendTo(this.instance.element).data("sortable-item",true);
this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return C.helper[0]
};F.target=this.instance.currentItem[0];this.instance.mouseCapture(F,true);this.instance.mouseStart(F,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",F)}if(this.instance.currentItem){this.instance.mouseDrag(F)
}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;
this.instance.options.revert=false;this.instance.mouseStop(F,true);this.instance.options.helper=this.instance.options._helper;
this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()
}B.propagate("fromSortable",F)}}})}});A.ui.plugin.add("draggable","stack",{start:function(D,C){var B=A.makeArray(A(C.options.stack.group)).sort(function(E,F){return(parseInt(A(E).css("zIndex"),10)||C.options.stack.min)-(parseInt(A(F).css("zIndex"),10)||C.options.stack.min)
});A(B).each(function(E){this.style.zIndex=C.options.stack.min+E});this[0].style.zIndex=C.options.stack.min+B.length
}})})(jQuery);(function(A){A.fn.unwrap=A.fn.unwrap||function(B){return this.each(function(){A(this).parents(B).eq(0).after(this).remove()
})};A.widget("ui.slider",{plugins:{},ui:function(B){return{options:this.options,handle:this.currentHandle,value:this.options.axis!="both"||!this.options.axis?Math.round(this.value(null,this.options.axis=="vertical"?"y":"x")):{x:Math.round(this.value(null,"x")),y:Math.round(this.value(null,"y"))},range:this.getRange()}
},propagate:function(B,C){A.ui.plugin.call(this,B,[C,this.ui()]);this.element.triggerHandler(B=="slide"?B:"slide"+B,[C,this.ui()],this.options[B])
},destroy:function(){this.element.removeClass("ui-slider ui-slider-disabled").removeData("slider").unbind(".slider");
if(this.handle&&this.handle.length){this.handle.unwrap("a");this.handle.each(function(){A(this).data("mouse").mouseDestroy()
})}this.generated&&this.generated.remove()},setData:function(C,B){A.widget.prototype.setData.apply(this,arguments);
if(/min|max|steps/.test(C)){this.initBoundaries()}if(C=="range"){B?this.handle.length==2&&this.createRange():this.removeRange()
}},init:function(){var C=this;this.element.addClass("ui-slider");this.initBoundaries();
this.handle=A(this.options.handle,this.element);if(!this.handle.length){C.handle=C.generated=A(C.options.handles||[0]).map(function(){var D=A("<div/>").addClass("ui-slider-handle").appendTo(C.element);
if(this.id){D.attr("id",this.id)}return D[0]})}var B=function(D){this.element=A(D);
this.element.data("mouse",this);this.options=C.options;this.element.bind("mousedown",function(){if(C.currentHandle){this.blur(C.currentHandle)
}C.focus(this,1)});this.mouseInit()};A.extend(B.prototype,A.ui.mouse,{mouseStart:function(D){return C.start.call(C,D,this.element[0])
},mouseStop:function(D){return C.stop.call(C,D,this.element[0])},mouseDrag:function(D){return C.drag.call(C,D,this.element[0])
},mouseCapture:function(){return true},trigger:function(D){this.mouseDown(D)}});A(this.handle).each(function(){new B(this)
}).wrap('<a href="javascript:void(0)" style="outline:none;border:none;"></a>').parent().bind("focus",function(D){C.focus(this.firstChild)
}).bind("blur",function(D){C.blur(this.firstChild)}).bind("keydown",function(D){if(!C.options.noKeyboard){C.keydown(D.keyCode,this.firstChild)
}});this.element.bind("mousedown.slider",function(D){C.click.apply(C,[D]);C.currentHandle.data("mouse").trigger(D);
C.firstValue=C.firstValue+1});A.each(this.options.handles||[],function(D,E){C.moveTo(E.start,D,true)
});if(!isNaN(this.options.startValue)){this.moveTo(this.options.startValue,0,true)
}this.previousHandle=A(this.handle[0]);if(this.handle.length==2&&this.options.range){this.createRange()
}},initBoundaries:function(){var C=this.element[0],B=this.options;this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};
A.extend(B,{axis:B.axis||(C.offsetWidth<C.offsetHeight?"vertical":"horizontal"),max:!isNaN(parseInt(B.max,10))?{x:parseInt(B.max,10),y:parseInt(B.max,10)}:({x:B.max&&B.max.x||100,y:B.max&&B.max.y||100}),min:!isNaN(parseInt(B.min,10))?{x:parseInt(B.min,10),y:parseInt(B.min,10)}:({x:B.min&&B.min.x||0,y:B.min&&B.min.y||0})});
B.realMax={x:B.max.x-B.min.x,y:B.max.y-B.min.y};B.stepping={x:B.stepping&&B.stepping.x||parseInt(B.stepping,10)||(B.steps?B.realMax.x/(B.steps.x||parseInt(B.steps,10)||B.realMax.x):0),y:B.stepping&&B.stepping.y||parseInt(B.stepping,10)||(B.steps?B.realMax.y/(B.steps.y||parseInt(B.steps,10)||B.realMax.y):0)}
},keydown:function(B,C){if(/(37|38|39|40)/.test(B)){this.moveTo({x:/(37|39)/.test(B)?(B==37?"-":"+")+"="+this.oneStep("x"):0,y:/(38|40)/.test(B)?(B==38?"-":"+")+"="+this.oneStep("y"):0},C)
}},focus:function(C,B){this.currentHandle=A(C).addClass("ui-slider-handle-active");
if(B){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}},click:function(C){var B=[C.pageX,C.pageY];var D=false;this.handle.each(function(){if(this==C.target){D=true
}});if(D||this.options.disabled||!(this.currentHandle||this.previousHandle)){return
}if(!this.currentHandle&&this.previousHandle){this.focus(this.previousHandle,true)
}this.offset=this.element.offset();this.moveTo({y:this.convertValue(C.pageY-this.offset.top-this.currentHandle[0].offsetHeight/2,"y"),x:this.convertValue(C.pageX-this.offset.left-this.currentHandle[0].offsetWidth/2,"x")},null,!this.options.distance)
},createRange:function(){if(this.rangeElement){return}this.rangeElement=A("<div></div>").addClass("ui-slider-range").css({position:"absolute"}).appendTo(this.element);
this.updateRange()},removeRange:function(){this.rangeElement.remove();this.rangeElement=null
},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)||0)+this.handleSize(0,this.options.axis=="vertical"?"y":"x")/2);
this.rangeElement.css(B,(parseInt(A(this.handle[1]).css(C),10)||0)-(parseInt(A(this.handle[0]).css(C),10)||0))
},getRange:function(){return this.rangeElement?this.convertValue(parseInt(this.rangeElement.css(this.options.axis=="vertical"?"height":"width"),10),this.options.axis=="vertical"?"y":"x"):null
},handleIndex:function(){return this.handle.index(this.currentHandle[0])},value:function(D,C){if(this.handle.length==1){this.currentHandle=this.handle
}if(!C){C=this.options.axis=="vertical"?"y":"x"}var B=A(D!=undefined&&D!==null?this.handle[D]||D:this.currentHandle);
if(B.data("mouse").sliderValue){return parseInt(B.data("mouse").sliderValue[C],10)
}else{return parseInt(((parseInt(B.css(C=="x"?"left":"top"),10)/(this.actualSize[C=="x"?"width":"height"]-this.handleSize(D,C)))*this.options.realMax[C])+this.options.min[C],10)
}},convertValue:function(B,C){return this.options.min[C]+(B/(this.actualSize[C=="x"?"width":"height"]-this.handleSize(null,C)))*this.options.realMax[C]
},translateValue:function(B,C){return((B-this.options.min[C])/this.options.realMax[C])*(this.actualSize[C=="x"?"width":"height"]-this.handleSize(null,C))
},translateRange:function(B,C){if(this.rangeElement){if(this.currentHandle[0]==this.handle[0]&&B>=this.translateValue(this.value(1),C)){B=this.translateValue(this.value(1,C)-this.oneStep(C),C)
}if(this.currentHandle[0]==this.handle[1]&&B<=this.translateValue(this.value(0),C)){B=this.translateValue(this.value(0,C)+this.oneStep(C),C)
}}if(this.options.handles){var D=this.options.handles[this.handleIndex()];if(B<this.translateValue(D.min,C)){B=this.translateValue(D.min,C)
}else{if(B>this.translateValue(D.max,C)){B=this.translateValue(D.max,C)}}}return B
},translateLimits:function(B,C){if(B>=this.actualSize[C=="x"?"width":"height"]-this.handleSize(null,C)){B=this.actualSize[C=="x"?"width":"height"]-this.handleSize(null,C)
}if(B<=0){B=0}return B},handleSize:function(C,B){return A(C!=undefined&&C!==null?this.handle[C]:this.currentHandle)[0]["offset"+(B=="x"?"Width":"Height")]
},oneStep:function(B){return this.options.stepping[B]||1},start:function(C,D){var B=this.options;
if(B.disabled){return false}this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};
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);this.drag(C,D);return true
},stop:function(B){this.propagate("stop",B);if(this.firstValue!=this.value()){this.propagate("change",B)
}this.focus(this.currentHandle,true);return false},drag:function(D,F){var C=this.options;
var E={top:D.pageY-this.offset.top-this.clickOffset.top,left:D.pageX-this.offset.left-this.clickOffset.left};
if(!this.currentHandle){this.focus(this.previousHandle,true)}E.left=this.translateLimits(E.left,"x");
E.top=this.translateLimits(E.top,"y");if(C.stepping.x){var B=this.convertValue(E.left,"x");
B=Math.round(B/C.stepping.x)*C.stepping.x;E.left=this.translateValue(B,"x")}if(C.stepping.y){var B=this.convertValue(E.top,"y");
B=Math.round(B/C.stepping.y)*C.stepping.y;E.top=this.translateValue(B,"y")}E.left=this.translateRange(E.left,"x");
E.top=this.translateRange(E.top,"y");if(C.axis!="vertical"){this.currentHandle.css({left:E.left})
}if(C.axis!="horizontal"){this.currentHandle.css({top:E.top})}this.currentHandle.data("mouse").sliderValue={x:Math.round(this.convertValue(E.left,"x"))||0,y:Math.round(this.convertValue(E.top,"y"))||0};
if(this.rangeElement){this.updateRange()}this.propagate("slide",D);return false},moveTo:function(F,G,I){var D=this.options;
this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};
if(G==undefined&&!this.currentHandle&&this.handle.length!=1){return false}if(G==undefined&&!this.currentHandle){G=0
}if(G!=undefined){this.currentHandle=this.previousHandle=A(this.handle[G]||G)}if(F.x!==undefined&&F.y!==undefined){var B=F.x,E=F.y
}else{var B=F,E=F}if(B!==undefined&&B.constructor!=Number){var H=/^\-\=/.test(B),C=/^\+\=/.test(B);
if(H||C){B=this.value(null,"x")+parseInt(B.replace(H?"=":"+=",""),10)}else{B=isNaN(parseInt(B,10))?undefined:parseInt(B,10)
}}if(E!==undefined&&E.constructor!=Number){var H=/^\-\=/.test(E),C=/^\+\=/.test(E);
if(H||C){E=this.value(null,"y")+parseInt(E.replace(H?"=":"+=",""),10)}else{E=isNaN(parseInt(E,10))?undefined:parseInt(E,10)
}}if(D.axis!="vertical"&&B!==undefined){if(D.stepping.x){B=Math.round(B/D.stepping.x)*D.stepping.x
}B=this.translateValue(B,"x");B=this.translateLimits(B,"x");B=this.translateRange(B,"x");
D.animate?this.currentHandle.stop().animate({left:B},(Math.abs(parseInt(this.currentHandle.css("left"))-B))*(!isNaN(parseInt(D.animate))?D.animate:5)):this.currentHandle.css({left:B})
}if(D.axis!="horizontal"&&E!==undefined){if(D.stepping.y){E=Math.round(E/D.stepping.y)*D.stepping.y
}E=this.translateValue(E,"y");E=this.translateLimits(E,"y");E=this.translateRange(E,"y");
D.animate?this.currentHandle.stop().animate({top:E},(Math.abs(parseInt(this.currentHandle.css("top"))-E))*(!isNaN(parseInt(D.animate))?D.animate:5)):this.currentHandle.css({top:E})
}if(this.rangeElement){this.updateRange()}this.currentHandle.data("mouse").sliderValue={x:Math.round(this.convertValue(B,"x"))||0,y:Math.round(this.convertValue(E,"y"))||0};
if(!I){this.propagate("start",null);this.propagate("stop",null);this.propagate("change",null);
this.propagate("slide",null)}}});A.ui.slider.getter="value";A.ui.slider.defaults={handle:".ui-slider-handle",distance:1,animate:false}
})(jQuery);