﻿Type.registerNamespace('AjaxControlToolkit');AjaxControlToolkit._DualSliderDragDropManagerInternal = function() {
AjaxControlToolkit._DualSliderDragDropManagerInternal.initializeBase(this);this._instance = null;}
AjaxControlToolkit._DualSliderDragDropManagerInternal.prototype = {
_getInstance : function() {
this._instance = new AjaxControlToolkit.GenericDragDropManager();this._instance.initialize();this._instance.add_dragStart(Function.createDelegate(this, this._raiseDragStart));this._instance.add_dragStop(Function.createDelegate(this, this._raiseDragStop));return this._instance;} 
}
AjaxControlToolkit._DualSliderDragDropManagerInternal.registerClass('AjaxControlToolkit._DualSliderDragDropManagerInternal', AjaxControlToolkit._DragDropManager);AjaxControlToolkit.DualSliderDragDropManagerInternal = new AjaxControlToolkit._DualSliderDragDropManagerInternal();AjaxControlToolkit.DualSliderOrientation = function() {
}
AjaxControlToolkit.DualSliderOrientation.prototype = {
Horizontal : 0,
Vertical : 1
}
AjaxControlToolkit.DualSliderOrientation.registerEnum('AjaxControlToolkit.DualSliderOrientation', false);AjaxControlToolkit.DualSliderBehavior = function(element) {
AjaxControlToolkit.DualSliderBehavior.initializeBase(this, [element]);this._minimum = 0;this._maximum = 100;this._leftValue = null;this._oldLeftValue=null;this._rightValue = null;this._oldRightValue=null;this._steps = 0;this._decimals = 0;this._orientation = AjaxControlToolkit.DualSliderOrientation.Horizontal;this._railElement = null;this._railCssClass = null;this._isHorizontal = true;this._isUpdatingInternal = false;this._isInitializedInternal = false;this._handleAnimationDuration = 0.1;this._mouseupHandler = null;this._selectstartHandler = null;this._length = null;this._raiseChangeOnlyOnMouseUp = true;this._animationPending = false;this._selectstartPending = false;this.isDragging = false;this.ignoreRailClick = true;this._leftBoundControlChangeHandler = null;this._leftBoundControlKeyPressHandler = null;this._leftBoundControlID = null;this._leftHandle = null;this._leftHandleImage = null;this._leftHandleAnimation = null;this._leftHandleImageUrl = null;this._leftHandleCssClass = null;this._dragLeftHandle = null;this._enableLeftHandleAnimation = false;this._rightBoundControlChangeHandler = null;this._rightBoundControlKeyPressHandler = null;this._rightBoundControlID = null;this._rightHandle = null;this._rightHandleImage = null;this._rightHandleAnimation = null;this._rightHandleImageUrl = null;this._rightHandleCssClass = null;this._dragRightHandle = null;this._enableRightHandleAnimation = false;this._rightHandleWidth = 10;this._activeCurrenthandle=null;}
AjaxControlToolkit.DualSliderBehavior.prototype = {
initialize : function() {
AjaxControlToolkit.DualSliderBehavior.callBaseMethod(this, 'initialize');this._initializeLayout();},
dispose : function() {
this._disposeHandlers();this._disposeLeftBoundControl();this._disposeRightBoundControl();if(this._enableLeftHandleAnimation && this._leftHandleAnimation) {
this._leftHandleAnimation.dispose();}
if(this._enableRightHandleAnimation && this._rightHandleAnimation) {
this._rightHandleAnimation.dispose();}
AjaxControlToolkit.DualSliderBehavior.callBaseMethod(this, 'dispose');},
_initializeLayout : function() {
this._railElement = document.createElement('DIV');this._railElement.id = this.get_id() + '_railElement';this._railElement.tabIndex = -1;this._railElement.innerHTML = '<div></div><div></div>';this._leftHandle = this._railElement.childNodes[0];this._leftHandle.style.overflow = 'hidden';this._leftHandle.style.position = 'absolute';this._rightHandle = this._railElement.childNodes[1];this._rightHandle.style.overflow = 'hidden';this._rightHandle.style.position = 'absolute';if(Sys.Browser.agent == Sys.Browser.Opera) {
this._leftHandle.style.left = '0px';this._leftHandle.style.top = '0px';this._rightHandle.style.left = '0px';this._rightHandle.style.top = '0px';}
var textBoxElement = this.get_element();var textBoxElementBounds = CommonToolkitScripts.getBounds(textBoxElement);textBoxElement.parentNode.insertBefore(this._railElement, textBoxElement);textBoxElement.style.display = 'none';this._isHorizontal = (this._orientation == AjaxControlToolkit.DualSliderOrientation.Horizontal);var defaultRailCssClass = (this._isHorizontal) ? 'ajax__dualslider_h_rail' : 'ajax__dualslider_v_rail';var defaultLeftHandleCssClass = (this._isHorizontal) ? 'ajax__dualslider_h_lefthandle' : 'ajax__dualslider_v_handle';var defaultRightHandleCssClass = (this._isHorizontal) ? 'ajax__dualslider_h_righthandle' : 'ajax__dualslider_v_handle';this._railElement.className = (this._railCssClass) ? this._railCssClass : defaultRailCssClass;this._leftHandle.className = (this._leftHandleCssClass) ? this._leftHandleCssClass : defaultLeftHandleCssClass;this._rightHandle.className = (this._rightHandleCssClass) ? this._rightHandleCssClass : defaultRightHandleCssClass;if(!this._leftHandleImageUrl) this._leftHandleImageUrl='WebResource.axd?d=xPGdG3CLr8Eexjj64C6tvqTExlXH3w0BveHgOx6aAcQSWu2lDiBoXS6w5u5-dL0dhk0cwmEI9mh1UDfvLqyDxkDJ7xagB0iG_GCSlY-rN181&t=633934807433836897';if(!this._rightHandleImageUrl)this._rightHandleImageUrl='WebResource.axd?d=xPGdG3CLr8Eexjj64C6tvqTExlXH3w0BveHgOx6aAcQSWu2lDiBoXS6w5u5-dL0de1E619D0vJgQG0uKGrnKisFTFxEs_lq_m7T93iausaw1&t=633934807433836897';if (this._isHorizontal)
{ 
if(this._length) this._railElement.style.width = this._length;}
else
{
if(this._length) this._railElement.style.height = this._length;} 
this._loadLeftHandleImage();this._loadRightHandleImage();this._enforceLeftElementPositioning();this._enforceRightElementPositioning();this._initializeSlider();},
_enforceLeftElementPositioning : function() {
var tbPosition = 
{
position: this.get_leftElement().style.position,
top: this.get_leftElement().style.top,
right: this.get_leftElement().style.right,
bottom: this.get_leftElement().style.bottom,
left: this.get_leftElement().style.left
};if(tbPosition.position != '') {
this._railElement.style.position = tbPosition.position;}
if(tbPosition.top != '') {
this._railElement.style.top = tbPosition.top;}
if(tbPosition.right != '') {
this._railElement.style.right = tbPosition.right;}
if(tbPosition.bottom != '') {
this._railElement.style.bottom = tbPosition.bottom;}
if(tbPosition.left != '') {
this._railElement.style.left = tbPosition.left;}
},
_enforceRightElementPositioning : function() {
var tbPosition = 
{
position: this.get_rightElement().style.position,
top: this.get_rightElement().style.top,
right: this.get_rightElement().style.right,
bottom: this.get_rightElement().style.bottom,
left: this.get_rightElement().style.left
};if(tbPosition.position != '') {
this._railElement.style.position = tbPosition.position;}
if(tbPosition.top != '') {
this._railElement.style.top = tbPosition.top;}
if(tbPosition.right != '') {
this._railElement.style.right = tbPosition.right;}
if(tbPosition.bottom != '') {
this._railElement.style.bottom = tbPosition.bottom;}
if(tbPosition.left != '') {
this._railElement.style.left = tbPosition.left;}
},
_loadLeftHandleImage : function() { 
this._leftHandleImage = document.createElement('IMG');this._leftHandle.appendChild(this._leftHandleImage);this._leftHandleImage.id = this.get_id() + '_lefthandleImage';this._leftHandleImage.src = this._leftHandleImageUrl;this._leftHandle.style.position = 'absolute';},
_loadRightHandleImage : function() {
this._rightHandleImage = document.createElement('IMG');this._rightHandleImage.id = this.get_id() + '_righthandleImage';this._rightHandle.appendChild(this._rightHandleImage);this._rightHandleImage.src = this._rightHandleImageUrl;this._rightHandle.style.position = 'absolute';},
_onLeftHandleImageLoaded : function() {
var leftHandleImageBounds = $common.getBounds(this._leftHandleImage);this._leftHandle.style.height = leftHandleImageBounds.height + 'px';this._leftHandle.style.width = leftHandleImageBounds.width + 'px';},
_onRightHandleImageLoaded : function() {
var rightHandleImageBounds = $common.getBounds(this._rightHandleImage);this._rightHandle.style.height = rightHandleImageBounds.height + 'px';this._rightHandle.style.width = rightHandleImageBounds.width + 'px';},
_initializeSlider : function() {
this._initializeLeftBoundControl();this._initializeRightBoundControl();var _elementValue;try 
{
_elementValue = parseFloat(this.get_leftElement().value);} 
catch(ex) 
{
_elementValue = Number.NaN;} 
this.set_leftValue(_elementValue);try 
{
_elementValue = parseFloat(this.get_rightElement().value);} 
catch(ex) 
{
_elementValue = Number.NaN;}
this.set_rightValue(_elementValue);this._setLeftHandleOffset(this._leftValue);this._setRightHandleOffset(this._rightValue);this._initializeLeftDragHandle();this._initializeRightDragHandle();AjaxControlToolkit.DualSliderDragDropManagerInternal.registerDropTarget(this);this._initializeHandlers();this._initializeLeftHandleAnimation();this._initializeRightHandleAnimation();this._isInitializedInternal = true;this._raiseEvent('sliderInitialized');},
_initializeLeftBoundControl : function() {
if(this._leftBoundControlID) {
var boundElement = $get(this._leftBoundControlID);var isInputElement = boundElement && boundElement.nodeName == 'INPUT';if(isInputElement) {
this._leftBoundControlChangeHandler = Function.createDelegate(this, this._onLeftBoundControlChange);this._leftBoundControlKeyPressHandler = Function.createDelegate(this, this._onLeftBoundControlKeyPress);$addHandler(boundElement, 'change', this._leftBoundControlChangeHandler);$addHandler(boundElement, 'keypress', this._leftBoundControlKeyPressHandler);}
}
},
_initializeRightBoundControl : function() {
if(this._rightBoundControlID) {
var boundElement = $get(this._rightBoundControlID);var isInputElement = boundElement && boundElement.nodeName == 'INPUT';if(isInputElement) {
this._rightBoundControlChangeHandler = Function.createDelegate(this, this._onRightBoundControlChange);this._rightBoundControlKeyPressHandler = Function.createDelegate(this, this._onRightBoundControlKeyPress);$addHandler(boundElement, 'change', this._rightBoundControlChangeHandler);$addHandler(boundElement, 'keypress', this._rightBoundControlKeyPressHandler);}
}
},
_disposeLeftBoundControl : function() {
if(this._leftBoundControlID) {
var boundElement = $get(this._leftBoundControlID);var isInputElement = boundElement && boundElement.nodeName == 'INPUT';if(isInputElement) {
$removeHandler(boundElement, 'change', this._leftBoundControlChangeHandler);$removeHandler(boundElement, 'keypress', this._leftBoundControlKeyPressHandler);}
}
},
_disposeRightBoundControl : function() {
if(this._rightBoundControlID) {
var boundElement = $get(this._rightBoundControlID);var isInputElement = boundElement && boundElement.nodeName == 'INPUT';if(isInputElement) {
$removeHandler(boundElement, 'change', this._rightBoundControlChangeHandler);$removeHandler(boundElement, 'keypress', this._rightBoundControlKeyPressHandler);}
}
},
_onLeftBoundControlChange : function(evt) {
if($get(this._leftBoundControlID).value < $get(this._rightBoundControlID).value)
{
this._animationPending = true;this._setValueFromLeftBoundControl();evt.preventDefault();}
},
_onRightBoundControlChange : function(evt) {
if($get(this._rightBoundControlID).value > $get(this._leftBoundControlID).value)
{
this._animationPending = true;this._setValueFromRightBoundControl();evt.preventDefault();}
},
_onLeftBoundControlKeyPress : function(evt) {
if(evt.charCode == 13) {
if($get(this._leftBoundControlID).value < $get(this._rightBoundControlID).value)
{
this._animationPending = true;this._setValueFromLeftBoundControl();evt.preventDefault();}
else{
$get(this._leftBoundControlID).value = $get(this._rightBoundControlID).value;this._animationPending = true;this._setValueFromLeftBoundControl();evt.preventDefault();}
}
},
_onRightBoundControlKeyPress : function(evt) {
if(evt.charCode == 13) {
if($get(this._rightBoundControlID).value > $get(this._leftBoundControlID).value)
{
this._animationPending = true;this._setValueFromRightBoundControl();evt.preventDefault();}
else{
$get(this._rightBoundControlID).value = $get(this._leftBoundControlID).value;this._animationPending = true;this._setValueFromRightBoundControl();evt.preventDefault();}
}
},
_setValueFromLeftBoundControl : function() {
this._isUpdatingInternal = true;if(this._leftBoundControlID) {
this._calcLeftValue($get(this._leftBoundControlID).value);}
this._isUpdatingInternal = false;},
_setValueFromRightBoundControl : function() {
this._isUpdatingInternal = true;if(this._rightBoundControlID) {
this._calcRightValue($get(this._rightBoundControlID).value);}
this._isUpdatingInternal = false;},
_initializeLeftHandleAnimation : function() {
if(this._steps > 0) {
this._enableLeftHandleAnimation = false;return;}
if(this._enableLeftHandleAnimation) {
this._leftHandleAnimation = new AjaxControlToolkit.Animation.LengthAnimation(
this._leftHandle, this._handleAnimationDuration, 100, 'style');}
},
_initializeRightHandleAnimation : function() {
if(this._steps > 0) {
this._enableRightHandleAnimation = false;return;}
if(this._enableRightHandleAnimation) {
this._rightHandleAnimation = new AjaxControlToolkit.Animation.LengthAnimation(
this._rightHandle, this._handleAnimationDuration, 100, 'style');}
},
_ensureLeftBinding : function() {
if(this._leftBoundControlID) {
var value = this._leftValue;if(value >= this._minimum || value <= this._maximum) {
var boundElement = $get(this._leftBoundControlID);var isInputElement = boundElement && boundElement.nodeName == 'INPUT';if(isInputElement) {
boundElement.value = value;}
else if(boundElement) {
boundElement.innerHTML = value;}
}
}
},
_ensureRightBinding : function() { 
if(this._rightBoundControlID) {
var value = this._rightValue;if(value >= this._minimum || value <= this._maximum) {
var boundElement = $get(this._rightBoundControlID);var isInputElement = boundElement && boundElement.nodeName == 'INPUT';if(isInputElement) {
boundElement.value = value;}
else if(boundElement) {
boundElement.innerHTML = value;}
}
}
},
_getBoundsInternal : function(element) {
var bounds = CommonToolkitScripts.getBounds(element);function hasSize() { 
return bounds.width > 0 && bounds.height > 0;}
if(!hasSize()) {
bounds.width = parseInt($common.getCurrentStyle(element, 'width'));bounds.height = parseInt($common.getCurrentStyle(element, 'height'));if(!hasSize()) {
var tempNode = element.cloneNode(true);tempNode.visibility = 'hidden';document.body.insertBefore(tempNode,document.body.firstChild);bounds.width = parseInt($common.getCurrentStyle(tempNode, 'width'));bounds.height = parseInt($common.getCurrentStyle(tempNode, 'height'));document.body.removeChild(tempNode);if(!hasSize()) {
throw Error.argument('element size', AjaxControlToolkit.Resources.Slider_NoSizeProvided);}
}
}
if(this._orientation == AjaxControlToolkit.DualSliderOrientation.Vertical) {
bounds = { x : bounds.y, 
y : bounds.x, 
height : bounds.width, 
width : bounds.height, 
right : bounds.right,
bottom : bounds.bottom,
location : {x:bounds.y, y:bounds.x},
size : {width:bounds.height, height:bounds.width}
};}
return bounds;},
_getRailBounds : function() {
var bounds = this._getBoundsInternal(this._railElement);return bounds;},
_getLeftHandleBounds : function() {
return this._getBoundsInternal(this._leftHandle);},
_getRightHandleBounds : function() {
return this._getBoundsInternal(this._rightHandle);},
_initializeLeftDragHandle : function() {
var dh = this._dragLeftHandle = document.createElement('DIV');dh.style.position = 'absolute';dh.style.width = '1px';dh.style.height = '1px';dh.style.overflow = 'hidden';dh.style.zIndex = '999';dh.style.background = 'none';dh.id=this.get_id()+'_dragleftHandle';document.body.insertBefore(this._dragLeftHandle,document.body.firstChild);},
_initializeRightDragHandle : function() {
var dh = this._dragRightHandle = document.createElement('DIV');dh.style.position = 'absolute';dh.style.width = '1px';dh.style.height = '1px';dh.style.overflow = 'hidden';dh.style.zIndex = '1000';dh.style.background = 'none';dh.id=this.get_id()+'_dragRightHandle';document.body.insertBefore(this._dragRightHandle,document.body.firstChild);},
_resetLeftHandleDrag : function() { 
var leftHandleBounds = this._getLeftHandleBounds();$common.setLocation(this._dragLeftHandle, {x:leftHandleBounds.x, y:leftHandleBounds.y});},
_resetRightHandleDrag : function() { 
var rightHandleBounds= this._getRightHandleBounds();$common.setLocation(this._dragRightHandle, {x:rightHandleBounds.x, y:rightHandleBounds.y});},
_initializeHandlers : function() {
this._selectstartHandler = Function.createDelegate(this, this._onSelectStart);this._mouseupHandler = Function.createDelegate(this, this._onMouseUp);$addHandler(document, 'mouseup', this._mouseupHandler);$addHandlers(this._leftHandle, 
{
'mousedown': this._onMouseDownLeft,
'dragstart': this._IEDragDropHandler,
'drag': this._IEDragDropHandler,
'dragend': this._IEDragDropHandler
},
this);$addHandlers(this._rightHandle, 
{
'mousedown': this._onMouseDownRight,
'dragstart': this._IEDragDropHandler,
'drag': this._IEDragDropHandler,
'dragend': this._IEDragDropHandler
},
this);$addHandlers(this._railElement,
{
'click': this._onRailClick
},
this);},
_disposeHandlers : function() {
$clearHandlers(this._leftHandle);$clearHandlers(this._rightHandle);$clearHandlers(this._railElement);$removeHandler(document, 'mouseup', this._mouseupHandler);this._mouseupHandler = null;this._selectstartHandler = null;},
startDragDropLeft : function(dragVisual) {
this._activeCurrenthandle=this._dragLeftHandle.id;this._resetLeftHandleDrag();AjaxControlToolkit.DualSliderDragDropManagerInternal.startDragDrop(this, dragVisual, null);this.isDragging = true;},
startDragDropRight : function(dragVisual) {
this._activeCurrenthandle=this._dragRightHandle.id;this._resetRightHandleDrag();AjaxControlToolkit.DualSliderDragDropManagerInternal.startDragDrop(this, dragVisual, null);this.isDragging = true;},
_onMouseDownLeft : function(evt) {
window._event = evt;evt.preventDefault();if(!AjaxControlToolkit.DualSliderBehavior.DropPending) {
AjaxControlToolkit.DualSliderBehavior.DropPending = this;$addHandler(document, 'selectstart', this._selectstartHandler);this._selectstartPending = true;this.startDragDropLeft(this._dragLeftHandle);}
},
_onMouseDownRight : function(evt) {
window._event = evt;evt.preventDefault();if(!AjaxControlToolkit.DualSliderBehavior.DropPending) {
AjaxControlToolkit.DualSliderBehavior.DropPending = this;$addHandler(document, 'selectstart', this._selectstartHandler);this._selectstartPending = true;this.startDragDropRight(this._dragRightHandle);}
},
_onMouseUp : function(evt) {
var srcElement = evt.target;if(AjaxControlToolkit.DualSliderBehavior.DropPending == this) {
AjaxControlToolkit.DualSliderBehavior.DropPending = null;if(this._selectstartPending) {
$removeHandler(document, 'selectstart', this._selectstartHandler);}
}
if(this.isDragging)
{
this.isDragging = false;this.ignoreRailClick = true;}
},
_onRailClick : function(evt) {
if(this.ignoreRailClick==false){
if(evt.target == this._railElement) {
this._animationPending = true;}
}
this.ignoreRailClick = false;},
_IEDragDropHandler : function(evt) {
evt.preventDefault();},
_onSelectStart : function(evt) {
evt.preventDefault();},
_calcLeftValue : function(value, mouseOffset) {
var val;if(value != null) { 
if(!Number.isInstanceOfType(value)) {
try {
value = parseFloat(value);} catch(ex) {
value = Number.NaN;}
}
if(isNaN(value)) {
value = this._minimum;}
val = (value <= this._minimum) ? this._minimum
: (value >= this._maximum) ? this._minimum
: value;}
else { 
var _minimum = this._minimum;var _maximum = this._maximum;var leftHandleBounds = this._getLeftHandleBounds();var sliderBounds = this._getRailBounds();var leftX = (mouseOffset) ? mouseOffset - leftHandleBounds.width / 2 
: leftHandleBounds.x - sliderBounds.x;var extent = sliderBounds.width - leftHandleBounds.width/2;var percent = leftX / extent;val = (leftX == 0) ? _minimum
: (leftX >= (sliderBounds.width - leftHandleBounds.width/2)) ? _maximum
: _minimum +percent * (_maximum - _minimum);}
if(this._steps > 0) {
val = this._getNearestStepValue(val);}
val = (val <= this._minimum) ? this._minimum 
: (val >= this._maximum) ? this._minimum 
: val;this._isUpdatingInternal = true;this.set_leftValue(val);this._isUpdatingInternal = false;return val;},
_calcRightValue : function(value, mouseOffset) {
var val;if(value != null) {
if(!Number.isInstanceOfType(value)) {
try {
value = parseFloat(value);} catch(ex) {
value = Number.NaN;}
}
if(isNaN(value)) {
value = this._maximum;}
val = (value < this._minimum) ? this._maximum 
: (value > this._maximum) ? this._maximum
: value;}
else { 
var _minimum = this._minimum;var _maximum = this._maximum;var rightHandleBounds = this._getRightHandleBounds();var sliderBounds = this._getRailBounds();var rightX = (mouseOffset) ? mouseOffset - rightHandleBounds.width / 2 
: rightHandleBounds.x - sliderBounds.x;var extent = sliderBounds.width - rightHandleBounds.width/2;var percent = rightX / extent;val = (rightX == 0) ? _minimum
: (rightX >= (sliderBounds.width - rightHandleBounds.width/2)) ? _maximum
: _minimum + percent * (_maximum - _minimum);}
if(this._steps > 0) {
val = this._getNearestStepValue(val);}
val = (val <= this._minimum) ? this._maximum
: (val >= this._maximum) ? this._maximum 
: val;this._isUpdatingInternal = true;this.set_rightValue(val);this._isUpdatingInternal = false;return val;},
_setLeftHandleOffset : function(value, playLeftHandleAnimation) {
var _minimum = this._minimum;var _maximum = this._maximum;var leftHandleBounds = this._getLeftHandleBounds();var sliderBounds = this._getRailBounds();var Commons = AjaxControlToolkit.CommonToolkitScripts;if(leftHandleBounds.width <= 0 && sliderBounds.width <= 0) {
leftHandleBounds.width = parseInt(Commons.getCurrentStyle(this._leftHandle, 'width'));sliderBounds.width = parseInt(Commons.getCurrentStyle(this._railElement, 'width'));if(leftHandleBounds.width <= 0 || sliderBounds.width <= 0) {
throw Error.argument('width', AjaxControlToolkit.Resources.Slider_NoSizeProvided);}
}
var extent = _maximum - _minimum;var fraction = (value - _minimum) / extent;var hypOffset = Math.round(fraction * (sliderBounds.width - leftHandleBounds.width/2));var offset = (value == _minimum) ? 0
: (value == _maximum) ? (sliderBounds.width - leftHandleBounds.width/2)
: hypOffset;if(playLeftHandleAnimation) {
this._leftHandleAnimation.set_startValue(leftHandleBounds.x - sliderBounds.x);this._leftHandleAnimation.set_endValue(offset);this._leftHandleAnimation.set_propertyKey((this._isHorizontal) ? 'left' : 'top');this._leftHandleAnimation.play();this._animationPending = false;}
else {
if(this._isHorizontal) {
this._leftHandle.style.left = offset + 'px';}
else {
this._leftHandle.style.top = offset + 'px';}
}
},
_setRightHandleOffset : function(value, playRightHandleAnimation) {
var _minimum = this._minimum;var _maximum = this._maximum;var rightHandleBounds = this._getRightHandleBounds();var sliderBounds = this._getRailBounds();var Commons = AjaxControlToolkit.CommonToolkitScripts;if(rightHandleBounds.width <= 0 && sliderBounds.width <= 0) {
rightHandleBounds.width = parseInt(Commons.getCurrentStyle(this._rightHandle, 'width'));sliderBounds.width = parseInt(Commons.getCurrentStyle(this._railElement, 'width'));if(rightHandleBounds.width <= 0 || sliderBounds.width <= 0) {
throw Error.argument('width', AjaxControlToolkit.Resources.Slider_NoSizeProvided);}
}
var extent = _maximum - _minimum;var fraction = (value - _minimum) / extent;var hypOffset = Math.round(fraction * (sliderBounds.width - rightHandleBounds.width/2));var offset = (value == _minimum) ? 0
: (value == _maximum) ? (sliderBounds.width - rightHandleBounds.width/2)
: hypOffset;if(playRightHandleAnimation) {
this._rightHandleAnimation.set_startValue(rightHandleBounds.x - sliderBounds.x);this._rightHandleAnimation.set_endValue(offset);this._rightHandleAnimation.set_propertyKey((this._isHorizontal) ? 'left' : 'top');this._rightHandleAnimation.play();this._animationPending = false;}
else {
if(this._isHorizontal) {
this._rightHandle.style.left = offset + 'px';}
else {
this._rightHandle.style.top = offset + 'px';}
}
},
_getNearestStepValue : function(value) {
if(this._steps == 0) return value;var extent = this._maximum - this._minimum;if (extent == 0) return value;var delta = extent / (this._steps - 1);return Math.round(value / delta) * delta;},
_onLeftHandleReleased : function() {
if(this._raiseChangeOnlyOnMouseUp) {
this._raiseLeftHandleChangedEvent();}
},
_onRightHandleReleased : function() {
if(this._raiseChangeOnlyOnMouseUp) {
this._raiseRightHandleChangedEvent();}
},
_onRailClicked : function(evt) {
var leftHandleBounds = this._getLeftHandleBounds();var rightHandleBounds = this._getRightHandleBounds();var sliderBounds = this._getRailBounds();var offset = (this._isHorizontal) ? evt.offsetX : evt.offsetY;var minOffset = leftHandleBounds.width / 2;var maxOffset = sliderBounds.width - minOffset;offset = (offset < minOffset) ? minOffset 
: (offset > maxOffset) ? maxOffset
: offset;var d1 = Math.abs(leftHandleBounds.x-offset);var d2 = Math.abs(rightHandleBounds.x-offset);if( d1 < d2)
{
this._calcLeftValue(null, offset, true);this._raiseLeftHandleChangedEvent();}
else if(d2 < d1)
{
this._calcRightValue(null, offset, true);this._raiseRightHandleChangedEvent();}
else
{
if(offset < leftHandleBounds.x)
{
this._calcLeftValue(null, offset, true);this._raiseLeftHandleChangedEvent();}
else if(offset > rightHandleBounds.x)
{
this._calcRightValue(null, offset, true);this._raiseRightHandleChangedEvent();}
}
this._raiseEvent('slideEnd');},
_raiseLeftHandleChangedEvent : function() { 
if (document.createEvent) {
var onchangeEvent = document.createEvent('HTMLEvents');onchangeEvent.initEvent('change', true, false);this.get_leftElement().dispatchEvent(onchangeEvent);} 
else if(document.createEventObject) {
this.get_leftElement().fireEvent('onchange');}
},
_raiseRightHandleChangedEvent : function() {
if (document.createEvent) {
var onchangeEvent = document.createEvent('HTMLEvents');onchangeEvent.initEvent('change', true, false);this.get_rightElement().dispatchEvent(onchangeEvent);} 
else if(document.createEventObject) {
this.get_rightElement().fireEvent('onchange');}
},
get_dragDataType : function() { 
return 'HTML';},
getDragData : function() {
return this._rightHandle;},
get_dragMode : function() { 
return AjaxControlToolkit.DragMode.Move;},
onDragStart : function() {
this._oldLeftValue=parseInt(this._leftValue);this._oldRightValue=parseInt(this._rightValue);this._resetLeftHandleDrag();this._resetRightHandleDrag();this._raiseEvent('slideStart');},
onDrag : function() {
var dragLeftHandleBounds = this._getBoundsInternal(this._dragLeftHandle);var leftHandleBounds = this._getLeftHandleBounds();var dragRightHandleBounds = this._getBoundsInternal(this._dragRightHandle);var rightHandleBounds = this._getRightHandleBounds();var sliderBounds = this._getRailBounds();var leftHandlePosition;var rightHandlePosition;var setHandle = true;if(this._isHorizontal) {
leftHandlePosition = { x:dragLeftHandleBounds.x - sliderBounds.x, y:0 };rightHandlePosition = { x:dragRightHandleBounds.x - sliderBounds.x, y:0 };var unitDifference=sliderBounds.width/(this._maximum-this._minimum);var pixelDifference=(this._maximum-this._minimum)>this._rightHandleWidth ? parseInt(this._rightHandleWidth*(this._maximum-this._minimum)*unitDifference/100):parseInt(unitDifference);if(leftHandlePosition.x + pixelDifference > rightHandlePosition.x )
{
setHandle = false;} 
}
else 
{
leftHandlePosition = { y:dragLeftHandleBounds.x - sliderBounds.x, x:0 };rightHandlePosition = { y:dragRightHandleBounds.x - sliderBounds.x, x:0 };if(leftHandlePosition.y > rightHandlePosition.y - this._rightHandleWidth)
{
setHandle = false;}
}
if(setHandle){
if(this._activeCurrenthandle==this._dragRightHandle.id)
{
$common.setLocation(this._rightHandle, rightHandlePosition);this._calcRightValue(null, null);}
else
{
$common.setLocation(this._leftHandle, leftHandlePosition);this._calcLeftValue(null, null);}
}
if(this._steps > 0) {
this._setLeftHandleOffset(this.get_leftValue(), false);this._setRightHandleOffset(this.get_rightValue(), false);}
},
onDragEnd : function() {
if( this._oldLeftValue!=this._leftValue || this._oldRightValue!=this._rightValue )
{
this._onLeftHandleReleased();this._onRightHandleReleased();}
this._raiseEvent('slideEnd');},
get_dropTargetElement : function() {
return document.body;},
canDrop : function(dragMode, dataType) {
return dataType == 'HTML';},
drop : Function.emptyMethod,
onDragEnterTarget : Function.emptyMethod,
onDragLeaveTarget : Function.emptyMethod,
onDragInTarget : Function.emptyMethod,
add_sliderInitialized : function(handler) {
this.get_events().addHandler('sliderInitialized', handler);},
remove_sliderInitialized : function(handler) {
this.get_events().removeHandler('sliderInitialized', handler);},
add_valueChanged : function(handler) {
this.get_events().addHandler('valueChanged', handler);},
remove_valueChanged : function(handler) {
this.get_events().removeHandler('valueChanged', handler);},
add_slideStart : function(handler) {
this.get_events().addHandler('slideStart', handler);},
remove_slideStart : function(handler) {
this.get_events().removeHandler('slideStart', handler);},
add_slideEnd : function(handler) {
this.get_events().addHandler('slideEnd', handler);},
remove_slideEnd : function(handler) {
this.get_events().removeHandler('slideEnd', handler);},
_raiseEvent : function(eventName, eventArgs) {
var handler = this.get_events().getHandler(eventName);if (handler) {
if (!eventArgs) {
eventArgs = Sys.EventArgs.Empty;}
handler(this, eventArgs);}
},
get_leftValue : function() {
return this._leftValue;},
set_leftValue : function(value) {
var oldValue = this._leftValue;var newValue = value;if(!this._isUpdatingInternal) {
newValue = this._calcLeftValue(value);}
if( oldValue!=newValue)
{
this.get_leftElement().value = this._leftValue = newValue.toFixed(this._decimals);this._ensureLeftBinding();}
if(!Number.isInstanceOfType(this._leftValue)) {
try {
this._leftValue = parseFloat(this._leftValue);} catch(ex) {
this._leftValue = Number.NaN;}
}
if(this._isInitializedInternal) {
this._setLeftHandleOffset(newValue, this._enableLeftHandleAnimation && this._animationPending);if(this._isUpdatingInternal) {
if(!this._raiseChangeOnlyOnMouseUp) {
this._raiseLeftHandleChangedEvent();}
}
if(this._leftValue != oldValue) {
this._raiseEvent('valueChanged');}
} 
},
get_rightValue : function() {
return this._rightValue;},
set_rightValue : function(value) {
var oldValue = this._rightValue;var newValue = value;if(!this._isUpdatingInternal) {
newValue = this._calcRightValue(value);}
if( oldValue!=newValue)
{
this.get_rightElement().value = this._rightValue = newValue.toFixed(this._decimals);this._ensureRightBinding();} 
if(!Number.isInstanceOfType(this._rightValue)) {
try {
this._rightValue = parseFloat(this._rightValue);} catch(ex) {
this._rightValue = Number.NaN;}
}
if(this._isInitializedInternal) {
this._setRightHandleOffset(newValue, this._enableRightHandleAnimation && this._animationPending);if(this._isUpdatingInternal) {
if(!this._raiseChangeOnlyOnMouseUp) {
this._raiseRightHandleChangedEvent();}
}
if(this._rightValue != oldValue) {
this._raiseEvent('valueChanged');}
}
},
get_RailCssClass : function() {
return this._railCssClass;},
set_RailCssClass : function(value) {
this._railCssClass = value;}, 
get_LeftHandleImageUrl : function() {
return this._leftHandleImageUrl;},
set_LeftHandleImageUrl : function(value) {
this._leftHandleImageUrl = value;},
get_LeftHandleCssClass : function() {
return this._leftHandleCssClass;},
set_LeftHandleCssClass : function(value) {
this._leftHandleCssClass = value;},
get_RightHandleImageUrl : function() {
return this._rightHandleImageUrl;},
set_RightHandleImageUrl : function(value) {
this._rightHandleImageUrl = value;},
get_RightHandleCssClass : function() {
return this._rightHandleCssClass;},
set_RightHandleCssClass : function(value) {
this._rightHandleCssClass = value;},
get_Minimum : function() {
return this._minimum;},
set_Minimum : function(value) {
this._minimum = value;}, 
get_Maximum : function() {
return this._maximum;},
set_Maximum : function(value) {
this._maximum = value;},
get_Orientation : function() {
return this._orientation;},
set_Orientation : function(value) {
this._orientation = value;},
get_Steps : function() {
return this._steps;},
set_Steps : function(value) {
this._steps = Math.abs(value);this._steps = (this._steps == 1) ? 2 : this._steps;},
get_Decimals : function() {
return this._decimals;},
set_Decimals : function(value) {
this._decimals = Math.abs(value);},
get_EnableLeftHandleAnimation : function() {
return this._enableLeftHandleAnimation;},
set_EnableLeftHandleAnimation : function(value) {
this._enableLeftHandleAnimation = value;},
get_LeftBoundControlID : function() {
return this._leftBoundControlID;},
set_LeftBoundControlID : function(value) {
this._leftBoundControlID = value;},
get_EnableRightHandleAnimation : function() {
return this._enableLeftHandleAnimation;},
set_EnableRightHandleAnimation : function(value) {
this._enableLeftHandleAnimation = value;},
get_RightBoundControlID : function() {
return this._rightBoundControlID;},
set_RightBoundControlID : function(value) {
this._rightBoundControlID = value;},
get_Length : function() {
return this._length;},
set_Length : function(value) {
this._length = value + 'px';},
get_RightHandleWidth : function() {
return this._rightHandleWidth;},
set_RightHandleWidth : function(value) { 
this._rightHandleWidth =value;},
get_SliderInitialized : function() {
return this._isInitializedInternal;},
get_RaiseChangeOnlyOnMouseUp : function() {
return this._raiseChangeOnlyOnMouseUp;},
set_RaiseChangeOnlyOnMouseUp : function(value) {
this._raiseChangeOnlyOnMouseUp = value;},
get_LeftHandleAnimationDuration : function() {
return this._leftHandleAnimationDuration;},
set_LeftHandleAnimationDuration : function(value) {
this._leftHandleAnimationDuration = value;},
get_RightHandleAnimationDuration : function() {
return this._leftHandleAnimationDuration;},
set_RightHandleAnimationDuration : function(value) {
this._leftHandleAnimationDuration = value;},
get_leftElement : function()
{
return document.getElementById(this.get_LeftBoundControlID());},
get_rightElement : function()
{
return document.getElementById(this.get_RightBoundControlID());} , 
getClientState : function() {
var value = AjaxControlToolkit.DualSliderBehavior.callBaseMethod(this, 'get_ClientState');if (value == '') value = null;return value;},
setClientState : function(value) {
AjaxControlToolkit.DualSliderBehavior.callBaseMethod(this, 'set_ClientState',[value]);}
}
AjaxControlToolkit.DualSliderBehavior.DropPending = null;AjaxControlToolkit.DualSliderBehavior.registerClass('AjaxControlToolkit.DualSliderBehavior', AjaxControlToolkit.BehaviorBase, AjaxControlToolkit.IDragSource, AjaxControlToolkit.IDropTarget);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();