function vi_controls(parentElement,player,width) { if(_isIe==true) try { document.execCommand("BackgroundImageCache", false, true) } catch(e) {}; if(!parentElement) { var parentElementId="vi_controls_"+(new Date()).valueOf()+Math.random(1000); var parentElement=document.createElement("div"); parentElement.setAttribute("id",parentElementId); document.body.appendChild(parentElement); } else if(typeof(parentElement)!="object") parentElement=document.getElementById(parentElement); player.attachEvent("onMuteOn",function() { this.controls.muteActive(); }); player.attachEvent("onMuteOff",function() { this.controls.muteInActive(); }); player.attachEvent("onVolumeSet",function(value) { this.controls.volumeSlider.setValue(value); }); player.attachEvent("onPositionChanged",function(position,duration,amountDownloaded) { this.controls.positionCell.innerHTML=this.controls.getFormattedPosition(position); if(this.controls.player.isLive=="true") this.controls.durationCell.innerHTML="Live"; else this.controls.durationCell.innerHTML=this.controls.getFormattedPosition(duration); this.controls.scrubSlider.setMax(duration * 100); if(this.controls.player.isLive=="true") { this.controls.scrubSlider.setValue(0); this.controls.scrubSlider.con.onmousedown=null; this.controls.scrubSlider.con.onmouseup=null; } else this.controls.scrubSlider.setValue(position * 100); }); player.attachEvent("onPlayItem",function(){this.controls.disableControls();}); player.attachEvent("onPlaying",function(){this.controls.enableControls();}); player.attachEvent("onCreatePlayer",function(hidden){this.controls.parent.style.display=hidden?'none':'block';}); player.attachEvent("onBuffering",function(){this.controls.playStateCell.innerHTML="";this.controls.playStateCell.innerHTML="Buffering";}); player.attachEvent("onStateChanged",function(state) { if(state=="Paused") { this.controls.onPause(); } }); player.attachEvent("onStateChanged",function(state) { if(state=="Playing") { this.controls.onResume(); } }); this.controlsContainer=null; this.durationCell=null; this.fullScreenControl=null; this.imagePath=""; this.isScrubbing=false; this.muteControl=null; this.parent=parentElement; this.player=player; this.player.controls=this; this.playPauseControl=null; this.playStateCell=null; this.positionCell=null; this.volumeControl=null; this.volumeSlider=null; this.volumeSliderContainer=null; this.scrubSlider=null; this.themeName="vi_basic"; this.width=width; this.mousedDownElement = ""; this.doneCreateWindowMouseUpEvent = false; return this; } String.prototype.pad=function(l, s){return(l-=this.length)>0?(s=new Array(Math.ceil(l/s.length)+1).join(s)).substr(0,s.length)+this+s.substr(0,l-s.length):this;}; vi_controls.prototype.disableControls=function() { if (this.volumeSliderContainer) { this.volumeSliderContainer.onmousedown=null; this.volumeSliderContainer.onmouseup=null; } if (this.playPauseControl) { this.playPauseControl.src=this.imagePath+"playDisabled.png"; this.playPauseControl.alt=""; this.playPauseControl.title=""; this.playPauseControl.setAttribute("class", ""); this.playPauseControl.onmouseover=null; this.playPauseControl.onmouseout=null; this.playPauseControl.onclick=null; } if (this.fullScreenControl) { this.fullScreenControl.src=this.imagePath+"fullScreenDisabled.png"; this.fullScreenControl.alt=""; this.fullScreenControl.title=""; this.fullScreenControl.setAttribute("class", ""); this.fullScreenControl.onmouseover=null; this.fullScreenControl.onmouseout=null; this.fullScreenControl.onclick=null; } if (this.muteControl) { this.muteControl.src=this.imagePath+"muteDisabled.png"; this.muteControl.alt=""; this.muteControl.title=""; this.muteControl.setAttribute("class", ""); this.muteControl.onmouseover=null; this.muteControl.onmouseout=null; this.muteControl.onclick=null; } if (this.volumeControl) { this.volumeControl.src=this.imagePath+"showVolumeDisabled.png"; this.volumeControl.alt=""; this.volumeControl.title=""; this.volumeControl.setAttribute("class", ""); this.volumeControl.onmouseover=null; this.volumeControl.onmouseout=null; this.volumeControl.onclick=null; } if (this.scrubSlider) { this.scrubSlider.con.onmousedown=null; this.scrubSlider.con.onmouseup=null; this.scrubSlider.con.setAttribute("class","dhtmlxSlider_simplesilver"); } } vi_controls.prototype.enableControls=function() { if (this.scrubSlider) { if (this.player.isLive=="true"||this.player.canSkip=="false") { this.scrubSlider.con.onmousedown=null; this.scrubSlider.con.onmouseup=null; } else { this.scrubSlider.con.onmousedown=this.scrubSlider._onMouseDown; this.scrubSlider.con.onmouseup=this.scrubSlider._onMouseUp; this.scrubSlider.con.setAttribute("class","dhtmlxSlider_simplesilver vi_controlHover"); } } if (this.playPauseControl) { this.playPauseControl.src=this.imagePath+"pause.png"; this.playPauseControl.alt= "Pause"; this.playPauseControl.title= "Pause"; this.playPauseControl.setAttribute("class", "vi_controlHover"); this.playPauseControl.onmouseover=function(){this.src=this.player.controls.imagePath+"pauseHover.png";}; this.playPauseControl.onmouseout=function(){this.src=this.player.controls.imagePath+"pause.png";}; this.playPauseControl.onclick=function() { var aa="aa"; this.player.controls.onPause(); }; } if (this.fullScreenControl) { if (this.isFullScreenAvailable == true) { this.fullScreenControl.style.visibility="visible"; this.fullScreenControl.src=this.imagePath+"fullScreen.png"; this.fullScreenControl.alt= "Full Screen"; this.fullScreenControl.title= "Full Screen"; this.fullScreenControl.setAttribute("class", "vi_controlHover"); this.fullScreenControl.onmouseover=function(){this.src=this.player.controls.imagePath+"fullScreenHover.png";}; this.fullScreenControl.onmouseout=function(){this.src=this.player.controls.imagePath+"fullScreen.png";}; this.fullScreenControl.onclick=function(){this.player.showFullScreen();}; } else { this.fullScreenControl.style.visibility="hidden"; } } if (this.muteControl) { this.muteControl.src=this.player.settings.isMuted?this.imagePath+"muteActive.png":this.imagePath+"mute.png"; this.muteControl.alt="Mute"; this.muteControl.title="Mute"; this.muteControl.setAttribute("class", "vi_controlHover"); this.muteControl.onmouseover=function() { if(this.player.settings.isMuted) this.src=this.player.controls.imagePath+"muteActiveHover.png"; else this.src=this.player.controls.imagePath+"muteHover.png"; }; this.muteControl.onmouseout=function() { if(this.player.settings.isMuted) this.src=this.player.controls.imagePath+"muteActive.png"; else this.src=this.player.controls.imagePath+"mute.png"; }; this.muteControl.onclick=function() { if(this.player.settings.isMuted) { this.src=this.player.controls.imagePath+"muteHover.png"; this.player.setMuteOff(); } else { this.player.setMuteOn(); this.src=this.player.controls.imagePath+"muteActiveHover.png"; } }; } if (this.volumeControl) { this.volumeControl.src=this.imagePath+"showVolume.png"; this.volumeControl.alt="Volume"; this.volumeControl.title="Volume"; this.volumeControl.setAttribute("class", "vi_controlHover"); this.volumeControl.onmouseover=function(){this.src=this.player.controls.imagePath+"showVolumeHover.png";}; this.volumeControl.onmouseout=function(){this.src=this.player.controls.imagePath+"showVolume.png";}; this.volumeControl.onclick=function() { var temp=this.player.controls.volumeSliderContainer.style; temp.visibility=temp.visibility=="visible"?"hidden":"visible"; this.player.controls.volumeSliderContainer.setAttribute("class","vi_controlHover"); }; } if (this.playStateCell) { this.playStateCell.innerHTML=""; } } vi_controls.prototype.formatDisplay=function() { if(this.controlsContainer) { this.controlsContainer.parentNode.removeChild(this.controlsContainer); this.controlsContainer=null }; this.controlsContainer=document.createElement("div"); this.controlsContainer.setAttribute("id",this.parent.id+"ControlsContainer"); this.parent.appendChild(this.controlsContainer); this.controlsContainer.style.width=this.width+"px"; var table=document.createElement("table"); table.setAttribute("id",this.parent.id+"ControlsTable"); table.setAttribute("class",this.themeName); this.controlsContainer.appendChild(table); table.display="block"; table.style.width=this.width+"px"; var tableBody=document.createElement("tbody"); table.appendChild(tableBody); var tableRow=document.createElement("tr"); tableBody.appendChild(tableRow); this.positionCell=document.createElement("td"); this.positionCell.setAttribute("id",this.parent.id+"Position"); this.positionCell.setAttribute("class",this.themeName+"_td"); tableRow.appendChild(this.positionCell); this.positionCell.style.width="30px"; this.positionCell.style.fontSize="10px"; this.positionCell.style.fontFamily="'Trebuchet MS', Tahoma, arial, sans-serif"; this.positionCell.innerHTML=this.getFormattedPosition(0); var tableCell=document.createElement("td"); tableCell.setAttribute("id",this.parent.id+"Scrub"); tableCell.setAttribute("class",this.themeName+"_td"); tableRow.appendChild(tableCell); tableCell.colSpan=3; tableCell.style.fontSize="10px"; tableCell.style.fontFamily="'Trebuchet MS', Tahoma, arial, sans-serif"; this.scrubContainer=document.createElement("div"); this.scrubContainer.setAttribute("id",this.parent.id+"scrubContainer"); tableCell.appendChild(this.scrubContainer); this.scrubSlider=new dhtmlxSlider(this.scrubContainer,this.width-110,"simplesilver",false,0,100,0,1,"s"); this.scrubSlider.setImagePath(this.imagePath); this.scrubSlider.init(); this.scrubSlider.attachEvent("onChange",function(position) { if(this.controls.player) { if(!this.isScrubbing) { if (this.controls.player.isLive=="false"&&this.controls.player.canSkip=="true") this.controls.player.setPosition(position/100); } } }); this.scrubSlider.setValue(0); this.scrubSlider.controls=this; this.durationCell=document.createElement("td"); this.durationCell.setAttribute("id",this.parent.id+"Length"); this.durationCell.setAttribute("class",this.themeName+"_td"); tableRow.appendChild(this.durationCell); this.durationCell.style.width="30px"; this.durationCell.style.fontSize="10px"; this.durationCell.style.fontFamily="'Trebuchet MS', Tahoma, arial, sans-serif"; this.durationCell.innerHTML=this.getFormattedPosition(0); tableRow=document.createElement("tr"); tableBody.appendChild(tableRow); tableCell=document.createElement("td"); tableCell.setAttribute("id",this.parent.id+"PlayPause"); tableCell.setAttribute("class",this.themeName+"_td"); tableRow.appendChild(tableCell); tableCell.style.width="24px"; this.playPauseControl=document.createElement("img"); this.playPauseControl.setAttribute("id",this.parent.id+"PlayPauseImg"); this.playPauseControl.setAttribute("src",this.imagePath+"playDisabled.png"); this.playPauseControl.player=this.player; this.playPauseControl.onclick=Function("this.player.resume();"); tableCell.appendChild(this.playPauseControl); this.playStateCell=document.createElement("td"); this.playStateCell.setAttribute("id",this.parent.id+"PlayState"); this.playStateCell.setAttribute("class",this.themeName+"_td"); tableRow.appendChild(this.playStateCell); this.playStateCell.style.width="100px"; tableCell=document.createElement("td"); tableCell.setAttribute("id",this.parent.id+"Empty"); tableCell.setAttribute("class",this.themeName+"_td"); tableRow.appendChild(tableCell); tableCell.style.width=(this.width-196)+"px"; tableCell=document.createElement("td"); tableCell.setAttribute("id",this.parent.id+"Volume"); tableCell.setAttribute("class",this.themeName+"_td"); tableRow.appendChild(tableCell); tableCell.style.width="24px"; var div=document.createElement("div"); div.setAttribute("id",this.parent.id+"VolumeContainer"); div.style.position="relative"; div.style.zIndex="100" tableCell.appendChild(div); this.volumeControl=document.createElement("img"); this.volumeControl.setAttribute("id",this.parent.id+"VolumeImg"); this.volumeControl.setAttribute("src",this.imagePath+"showVolumeDisabled.png"); this.volumeControl.player=this.player; div.appendChild(this.volumeControl); this.volumeSliderContainer=document.createElement("div"); this.volumeSliderContainer.setAttribute("id",this.parent.id+"volumeSliderContainer"); div.appendChild(this.volumeSliderContainer); this.volumeSliderContainer.style.left="-85px"; this.volumeSliderContainer.style.top="5px"; this.volumeSliderContainer.style.width="95px"; this.volumeSliderContainer.style.height="18px"; this.volumeSliderContainer.style.display="block"; this.volumeSliderContainer.style.visibility="hidden"; this.volumeSliderContainer.style.position="absolute"; this.volumeSlider=new dhtmlxSlider(this.volumeSliderContainer,70,"simplesilver",false,0,100,0,1,"v"); this.volumeSlider.setImagePath(this.imagePath); this.volumeSlider.init(); this.volumeSlider.attachEvent("onChange",this.onVolumeChange); this.volumeSlider.setValue(this.player.settings.volume); this.volumeSlider.controls=this; tableCell=document.createElement("td"); tableCell.setAttribute("id",this.parent.id+"Mute"); tableCell.setAttribute("class",this.themeName+"_td"); tableRow.appendChild(tableCell); tableCell.style.width="24px"; this.muteControl=document.createElement("img"); this.muteControl.setAttribute("id",this.parent.id+"MuteImg"); this.muteControl.setAttribute("src",this.imagePath+"muteDisabled.png"); this.muteControl.player=this.player; tableCell.appendChild(this.muteControl); this.disableControls(); } vi_controls.prototype.onMouseOut=function() { } vi_controls.prototype.getFormattedPosition=function(position) { return Math.floor(position/60).toFixed().pad(2,"0")+":"+(position%60).toFixed().pad(2,"0"); } vi_controls.prototype.initialise=function(name) { this.isInitialised=true; this.name=name; this.formatDisplay(); } vi_controls.prototype.muteActive=function() { this.muteControl.src=this.imagePath+"muteActive.png"; this.muteControl.alt="Mute"; this.muteControl.title="Mute"; this.muteControl.setAttribute("class", "vi_controlHover"); this.muteControl.onmouseover=function() { this.src=this.player.controls.imagePath+"muteActiveHover.png"; }; this.muteControl.onmouseout=function() { this.src=this.player.controls.imagePath+"muteActive.png"; }; this.muteControl.onclick=function() { this.player.setMuteOff(); } } vi_controls.prototype.muteInActive=function() { this.muteControl.src=this.imagePath+"mute.png"; this.muteControl.alt="Mute"; this.muteControl.title="Mute"; this.muteControl.setAttribute("class", "vi_controlHover"); this.muteControl.onmouseover=function() { this.src=this.player.controls.imagePath+"muteHover.png"; }; this.muteControl.onmouseout=function() { this.src=this.player.controls.imagePath+"mute.png"; }; this.muteControl.onclick=function() { this.player.setMuteOn(); } } vi_controls.prototype.onPause=function() { this.player.pause(); if (this.playPauseControl) { this.playPauseControl.src=this.imagePath+"play.png"; this.playPauseControl.alt="Play"; this.playPauseControl.title="Play"; this.playPauseControl.onmouseover=function(){this.src=this.player.controls.imagePath+"playHover.png";}; this.playPauseControl.onmouseout=function(){this.src=this.player.controls.imagePath+"play.png";}; this.playPauseControl.onclick=function() { this.player.controls.onResume(); }; } if (this.playStateCell) { this.playStateCell.innerHTML="Paused"; } } vi_controls.prototype.onResume=function() { this.isScrubbing=false; var scrubPosition=this.player.controls.scrubSlider.getValue()/100; this.player.setPosition(scrubPosition); if (this.playPauseControl) { this.playPauseControl.src=this.imagePath+"pause.png"; this.playPauseControl.alt="Pause"; this.playPauseControl.title="Pause"; this.playPauseControl.onmouseover=function(){this.src=this.player.controls.imagePath+"pauseHover.png";}; this.playPauseControl.onmouseout=function(){this.src=this.player.controls.imagePath+"pause.png";}; this.playPauseControl.onclick=function(){this.player.controls.onPause();}; } } vi_controls.prototype.onScrubMouseDown=function() { this.isScrubbing=true; this.onPause(); } vi_controls.prototype.onVolumeChange=function(volume) { var aa=volume; if(this.controls.player) { this.controls.player.setVolume(volume); this.controls.muteInActive(); this.controls.player.setMuteOff(); } } function dhtmlxSlider(parentNod,size,skin,vertical,min,max,value,step,tooltipFormat) { if(_isIe==true) try { document.execCommand("BackgroundImageCache", false, true) } catch (e) {}; if (!parentNod) { var z="slider_div_"+(new Date()).valueOf()+Math.random(1000); var parentNod=document.createElement ("div"); parentNod.setAttribute ("id", z); document.body.appendChild (parentNod) } else if (typeof(parentNod)!="object") parentNod=document.getElementById(parentNod); if (typeof(size)=="object") { skin=size.skin; min=size.min; max=size.max; step=size.step; vertical=size.vertical; ttf=tooltipFormat; value=size.value; size=size.size; }; this.size=size; this.value=value || 0; this.ttf=tooltipFormat; this.vMode= vertical||false; this.skin=skin || ""; this.parent=parentNod; this.isInit=false; this.value=value || min || 0; this.inputPriority=true; this.stepping=false; this.isScrubbing=false; this.imgURL=window.dhx_globalImgPath||""; this._def=[min,max,step,value,size]; return this }; dhtmlxSlider.prototype.createStructure=function() { if (this.con) { this.con.parentNode.removeChild(this.con); this.con=null }; if (this.vMode) { this._sW="height"; this._sH="width"; this._sL="top"; this._sT="left"; var skinImgPath=this.imgURL+"skins/"+(this.skin==""?"default":this.skin)+"/vertical/" } else { this._sW="width"; this._sH="height"; this._sL="left"; this._sT="top"; var skinImgPath=this.imgURL+"skins/"+(this.skin==""?"default":this.skin)+"/" }; this.con=document.createElement("DIV"); this.con.onselectstart=function(){return false}; this.con._etype="slider"; this.con.className="dhtmlxSlider" + (this.skin?"_"+this.skin:this.skin); this.con.style.background="url("+skinImgPath+"bg.gif)"; this.con.style.background="url("+skinImgPath+"rightzone_bg.gif)"; this.drag=document.createElement("DIV"); this.drag._etype="drag"; if(this.parent.id.indexOf("volume")==-1) this.drag.id=this.parent.id+"ScrubKnob"; this.drag.className="selector"; this.drag.style.backgroundImage="url("+skinImgPath+"selector.gif)"; var leftSide=document.createElement("DIV"); leftSide.className="leftSide"; leftSide.style.background="url("+skinImgPath+"leftside_bg.gif)"; this.leftZone=document.createElement("DIV"); this.leftZone.className="leftZone"; this.leftZone.style.background="url("+skinImgPath+"leftzone_bg.gif)"; this.leftZone.style.width=Math.abs(this.value) + 'px'; var rightSide=document.createElement("DIV"); rightSide.className="rightSide"; rightSide.style.background="url("+skinImgPath+"rightside_bg.gif)"; this.rightZone=document.createElement("DIV"); this.rightZone.className="rightZone"; this.rightZone.style.background="url("+skinImgPath+"rightzone_bg.gif)"; this.con.appendChild(leftSide); this.con.appendChild(this.leftZone); this.con.appendChild(this.rightZone); this.con.appendChild(rightSide); this.con.appendChild(this.drag); this.parent.appendChild(this.con); if (!this.parent.parentNode || !this.parent.parentNode.tagName) document.body.appendChild(this.parent); if (this.vMode) { this._sW="height"; this._sH="width"; this._sL="top"; this._sT="left"; this.con.style.width=this.con.offsetHeight + 'px'; for (var i=0;i this._def[1])this.value=this._def[1]; if (this.posX>this._xlimit)this.posX=this._xlimit; if (this.step!=1)this.posX=Math.round(this.posX/this.step)*this.step; var a_old=this.drag.style[this._sL]; this.drag.style[this._sL]=this.posX+this.dragLeft*1+"px"; var temp=this.posX+this.dragLeft*1; if(temp<0)temp=0; this.leftZone.style[this._sW]=temp+"px"; this.rightZone.style[this._sL]=temp+1+"px"; temp=this.zoneSize-(this.posX+this.dragLeft*1); if(temp<0)temp=0; this.rightZone.style[this._sW]=temp+"px"; var nw=this.getValue(); if (this._link) { if (this._linkBoth)this._link.value=nw; else this._link.innerHTML=nw }; if ((!skip)&&this.hasEvent("onChange")&&(a_old!=this.drag.style[this._sL])) this.callEvent("onChange",[nw,this]); this.value=this.getValue (); if(!this._dttp)this._setTooltip(nw) }; dhtmlxSlider.prototype._setTooltip=function(nw) { nw1=nw/100; switch(this.ttf) { case "s": this.con.title=Math.floor(nw1/60).toFixed().pad(2,"0")+":"+(nw1%60).toFixed().pad(2,"0"); break; case "v": this.con.title=nw+"%"; break; } }; dhtmlxSlider.prototype.setSkin=function(skin) { this.skin=(skin?skin:""); if (this.isInit)this.createStructure() }; dhtmlxSlider.prototype.startDrag=function(e) { if (this._busy)return; if(this.hasEvent("onSlideStart")) this.callEvent("onSlideStart") if ((e.button === 0)|| (e.button === 1)) { this.drag_mx=e.clientX; this.drag_my=e.clientY; this.drag_cx=this.posX; this.d_b_move=document.body.onmousemove; this.d_b_up=document.body.onmouseup; var _c=this; document.body.onmouseup=function(e) { _c.stopDrag(e||event); _c=null }; document.body.onmousemove=function (e) { _c.onDrag(e||event) }; this._busy=true } }; dhtmlxSlider.prototype.onDrag=function(e) { if (this._busy) { if (!this.vMode) this.posX=this.drag_cx + e.clientX - this.drag_mx; else this.posX=this.drag_cx + e.clientY - this.drag_my; this._applyPos() } }; dhtmlxSlider.prototype.stopDrag=function(e) { var e=e||event; document.body.onmousemove=this.d_b_move?this.d_b_move:null; document.body.onmouseup=this.d_b_up?this.d_b_up:null; this.d_b_move=this.d_b_up=null; this._busy=false; this.callEvent("onSlideEnd",[this.getValue()]) }; dhtmlxSlider.prototype.getValue=function() { if ((!this._busy)&& (this.inputPriority)) return Math.round (this.value / this._step) * this._step; return Math.round ((Math.round ((this.posX / this._mod) / this._step) * this._step + this.shift * 1) * 10000) / 10000 }; dhtmlxSlider.prototype.setValue=function(val) { if(!this.isScrubbing) { this.value=val; this._applyPos(this.posX=(Math.round(((val||0)-this.shift)*this._mod))) } }; dhtmlxSlider.prototype._getActionElement=function(nod) { if (nod._etype)return nod; if (nod.parentNode)return this._getActionElement(nod.parentNode); return null }; dhtmlxSlider.prototype.scrubMouseUpEvent=function() { if(document.createEvent) { if (!this.doneCreateWindowMouseUpEvent) { this.doneCreateWindowMouseUpEvent = true; var evt = document.createEvent("MouseEvents"); evt.initMouseEvent("mouseup", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); var scrub = document.getElementById(this.mousedDownElement.id); scrub.dispatchEvent(evt); window.removeEventListener('mouseup', dhtmlxSlider.prototype.scrubMouseUpEvent, false); } else{this.doneCreateWindowMouseUpEvent = false;} } else { this.doneCreateWindowMouseUpEvent = true; var scrub = document.getElementById(this.mousedDownElement.id); scrub.releaseCapture(); document.detachEvent('onmouseup', dhtmlxSlider.prototype.scrubMouseUpEvent); } } dhtmlxSlider.prototype._onMouseDown=function(e) { e=e||event; var that=this.that; if (that.ttf=="s") { that.isScrubbing=true; that.controls.onPause(); } var ev = arguments[0] || window.event; mousedDownElement = ev.target || ev.srcElement; if((mousedDownElement.id!="")&&(mousedDownElement.id==this.childNodes.item(4).id)) { if (document.addEventListener) { window.addEventListener('mouseup', this.that.scrubMouseUpEvent, false); } else if (document.attachEvent) { var scrub = document.getElementById(mousedDownElement.id); scrub.setCapture(); document.attachEvent('onmouseup', this.that.scrubMouseUpEvent); } } var nod=that._getActionElement(_isIe?e.srcElement:e.target); switch (nod._etype) { case "slider": if (that.vMode)var z=e.clientY-(getAbsoluteTop(that.con)-document.body.scrollTop); else var z=e.clientX-(getAbsoluteLeft(that.con)-document.body.scrollLeft); var posX=that.posX; that.posX=z-that.dragLeft-that.dragWidth/2; that.direction=that.posX > posX ? 1 : -1; if (that.stepping) { clearInterval (that._int); that.setValue (that.value + that._step * that.direction); that._int=setInterval (function () { that.setValue (that.value + that._step * that.direction) }, 600) } else { that._busy=true; that._applyPos(); that._busy=false; that.callEvent("onSlideEnd",[that.getValue()]) }; break; case "drag": that.startDrag(e||event); break }; return false }; dhtmlxSlider.prototype._onMouseUp=function(e) { var that=this.that; if (that.ttf=="s") { that.isScrubbing=false; that.controls.onResume(); } clearInterval (that._int); } dhtmlxSlider.prototype.setOnChangeHandler=function(func) { this.attachEvent("onChange",func) }; dhtmlxSlider.prototype._linkFrom=function() { this.setValue (parseFloat (this._link.value)) }; dhtmlxSlider.prototype.linkTo=function(obj) { obj=(typeof(obj) != "object") ? document.getElementById(obj) : obj; this._link=obj; var name=obj.tagName.toString().toLowerCase(); this._linkBoth=(((name=="input")||(name=="select")||(name=="textarea"))?1:0); if (this._linkBoth) { var self=this; var f=function() { if (this._nextSlider)window.clearTimeout(this._nextSlider); this._nextSlider=window.setTimeout(function(){self._linkFrom()},500) }; obj.onblur=obj.onkeypress=obj.onchange=f }; this._applyPos() }; dhtmlxSlider.prototype.enableTooltip=function(mode) { this._dttp=(!convertStringToBoolean(mode)); this._setTooltip(this._dttp?"":this.getValue()) }; dhtmlxSlider.prototype.setImagePath=function(path) { this.imgURL=path }; dhtmlxSlider.prototype.init=function() { this.isInit=true; this.createStructure() }; dhtmlxSlider.prototype.setInputPriority=function (mode) { this.inputPriority=mode }; dhtmlxSlider.prototype.setSteppingMode=function (mode) { this.stepping=mode } dhtmlxSlider.prototype.attachEvent=function(name, handler) { name='ev_'+name.toLowerCase(); if(!this[name]) this[name]=new this.eventHandler(this); return(name+':'+this[name].addEvent(handler)); }; dhtmlxSlider.prototype.callEvent=function(name, args) { if(args==undefined)args=[null]; name='ev_'+name.toLowerCase(); if(this[name]) return this[name].apply(this, args); return true; }; dhtmlxSlider.prototype.hasEvent=function(name) { return (!!this['ev_'+name.toLowerCase()]); }; dhtmlxSlider.prototype.eventHandler=function(obj) { var handlers=[]; var tmp=function() { var ret=true; for (var i=0;i