var g_bSliderDrag=false;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){var i=GetSliderPos(b,d);OnButtonDownSlider(b,d,f,h);if(g_bSliderDrag&&(c!=null)){if(!c()){SetSliderPos(b,d,i)}}};b.onmousemove=function(h){var i=GetSliderPos(b,d);OnScrollSlider(b,d,f,h);if(g_bSliderDrag&&(c!=null)){if(!c()){SetSliderPos(b,d,i)}}};d.onmousedown=function(h){var i=GetSliderPos(b,d);OnButtonDownSlider(b,d,f,h);if(g_bSliderDrag&&(c!=null)){if(!c()){SetSliderPos(b,d,i)}}};d.onmousemove=function(h){var i=GetSliderPos(b,d);OnScrollSlider(b,d,f,h);if(g_bSliderDrag&&(c!=null)){if(!c()){SetSliderPos(b,d,i)}}};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"};