var g_bSliderDrag=false;var g_sliderPos=0;function OnSliderDocMouseMove(){if(g_bSliderDrag){return false}}function OnReleaseSlider(){if(g_bSliderDrag){g_bSliderDrag=false}}function OnButtonDownSlider(c,b,d,a){g_bSliderDrag=true;d.style.display="";document.onmousemove=function(){if(g_bSliderDrag){return false}};document.onmouseup=function(){if(g_bSliderDrag){g_bSliderDrag=false;d.style.display="none"}};OnScrollSlider(c,b,d,a)}function OnScrollSlider(e,b,j,h){var a=h?h:(window.event?window.event:null);if(g_bSliderDrag){var c=e.offsetLeft+1;var d=e.offsetParent;while(d.offsetParent!=null){c+=d.offsetLeft+1;d=d.offsetParent}var f=0;if((a.clientX<(c+e.offsetWidth-b.offsetWidth))&&(a.clientX>=c)){f=a.clientX-c+parseInt(e.style.left,10);b.style.left=f+"px";j.innerHTML=e.rangeMin+Math.round((a.clientX-c)*(e.rangeMax-e.rangeMin)/(e.offsetWidth-b.offsetWidth))}else{if(a.clientX>=(c+e.offsetWidth-b.offsetWidth)){f=e.offsetWidth-b.offsetWidth+parseInt(e.style.left,10);b.style.left=f+"px";j.innerHTML=e.rangeMax}else{if(a.clientX<c){f=parseInt(e.style.left,10);b.style.left=f+"px";j.innerHTML=e.rangeMin}}}var g=parseInt(b.style.left,10);j.style.left=g+"px";var i=parseInt(b.style.top,10)-20;j.style.top=i+"px"}}function CreateSlider(a,b,d,f,g,e,c){b.onmousedown=function(h){g_sliderPos=GetSliderPos(b,d);OnButtonDownSlider(b,d,f,h)};b.onmousemove=function(h){g_sliderPos=GetSliderPos(b,d);OnScrollSlider(b,d,f,h)};d.onmousedown=function(h){g_sliderPos=GetSliderPos(b,d);OnButtonDownSlider(b,d,f,h)};d.onmousemove=function(h){g_sliderPos=GetSliderPos(b,d);OnScrollSlider(b,d,f,h)};b.onmouseup=function(h){if(g_bSliderDrag&&(c!=null)){if(!c()){SetSliderPos(b,d,g_sliderPos)}}};d.onmouseup=function(h){if(g_bSliderDrag&&(c!=null)){if(!c()){SetSliderPos(b,d,g_sliderPos)}}};b.rangeMin=g;b.rangeMax=e}function GetSliderPos(b,a){return b.rangeMin+Math.round((parseInt(a.style.left,10)-parseInt(b.style.left,10))*(b.rangeMax-b.rangeMin)/(b.offsetWidth-a.offsetWidth))}function SetSliderPos(c,a,d){if(d<c.rangeMin){d=c.rangeMin}if(d>c.rangeMax){d=c.rangeMax}var b=Math.round((c.offsetWidth-a.offsetWidth)*(d-c.rangeMin)/(c.rangeMax-c.rangeMin))+parseInt(c.style.left,10);a.style.left=b+"px"};