﻿Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit._SliderDragDropManagerInternal=function(){AjaxControlToolkit._SliderDragDropManagerInternal.initializeBase(this);this._instance=null};AjaxControlToolkit._SliderDragDropManagerInternal.prototype={_getInstance:function(){var a=this;a._instance=new AjaxControlToolkit.GenericDragDropManager;a._instance.initialize();a._instance.add_dragStart(Function.createDelegate(a,a._raiseDragStart));a._instance.add_dragStop(Function.createDelegate(a,a._raiseDragStop));return a._instance}};AjaxControlToolkit._SliderDragDropManagerInternal.registerClass("AjaxControlToolkit._SliderDragDropManagerInternal",AjaxControlToolkit._DragDropManager);AjaxControlToolkit.SliderDragDropManagerInternal=new AjaxControlToolkit._SliderDragDropManagerInternal;AjaxControlToolkit.SliderOrientation=function(){};AjaxControlToolkit.SliderOrientation.prototype={Horizontal:0,Vertical:1};AjaxControlToolkit.SliderOrientation.registerEnum("AjaxControlToolkit.SliderOrientation",false);AjaxControlToolkit.SliderBehavior=function(d){var c=false,b=null,a=this;AjaxControlToolkit.SliderBehavior.initializeBase(a,[d]);a._minimum=0;a._maximum=100;a._value=b;a._steps=0;a._decimals=0;a._orientation=AjaxControlToolkit.SliderOrientation.Horizontal;a._railElement=b;a._railCssClass=b;a._isHorizontal=true;a._isUpdatingInternal=c;a._isInitializedInternal=c;a._enableHandleAnimation=c;a._handle=b;a._handleImage=b;a._handleAnimation=b;a._handleAnimationDuration=.1;a._handleImageUrl=b;a._handleCssClass=b;a._dragHandle=b;a._mouseupHandler=b;a._selectstartHandler=b;a._boundControlChangeHandler=b;a._boundControlKeyPressHandler=b;a._boundControlID=b;a._boundControl=b;a._length=b;a._raiseChangeOnlyOnMouseUp=true;a._animationPending=c;a._selectstartPending=c;a._tooltipText=""};AjaxControlToolkit.SliderBehavior.prototype={initialize:function(){AjaxControlToolkit.SliderBehavior.callBaseMethod(this,"initialize");this._initializeLayout()},dispose:function(){var a=this;a._disposeHandlers();a._disposeBoundControl();if(a._enableHandleAnimation&&a._handleAnimation)a._handleAnimation.dispose();AjaxControlToolkit.SliderBehavior.callBaseMethod(a,"dispose")},_initializeLayout:function(){var a=this;a._railElement=document.createElement("DIV");a._railElement.id=a.get_id()+"_railElement";a._railElement.tabIndex=-1;a._railElement.innerHTML="<div></div>";a._handle=a._railElement.childNodes[0];a._handle.style.overflow="hidden";a._handle.style.position="absolute";if(Sys.Browser.agent==Sys.Browser.Opera){a._handle.style.left="0px";a._handle.style.top="0px"}var b=a.get_element(),f=$common.getBounds(b);b.parentNode.insertBefore(a._railElement,b);b.style.display="none";a._isHorizontal=a._orientation==AjaxControlToolkit.SliderOrientation.Horizontal;var e=a._isHorizontal?"ajax__slider_h_rail":"ajax__slider_v_rail",c=a._isHorizontal?"ajax__slider_h_handle":"ajax__slider_v_handle",d=a._isHorizontal?'WebResource.axd?d=5qXbHgmWCipl6h53ABb5zHTAlOd2Hfv9D_8yr_w4J-5qtZM4sCFpgzEPl5877RDzh5bKsafxstghbFo-QNAmC_i-ygpi-9IWHvqZt30I2Vo1&t=633833483690937176':'WebResource.axd?d=5qXbHgmWCipl6h53ABb5zHTAlOd2Hfv9D_8yr_w4J-5qtZM4sCFpgzEPl5877RDz1KZkvP2u0ZqRmnBixhLYLotKVYifN7fh4ZzsOsdhvx81&t=633833483690937176';a._railElement.className=a._railCssClass?a._railCssClass:e;a._handle.className=a._handleCssClass?a._handleCssClass:c;if(!a._handleImageUrl)a._handleImageUrl=d;if(a._isHorizontal){if(a._length)a._railElement.style.width=a._length}else if(a._length)a._railElement.style.height=a._length;a._loadHandleImage();a._enforceTextBoxElementPositioning();a._initializeSlider()},_enforceTextBoxElementPositioning:function(){var b=this,a={position:b.get_element().style.position,top:b.get_element().style.top,right:b.get_element().style.right,bottom:b.get_element().style.bottom,left:b.get_element().style.left};if(a.position!="")b._railElement.style.position=a.position;if(a.top!="")b._railElement.style.top=a.top;if(a.right!="")b._railElement.style.right=a.right;if(a.bottom!="")b._railElement.style.bottom=a.bottom;if(a.left!="")b._railElement.style.left=a.left},_loadHandleImage:function(){var a=this;a._handleImage=document.createElement("IMG");a._handleImage.id=a.get_id()+"_handleImage";a._handle.appendChild(a._handleImage);a._handleImage.src=a._handleImageUrl},_initializeSlider:function(){var a=this;a._initializeBoundControl();var b;try{b=parseFloat(a.get_element().value)}catch(c){b=Number.NaN}a.set_Value(b);a._setHandleOffset(a._value);a._initializeDragHandle();AjaxControlToolkit.SliderDragDropManagerInternal.registerDropTarget(a);a._initializeHandlers();a._initializeHandleAnimation();a._isInitializedInternal=true;a._raiseEvent("sliderInitialized")},_initializeBoundControl:function(){var a=this;if(a._boundControl){var b=a._boundControl.nodeName=="INPUT";if(b){a._boundControlChangeHandler=Function.createDelegate(a,a._onBoundControlChange);a._boundControlKeyPressHandler=Function.createDelegate(a,a._onBoundControlKeyPress);$addHandler(a._boundControl,"change",a._boundControlChangeHandler);$addHandler(a._boundControl,"keypress",a._boundControlKeyPressHandler)}}},_disposeBoundControl:function(){var a=this;if(a._boundControl){var b=a._boundControl.nodeName=="INPUT";if(b){$removeHandler(a._boundControl,"change",a._boundControlChangeHandler);$removeHandler(a._boundControl,"keypress",a._boundControlKeyPressHandler)}}},_onBoundControlChange:function(){this._animationPending=true;this._setValueFromBoundControl()},_onBoundControlKeyPress:function(a){if(a.charCode==13){this._animationPending=true;this._setValueFromBoundControl();a.preventDefault()}},_setValueFromBoundControl:function(){var a=this;a._isUpdatingInternal=true;if(a._boundControlID)a._calcValue($get(a._boundControlID).value);a._isUpdatingInternal=false},_initializeHandleAnimation:function(){var a=this;if(a._steps>0){a._enableHandleAnimation=false;return}if(a._enableHandleAnimation)a._handleAnimation=new AjaxControlToolkit.Animation.LengthAnimation(a._handle,a._handleAnimationDuration,100,"style")},_ensureBinding:function(){var a=this;if(a._boundControl){var b=a._value;if(b>=a._minimum||b<=a._maximum){var c=a._boundControl.nodeName=="INPUT";if(c)a._boundControl.value=b;else if(a._boundControl)a._boundControl.innerHTML=b}}},_getBoundsInternal:function(c){var a=$common.getBounds(c);function d(){return a.width>0&&a.height>0}if(!d()){a.width=parseInt($common.getCurrentStyle(c,"width"));a.height=parseInt($common.getCurrentStyle(c,"height"));if(!d()){var b=c.cloneNode(true);b.visibility="hidden";document.body.appendChild(b);a.width=parseInt($common.getCurrentStyle(b,"width"));a.height=parseInt($common.getCurrentStyle(b,"height"));document.body.removeChild(b);if(!d())throw Error.argument("element size",AjaxControlToolkit.Resources.Slider_NoSizeProvided)}}if(this._orientation==AjaxControlToolkit.SliderOrientation.Vertical)a={x:a.y,y:a.x,height:a.width,width:a.height,right:a.right,bottom:a.bottom,location:{x:a.y,y:a.x},size:{width:a.height,height:a.width}};return a},_getRailBounds:function(){var a=this._getBoundsInternal(this._railElement);return a},_getHandleBounds:function(){return this._getBoundsInternal(this._handle)},_initializeDragHandle:function(){var a=this._dragHandle=document.createElement("DIV");a.style.position="absolute";a.style.width="1px";a.style.height="1px";a.style.overflow="hidden";a.style.zIndex="999";a.style.background="none";document.body.appendChild(this._dragHandle)},_resetDragHandle:function(){var a=$common.getBounds(this._handle);$common.setLocation(this._dragHandle,{x:a.x,y:a.y})},_initializeHandlers:function(){var a=this;a._selectstartHandler=Function.createDelegate(a,a._onSelectStart);a._mouseupHandler=Function.createDelegate(a,a._onMouseUp);$addHandler(document,"mouseup",a._mouseupHandler);$addHandlers(a._handle,{mousedown:a._onMouseDown,dragstart:a._IEDragDropHandler,drag:a._IEDragDropHandler,dragend:a._IEDragDropHandler},a);$addHandlers(a._railElement,{click:a._onRailClick},a)},_disposeHandlers:function(){var a=this;$clearHandlers(a._handle);$clearHandlers(a._railElement);$removeHandler(document,"mouseup",a._mouseupHandler);a._mouseupHandler=null;a._selectstartHandler=null},startDragDrop:function(a){this._resetDragHandle();AjaxControlToolkit.SliderDragDropManagerInternal.startDragDrop(this,a,null)},_onMouseDown:function(b){var a=this;window._event=b;b.preventDefault();if(!AjaxControlToolkit.SliderBehavior.DropPending){AjaxControlToolkit.SliderBehavior.DropPending=a;$addHandler(document,"selectstart",a._selectstartHandler);a._selectstartPending=true;a.startDragDrop(a._dragHandle)}},_onMouseUp:function(a){var b=a.target;if(AjaxControlToolkit.SliderBehavior.DropPending==this){AjaxControlToolkit.SliderBehavior.DropPending=null;if(this._selectstartPending)$removeHandler(document,"selectstart",this._selectstartHandler)}},_onRailClick:function(a){if(a.target==this._railElement){this._animationPending=true;this._onRailClicked(a)}},_IEDragDropHandler:function(a){a.preventDefault()},_onSelectStart:function(a){a.preventDefault()},_calcValue:function(b,h){var a=this,c;if(b!=null){if(!Number.isInstanceOfType(b))try{b=parseFloat(b)}catch(l){b=Number.NaN}if(isNaN(b))b=a._minimum;c=b<a._minimum?a._minimum:b>a._maximum?a._maximum:b}else{var f=a._minimum,i=a._maximum,d=a._getHandleBounds(),e=a._getRailBounds(),g=h?h-d.width/2:d.x-e.x,k=e.width-d.width,j=g/k;c=g==0?f:g==e.width-d.width?i:f+j*(i-f)}if(a._steps>0)c=a._getNearestStepValue(c);c=c<a._minimum?a._minimum:c>a._maximum?a._maximum:c;a._isUpdatingInternal=true;a.set_Value(c);a._isUpdatingInternal=false;return c},_setHandleOffset:function(f,h){var a=this,d=a._minimum,g=a._maximum,b=a._getHandleBounds(),c=a._getRailBounds(),k=g-d,j=(f-d)/k,i=Math.round(j*(c.width-b.width)),e=f==d?0:f==g?c.width-b.width:i;if(h){a._handleAnimation.set_startValue(b.x-c.x);a._handleAnimation.set_endValue(e);a._handleAnimation.set_propertyKey(a._isHorizontal?"left":"top");a._handleAnimation.play();a._animationPending=false}else if(a._isHorizontal)a._handle.style.left=e+"px";else a._handle.style.top=e+"px"},_getNearestStepValue:function(b){var a=this;if(a._steps==0)return b;var c=a._maximum-a._minimum;if(c==0)return b;var d=c/(a._steps-1);return Math.round(b/d)*d},_onHandleReleased:function(){if(this._raiseChangeOnlyOnMouseUp)this._fireTextBoxChangeEvent();this._raiseEvent("slideEnd")},_onRailClicked:function(e){var b=this,f=b._getHandleBounds(),g=b._getRailBounds(),a=b._isHorizontal?e.offsetX:e.offsetY,c=f.width/2,d=g.width-c;a=a<c?c:a>d?d:a;b._calcValue(null,a,true);b._fireTextBoxChangeEvent()},_fireTextBoxChangeEvent:function(){if(document.createEvent){var a=document.createEvent("HTMLEvents");a.initEvent("change",true,false);this.get_element().dispatchEvent(a)}else if(document.createEventObject)this.get_element().fireEvent("onchange")},get_dragDataType:function(){return "HTML"},getDragData:function(){return this._handle},get_dragMode:function(){return AjaxControlToolkit.DragMode.Move},onDragStart:function(){this._resetDragHandle();this._raiseEvent("slideStart")},onDrag:function(){var a=this,c=a._getBoundsInternal(a._dragHandle),e=a._getHandleBounds(),d=a._getRailBounds(),b;if(a._isHorizontal)b={x:c.x-d.x,y:0};else b={y:c.x-d.x,x:0};$common.setLocation(a._handle,b);a._calcValue(null,null);if(a._steps>1)a._setHandleOffset(a.get_Value(),false)},onDragEnd:function(){this._onHandleReleased()},get_dropTargetElement:function(){return document.body},canDrop:function(b,a){return a=="HTML"},drop:Function.emptyMethod,onDragEnterTarget:Function.emptyMethod,onDragLeaveTarget:Function.emptyMethod,onDragInTarget:Function.emptyMethod,add_sliderInitialized:function(a){this.get_events().addHandler("sliderInitialized",a)},remove_sliderInitialized:function(a){this.get_events().removeHandler("sliderInitialized",a)},add_valueChanged:function(a){this.get_events().addHandler("valueChanged",a)},remove_valueChanged:function(a){this.get_events().removeHandler("valueChanged",a)},add_slideStart:function(a){this.get_events().addHandler("slideStart",a)},remove_slideStart:function(a){this.get_events().removeHandler("slideStart",a)},add_slideEnd:function(a){this.get_events().addHandler("slideEnd",a)},remove_slideEnd:function(a){this.get_events().removeHandler("slideEnd",a)},_raiseEvent:function(c,a){var b=this.get_events().getHandler(c);if(b){if(!a)a=Sys.EventArgs.Empty;b(this,a)}},get_Value:function(){return this._value},set_Value:function(c){var a=this,d=a._value,b=c;if(!a._isUpdatingInternal)b=a._calcValue(c);a.get_element().value=a._value=b.toFixed(a._decimals);a._ensureBinding();if(!Number.isInstanceOfType(a._value))try{a._value=parseFloat(a._value)}catch(e){a._value=Number.NaN}if(a._tooltipText)a._handle.alt=a._handle.title=String.format(a._tooltipText,a._value);if(a._isInitializedInternal){a._setHandleOffset(b,a._enableHandleAnimation&&a._animationPending);if(a._isUpdatingInternal)if(!a._raiseChangeOnlyOnMouseUp)a._fireTextBoxChangeEvent();if(a._value!=d)a._raiseEvent("valueChanged")}},get_RailCssClass:function(){return this._railCssClass},set_RailCssClass:function(a){this._railCssClass=a},get_HandleImageUrl:function(){return this._handleImageUrl},set_HandleImageUrl:function(a){this._handleImageUrl=a},get_HandleCssClass:function(){return this._handleCssClass},set_HandleCssClass:function(a){this._handleCssClass=a},get_Minimum:function(){return this._minimum},set_Minimum:function(a){this._minimum=a},get_Maximum:function(){return this._maximum},set_Maximum:function(a){this._maximum=a},get_Orientation:function(){return this._orientation},set_Orientation:function(a){this._orientation=a},get_Steps:function(){return this._steps},set_Steps:function(b){var a=this;a._steps=Math.abs(b);a._steps=a._steps==1?2:a._steps},get_Decimals:function(){return this._decimals},set_Decimals:function(a){this._decimals=Math.abs(a)},get_EnableHandleAnimation:function(){return this._enableHandleAnimation},set_EnableHandleAnimation:function(a){this._enableHandleAnimation=a},get_HandleAnimationDuration:function(){return this._handleAnimationDuration},set_HandleAnimationDuration:function(a){this._handleAnimationDuration=a},get_BoundControlID:function(){return this._boundControlID},set_BoundControlID:function(b){var a=this;a._boundControlID=b;if(a._boundControlID)a._boundControl=$get(a._boundControlID);else a._boundControl=null},get_Length:function(){return this._length},set_Length:function(a){this._length=a+"px"},get_SliderInitialized:function(){return this._isInitializedInternal},get_RaiseChangeOnlyOnMouseUp:function(){return this._raiseChangeOnlyOnMouseUp},set_RaiseChangeOnlyOnMouseUp:function(a){this._raiseChangeOnlyOnMouseUp=a},get_TooltipText:function(){return this._tooltipText},set_TooltipText:function(a){this._tooltipText=a},getClientState:function(){var a=AjaxControlToolkit.SliderBehavior.callBaseMethod(this,"get_ClientState");if(a=="")a=null;return a},setClientState:function(a){return AjaxControlToolkit.SliderBehavior.callBaseMethod(this,"set_ClientState",[a])}};AjaxControlToolkit.SliderBehavior.DropPending=null;AjaxControlToolkit.SliderBehavior.registerClass("AjaxControlToolkit.SliderBehavior",AjaxControlToolkit.BehaviorBase,AjaxControlToolkit.IDragSource,AjaxControlToolkit.IDropTarget);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();