/*
===================================================================
Copyright DHTMLX LTD. http://www.dhtmlx.com
This code is obfuscated and not allowed for any purposes except 
using on sites which belongs to DHTMLX LTD.

Please contact sales@dhtmlx.com to obtain necessary 
license for usage of dhtmlx components.
===================================================================
*/function dhtmlxSlider(Jg,size,skin,vertical,min,max,value,step){if(_isIE)try{document.execCommand("BackgroundImageCache",false,true)}catch(e){};if(!Jg){var z="slider_div_"+(new Date()).valueOf()+Math.random(1000);var Jg=document.createElement("div");Jg.setAttribute("id",z);document.body.appendChild(Jg)}else if(typeof(Jg)!="object")Jg=document.getElementById(Jg);if(typeof(size)=="object"){skin=size.skin;min=size.min;max=size.max;step=size.step;vertical=size.vertical;value=size.value;size=size.size};this.size=size;this.value=value||0;this.tS=vertical||false;this.skin=skin||"";this.parent=Jg;this.isInit=false;this.value=min||value||0;this.inputPriority=true;this.stepping=false;this.eg=window.fe||"";this.uf=[min,max,step,value,size];this.Ag();return this};dhtmlxSlider.prototype.zL=function(){if(this.con){this.con.parentNode.removeChild(this.con);this.con=null};if(this.tS){this.Bv="height";this.QI="width";this.yp="top";this.QS="left";var skinImgPath=this.eg+"skins/"+(this.skin==""?"default":this.skin)+"/vertical/"}else{this.Bv="width";this.QI="height";this.yp="left";this.QS="top";var skinImgPath=this.eg+"skins/"+(this.skin==""?"default":this.skin)+"/"};this.con=document.createElement("DIV");this.con.onselectstart=function(){return false};this.con.JG="slider";this.con.className="dhtmlxSlider"+(this.skin?"_"+this.skin:this.skin);this.con.style.background="url("+skinImgPath+"bg.gif)";this.drag=document.createElement("DIV");this.drag.JG="drag";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=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.tS){this.Bv="height";this.QI="width";this.yp="top";this.QS="left";this.con.style.width=this.con.offsetHeight+'px';for(var i=0;i<this.con.childNodes.length;i++){this.con.childNodes[i].style.fontSize="0";var YV=this.con.childNodes[i].offsetWidth;this.con.childNodes[i].style.width=this.con.childNodes[i].offsetHeight+'px';this.con.childNodes[i].style.height=YV+'px';YV=this.con.childNodes[i].offsetLeft;this.con.childNodes[i].style.left=this.con.childNodes[i].offsetTop+'px';this.con.childNodes[i].style.top=YV+'px'};rightSide.style.top=this.size-rightSide.offsetHeight+'px';this.eb=this.size-rightSide.offsetHeight;this.dragLeft=this.drag.offsetTop;this.dragWidth=this.drag.offsetHeight;this.rightZone.style.height=this.eb+'px'}else{this.eb=this.size-rightSide.offsetWidth;this.dragLeft=this.drag.offsetLeft;this.dragWidth=this.drag.offsetWidth;this.rightZone.style.width=this.eb+'px'};this.con.style[this.Bv]=this.size+"px";this.con.onmousedown=this._onMouseDown;this.con.onmouseup=this.con.onmouseout=function(){clearInterval(this.that.VX)};this.con.that=this;this._aCalc(this.uf)};dhtmlxSlider.prototype._aCalc=function(def){if(!this.isInit)return;this.shift=def[0]||0;this.limit=(def[1]||100)-this.shift;this.Jy=(def[4]-this.dragLeft*2-this.dragWidth)/this.limit;this.xo=(def[2]||1);this.step=this.xo*this.Jy;this.Im=def[4]-this.dragLeft*2-this.dragWidth;if(!this.posX)this.posX=this.Im*((def[3]||0)-this.shift)/this.limit;this._applyPos(true);return this};dhtmlxSlider.prototype.setMin=function(val){this.uf[0]=val;this._aCalc(this.uf)};dhtmlxSlider.prototype.setMax=function(val){this.uf[1]=val;this._aCalc(this.uf)};dhtmlxSlider.prototype.fB=function(val){this.uf[2]=val;this._aCalc(this.uf)};dhtmlxSlider.prototype._applyPos=function(Ch){if(!this.isInit)return;if(this.step!=1)this.posX=Math.round(this.posX/this.step)*this.step;if(this.posX<0)this.posX=0;if(this.value<(this.uf[0]||0))this.value=this.uf[0]||0;if(this.value<this.uf[3])this.value=this.uf[3];if(this.value>this.uf[1])this.value=this.uf[1];if(this.posX>this.Im)this.posX=this.Im;var a_old=this.drag.style[this.yp];this.drag.style[this.yp]=this.posX+this.dragLeft*1+"px";this.leftZone.style[this.Bv]=this.posX+this.dragLeft*1+"px";this.rightZone.style[this.yp]=this.posX+this.dragLeft*1+1+"px";this.rightZone.style[this.Bv]=this.eb-(this.posX+this.dragLeft*1)+"px";var nw=this.getValue();if(this.DM){if(this.UE)this.DM.value=nw;else this.DM.innerHTML=nw};if((!Ch)&&this.mR("onChange")&&(a_old!=this.drag.style[this.yp]))this.callEvent("onChange",[nw,this]);this.value=this.getValue();if(!this.Wt)this._setTooltip(nw)};dhtmlxSlider.prototype._setTooltip=function(nw){this.con.title=nw};dhtmlxSlider.prototype.setSkin=function(skin){this.skin=(skin?skin:"");if(this.isInit)this.zL()};dhtmlxSlider.prototype.Yd=function(e){if(this.yR)return;if((e.button===0)||(e.button===1)){this.adz=e.clientX;this.adB=e.clientY;this.drag_cx=this.posX;this.d_b_move=document.body.onmousemove;this.d_b_up=document.body.onmouseup;var asz=this;document.body.onmouseup=function(e){asz.dc(e||event);asz=null};document.body.onmousemove=function(e){asz.onDrag(e||event)};this.yR=true}};dhtmlxSlider.prototype.onDrag=function(e){if(this.yR){if(!this.tS)this.posX=this.drag_cx+e.clientX-this.adz;else this.posX=this.drag_cx+e.clientY-this.adB;this._applyPos()}};dhtmlxSlider.prototype.dc=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.yR=false;this.callEvent("onSlideEnd",[this.getValue()])};dhtmlxSlider.prototype.getValue=function(){if((!this.yR)&&(this.inputPriority))return Math.round(this.value/this.xo)*this.xo;return Math.round((Math.round((this.posX/this.Jy)/this.xo)*this.xo+this.shift*1)*10000)/10000};dhtmlxSlider.prototype.setValue=function(val){this.value=val;this._applyPos(this.posX=(Math.round(((val||0)-this.shift)*this.Jy)))};dhtmlxSlider.prototype._getActionElement=function(aoL){if(aoL.JG)return aoL;if(aoL.parentNode)return this._getActionElement(aoL.parentNode);return null};dhtmlxSlider.prototype._onMouseDown=function(e){e=e||event;var that=this.that;var aoL=that._getActionElement(_isIE?e.srcElement:e.target);switch(aoL.JG){case "slider":if(that.tS)var z=e.clientY-(dg(that.con)-document.body.scrollTop);else var z=e.clientX-(ej(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.VX);that.setValue(that.value+that.xo*that.direction);that.VX=setInterval(function(){that.setValue(that.value+that.xo*that.direction)},600)}else{that.yR=true;that._applyPos();that.yR=false};break;case "drag":that.Yd(e||event);break};return false};dhtmlxSlider.prototype.KN=function(aQ){this.attachEvent("onChange",aQ)};dhtmlxSlider.prototype._linkFrom=function(){this.setValue(parseFloat(this.DM.value))};dhtmlxSlider.prototype.linkTo=function(obj){obj=(typeof(obj)!="object")?document.getElementById(obj):obj;this.DM=obj;var name=obj.tagName.toString().toLowerCase();this.UE=(((name=="input")||(name=="select")||(name=="textarea"))?1:0);if(this.UE){var self=this;var f=function(){if(this.Ml)window.clearTimeout(this.Ml);this.Ml=window.setTimeout(function(){self._linkFrom()},500)};obj.onblur=obj.onkeypress=obj.onchange=f};this._applyPos()};dhtmlxSlider.prototype.ajS=function(mode){this.Wt=(!K(mode));this._setTooltip(this.Wt?"":this.getValue())};dhtmlxSlider.prototype.setImagePath=function(path){this.eg=path};dhtmlxSlider.prototype.init=function(){this.isInit=true;this.zL()};dhtmlxSlider.prototype.Ag=function(){this.xw="";this.attachEvent=function(eN,hk,qr){qr=qr||this;eN='ev_'+eN;if((!this[eN])||(!this[eN].oe)){var z=new this.sI(qr);z.oe(this[eN]);this[eN]=z};return(eN+':'+this[eN].oe(hk))};this.callEvent=function(name,afo){if(this["ev_"+name])return this["ev_"+name].apply(this,afo);return true};this.mR=function(name){if(this["ev_"+name])return true;return false};this.sI=function(obj){var gu=new Array();var yO=obj;var uz=function(hk,rpc){hk=hk.split(":");var BR="";var aaL="";var target=hk[1];if(hk[1]=="rpc"){BR='<?xml version="1.0"?><methodCall><methodName>'+hk[2]+'</methodName><params>';aaL="</params></methodCall>";target=rpc};var z=function(){};return z};var z=function(){if(gu)var res=true;for(var i=0;i<gu.length;i++){if(gu[i]!=null){var O=gu[i].apply(yO,arguments);res=res&&O}};return res};z.oe=function(ev){if(typeof(ev)!="function")if(ev&&ev.indexOf&&ev.indexOf("server:")==0)ev=new uz(ev,yO.Ta);else ev=eval(ev);if(ev)return gu.push(ev)-1;return false};z.uI=function(id){gu[id]=null};return z};this.detachEvent=function(id){if(id!=false){var list=id.split(':');this[list[0]].uI(list[1])}}};dhtmlxSlider.prototype.setInputPriority=function(mode){this.inputPriority=mode};dhtmlxSlider.prototype.oW=function(mode){this.stepping=mode}
