function cs_slidebarondragstart(idInput,imgElt,forceint) { imgElt.style.zIndex=1; } function cs_slidebarondrag(idInput,imgElt,e,forceint) { if(!e){e=window.event;} try{ e.returnValue=false; }catch(err){} var dwidth=document.getElementById(idInput+"TD").offsetWidth; var min=parseFloat(document.getElementById(idInput+"MIN").value); var max=parseFloat(document.getElementById(idInput+"MAX").value); if(imgElt.style.zIndex==1){ var pos=document.body.scrollLeft-cs_getWindowOffsetLeft(imgElt.offsetParent)+ e.clientX; var range=max-min; var f=dwidth/range; if(pos>=0 && pos<=dwidth){ imgElt.style.left=pos-imgElt.width/2; imgElt.title=pos/f+min; if(forceint==1){ document.getElementById(idInput).value=parseInt(pos/f+min); } else{ document.getElementById(idInput).value=(pos/f)+min; } } } } function cs_slidebarondragend(idInput,imgElt,forceint) { imgElt.style.zIndex=0; var dwidth=document.getElementById(idInput+"TD").offsetWidth; var min=parseFloat(document.getElementById(idInput+"MIN").value); var max=parseFloat(document.getElementById(idInput+"MAX").value); var range=max-min; var f=dwidth/range; var pos=(document.getElementById(idInput).value-min)*f; if(pos<0){ pos=0; document.getElementById(idInput).value=min; } if(pos>dwidth){ pos=dwidth; document.getElementById(idInput).value=max; } if(pos>=0 && pos<=dwidth){ imgElt.title=document.getElementById(idInput).value; imgElt.style.left=pos-imgElt.width/2; } } function cs_getWindowOffsetLeft(obj) { var off=obj.offsetLeft; if(obj.offsetParent){ off+=cs_getWindowOffsetLeft(obj.offsetParent); } return off; }