﻿Type.registerNamespace("Telerik.Web");
Telerik.Web.UI.SliderValueChangeEventArgs=function(_1){
Telerik.Web.UI.SliderValueChangeEventArgs.initializeBase(this);
this._oldValue=_1;
};
Telerik.Web.UI.SliderValueChangeEventArgs.prototype={get_oldValue:function(){
return this._oldValue;
}};
$telerikCommon.makeCompatible(Telerik.Web.UI.SliderValueChangeEventArgs);
Telerik.Web.UI.SliderValueChangeEventArgs.registerClass("Telerik.Web.UI.SliderValueChangeEventArgs",Sys.EventArgs);
Telerik.Web._SliderDragDropManagerInternal=function(){
Telerik.Web._SliderDragDropManagerInternal.initializeBase(this);
this._instance=null;
};
Telerik.Web._SliderDragDropManagerInternal.prototype={_getInstance:function(){
this._instance=new Telerik.Web.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;
}};
Telerik.Web._SliderDragDropManagerInternal.registerClass("Telerik.Web._SliderDragDropManagerInternal",Telerik.Web._DragDropManager);
Telerik.Web.SliderDragDropManagerInternal=new Telerik.Web._SliderDragDropManagerInternal();
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadSlider=function(_2){
Telerik.Web.UI.RadSlider.initializeBase(this,[_2]);
this._minimumValue=0;
this._maximumValue=100;
this._value=0;
this._orientation=Telerik.Web.UI.Orientation.Horizontal;
this._isHorizontal=true;
this._animationDuration=0.1;
this._useAnimation=true;
this._showDecreaseHandle=true;
this._showIncreaseHandle=true;
this._showDragHandle=true;
this._enabled=true;
this._slideStep=1;
this._clickOffset=0;
this._trackMouseWheel=true;
this._length=200;
this._skin="Default";
this._trackMouseDownDone=false;
this._autoPostBack=false;
this._wrapperElement=null;
this._dragHandleElement=null;
this._mouseupHandler=null;
this._selectstartHandler=null;
this._animationPending=false;
this._selectstartPending=false;
this._inSlidingMode=false;
this._inRedrawMode=false;
this._dragText="";
this._increaseText="";
this._decreaseText="";
this._uniqueID=null;
};
Telerik.Web.UI.RadSlider.prototype={updated:function(){
this.set_value(this._value);
Telerik.Web.UI.RadSlider.callBaseMethod(this,"updated");
},initialize:function(){
Telerik.Web.UI.RadSlider.callBaseMethod(this,"initialize");
if(this._minimumValue>this._maximumValue){
throw Error.argumentOutOfRange("_minimumValue",this._minimumValue,"MinimumValue should be smaller than MaximumValue");
}
this._initializeLayout();
this._initializeSlider();
},dispose:function(){
this._disposeSlider();
Telerik.Web.UI.RadSlider.callBaseMethod(this,"dispose");
},_disposeSlider:function(){
this._disposeHandlers();
if(this._dragHandleAnimation){
this._dragHandleAnimation.dispose();
}
if(this._selectedRegionAnimation){
this._selectedRegionAnimation.dispose();
}
clearTimeout(this._increaseMDownInterval);
clearTimeout(this._decreaseMDownInterval);
clearTimeout(this._mDownInterval);
Telerik.Web.SliderDragDropManagerInternal._getInstance().dispose();
if(this._dragHelper){
document.body.removeChild(this._dragHelper);
}
if(this._wrapperElement){
this._wrapperElement.parentNode.removeChild(this._wrapperElement);
}
this._dragHandleElement=null;
this._decreaseHandleElement=null;
this._increaseHandleElement=null;
this._trackElement=null;
this._selectedRegionElement=null;
this._wrapperElement=null;
},_initializeLayout:function(){
var _3=this.get_element();
this._wrapperElement=document.createElement("DIV");
var _4="RadSliderWrapper_"+this.get_id();
var _5="RadSliderDecrease_"+this.get_id();
var _6="RadSliderIncrease_"+this.get_id();
var _7="RadSliderTrack_"+this.get_id();
var _8="RadSliderSelected_"+this.get_id();
var _9="RadSliderDrag_"+this.get_id();
var _a=(this._isHorizontal)?"horizontal":"vertical";
var _b=(!this._enabled)?"disabled":"";
this._wrapperElement.id=_4;
this._wrapperElement.className="radslider RadSlider_"+this._skin+" "+_a+" "+_b;
this._wrapperElement.setAttribute("unselectable","on");
this._wrapperElement.innerHTML=((this._showDecreaseHandle)?"<a onmouseup=\"this.blur();\"\tid=\""+_5+"\" href=\"javascript: void(0);\" class=\"handle decrease\" title=\""+this._decreaseText+"\"><span>"+this._decreaseText+"</span></a>":"")+"<span unselectable=\"on\" id=\""+_7+"\"  class=\"track\">"+"<div id=\""+_8+"\" class=\"selectedregion\"><!-- --></div>"+((this._showDragHandle)?"<a onmouseup=\"this.blur();\" id=\""+_9+"\" href=\"javascript: void(0);\" class=\"draghandle\" title=\""+this._dragText+"\"><span>"+this._dragText+"</span></a>":"")+"</span>"+((this._showIncreaseHandle)?"<a onmouseup=\"this.blur();\" id=\""+_6+"\" href=\"javascript: void(0);\" class=\"handle increase\" title=\""+this._increaseText+"\"><span>"+this._increaseText+"</span></a>":"");
_3.parentNode.insertBefore(this._wrapperElement,_3);
_3.style.display="none";
this._dragHandleElement=$get(_9);
this._decreaseHandleElement=$get(_5);
this._increaseHandleElement=$get(_6);
this._trackElement=$get(_7);
this._selectedRegionElement=$get(_8);
var _c=(this._isHorizontal)?"left":"top";
var _d=(this._isHorizontal)?"width":"height";
if(!this._showDecreaseHandle){
this._trackElement.style[_c]="0px";
}
this._wrapperElement.style[_d]=this.get_length()+"px";
var _e=(this._showIncreaseHandle)?this._getIncreaseHandleBounds().width:0;
var _f=(this._showDecreaseHandle)?this._getDecreaseHandleBounds().width:0;
var _10=this.get_length()-_f-_e;
var _11=Telerik.Web.DomElement.getBounds(this._trackElement);
var _12=(this._isHorizontal)?_10:_11.width;
var _13=(!this._isHorizontal)?_10:_11.height;
if(_12!=0&&_13!=0){
TelerikCommonScripts.setSize(this._trackElement,{width:_12,height:_13});
}
},_initializeSlider:function(){
this._initializeDragHelper();
Telerik.Web.SliderDragDropManagerInternal.registerDropTarget(this);
if(this._enabled){
this._initializeEventHandlers();
this._initializeAnimation();
}
this.get_element().RadShow=Function.createDelegate(this,this.redraw);
if(!this._inRedrawMode){
this.raiseEvent("loaded");
}
},_initializeDragHelper:function(){
var dh=this._dragHelper=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";
document.body.appendChild(this._dragHelper);
},_resetDragHandle:function(){
if(!this._showDragHandle){
return;
}
var _15=Telerik.Web.DomElement.getBounds(this._dragHandleElement);
TelerikCommonScripts.setLocation(this._dragHelper,{x:_15.x,y:_15.y});
},_initializeAnimation:function(){
var fps=100;
if(this._showDragHandle){
this._dragHandleAnimation=new Telerik.Web.Animation.LengthAnimation(this._dragHandleElement,this._animationDuration,fps,"style");
}
this._selectedRegionAnimation=new Telerik.Web.Animation.LengthAnimation(this._selectedRegionElement,this._animationDuration,fps,"style");
},_getBoundsInternal:function(_17){
var _18=Telerik.Web.DomElement.getBounds(_17);
if(this._orientation==Telerik.Web.UI.Orientation.Vertical){
_18={x:_18.y,y:_18.x,height:_18.width,width:_18.height,right:_18.right,bottom:_18.bottom,location:{x:_18.y,y:_18.x},size:{width:_18.height,height:_18.width}};
}
return _18;
},_getTrackBounds:function(){
var _19=this._getBoundsInternal(this._trackElement);
return _19;
},_getDragHandleBounds:function(){
if(!this._showDragHandle){
var _1a={x:0,y:0,height:0,width:0,right:0,bottom:0,location:{x:0,y:0},size:{width:0,height:0}};
return _1a;
}
return this._getBoundsInternal(this._dragHandleElement);
},_getDecreaseHandleBounds:function(){
return this._getBoundsInternal(this._decreaseHandleElement);
},_getIncreaseHandleBounds:function(){
return this._getBoundsInternal(this._increaseHandleElement);
},_initializeEventHandlers:function(){
this._selectstartHandler=Function.createDelegate(this,this._onSelectStart);
this._mouseupHandler=Function.createDelegate(this,this._onMouseUp);
$addHandler(document,"mouseup",this._mouseupHandler);
if(this._showDragHandle){
$addHandlers(this._dragHandleElement,{"mousedown":this._onMouseDown,"dragstart":this._IEDragDropHandler,"drag":this._IEDragDropHandler,"dragend":this._IEDragDropHandler},this);
}
$addHandlers(this._trackElement,{"mousedown":this._onTrackMouseDown},this);
if(this._trackMouseWheel){
$addHandlers(this._trackElement,{"mousewheel":this._onMouseWheel},this);
if(Telerik.Web.Browser.agent==Telerik.Web.Browser.Firefox){
$addHandlers(this._trackElement,{"DOMMouseScroll":this._onMouseWheel},this);
}
}
if(this._showDecreaseHandle){
$addHandlers(this._decreaseHandleElement,{"mousedown":this._onDecreaseMouseDown},this);
}
if(this._showIncreaseHandle){
$addHandlers(this._increaseHandleElement,{"mousedown":this._onIncreaseMouseDown},this);
}
},_disposeHandlers:function(){
try{
$clearHandlers(this._dragHandleElement);
$clearHandlers(this._trackElement);
$clearHandlers(this._decreaseHandleElement);
$clearHandlers(this._increaseHandleElement);
$clearHandlers(this._selectedRegionElement);
$removeHandler(document,"mouseup",this._mouseupHandler);
this._mouseupHandler=null;
this._selectstartHandler=null;
}
catch(e){
}
},_raiseValueChangedServerEvent:function(){
__doPostBack(this._uniqueID);
},startDragDrop:function(_1b){
this._resetDragHandle();
Telerik.Web.SliderDragDropManagerInternal.startDragDrop(this,_1b,null);
},_onMouseDown:function(evt){
if(evt.button!=0){
return;
}
window._event=evt;
evt.preventDefault();
if(!Telerik.Web.UI.RadSlider.DropPending){
Telerik.Web.UI.RadSlider.DropPending=this;
$addHandler(document,"selectstart",this._selectstartHandler);
this._selectstartPending=true;
this.startDragDrop(this._dragHelper);
}
},_onMouseUp:function(evt){
this._trackMouseDownDone=true;
this._incdecreaseMouseDownDone=true;
if(Telerik.Web.UI.RadSlider.DropPending==this){
Telerik.Web.UI.RadSlider.DropPending=null;
if(this._selectstartPending){
$removeHandler(document,"selectstart",this._selectstartHandler);
}
if(this._dragHandleElement){
this._dragHandleElement.blur();
}
if(this._decreaseHandleElement){
this._decreaseHandleElement.blur();
}
if(this._increaseHandleElement){
this._increaseHandleElement.blur();
}
}
},_IEDragDropHandler:function(evt){
evt.preventDefault();
},_onSelectStart:function(evt){
evt.preventDefault();
},_calcValue:function(_20,_21){
var _22;
if(_20!=null){
if(!Number.isInstanceOfType(_20)){
try{
_20=parseFloat(_20);
}
catch(ex){
_20=Number.NaN;
}
}
if(isNaN(_20)){
_20=this._minimumValue;
}
_22=(_20<this._minimumValue)?this._minimumValue:(_20>this._maximumValue)?this._maximumValue:_20;
}else{
var _23=this._minimumValue;
var _24=this._maximumValue;
var _25=this._getDragHandleBounds();
var _26=this._getTrackBounds();
var _27=(_21)?_21-_25.width/2:_25.x-_26.x;
var _28=_26.width-_25.width;
var _29=_27/_28;
_22=(_27==0)?_23:(_27==(_26.width-_25.width))?_24:_23+_29*(_24-_23);
}
_22=this._getNearestStepValue(_22);
_22=(_22<this._minimumValue)?this._minimumValue:(_22>this._maximumValue)?this._maximumValue:_22;
this._isUpdatingInternal=true;
this.set_value(_22);
this._isUpdatingInternal=false;
return _22;
},_setHandlePosition:function(_2a){
var _2b=this._minimumValue;
var _2c=this._maximumValue;
var _2d=this._getDragHandleBounds();
var _2e=this._getTrackBounds();
var _2f=_2c-_2b;
var _30=(this._value-_2b)/_2f;
var _31=parseInt(_30*(_2e.width-_2d.width));
var _32=(this._value==_2b)?0:(this._value==_2c)?(_2e.width-_2d.width):_31;
if(_2a){
var _33=this._getBoundsInternal(this._selectedRegionElement).width;
if(this._showDragHandle){
_33=_2d.x-_2e.x;
this._dragHandleAnimation.set_startValue(_33);
this._dragHandleAnimation.set_endValue(_32);
this._dragHandleAnimation.set_propertyKey((this._isHorizontal)?"left":"top");
this._dragHandleAnimation.play();
}
this._selectedRegionAnimation.set_startValue(_33);
this._selectedRegionAnimation.set_endValue(_32+_2d.width/2);
this._selectedRegionAnimation.set_propertyKey((this._isHorizontal)?"width":"height");
this._selectedRegionAnimation.play();
this._animationPending=false;
}else{
if(this._isHorizontal){
if(this._showDragHandle){
this._dragHandleElement.style.left=_32+"px";
}
this._selectedRegionElement.style.width=_32+_2d.width/2+"px";
}else{
if(this._showDragHandle){
this._dragHandleElement.style.top=_32+"px";
}
this._selectedRegionElement.style.height=_32+_2d.width/2+"px";
}
}
},_getNearestStepValue:function(_34){
var _35=this._maximumValue-this._minimumValue;
if(_35==0){
return _34;
}
if(_34>=this._maximumValue){
return this._maximumValue;
}
if(_34<=this._minimumValue){
return this._minimumValue;
}
_34-=this._minimumValue;
var _36=(_34-parseInt(_34/this._slideStep)*this._slideStep);
if(_36==0){
return (_34+this._minimumValue);
}
var _37=this._slideStep-_36;
if(_36<this._slideStep/2){
_37=-1*_36;
}
var _38=_34+_37+this._minimumValue;
return _38;
},_onTrackMouseDown:function(evt){
if(evt.button!=0){
return;
}
if(evt.target!=this._trackElement&&evt.target!=this._selectedRegionElement){
return;
}
this._animationPending=true;
var _3a=this._getDragHandleBounds();
var _3b=this._getTrackBounds();
var _3c=(this._isHorizontal)?evt.offsetX:evt.offsetY;
var _3d=_3a.width/2;
var _3e=_3b.width-_3d;
_3c=(_3c<_3d)?_3d:(_3c>_3e)?_3e:_3c;
if(this._clickOffset==0){
this._calcValue(null,_3c);
}else{
this._trackMouseDownDone=false;
var _3f=this;
var _40=this._getBoundsInternal(this._selectedRegionElement);
var _41=(_3c<_40.width);
function _tmp(_42){
var _43=_3f._getBoundsInternal(_3f._selectedRegionElement);
var _44=(_3c<_43.width);
if(_3f._trackMouseDownDone||_44!=_41){
clearTimeout(this._mDownInterval);
_3f._trackMouseDownDone=true;
return;
}
var _45=_3f._clickOffset;
if(_41){
_45*=-1;
}
var _46=_3f._value+_45;
_3f._calcValue(_46);
_3f._mDownInterval=setTimeout(_tmp,(_42)?_42:100);
}
_tmp(300);
}
},_onMouseWheel:function(evt){
this._animationPending=true;
var _48=this._value;
var _49=evt.rawEvent;
var _4a=(_49.wheelDelta)?_49.wheelDelta:_49.detail;
if(Sys.Browser.agent==Sys.Browser.InternetExplorer){
_4a*=-1;
}
var _4b=_48+((_4a>0)?this._slideStep:(-1)*this._slideStep);
this._calcValue(_4b);
evt.preventDefault();
},_onDecreaseMouseDown:function(evt){
this._onIncreaseDecreaseMDown(evt,false);
},_onIncreaseMouseDown:function(evt){
this._onIncreaseDecreaseMDown(evt,true);
},_onIncreaseDecreaseMDown:function(evt,_4f){
if(evt.button!=0){
return;
}
this._incdecreaseMouseDownDone=false;
this._inSlidingMode=true;
this._valueOnSlideStart=this.get_value();
var _50=this;
function _tmp(_51){
if(_50._incdecreaseMouseDownDone){
_50._inSlidingMode=false;
clearTimeout(_50._increaseMDownInterval);
if(_50._valueOnSlideStart!=_50.get_value()&&_50._autoPostBack){
_50._raiseValueChangedServerEvent();
}
return;
}
_50._doSmallStep(_4f);
_50._increaseMDownInterval=setTimeout(_tmp,(_51)?_51:50);
}
_tmp(300);
},_doSmallStep:function(_52){
var _53=this._slideStep;
if(!_52){
_53*=-1;
}
this._animationPending=true;
this._calcValue(this._value+_53);
},get_dragDataType:function(){
return "HTML";
},getDragData:function(){
return this._dragHandleElement;
},get_dragMode:function(){
return Telerik.Web.DragMode.Move;
},onDragStart:function(){
this._resetDragHandle();
this._valueOnSlideStart=this.get_value();
this._inSlidingMode=true;
this.raiseEvent("slideStart");
},onDrag:function(){
var _54=this._getBoundsInternal(this._dragHelper);
var _55=this._getTrackBounds();
var _56;
if(this._isHorizontal){
_56={x:_54.x-_55.x,y:0};
}else{
_56={y:_54.x-_55.x,x:0};
}
if(this._showDragHandle){
TelerikCommonScripts.setLocation(this._dragHandleElement,_56);
}
this._calcValue(null,null);
this.raiseEvent("slide");
},onDragEnd:function(){
this._inSlidingMode=false;
if(this._autoPostBack&&this._valueOnSlideStart!=this.get_value()){
this._raiseValueChangedServerEvent();
}
this.raiseEvent("slideEnd");
},get_dropTargetElement:function(){
return document.body;
},canDrop:function(_57,_58){
return _58=="HTML";
},drop:function(){
},onDragEnterTarget:function(){
},onDragLeaveTarget:function(){
},onDragInTarget:function(){
},add_loaded:function(_59){
this.get_events().addHandler("loaded",_59);
},remove_loaded:function(_5a){
this.get_events().removeHandler("loaded",_5a);
},add_slideStart:function(_5b){
this.get_events().addHandler("slideStart",_5b);
},remove_slideStart:function(_5c){
this.get_events().removeHandler("slideStart",_5c);
},add_slide:function(_5d){
this.get_events().addHandler("slide",_5d);
},remove_slide:function(_5e){
this.get_events().removeHandler("slide",_5e);
},add_slideEnd:function(_5f){
this.get_events().addHandler("slideEnd",_5f);
},remove_slideEnd:function(_60){
this.get_events().removeHandler("slideEnd",_60);
},add_valueChange:function(_61){
this.get_events().addHandler("valueChange",_61);
},remove_valueChange:function(_62){
this.get_events().removeHandler("valueChange",_62);
},get_value:function(){
return this._value;
},set_value:function(_63){
if(isNaN(parseInt(_63,10))){
return;
}
if(_63<this._minimumValue){
_63=this._minimumValue;
}
if(_63>this._maximumValue){
_63=this._maximumValue;
}
if(!this._initialized){
this._value=_63;
return;
}
var _64=_63;
if(!this._isUpdatingInternal){
_64=this._calcValue(_63);
}
var _65=this._value;
this._value=_64.toFixed(0);
if(!Number.isInstanceOfType(this._value)){
try{
this._value=parseFloat(this._value);
}
catch(ex){
this._value=Number.NaN;
}
}
this._setHandlePosition(this._useAnimation&&this._animationPending);
this.updateClientState();
if(this._value!=_65){
var _66=new Telerik.Web.UI.SliderValueChangeEventArgs(_65);
this.raiseEvent("valueChange",_66);
if(!this._inSlidingMode&&this._autoPostBack){
this._raiseValueChangedServerEvent();
}
}
},get_minimumValue:function(){
return this._minimumValue;
},set_minimumValue:function(_67){
if(isNaN(parseInt(_67,10))){
return;
}
this._minimumValue=_67;
this.updateClientState();
},get_maximumValue:function(){
return this._maximumValue;
},set_maximumValue:function(_68){
if(isNaN(parseInt(_68,10))){
return;
}
this._maximumValue=_68;
this.updateClientState();
},get_orientation:function(){
return this._orientation;
},set_orientation:function(_69){
this._orientation=_69;
this._isHorizontal=(this._orientation==Telerik.Web.UI.Orientation.Horizontal);
this.updateClientState();
},get_animationDuration:function(){
return this._animationDuration*1000;
},set_animationDuration:function(_6a){
if(isNaN(parseInt(_6a,10))||_6a<0){
throw Error.argumentOutOfRange("value",_6a,"AnimationDuration should be positive integer");
}
_6a=_6a/1000;
this._animationDuration=_6a;
this._useAnimation=(this._animationDuration>0);
this.updateClientState();
},get_length:function(){
return this._length;
},set_length:function(_6b){
if(isNaN(parseInt(_6b,10))||_6b<1){
throw Error.argumentOutOfRange("value",_6b,"Length should be an integer bigger than 1");
}
this._length=_6b;
this.updateClientState();
},get_showDecreaseHandle:function(){
return this._showDecreaseHandle;
},set_showDecreaseHandle:function(_6c){
this._showDecreaseHandle=_6c;
this.updateClientState();
},get_showIncreaseHandle:function(){
return this._showIncreaseHandle;
},set_showIncreaseHandle:function(_6d){
this._showIncreaseHandle=_6d;
this.updateClientState();
},get_showDragHandle:function(){
return this._showDragHandle;
},set_showDragHandle:function(_6e){
this._showDragHandle=_6e;
this.updateClientState();
},get_trackMouseWheel:function(){
return this._trackMouseWheel;
},set_trackMouseWheel:function(_6f){
this._trackMouseWheel=_6f;
this.updateClientState();
},get_clickOffset:function(){
return this._clickOffset;
},set_clickOffset:function(_70){
if(isNaN(parseInt(_70,10))||_70<0){
throw Error.argumentOutOfRange("value",_70,"ClickOffset should be positive integer");
}
this._clickOffset=_70;
this.updateClientState();
},get_slideStep:function(){
return this._slideStep;
},set_slideStep:function(_71){
if(isNaN(parseInt(_71,10))||_71<1){
throw Error.argumentOutOfRange("value",_71,"SlideStep should be integer bigger than 1");
}
this._slideStep=_71;
this.updateClientState();
},get_enabled:function(){
return this._enabled;
},set_enabled:function(_72){
this._enabled=_72;
this.updateClientState();
},Redraw:function(){
this.redraw();
},redraw:function(){
this._inRedrawMode=true;
this._disposeSlider();
this._initializeLayout();
this._initializeSlider();
this.set_value(this._value);
this._inRedrawMode=false;
},saveClientState:function(){
var _73=["value","enabled","slideStep","clickOffset","trackMouseWheel","showDragHandle","showDecreaseHandle","showIncreaseHandle","length","animationDuration","minimumValue","maximumValue","orientation"];
var _74={};
for(var i=0;i<_73.length;i++){
_74[_73[i]]=this["get_"+_73[i]]();
}
return Sys.Serialization.JavaScriptSerializer.serialize(_74);
}};
Telerik.Web.UI.RadSlider.DropPending=null;
$telerikCommon.makeCompatible(Telerik.Web.UI.RadSlider);
Telerik.Web.UI.RadSlider.registerClass("Telerik.Web.UI.RadSlider",Telerik.Web.UI.RadWebControl,Telerik.Web.IDragSource,Telerik.Web.IDropTarget);


if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();