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;
}};
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;
this.repaint=this.redraw;
};
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.getBounds(this._trackElement);
var _12=(this._isHorizontal)?_10:_11.width;
var _13=(!this._isHorizontal)?_10:_11.height;
if(_12>0&&_13>0){
$telerik.setSize(this._trackElement,{width:_12,height:_13});
}
},_initializeSlider:function(){
this._initializeDragHelper();
Telerik.Web.SliderDragDropManagerInternal.registerDropTarget(this);
if(this._enabled){
this._initializeEventHandlers();
this._initializeAnimation();
}
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.getBounds(this._dragHandleElement);
$telerik.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.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.isFirefox){
$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){
var _48=this._getTrackBounds();
if(_48.width<1||_48.height<1){
return;
}
this._animationPending=true;
var _49=this._value;
var _4a=evt.rawEvent;
var _4b=(_4a.wheelDelta)?_4a.wheelDelta:_4a.detail;
if(Sys.Browser.agent==Sys.Browser.InternetExplorer){
_4b*=-1;
}
var _4c=_49+((_4b>0)?this._slideStep:(-1)*this._slideStep);
this._calcValue(_4c);
evt.preventDefault();
},_onDecreaseMouseDown:function(evt){
this._onIncreaseDecreaseMDown(evt,false);
},_onIncreaseMouseDown:function(evt){
this._onIncreaseDecreaseMDown(evt,true);
},_onIncreaseDecreaseMDown:function(evt,_50){
if(evt.button!=0){
return;
}
this._incdecreaseMouseDownDone=false;
this._inSlidingMode=true;
this._valueOnSlideStart=this.get_value();
var _51=this;
function _tmp(_52){
if(_51._incdecreaseMouseDownDone){
_51._inSlidingMode=false;
clearTimeout(_51._increaseMDownInterval);
if(_51._valueOnSlideStart!=_51.get_value()&&_51._autoPostBack){
_51._raiseValueChangedServerEvent();
}
return;
}
_51._doSmallStep(_50);
_51._increaseMDownInterval=setTimeout(_tmp,(_52)?_52:50);
}
_tmp(300);
},_doSmallStep:function(_53){
var _54=this._slideStep;
if(!_53){
_54*=-1;
}
this._animationPending=true;
this._calcValue(this._value+_54);
},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 _55=this._getBoundsInternal(this._dragHelper);
var _56=this._getTrackBounds();
if(_56.width<1||_56.height<1){
return;
}
var _57;
if(this._isHorizontal){
_57={x:_55.x-_56.x,y:0};
}else{
_57={y:_55.x-_56.x,x:0};
}
if(this._showDragHandle){
$telerik.setLocation(this._dragHandleElement,_57);
}
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(_58,_59){
return _59=="HTML";
},drop:function(){
},onDragEnterTarget:function(){
},onDragLeaveTarget:function(){
},onDragInTarget:function(){
},add_loaded:function(_5a){
this.get_events().addHandler("loaded",_5a);
},remove_loaded:function(_5b){
this.get_events().removeHandler("loaded",_5b);
},add_slideStart:function(_5c){
this.get_events().addHandler("slideStart",_5c);
},remove_slideStart:function(_5d){
this.get_events().removeHandler("slideStart",_5d);
},add_slide:function(_5e){
this.get_events().addHandler("slide",_5e);
},remove_slide:function(_5f){
this.get_events().removeHandler("slide",_5f);
},add_slideEnd:function(_60){
this.get_events().addHandler("slideEnd",_60);
},remove_slideEnd:function(_61){
this.get_events().removeHandler("slideEnd",_61);
},add_valueChange:function(_62){
this.get_events().addHandler("valueChange",_62);
},remove_valueChange:function(_63){
this.get_events().removeHandler("valueChange",_63);
},get_value:function(){
return this._value;
},set_value:function(_64){
if(isNaN(parseInt(_64,10))){
return;
}
if(_64<this._minimumValue){
_64=this._minimumValue;
}
if(_64>this._maximumValue){
_64=this._maximumValue;
}
if(!this._initialized){
this._value=_64;
return;
}
var _65=_64;
if(!this._isUpdatingInternal){
_65=this._calcValue(_64);
}
var _66=this._value;
this._value=_65.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!=_66){
var _67=new Telerik.Web.UI.SliderValueChangeEventArgs(_66);
this.raiseEvent("valueChange",_67);
if(!this._inSlidingMode&&this._autoPostBack){
this._raiseValueChangedServerEvent();
}
}
},get_minimumValue:function(){
return this._minimumValue;
},set_minimumValue:function(_68){
if(isNaN(parseInt(_68,10))){
return;
}
this._minimumValue=_68;
this.updateClientState();
},get_maximumValue:function(){
return this._maximumValue;
},set_maximumValue:function(_69){
if(isNaN(parseInt(_69,10))){
return;
}
this._maximumValue=_69;
this.updateClientState();
},get_orientation:function(){
return this._orientation;
},set_orientation:function(_6a){
this._orientation=_6a;
this._isHorizontal=(this._orientation==Telerik.Web.UI.Orientation.Horizontal);
this.updateClientState();
},get_animationDuration:function(){
return this._animationDuration*1000;
},set_animationDuration:function(_6b){
if(isNaN(parseInt(_6b,10))||_6b<0){
throw Error.argumentOutOfRange("value",_6b,"AnimationDuration should be positive integer");
}
_6b=_6b/1000;
this._animationDuration=_6b;
this._useAnimation=(this._animationDuration>0);
this.updateClientState();
},get_length:function(){
return this._length;
},set_length:function(_6c){
if(isNaN(parseInt(_6c,10))||_6c<1){
throw Error.argumentOutOfRange("value",_6c,"Length should be an integer bigger than 1");
}
this._length=_6c;
this.updateClientState();
},get_showDecreaseHandle:function(){
return this._showDecreaseHandle;
},set_showDecreaseHandle:function(_6d){
this._showDecreaseHandle=_6d;
this.updateClientState();
},get_showIncreaseHandle:function(){
return this._showIncreaseHandle;
},set_showIncreaseHandle:function(_6e){
this._showIncreaseHandle=_6e;
this.updateClientState();
},get_showDragHandle:function(){
return this._showDragHandle;
},set_showDragHandle:function(_6f){
this._showDragHandle=_6f;
this.updateClientState();
},get_trackMouseWheel:function(){
return this._trackMouseWheel;
},set_trackMouseWheel:function(_70){
this._trackMouseWheel=_70;
this.updateClientState();
},get_clickOffset:function(){
return this._clickOffset;
},set_clickOffset:function(_71){
if(isNaN(parseInt(_71,10))||_71<0){
throw Error.argumentOutOfRange("value",_71,"ClickOffset should be positive integer");
}
this._clickOffset=_71;
this.updateClientState();
},get_slideStep:function(){
return this._slideStep;
},set_slideStep:function(_72){
if(isNaN(parseInt(_72,10))||_72<1){
throw Error.argumentOutOfRange("value",_72,"SlideStep should be integer bigger than 1");
}
this._slideStep=_72;
this.updateClientState();
},get_enabled:function(){
return this._enabled;
},set_enabled:function(_73){
this._enabled=_73;
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 _74=["value","enabled","slideStep","clickOffset","trackMouseWheel","showDragHandle","showDecreaseHandle","showIncreaseHandle","length","animationDuration","minimumValue","maximumValue","orientation"];
var _75={};
for(var i=0;i<_74.length;i++){
_75[_74[i]]=this["get_"+_74[i]]();
}
return Sys.Serialization.JavaScriptSerializer.serialize(_75);
}};
Telerik.Web.UI.RadSlider.DropPending=null;
Telerik.Web.UI.RadSlider.registerClass("Telerik.Web.UI.RadSlider",Telerik.Web.UI.RadWebControl,Telerik.Web.IDragSource,Telerik.Web.IDropTarget);

