/* Product Name: dhtmlxSuite Version: 4.0.3 Edition: Professional License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com Copyright UAB Dinamenta http://www.dhtmlx.com */ if(typeof(window.dhx4)=="undefined"){window.dhx4={version:"4.0.3",skin:null,skinDetect:function(c){var g=document.createElement("DIV");g.className=c+"_skin_detect";if(document.body.firstChild){document.body.insertBefore(g,document.body.firstChild)}else{document.body.appendChild(g)}var a=g.offsetWidth;g.parentNode.removeChild(g);g=null;return{10:"dhx_skyblue",20:"dhx_web",30:"dhx_terrace"}[a]||null},lastId:1,newId:function(){return this.lastId++},zim:{data:{},step:5,first:function(){return 100},last:function(){var g=this.first();for(var c in this.data){g=Math.max(g,this.data[c])}return g},reserve:function(a){this.data[a]=this.last()+this.step;return this.data[a]},clear:function(a){if(this.data[a]!=null){this.data[a]=null;delete this.data[a]}}},s2b:function(a){return(a==true||a==1||a=="true"||a=="1"||a=="yes"||a=="y")},trim:function(a){return String(a).replace(/^\s{1,}/,"").replace(/\s{1,}$/,"")},template:function(c,g,a){return c.replace(/#([a-zA-Z0-9_-]{1,})#/g,function(l,h){if(h.length>0&&typeof(g[h])!="undefined"){if(a==true){return window.dhx4.trim(g[h])}return String(g[h])}return""})},absLeft:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this._aOfs(a).left},absTop:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this._aOfs(a).top},_aOfsSum:function(a){var g=0,c=0;while(a){g=g+parseInt(a.offsetTop);c=c+parseInt(a.offsetLeft);a=a.offsetParent}return{top:g,left:c}},_aOfsRect:function(h){var n=h.getBoundingClientRect();var o=document.body;var c=document.documentElement;var a=window.pageYOffset||c.scrollTop||o.scrollTop;var l=window.pageXOffset||c.scrollLeft||o.scrollLeft;var m=c.clientTop||o.clientTop||0;var q=c.clientLeft||o.clientLeft||0;var r=n.top+a-m;var g=n.left+l-q;return{top:Math.round(r),left:Math.round(g)}},_aOfs:function(a){if(a.getBoundingClientRect){return this._aOfsRect(a)}else{return this._aOfsSum(a)}},_isObj:function(a){return(a!=null&&typeof(a)=="object"&&typeof(a.length)=="undefined")},_copyObj:function(h){if(this._isObj(h)){var g={};for(var c in h){if(typeof(h[c])=="object"&&h[c]!=null){g[c]=this._copyObj(h[c])}else{g[c]=h[c]}}}else{var g=[];for(var c=0;c=0);var c={};c.left=document.body.scrollLeft;c.right=c.left+(window.innerWidth||document.body.clientWidth);c.top=Math.max((a?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);c.bottom=c.top+(a?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0):window.innerHeight);return c},selectTextRange:function(h,m,c){h=(typeof(h)=="string"?document.getElementById(h):h);var a=h.value.length;m=Math.max(Math.min(m,a),0);c=Math.min(c,a);if(h.setSelectionRange){try{h.setSelectionRange(m,c)}catch(l){}}else{if(h.createTextRange){var g=h.createTextRange();g.moveStart("character",m);g.moveEnd("character",c-a);try{g.select()}catch(l){}}}},transData:null,transDetect:function(){if(this.transData==null){this.transData={transProp:false,transEv:null};var g={MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd",OTransition:"oTransitionEnd",msTransition:"transitionend",transition:"transitionend"};for(var c in g){if(this.transData.transProp==false&&document.documentElement.style[c]!=null){this.transData.transProp=c;this.transData.transEv=g[c]}}g=null}return this.transData}};window.dhx4.isIE=(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>=0);window.dhx4.isIE6=(window.XMLHttpRequest==null&&navigator.userAgent.indexOf("MSIE")>=0);window.dhx4.isIE7=(navigator.userAgent.indexOf("MSIE 7.0")>=0&&navigator.userAgent.indexOf("Trident")<0);window.dhx4.isOpera=(navigator.userAgent.indexOf("Opera")>=0);window.dhx4.isChrome=(navigator.userAgent.indexOf("Chrome")>=0);window.dhx4.isKHTML=(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0);window.dhx4.isFF=(navigator.userAgent.indexOf("Firefox")>=0);window.dhx4.isIPad=(navigator.userAgent.search(/iPad/gi)>=0)}if(typeof(window.dhx4.ajax)=="undefined"){window.dhx4.ajax={cache:false,method:"post",get:function(a,c){this._call("GET",a,null,true,c)},getSync:function(a){return this._call("GET",a,null,false)},post:function(c,a,g){if(arguments.length==1){a=""}else{if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a])=="function")){g=a;a=""}else{a=String(a)}}this._call("POST",c,a,true,g)},postSync:function(c,a){a=(a==null?"":String(a));return this._call("POST",c,a,false)},getLong:function(a,c){this._call("GET",a,null,true,c,{url:a})},postLong:function(c,a,g){if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a]))){g=a;a=""}this._call("POST",c,a,true,g,{url:c,postData:a})},_call:function(o,c,a,m,l,h){var g=(window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"));var n=(navigator.userAgent.match(/AppleWebKit/)!=null&&navigator.userAgent.match(/Qt/)!=null&&navigator.userAgent.match(/Safari/)!=null);if(m==true){g.onreadystatechange=function(){if((g.readyState==4&&g.status==200)||(n==true&&g.readyState==3)){window.setTimeout(function(){if(typeof(l)=="function"){l.apply(window,[{xmlDoc:g}])}if(h!=null){if(typeof(h.postData)!="undefined"){dhx4.ajax.postLong(h.url,h.postData,l)}else{dhx4.ajax.getLong(h.url,l)}}l=null;g=null},1)}}}if(o=="GET"&&this.cache!=true){c+=(c.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime()}g.open(o,c,m);if(o=="POST"){g.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(this.cache!=true){a+=(a.length>0?"&":"")+"dhxr"+new Date().getTime()}}else{a=null}g.setRequestHeader("X-Requested-With","XMLHttpRequest");g.send(a);if(!m){return{xmlDoc:g}}}}}if(typeof(window.dhx4._enableDataLoading)=="undefined"){window.dhx4._enableDataLoading=function(obj,initObj,xmlToJson,xmlRootTag,mode){if(mode=="clear"){for(var a in obj._dhxdataload){obj._dhxdataload[a]=null;delete obj._dhxdataload[a]}obj._loadData=null;obj._dhxdataload=null;obj.load=null;obj.loadStruct=null;obj=null;return}obj._dhxdataload={initObj:initObj,xmlToJson:xmlToJson,xmlRootTag:xmlRootTag,onBeforeXLS:null};obj._loadData=function(data,loadParams,onLoad){if(arguments.length==2){onLoad=loadParams;loadParams=null}var obj=null;if(arguments.length==3){onLoad=arguments[2]}if(typeof(data)=="string"){var k=data.replace(/^\s{1,}/,"").replace(/\s{1,}$/,"");var tag=new RegExp("^<"+this._dhxdataload.xmlRootTag);if(tag.test(k.replace(/^<\?xml[^\?]*\?>\s*/,""))){if(window.DOMParser){obj=(new window.DOMParser()).parseFromString(data,"text/xml")}else{if(typeof(window.ActiveXObject)!="undefined"){obj=new window.ActiveXObject("Microsoft.XMLDOM");obj.async="false";obj.loadXML(data)}}if(obj!=null){obj=this[this._dhxdataload.xmlToJson].apply(this,[obj])}}if(obj==null&&(k.match(/^\{.*\}$/)!=null||k.match(/^\[.*\]$/)!=null)){try{eval("dhx4.temp="+k)}catch(e){dhx4.temp=null}obj=dhx4.temp;dhx4.temp=null}if(obj==null){this.callEvent("onXLS",[]);var params=[];if(typeof(this._dhxdataload.onBeforeXLS)=="function"){var k=this._dhxdataload.onBeforeXLS.apply(this,[data]);if(k!=null&&typeof(k)=="object"){if(k.url!=null){data=k.url}if(k.params!=null){for(var a in k.params){params.push(a+"="+encodeURIComponent(k.params[a]))}}}}var t=this;var callBack=function(r){var obj=null;if((r.xmlDoc.getResponseHeader("Content-Type")||"").search(/xml/gi)>=0||(r.xmlDoc.responseText.replace(/^\s{1,}/,"")).match(/^0?"":"")+params,callBack)}}return}}else{if(typeof(data.documentElement)=="object"||(typeof(data.tagName)!="undefined"&&typeof(data.getElementsByTagName)!="undefined"&&data.getElementsByTagName(this._dhxdataload.xmlRootTag).length>0)){obj=this[this._dhxdataload.xmlToJson].apply(this,[data])}else{obj=window.dhx4._copyObj(data)}}if(obj!=null){this[this._dhxdataload.initObj].apply(this,[obj])}if(onLoad!=null){if(typeof(onLoad)=="function"){onLoad.apply(this,[])}else{if(typeof(window[onLoad])=="function"){window[onLoad].apply(this,[])}}onLoad=null}};if(mode!=null){var k={struct:"loadStruct",data:"load"};for(var a in mode){if(mode[a]==true){obj[k[a]]=function(){return this._loadData.apply(this,arguments)}}}}obj=null}}if(typeof(window.dhx4._eventable)=="undefined"){window.dhx4._eventable=function(a,c){if(c=="clear"){a.detachAllEvents();a.dhxevs=null;a.attachEvent=null;a.detachEvent=null;a.checkEvent=null;a.callEvent=null;a.detachAllEvents=null;a=null;return}a.dhxevs={data:{}};a.attachEvent=function(g,l){g=String(g).toLowerCase();if(!this.dhxevs.data[g]){this.dhxevs.data[g]={}}var h=window.dhx4.newId();this.dhxevs.data[g][h]=l;return h};a.detachEvent=function(m){for(var h in this.dhxevs.data){var l=0;for(var g in this.dhxevs.data[h]){if(g==m){this.dhxevs.data[h][g]=null;delete this.dhxevs.data[h][g]}else{l++}}if(l==0){this.dhxevs.data[h]=null;delete this.dhxevs.data[h]}}};a.checkEvent=function(g){g=String(g).toLowerCase();return(this.dhxevs.data[g]!=null)};a.callEvent=function(h,m){h=String(h).toLowerCase();if(this.dhxevs.data[h]==null){return true}var l=true;for(var g in this.dhxevs.data[h]){l=this.dhxevs.data[h][g].apply(this,m)&&l}return l};a.detachAllEvents=function(){for(var h in this.dhxevs.data){for(var g in this.dhxevs.data[h]){this.dhxevs.data[h][g]=null;delete this.dhxevs.data[h][g]}this.dhxevs.data[h]=null;delete this.dhxevs.data[h]}};a=null}}dhtmlx=function(g){for(var c in g){dhtmlx[c]=g[c]}return dhtmlx};dhtmlx.extend_api=function(a,h,g){var c=window[a];if(!c){return}window[a]=function(n){if(n&&typeof n=="object"&&!n.tagName){var m=c.apply(this,(h._init?h._init(n):arguments));for(var l in dhtmlx){if(h[l]){this[h[l]](dhtmlx[l])}}for(var l in n){if(h[l]){this[h[l]](n[l])}else{if(l.indexOf("on")==0){this.attachEvent(l,n[l])}}}}else{var m=c.apply(this,arguments)}if(h._patch){h._patch(this)}return m||this};window[a].prototype=c.prototype;if(g){dhtmlXHeir(window[a].prototype,g)}};dhtmlxAjax={get:function(a,g){var c=new dtmlXMLLoaderObject(true);c.async=(arguments.length<3);c.waitCall=g;c.loadXML(a);return c},post:function(a,g,h){var c=new dtmlXMLLoaderObject(true);c.async=(arguments.length<4);c.waitCall=h;c.loadXML(a,true,g);return c},getSync:function(a){return this.get(a,null,true)},postSync:function(a,c){return this.post(a,c,null,true)}};function dtmlXMLLoaderObject(c,h,g,a){this.xmlDoc="";if(typeof(g)!="undefined"){this.async=g}else{this.async=true}this.onloadAction=c||null;this.mainObject=h||null;this.waitCall=null;this.rSeed=a||false;return this}dtmlXMLLoaderObject.count=0;dtmlXMLLoaderObject.prototype.waitLoadFunction=function(c){var a=true;this.check=function(){if((c)&&(c.onloadAction!=null)){if((!c.xmlDoc.readyState)||(c.xmlDoc.readyState==4)){if(!a){return}a=false;dtmlXMLLoaderObject.count++;if(typeof c.onloadAction=="function"){c.onloadAction(c.mainObject,null,null,null,c)}if(c.waitCall){c.waitCall.call(this,c);c.waitCall=null}}}};return this.check};dtmlXMLLoaderObject.prototype.getXMLTopNode=function(g,a){if(typeof this.xmlDoc.status=="undefined"||this.xmlDoc.status<400){if(this.xmlDoc.responseXML){var c=this.xmlDoc.responseXML.getElementsByTagName(g);if(c.length==0&&g.indexOf(":")!=-1){var c=this.xmlDoc.responseXML.getElementsByTagName((g.split(":"))[1])}var h=c[0]}else{var h=this.xmlDoc.documentElement}if(h){this._retry=false;return h}if(!this._retry&&_isIE){this._retry=true;var a=this.xmlDoc;this.loadXMLString(this.xmlDoc.responseText.replace(/^[\s]+/,""),true);return this.getXMLTopNode(g,a)}}dhtmlxError.throwError("LoadXML","Incorrect XML",[(a||this.xmlDoc),this.mainObject]);return document.createElement("DIV")};dtmlXMLLoaderObject.prototype.loadXMLString=function(c,a){if(!_isIE){var g=new DOMParser();this.xmlDoc=g.parseFromString(c,"text/xml")}else{this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");this.xmlDoc.async=this.async;this.xmlDoc.onreadystatechange=function(){};this.xmlDoc.loadXML(c)}if(a){return}if(this.onloadAction){this.onloadAction(this.mainObject,null,null,null,this)}if(this.waitCall){this.waitCall();this.waitCall=null}};dtmlXMLLoaderObject.prototype.loadXML=function(g,c,a,h){if(this.rSeed){g+=((g.indexOf("?")!=-1)?"&":"?")+"a_dhx_rSeed="+(new Date()).valueOf()}this.filePath=g;if((!_isIE)&&(window.XMLHttpRequest)){this.xmlDoc=new XMLHttpRequest()}else{this.xmlDoc=new ActiveXObject("Microsoft.XMLHTTP")}if(this.async){this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this)}this.xmlDoc.open(c?"POST":"GET",g,this.async);if(h){this.xmlDoc.setRequestHeader("User-Agent","dhtmlxRPC v0.1 ("+navigator.userAgent+")");this.xmlDoc.setRequestHeader("Content-type","text/xml")}else{if(c){this.xmlDoc.setRequestHeader("Content-type",(this.contenttype||"application/x-www-form-urlencoded"))}}this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");this.xmlDoc.send(null||a);if(!this.async){(new this.waitLoadFunction(this))()}};dtmlXMLLoaderObject.prototype.destructor=function(){this._filterXPath=null;this._getAllNamedChilds=null;this._retry=null;this.async=null;this.rSeed=null;this.filePath=null;this.onloadAction=null;this.mainObject=null;this.xmlDoc=null;this.doXPath=null;this.doXPathOpera=null;this.doXSLTransToObject=null;this.doXSLTransToString=null;this.loadXML=null;this.loadXMLString=null;this.doSerialization=null;this.xmlNodeToJSON=null;this.getXMLTopNode=null;this.setXSLParamValue=null;return null};dtmlXMLLoaderObject.prototype.xmlNodeToJSON=function(h){var g={};for(var c=0;c-1){_isChrome=true}if((navigator.userAgent.indexOf("Safari")!=-1)||(navigator.userAgent.indexOf("Konqueror")!=-1)){_KHTMLrv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari")+7,5));if(_KHTMLrv>525){_isFF=true;_FFrv=1.9}else{_isKHTML=true}}else{if(navigator.userAgent.indexOf("Opera")!=-1){_isOpera=true;_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3))}else{if(navigator.appName.indexOf("Microsoft")!=-1){_isIE=true;if((navigator.appVersion.indexOf("MSIE 8.0")!=-1||navigator.appVersion.indexOf("MSIE 9.0")!=-1||navigator.appVersion.indexOf("MSIE 10.0")!=-1||document.documentMode>7)&&document.compatMode!="BackCompat"){_isIE=8}}else{if(navigator.appName=="Netscape"&&navigator.userAgent.indexOf("Trident")!=-1){_isIE=8}else{_isFF=true;_FFrv=parseFloat(navigator.userAgent.split("rv:")[1])}}}}dtmlXMLLoaderObject.prototype.doXPath=function(g,l,h,q){if(_isKHTML||(!_isIE&&!window.XPathResult)){return this.doXPathOpera(g,l)}if(_isIE){if(!l){if(!this.xmlDoc.nodeName){l=this.xmlDoc.responseXML}else{l=this.xmlDoc}}if(!l){dhtmlxError.throwError("LoadXML","Incorrect XML",[(l||this.xmlDoc),this.mainObject])}if(h!=null){l.setProperty("SelectionNamespaces","xmlns:xsl='"+h+"'")}if(q=="single"){return l.selectSingleNode(g)}else{return l.selectNodes(g)||new Array(0)}}else{var a=l;if(!l){if(!this.xmlDoc.nodeName){l=this.xmlDoc.responseXML}else{l=this.xmlDoc}}if(!l){dhtmlxError.throwError("LoadXML","Incorrect XML",[(l||this.xmlDoc),this.mainObject])}if(l.nodeName.indexOf("document")!=-1){a=l}else{a=l;l=l.ownerDocument}var n=XPathResult.ANY_TYPE;if(q=="single"){n=XPathResult.FIRST_ORDERED_NODE_TYPE}var m=new Array();var c=l.evaluate(g,a,function(r){return h},n,null);if(n==XPathResult.FIRST_ORDERED_NODE_TYPE){return c.singleNodeValue}var o=c.iterateNext();while(o){m[m.length]=o;o=c.iterateNext()}return m}};function _dhtmlxError(c,a,g){if(!this.catches){this.catches=new Array()}return this}_dhtmlxError.prototype.catchError=function(c,a){this.catches[c]=a};_dhtmlxError.prototype.throwError=function(c,a,g){if(this.catches[c]){return this.catches[c](c,a,g)}if(this.catches.ALL){return this.catches.ALL(c,a,g)}alert("Error type: "+arguments[0]+"\nDescription: "+arguments[1]);return null};window.dhtmlxError=new _dhtmlxError();dtmlXMLLoaderObject.prototype.doXPathOpera=function(g,a){var l=g.replace(/[\/]+/gi,"/").split("/");var h=null;var c=1;if(!l.length){return[]}if(l[0]=="."){h=[a]}else{if(l[0]==""){h=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(l[c].replace(/\[[^\]]*\]/g,""));c++}else{return[]}}for(c;c=0){return true}return false};dhtmlx.assert_rule_dimension.describe=function(){return"{Integer} value must be a positive number"};dhtmlx.assert_rule_number=function(a){if(typeof a=="number"){return true}return false};dhtmlx.assert_rule_number.describe=function(){return"{Integer} value must be a number"};dhtmlx.assert_rule_function=function(a){if(typeof a=="function"){return true}return false};dhtmlx.assert_rule_function.describe=function(){return"{Function} value must be a custom function"};dhtmlx.assert_rule_any=function(a){return true};dhtmlx.assert_rule_any.describe=function(){return"Any value"};dhtmlx.assert_rule_mix=function(g,c){var h=function(a){if(g(a)||c(a)){return true}return false};h.describe=function(){return g.describe()};return h}}dhtmlx.version="3.0";dhtmlx.codebase="./";dhtmlx.copy=function(c){var a=dhtmlx.copy._function;a.prototype=c;return new a()};dhtmlx.copy._function=function(){};dhtmlx.extend=function(c,a){for(var g in a){c[g]=a[g]}if(dhtmlx.assert_enabled()&&a._assert){c._assert();c._assert=null}dhtmlx.assert(c,"Invalid nesting target");dhtmlx.assert(a,"Invalid nesting source");if(a._init){c._init()}return c};dhtmlx.proto_extend=function(){var m=arguments;var g=m[0];var c=[];for(var l=m.length-1;l>0;l--){if(typeof m[l]=="function"){m[l]=m[l].prototype}for(var h in m[l]){if(h=="_init"){c.push(m[l][h])}else{if(!g[h]){g[h]=m[l][h]}}}}if(m[0]._init){c.push(m[0]._init)}g._init=function(){for(var n=0;n=0){this.splice(c,(a||1))}},remove:function(a){this.removeAt(this.find(a))},insertAt:function(c,g){if(!g&&g!==0){this.push(c)}else{var a=this.splice(g,(this.length-g));this[g]=c;this.push.apply(this,a)}},find:function(a){for(i=0;ig){var c=g;g=h;h=c}return this.getIndexRange(h,g)},getIndexRange:function(h,g){g=Math.min((g||Infinity),this.dataCount()-1);var a=dhtmlx.toArray();for(var c=(h||0);c<=g;c++){a.push(this.item(this.order[c]))}return a},dataCount:function(){return this.order.length},exists:function(a){return !!(this.pull[a])},move:function(a,h){if(a<0||h<0){dhtmlx.error("DataStore::move","Incorrect indexes");return}var g=this.idByIndex(a);var c=this.item(g);this.order.removeAt(a);this.order.insertAt(g,Math.min(this.order.length,h));this.callEvent("onStoreUpdated",[g,c,"move"])},scheme:function(a){this._scheme=a},sync:function(l,h,a){if(typeof h!="function"){a=h;h=null}if(dhtmlx.debug_bind){this.debug_sync_master=l;dhtmlx.log("[sync] "+this.debug_bind_master.name+"@"+this.debug_bind_master._settings.id+" <= "+this.debug_sync_master.name+"@"+this.debug_sync_master._settings.id)}var g=l;if(l.name!="DataStore"){l=l.data}var c=dhtmlx.bind(function(o,m,n){if(n!="update"||h){o=null}if(!o){this.order=dhtmlx.toArray([].concat(l.order));this._filter_order=null;this.pull=l.pull;if(h){this.silent(h)}if(this._on_sync){this._on_sync()}}if(dhtmlx.debug_bind){dhtmlx.log("[sync:request] "+this.debug_sync_master.name+"@"+this.debug_sync_master._settings.id+" <= "+this.debug_bind_master.name+"@"+this.debug_bind_master._settings.id)}if(!a){this.refresh(o)}else{a=false}},this);l.attachEvent("onStoreUpdated",c);this.feed=function(n,m){g.loadNext(m,n)};c()},add:function(l,a){if(this._scheme){l=l||{};for(var c in this._scheme){l[c]=l[c]||this._scheme[c]}if(this._scheme){if(this._scheme.$init){this._scheme.$update(l)}else{if(this._scheme.$update){this._scheme.$update(l)}}}}var m=this.id(l);var h=this.dataCount();if(dhtmlx.isNotDefined(a)||a<0){a=h}if(a>h){dhtmlx.log("Warning","DataStore:add","Index of out of bounds");a=Math.min(this.order.length,a)}if(this.callEvent("onBeforeAdd",[m,l,a])===false){return false}if(this.exists(m)){return dhtmlx.error("Not unique ID")}this.pull[m]=l;this.order.insertAt(m,a);if(this._filter_order){var g=this._filter_order.length;if(!a&&this.order.length){g=0}this._filter_order.insertAt(m,g)}this.callEvent("onafterAdd",[m,a]);this.callEvent("onStoreUpdated",[m,l,"add"]);return m},remove:function(g){if(g instanceof Array){for(var a=0;a=this.order.length||a<0){dhtmlx.log("Warning","DataStore::idByIndex Incorrect index")}return this.order[a]},indexById:function(c){var a=this.order.find(c);return a},next:function(c,a){return this.order[this.indexById(c)+(a||1)]},first:function(){return this.order[0]},last:function(){return this.order[this.order.length-1]},previous:function(c,a){return this.order[this.indexById(c)-(a||1)]},sort:function(m,c,a){var g=m;if(typeof m=="function"){g={as:m,dir:c}}else{if(typeof m=="string"){g={by:m,dir:c,as:a}}}var l=[g.by,g.dir,g.as];if(!this.callEvent("onbeforesort",l)){return}if(this.order.length){var n=dhtmlx.sort.create(g);var h=this.getRange(this.first(),this.last());h.sort(n);this.order=h.map(function(o){return this.id(o)},this)}this.refresh();this.callEvent("onaftersort",l)},filter:function(l,h){if(!this.callEvent("onBeforeFilter",[l,h])){return}if(this._filter_order){this.order=this._filter_order;delete this._filter_order}if(!this.order.length){return}if(l){var c=l;h=h||"";if(typeof l=="string"){l=dhtmlx.Template.fromHTML(l);h=h.toString().toLowerCase();c=function(o,n){return l(o).toLowerCase().indexOf(n)!=-1}}var g=dhtmlx.toArray();for(var a=0;ac?1:(gc?1:(gc?1:(g")!=-1){c=c.split("->");switch(c[0]){case"html":c=dhtmlx.html.getValue(c[1]).replace(/\"/g,'\\"');break;case"http":c=new dhtmlx.ajax().sync().get(c[1],{uid:(new Date()).valueOf()}).responseText;break;default:break}}g[a]=dhtmlx.Template.fromHTML(c)}}};dhtmlx.SingleRender={_init:function(){},_toHTML:function(a){return this.type._item_start(a,this.type)+this.type.template(a,this.type)+this.type._item_end},render:function(){if(!this.callEvent||this.callEvent("onBeforeRender",[this.data])){if(this.data){this._dataobj.innerHTML=this._toHTML(this.data)}if(this.callEvent){this.callEvent("onAfterRender",[])}}}};dhtmlx.ui.Tooltip=function(a){this.name="Tooltip";this.version="3.0";if(dhtmlx.assert_enabled()){this._assert()}if(typeof a=="string"){a={template:a}}dhtmlx.extend(this,dhtmlx.Settings);dhtmlx.extend(this,dhtmlx.SingleRender);this._parseSettings(a,{type:"default",dy:0,dx:20});this._dataobj=this._obj=document.createElement("DIV");this._obj.className="dhx_tooltip";dhtmlx.html.insertBefore(this._obj,document.body.firstChild)};dhtmlx.ui.Tooltip.prototype={show:function(a,c){if(this._disabled){return}if(this.data!=a){this.data=a;this.render(a)}this._obj.style.top=c.y+this._settings.dy+"px";this._obj.style.left=c.x+this._settings.dx+"px";this._obj.style.display="block"},hide:function(){this.data=null;this._obj.style.display="none"},disable:function(){this._disabled=true},enable:function(){this._disabled=false},types:{"default":dhtmlx.Template.fromHTML("{obj.id}")},template_item_start:dhtmlx.Template.empty,template_item_end:dhtmlx.Template.empty};dhtmlx.AutoTooltip={tooltip_setter:function(c){var a=new dhtmlx.ui.Tooltip(c);this.attachEvent("onMouseMove",function(h,g){a.show(this.get(h),dhtmlx.html.pos(g))});this.attachEvent("onMouseOut",function(h,g){a.hide()});this.attachEvent("onMouseMoving",function(h,g){a.hide()});return a}};dhtmlx.compat=function(a,c){if(dhtmlx.compat[a]){dhtmlx.compat[a](c)}};(function(){if(!window.dhtmlxError){var c=function(){};window.dhtmlxError={catchError:c,throwError:c};window.convertStringToBoolean=function(g){return !!g};window.dhtmlxEventable=function(g){dhtmlx.extend(g,dhtmlx.EventSystem)};var a={getXMLTopNode:function(g){},doXPath:function(g){return dhtmlx.DataDriver.xml.xpath(this.xml,g)},xmlDoc:{responseXML:true}};dhtmlx.compat.dataProcessor=function(m){var g="_sendData";var h="_in_progress";var n="_tMode";var l="_waitMode";m[g]=function(q,r){if(!q){return}if(r){this[h][r]=(new Date()).valueOf()}if(!this.callEvent("onBeforeDataSending",r?[r,this.getState(r)]:[])){return false}var o=this;var s=this.serverProcessor;if(this[n]!="POST"){dhtmlx.ajax().get(s+((s.indexOf("?")!=-1)?"&":"?")+this.serialize(q,r),"",function(w,u,v){a.xml=dhtmlx.DataDriver.xml.checkResponse(w,u);o.afterUpdate(o,null,null,null,a)})}else{dhtmlx.ajax().post(s,this.serialize(q,r),function(w,u,v){a.xml=dhtmlx.DataDriver.xml.checkResponse(w,u);o.afterUpdate(o,null,null,null,a)})}this[l]++}}}})();if(!dhtmlx.attaches){dhtmlx.attaches={}}dhtmlx.attaches.attachAbstract=function(c,a){var l=document.createElement("DIV");l.id="CustomObject_"+dhtmlx.uid();l.style.width="100%";l.style.height="100%";l.cmp="grid";document.body.appendChild(l);this.attachObject(l.id);a.container=l.id;var h=this.vs[this.av];h.grid=new window[c](a);h.gridId=l.id;h.gridObj=l;h.grid.setSizes=function(){if(this.resize){this.resize()}else{this.render()}};var g="_viewRestore";return this.vs[this[g]()].grid};dhtmlx.attaches.attachDataView=function(a){return this.attachAbstract("dhtmlXDataView",a)};dhtmlx.attaches.attachChart=function(a){return this.attachAbstract("dhtmlXChart",a)};dhtmlx.compat.layout=function(){};function dataProcessor(a){this.serverProcessor=a;this.action_param="!nativeeditor_status";this.object=null;this.updatedRows=[];this.autoUpdate=true;this.updateMode="cell";this._tMode="GET";this.post_delim="_";this._waitMode=0;this._in_progress={};this._invalid={};this.mandatoryFields=[];this.messages=[];this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",error:"color:red;",clear:"font-weight:normal;text-decoration:none;"};this.enableUTFencoding(true);dhtmlxEventable(this);return this}dataProcessor.prototype={setTransactionMode:function(c,a){this._tMode=c;this._tSend=a},escape:function(a){if(this._utf){return encodeURIComponent(a)}else{return escape(a)}},enableUTFencoding:function(a){this._utf=convertStringToBoolean(a)},setDataColumns:function(a){this._columns=(typeof a=="string")?a.split(","):a},getSyncState:function(){return !this.updatedRows.length},enableDataNames:function(a){this._endnm=convertStringToBoolean(a)},enablePartialDataSend:function(a){this._changed=convertStringToBoolean(a)},setUpdateMode:function(c,a){this.autoUpdate=(c=="cell");this.updateMode=c;this.dnd=a},ignore:function(c,a){this._silent_mode=true;c.call(a||window);this._silent_mode=false},setUpdated:function(h,g,l){if(this._silent_mode){return}var c=this.findRow(h);l=l||"updated";var a=this.obj.getUserData(h,this.action_param);if(a&&l=="updated"){l=a}if(g){this.set_invalid(h,false);this.updatedRows[c]=h;this.obj.setUserData(h,this.action_param,l);if(this._in_progress[h]){this._in_progress[h]="wait"}}else{if(!this.is_invalid(h)){this.updatedRows.splice(c,1);this.obj.setUserData(h,this.action_param,"")}}if(!g){this._clearUpdateFlag(h)}this.markRow(h,g,l);if(g&&this.autoUpdate){this.sendData(h)}},_clearUpdateFlag:function(a){},markRow:function(m,g,l){var h="";var c=this.is_invalid(m);if(c){h=this.styles[c];g=true}if(this.callEvent("onRowMark",[m,g,l,c])){h=this.styles[g?l:"clear"]+h;this.obj[this._methods[0]](m,h);if(c&&c.details){h+=this.styles[c+"_cell"];for(var a=0;a0?"&dhx_no_header=1":"")};var h=function(l){return a.call(this,l)+(this._connector_sorting||"")+(this._connector_filter||"")};var g=function(m,n,l){this._connector_sorting="&dhx_sort["+n+"]="+l;return h.call(this,m)};var c=function(m,l,o){var q=[];for(var n=0;n0){this.views[m].cellCont.push(n.firstChild);n.removeChild(n.firstChild)}this.dataType=null;this.dataObj=null;for(var l in this.dataNodes){for(var h in this.conf.ofs_nodes){if(typeof(this.conf.ofs_nodes[h][l])!="undefined"){this.views[m].ofs_nodes[h][l]=this.conf.ofs_nodes[h][l];this.conf.ofs_nodes[h][l]=null;delete this.conf.ofs_nodes[h][l]}}this.views[m].dataNodesCont[l]=this.cell.childNodes[this.conf.idx[l]];this.cell.removeChild(this.cell.childNodes[this.conf.idx[l]]);this.views[m].dataNodes[l]=this.dataNodes[l];this.dataNodes[l]=null;delete this.dataNodes[l];this._updateIdx()}this.callEvent("_onViewSave",[m])};this._viewRestore=function(m){if(this.views[m]==null){return}this.dataObj=this.views[m].dataObj;this.dataType=this.views[m].dataType;for(var n=0;n"+a.xmlDoc.responseText+"");if(typeof(q._doOnFrameContentLoaded)=="function"){q._doOnFrameContentLoaded()}q.dataType="url-ajax";q=a=null})}else{dhx4.ajax.get(c,function(a){q.attachHTMLString("
"+a.xmlDoc.responseText+"
");if(typeof(q._doOnFrameContentLoaded)=="function"){q._doOnFrameContentLoaded()}q.dataType="url-ajax";q=a=null})}}else{if(this.dataType=="url"){var m=this.getFrame()}else{var m=document.createElement("IFRAME");m.frameBorder=0;m.border=0;m.style.width="100%";m.style.height="100%";m.style.position="relative";this._attachObject(m);this.dataType="url";this._attachURLEvents()}if(h){var n=(typeof(this.conf.url_data.post_ifr)=="undefined");this.conf.url_data.post_ifr=true;if(n){this._attachURLEvents()}m.src="about:blank"}else{m.src=c+(c.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime()}m=null}m=null};dhtmlXCellObject.prototype.reloadURL=function(){if(!(this.dataType=="url"||this.dataType=="url-ajax")){return}if(this.conf.url_data==null){return}this.attachURL(this.conf.url_data.url,this.conf.url_data.ajax,this.conf.url_data.post_data)};dhtmlXCellObject.prototype.attachHTMLString=function(str){this._attachObject(null,null,str);var z=str.match(/]*>[^\f]*?<\/script>/g)||[];for(var i=0;i]*>/gi,"");if(s){if(window.execScript){window.execScript(s)}else{window.eval(s)}}}};dhtmlXCellObject.prototype.attachLayout=function(a){if(this.conf.skin=="dhx_skyblue"&&typeof(window.dhtmlXWindowsCell)!="undefined"&&(this instanceof dhtmlXWindowsCell)){}if(this instanceof dhtmlXLayoutCell){this._hideBorders()}var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);if(typeof(this._layoutMainInst)!="undefined"){c._layoutMainInst=this._layoutMainInst}if(this instanceof window.dhtmlXLayoutCell){}if(typeof(window.dhtmlXLayoutCell)!="undefined"&&this instanceof dhtmlXLayoutCell){c._isParentCell=true}if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={t:-1}}if(typeof(a)=="string"){a={pattern:a}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=c;this.dataType="layout";this.dataObj=new dhtmlXLayoutObject(a);if(this instanceof dhtmlXLayoutCell){this.dataObj.parentLayout=this.layout}c._layoutMainInst=null;a.parent=null;c=a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype.attachTree=function(a){var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);this.dataType="tree";this.dataObj=new dhtmlXTreeObject(c,"100%","100%",(a||0));this.dataObj.setSkin(this.conf.skin);this.dataObj.allTree.childNodes[0].style.marginTop="2px";this.dataObj.allTree.childNodes[0].style.marginBottom="2px";c=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype.attachGrid=function(){var a=document.createElement("DIV");a.style.width="100%";a.style.height="100%";a.style.position="relative";a.style.overflow="hidden";this._attachObject(a);this.dataType="grid";this.dataObj=new dhtmlXGridObject(a);this.dataObj.setSkin(this.conf.skin);if(this.conf.skin=="dhx_skyblue"&&typeof(window.dhtmlXWindowsCell)!="undefined"&&this instanceof window.dhtmlXWindowsCell){this.dataObj.entBox.style.border="1px solid #a4bed4";this.dataObj._sizeFix=0}else{this.dataObj.entBox.style.border="0px solid white";this.dataObj._sizeFix=2}a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype.attachTabbar=function(a){if(typeof(window.dhtmlXLayoutCell)!="undefined"&&this instanceof dhtmlXLayoutCell){this._hideBorders()}if(typeof(a)=="string"){a={mode:a}}else{if(typeof(a)!="object"||a==null){a={}}}var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={t:-1}}this._attachObject(c);a.skin=this.conf.skin;a.parent=c;this.dataType="tabbar";this.dataObj=new dhtmlXTabBar(a);a.parent=c=null;a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype.attachAccordion=function(a){if(typeof(window.dhtmlXWindowsCell)!="undefined"&&(this instanceof dhtmlXWindowsCell)){}else{if(this._isCell){this._hideBorders()}}var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";this._attachObject(c);if(typeof(a)=="undefined"){a={}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=c;if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={s:{first:-1},m:{first:4}}}this.dataType="acc";this.dataObj=new dhtmlXAccordion(a);a.obj=null;c=a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype.attachEditor=function(a){var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);if(!(typeof(a)=="object"&&a!=null)){a={}}a.parent=c;this.dataType="editor";this.dataObj=new dhtmlXEditor(a);c=null;a.parent=null;a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype.attachDataView=function(a){var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);if(typeof(a)=="undefined"){a={}}c.id="DataViewObject_"+new Date().getTime();a.container=c.id;a.skin=this.conf.skin;this.dataType="dataview";this.dataObj=new dhtmlXDataView(a);this.dataObj.setSizes=function(){this.render()};c=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype.attachScheduler=function(a,n,c,h){h=h||window.scheduler;var l=false;if(c){var m=document.getElementById(c);if(m){l=true}}if(!l){var g=c||'
';var m=document.createElement("DIV");m.id="dhxSchedObj_"+new Date().getTime();m.style.width="100%";m.style.height="100%";m.style.position="relative";m.style.overflow="hidden";m.className="dhx_cal_container";m.innerHTML='
 
 
'+g+'
'}this._attachObject(m);this.dataType="scheduler";this.dataObj=h;this.dataObj.setSizes=function(){this.update_view()};h.init(m.id,a,n);m=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype.attachForm=function(a){var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";if(window.dhtmlx&&dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(c)}else{c.style.overflow="auto"}this._attachObject(c);this.dataType="form";this.dataObj=new dhtmlXForm(c,a);this.dataObj.setSkin(this.conf.skin);c=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype.attachMap=function(a){var c=document.createElement("DIV");c.id="GMapsObj_"+this._genStr(12);c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);if(!a){a={center:new google.maps.LatLng(40.719837,-73.992348),zoom:11,mapTypeId:google.maps.MapTypeId.ROADMAP}}this.dataType="maps";this.dataObj=new google.maps.Map(c,a);this.dataObj.setSizes=function(){google.maps.event.trigger(this,"resize")};c=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype.attachChart=function(a){var c=document.createElement("DIV");c.id="dhxChartObj_"+window.dhx4.newId();c.style.width="100%";c.style.height="100%";document.body.appendChild(c);this._attachObject(c);a.container=c.id;this.dataType="chart";this.dataObj=new dhtmlXChart(a);if(!this.dataObj.setSizes){this.dataObj.setSizes=function(){if(this.resize){this.resize()}else{this.render()}}}return this.dataObj};dhtmlXCellObject.prototype.attachMenu=function(a){if(this.dataNodes.menu){return}if(typeof(a)=="undefined"){a={}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=this._attachObject("menu").firstChild;this.dataNodes.menu=new dhtmlXMenuObject(a);this._adjustCont(this._idd);a.parent=null;a=null;return this.dataNodes.menu};dhtmlXCellObject.prototype.detachMenu=function(){if(!this.dataNodes.menu){return}this.dataNodes.menu.unload();this.dataNodes.menu=null;delete this.dataNodes.menu;this._detachObject("menu")};dhtmlXCellObject.prototype.showMenu=function(){this._mtbShowHide("menu","")};dhtmlXCellObject.prototype.hideMenu=function(){this._mtbShowHide("menu","none")};dhtmlXCellObject.prototype.attachToolbar=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}if(typeof(a)=="undefined"){a={}}else{if(typeof(a)=="string"){a={skin:a}}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=this._attachObject("toolbar").firstChild;this.dataNodes.toolbar=new dhtmlXToolbarObject(a);this._adjustCont(this._idd);this.dataNodes.toolbar._masterCell=this;this.dataNodes.toolbar.attachEvent("_onIconSizeChange",function(){this._masterCell._adjustCont()});a.parent=null;a=null;return this.dataNodes.toolbar};dhtmlXCellObject.prototype.detachToolbar=function(){if(!this.dataNodes.toolbar){return}this.dataNodes.toolbar._masterCell=null;this.dataNodes.toolbar.unload();this.dataNodes.toolbar=null;delete this.dataNodes.toolbar;this._detachObject("toolbar")};dhtmlXCellObject.prototype.showToolbar=function(){this._mtbShowHide("toolbar","")};dhtmlXCellObject.prototype.hideToolbar=function(){this._mtbShowHide("toolbar","none")};dhtmlXCellObject.prototype.attachRibbon=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}if(typeof(a)=="undefined"){a={}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=this._attachObject("ribbon").firstChild;this.dataNodes.ribbon=new dhtmlXRibbon(a);var c=this;this.dataNodes.ribbon.attachEvent("_onHeightChanged",function(){c._adjustCont(c._idd)});this._adjustCont();a.parent=null;a=null;return this.dataNodes.ribbon};dhtmlXCellObject.prototype.detachRibbon=function(){if(!this.dataNodes.ribbon){return}this.dataNodes.ribbon.unload();this.dataNodes.ribbon=null;delete this.dataNodes.ribbon;this._detachObject("ribbon")};dhtmlXCellObject.prototype.showRibbon=function(){this._mtbShowHide("ribbon","")};dhtmlXCellObject.prototype.hideRibbon=function(){this._mtbShowHide("ribbon","none")};dhtmlXCellObject.prototype.attachStatusBar=function(a){if(this.dataNodes.sb){return}if(this.conf.skin=="dhx_skyblue"&&typeof(window.dhtmlXWindowsCell)!="undefined"&&(this instanceof dhtmlXWindowsCell)){this.cell.childNodes[this.conf.idx.cont].className+=" dhx_cell_statusbar_attached"}this.dataNodes.sb=this._attachObject("sb",a);this.dataNodes.sb.setText=function(c){this.childNodes[0].innerHTML=c};this.dataNodes.sb.getText=function(){return this.childNodes[0].innerHTML};this.dataNodes.sb.onselectstart=function(c){return false};return this.dataNodes.sb};dhtmlXCellObject.prototype.detachStatusBar=function(){if(!this.dataNodes.sb){return}if(this.conf.skin=="dhx_skyblue"&&typeof(window.dhtmlXWindowsCell)!="undefined"&&(this instanceof dhtmlXWindowsCell)){this.cell.childNodes[this.conf.idx.cont].className=this.cell.childNodes[this.conf.idx.cont].className.replace(/\s{0,}dhx_cell_statusbar_attached/,"")}this.dataNodes.sb.setText=this.dataNodes.sb.getText=this.dataNodes.sb.onselectstart=null;this.dataNodes.sb=null;delete this.dataNodes.sb;this._detachObject("sb")};dhtmlXCellObject.prototype.showStatusBar=function(){this._mtbShowHide("sb","")};dhtmlXCellObject.prototype.hideStatusBar=function(){this._mtbShowHide("sb","none")};dhtmlXCellObject.prototype._mtbShowHide=function(c,a){if(!this.dataNodes[c]){return}this.cell.childNodes[this.conf.idx[c]].style.display=a;this._adjustCont()};dhtmlXCellObject.prototype.getFrame=dhtmlXCellObject.prototype._getFrame=function(){if(this.dataType!="url"){return null}return this.cell.childNodes[this.conf.idx.cont].firstChild};dhtmlXCellObject.prototype._genStr=function(){if(!this._genStrId){this._genStrId=new Date().getTime()}return this._genStrId++};dhtmlXCellObject.prototype._attachURLEvents=function(){if(this.dataType!="url"){return}var g=this;var c=this._idd;var a=this.cell.childNodes[this.conf.idx.cont].firstChild;if(typeof(this._doOnFrameMouseDown)!="function"){this._doOnFrameMouseDown=function(h){g.callEvent("_onContentMouseDown",[c,h||event])}}if(typeof(window.addEventListener)=="function"){a.onload=function(){try{if(typeof(g._doOnFrameMouseDown)=="function"){this.contentWindow.document.body.addEventListener("mousedown",g._doOnFrameMouseDown,false)}}catch(h){}try{if(typeof(g._doOnFrameContentLoaded)=="function"){g._doOnFrameContentLoaded()}}catch(h){}}}else{a.onreadystatechange=function(h){if(this.readyState=="complete"){try{if(typeof(g._doOnFrameMouseDown)=="function"){this.contentWindow.document.body.attachEvent("onmousedown",g._doOnFrameMouseDown)}}catch(l){}try{if(typeof(g._doOnFrameContentLoaded)=="function"){g._doOnFrameContentLoaded()}}catch(l){}}}}};dhtmlXCellObject.prototype._doOnFrameContentLoaded=function(){if(this.conf.url_data.post_ifr==true){var m=this.getFrame().contentWindow.document;var l=m.createElement("FORM");l.method="POST";l.action=this.conf.url_data.url;m.body.appendChild(l);var g={};g["dhxr"+new Date().getTime()]="1";for(var c in this.conf.url_data.post_data){g[c]=this.conf.url_data.post_data[c]}for(var c in g){var h=m.createElement("INPUT");h.type="hidden";h.name=c;h.value=g[c];l.appendChild(h);h=null}this.conf.url_data.post_ifr=false;l.submit()}else{this.callEvent("_onContentLoaded",[this._idd])}};dhtmlXCellObject.prototype._detachURLEvents=function(a){if(a==null){if(this.dataType!="url"){return}a=this.cell.childNodes[this.conf.idx.cont].firstChild}if(typeof(window.addEventListener)=="function"){a.onload=null;try{a.contentWindow.document.body.removeEventListener("mousedown",this._doOnFrameMouseDown,false)}catch(c){}}else{a.onreadystatechange=null;try{a.contentWindow.document.body.detachEvent("onmousedown",this._doOnFrameMouseDown)}catch(c){}}a=null};dhtmlXCellObject.prototype._attachObject=function(o,l,n,a,m){if(o=="menu"){if(typeof(m)!="undefined"){o=m}else{o=document.createElement("DIV");o.className="dhx_cell_menu_"+(this.conf.borders?"def":"no_borders");o.appendChild(document.createElement("DIV"))}this.cell.insertBefore(o,this.cell.childNodes[this.conf.idx.toolbar||this.conf.idx.cont]);this.conf.ofs_nodes.t.menu=true;this._updateIdx();return o}if(o=="toolbar"){if(typeof(m)!="undefined"){o=m}else{o=document.createElement("DIV");o.className="dhx_cell_toolbar_"+(this.conf.borders?"def":"no_borders");o.appendChild(document.createElement("DIV"));o.firstChild.className="dhx_toolbar_base_18_dhx_skyblue"}this.cell.insertBefore(o,this.cell.childNodes[this.conf.idx.cont]);this.conf.ofs_nodes.t.toolbar=true;this._updateIdx();return o}if(o=="ribbon"){if(typeof(m)!="undefined"){o=m}else{o=document.createElement("DIV");o.className="dhx_cell_ribbon_"+(this.conf.borders?"def":"no_borders");o.appendChild(document.createElement("DIV"))}this.cell.insertBefore(o,this.cell.childNodes[this.conf.idx.cont]);this.conf.ofs_nodes.t.ribbon=true;this._updateIdx();this._adjustCont(this._idd);return o}if(o=="sb"){if(typeof(m)!="undefined"){o=m}else{var c=l||{};var q=(typeof(c.text)=="string"&&c.text.length>0?c.text:" ");var g=(typeof(c.height)=="number"?c.height:false);var o=document.createElement("DIV");o.className="dhx_cell_statusbar_def";o.innerHTML="
"+q+"
";if(g!=false){o.firstChild.style.height=o.firstChild.style.lineHeight=g+"px"}}if(this.conf.idx.pr1!=null){this.cell.insertBefore(o,this.cell.childNodes[this.conf.idx.pr1])}else{this.cell.appendChild(o)}this.conf.ofs_nodes.b.sb=true;this._updateIdx();this._adjustCont(this._idd);return o}if(a!=true){this._detachObject(null,true,null)}if(typeof(n)=="string"){this.cell.childNodes[this.conf.idx.cont].innerHTML=n}else{this.cell.childNodes[this.conf.idx.cont].appendChild(o)}o=null};dhtmlXCellObject.prototype._detachObject=function(l,c,a){this.callEvent("_onBeforeContentDetach",[]);if(l=="menu"||l=="toolbar"||l=="ribbon"||l=="sb"){var h=this.cell.childNodes[this.conf.idx[l]];h.parentNode.removeChild(h);h=null;this.conf.ofs_nodes[l=="sb"?"b":"t"][l]=false;this._updateIdx();if(!this.conf.unloading){this._adjustCont(this._idd)}return}if(c==true){a=false}else{if(typeof(a)=="undefined"){a=document.body}else{if(typeof(a)=="string"){a=document.getElementById(a)}}}if(a===false){if(this.dataType=="url"){this._detachURLEvents()}else{if(this.dataObj!=null){if(typeof(this.dataObj.unload)=="function"){this.dataObj.unload()}else{if(typeof(this.dataObj.destructor)=="function"){this.dataObj.destructor()}}}}}var h=this.cell.childNodes[this.conf.idx.cont];while(h.childNodes.length>0){if(a===false){h.removeChild(h.lastChild)}else{h.firstChild.style.display="none";a.appendChild(h.firstChild)}}if(this.conf.append_mode){h.style.overflow="";this.conf.append_mode=false}var g=(this.dataType=="tabbar");this.dataObj=null;this.dataType=null;a=h=null;if(this.conf.unloading!=true&&g){this.showHeader(true);this._showBorders()}};dhtmlXCellObject.prototype._attachFromCell=function(c){this.detachObject(true);var h="layout";if(typeof(window.dhtmlXWindowsCell)!="undefined"&&this instanceof window.dhtmlXWindowsCell){h="window"}if(typeof(window.dhtmlXWindowsCell)!="undefined"&&c instanceof window.dhtmlXWindowsCell&&c.wins.w[c._idd].conf.parked){c.wins._winCellSetOpacity(c._idd,"open",false)}if(typeof(window.dhtmlXAccordionCell)!="undefined"&&c instanceof window.dhtmlXAccordionCell&&c.conf.opened==false){c._cellSetOpacity("open",false)}for(var g in c.dataNodes){this._attachObject(g,null,null,null,c.cell.childNodes[c.conf.idx[g]]);this.dataNodes[g]=c.dataNodes[g];c.dataNodes[g]=null;c.conf.ofs_nodes[g=="sb"?"b":"t"][g]=false;c._updateIdx()}this._mtbUpdBorder();if(c.dataType!=null&&c.dataObj!=null){this.dataType=c.dataType;this.dataObj=c.dataObj;while(c.cell.childNodes[c.conf.idx.cont].childNodes.length>0){this.cell.childNodes[this.conf.idx.cont].appendChild(c.cell.childNodes[c.conf.idx.cont].firstChild)}c.dataType=null;c.dataObj=null;if(this.dataType=="grid"){if(h=="window"&&this.conf.skin=="dhx_skyblue"){this.dataObj.entBox.style.border="1px solid #a4bed4";this.dataObj._sizeFix=0}else{this.dataObj.entBox.style.border="0px solid white";this.dataObj._sizeFix=2}}}else{while(c.cell.childNodes[c.conf.idx.cont].childNodes.length>0){this.cell.childNodes[this.conf.idx.cont].appendChild(c.cell.childNodes[c.conf.idx.cont].firstChild)}}this.conf.view=c.conf.view;c.conf.view="def";for(var g in c.views){this.views[g]=c.views[g];c.views[g]=null;delete c.views[g]}c._updateIdx();c._adjustCont();this._updateIdx();this._adjustCont();if(h=="window"&&this.wins.w[this._idd].conf.parked){this.wins._winCellSetOpacity(this._idd,"close",false)}};function dhtmlXCalendarObject(m,u){this.i={};var g=null;if(typeof(m)=="string"){var h=document.getElementById(m)}else{var h=m}if(h&&typeof(h)=="object"&&h.tagName&&String(h.tagName).toLowerCase()!="input"){g=h}h=null;if(typeof(m)!="object"||!m.length){m=[m]}for(var c=0;c
";n.appendChild(s);var l=this;s[this.conf.touch?"ontouchstart":"onclick"]=function(w){w=w||event;var q=(w.target||w.srcElement);if(q.className&&q.className.indexOf("dhtmlxcalendar_month_arrow")===0){l._hideSelector();var v=(q.parentNode.firstChild==q?-1:1);var a=new Date(l._activeMonth);l._drawMonth(new Date(l._activeMonth.getFullYear(),l._activeMonth.getMonth()+v,1,0,0,0,0));l._evOnArrowClick([a,new Date(l._activeMonth)]);return}if(q.className&&q.className=="dhtmlxcalendar_month_label_month"){w.cancelBubble=true;l._showSelector("month",Math.round(q.offsetLeft+q.offsetWidth/2),q.offsetTop+q.offsetHeight+2,"selector_month",true);return}if(q.className&&q.className=="dhtmlxcalendar_month_label_year"){w.cancelBubble=true;l._showSelector("year",Math.round(q.offsetLeft+q.offsetWidth/2),q.offsetTop+q.offsetHeight+2,"selector_year",true);return}l._hideSelector()};this.contDays=document.createElement("DIV");this.contDays.className="dhtmlxcalendar_days_cont";this.base.firstChild.appendChild(this.contDays);this.setWeekStartDay=function(a){if(a==0){a=7}this._wStart=Math.min(Math.max((isNaN(a)?1:a),1),7);this._drawDaysOfWeek()};this._drawDaysOfWeek=function(){if(this.contDays.childNodes.length==0){var y=document.createElement("UL");y.className="dhtmlxcalendar_line";this.contDays.appendChild(y)}else{var y=this.contDays.firstChild}var v=this._wStart;var x=this.langData[this.lang].daysSNames;x.push(String(this.langData[this.lang].daysSNames[0]).valueOf());for(var A=0;A<8;A++){if(y.childNodes[A]==null){var a=document.createElement("LI");y.appendChild(a)}else{var a=y.childNodes[A]}if(A==0){a.className="dhtmlxcalendar_cell_wn";a.innerHTML="
"+(this.langData[this.lang].weekname||"w")+"
"}else{a.className="dhtmlxcalendar_cell"+(v>=6?" dhtmlxcalendar_day_weekday_cell":"")+(A==1?"_first":"");a.innerHTML=x[v];if(++v>7){v=1}}}if(this._activeMonth!=null){this._drawMonth(this._activeMonth)}};this._wStart=this.langData[this.lang].weekstart;this.setWeekStartDay(this._wStart);this.contDates=document.createElement("DIV");this.contDates.className="dhtmlxcalendar_dates_cont";this.base.firstChild.appendChild(this.contDates);this.contDates[this.conf.touch?"ontouchend":"onclick"]=function(y){y=y||event;var q=(y.target||y.srcElement);if(q.parentNode!=null&&q.parentNode._date!=null){q=q.parentNode}if(q._date!=null&&!q._css_dis){var w=l._activeDate.getHours();var v=l._activeDate.getMinutes();var x=q._date;if(l.checkEvent("onBeforeChange")){if(!l.callEvent("onBeforeChange",[new Date(q._date.getFullYear(),q._date.getMonth(),q._date.getDate(),w,v)])){return}}if(l._activeDateCell!=null){l._activeDateCell._css_date=false;l._updateCellStyle(l._activeDateCell._q,l._activeDateCell._w)}var a=(l._activeDate.getFullYear()+"_"+l._activeDate.getMonth()!=x.getFullYear()+"_"+x.getMonth());l._nullDate=false;l._activeDate=new Date(x.getFullYear(),x.getMonth(),x.getDate(),w,v);l._activeDateCell=q;l._activeDateCell._css_date=true;l._activeDateCell._css_hover=false;l._updateCellStyle(l._activeDateCell._q,l._activeDateCell._w);if(a){l._drawMonth(l._activeDate)}if(l._activeInp&&l.i[l._activeInp]&&l.i[l._activeInp].input!=null){l.i[l._activeInp].input.value=l._dateToStr(new Date(l._activeDate.getTime()))}if(!l._hasParent){l._hide()}l._evOnClick([new Date(l._activeDate.getTime())])}};if(!this.conf.touch){this.contDates.onmouseover=function(q){q=q||event;var a=(q.target||q.srcElement);if(a.parentNode!=null&&a.parentNode._date!=null){a=a.parentNode}if(a._date!=null){if(l._lastHover==a||a._css_hover){return}a._css_hover=true;l._updateCellStyle(a._q,a._w);l._lastHover=a;l._evOnMouseOver([new Date(a._date.getFullYear(),a._date.getMonth(),a._date.getDate(),0,0,0,0),q]);a=null}};this.contDates.onmouseout=function(a){l._clearDayHover(a||event)}}this._lastHover=null;this._clearDayHover=function(a){if(!this._lastHover){return}this._lastHover._css_hover=false;this._updateCellStyle(this._lastHover._q,this._lastHover._w);l._evOnMouseOut([new Date(this._lastHover._date.getFullYear(),this._lastHover._date.getMonth(),this._lastHover._date.getDate(),0,0,0,0),a]);this._lastHover=null};for(var c=0;c<6;c++){var n=document.createElement("UL");n.className="dhtmlxcalendar_line";this.contDates.appendChild(n);for(var r=0;r<=7;r++){var s=document.createElement("LI");if(r==0){s.className="dhtmlxcalendar_cell_wn"}else{s.className="dhtmlxcalendar_cell"}n.appendChild(s)}}this.contTime=document.createElement("DIV");this.contTime.className="dhtmlxcalendar_time_cont";this.base.firstChild.appendChild(this.contTime);this.showTime=function(){this.contTime.style.display="";this._ifrSize()};this.hideTime=function(){this.contTime.style.display="none";this._ifrSize()};var n=document.createElement("UL");n.className="dhtmlxcalendar_line";this.contTime.appendChild(n);var s=document.createElement("LI");s.className="dhtmlxcalendar_cell dhtmlxcalendar_time_hdr";s.innerHTML="
: ";n.appendChild(s);s[this.conf.touch?"ontouchstart":"onclick"]=function(v){v=v||event;var a=(v.target||v.srcElement);if(a.tagName!=null&&a.tagName.toLowerCase()=="span"&&a._par==true&&a.parentNode!=null){a=a.parentNode}if(a.className&&a.className=="dhtmlxcalendar_label_hours"){v.cancelBubble=true;var q=l.contMonth.offsetHeight+l.contDays.offsetHeight+l.contDates.offsetHeight+a.offsetTop;l._showSelector("hours",Math.round(a.offsetLeft+a.offsetWidth/2),q-2,"selector_hours",true);return}if(a.className&&a.className=="dhtmlxcalendar_label_minutes"){v.cancelBubble=true;if(l._minutesInterval==1){var w=l.getFormatedDate("%i");a.innerHTML=""+w.charAt(0)+""+w.charAt(1);a.firstChild._par=true;l._selectorMode=1}var q=l.contMonth.offsetHeight+l.contDays.offsetHeight+l.contDates.offsetHeight+a.offsetTop;l._showSelector("minutes",Math.round(a.offsetLeft+a.offsetWidth/2),q-2,"selector_minutes",true);return}l._hideSelector()};this._activeMonth=null;this._activeDate=new Date();this._activeDateCell=null;this.setDate=function(q){this._nullDate=(typeof(q)=="undefined"||q===""||!q);if(!(q instanceof Date)){q=this._strToDate(String(q||""));if(q=="Invalid Date"){q=new Date()}}var a=q.getTime();if(this._isOutOfRange(a)){return}this._activeDate=new Date(a);this._drawMonth(this._nullDate?new Date():this._activeDate);this._updateVisibleHours();this._updateVisibleMinutes()};this.getDate=function(q){if(this._nullDate){return null}var a=new Date(this._activeDate.getTime());if(q){return this._dateToStr(a)}return a};this._drawMonth=function(E){if(!(E instanceof Date)){return}if(isNaN(E.getFullYear())){E=new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),1,0,0,0,0)}this._activeMonth=new Date(E.getFullYear(),E.getMonth(),1,0,0,0,0);this._activeDateCell=null;var C=new Date(this._activeMonth.getTime());var x=C.getDay();var I=x-this._wStart;if(I<0){I=I+7}C.setDate(C.getDate()-I);var L=E.getMonth();var M=new Date(this._activeDate.getFullYear(),this._activeDate.getMonth(),this._activeDate.getDate(),0,0,0,0).getTime();var A=0;for(var v=0;v<6;v++){var D=this._wStart;for(var K=0;K<=7;K++){if(K==0){var J=this.getWeekNumber(new Date(C.getFullYear(),C.getMonth(),C.getDate()+A,0,0,0,0));this.contDates.childNodes[v].childNodes[K].innerHTML="
"+J+"
"}else{var a=new Date(C.getFullYear(),C.getMonth(),C.getDate()+A,0,0,0,0);var H=a.getDay();var y=a.getTime();var F="dhtmlxcalendar_label";if(this._tipData[y]!=null){if(this._tipData[y].usePopup&&typeof(window.dhtmlXPopup)=="function"){this.contDates.childNodes[v].childNodes[K].removeAttribute("title");this._initTooltipPopup()}else{this.contDates.childNodes[v].childNodes[K].setAttribute("title",this._tipData[y].text)}if(this._tipData[y].showIcon){F+=" dhtmlxcalendar_label_title"}}else{this.contDates.childNodes[v].childNodes[K].removeAttribute("title")}this.contDates.childNodes[v].childNodes[K].innerHTML="
"+a.getDate()+"
";this.contDates.childNodes[v].childNodes[K]._date=new Date(y);this.contDates.childNodes[v].childNodes[K]._q=v;this.contDates.childNodes[v].childNodes[K]._w=K;this.contDates.childNodes[v].childNodes[K]._css_month=(a.getMonth()==L);this.contDates.childNodes[v].childNodes[K]._css_date=(!this._nullDate&&y==M);this.contDates.childNodes[v].childNodes[K]._css_weekend=(D>=6);this.contDates.childNodes[v].childNodes[K]._css_dis=this._isOutOfRange(y);this.contDates.childNodes[v].childNodes[K]._css_holiday=(this._holidays[y]==true);this._updateCellStyle(v,K);if(y==M){this._activeDateCell=this.contDates.childNodes[v].childNodes[K]}if(++D>7){D=1}A++}}}this.contMonth.firstChild.firstChild.childNodes[1].innerHTML=this._buildMonthHdr(E)};this._updateCellStyle=function(y,a){var x=this.contDates.childNodes[y].childNodes[a];var v="dhtmlxcalendar_cell dhtmlxcalendar_cell";v+=(x._css_month?"_month":"");v+=(x._css_date?"_date":"");v+=(x._css_weekend?"_weekend":"");v+=(x._css_holiday?"_holiday":"");v+=(x._css_dis?"_dis":"");v+=(x._css_hover&&!x._css_dis?"_hover":"");x.className=v;x=null};this._minutesInterval=5;this._initSelector=function(E,y){if(!this._selCover){this._selCover=document.createElement("DIV");this._selCover.className="dhtmlxcalendar_selector_cover";this.base.firstChild.appendChild(this._selCover)}if(!this._sel){this._sel=document.createElement("DIV");this._sel.className="dhtmlxcalendar_selector_obj";this.base.firstChild.appendChild(this._sel);this._sel.appendChild(document.createElement("TABLE"));this._sel.firstChild.className="dhtmlxcalendar_selector_table";this._sel.firstChild.cellSpacing=0;this._sel.firstChild.cellPadding=0;this._sel.firstChild.border=0;this._sel.firstChild.appendChild(document.createElement("TBODY"));this._sel.firstChild.firstChild.appendChild(document.createElement("TR"));this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD"));this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD"));this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD"));this._sel.firstChild.firstChild.firstChild.childNodes[0].className="dhtmlxcalendar_selector_cell_left";this._sel.firstChild.firstChild.firstChild.childNodes[1].className="dhtmlxcalendar_selector_cell_middle";this._sel.firstChild.firstChild.firstChild.childNodes[2].className="dhtmlxcalendar_selector_cell_right";this._sel.firstChild.firstChild.firstChild.childNodes[0].innerHTML=" ";this._sel.firstChild.firstChild.firstChild.childNodes[2].innerHTML=" ";if(!this.conf.touch){this._sel.firstChild.firstChild.firstChild.childNodes[0].onmouseover=function(){this.className="dhtmlxcalendar_selector_cell_left dhtmlxcalendar_selector_cell_left_hover"};this._sel.firstChild.firstChild.firstChild.childNodes[0].onmouseout=function(){this.className="dhtmlxcalendar_selector_cell_left"};this._sel.firstChild.firstChild.firstChild.childNodes[2].onmouseover=function(){this.className="dhtmlxcalendar_selector_cell_right dhtmlxcalendar_selector_cell_right_hover"};this._sel.firstChild.firstChild.firstChild.childNodes[2].onmouseout=function(){this.className="dhtmlxcalendar_selector_cell_right"};this._sel.onmouseover=function(w){w=w||event;var q=(w.target||w.srcElement);if(q._cell===true){if(l._selHover!=q){l._clearSelHover()}if(String(q.className).match(/^\s{0,}dhtmlxcalendar_selector_cell\s{0,}$/gi)!=null){q.className+=" dhtmlxcalendar_selector_cell_hover";l._selHover=q}}};this._sel.onmouseout=function(){l._clearSelHover()}}this._sel.firstChild.firstChild.firstChild.childNodes[0][this.conf.touch?"ontouchstart":"onclick"]=function(q){q=q||event;q.cancelBubble=true;l._scrollYears(-1)};this._sel.firstChild.firstChild.firstChild.childNodes[2][this.conf.touch?"ontouchstart":"onclick"]=function(q){q=q||event;q.cancelBubble=true;l._scrollYears(1)};this._sel._ta={};this._selHover=null;this._sel.appendChild(document.createElement("DIV"));this._sel.lastChild.className="dhtmlxcalendar_selector_obj_arrow"}if(this._sel._ta[E]==true){return}if(E=="month"){this._msCells={};this.msCont=document.createElement("DIV");this.msCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.msCont);var v=0;for(var a=0;a<4;a++){var D=document.createElement("UL");D.className="dhtmlxcalendar_selector_line";this.msCont.appendChild(D);for(var F=0;F<3;F++){var H=document.createElement("LI");H.innerHTML=this.langData[this.lang].monthesSNames[v];H.className="dhtmlxcalendar_selector_cell";D.appendChild(H);H._month=v;H._cell=true;this._msCells[v++]=H}}this.msCont[this.conf.touch?"ontouchstart":"onclick"]=function(w){w=w||event;w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._month!=null){l._hideSelector();l._updateActiveMonth();l._drawMonth(new Date(l._activeMonth.getFullYear(),q._month,1,0,0,0,0));l._doOnSelectorChange()}}}if(E=="year"){this._ysCells={};this.ysCont=document.createElement("DIV");this.ysCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.ysCont);for(var a=0;a<4;a++){var D=document.createElement("UL");D.className="dhtmlxcalendar_selector_line";this.ysCont.appendChild(D);for(var F=0;F<3;F++){var H=document.createElement("LI");H.className="dhtmlxcalendar_selector_cell";H._cell=true;D.appendChild(H)}}this.ysCont[this.conf.touch?"ontouchstart":"onclick"]=function(w){w=w||event;w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._year!=null){l._hideSelector();l._drawMonth(new Date(q._year,l._activeMonth.getMonth(),1,0,0,0,0));l._doOnSelectorChange()}}}if(E=="hours"){this._hsCells={};this.hsCont=document.createElement("DIV");this.hsCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.hsCont);var v=0;for(var a=0;a<4;a++){var D=document.createElement("UL");D.className="dhtmlxcalendar_selector_line";this.hsCont.appendChild(D);for(var F=0;F<6;F++){var H=document.createElement("LI");H.innerHTML=this._fixLength(v,2);H.className="dhtmlxcalendar_selector_cell";D.appendChild(H);H._hours=v;H._cell=true;this._hsCells[v++]=H}}this.hsCont[this.conf.touch?"ontouchstart":"onclick"]=function(w){w=w||event;w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._hours!=null){l._hideSelector();l._activeDate.setHours(q._hours);l._updateActiveHours();l._updateVisibleHours();l._doOnSelectorChange()}}}if(E=="minutes"){var C=4;var x=3;var A=2;if(this._minutesInterval==1){if(this._selectorMode==1){C=2;x=3;A=1}else{C=2;x=5;A=1;y+="5"}}if(this._minutesInterval==10){C=2}if(this._minutesInterval==15){C=1;x=4;y+="4"}this._rsCells={};this.rsCont=document.createElement("DIV");this.rsCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.rsCont);var v=0;for(var a=0;a1?this._fixLength(v,A):v);H.className="dhtmlxcalendar_selector_cell";D.appendChild(H);H._minutes=v;H._cell=true;this._rsCells[v]=H;v+=this._minutesInterval}}this.rsCont[this.conf.touch?"ontouchstart":"onclick"]=function(I){I=I||event;I.cancelBubble=true;var w=(I.target||I.srcElement);if(w._minutes!=null){if(l._minutesInterval==1){var q=l.getFormatedDate("%i");if(l._selectorMode==1){q=w._minutes.toString()+q.charAt(1)}else{q=q.charAt(0)+w._minutes.toString()}l._activeDate.setMinutes(Number(q));l._hideSelector();if(l._selectorMode==1){l._updateVisibleMinutes(true);l._selectorMode=2;l._showSelector("minutes",l._sel._x,l._sel._y,"selector_minutes",true);l._updateActiveMinutes();return}else{l._selectorMode=1}}else{l._hideSelector();l._activeDate.setMinutes(w._minutes);l._updateActiveMinutes()}l._updateVisibleMinutes();l._doOnSelectorChange()}}}this._sel._ta[E]=true};this._showSelector=function(A,q,C,w,a){if(a===true&&this._sel!=null&&this._isSelectorVisible()&&A==this._sel._t){this._hideSelector();return}if(this.conf.skin=="dhx_terrace"){q+=12}if(!this._sel||!this._sel._ta[A]){this._initSelector(A,w)}if(A!=this._sel._t&&this._sel._t=="minutes"&&this._minutesInterval==1){this.contTime.firstChild.firstChild.childNodes[3].innerHTML=this.getFormatedDate("%i")}this._sel._x=q;this._sel._y=C;this._sel.style.visibility="hidden";this._sel.style.display="";this._selCover.style.width=this.base.offsetWidth-2+"px";this._selCover.style.top=this.contMonth.offsetHeight+"px";this._selCover.style.height=this.contDates.offsetHeight+this.contDays.offsetHeight-1+"px";this._selCover.style.display="";this._sel._t=A;this._sel.className="dhtmlxcalendar_selector_obj dhtmlxcalendar_"+w;this._sel.childNodes[0].firstChild.firstChild.childNodes[0].style.display=this._sel.childNodes[0].firstChild.firstChild.childNodes[2].style.display=(A=="year"?"":"none");var v=Math.max(0,q-Math.round(this._sel.offsetWidth/2));if(v+this._sel.offsetWidth>this._sel.parentNode.offsetWidth){v=this._sel.parentNode.offsetWidth-this._sel.offsetWidth}this._sel.style.left=v+"px";if(A=="hours"||A=="minutes"){this._sel.style.top=C-this._sel.offsetHeight+"px"}else{this._sel.style.top=C+"px"}this._sel.childNodes[1].style.width=this._sel.childNodes[0].offsetWidth+"px";this._sel.style.visibility="visible";this._doOnSelectorShow(A)};this._doOnSelectorShow=function(a){if(a=="month"){this._updateActiveMonth()}if(a=="year"){this._updateYearsList(this._activeMonth)}if(a=="hours"){this._updateActiveHours()}if(a=="minutes"){this._updateActiveMinutes()}};this._hideSelector=function(a){if(!this._sel){return}this._sel.style.display="none";this._sel.style.visible="hidden";this._selCover.style.display="none";if(this._sel._t=="minutes"&&this._minutesInterval==1){this.contTime.firstChild.firstChild.childNodes[3].innerHTML=this.getFormatedDate("%i");this._unloadSelector("minutes")}};this._isSelectorVisible=function(){if(!this._sel){return false}return(this._sel.style.display!="none")};this._doOnSelectorChange=function(a){this.callEvent("onChange",[new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),this._activeDate.getDate(),this._activeDate.getHours(),this._activeDate.getMinutes(),this._activeDate.getSeconds()),a===true])};this._clearSelHover=function(){if(!this._selHover){return}this._selHover.className=String(this._selHover.className.replace(/dhtmlxcalendar_selector_cell_hover/gi,""));this._selHover=null};this._unloadSelector=function(v){if(!this._sel){return}if(!this._sel._ta[v]){return}if(v=="month"){this.msCont.onclick=this.msCont.ontouchstart=null;this._msActive=null;for(var q in this._msCells){this._msCells[q]._cell=null;this._msCells[q]._month=null;this._msCells[q].parentNode.removeChild(this._msCells[q]);this._msCells[q]=null}this._msCells=null;while(this.msCont.childNodes.length>0){this.msCont.removeChild(this.msCont.lastChild)}this.msCont.parentNode.removeChild(this.msCont);this.msCont=null}if(v=="year"){this.ysCont.onclick=this.ysCont.ontouchstart=null;for(var q in this._ysCells){this._ysCells[q]._cell=null;this._ysCells[q]._year=null;this._ysCells[q].parentNode.removeChild(this._ysCells[q]);this._ysCells[q]=null}this._ysCells=null;while(this.ysCont.childNodes.length>0){this.ysCont.removeChild(this.ysCont.lastChild)}this.ysCont.parentNode.removeChild(this.ysCont);this.ysCont=null}if(v=="hours"){this.hsCont.onclick=this.hsCont.ontouchstart=null;this._hsActive=null;for(var q in this._hsCells){this._hsCells[q]._cell=null;this._hsCells[q]._hours=null;this._hsCells[q].parentNode.removeChild(this._hsCells[q]);this._hsCells[q]=null}this._hsCells=null;while(this.hsCont.childNodes.length>0){this.hsCont.removeChild(this.hsCont.lastChild)}this.hsCont.parentNode.removeChild(this.hsCont);this.hsCont=null}if(v=="minutes"){this.rsCont.onclick=this.rsCont.ontouchstart=null;this._rsActive=null;for(var q in this._rsCells){this._rsCells[q]._cell=null;this._rsCells[q]._minutes=null;this._rsCells[q].parentNode.removeChild(this._rsCells[q]);this._rsCells[q]=null}this._rsCells=null;while(this.rsCont.childNodes.length>0){this.rsCont.removeChild(this.rsCont.lastChild)}this.rsCont.parentNode.removeChild(this.rsCont);this.rsCont=null}this._sel._ta[v]=null};this.setMinutesInterval=function(a){if(!(a==1||a==5||a==10||a==15)){return}this._minutesInterval=a;this._unloadSelector("minutes")};this._updateActiveMonth=function(){if(typeof(this._msActive)!="undefined"&&typeof(this._msCells[this._msActive])!="undefined"){this._msCells[this._msActive].className="dhtmlxcalendar_selector_cell"}this._msActive=this._activeMonth.getMonth();this._msCells[this._msActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"};this._updateActiveYear=function(){var a=this._activeMonth.getFullYear();if(this._ysCells[a]){this._ysCells[a].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"}};this._updateYearsList=function(C){for(var x in this._ysCells){this._ysCells[x]=null;delete this._ysCells[x]}var y=12*Math.floor(C.getFullYear()/12);for(var A=0;A<4;A++){for(var v=0;v<3;v++){this.ysCont.childNodes[A].childNodes[v].innerHTML=y;this.ysCont.childNodes[A].childNodes[v]._year=y;this.ysCont.childNodes[A].childNodes[v].className="dhtmlxcalendar_selector_cell";this._ysCells[y++]=this.ysCont.childNodes[A].childNodes[v]}}this._updateActiveYear()};this._scrollYears=function(a){var v=(a<0?this.ysCont.firstChild.firstChild._year:this.ysCont.lastChild.lastChild._year)+a;var q=new Date(v,this._activeMonth.getMonth(),1,0,0,0,0);this._updateYearsList(q)};this._updateActiveHours=function(){if(typeof(this._hsActive)!="undefined"&&typeof(this._hsCells[this._hsActive])!="undefined"){this._hsCells[this._hsActive].className="dhtmlxcalendar_selector_cell"}this._hsActive=this._activeDate.getHours();this._hsCells[this._hsActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"};this._updateVisibleHours=function(){this.contTime.firstChild.firstChild.childNodes[1].innerHTML=this._fixLength(this._activeDate.getHours(),2)};this._updateActiveMinutes=function(){if(this._rsActive!=null&&typeof(this._rsActive)!="undefined"&&typeof(this._rsCells[this._rsActive])!="undefined"){this._rsCells[this._rsActive].className="dhtmlxcalendar_selector_cell"}if(this._minutesInterval==1){this._rsActive=(this.getFormatedDate("%i").toString()).charAt(this._selectorMode==1?0:1)}else{this._rsActive=this._activeDate.getMinutes()}if(typeof(this._rsCells[this._rsActive])!="undefined"){this._rsCells[this._rsActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"}};this._updateVisibleMinutes=function(q){var a=this._fixLength(this._activeDate.getMinutes(),2).toString();if(q==true){a=a.charAt(0)+""+a.charAt(1)+""}this.contTime.firstChild.firstChild.childNodes[3].innerHTML=a;if(q==true){this.contTime.firstChild.firstChild.childNodes[3].lastChild._par=true}};this._fixLength=function(a,q){while(String(a).length0){var y=this._strToDate(this.i[q].input.value,this._dateFormat||this.langData[this.lang].dateformat||"%Y-%m-%d");if(y instanceof Date){w[q]=y}}}}this._dateFormat=x;var v=String(this._dateFormat).replace(/%[a-zA-Z]+/g,function(a){var A=a.replace(/%/,"");switch(A){case"n":case"h":case"j":case"g":case"G":return"\\d{1,2}";case"m":case"d":case"H":case"i":case"s":case"y":return"\\d{2}";case"Y":return"\\d{4}";case"M":return"("+l.langData[l.lang].monthesSNames.join("|").toLowerCase()+"){1,}";case"F":return"("+l.langData[l.lang].monthesFNames.join("|").toLowerCase()+"){1,}";case"D":return"[a-z]{2}";case"a":case"A":return"AM|PM"}return a});this._dateFormatRE=new RegExp(v,"i");for(var q in w){this.i[q].input.value=this._dateToStr(w[q])}w=null};this.setDateFormat(this.langData[this.lang].dateformat||"%Y-%m-%d");this._getInd=function(w,a){for(var v=0;v=E&&v<=D){}else{A=1}var y=v-E;var C=new Date(x.getFullYear(),0,1-y+A*7,0,0,0,0);var H=604800000;var a=new Date(x.getFullYear(),x.getMonth(),x.getDate()+1,0,0,0,0);var F=Math.ceil((a.getTime()-C.getTime())/H);return F};this.showWeekNumbers=function(){this.base.firstChild.className="dhtmlxcalendar_wn"};this.hideWeekNumbers=function(){this.base.firstChild.className=""};this.show=function(v){if(!v&&this._hasParent){this._show();return}if(typeof(v)=="object"&&typeof(v._dhtmlxcalendar_uid)!="undefined"&&this.i[v._dhtmlxcalendar_uid]==v){this._show(v._dhtmlxcalendar_uid);return}if(typeof(v)=="undefined"){for(var q in this.i){if(!v){v=q}}}if(!v){return}this._show(v)};this.hide=function(){if(this._isVisible()){this._hide()}};this.isVisible=function(){return this._isVisible()};this._activeInp=null;this.pos="bottom";this.setPosition=function(a,q){this._px=null;this._py=null;if(a=="right"||a=="bottom"){this.pos=a}else{this.pos="int";if(typeof(a)!="undefined"&&!isNaN(a)){this.base.style.left=a+"px";this._px=a}if(typeof(q)!="undefined"&&!isNaN(q)){this.base.style.top=q+"px";this._py=q}this._ifrSize()}};this._show=function(A,a){if(a===true&&this._activeInp==A&&this._isVisible()){this._hide();return}this.base.style.visibility="hidden";this.base.style.display="";if(!A){if(this._px&&this._py){this.base.style.left=this._px+"px";this.base.style.top=this._py+"px"}else{this.base.style.left="0px";this.base.style.top="0px"}}else{if(this.base.className.indexOf("dhtmlxcalendar_in_input")==-1){this.base.className+=" dhtmlxcalendar_in_input"}var w=(this.i[A].input||this.i[A].button);var q=(navigator.appVersion.indexOf("MSIE")!=-1);var x=Math.max((q?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);var v=x+(q?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0,document.body.clientHeight||0):window.innerHeight);if(this.pos=="right"){this.base.style.left=this._getLeft(w)+w.offsetWidth+"px";this.base.style.top=Math.min(this._getTop(w),v-this.base.offsetHeight)+"px"}else{if(this.pos=="bottom"){var y=this._getTop(w)+w.offsetHeight+1;if(y+this.base.offsetHeight>v){y=this._getTop(w)-this.base.offsetHeight}this.base.style.left=this._getLeft(w)+"px";this.base.style.top=y+"px"}else{this.base.style.left=(this._px||0)+"px";this.base.style.top=(this._py||0)+"px"}}this._activeInp=A;w=null}this._hideSelector();this.base.style.visibility="visible";this.base.style.zIndex=window.dhx4.zim.reserve(this.conf.zi);this._ifrSize();if(this._ifr){this._ifr.style.display=""}this.callEvent("onShow",[])};this._hide=function(){this._hideSelector();this.base.style.display="none";window.dhx4.zim.clear(this.conf.zi);if(this.base.className.indexOf("dhtmlxcalendar_in_input")>=0){this.base.className=this.base.className.replace(/\s{0,}dhtmlxcalendar_in_input/gi,"")}this._activeInp=null;if(this._ifr){this._ifr.style.display="none"}this.callEvent("onHide",[])};this._isVisible=function(){return(this.base.style.display!="none")};this._getLeft=function(a){return this._posGetOffset(a).left};this._getTop=function(a){return this._posGetOffset(a).top};this._posGetOffsetSum=function(a){var v=0,q=0;while(a){v=v+parseInt(a.offsetTop);q=q+parseInt(a.offsetLeft);a=a.offsetParent}return{top:v,left:q}};this._posGetOffsetRect=function(w){var A=w.getBoundingClientRect();var C=document.body;var q=document.documentElement;var a=window.pageYOffset||q.scrollTop||C.scrollTop;var x=window.pageXOffset||q.scrollLeft||C.scrollLeft;var y=q.clientTop||C.clientTop||0;var D=q.clientLeft||C.clientLeft||0;var E=A.top+a-y;var v=A.left+x-D;return{top:Math.round(E),left:Math.round(v)}};this._posGetOffset=function(a){return this[a.getBoundingClientRect?"_posGetOffsetRect":"_posGetOffsetSum"](a)};this._rangeActive=false;this._rangeFrom=null;this._rangeTo=null;this._rangeSet={};this.setInsensitiveDays=function(w){var a=this._extractDates(w);for(var v=0;vthis._rangeTo)){return true}if(this._rangeType=="out"&&(q>=this._rangeFrom&&q<=this._rangeTo)){return true}if(this._rangeType=="from"&&qthis._rangeTo){return true}}var a=new Date(q);if(this._rangeWeek){if(this._rangeWeekData[a.getDay()]===true){return true}}if(this._rangeMonth){if(this._rangeMonthData[a.getDate()]===true){return true}}if(this._rangeYear){if(this._rangeYearData[a.getMonth()+"_"+a.getDate()]===true){return true}}return false};this.clearSensitiveRange=function(){this._clearRange();this._drawMonth(this._activeMonth)};this.setSensitiveRange=function(w,v,a){var q=false;if(w!=null&&v!=null){if(!(w instanceof Date)){w=this._strToDate(w)}if(!(v instanceof Date)){v=this._strToDate(v)}if(w.getTime()>v.getTime()){return}this._rangeFrom=new Date(w.getFullYear(),w.getMonth(),w.getDate(),0,0,0,0).getTime();this._rangeTo=new Date(v.getFullYear(),v.getMonth(),v.getDate(),0,0,0,0).getTime();this._rangeActive=true;this._rangeType="in";q=true}if(!q&&w!=null&&v==null){if(!(w instanceof Date)){w=this._strToDate(w)}this._rangeFrom=new Date(w.getFullYear(),w.getMonth(),w.getDate(),0,0,0,0).getTime();this._rangeTo=null;if(a===true){this._rangeFrom++}this._rangeActive=true;this._rangeType="from";q=true}if(!q&&w==null&&v!=null){if(!(v instanceof Date)){v=this._strToDate(v)}this._rangeFrom=null;this._rangeTo=new Date(v.getFullYear(),v.getMonth(),v.getDate(),0,0,0,0).getTime();if(a===true){this._rangeTo--}this._rangeActive=true;this._rangeType="to";q=true}if(q){this._drawMonth(this._activeMonth)}};this.setInsensitiveRange=function(q,a){if(q!=null&&a!=null){if(!(q instanceof Date)){q=this._strToDate(q)}if(!(a instanceof Date)){a=this._strToDate(a)}if(q.getTime()>a.getTime()){return}this._rangeFrom=new Date(q.getFullYear(),q.getMonth(),q.getDate(),0,0,0,0).getTime();this._rangeTo=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0).getTime();this._rangeActive=true;this._rangeType="out";this._drawMonth(this._activeMonth);return}if(q!=null&&a==null){this.setSensitiveRange(null,q,true);return}if(q==null&&a!=null){this.setSensitiveRange(a,null,true);return}};this.disableDays=function(A,y){if(A=="week"){if(typeof(y)!="object"&&typeof(y.length)=="undefined"){y=[y]}if(!this._rangeWeekData){this._rangeWeekData={}}for(var v in this._rangeWeekData){this._rangeWeekData[v]=false;delete this._rangeWeekData[v]}for(var x=0;x0){this.contMonth.firstChild.firstChild.removeChild(this.contMonth.firstChild.firstChild.lastChild)}this.contMonth.firstChild.removeChild(this.contMonth.firstChild.firstChild);this.contMonth.removeChild(this.contMonth.firstChild);this.contMonth.parentNode.removeChild(this.contMonth);this.contMonth=null;while(this.contDays.firstChild.childNodes.length>0){this.contDays.firstChild.removeChild(this.contDays.firstChild.lastChild)}this.contDays.removeChild(this.contDays.firstChild);this.contDays.parentNode.removeChild(this.contDays);this.contDays=null;this.contDates.onclick=null;this.contDates.ontouchstart=null;this.contDates.onmouseover=null;this.contDates.onmouseout=null;while(this.contDates.childNodes.length>0){while(this.contDates.lastChild.childNodes.length>0){this.contDates.lastChild.lastChild._css_date=null;this.contDates.lastChild.lastChild._css_month=null;this.contDates.lastChild.lastChild._css_weekend=null;this.contDates.lastChild.lastChild._css_hover=null;this.contDates.lastChild.lastChild._date=null;this.contDates.lastChild.lastChild._q=null;this.contDates.lastChild.lastChild._w=null;this.contDates.lastChild.removeChild(this.contDates.lastChild.lastChild)}this.contDates.removeChild(this.contDates.lastChild)}this.contDates.parentNode.removeChild(this.contDates);this.contDates=null;this.contTime.firstChild.firstChild.onclick=null;this.contTime.firstChild.firstChild.ontouchstart=null;while(this.contTime.firstChild.firstChild.childNodes.length>0){this.contTime.firstChild.firstChild.removeChild(this.contTime.firstChild.firstChild.lastChild)}this.contTime.firstChild.removeChild(this.contTime.firstChild.firstChild);this.contTime.removeChild(this.contTime.firstChild);this.contTime.parentNode.removeChild(this.contTime);this.contTime=null;this._lastHover=null;this._unloadSelector("month");this._unloadSelector("year");this._unloadSelector("hours");this._unloadSelector("minutes");if(this._selCover){this._selCover.parentNode.removeChild(this._selCover);this._selCover=null}if(this._sel){for(var q in this._sel._ta){this._sel._ta[q]=null}this._sel._ta=null;this._sel._t=null;this._sel.onmouseover=null;this._sel.onmouseout=null;while(this._sel.firstChild.firstChild.firstChild.childNodes.length>0){this._sel.firstChild.firstChild.firstChild.lastChild.onclick=null;this._sel.firstChild.firstChild.firstChild.lastChild.onmouseover=null;this._sel.firstChild.firstChild.firstChild.lastChild.onmouseout=null;this._sel.firstChild.firstChild.firstChild.removeChild(this._sel.firstChild.firstChild.firstChild.lastChild)}this._sel.firstChild.firstChild.removeChild(this._sel.firstChild.firstChild.firstChild);this._sel.firstChild.removeChild(this._sel.firstChild.firstChild);while(this._sel.childNodes.length>0){this._sel.removeChild(this._sel.lastChild)}this._sel.parentNode.removeChild(this._sel);this._sel=null}this.base.onclick=null;this.base.onmousedown=null;this.base.ontouchstart=null;this.base.onmouseout=null;this.base.parentNode.removeChild(this.base);this.base=null;this._clearDayHover=null;this._clearSelHover=null;this._doOnSelectorChange=null;this._doOnSelectorShow=null;this._drawMonth=null;this._fixLength=null;this._getLeft=null;this._getTop=null;this._ifrSize=null;this._hide=null;this._hideSelector=null;this._initSelector=null;this._isSelectorVisible=null;this._isVisible=null;this._posGetOffset=null;this._posGetOffsetRect=null;this._posGetOffsetSum=null;this._scrollYears=null;this._show=null;this._showSelector=null;this._strToDate=null;this._updateActiveHours=null;this._updateActiveMinutes=null;this._updateActiveMonth=null;this._updateActiveYear=null;this._updateCellStyle=null;this._updateDateStr=null;this._updateVisibleHours=null;this._updateVisibleMinutes=null;this._updateYearsList=null;this.enableIframe=null;this.hide=null;this.hideTime=null;this.setDate=null;this.setDateFormat=null;this.setYearsRange=null;this.show=null;this.showTime=null;this.unload=null;if(this._tipPopup!=null){this._tipPopup.unload();this._tipPopup=null}for(var q in this){delete this[q]}q=l=null};this.setDate(this._activeDate);return this}dhtmlXCalendarObject.prototype.lang="en";dhtmlXCalendarObject.prototype.langData={en:{dateformat:"%Y-%m-%d",hdrformat:"%F %Y",monthesFNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthesSNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],daysFNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysSNames:["Su","Mo","Tu","We","Th","Fr","Sa"],weekstart:1,weekname:"w"}};dhtmlXCalendarObject.prototype._buildMonthHdr=function(l){var c=this;var h=function(m){return(String(m).length==1?"0"+String(m):m)};var a=function(m,n){return""+n+""};var g=String(this.langData[this.lang].hdrformat||("%F %Y")).replace(/%[a-z]/gi,function(m){switch(m){case"%m":return a("month",h(l.getMonth()+1));case"%n":return a("month",l.getMonth()+1);case"%M":return a("month",c.langData[c.lang].monthesSNames[l.getMonth()]);case"%F":return a("month",c.langData[c.lang].monthesFNames[l.getMonth()]);case"%y":return a("year",h(l.getYear()%100));case"%Y":return a("year",l.getFullYear());case"%%":return"%";default:return m}});c=h=a=null;return g};dhtmlXCalendarObject.prototype.enableIframe=function(a){if(a==true){if(!this._ifr){this._ifr=document.createElement("IFRAME");this._ifr.frameBorder=0;this._ifr.border=0;this._ifr.setAttribute("src","javascript:false;");this._ifr.className="dhtmlxcalendar_ifr";this._ifr.onload=function(){this.onload=null;this.contentWindow.document.open("text/html","replace");this.contentWindow.document.write("")};this.base.parentNode.insertBefore(this._ifr,this.base);this._ifrSize()}}else{if(this._ifr){this._ifr.parentNode.removeChild(this._ifr);this._ifr=null}}};dhtmlXCalendarObject.prototype._ifrSize=function(){if(this._ifr){this._ifr.style.left=this.base.style.left;this._ifr.style.top=this.base.style.top;this._ifr.style.width=this.base.offsetWidth+"px";this._ifr.style.height=this.base.offsetHeight+"px"}};dhtmlxCalendarObject=dhtmlXCalendarObject;dhtmlXCalendarObject.prototype._strToDate=function(l,A){A=(A||this._dateFormat);A=A.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\\:|]/g,"\\$&");var D=[];var s=[];A=A.replace(/%[a-z]/gi,function(q){switch(q){case"%d":case"%m":case"%y":case"%h":case"%H":case"%i":case"%s":s.push(q);return"(\\d{2})";case"%D":case"%l":case"%M":case"%F":s.push(q);return"([a-zéûä\u0430-\u044F\u0451]{1,})";case"%j":case"%n":case"%g":case"%G":s.push(q);return"(\\d{1,2})";case"%Y":s.push(q);return"(\\d{4})";case"%a":s.push(q);return"(\\[am|pm])";case"%A":s.push(q);return"(\\[AM|PM])"}return q});var E=new RegExp(A);var u=l.match(E);if(u==null||u.length-1!=s.length){return"Invalid Date"}for(var c=1;c=0){a.setMonth(m)}break;case"%y":if(!isNaN(D[c])){var C=Number(D[c]);a.setFullYear(C+(C>50?1900:2000))}break;case"%g":case"%h":if(!isNaN(D[c])){var C=Number(D[c]);if(C<=12&&C>=0){a.setHours(C+(this._getInd("pm",D)>=0?(C==12?0:12):(C==12?-12:0)))}}break}}o=null;return a};dhtmlXCalendarObject.prototype._dateToStr=function(m,h){var g=this;if(m instanceof Date){var l=function(n){return(String(n).length==1?"0"+String(n):n)};var a=function(n){switch(n){case"%d":return l(m.getDate());case"%j":return m.getDate();case"%D":return g.langData[g.lang].daysSNames[m.getDay()];case"%l":return g.langData[g.lang].daysFNames[m.getDay()];case"%m":return l(m.getMonth()+1);case"%n":return m.getMonth()+1;case"%M":return g.langData[g.lang].monthesSNames[m.getMonth()];case"%F":return g.langData[g.lang].monthesFNames[m.getMonth()];case"%y":return l(m.getYear()%100);case"%Y":return m.getFullYear();case"%g":return(m.getHours()+11)%12+1;case"%h":return l((m.getHours()+11)%12+1);case"%G":return m.getHours();case"%H":return l(m.getHours());case"%i":return l(m.getMinutes());case"%s":return l(m.getSeconds());case"%a":return(m.getHours()>11?"pm":"am");case"%A":return(m.getHours()>11?"PM":"AM");case"%%":"%";default:return n}};var c=String(h||this._dateFormat).replace(/%[a-zA-Z]/g,a)}g=null;return(c||String(m))};window.dhtmlxDblCalendarObject=window.dhtmlXDoubleCalendarObject=window.dhtmlXDoubleCalendar=function(c){var a=this;this.leftCalendar=new dhtmlXCalendarObject(c);this.leftCalendar.hideTime();this.rightCalendar=new dhtmlXCalendarObject(c);this.rightCalendar.hideTime();this.leftCalendar.attachEvent("onClick",function(g){a._updateRange("rightCalendar",g,null);a._evOnClick(["left",g])});this.rightCalendar.attachEvent("onClick",function(g){a._updateRange("leftCalendar",null,g);a._evOnClick(["right",g])});this.leftCalendar.attachEvent("onBeforeChange",function(g){return a._evOnBeforeChange(["left",g])});this.rightCalendar.attachEvent("onBeforeChange",function(g){return a._evOnBeforeChange(["right",g])});this.show=function(){this.leftCalendar.show();this.rightCalendar.base.style.marginLeft=this.leftCalendar.base.offsetWidth-1+"px";this.rightCalendar.show()};this.hide=function(){this.leftCalendar.hide();this.rightCalendar.hide()};this.setDateFormat=function(g){this.leftCalendar.setDateFormat(g);this.rightCalendar.setDateFormat(g)};this.setDates=function(h,g){if(h!=null){this.leftCalendar.setDate(h)}if(g!=null){this.rightCalendar.setDate(g)}this._updateRange()};this._updateRange=function(g,l,h){if(arguments.length==3){(g=="leftCalendar"?this.leftCalendar:this.rightCalendar).setSensitiveRange(l,h)}else{this.leftCalendar.setSensitiveRange(null,this.rightCalendar.getDate());this.rightCalendar.setSensitiveRange(this.leftCalendar.getDate(),null)}};this.getFormatedDate=function(){return this.leftCalendar.getFormatedDate.apply(this.leftCalendar,arguments)};this.unload=function(){window.dhx4._eventable(this,"clear");this.leftCalendar.unload();this.rightCalendar.unload();this.leftCalendar=this.rightCalendar=null;this._updateRange=null;this._evOnClick=null;this._evOnBeforeChange=null;this.show=null;this.hide=null;this.setDateFormat=null;this.setDates=null;this.getFormatedDate=null;this.unload=null;a=null};this._evOnClick=function(g){return this.callEvent("onClick",g)};this._evOnBeforeChange=function(g){return this.callEvent("onBeforeChange",g)};window.dhx4._eventable(this);return this};function dhtmlXCombo(m,s,g,o,l){var n=this;var h=null;var u=null;if(typeof(m)=="object"&&!m.tagName){h=m;m=h.parent;g=h.width;s=h.name;o=h.mode;u=h.skin}this.cont=(typeof(m)=="string"?document.getElementById(m):m);this.conf={skin:null,form_name:s||"dhxcombo",combo_width:(parseInt(g)||this.cont.offsetWidth||120)-(dhx4.isFF||dhx4.isIE?2:0),combo_image:false,combo_focus:false,opts_type:(typeof(o)=="string"&&typeof(this.modes[o])!="undefined"?o:"option"),opts_count:8,opts_count_min:3,opts_width:null,item_h:null,list_zi_id:window.dhx4.newId(),allow_free_text:true,allow_empty_value:true,enabled:true,img_path:"",img_def:"",img_def_dis:true,template:{input:"#text#",option:"#text#"},f_mode:false,f_url:false,f_cache:false,f_cache_data:{},f_dyn:false,f_dyn_end:false,f_mask:"",f_ac:true,f_ac_text:"",f_server_tm:null,f_server_last:"",last_hover:null,last_selected:null,last_match:null,last_text:"",last_value:"",tm_hover:null,tm_confirm_blur:null,clear_click:false,clear_blur:false,clear_bsp:false,clear_key:false,sp:{dhx_skyblue:{list_ofs:1},dhx_web:{list_ofs:0},dhx_terrace:{list_ofs:1}}};this.conf.combo_image=(this.modes[this.conf.opts_type].image==true);this.t={};this.base=document.createElement("DIV");this.base.style.width=this.conf.combo_width+"px";this.base.innerHTML="
"+(this.conf.combo_image?"
"+this.modes[this.conf.opts_type].getTopImage(null,this.conf.enabled)+"
":"");this.cont.appendChild(this.base);this.list=document.createElement("DIV");this.list.style.display="none";document.body.insertBefore(this.list,document.body.firstChild);this.setSkin(u||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxcombo")||"dhx_skyblue");this._updateTopImage=function(a){if(!this.conf.combo_image){return}if(a!=null){this.base.lastChild.innerHTML=this.t[a].obj.getTopImage(this.t[a].item,this.conf.enabled)}else{this.base.lastChild.innerHTML=this.modes[this.conf.opts_type].getTopImage(null,this.conf.enabled)}};this._filterOpts=function(D){if(this.conf.f_server_tm){window.clearTimeout(this.conf.f_server_tm)}var w=String(this.base.firstChild.value).replace(new RegExp(this.conf.f_ac_text+"$","i"),"");if(this.conf.f_server_last==w.toLowerCase()){this._checkForMatch();return}if(this.conf.f_url!=null&&this.checkEvent("onDynXLS")){this.conf.f_server_last=w.toLowerCase();this.callEvent("onDynXLS",[w]);return}if(this.conf.f_url!=null){if(w.length==0){this.conf.f_server_last=w.toLowerCase();this.clearAll();return}if(this.conf.f_cache==true&&this.conf.f_cache_data[w]!=null){this.clearAll();this.conf.f_server_last=w.toLowerCase();for(var y=0;y=0?"&":"?")+q,a)}}},200)}}else{this.conf.f_server_last=w.toLowerCase();var x=(w.length==0?true:new RegExp((this.conf.f_mode=="start"?"^":"")+w,"i"));var C=null;for(var v in this.t){var A=this.t[v].obj.getText(this.t[v].item,true);if(x===true||x.test(A)==true){this.t[v].item.style.display="";if(C==null&&w.length>0){C=String(this.t[v].obj.getText(this.t[v].item,true))}}else{this.t[v].item.style.display="none"}}if(this.conf.f_ac&&this.conf.f_mode=="start"&&this.conf.clear_bsp==false&&C!=null){this.conf.f_ac_text=C.replace(new RegExp("^"+w,"i"),"");this.base.firstChild.value=C;this._selectRange(this.conf.f_server_last.length,this.base.firstChild.value.length)}if(this.conf.f_mode=="between"&&this.conf.clear_bsp==true){this._checkForMatch(true)}if(D!==true){this._showList(true);this._checkForMatch()}}};this._initObj=function(a){if(typeof(a.template)!="undefined"){this.setTemplate(a.template)}this.addOption(a.options)};this._xmlToObj=function(E,H){var L={options:[]};var I=(H==true?E:E.getElementsByTagName("complete"));if(I.length>0){var x=I[0].childNodes;for(var v=0;v0){l.addOption(a.options)}a=null;g.parentNode.removeChild(g);g=null;return l}dhtmlXCombo.prototype.setName=function(a){this.conf.form_name=a;this.base.childNodes[1].name=a;this.base.childNodes[2].name=a+"_new_value"};dhtmlXCombo.prototype.readonly=function(a){if(window.dhx4.s2b(a)){this.base.firstChild.setAttribute("readOnly","true")}else{this.base.firstChild.removeAttribute("readOnly")}};dhtmlXCombo.prototype.setPlaceholder=function(a){if(typeof(a)=="undefined"||a==null){a=""}this.base.firstChild.setAttribute("placeholder",String(a))};dhtmlXCombo.prototype.setTemplate=function(g){for(var c in g){if(typeof(this.conf.template[c])!="undefined"){this.conf.template[c]=String(g[c])}}for(var c in this.t){this.t[c].obj.setText(this.t[c].item,this.t[c].item._conf.text)}this._confirmSelect()};dhtmlXCombo.prototype.setSkin=function(a){if(a==this.conf.skin){return}this.conf.skin=a;this.base.className="dhxcombo_"+this.conf.skin+(this.conf.enabled?"":" dhxcombo_disabled");this.list.className="dhxcombolist_"+this.conf.skin};dhtmlXCombo.prototype.getInput=function(){return this.base.firstChild};dhtmlXCombo.prototype.getButton=function(){return this.base.childNodes[this.base.childNodes.length-(this.conf.combo_image?2:1)]};dhtmlXCombo.prototype.getList=function(){return this.list};dhtmlXCombo.prototype.getBase=function(){return this.base};dhtmlXCombo.prototype.getParent=function(){return this.DOMParent};dhtmlXCombo.prototype.forEachOption=function(a){for(var c=0;c=this.list.childNodes.length){return}var h=this.list.childNodes[c]._optId;this._setSelected(h,this._isListVisible(),true);this._confirmSelect("script")};dhtmlXCombo.prototype.unSelectOption=function(){};dhtmlXCombo.prototype.confirmValue=function(){this._confirmSelect("script")};dhtmlXCombo.prototype.enable=function(a){a=(typeof(a)=="undefined"?true:window.dhx4.s2b(a));if(this.conf.enabled==a){return}this.conf.enabled=a;if(a){this.base.className="dhxcombo_"+this.conf.skin;this.base.firstChild.removeAttribute("disabled")}else{this._hideList();this.base.className="dhxcombo_"+this.conf.skin+" dhxcombo_disabled";this.base.firstChild.setAttribute("disabled","true")}this._updateTopImage(this.conf.last_selected)};dhtmlXCombo.prototype.disable=function(a){a=(typeof(a)=="undefined"?true:window.dhx4.s2b(a));this.enable(!a)};dhtmlXCombo.prototype.isEnabled=function(){return(this.conf.enabled==true)};dhtmlXCombo.prototype.show=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.base.style.display=(a==true?"":"none")};dhtmlXCombo.prototype.hide=function(a){if(typeof(a)=="undefined"){a=true}this.show(!a)};dhtmlXCombo.prototype.isVisible=function(){return(this.base.style.display=="")};dhtmlXCombo.prototype.enableFilteringMode=function(h,c,a,g){if(h==true||h=="between"){this.conf.f_mode=(h==true?"start":"between");if(c!=null){this.conf.f_url=c;this.conf.f_cache=window.dhx4.s2b(a);this.conf.f_dyn=window.dhx4.s2b(g)}else{this.conf.f_url=null;this.conf.f_cache=false;this.conf.f_dyn=false}}else{this.conf.f_mode=false;this.conf.f_url=null;this.conf.f_cache=false;this.conf.f_dyn=false}};dhtmlXCombo.prototype.filter=function(c){for(var g=0;gl?n:-1*n)})}else{if(typeof(g)=="function"||typeof(window[g])=="function"){if(typeof(window[g])=="function"){g=window[g]}a.sort(function(m,l){return g.apply(window,[m[1],l[1]])})}}while(this.list.childNodes.length>0){this.list.removeChild(this.list.lastChild)}for(var c=0;co){o=null}var n=Math.min((o==null?c:o),this.conf.opts_count,u);var g=(na){this.list.scrollTop=g-this.list.clientHeight}}};dhtmlXCombo.prototype._setSelected=function(m,l,c){if(c){this._updateTopImage(m)}if(m!=null&&this.conf.last_hover==m){if(l){this._scrollToItem(m)}return}if(this.conf.last_hover!=null){this.t[this.conf.last_hover].obj.setSelected(this.t[this.conf.last_hover].item,false);this.conf.last_hover=null;if(m==null){this.callEvent("onSelectionChange",[])}}if(m!=null){this.t[m].obj.setSelected(this.t[m].item,true);this.conf.last_hover=m;this.callEvent("onSelectionChange",[]);if(this.t[m].item==this.t[m].item.parentNode.lastChild&&this.conf.f_url!=null&&this.conf.f_dyn==true&&!this.conf.f_dyn_end){var h="mask="+encodeURIComponent(this.conf.f_mask)+"&pos="+this.list.childNodes.length;var a=this;var g=function(o){if(a.conf.f_cache){a.conf.f_cache_data[a.conf.f_mask].data.push(o.xmlDoc.responseXML)}var n=a.list.childNodes.length;a.load(o.xmlDoc.responseXML);if(n==a.list.childNodes.length){a.conf.f_dyn_end=true;if(a.conf.f_cache){a.conf.f_cache_data[a.conf.f_mask].dyn_end=true}}g=a=null};if(window.dhx4.ajax.method=="post"){window.dhx4.ajax.post(this.conf.f_url,h,g)}else{if(window.dhx4.ajax.method=="get"){window.dhx4.ajax.get(this.conf.f_url+(String(this.conf.f_url).indexOf("?")>=0?"&":"?")+h,g)}}}if(l){this._scrollToItem(m)}}};dhtmlXCombo.prototype.addOption=function(m,n,c,a,h){var g=null;if(!(m instanceof Array)){var o=this._renderOption({value:m,text:n,css:c,img:a});if(g==null&&window.dhx4.s2b(h)==true){g=o}}else{for(var l=0;l=0&&a ";if(c.css!=null){a.lastChild.style.cssText=c.css;a._conf.css=c.css}this.setText(a,c.text);return this},destruct:function(a){a._conf=null},update:function(a,c){a._conf.value=c.value;a._conf.css=c.css;a.lastChild.style.cssText=c.css;this.setText(a,c.text)},setText:function(c,g){c._conf.text=g;var a=(typeof(g)=="object"?window.dhx4.template(c._tpl.option,c._conf.text,true):window.dhx4.trim(c._conf.text||""));c.lastChild.innerHTML=(a.length==0?" ":a)},getText:function(g,a,c){if(window.dhx4.s2b(a)&&typeof(g._conf.text)=="object"){return window.dhx4.template(g._tpl.input,g._conf.text,true)}if(window.dhx4.s2b(c)&&typeof(g._conf.text)=="object"){return window.dhx4.template(g._tpl.option,g._conf.text,true)}return g._conf.text},getValue:function(a){return a._conf.value},getCss:function(a){return a._conf.css},setSelected:function(a,c){a.className="dhxcombo_option"+(c?" dhxcombo_option_selected":"")},isSelected:function(a){return String(a.className).indexOf("dhxcombo_option_selected")>=0},getExtraData:function(a){return{type:"option"}}};dhtmlXCombo.prototype.modes.checkbox={image:true,image_css:"dhxcombo_checkbox dhxcombo_chbx_#state#",option_css:"dhxcombo_option_text dhxcombo_option_text_chbx",render:function(a,c){a._conf={value:c.value,css:"",checked:window.dhx4.s2b(c.checked)};a.className="dhxcombo_option";a.innerHTML="
 
";a.firstChild._optChbxId=a._optId;if(c.css!=null){a.lastChild.style.cssText+=c.css;a._conf.css=c.css}this.setText(a,c.text);return this},setChecked:function(a,c){a._conf.checked=window.dhx4.s2b(c);a.firstChild.className=String(this.image_css).replace("#state#",(a._conf.checked?"1":"0"))},isChecked:function(a){return(a._conf.checked==true)},getExtraData:function(a){return{type:"checkbox",checked:a._conf.checked}},optionClick:function(h,g,l){var c=true;var a=(g.target||g.srcElement);while(c==true&&a!=null&&a!=h){if(a._optChbxId!=null){if(l.callEvent("onCheck",[h._conf.value,!h._conf.checked])===true){this.setChecked(h,!this.isChecked(h))}c=false}else{a=a.parentNode}}a=l=h=null;return c},getTopImage:function(c,a){return""},topImageClick:function(a,c){return true}};dhtmlXComboExtend("checkbox","option");dhtmlXCombo.prototype.setChecked=function(a,c){this.doWithItem(a,"setChecked",c)};dhtmlXCombo.prototype.getChecked=function(a,h){var c=[];for(var g=0;g
 
";if(c.css!=null){a.lastChild.style.cssText+=c.css;a._conf.css=c.css}this.setText(a,c.text);this.setImage(a,c.img,c.img_dis,c.img_path,c.img_def,c.img_def_dis);return this},update:function(a,c){a._conf.value=c.value;a._conf.css=c.css;a.lastChild.style.cssText=c.css;this.setText(a,c.text);this.setImage(a,c.img,c.img_dis,c.img_path,c.img_def,c.img_def_dis)},setImage:function(g,a,l,m,h,c){if(a!=null&&a.length>0){a=m+a}else{if(h!=null&&h.length>0){a=m+h}else{a=null}}if(l!=null&&l.length>0){l=m+l}else{if(c!=null&&c.length>0){l=m+c}else{if(c==true){l=a}else{l=null}}}g._conf.img=a;g._conf.img_dis=l;g.firstChild.style.backgroundImage=(a!=null?"url("+a+")":"none")},getExtraData:function(a){return{type:"image"}},getTopImage:function(h,g){var c=(g?"img":"img_dis");if(h!=null&&h._conf[c]!=null){return"
"}return""}};dhtmlXComboExtend("image","option");dhtmlXCombo.prototype.setDefaultImage=function(a,c){if(a!=null){this.conf.img_def=a}if(c!=null){this.conf.img_def_dis=c}};dhtmlXCombo.prototype.setImagePath=function(a){this.conf.img_path=a};function dhtmlXColorPicker(o){if(!(this instanceof dhtmlXColorPicker)){return new dhtmlXColorPicker(o)}dhx4._eventable(this);var m=this,h=undefined,n=null,g,a,c;this._nodes=[];this.activeNode=null;this._inputListenerId=null;this.base=null;this._globalNode=null;this.memory=null;this.skin=null;this.conf={cp_id:dhx4.newId(),x:0,y:0,c:0,indent:2,position:"right",customColors:false,selectedColor:null,hide:false,hideOnSelect:false,lang:"en",closeable:true};this.value={red:null,blue:null,green:null,hue:null,sat:null,lum:null};this._initMoveSelection=function(l){l=l||event;if(typeof(window.addEventListener)=="function"){m._controllerNodes.colorArea.addEventListener("mousemove",m._setMoveSelection,false);document.body.addEventListener("mouseup",m._cleanMoveSelection,false)}else{m._controllerNodes.colorArea.attachEvent("onmousemove",m._setMoveSelection);document.body.attachEvent("onmouseup",m._cleanMoveSelection)}m._setMoveSelection(l,m._controllerNodes.colorArea);return false};this._cleanMoveSelection=function(){if(typeof(window.removeEventListener)=="function"){m._controllerNodes.colorArea.removeEventListener("mousemove",m._setMoveSelection,false);document.body.removeEventListener("mouseup",m._cleanMoveSelection,false)}else{m._controllerNodes.colorArea.detachEvent("onmousemove",m._setMoveSelection);document.body.detachEvent("onmouseup",m._cleanMoveSelection)}return false};this._setMoveSelection=function(l){l=l||event;var q=m._getOffsetPosition(l,m._controllerNodes.colorArea);if(m._controllerNodes.fr_cover){setTimeout(function(){m._setColorAreaXY(q.x,q.y);m._setColorByXYC()},0)}else{m._setColorAreaXY(q.x,q.y);m._setColorByXYC()}return false};this._initMoveContrast=function(l){l=l||event;if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousemove",m._setMoveContrast,false);document.body.addEventListener("mouseup",m._cleanMoveContrast,false)}else{document.body.attachEvent("onmousemove",m._setMoveContrast);document.body.attachEvent("onmouseup",m._cleanMoveContrast)}m._setMoveContrast(l,m._controllerNodes.contrastArea)};this._cleanMoveContrast=function(){if(typeof(window.removeEventListener)=="function"){document.body.removeEventListener("mousemove",m._setMoveContrast,false);document.body.removeEventListener("mouseup",m._cleanMoveContrast,false)}else{document.body.detachEvent("onmousemove",m._setMoveContrast);document.body.detachEvent("onmouseup",m._cleanMoveContrast)}};this._setMoveContrast=function(l){l=l||event;var q=m._getOffsetPosition(l,m._controllerNodes.contrastArea);m._setContrastY(q.y);m._setColorByXYC(true)};this._doOnSelectColor=function(){var l=m.colorAIP.rgb2hex({r:m.value.red,g:m.value.green,b:m.value.blue});if(m.activeNode!=null){if(m.activeNode.valueCont){m.activeNode.valueCont.value=l}if(m.activeNode.valueColor){m.activeNode.valueColor.style.backgroundColor=l}}if(m.base._dhx_remove||m.conf.hideOnSelect){m.hide()}m.callEvent("onSelect",[l,((m.activeNode)?m.activeNode.node:null)])};this._doOnCancel=function(){if(m.callEvent("onCancel",[((m.activeNode)?m.activeNode.node:null)])==true&&m.conf.closeable==true){m.hide()}};this._doOnFocusByInput=function(){var q=(this!=window)?this:event.srcElement;var l=(m.activeNode&&m.activeNode.valueCont&&m.activeNode.valueCont==q)?m.activeNode:m._getNodeByValueCont(q);m.activeNode=l;if(l&&l==m.activeNode){m._initListenerInput()}};this._doOnBlurByInput=function(){var q=(this!=window)?this:event.srcElement;var l=(m.activeNode&&m.activeNode.valueCont&&m.activeNode.valueCont==q)?m.activeNode:m._getNodeByValueCont(q);if(l&&l==m.activeNode){m._removeListenerInput()}};this._doOnClickByNode=function(q){q=q||event;var l=(this!=window)?this:event.srcElement;m.activeNode=(m.activeNode.node!=l)?m._getNodeByElement(l):m.activeNode;if(!m.isVisible()){m.show()}};this.saveColor=function(){m.memory.setValue(m.value)};this._onSelectMemoryEl=function(q){var l;m._refreshCoordinatesByHSL(q.value.hue,q.value.sat,q.value.lum);for(l in q.value){m.value[l]=q.value[l]}m._refreshContrast();m._refreshInputValues();m._refreshColorValue()};this._doOnClickByBody=function(r){r=r||event;var l=true,q=r.target||r.srcElement;if(m._isBaseNode(q)){l=false}if(l&&m.activeNode&&(m.activeNode.node==q||m.activeNode.valueCont==q)){l=false}if(l){m.hide()}};this._doOnChangeHSL=function(){var r=parseInt(m._controllerNodes.hue.value),q=parseInt(m._controllerNodes.sat.value),l=parseInt(m._controllerNodes.lum.value),s;if(isNaN(r)||r>359||r<0){m._controllerNodes.hue.value=m.value.hue}else{m.value.hue=r}if(isNaN(q)||q>100||q<0){m._controllerNodes.sat.value=m.value.sat}else{m.value.sat=q}if(isNaN(l)||l>100||l<0){m._controllerNodes.lum.value=m.value.lum}else{m.value.lum=l}s=m.colorAIP.hsl2rgb(m.value.hue,m.value.sat/100,m.value.lum/100);m.value.red=Math.round(255*s.r);m.value.green=Math.round(255*s.g);m.value.blue=Math.round(255*s.b);m._refreshCoordinatesByHSL(m.value.hue,m.value.sat,m.value.lum);m._refreshContrast();m._refreshInputValues();m._refreshColorValue()};this._doOnChangeRGB=function(){var s=parseInt(m._controllerNodes.red.value),r=parseInt(m._controllerNodes.green.value),l=parseInt(m._controllerNodes.blue.value),q;if(isNaN(s)||s>255||s<0){m._controllerNodes.red.value=m.value.red}else{m.value.red=s}if(isNaN(r)||r>255||r<0){m._controllerNodes.green.value=m.value.green}else{m.value.green=r}if(isNaN(l)||l>255||l<0){m._controllerNodes.blue.value=m.value.blue}else{m.value.blue=l}q=m.colorAIP.rgb2hsl(m.value.red/255,m.value.green/255,m.value.blue/255);m.value.hue=Math.round(q.h);m.value.sat=Math.round(q.s*100);m.value.lum=Math.round(q.l*100);m._refreshCoordinatesByHSL(m.value.hue,m.value.sat,m.value.lum);m._refreshContrast();m._refreshInputValues();m._refreshColorValue()};this._doOnChangeHSV=function(){m._controllerNodes.hsv.value=m.setColor(m._controllerNodes.hsv.value)};this._checkType=function(q){var l;if(q instanceof Array){l=m._checkType(q[0]);switch(l){case"string":return"array_string";break;case"input":case"textarea":return"array_input";break;case"object":return"array_object";break;default:return undefined}}else{if(q==undefined){return null}else{if(typeof(q)=="string"){return"string"}else{if(q.tagName&&q.tagName.toLowerCase()=="input"){return"input"}else{if(q.tagName&&q.tagName.toLowerCase()=="textarea"){return"textarea"}else{if(q.tagName){return"container"}else{if(typeof(q)=="object"){return"object"}else{return undefined}}}}}}}};this._initByObject=function(l){if(l.parent&&l.parent.tagName){m.base=l.parent}else{if(typeof(l.parent)=="string"){m.base=document.getElementById(l.parent)}else{m.base=document.createElement("div");m.base._dhx_remove=true}}if(l.color){m.conf.selectedColor=l.color}if(typeof(l.closeable)!="undefined"){this.conf.closeable=dhx4.s2b(l.closeable)}if(l.custom_colors){this._tempInitCC=function(){var s,r;this.initMemoryColors();this.conf.customColors=true;if(l.custom_colors instanceof Array){r=l.custom_colors.length;for(s=0;s
"+this.i18n[this.conf.lang].labelHue+""+this.i18n[this.conf.lang].labelRed+"
"+this.i18n[this.conf.lang].labelSat+""+this.i18n[this.conf.lang].labelGreen+"
"+this.i18n[this.conf.lang].labelLum+""+this.i18n[this.conf.lang].labelBlue+"
";"";this._globalNode=this.base.firstChild;this._controllerNodes={colorArea:this._globalNode.firstChild.firstChild.firstChild,v_line:this._globalNode.firstChild.firstChild.firstChild.childNodes[0],h_line:this._globalNode.firstChild.firstChild.firstChild.childNodes[1],contrastArea:this._globalNode.firstChild.firstChild.childNodes[1],contrast_line:this._globalNode.firstChild.firstChild.childNodes[1].firstChild,color:this._globalNode.firstChild.childNodes[1].childNodes[0].firstChild,hsv:this._globalNode.firstChild.childNodes[1].childNodes[0].childNodes[1],hue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].childNodes[1].firstChild,sat:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].childNodes[1].firstChild,lum:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].childNodes[1].firstChild,red:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].childNodes[3].firstChild,green:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].childNodes[3].firstChild,blue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].childNodes[3].firstChild,memory_block:this._globalNode.firstChild.childNodes[2],button_save:this._globalNode.firstChild.childNodes[3].firstChild,button_cancel:this._globalNode.firstChild.childNodes[3].childNodes[1]};this._labelNodes={labelHue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].firstChild,labelSat:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].firstChild,labelLum:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].firstChild,labelRed:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].childNodes[2],labelGreen:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].childNodes[2],labelBlue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].childNodes[2],btnAddColor:null,btnSelect:this._globalNode.firstChild.childNodes[3].firstChild,btnCancel:this._globalNode.firstChild.childNodes[3].childNodes[1]};if(typeof(this._tempInitCC)=="function"){this._tempInitCC()}if(typeof(window.addEventListener)=="function"){this._controllerNodes.colorArea.addEventListener("mousedown",this._initMoveSelection,false);this._controllerNodes.colorArea.addEventListener("dblclick",this._doOnSelectColor,false);this._controllerNodes.contrastArea.addEventListener("mousedown",this._initMoveContrast,false);this._controllerNodes.button_save.addEventListener("click",this._doOnSelectColor,false);this._controllerNodes.button_cancel.addEventListener("click",this._doOnCancel,false);this._controllerNodes.hue.addEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.sat.addEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.lum.addEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.red.addEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.green.addEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.blue.addEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.hsv.addEventListener("change",this._doOnChangeHSV,false)}else{this._controllerNodes.colorArea.attachEvent("onmousedown",this._initMoveSelection);this._controllerNodes.colorArea.attachEvent("ondblclick",this._doOnSelectColor);this._controllerNodes.contrastArea.attachEvent("onmousedown",this._initMoveContrast);this._controllerNodes.button_save.attachEvent("onclick",this._doOnSelectColor);this._controllerNodes.button_cancel.attachEvent("onclick",this._doOnCancel);this._controllerNodes.hue.attachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.sat.attachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.lum.attachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.red.attachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.green.attachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.blue.attachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.hsv.attachEvent("onchange",this._doOnChangeHSV)}if(this.conf.selectedColor){this.setColor(this.conf.selectedColor)}else{this._setColorAreaXY(10,10);this._setContrastY(10);m._setColorByXYC()}if(this._nodes.length){for(var g=0;g
";this.memory=new this.Memory(this._controllerNodes.memory_block.childNodes[1]);this.memory.onSelect=this._onSelectMemoryEl;this.memory.onSave=function(h){var g=c.colorAIP.rgb2hex({r:h.red,g:h.green,b:h.blue});c.callEvent("onSaveColor",[g])};var a=this._controllerNodes.memory_block.childNodes[0].firstChild;this._labelNodes.btnAddColor=this._controllerNodes.memory_block.childNodes[0].firstChild.firstChild;if(typeof(window.addEventListener)=="function"){a.addEventListener("click",this.saveColor,false)}else{a.attachEvent("onclick",this.saveColor)}};dhtmlXColorPicker.prototype._refreshCoordinatesByHSL=function(o,n,c){var a,m,g;a=Math.round((this.configColorArea.maxX-this.configColorArea.minX)*o/359)+this.configColorArea.minX;m=Math.round((this.configColorArea.maxY-this.configColorArea.minY)*(100-c)/100)+this.configColorArea.minY;g=Math.round((this.configColorArea.maxY-this.configColorArea.minY)*(100-n)/100)+this.configColorArea.minY;this._setColorAreaXY(a,m);this._setContrastY(g)};dhtmlXColorPicker.prototype.setColor=function(n){var h,g,m=true,c,a=this.colorAIP.rgb2hex({r:this.value.red,g:this.value.green,b:this.value.blue}),l;if(n instanceof Array){h={r:parseInt(n[0]),g:parseInt(n[1]),b:parseInt(n[2])}}else{if(typeof(n)=="string"){n=n.replace(/\s/g,"");if(/^rgb\((\d{1,3})\,(\d{1,3})\,(\d{1,3})\)$/i.test(n)){g=n.match(/^rgb\((\d{1,3})\,(\d{1,3})\,(\d{1,3})\)$/i);h={r:parseInt(g[1]),g:parseInt(g[2]),b:parseInt(g[3])}}else{h=this.colorAIP.hex2rgb(n)}}}m=m&&h instanceof Object;m=m&&(0<=h.r&&h.r<=255);m=m&&(0<=h.g&&h.g<=255);m=m&&(0<=h.b&&h.b<=255);if(!m){return a}l=this.colorAIP.rgb2hex({r:h.r,g:h.g,b:h.b});if(l==a){return a}this.value.red=h.r;this.value.green=h.g;this.value.blue=h.b;c=this.colorAIP.rgb2hsl(h.r/255,h.g/255,h.b/255);this.value.hue=Math.round(c.h);this.value.sat=Math.round(c.s*100);this.value.lum=Math.round(c.l*100);this._refreshCoordinatesByHSL(this.value.hue,this.value.sat,this.value.lum);this._refreshContrast();this._refreshInputValues();this._refreshColorValue();return l};dhtmlXColorPicker.prototype.getSelectedColor=function(){return[this.colorAIP.rgb2hex({r:this.value.red,g:this.value.green,b:this.value.blue}),[this.value.red,this.value.green,this.value.blue],[this.value.hue,this.value.sat,this.value.lum]]};dhtmlXColorPicker.prototype._attachEventsToNode=function(a){if(typeof(window.addEventListener)=="function"){a.node.addEventListener("click",this._doOnClickByNode,false)}else{a.node.attachEvent("onclick",this._doOnClickByNode)}if(a.valueCont&&a.valueCont.tagName.toLowerCase()=="input"){if(typeof(window.addEventListener)=="function"){a.valueCont.addEventListener("focus",this._doOnFocusByInput,false);a.valueCont.addEventListener("blur",this._doOnBlurByInput,false)}else{a.valueCont.attachEvent("onfocus",this._doOnFocusByInput);a.valueCont.attachEvent("onblur",this._doOnBlurByInput)}}};dhtmlXColorPicker.prototype._detachEventsFromNode=function(a){if(typeof(window.addEventListener)=="function"){a.node.removeEventListener("click",this._doOnClickByNode,false)}else{a.node.detachEvent("onclick",this._doOnClickByNode)}if(a.valueCont&&a.valueCont.tagName.toLowerCase()=="input"){if(typeof(window.addEventListener)=="function"){a.valueCont.removeEventListener("focus",this._doOnFocusByInput,false);a.valueCont.removeEventListener("blur",this._doOnBlurByInput,false)}else{a.valueCont.detachEvent("onfocus",this._doOnFocusByInput);a.valueCont.detachEvent("onblur",this._doOnBlurByInput)}}};dhtmlXColorPicker.prototype.show=function(c){var a=false;if(c!=undefined){this.activeNode=this.getNode(c)||this.activeNode}if(this.activeNode&&this.activeNode.valueCont&&this.activeNode.valueCont.value){this.setColor(this.activeNode.valueCont.value)}if(this.activeNode){a=(this.activeNode.conf.customColors!=null)?this.activeNode.conf.customColors:this.conf.customColors;this.setColor(this.activeNode.conf.selectedColor)}else{a=this.conf.customColors}if(a){this.showMemory()}else{this.hideMemory()}if(this.base._dhx_remove){this.base.firstChild.style.zIndex=dhx4.zim.reserve(this.conf.cp_id);if(document.body.firstChild){document.body.insertBefore(this.base,document.body.firstChild)}else{document.body.appendChild(this.base)}this._refreshPosition();if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousedown",this._doOnClickByBody,false)}else{document.body.attachEvent("onmousedown",this._doOnClickByBody)}}else{this.base.appendChild(this._globalNode)}if(this._controllerNodes.fr_cover){this.base.insertBefore(this._controllerNodes.fr_cover,this._globalNode)}this.callEvent("onShow",[((this.activeNode)?this.activeNode.node:null)])};dhtmlXColorPicker.prototype.setPosition=function(c,l){var h=null,a=parseInt(c),g=parseInt(l);if(isNaN(a)){h=(c.toLowerCase()=="left")?"left":(c.toLowerCase()=="bottom")?"bottom":null}if(this.base._dhx_remove){if(h==null){}else{this.conf.position=h;this._refreshPosition(h)}}else{if(isNaN(a)||isNaN(g)){}else{this._globalNode.style.left=a+"px";this._globalNode.style.top=g+"px";if(this._controllerNodes.fr_cover){this._controllerNodes.fr_cover.style.left=this._globalNode.style.left;this._controllerNodes.fr_cover.style.top=this._globalNode.style.top}}}};dhtmlXColorPicker.prototype._initListenerInput=function(){var a=this;this._inputListenerId=this._inputListenerId||setInterval(function(){a._refreshValueByInput()},70)};dhtmlXColorPicker.prototype._removeListenerInput=function(){if(this._inputListenerId){clearInterval(this._inputListenerId);this._inputListenerId=null}};dhtmlXColorPicker.prototype._refreshValueByInput=function(){var c=this.activeNode.valueCont.value,a=this.getSelectedColor()[0];if(this._inputListenerId){if(/^#[\da-f]{6}$/i.test(c)&&c!=a){this.setColor(c);this.callEvent("onSelect",[c,this.activeNode.node])}}};dhtmlXColorPicker.prototype._refreshPosition=function(c){if(this.activeNode==null){return}var m=dhx4.absTop(this.activeNode.node),a=dhx4.absLeft(this.activeNode.node),g=dhx4.screenDim(),h=this._globalNode.offsetHeight,l=0;c=c||this.conf.position;switch(c){case"bottom":this._globalNode.style.top=m+this.activeNode.node.offsetHeight+this.conf.indent+"px";this._globalNode.style.left=a+"px";break;default:this._globalNode.style.left=a+this.activeNode.node.offsetWidth+this.conf.indent+"px";l=m;if(g.bottom-(l+h)<=0){l=g.bottom-(h+this.conf.indent)}if(l-g.top<0){l=g.top+this.conf.indent}this._globalNode.style.top=l+"px"}if(this._controllerNodes.fr_cover){this._controllerNodes.fr_cover.style.left=this._globalNode.style.left;this._controllerNodes.fr_cover.style.top=this._globalNode.style.top}};dhtmlXColorPicker.prototype.isVisible=function(){var a=false;if(this.base._dhx_remove){a=this.base.parentNode==document.body}else{a=this._globalNode.parentNode==this.base}return a};dhtmlXColorPicker.prototype.hide=function(){if(this.base._dhx_remove){if(this.base.parentNode){this.base.parentNode.removeChild(this.base);dhx4.zim.clear(this.conf.cp_id);if(typeof(window.addEventListener)=="function"){document.body.removeEventListener("mousedown",this._doOnClickByBody,false)}else{document.body.detachEvent("onmousedown",this._doOnClickByBody)}}}else{if(this.isVisible()==false){return}this.base.removeChild(this._globalNode)}if(this._controllerNodes.fr_cover&&this._controllerNodes.fr_cover.parentNode){this._controllerNodes.fr_cover.parentNode.removeChild(this._controllerNodes.fr_cover)}if(this.callEvent!=undefined){this.callEvent("onHide",[((this.activeNode)?this.activeNode.node:null)])}};dhtmlXColorPicker.prototype.configColorArea={minX:1,maxX:209,minY:1,maxY:119};dhtmlXColorPicker.prototype._skinCollection={dhx_skyblue:true,dhx_web:true,dhx_terrace:true};dhtmlXColorPicker.prototype.i18n={en:{labelHue:"Hue",labelSat:"Sat",labelLum:"Lum",labelRed:"Red",labelGreen:"Green",labelBlue:"Blue",btnAddColor:"Save the color",btnSelect:"Select",btnCancel:"Cancel"}};dhtmlXColorPicker.prototype.loadUserLanguage=function(a){if(typeof(this._mergeLangModules)=="function"){this._mergeLangModules()}this.conf.lang=a;this._refreshLanguage()};dhtmlXColorPicker.prototype._refreshLanguage=function(){var a,c=this.i18n[this.conf.lang];for(a in c){if(this._labelNodes[a]){this._labelNodes[a].innerHTML=c[a]}}};dhtmlXColorPicker.prototype._setColorAreaXY=function(a,g){var c=this.configColorArea;a=parseInt(a);if(c.minX>a){this.conf.x=c.minX}else{if(a>c.maxX){this.conf.x=c.maxX}else{if(!isNaN(a)){this.conf.x=a}}}g=parseInt(g);if(c.minY>g){this.conf.y=c.minY}else{if(g>c.maxY){this.conf.y=c.maxY}else{if(!isNaN(g)){this.conf.y=g}}}this._refreshLines()};dhtmlXColorPicker.prototype._setColorByXYC=function(c){c=c||false;this.value.hue=Math.round((359*(this.conf.x-this.configColorArea.minX))/(this.configColorArea.maxX-this.configColorArea.minX));this.value.lum=Math.round(100-(100*(this.conf.y-this.configColorArea.minY))/(this.configColorArea.maxY-this.configColorArea.minY));this.value.sat=Math.round(100-(100*(this.conf.c-this.configColorArea.minY))/(this.configColorArea.maxY-this.configColorArea.minY));var a=this.colorAIP.hsl2rgb(this.value.hue,this.value.sat/100,this.value.lum/100);this.value.red=Math.round(255*a.r);this.value.green=Math.round(255*a.g);this.value.blue=Math.round(255*a.b);if(!c){this._refreshContrast()}this._refreshInputValues();this._refreshColorValue()};dhtmlXColorPicker.prototype._setContrastY=function(c){var a=this.configColorArea;c=parseInt(c);if(!isNaN(c)){this.conf.c=Math.min(Math.max(a.minY,c),a.maxY)}this._refreshContrastLine()};dhtmlXColorPicker.prototype._refreshInputValues=function(){this._controllerNodes.hue.value=this.value.hue;this._controllerNodes.sat.value=this.value.sat;this._controllerNodes.lum.value=this.value.lum;this._controllerNodes.red.value=this.value.red;this._controllerNodes.green.value=this.value.green;this._controllerNodes.blue.value=this.value.blue};dhtmlXColorPicker.prototype._refreshColorValue=function(){this._controllerNodes.color.style.backgroundColor="rgb("+[this.value.red,this.value.green,this.value.blue].join(", ")+")";var a=this.colorAIP.rgb2hex({r:this.value.red,g:this.value.green,b:this.value.blue});this._controllerNodes.hsv.value=a;this.callEvent("onChange",[a])};dhtmlXColorPicker.prototype._refreshContrast=function(){var h=this.colorAIP.hsl2rgb(this.value.hue,0,this.value.lum/100);var l=this.colorAIP.hsl2rgb(this.value.hue,1,this.value.lum/100);var g=this._checkIeVersion();if(g&&g<=8){var m=this._controllerNodes.contrastArea.firstChild;if(m==this._controllerNodes.contrast_line){m=document.createElement("div");m.className+="dhxcp_ie_gradient";this._controllerNodes.contrastArea.appendChild(m);this._controllerNodes.contrastArea.appendChild(this._controllerNodes.contrast_line)}var c=this.colorAIP.rgb2hex({r:Math.round(255*h.r),g:Math.round(255*h.g),b:Math.round(255*h.b)});var a=this.colorAIP.rgb2hex({r:Math.round(255*l.r),g:Math.round(255*l.g),b:Math.round(255*l.b)});m.style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr='"+a+"', endColorstr='"+c+"', GradientType=0)"}else{h=[Math.round(255*h.r),Math.round(255*h.g),Math.round(255*h.b)];l=[Math.round(255*l.r),Math.round(255*l.g),Math.round(255*l.b)];this._controllerNodes.contrastArea.style.backgroundImage="linear-gradient(to top, rgb("+h.join(",")+"), rgb("+l.join(",")+"))"}};dhtmlXColorPicker.prototype._refreshLines=function(){this._controllerNodes.v_line.style.left=this.conf.x+"px";this._controllerNodes.h_line.style.top=this.conf.y+"px"};dhtmlXColorPicker.prototype._refreshContrastLine=function(){this._controllerNodes.contrast_line.style.top=this.conf.c+"px"};dhtmlXColorPicker.prototype._getOffsetPosition=function(h,a){var c={x:NaN,y:NaN},g=h.target||h.srcElement;if(g==a){c.x=(h.offsetX!=undefined)?h.offsetX:h.layerX;c.y=(h.offsetY!=undefined)?h.offsetY:h.layerY}else{if(g==this._controllerNodes.v_line){c.y=(h.offsetY!=undefined)?h.offsetY:h.layerY}else{c.x=(h.offsetX!=undefined)?h.offsetX:h.layerX}}return c};dhtmlXColorPicker.prototype.colorAIP={hex2rgb:function(c){var a=c.match(/^(#)([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(a!=null){return{r:parseInt("0x"+a[2]),g:parseInt("0x"+a[3]),b:parseInt("0x"+a[4])}}else{return null}},rgb2hex:function(l){var h=parseInt(l.r),c=parseInt(l.g),a=parseInt(l.b);h=h||0,c=c||0,a=a||0;return"#"+((h)?((h<16)?"0"+h.toString(16):h.toString(16)):"00")+((c)?((c<16)?"0"+c.toString(16):c.toString(16)):"00")+((a)?((a<16)?"0"+a.toString(16):a.toString(16)):"00")},rgb2hsl:function(q,o,h){var n,m,c;var a=Math.max(q,o,h),l=Math.min(q,o,h);c=0.5*(a+l);if(a==l){n=0}else{if(a==q){n=60*(o-h)/(a-l);if(o1){c[h]-=1}}if(c[h]<1/6){a.push(m+(l-m)*6*c[h])}else{if(c[h]<0.5){a.push(l)}else{if(c[h]<2/3){a.push(m+(l-m)*(2/3-c[h])*6)}else{a.push(m)}}}}return{r:a[0],g:a[1],b:a[2]}}};dhtmlXColorPicker.prototype._checkIeVersion=function(){var a;var c=navigator.userAgent.match(/(MSIE)\s(\d\.\d)/i);a=(c&&c[2])?parseInt(c[2]):null;return a};dhtmlXColorPicker.prototype.setCustomColors=function(){if(this.memory==null){this.initMemoryColors();this.conf.customColors=true}var h,g,n,c,m,a;g=arguments.length;for(h=0;h=0;g--){if(a[g]==h){m=g;break}}return m};dhtmlXColorPicker.prototype.destructMemory=function(){if(this.memory==null){return}this.hideMemory();var a=this._controllerNodes.memory_block.childNodes[0].firstChild;this._labelNodes.btnAddColor=null;if(typeof(window.addEventListener)=="function"){a.removeEventListener("click",this.saveColor,false)}else{a.detachEvent("onclick",this.saveColor)}this.memory.remove();this._controllerNodes.memory_block.innerHTML="";this.memory=null};dhtmlXColorPicker.prototype.Memory=function(g){var c=this,a=null,h={red:255,blue:255,green:255,hue:0,sat:0,lum:100};this.select=function(){var m=(this!=window)?this:event.srcElement;var l=l||m.dhxpc_memory;if(a!=null){c.unSelect()}a=l;l.domElement.className+=" dhxcp_memory_el_select";if(typeof(c.onSelect)=="function"){c.onSelect(l)}};this.onSelect=null;this.onSave=null;this._createMemoryController=function(l){var m={domElement:l,value:dhx4._copyObj(h)};l.dhxpc_memory=m;if(typeof(window.addEventListener)=="function"){l.addEventListener("click",c.select,false)}else{l.attachEvent("onclick",c.select)}return m};this._findMemoryControllers=function(r){var o=r.getElementsByTagName("a"),n,m,q=[];m=o.length;for(n=0;n1){return new dhtmlXSlider(this._renderArgumets(arguments))}else{if(typeof(g)=="string"||(typeof(g)=="object"&&g.tagName)){return new dhtmlXSlider({parent:g})}}if(typeof(g.parent)=="string"){this.base=document.getElementById(g.parent)}else{this.base=g.parent}this._mergeConfig(this._readAttFormNode(this.base));this._mergeConfig(g);if(this.conf.size==null||this.conf.size==undefined){if(this.conf.vertical){this.conf.size=this.base.offsetHeight}else{this.conf.size=this.base.offsetWidth}}var h=this.conf.skin||window.dhx4.skin||(typeof(dhtmlx)!=="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxslider")||"dhx_skyblue";this.setSkin(h);this.base.innerHTML="
";this._nodes={cont:this.base.firstChild,track:this.base.firstChild.firstChild,runner:this.base.firstChild.childNodes[1]};this._nodes.cont.onmousedown=this._nodes.track.onmousedown=this._nodes.cont.onselectstart=this._nodes.track.onselectstart=function(l){l=l||event;if(typeof(l.preventDefault)=="function"){l.preventDefault()}else{l.returnValue=false}return false};this.conf.value=this._normalize(this.conf.value);this._setOrient(this.conf.vertical);this.setSize(this.conf.size);this._initMover=function(l){l=l||event;a={};a.value=c.conf.value;a.coord=(c.conf.vertical)?l.clientY:l.clientX;if(c.conf.disabled==false){if(typeof(window.addEventListener)=="function"){window.addEventListener("mousemove",c._move,false);window.addEventListener("mouseup",c._cleanMove,false)}else{document.body.attachEvent("onmousemove",c._move);document.body.attachEvent("onmouseup",c._cleanMove)}}c.callEvent("_onRunnerMouseDown",[]);return false};this._move=function(q){q=q||event;var o=(c.conf.vertical)?c._nodes.runner.offsetHeight:c._nodes.runner.offsetWidth;var m=c.conf.max-c.conf.min;var l=(c.conf.vertical)?q.clientY:q.clientX;var n=a.value+(l-a.coord)*m/(c.conf.size-o);c.setValue(Math.round(n),true)};this._cleanMove=function(l){if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",c._move,false);window.removeEventListener("mouseup",c._cleanMove,false)}else{document.body.detachEvent("onmousemove",c._move);document.body.detachEvent("onmouseup",c._cleanMove)}a=null;c.callEvent("onSlideEnd",[c.conf.value]);c.callEvent("_onRunnerMouseUp",[])};this._doOnSetValue=function(q){if(a){return false}q=q||event;var o=(c.conf.vertical)?(q.offsetY||q.layerY):(q.offsetX||q.layerX);var n=(c.conf.vertical)?c._nodes.runner.offoffsetHeightsetHe:c._nodes.runner.offsetWidth;var l=c.conf.max-c.conf.min;var m=o*l/(c.conf.size)+c.conf.min;c.setValue(Math.round(m),true);if(!a){c._initMover(q)}return false};this._doOnChangeInput=function(m){m=m||event;var l=m.target||m.srcElement;c.setValue(l.value)};this._doOnKeyDown=function(m){m=m||event;var l=m.target||m.srcElement;if(m.keyCode==13){c.setValue(l.value)}};this._attachEvents(this._nodes);this.unload=function(){dhx4._eventable(this,"clear");this._detachNode();this._detachEvents(this._nodes);this.base.removeChild(this._nodes.cont);this._nodes.cont.onmousedown=this._nodes.track.onmousedown=this._nodes.cont.onselectstart=this._nodes.track.onselectstart=null;delete this._nodes.cont;delete this._nodes.track;delete this._nodes.max;delete this._nodes.min;delete this._nodes.runner;if(/\s?dhtmlxslider_\S*/.test(this.base.className)){this.base.className=this.base.className.replace(/\s?dhtmlxslider_\S*/,"")}for(var l in this){this[l]=null}c=null};dhx4._eventable(this);if(this.conf.disabled){this.disable()}if(this.conf.tooltip){this.enableTooltip()}if(!this.conf.visible){this.hide()}if(this.conf.linkTo){this.linkTo(this.conf.linkTo)}return this}dhtmlXSlider.prototype._setOrient=function(a){a=a||false;if(/\s?dhxsl_cont_hr/i.test(this._nodes.cont.className)){this._nodes.cont.className=this._nodes.cont.className.replace(/\s?dhxsl_cont_hr/i,"")}if(/\s?dhxsl_cont_vr/i.test(this._nodes.cont.className)){this._nodes.cont.className=this._nodes.cont.className.replace(/\s?dhxsl_cont_vr/i,"")}if(a){this._nodes.cont.className+=" dhxsl_cont_vr"}else{this._nodes.cont.className+=" dhxsl_cont_hr"}};dhtmlXSlider.prototype._attachEvents=function(a){if(typeof(window.addEventListener)=="function"){a.runner.addEventListener("mousedown",this._initMover,false);a.cont.addEventListener("mousedown",this._doOnSetValue,false)}else{a.runner.attachEvent("onmousedown",this._initMover);a.cont.attachEvent("onmousedown",this._doOnSetValue)}};dhtmlXSlider.prototype._detachEvents=function(a){if(typeof(window.addEventListener)=="function"){a.runner.removeEventListener("mousedown",this._initMover,false);a.cont.removeEventListener("mousedown",this._doOnSetValue,false)}else{a.runner.detachEvent("onmousedown",this._initMover);a.cont.detachEvent("onmousedown",this._doOnSetValue)}};dhtmlXSlider.prototype._mergeConfig=function(c){for(var a in c){switch(a.toLowerCase()){case"size":case"min":case"max":case"value":case"step":this.conf[a]=parseInt(c[a]);break;case"vertical":case"tooltip":case"disabled":case"visible":this.conf[a]=dhx4.s2b(c[a]);break;case"parent":continue;break;default:this.conf[a]=c[a]}}};dhtmlXSlider.prototype._readAttFormNode=function(h){var n=h.attributes,a=n.length,g,m={},c;for(g=0;g=0;g--){if(a[g]==h){m=g;break}}return m};dhtmlXSlider.prototype._refreshRunner=function(){var a,c;if(this.conf.vertical){a=this._nodes.cont.offsetHeight-this._nodes.runner.offsetHeight;c=this._getCoord(a);this._nodes.runner.style.top=c+this.conf.border+"px";this._nodes.runner.style.left=Math.round((this._nodes.cont.offsetWidth-this._nodes.runner.offsetWidth)/2)+"px"}else{a=this._nodes.cont.offsetWidth-this._nodes.runner.offsetWidth;c=this._getCoord(a);this._nodes.runner.style.left=c+this.conf.border+"px";this._nodes.runner.style.top=Math.round((this._nodes.cont.offsetHeight-this._nodes.runner.offsetHeight)/2)+"px"}};dhtmlXSlider.prototype._setValueByCoord=function(h){var a=dhx4.absLeft(this._nodes.cont),l=dhx4.absTop(this._nodes.cont),g,c;if(this.conf.vertical){c=(h.y-l-this._nodes.runner.offsetHeight/2)/(this._nodes.cont.offsetHeight-this._nodes.runner.offsetHeight)}else{c=(h.x-a-this._nodes.runner.offsetWidth/2)/(this._nodes.cont.offsetWidth-this._nodes.runner.offsetWidth)}g=Math.round((this.conf.max-this.conf.min)*c+this.conf.min);this.setValue(g,true)};dhtmlXSlider.prototype._getCoord=function(a){var g=this.conf;var c=(g.value-g.min)/(g.max-g.min);return Math.round(a*c)};dhtmlXSlider.prototype._normalize=function(a){a=parseInt(a);return Math.round(a/this.conf.step)*this.conf.step};dhtmlXSlider.prototype._attachNode=function(c){var a=c.tagName.toLowerCase();if(!a){return}this._attachedNode.node=c;switch(a){case"input":if(typeof(window.addEventListener)=="function"){c.addEventListener("change",this._doOnChangeInput,false);c.addEventListener("keydown",this._doOnKeyDown,false)}else{c.attachEvent("onchange",this._doOnChangeInput);c.attachEvent("onkeydown",this._doOnKeyDown)}this._attachedNode.setValue=function(g){c.value=g};break;default:this._attachedNode.setValue=function(g){c.innerHTML=g}}this._attachedNode.setValue(this.conf.value)};dhtmlXSlider.prototype._detachNode=function(){var c=this._attachedNode.node;if(!c){return}var a=c.tagName;switch(a){case"input":if(typeof(window.addEventListener)=="function"){c.removeEventListener("change",this._doOnChangeInput,false);c.removeEventListener("keydown",this._doOnChangeInput,false)}else{c.detachEvent("change",this._doOnChangeInput);c.detachEvent("keydown",this._doOnChangeInput)}break}delete this._attachedNode.node;delete this._attachedNode.setValue};dhtmlXSlider.prototype.setSize=function(a){a=parseInt(a);if(!isNaN(a)){if(this.conf.vertical){if(this._nodes.cont.style.width){delete this._nodes.cont.style.width}this._nodes.cont.style.height=a-this.conf.margin+"px"}else{if(this._nodes.cont.style.height){delete this._nodes.cont.style.height}this._nodes.cont.style.width=a-this.conf.margin+"px"}this._refreshRunner()}};dhtmlXSlider.prototype.setSkin=function(l){l=l.toLowerCase();var g,c=-1,a,h="dhtmlxslider";g=this.base.className.match(/\S\w+/ig);if(g instanceof Array){for(a in this._skinCollection){if(c==-1){c=this._indexOf(g,h+"_"+a)}else{break}}c=(c==-1)?g.length:c}else{g=[];c=0}g[c]=h+"_"+l;this.base.className=g.join(" ");this.conf.skin=l;if(this._nodes){this._refreshRunner()}};dhtmlXSlider.prototype.setValue=function(a,c){a=parseInt(a);c=c||false;if(!isNaN(a)){a=this._normalize(a);a=Math.max(this.conf.min,a);a=Math.min(this.conf.max,a);if(this.conf.value!==a){this.conf.value=a;this._refreshRunner();if(this.conf.tooltip){this._nodes.cont.title=this.conf.value}if(c){this.callEvent("onChange",[this.conf.value,this])}}}if(typeof(this._attachedNode.setValue)=="function"){this._attachedNode.setValue(this.conf.value)}};dhtmlXSlider.prototype.getValue=function(){return this.conf.value};dhtmlXSlider.prototype.disable=function(g){g=(g==false)?false:true;var c=null;if(g){for(var a in this._nodes){if(a=="cont"){continue}c=new RegExp("\\s?dhxsl_"+a+"_dis","i");if(!c.test(this._nodes[a].className)){this._nodes[a].className+=" dhxsl_"+a+"_dis"}}this.conf.disabled=true}else{this.enable()}};dhtmlXSlider.prototype.enable=function(){var c;for(var a in this._nodes){if(a=="cont"){continue}c=new RegExp("\\s?dhxsl_"+a+"_dis","i");if(c.test(this._nodes[a].className)){this._nodes[a].className=this._nodes[a].className.replace(c,"")}}this.conf.disabled=false};dhtmlXSlider.prototype.isEnabled=function(){return !this.conf.disabled};dhtmlXSlider.prototype.disableTooltip=function(){this._nodes.cont.removeAttribute("title");this.conf.tooltip=false};dhtmlXSlider.prototype.enableTooltip=function(a){if(typeof(a)=="undefined"){a=true}else{a=dhx4.s2b(a)}if(a){this._nodes.cont.title=this.conf.value;this.conf.tooltip=true}else{this.disableTooltip()}};dhtmlXSlider.prototype.setMax=function(a){a=parseInt(a);if(!isNaN(a)&&this.conf.mina){this.conf.min=a;this.setValue(this.conf.value)}};dhtmlXSlider.prototype.getMin=function(){return this.conf.min};dhtmlXSlider.prototype.setStep=function(a){a=parseInt(a);var c=this.conf.max-this.conf.min;if(!isNaN(a)&&a=0);this.p=document.createElement("DIV");this.p.style.display="none";this.p.innerHTML="
";document.body.appendChild(this.p);this.skinParams={dhx_terrace:{t0:19,t1:9,t2:19,t3:9},dhx_skyblue:{t0:12,t1:9,t2:12,t3:9},dhx_web:{t0:12,t1:9,t2:12,t3:9}};this.p.onclick=function(l){l=l||event;h._clearClick=true;if(h._nodeObj!=null){h.callEvent("onContentClick",[]);return true}var a=(l.target||l.srcElement);var m=null;while(a!=h.p&&a!=null){if(typeof(a._idd)!="undefined"&&!a._isSeparator){m=a._idd;a=null}else{a=a.parentNode}}a=null;if(m!=null){h.callEvent("onClick",[m]);if(h!=null&&h.isVisible!=null&&h.isVisible()&&h.callEvent("onBeforeHide",["select",l,m])===true){l.cancelBubble=true;h.hide()}}};this.separator="DHXSEP_"+window.dhx4.newId();this.tpl=[];this._setTemplate=function(a){this.tpl=a.split(",")};this.show=function(l){var a=null;if(arguments.length==1){if(!l){l=this.conf.id[0]}else{if(!this._idExists(l)){return}}if(this.conf.toolbar){a=this.conf.toolbar._getItemDim(l)}if(this.conf.ribbon){a=this.conf.ribbon._getItemDim(l)}if(this.conf.form){a=this.conf.form._getItemDim(l)}}else{if(arguments.length==4){this._clearClick=true;a={left:arguments[0],top:arguments[1],width:arguments[2],height:arguments[3]};l=null}}if(!a){return}this.p.style.visibility="hidden";this.p.style.display="";this._setPos(a);this.p.style.zIndex=window.dhx4.zim.reserve(this.conf.zi);this.p.style.visibility="visible";this._lastId=l;this.callEvent("onShow",[l])};this._setPos=function(I,n){var v=I.left;var s=I.top;var C=I.width;var L=I.height;this._posData={left:v,top:s,width:C,height:L};var N=window.dhx4.screenDim();var F=n||this.mode;if(typeof(n)=="undefined"){n=false}var P={top:(s-this.p.offsetHeight)-N.top,bottom:N.bottom-(s+L+this.p.offsetHeight),left:v-this.p.offsetWidth-N.left,right:N.right-(v+C+this.p.offsetWidth)};if(!n&&P[F]<0){var J=this._getAvailPos(F,P);if(J!==false){this._setPos(I,J);return}}if(F=="top"||F=="bottom"){var D=this.skinParams[this.conf.skin].t2;var A=this.skinParams[this.conf.skin].t3;var r=Math.round(this.p.offsetWidth/2);var a=Math.round(this.p.lastChild.offsetWidth/2);if(vN.right){C=N.right-v}var u=Math.round(v+C/2);var m=u-r;var K=u-D-a;var q=u+a+D-this.p.offsetWidth;if(mN.right+A){m=Math.max(q,N.right+A-this.p.offsetWidth)}}this.p.style.left=m+"px";this.p.style.top=(F=="top"?s-this.p.offsetHeight:s+L)+"px";u=u-m-a;this.p.lastChild.className="dhx_popup_arrow dhx_popup_arrow_"+F;this.p.lastChild.style.top=(F=="top"?this.p.offsetHeight-this.p.lastChild.offsetHeight:0)+"px";this.p.lastChild.style.left=u+"px"}if(F=="left"||F=="right"){var D=this.skinParams[this.conf.skin].t0;var A=this.skinParams[this.conf.skin].t1;var o=Math.round(this.p.offsetHeight/2);var S=Math.round(this.p.lastChild.offsetHeight/2);if(sN.bottom){L=N.bottom-s}var u=Math.round(s+L/2);var H=u-o;var Q=u-D-S;var O=u+S+D-this.p.offsetHeight;if(HN.bottom+A){H=Math.max(O,N.bottom+A-this.p.offsetHeight)}}this.p.style.left=(F=="left"?v-this.p.offsetWidth:v+C)+"px";this.p.style.top=H+"px";u=u-H-S;this.p.lastChild.className="dhx_popup_arrow dhx_popup_arrow_"+F;this.p.lastChild.style.left=(F=="left"?this.p.offsetWidth-this.p.lastChild.offsetWidth:0)+"px";this.p.lastChild.style.top=u+"px"}if(this._IEDisp&&this._nodeId!=null){var E=document.getElementById(this._nodeId);window.setTimeout(function(){E.style.visibility="visible";E=null},1)}};this._getAvailPos=function(s,r){var m={top:["bottom","right","left"],bottom:["top","right","left"],left:["right","bottom","top"],right:["left","bottom","top"]};var n=null;for(var o=0;o0){n=m[s][o]}}if(n==null){n="bottom";for(var l in r){if(r[l]>r[n]){n=l}}}if(n==s){return false}return n};this._repaint=function(){if(this.isVisible()){this._setPos(this._posData)}};this.clear=function(){if(this._nodeObj){if(this.conf.isIE&&typeof(dhtmlXLayoutObject)!="undefined"&&this._nodeObj instanceof dhtmlXLayoutObject){this.p.onmousedown=null}if(this._nodeObj.unload){this._nodeObj.unload()}else{if(this._nodeObj.destruct){this._nodeObj.destruct()}}this._nodeObj=this._nodeId=null;if(this._nodeObjEv!=null){for(var l=0;l0){a.removeChild(a.lastChild)}a=null;this.itemData={}};this.hide=function(){if(this.p.style.display!="none"){this.p.style.display="none";window.dhx4.zim.clear(this.conf.zi);var a=this._lastId;this._lastId=null;this.callEvent("onHide",[a])}};this.isVisible=function(){return(this.p.style.display=="")};this.itemData={};this.getItemData=function(a){if(!a){return this.itemData}if(this.itemData[a]){return this.itemData[a]}return{}};this.setSkin=function(a){this.conf.skin=a;this.p.className="dhx_popup_"+this.conf.skin;if(this._nodeObj!=null&&typeof(this._nodeObj.setSkin)=="function"){this._nodeObj.setSkin(this.conf.skin)}this._repaint()};this.attachList=function(m,u){this._setTemplate(m);this.clear();var n=this.p.firstChild.firstChild.firstChild;for(var s=0;s ";o.appendChild(v);v=null}else{for(var a=0;a";if(m.width){o.firstChild.style.width=m.width+"px"}if(m.height){o.firstChild.style.height=m.height+"px"}l.appendChild(o);o=l=a=null;if(typeof(this["_attach_init_"+n])=="function"){this["_attach_init_"+n](m);this._enableIEVFix()}this._repaint();return this._nodeObj};this.unload=function(){if(typeof(window.addEventListener)=="function"){window.removeEventListener("click",this._doOnClick,false);window.removeEventListener("keyup",this._doOnKeyUp,false);window.removeEventListener("unload",this._doOnUnload,false)}else{document.body.detachEvent("onclick",this._doOnClick,false);document.body.detachEvent("onkeyup",this._doOnKeyUp,false);document.body.detachEvent("onunload",this._doOnUnload,false)}this.clear();this._doOnClick=null;this._doOnUnload=null;this._doOnKeyUp=null;if(this.conf.toolbarEvent!=null&&this.conf.toolbar!=null){if(this.conf.toolbar.detachEvent!=null){this.conf.toolbar.detachEvent(this.conf.toolbarEvent)}else{this.conf.toolbar._getItemDim=null}}if(this.conf.ribbonEvent!=null&&this.conf.ribbon!=null){if(this.conf.ribbon.detachEvent!=null){this.conf.ribbon.detachEvent(this.conf.ribbonEvent)}else{this.conf.ribbon._getItemDim=null}}if(this.conf.slider){for(var a=0;a=0){if(l.parentNode!=null&&l.parentNode.parentNode!=null&&l.parentNode.parentNode._idd!=null){q=l.parentNode.parentNode._idd;if(l.parentNode.parentNode._type=="ra"){q=[l.parentNode.parentNode._group,l.parentNode.parentNode._value]}}}else{var a=true;var m=false;while(a&&!m){var n=(l.className||"").toLowerCase();if(n.length>0){m=(n=="dhxform_btn"||n.search(/dhxeditor_inside/gi)>=0||n=="dhxcombo_input"||n.search(/dhxcombolist/gi)>=0)}l=l.parentNode;a=(l!=null)}if(m){return}}l=null;if(q!=null&&h._idExists(q)){return}}if(h.isVisible()&&h.callEvent("onBeforeHide",["click",o])===true){h.hide()}};this._doOnKeyUp=function(a){a=a||event;if(a.keyCode==27){if(h.isVisible()&&h.callEvent("onBeforeHide",["esc",a])===true){h.hide()}}};this._doOnUnload=function(){h.unload()};if(typeof(window.addEventListener)=="function"){window.addEventListener("click",this._doOnClick,false);window.addEventListener("keyup",this._doOnKeyUp,false);window.addEventListener("unload",this._doOnUnload,false)}else{document.body.attachEvent("onclick",this._doOnClick,false);document.body.attachEvent("onkeyup",this._doOnKeyUp,false);document.body.attachEvent("onunload",this._doOnUnload,false)}this._idExists=function(m){var a=false;for(var l=0;l=0||document.compatMode!="CSS1Compat"));this._IEHover=(this.conf.isIE&&navigator.userAgent.search("MSIE 6.0")>=0);if(this._IEHover){this._IEHoverInit=function(){this.p.onmouseover=function(){var a=event.srcElement;while(a!=this&&a._IEHover!=true){a=a.parentNode}if(a._IEHover){if(h._IEHoverTM){window.clearTimeout(h._IEHoverTM)}if(h._lastIEHover==a){return}h._IEHoverRender(a);a=null}};this.p.onmouseout=function(){if(h._IEHoverTM){window.clearTimeout(h._IEHoverTM)}h._IEHoverTM=window.setTimeout(function(){h._IEHoverRender(null)},1)};this._IEHoverRender=function(a){if(this._lastIEHover!=null){if(this._lastIEHover.className.search(/tr_hover/gi)>=0){this._lastIEHover.className=this._lastIEHover.className.replace(/\s{0,}tr_hover/gi,"");this._lastIEHover=null}}if(a!=null&&a.className.search(/tr_hover/gi)<0){a.className+=" tr_hover";h._lastIEHover=a}};this._IEHoverInited=true};this._IEHoverClear=function(){this.p.onmouseover=null;this.p.onmouseout=null;this._IEHoverInited=false}}this._IEFirstLast=(this.conf.isIE&&navigator.userAgent.search(/MSIE [6,7,8]\.0/i)>=0);this._enableIEVFix=function(){if(this.conf.isIE&&navigator.userAgent.search("MSIE 6.0")>=0){var l=this.attachEvent("onHide",function(){document.getElementById(this._nodeId).style.visibility="hidden"});var a=this.attachEvent("onShow",function(){document.getElementById(this._nodeId).style.visibility="visible"});if(this._nodeObjEv==null){this._nodeObjEv=[]}this._nodeObjEv.push(l,a)}};if(typeof(window.dhtmlXToolbarObject)!="undefined"&&this.conf.toolbar!=null&&this.conf.toolbar instanceof window.dhtmlXToolbarObject&&this.conf.id!=null){if(!(this.conf.id instanceof Array)){this.conf.id=[this.conf.id]}this.skinParent=this.conf.toolbar.conf.skin;this._doOnToolbarClick=function(l){for(var a=0;a=0&&document.compatMode=="BackCompat"),live_id:window.dhx4.newId(),tags:{root:"menu",item:"item",text_ext:"itemtext",userdata:"userdata",tooltip:"tooltip",hotkey:"hotkey",href:"href"},autoload:{},hide_tm:{},top_mode:true,top_tmtime:200,v_enabled:false,v:{x1:null,x2:null,y1:null,y2:null},dir_toplv:"bottom",dir_sublv:"right",auto_overflow:false,overflow_limit:0,of_utm:null,of_utime:20,of_ustep:3,of_dtm:null,of_dtime:20,of_dstep:3,tm_sec:400,tm_handler:null,dload:false,dload_url:"",dload_icon:false,dload_params:{action:"loadMenu"},dload_pid:"parentId",tl_botmarg:1,tl_rmarg:0,tl_ofsleft:1,context:false,ctx_zoneid:false,ctx_autoshow:true,ctx_autohide:true,ctx_hideall:true,ctx_zones:{},ctx_baseid:null,selected_sub:[],opened_poly:[]};if(typeof(l)=="object"&&l!=null&&typeof(l.tagName)=="undefined"){if(l.icons_path!=null||l.icon_path!=null){this.conf.icons_path=(l.icons_path||l.icon_path)}if(l.skin!=null){this.conf.skin=l.skin}if(l.visible_area){this.conf.v_enabled=true;this.conf.v={x1:l.visible_area.x1,x2:l.visible_area.x2,y1:l.visible_area.y1,y2:l.visible_area.y2}}for(var g in {json:1,xml:1,items:1,top_text:1,align:1,open_mode:1,overflow:1,dynamic:1,dynamic_icon:1,context:1,onload:1,onclick:1,oncheckboxclick:1,onradioclick:1}){if(l[g]!=null){this.conf.autoload[g]=l[g]}}l=l.parent}if(l==null){this.base=document.body}else{var c=(typeof(l)=="string"?document.getElementById(l):l);if(c!=null){this.base=c;if(!this.base.id){this.base.id=(new Date()).valueOf()}this.base.className+=" dhtmlxMenu_"+this.conf.skin+"_Middle dir_left";this.base._autoSkinUpdate=true;if(this.base.oncontextmenu){this.base._oldContextMenuHandler=this.base.oncontextmenu}this.conf.ctx_baseid=this.base.id;this.base.onselectstart=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};this.base.oncontextmenu=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false}}else{this.base=document.body}}this.idPrefix="";this.topId="dhxWebMenuTopId";this.idPull={};this.itemPull={};this.userData={};this.radio={};this.setSkin=function(o){var q=this.conf.skin;this.conf.skin=o;switch(this.conf.skin){case"dhx_skyblue":case"dhx_web":this.conf.tl_botmarg=2;this.conf.tl_rmarg=1;this.conf.tl_ofsleft=1;break;case"dhx_terrace":this.conf.tl_botmarg=0;this.conf.tl_rmarg=0;this.conf.tl_ofsleft=0;break}if(this.base._autoSkinUpdate){this.base.className=this.base.className.replace("dhtmlxMenu_"+q+"_Middle","")+" dhtmlxMenu_"+this.conf.skin+"_Middle"}for(var n in this.idPull){this.idPull[n].className=String(this.idPull[n].className).replace(q,this.conf.skin)}};this.setSkin(this.conf.skin);this._addSubItemToSelected=function(o,n){var a=true;for(var r=0;rthis.conf.v.y1+this.conf.v.y2){var D=Math.floor((this.conf.v.y2-this.conf.v.y1-35)/24);this.conf.overflow_limit=D}else{this.conf.overflow_limit=0;if(this.idPull["arrowup_"+I]!=null){this._removeUpArrow(String(I).replace(this.idPrefix,""))}if(this.idPull["arrowdown_"+I]!=null){this._removeDownArrow(String(I).replace(this.idPrefix,""))}}}if(this.conf.overflow_limit>0&&this.conf.overflow_limit0){if(this.conf.overflow_limitH&&!this.conf.rtl){v=a-C+2}if(vF&&this.conf.v.y2!=null){u=Math.max(O+q-L+2,(this.conf.v_enabled?this.conf.v.y1+2:2));if(this.conf.context&&this.idPrefix+this.topId==I&&E!=null){u=u-2}if(this.itemPull[I]!=null&&!this.conf.context){if(this.itemPull[I]["parent"]==this.idPrefix+this.topId){u=u-this.base.offsetHeight}}}this.idPull[J].style.left=v+"px";this.idPull[J].style.top=u+"px";if(typeof(this._menuEffect)!="undefined"&&this._menuEffect!==false){this._showPolygonEffect(J)}else{this.idPull[J].style.visibility="";if(this.conf.overflow_limit>0&&this.conf.overflow_limit0){this.conf.opened_poly.pop()}var a=this._getSubItemToDeselectByPolygon(r);this._removeSubItemFromSelected(-1,-1);for(var n=0;n0){a=n}}}return a};this._getMenuNodes=function(q){var n=new Array;for(var o in this.itemPull){if(this.itemPull[o]["parent"]==q){n[n.length]=o}}return n};this._genStr=function(a){var n="";var r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var o=0;o0){h.conf.opened_poly.pop()}for(var a=0;a0)&&(!this.itemPull[c]["complex"])){this._updateItemComplexState(c,true,false)}if((a==0)&&(this.itemPull[c]["complex"])){this._updateItemComplexState(c,false,false)}}};dhtmlXMenuObject.prototype._updateItemComplexState=function(l,g,h){if((!this.conf.context)&&(this._getItemLevelType(l.replace(this.idPrefix,""))=="TopLevel")){this.itemPull[l]["complex"]=g;return}if((this.idPull[l]==null)||(this.itemPull[l]==null)){return}this.itemPull[l]["complex"]=g;if(l==this.idPrefix+this.topId){return}var a=null;var c=this.idPull[l].childNodes[this.conf.rtl?0:2];if(c.childNodes[0]){if(String(c.childNodes[0].className).search("complex_arrow")===0){a=c.childNodes[0]}}if(this.itemPull[l]["complex"]){if(a==null){a=document.createElement("DIV");a.className="complex_arrow";a.id="arrow_"+l;while(c.childNodes.length>0){c.removeChild(c.childNodes[0])}c.appendChild(a)}if(this.conf.dload&&(this.itemPull[l].loaded=="get")&&this.conf.dload_icon){if(a.className!="complex_arrow_loading"){a.className="complex_arrow_loading"}}else{a.className="complex_arrow"}return}if((!this.itemPull[l]["complex"])&&(a!=null)){c.removeChild(a);if(this.itemPull[l]["hotkey_backup"]!=null&&this.setHotKey){this.setHotKey(l.replace(this.idPrefix,""),this.itemPull[l]["hotkey_backup"])}}};dhtmlXMenuObject.prototype._getItemLevelType=function(a){return(this.itemPull[this.idPrefix+a]["parent"]==this.idPrefix+this.topId?"TopLevel":"SubLevelArea")};dhtmlXMenuObject.prototype.setIconsPath=function(a){this.conf.icons_path=a};dhtmlXMenuObject.prototype._updateItemImage=function(g,h){g=this.idPrefix+g;var l=(this.itemPull[g]["parent"]==this.idPrefix+this.topId&&!this.conf.context);var m=null;if(l){for(var a=0;a0){if(m!=null){m.src=this.conf.icons_path+r}else{if(l){var m=document.createElement("IMG");m.className="dhtmlxMenu_TopLevel_Item_Icon";m.src=this.conf.icons_path+r;m.border="0";m.id="image_"+g;if(!this.conf.rtl&&this.idPull[g].childNodes.length>0){this.idPull[g].insertBefore(m,this.idPull[g].childNodes[0])}else{this.idPull[g].appendChild(m)}}else{var m=document.createElement("IMG");m.className="sub_icon";m.src=this.conf.icons_path+r;m.border="0";m.id="image_"+g;var o=this.idPull[g].childNodes[this.conf.rtl?2:0];while(o.childNodes.length>0){o.removeChild(o.childNodes[0])}o.appendChild(m)}}}else{if(m!=null){var c=m.parentNode;c.removeChild(m);c.innerHTML=" ";c=m=null}}};dhtmlXMenuObject.prototype._getAllParents=function(m){var g=new Array();for(var c in this.itemPull){if(this.itemPull[c]["parent"]==m){g[g.length]=this.itemPull[c]["id"];if(this.itemPull[c]["complex"]){var h=this._getAllParents(this.itemPull[c]["id"]);for(var l=0;l0){a.title=this.itemPull[o]["tip"]}if((this.itemPull[o]["imgen"]!="")||(this.itemPull[o]["imgdis"]!="")){var g=this.itemPull[o][(this.itemPull[o]["state"]=="enabled")?"imgen":"imgdis"];if(g){var c=document.createElement("IMG");c.border="0";c.id="image_"+o;c.src=this.conf.icons_path+g;c.className="dhtmlxMenu_TopLevel_Item_Icon";if(a.childNodes.length>0&&!this.conf.rtl){a.insertBefore(c,a.childNodes[0])}else{a.appendChild(c)}}}a.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}return false};a.oncontextmenu=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}return false};if(!this.cont){this.cont=document.createElement("DIV");this.cont.dir="ltr";this.cont.className=(this.conf.align=="right"?"align_right":"align_left");this.base.appendChild(this.cont)}if(n!=null){n++;if(n<0){n=0}if(n>this.cont.childNodes.length-1){n=null}}if(n!=null){this.cont.insertBefore(a,this.cont.childNodes[n])}else{this.cont.appendChild(a)}this.idPull[a.id]=a;if(this.itemPull[o]["complex"]&&(!this.conf.dload)){this._addSubMenuPolygon(this.itemPull[o]["id"],this.itemPull[o]["id"])}a.onmouseover=function(){if(l.conf.mode=="web"){window.clearTimeout(l.conf.tm_handler)}var m=l._getSubItemToDeselectByPolygon("parent");l._removeSubItemFromSelected(-1,-1);for(var s=0;s
';var g=document.createElement("TABLE");g.className="dhtmlxMebu_SubLevelArea_Tbl";g.cellSpacing=0;g.cellPadding=0;g.border=0;var a=document.createElement("TBODY");g.appendChild(a);c.childNodes[1].appendChild(g);c.tbl=g;c.tbd=a;this.idPull[c.id]=c;if(this.sxDacProc!=null){this.idPull["sxDac_"+h]=new this.sxDacProc(c,c.className);if(window.dhx4.isIE){this.idPull["sxDac_"+h]._setSpeed(this.dacSpeedIE);this.idPull["sxDac_"+h]._setCustomCycle(this.dacCyclesIE)}else{this.idPull["sxDac_"+h]._setSpeed(this.dacSpeed);this.idPull["sxDac_"+h]._setCustomCycle(this.dacCycles)}}return c};dhtmlXMenuObject.prototype._renderSublevelItem=function(a,r){var o=this;var q=document.createElement("TR");q.className=(this.itemPull[a]["state"]=="enabled"?"sub_item":"sub_item_dis");var n=document.createElement("TD");n.className="sub_item_icon";var s=this.itemPull[a][(this.itemPull[a]["state"]=="enabled"?"imgen":"imgdis")];if(s!=""){var w=this.itemPull[a]["type"];if(w=="checkbox"||w=="radio"){var l=document.createElement("DIV");l.id="image_"+this.itemPull[a]["id"];l.className="sub_icon "+s;n.appendChild(l)}if(!(w=="checkbox"||w=="radio")){var l=document.createElement("IMG");l.id="image_"+this.itemPull[a]["id"];l.className="sub_icon";l.src=this.conf.icons_path+s;n.appendChild(l)}}else{n.innerHTML=" "}var m=document.createElement("TD");m.className="sub_item_text";if(this.itemPull[a]["title"]!=""){var v=document.createElement("DIV");v.className="sub_item_text";v.innerHTML=this.itemPull[a]["title"];m.appendChild(v)}else{m.innerHTML=" "}var h=document.createElement("TD");h.className="sub_item_hk";if(this.itemPull[a]["complex"]){var c=document.createElement("DIV");c.className="complex_arrow";c.id="arrow_"+this.itemPull[a]["id"];h.appendChild(c)}else{if(this.itemPull[a]["hotkey"].length>0&&!this.itemPull[a]["complex"]){var g=document.createElement("DIV");g.className="sub_item_hk";g.innerHTML=this.itemPull[a]["hotkey"];h.appendChild(g)}else{h.innerHTML=" "}}q.appendChild(this.conf.rtl?h:n);q.appendChild(m);q.appendChild(this.conf.rtl?n:h);q.id=this.itemPull[a]["id"];q.parent=this.itemPull[a]["parent"];if(this.itemPull[a]["tip"].length>0){q.title=this.itemPull[a]["tip"]}q.onselectstart=function(x){x=x||event;if(x.preventDefault){x.preventDefault()}else{x.returnValue=false}return false};q.onmouseover=function(x){if(o.conf.hide_tm[this.id]){window.clearTimeout(o.conf.hide_tm[this.id])}if(o.conf.mode=="web"){window.clearTimeout(o.conf.tm_handler)}if(!this._visible){o._redistribSubLevelSelection(this.id,this.parent)}this._visible=true};q.onmouseout=function(){if(o.conf.mode=="web"){if(o.conf.tm_handler){window.clearTimeout(o.conf.tm_handler)}o.conf.tm_handler=window.setTimeout(function(){if(o&&o._clearAndHide){o._clearAndHide()}},o.conf.tm_sec,"JavaScript")}var x=this;if(o.conf.hide_tm[this.id]){window.clearTimeout(o.conf.hide_tm[this.id])}o.conf.hide_tm[this.id]=window.setTimeout(function(){x._visible=false},50)};q.onclick=function(y){if(!o.checkEvent("onClick")&&o.itemPull[this.id]["complex"]){return}y=y||event;y.cancelBubble=true;if(y.preventDefault){y.preventDefault()}else{y.returnValue=false}tc=(o.itemPull[this.id]["complex"]?"c":"-");td=(o.itemPull[this.id]["state"]=="enabled"?"-":"d");var x={ctrl:y.ctrlKey,alt:y.altKey,shift:y.shiftKey};switch(o.itemPull[this.id]["type"]){case"checkbox":o._checkboxOnClickHandler(this.id.replace(o.idPrefix,""),tc+td+"n",x);break;case"radio":o._radioOnClickHandler(this.id.replace(o.idPrefix,""),tc+td+"n",x);break;case"item":o._doOnClick(this.id.replace(o.idPrefix,""),tc+td+"n",x);break}return false};var u=this.idPull["polygon_"+this.itemPull[a]["parent"]];if(r!=null){r++;if(r<0){r=0}if(r>u.tbd.childNodes.length-1){r=null}}if(r!=null&&u.tbd.childNodes[r]!=null){u.tbd.insertBefore(q,u.tbd.childNodes[r])}else{u.tbd.appendChild(q)}this.idPull[q.id]=q};dhtmlXMenuObject.prototype._renderSeparator=function(c,n){var a=(this.conf.context?"SubLevelArea":(this.itemPull[c]["parent"]==this.idPrefix+this.topId?"TopLevel":"SubLevelArea"));if(a=="TopLevel"&&this.conf.context){return}var l=this;if(a!="TopLevel"){var m=document.createElement("TR");m.className="sub_sep";var g=document.createElement("TD");g.colSpan="3";m.appendChild(g)}var h=document.createElement("DIV");h.id="separator_"+c;h.className=(a=="TopLevel"?"top_sep":"sub_sep");h.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}};h.onclick=function(s){s=s||event;s.cancelBubble=true;var r={ctrl:s.ctrlKey,alt:s.altKey,shift:s.shiftKey};l._doOnClick(this.id.replace("separator_"+l.idPrefix,""),"--s",r)};if(a=="TopLevel"){if(n!=null){n++;if(n<0){n=0}if(this.cont.childNodes[n]!=null){this.cont.insertBefore(h,this.cont.childNodes[n])}else{this.cont.appendChild(h)}}else{var q=this.cont.childNodes[this.cont.childNodes.length-1];if(String(q).search("TopLevel_Text")==-1){this.cont.appendChild(h)}else{this.cont.insertBefore(h,q)}}this.idPull[h.id]=h}else{var o=this.idPull["polygon_"+this.itemPull[c]["parent"]];if(n!=null){n++;if(n<0){n=0}if(n>o.tbd.childNodes.length-1){n=null}}if(n!=null&&o.tbd.childNodes[n]!=null){o.tbd.insertBefore(m,o.tbd.childNodes[n])}else{o.tbd.appendChild(m)}g.appendChild(h);this.idPull[h.id]=m}};dhtmlXMenuObject.prototype.addNewSeparator=function(a,c){c=this.idPrefix+(c!=null?c:this._genStr(24));var g=this.idPrefix+this.getParentId(a);this._addItemIntoGlobalStrorage(c,g,"","separator",false,"","");this._renderSeparator(c,this.getItemPosition(a))};dhtmlXMenuObject.prototype._initObj=function(u,v,n){if(!(u instanceof Array)){n=u.parentId;if(n!=null&&String(n).indexOf(this.idPrefix)!==0){n=this.idPrefix+String(n)}u=u.items}for(var g=0;g0){this.itemPull[u[g].id].complex=true;this._initObj(u[g].items,true,u[g].id)}else{if(this.conf.dload&&u[g].complex==true){this.itemPull[u[g].id].loaded="no"}}this.itemPull[u[g].id].items=null}if(v!==true){if(this.conf.dload==true){if(n==null){this._initTopLevelMenu()}else{this._addSubMenuPolygon(n,n);if(this.conf.selected==n){var s=(this.itemPull[n].parent==this.idPrefix+this.topId);var c=(s&&!this.conf.context?this.conf.dir_toplv:this.conf.dir_sublv);var l=false;if(s&&this.conf.top_mode&&this.conf.mode=="web"&&!this.conf.context){var x=this.idPull[n];if(x._mouseOver==true){var m=this.conf.top_tmtime-(new Date().getTime()-x._dynLoadTM);if(m>1){var r=n;var o=this;x._menuOpenTM=window.setTimeout(function(){o._showPolygon(r,c);o=r=null},m);l=true}}}if(!l){this._showPolygon(n,c)}}this.itemPull[n].loaded="yes";if(this.conf.dload_icon==true){this._updateLoaderIcon(n,false)}}}else{this._init()}}};dhtmlXMenuObject.prototype._xmlToJson=function(l,h){var n=[];if(h==null){var o=l.getElementsByTagName(this.conf.tags.root);if(o==null||o.length==0){return data}o=o[0]}else{o=l}if(o.getAttribute("parentId")!=null){h=this.idPrefix+o.getAttribute("parentId")}for(var c=0;c0)}for(var s=0;s=0){return}var c=(this.conf.rtl?0:2);if(!this.idPull[h].childNodes[c]){return}if(!this.idPull[h].childNodes[c].childNodes[0]){return}var a=this.idPull[h].childNodes[c].childNodes[0];if(String(a.className).search("complex_arrow")===0){a.className="complex_arrow"+(g?"_loading":"")}};dhtmlXMenuObject.prototype.addNewSibling=function(h,l,a,c,g,o){var n=this.idPrefix+(l!=null?l:this._genStr(24));var m=this.idPrefix+(h!=null?this.getParentId(h):this.topId);this._addItemIntoGlobalStrorage(n,m,a,"item",c,g,o);if((m==this.idPrefix+this.topId)&&(!this.conf.context)){this._renderToplevelItem(n,this.getItemPosition(h))}else{this._renderSublevelItem(n,this.getItemPosition(h))}};dhtmlXMenuObject.prototype.addNewChild=function(n,m,h,a,c,g,l){if(n==null){if(this.conf.context){n=this.topId}else{this.addNewSibling(n,h,a,c,g,l);if(m!=null){this.setItemPosition(h,m)}return}}h=this.idPrefix+(h!=null?h:this._genStr(24));if(this.setHotKey){this.setHotKey(n,"")}n=this.idPrefix+n;this._addItemIntoGlobalStrorage(h,n,a,"item",c,g,l);if(this.idPull["polygon_"+n]==null){this._renderSublevelPolygon(n,n)}this._renderSublevelItem(h,m-1);this._redefineComplexState(n)};dhtmlXMenuObject.prototype.removeItem=function(h,m,l){if(!m){h=this.idPrefix+h}var n=null;if(h!=this.idPrefix+this.topId){if(this.itemPull[h]==null){return}if(this.idPull["polygon_"+h]&&this.idPull["polygon_"+h]._tmShow){window.clearTimeout(this.idPull["polygon_"+h]._tmShow)}var v=this.itemPull[h]["type"];if(v=="separator"){var u=this.idPull["separator_"+h];if(this.itemPull[h]["parent"]==this.idPrefix+this.topId){u.onclick=null;u.onselectstart=null;u.id=null;u.parentNode.removeChild(u)}else{u.childNodes[0].childNodes[0].onclick=null;u.childNodes[0].childNodes[0].onselectstart=null;u.childNodes[0].childNodes[0].id=null;u.childNodes[0].removeChild(u.childNodes[0].childNodes[0]);u.removeChild(u.childNodes[0]);u.parentNode.removeChild(u)}this.idPull["separator_"+h]=null;this.itemPull[h]=null;delete this.idPull["separator_"+h];delete this.itemPull[h];u=null}else{n=this.itemPull[h]["parent"];var u=this.idPull[h];u.onclick=null;u.oncontextmenu=null;u.onmouseover=null;u.onmouseout=null;u.onselectstart=null;u.id=null;while(u.childNodes.length>0){u.removeChild(u.childNodes[0])}u.parentNode.removeChild(u);this.idPull[h]=null;this.itemPull[h]=null;delete this.idPull[h];delete this.itemPull[h];u=null}v=null}for(var r in this.itemPull){if(this.itemPull[r]["parent"]==h){this.removeItem(r,true,true)}}var s=new Array(h);if(n!=null&&!l){if(this.idPull["polygon_"+n]!=null){if(this.idPull["polygon_"+n].tbd.childNodes.length==0){s.push(n);this._updateItemComplexState(n,false,false)}}}for(var c=0;c0){this.idPull[l].insertBefore(g,this.idPull[l].childNodes[0])}else{this.idPull[l].appendChild(g)}}g.innerHTML=this.itemPull[l]["title"]}}else{var g=null;for(var a=0;a0?a:null);this.itemPull[c]["tip"]=a};dhtmlXMenuObject.prototype.getTooltip=function(a){if(this.itemPull[this.idPrefix+a]==null){return null}return this.itemPull[this.idPrefix+a]["tip"]};dhtmlXMenuObject.prototype.setTopText=function(a){if(this.conf.context){return}if(this._topText==null){this._topText=document.createElement("DIV");this._topText.className="dhtmlxMenu_TopLevel_Text_"+(this.conf.rtl?"left":(this.conf.align=="left"?"right":"left"));this.base.appendChild(this._topText)}this._topText.innerHTML=a};dhtmlXMenuObject.prototype.setAlign=function(a){if(this.conf.align==a){return}if(a=="left"||a=="right"){this.conf.align=a;if(this.cont){this.cont.className=(this.conf.align=="right"?"align_right":"align_left")}if(this._topText!=null){this._topText.className="dhtmlxMenu_TopLevel_Text_"+(this.conf.align=="left"?"right":"left")}}};dhtmlXMenuObject.prototype.setHref=function(g,a,c){if(this.itemPull[this.idPrefix+g]==null){return}this.itemPull[this.idPrefix+g]["href_link"]=a;if(c!=null){this.itemPull[this.idPrefix+g]["href_target"]=c}};dhtmlXMenuObject.prototype.clearHref=function(a){if(this.itemPull[this.idPrefix+a]==null){return}delete this.itemPull[this.idPrefix+a]["href_link"];delete this.itemPull[this.idPrefix+a]["href_target"]};dhtmlXMenuObject.prototype.getCircuit=function(c){var a=new Array(c);while(this.getParentId(c)!=this.topId){c=this.getParentId(c);a[a.length]=c}return a.reverse()};dhtmlXMenuObject.prototype._getCheckboxState=function(a){if(this.itemPull[this.idPrefix+a]==null){return null}return this.itemPull[this.idPrefix+a]["checked"]};dhtmlXMenuObject.prototype._setCheckboxState=function(c,a){if(this.itemPull[this.idPrefix+c]==null){return}this.itemPull[this.idPrefix+c]["checked"]=a};dhtmlXMenuObject.prototype._updateCheckboxImage=function(c){if(this.idPull[this.idPrefix+c]==null){return}this.itemPull[this.idPrefix+c]["imgen"]="chbx_"+(this._getCheckboxState(c)?"1":"0");this.itemPull[this.idPrefix+c]["imgdis"]=this.itemPull[this.idPrefix+c]["imgen"];try{this.idPull[this.idPrefix+c].childNodes[(this.conf.rtl?2:0)].childNodes[0].className="sub_icon "+this.itemPull[this.idPrefix+c]["imgen"]}catch(a){}};dhtmlXMenuObject.prototype._checkboxOnClickHandler=function(h,a,c){if(a.charAt(1)=="d"){return}if(this.itemPull[this.idPrefix+h]==null){return}var g=this._getCheckboxState(h);if(this.checkEvent("onCheckboxClick")){if(this.callEvent("onCheckboxClick",[h,g,this.conf.ctx_zoneid,c])){this.setCheckboxState(h,!g)}}else{this.setCheckboxState(h,!g)}if(this.checkEvent("onClick")){this.callEvent("onClick",[h])}};dhtmlXMenuObject.prototype.setCheckboxState=function(c,a){this._setCheckboxState(c,a);this._updateCheckboxImage(c)};dhtmlXMenuObject.prototype.getCheckboxState=function(a){return this._getCheckboxState(a)};dhtmlXMenuObject.prototype.addCheckbox=function(o,h,q,r,s,a,l){if(this.conf.context&&h==this.topId){}else{if(this.itemPull[this.idPrefix+h]==null){return}if(o=="child"&&this.itemPull[this.idPrefix+h]["type"]!="item"){return}}var m="chbx_"+(a?"1":"0");var g=m;if(o=="sibling"){var c=this.idPrefix+(r!=null?r:this._genStr(24));var n=this.idPrefix+this.getParentId(h);this._addItemIntoGlobalStrorage(c,n,s,"checkbox",l,m,g);this.itemPull[c]["checked"]=a;this._renderSublevelItem(c,this.getItemPosition(h))}else{var c=this.idPrefix+(r!=null?r:this._genStr(24));var n=this.idPrefix+h;this._addItemIntoGlobalStrorage(c,n,s,"checkbox",l,m,g);this.itemPull[c]["checked"]=a;if(this.idPull["polygon_"+n]==null){this._renderSublevelPolygon(n,n)}this._renderSublevelItem(c,q-1);this._redefineComplexState(n)}};dhtmlXMenuObject.prototype.setHotKey=function(m,a){m=this.idPrefix+m;if(!(this.itemPull[m]!=null&&this.idPull[m]!=null)){return}if(this.itemPull[m]["parent"]==this.idPrefix+this.topId&&!this.conf.context){return}if(this.itemPull[m]["complex"]){return}var c=this.itemPull[m]["type"];if(!(c=="item"||c=="checkbox"||c=="radio")){return}var l=null;try{if(this.idPull[m].childNodes[this.conf.rtl?0:2].childNodes[0].className=="sub_item_hk"){l=this.idPull[m].childNodes[this.conf.rtl?0:2].childNodes[0]}}catch(h){}if(a.length==0){this.itemPull[m]["hotkey_backup"]=this.itemPull[m]["hotkey"];this.itemPull[m]["hotkey"]="";if(l!=null){l.parentNode.removeChild(l)}}else{this.itemPull[m]["hotkey"]=a;this.itemPull[m]["hotkey_backup"]=null;if(l==null){l=document.createElement("DIV");l.className="sub_item_hk";var g=this.idPull[m].childNodes[this.conf.rtl?0:2];while(g.childNodes.length>0){g.removeChild(g.childNodes[0])}g.appendChild(l)}l.innerHTML=a}};dhtmlXMenuObject.prototype.getHotKey=function(a){if(this.itemPull[this.idPrefix+a]==null){return null}return this.itemPull[this.idPrefix+a]["hotkey"]};dhtmlXMenuObject.prototype._clearAllSelectedSubItemsInPolygon=function(a){var g=this._getSubItemToDeselectByPolygon(a);for(var c=0;c0){var g=false;var l=a.scrollTop-this.conf.of_ustep;if(l<0){g=true;l=0}a.scrollTop=l;if(!g){var c=this;this.conf.of_utm=window.setTimeout(function(){c._doScrollUp(m,false);c=null},this.conf.of_utime)}else{h=true}}else{this._canScrollUp=false;this._checkArrowsState(m)}if(h){this._checkArrowsState(m)}};dhtmlXMenuObject.prototype._doScrollDown=function(m,h){var a=this.idPull["polygon_"+m].childNodes[1];if(this._canScrollDown&&a.scrollTop+a.offsetHeight<=a.scrollHeight){var g=false;var l=a.scrollTop+this.conf.of_dstep;if(l+a.offsetHeight>=a.scrollHeight){g=true;l=a.scrollHeight-a.offsetHeight}a.scrollTop=l;if(!g){var c=this;this.conf.of_dtm=window.setTimeout(function(){c._doScrollDown(m,false);c=null},this.conf.of_dtime)}else{h=true}}else{this._canScrollDown=false;this._checkArrowsState(m)}if(h){this._checkArrowsState(m)}};dhtmlXMenuObject.prototype._countPolygonItems=function(m){var h=0;for(var c in this.itemPull){var g=this.itemPull[c]["parent"];var l=this.itemPull[c]["type"];if(g==this.idPrefix+m&&(l=="item"||l=="radio"||l=="checkbox")){h++}}return h};dhtmlXMenuObject.prototype.setOverflowHeight=function(h){if(h==="auto"){this.conf.overflow_limit=0;this.conf.auto_overflow=true;return}if(this.conf.overflow_limit==0&&h<=0){return}this._clearAndHide();if(this.conf.overflow_limit>=0&&h>0){this.conf.overflow_limit=h;return}if(this.conf.overflow_limit>0&&h<=0){for(var g in this.itemPull){if(this._isArrowExists(g)){var c=String(g).replace(this.idPrefix,"");this._removeUpArrow(c);this._removeDownArrow(c);this.idPull["polygon_"+g].childNodes[1].style.height=""}}this.conf.overflow_limit=0;return}};dhtmlXMenuObject.prototype._getRadioImgObj=function(g){try{var a=this.idPull[this.idPrefix+g].childNodes[(this.conf.rtl?2:0)].childNodes[0]}catch(c){var a=null}return a};dhtmlXMenuObject.prototype._setRadioState=function(h,g){var c=this._getRadioImgObj(h);if(c!=null){var a=this.itemPull[this.idPrefix+h];a.checked=g;a.imgen="rdbt_"+(a.checked?"1":"0");a.imgdis=a.imgen;c.className="sub_icon "+a.imgen}};dhtmlXMenuObject.prototype._radioOnClickHandler=function(h,a,c){if(a.charAt(1)=="d"||this.itemPull[this.idPrefix+h]["group"]==null){return}var g=this.itemPull[this.idPrefix+h]["group"];if(this.checkEvent("onRadioClick")){if(this.callEvent("onRadioClick",[g,this.getRadioChecked(g),h,this.conf.ctx_zoneid,c])){this.setRadioChecked(g,h)}}else{this.setRadioChecked(g,h)}if(this.checkEvent("onClick")){this.callEvent("onClick",[h])}};dhtmlXMenuObject.prototype.getRadioChecked=function(h){var m=null;for(var g=0;g";return a};dhtmlXMenuObject.prototype._readLevel=function(h){var l="";for(var q in this.itemPull){if(this.itemPull[q]["parent"]==h){var c="";var g="";var s="";var o=String(this.itemPull[q]["id"]).replace(this.idPrefix,"");var n="";var r=(this.itemPull[q]["title"]!=""?' text="'+this.itemPull[q]["title"]+'"':"");var m="";if(this.itemPull[q]["type"]=="item"){if(this.itemPull[q]["imgen"]!=""){c=' img="'+this.itemPull[q]["imgen"]+'"'}if(this.itemPull[q]["imgdis"]!=""){g=' imgdis="'+this.itemPull[q]["imgdis"]+'"'}if(this.itemPull[q]["hotkey"]!=""){s=""+this.itemPull[q]["hotkey"]+""}}if(this.itemPull[q]["type"]=="separator"){n=' type="separator"'}else{if(this.itemPull[q]["state"]=="disabled"){m=' enabled="false"'}}if(this.itemPull[q]["type"]=="checkbox"){n=' type="checkbox"'+(this.itemPull[q]["checked"]?' checked="true"':"")}if(this.itemPull[q]["type"]=="radio"){n=' type="radio" group="'+this.itemPull[q]["group"]+'" '+(this.itemPull[q]["checked"]?' checked="true"':"")}l+="";l+=s;if(this.itemPull[q]["complex"]){l+=this._readLevel(q)}l+=""}}return l};dhtmlXMenuObject.prototype.enableEffect=function(g,l,h){this._menuEffect=(g=="opacity"||g=="slide"||g=="slide+"?g:false);this._pOpStyleIE=(navigator.userAgent.search(/MSIE\s[678]\.0/gi)>=0);for(var c in this.idPull){if(c.search(/polygon/)===0){this._pOpacityApply(c,(this._pOpStyleIE?100:1));this.idPull[c].style.height=""}}this._pOpMax=(typeof(l)=="undefined"?100:l)/(this._pOpStyleIE?1:100);this._pOpStyleName=(this._pOpStyleIE?"filter":"opacity");this._pOpStyleValue=(this._pOpStyleIE?"progid:DXImageTransform.Microsoft.Alpha(Opacity=#)":"#");this._pSlSteps=(this._pOpStyleIE?10:20);this._pSlTMTimeMax=h||50};dhtmlXMenuObject.prototype._showPolygonEffect=function(a){this._pShowHide(a,true)};dhtmlXMenuObject.prototype._hidePolygonEffect=function(a){this._pShowHide(a,false)};dhtmlXMenuObject.prototype._pOpacityApply=function(a,c){this.idPull[a].style[this._pOpStyleName]=String(this._pOpStyleValue).replace("#",c||this.idPull[a]._op)};dhtmlXMenuObject.prototype._pShowHide=function(a,c){if(!this.idPull){return}if(this.idPull[a]._tmShow!=null){if((this.idPull[a]._step_h>0&&c==true)||(this.idPull[a]._step_h<0&&c==false)){return}window.clearTimeout(this.idPull[a]._tmShow);this.idPull[a]._tmShow=null;this.idPull[a]._max_h=null}if(c==false&&(this.idPull[a].style.visibility=="hidden"||this.idPull[a].style.display=="none")){return}if(c==true&&this.idPull[a].style.display=="none"){this.idPull[a].style.visibility="hidden";this.idPull[a].style.display=""}if(this.idPull[a]._max_h==null){this.idPull[a]._max_h=parseInt(this.idPull[a].offsetHeight);this.idPull[a]._h=(c==true?0:this.idPull[a]._max_h);this.idPull[a]._step_h=Math.round(this.idPull[a]._max_h/this._pSlSteps)*(c==true?1:-1);if(this.idPull[a]._step_h==0){return}this.idPull[a]._step_tm=Math.round(this._pSlTMTimeMax/this._pSlSteps);if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[a].op_tm=this.idPull[a]._step_tm;this.idPull[a].op_step=(this._pOpMax/this._pSlSteps)*(c==true?1:-1);if(this._pOpStyleIE){this.idPull[a].op_step=Math.round(this.idPull[a].op_step)}this.idPull[a]._op=(c==true?0:this._pOpMax);this._pOpacityApply(a)}else{this.idPull[a]._op=(this._pOpStyleIE?100:1);this._pOpacityApply(a)}if(this._menuEffect.search(/slide/)===0){this.idPull[a].style.height="0px"}this.idPull[a].style.visibility="visible"}this._pEffectSet(a,this.idPull[a]._h+this.idPull[a]._step_h)};dhtmlXMenuObject.prototype._pEffectSet=function(g,c){if(!this.idPull){return}if(this.idPull[g]._tmShow){window.clearTimeout(this.idPull[g]._tmShow)}this.idPull[g]._h=Math.max(0,Math.min(c,this.idPull[g]._max_h));if(this._menuEffect.search(/slide/)===0){this.idPull[g].style.height=this.idPull[g]._h+"px"}c+=this.idPull[g]._step_h;if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[g]._op=Math.max(0,Math.min(this._pOpMax,this.idPull[g]._op+this.idPull[g].op_step));this._pOpacityApply(g)}if((this.idPull[g]._step_h>0&&c<=this.idPull[g]._max_h)||(this.idPull[g]._step_h<0&&c>=0)){var a=this;this.idPull[g]._tmShow=window.setTimeout(function(){a._pEffectSet(g,c)},this.idPull[g]._step_tm)}else{if(this._menuEffect.search(/slide/)===0){this.idPull[g].style.height=""}if(this.idPull[g]._step_h<0){this.idPull[g].style.visibility="hidden"}if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[g]._op=(this.idPull[g]._step_h<0?(this._pOpStyleIE?100:1):this._pOpMax);this._pOpacityApply(g)}this.idPull[g]._tmShow=null;this.idPull[g]._h=null;this.idPull[g]._max_h=null;this.idPull[g]._step_tm=null}};function dhtmlXRibbon(h){var g=this,c,a;this.conf={type:"ribbon",icons_path:(h&&h.icons_path)?h.icons_path:"",skin:"dhx_skyblue"};this._eventHandlers={};this._base=null;this._items={};this._tabbar=null;this.childIds=[];if(typeof(h)=="string"){a=h}else{if(h&&h.tagName){a=h}else{if(h&&h.parent){if(h.parent.tagName||typeof(h.parent)=="string"){a=h.parent}}}}this._doOnHighlight0=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].mouseover)=="function"){if(g.items[m.type].mouseover(m,g,o)!=true){return false}}if(!/dhxrb_highlight0/.test(l.className)){l.className+=" dhxrb_highlight0"}};this._doOffHighlight0=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].mouseout)=="function"){if(g.items[m.type].mouseout(m,g,o)!=true){return false}}if(/dhxrb_highlight1/.test(l.className)){l.className=l.className.replace(/\s?dhxrb_highlight1/,"")}if(/dhxrb_highlight0/.test(l.className)){l.className=l.className.replace(/\s?dhxrb_highlight0/,"")}};this._doOnHighlight1=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}g.callEvent("_showPopup",[m.id]);if(g.items[m.type]&&typeof(g.items[m.type].mousedown)=="function"){if(g.items[m.type].mousedown(m,g,o)!=true){return false}}if(!/dhxrb_highlight1/.test(l.className)){l.className+=" dhxrb_highlight1"}};this._doOffHighlight1=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].mouseup)=="function"){if(g.items[m.type].mouseup(m,g,o)!=true){return false}}if(/dhxrb_highlight1/.test(l.className)){l.className=l.className.replace(/\s?dhxrb_highlight1/,"")}};this._doOnClick=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].click)=="function"){g.items[m.type].click(m,g,o)}};this._doOnFocus=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}g.callEvent("_showPopup",[m.id]);if(g.items[m.type]&&typeof(g.items[m.type].focus)=="function"){g.items[m.type].focus(m,g,o)}};this._doOnBlur=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].blur)=="function"){g.items[m.type].blur(m,g,o)}};this._doOnChange=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].change)=="function"){g.items[m.type].change(m,g,o)}};this._doOnKeydown=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].keydown)=="function"){g.items[m.type].keydown(m,g,o)}};this._tabCustomApi={enable:function(o,n){var m=null,l=null;n=n||false;if(n!=true){m=g._items[this._idd];for(l in m.childIds){l=parseInt(l);g.enable(m.childIds[l])}}return g._tabOriginalApi.enable.apply(this,[o])},disable:function(o,n){var m=null,l=null;if(n!=false){m=g._items[this._idd];for(l in m.childIds){l=parseInt(l);g.disable(m.childIds[l])}}return g._tabOriginalApi.disable.apply(this,[o])},close:function(n){var m=g._items[this._idd],l;g._removeTab(m);g._tabOriginalApi.close.apply(this,[n]);for(l in g._tabOriginalApi){this[l]=null}}};this._attachEventTabbar=function(){this._tabbar.attachEvent("onSelect",function(){return g.callEvent("onSelect",arguments)});this._tabbar.attachEvent("onTabClick",function(){return g.callEvent("onTabClick",arguments)});this._tabbar.attachEvent("onTabClose",function(){return g.callEvent("onTabClose",arguments)})};if(typeof(a)=="string"){this._base=document.getElementById(a)}else{if(a&&a.tagName){this._base=a}else{this._base=document.createElement("div");this._base._dhx_remove=true;if(document.body.firstChild){document.body.insertBefore(this._base,document.body.firstChild)}else{document.body.appendChild(this._base)}}}c=dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||dhx4.skinDetect("dhtmlxribbon")||"dhx_skyblue";if(typeof(h)=="object"&&h.skin){c=h.skin}this.setSkin(c);dhx4._eventable(this);dhx4._enableDataLoading(this,"_renderData","_xmlToJson","ribbon",{struct:true});this.attachEvent("_onHeightChanged",function(){this.conf.inited=true});this._base.className+=" dhxrb_without_tabbar";this._base.innerHTML="
";if(h!=null){if(h.json){this.loadStruct(h.json,h.onload)}else{if(h.xml){this.loadStruct(h.xml,h.onload)}else{this._renderData(h)}}}this.unload=function(){var m=null,l=[];for(m in this.childIds){m=parseInt(m);l.push(this.childIds[m])}dhx4._enableDataLoading(this,null,null,null,"clear");dhx4._eventable(this,"clear");for(m in l){m=parseInt(m);if(this._items[l[m]].type=="tab"){this.tabs(l[m]).close(false)}else{this.removeItem(l[m])}}if(this._tabbar){this._tabbar.unload();this._tabbar=null}this._base.innerHTML="";if(this._base._dhx_remove){this._base.parentNode.removeChild(this._base)}else{this._base.className=this._base.className.replace(/\s?(dhtmlx|dhxrb)(\S*)/ig,"")}for(m in this){this[m]=null}g=null}}dhtmlXRibbon.prototype.setSizes=function(){if(this._tabbar!=null&&typeof(this.setSizes)=="function"){this._tabbar.setSizes()}};dhtmlXRibbon.prototype._renderData=function(c){var a=this._base.firstChild;if(c!=null){this.conf.icons_path=c.icons_path||this.conf.icons_path;if(c.tabs instanceof Array){this._base.className=this._base.className.replace(/\s?dhxrb_without_tabbar/i,"");a.className="dhxrb_with_tabbar";this._tabbar=new dhtmlXTabBar(a);this._attachEventTabbar();this._tabbar.setSkin(this.conf.skin);this.childIds=this._appendTabs(c.tabs)}else{if(c.items instanceof Array){if(!/\s?dhxrb_without_tabbar/i.test(this._base.className)){this._base.className+=" dhxrb_without_tabbar"}if(/\s?dhxrb_background_area/i.test(a.className)){a.className="dhxrb_background_area"}a.innerHTML="
";this.childIds=this._appendBlocks(c.items,a.firstChild)}}this.callEvent("_onHeightChanged",[])}};dhtmlXRibbon.prototype._xmlToJson=function(c){var a=c.lastChild||null,h={},g=[];if(a&&a.tagName=="ribbon"){g=this._convertXmlNodeListIntoObject(a.childNodes)}if(g[0]&&g[0].type&&g[0].type.toLowerCase()=="block"){h.items=g}else{h.tabs=g}return h};dhtmlXRibbon.prototype._convertXmlNodeListIntoObject=function(c){var g,a,m=[],h;a=c.length;for(g=0;g
"+h.conf.text+"
";if(typeof(this.afterRender)=="function"){this.afterRender(h)}if(h.conf.disable){this.disable(h)}return h},getText:function(a){return a.conf.text},setText:function(c,g){var a=c.base.childNodes[1];c.conf.text=g;a.innerHTML=g},mousedown:function(a,g,c){return true},click:function(a,g,c){if(c.button!=0){return false}g._callHandler(a.id,[a.id]);a.callEvent("onClick",[a.id]);return false},disable:function(c){var g=c.base.childNodes[0],a=c.base.childNodes[1];if(c.conf.imgdis){g.src=c.conf.icons_path+c.conf.imgdis;if(/\s?dhxrb_invisible/i.test(g.className)){g.className=g.className.replace(/\s?dhxrb_invisible/i,"")}}if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(c){var g=c.base.childNodes[0],a=c.base.childNodes[1];if(c.conf.img){g.src=c.conf.icons_path+c.conf.img}else{if(!/\s?dhxrb_invisible/i.test(g.className)){g.className+=" dhxrb_invisible"}}if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true}};dhtmlXRibbon.prototype.items.buttonTwoState={click:function(a,g,c){return false},afterRender:function(a){if(a.conf.state){this.setState(a,a.conf.state)}},mouseover:function(a){if(!/dhxrb_highlight0/.test(a.base.className)){a.base.className+=" dhxrb_highlight0"}return false},mouseout:function(a){if(/dhxrb_highlight0/.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_highlight0/,"")}return false},mousedown:function(a,g,c){g._callHandler(a.id,[a.id,!a.conf.state]);this.setState(a,!a.conf.state,true);return false},mouseup:function(a){return false},setState:function(a,c,g){g=g||false;c=dhx4.s2b(c);if(c){if(!/dhxrb_highlight1/.test(a.base.className)){a.base.className+=" dhxrb_highlight1"}}else{if(/dhxrb_highlight1/.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_highlight1/,"")}}a.conf.state=c;if(g){a.callEvent("onStateChange",[a.id,a.conf.state])}}};dhtmlXRibbon.prototype.items.buttonSegment={click:function(a,g,c){return false},mousedown:function(a,g,c){this.setState(a,g,true);return false},callAfterInit:function(a){if(a.conf.state||dhtmlXRibbon.prototype.items.buttonSegment._getSelectedNeighbor(a,this)==null){if(a.conf.state){a.conf.state=false}dhtmlXRibbon.prototype.items.buttonSegment.setState(a,this,false)}},afterRender:function(){},setState:function(a,l,h){h=h||false;var g=null,c=dhx4.s2b(a.conf.state);if(c==false){g=this._getSelectedNeighbor(a,l);if(g!=null){this._unSelect(g)}if(!/dhxrb_highlight1/.test(a.base.className)){a.base.className+=" dhxrb_highlight1"}a.conf.state=true;if(h){l._callHandler(a.id,[a.id,(g?g.id:null)]);l.callEvent("onStateChange",[a.id,(g?g.id:null)])}}},remove:function(g,n){var l=dhx4.s2b(g.conf.state),m=null,a=0,c=n._items[g.parentId],h;if(l){while(c.childIds[a]&&m==null){h=n._items[c.childIds[a]];if(h.type=="buttonSegment"&&h!=g){m=h}a++}if(m){this.setState(m,n)}}},_unSelect:function(a){var c=dhx4.s2b(a.conf.state);if(c){if(/dhxrb_highlight1/.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_highlight1/,"")}a.conf.state=false}},_getSelectedNeighbor:function(h,o){var g=o._items[h.parentId],c,a,n,m=null;a=g.childIds.length;for(c=0;c ";c.menu=null;this.itemCollection.push(c);this._attachEventToWindow();a=null},setText:function(a,g){var c=a.base.childNodes[1].lastChild;a.conf.text=g;a.base.childNodes[1].innerHTML=g;a.base.childNodes[1].appendChild(c)},_attachEventToWindow:function(){if(this._isAttachedEventInWindow==false){if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousedown",this._hideAllMenus,false)}else{document.body.attachEvent("onmousedown",this._hideAllMenus)}this._isAttachedEventInWindow=true}},_detachEventFromWindow:function(){if(typeof(window.addEventListener)=="function"){document.body.removeEventListener("mousedown",this._hideAllMenus,false)}else{document.body.detachEvent("onmousedown",this._hideAllMenus)}this._isAttachedEventInWindow=false},_hideAllMenus:function(l){l=l||event;var g=l.target||l.srcElement;var a=true;while(g!=null&&a==true){if(g.className!=null&&/SubLevelArea_Polygon/i.test(g.className)){a=false}else{g=g.parentNode}}if(a==false){return}var c=dhtmlXRibbon.prototype.items.buttonSelect.itemCollection;for(var n in c){var h=c[n];if(h.menu instanceof dhtmlXMenuObject){if(h._skipHiding){h._skipHiding=false}else{dhtmlXRibbon.prototype.items.buttonSelect.hideMenu(h)}}}},mousedown:function(a,g,c){a._skipHiding=true;this.showMenu(a);return false},mouseup:function(a){return false},click:function(){},setState:function(){},showMenu:function(c){var a=dhx4.absLeft(c.base),g=dhx4.absTop(c.base)+c.base.offsetHeight;if(!(c.menu instanceof dhtmlXMenuObject)){c.menu=new dhtmlXMenuObject({parent:c.base,icons_path:c.conf.icons_path,context:true,items:c.conf.items,skin:c.conf.skin});if(c.conf.data){c.menu.loadStruct(c.conf.data);delete c.conf.data}c.menu.setAutoHideMode(false);c.menu.attachEvent("onHide",function(h){if(h==null){dhtmlXRibbon.prototype.items.buttonSelect._doOnHideMenu(c)}});c.menu.attachEvent("onShow",function(h){if(h==null){dhtmlXRibbon.prototype.items.buttonSelect._doOnShowMenu(c)}});c.menu.attachEvent("onClick",function(h){c.callEvent("onClick",[h])});c.base.oncontextmenu=function(){return false};dhtmlXRibbon.prototype.items.buttonSelect.showMenu(c)}else{c.menu.showContextMenu(a,g)}},hideMenu:function(a){if(a.menu instanceof dhtmlXMenuObject){a.menu.hideContextMenu()}},remove:function(c){var g,a;if(c.menu instanceof dhtmlXMenuObject){c.menu.unload();c.menu=null}c.base.oncontextmenu=null;g=dhtmlXRibbon.prototype._indexOf(dhtmlXRibbon.prototype.items.buttonSelect.itemCollection,c);if(g!=-1){dhtmlXRibbon.prototype.items.buttonSelect.itemCollection.splice(g,1)}if(dhtmlXRibbon.prototype.items.buttonSelect.itemCollection.length==0){this._detachEventFromWindow()}},setSkin:function(a,c){if(a.menu instanceof dhtmlXMenuObject){a.menu.setSkin(c)}},_doOnHideMenu:function(a){if(a._skipHiding){a._skipHiding=false}else{if(/dhxrb_highlight1/.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_highlight1/,"")}}},_doOnShowMenu:function(a){if(!/dhxrb_highlight1/.test(a.base.className)){a.base.className+=" dhxrb_highlight1"}}};dhtmlXRibbon.prototype.items.group={render:function(c,a){var g,h;h={base:c,id:a.id,type:a.type,conf:{disable:false,skin:a.skin},childIds:[]};c.className="dhxrb_group";for(g in a){if(g=="id"||g=="onclick"||g=="type"){continue}h.conf[g]=a[g]}return h},callAfterInit:function(m){this._detachEventFromItem(m.base);var h,a,n=m.conf.list,o,g,c;a=(n)?n.length:0;for(h=0;h
"+h.conf.text+"
";if(typeof(this.afterRender)=="function"){this.afterRender(h)}if(h.conf.disable){this.disable(h)}if(h.conf.width){this.setWidth(h,h.conf.width)}if(h.conf.value){this.setValue(h,h.conf.value)}return h},callAfterInit:function(c){var a=c.base.childNodes[0];this._detachEventFromItem(c.base);this._attachEventsToInput(a)},setText:dhtmlXRibbon.prototype.items.button.setText,getText:dhtmlXRibbon.prototype.items.button.getText,change:function(c){var a=c.base.childNodes[0];c.conf.value=a.value},keydown:function(c,h,g){if(g.keyCode==13){var a=c.base.childNodes[0];c.conf.value=a.value;h.callEvent("onEnter",[c.id,c.conf.value])}},remove:function(c,g){var a=c.base.childNodes[0];g._detachEventsFromInput(a)},getValue:function(c){var a=c.base.childNodes[0],g;g=a.value;a=undefined;return g},setValue:function(c,g){var a=c.base.childNodes[0],g;a.value=g;c.conf.value=g},setWidth:function(c,g){var a=c.base.childNodes[0];a.style.width=parseInt(g)+"px"},disable:function(g){var c=g.base.childNodes[0],a=g.base.childNodes[1];c.disabled=true;if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(g){var c=g.base.childNodes[0],a=g.base.childNodes[1];c.disabled=false;if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true}};dhtmlXRibbon.prototype.items.checkbox={render:function(c,a){var g,h;h={base:c,id:a.id,type:a.type,conf:{text:"",text_pos:(a.isbig)?"bottom":"right",disable:false,checked:false}};for(g in a){if(g=="id"||g=="onclick"||g=="type"){continue}h.conf[g]=a[g]}c.innerHTML="
"+h.conf.text+"
";if(typeof(this.afterRender)=="function"){this.afterRender(h)}if(h.conf.checked){this.check(h)}return h},callAfterInit:function(a){if(a.conf.disable){this.disable(a.id)}},setText:dhtmlXRibbon.prototype.items.button.setText,getText:dhtmlXRibbon.prototype.items.button.getText,mousedown:function(a){return false},mouseup:function(a){return false},click:function(a,g,c){if(c.button!=0){return false}if(a.type=="checkbox"){if(a.conf.checked){this.uncheck(a,true)}else{this.check(a,true)}}},check:function(a,c){c=c||false;if(a.type!="checkbox"){return}a.conf.checked=true;if(!/\s?dhxrb_checked/i.test(a.base.className)){a.base.className+=" dhxrb_checked"}if(c){a.callEvent("onCheck",[a.id,a.conf.checked])}},uncheck:function(a,c){c=c||false;if(a.type!="checkbox"){return}a.conf.checked=false;if(/\s?dhxrb_checked/i.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_checked/i,"")}if(c){a.callEvent("onCheck",[a.id,a.conf.checked])}},disable:function(a){return true},enable:function(a){return true}};dhtmlXRibbon.prototype.items.text={render:function(a,h){var g={base:a,id:h.id,type:h.type,conf:{text:""}};for(var c in h){if(c=="id"||c=="type"){continue}g.conf[c]=h[c]}a.innerHTML="
"+g.conf.text+"
";if(typeof(this.afterRender)=="function"){this.afterRender(g)}return g},callAfterInit:function(a){this._detachEventFromItem(a.base)},getText:function(a){return a.conf.text},setText:function(a,c){a.conf.text=c;a.base.innerHTML=c}};dhtmlXRibbon.prototype.items.buttonCombo={render:function(a,c){var g,h,l={};h={base:a,id:c.id,type:c.type,conf:{text:"",text_pos:"right",width:140,skin:c.skin}};for(g in c){if(g=="id"||g=="onclick"||g=="type"){continue}h.conf[g]=c[g]}for(g in h.conf){if(g=="text"||g=="text_pos"||g=="disable"||g=="data"){continue}l[g]=h.conf[g]}h.base.className+=" dhxrb_buttoncombo_cont";h.base.innerHTML="
"+h.conf.text+"
";l.parent=h.base.firstChild;h.combo=new dhtmlXCombo(l);h.combo.setSkin(l.skin);h.combo.attachEvent("onChange",function(m,n){h._callHandler(h.id,[m,n]);h.callEvent("onSelectOption",[h.id,m,n])});if(h.conf.data){h.combo.load(h.conf.data);delete h.conf.data}if(typeof(this.afterRender)=="function"){this.afterRender(h)}if(h.conf.disable){this.disable(h)}return h},callAfterInit:function(a){this._detachEventFromItem(a.base)},disable:function(c){var a=c.base.lastChild;if(c.combo instanceof dhtmlXCombo){c.combo.disable()}if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(c){var a=c.base.lastChild;if(c.combo instanceof dhtmlXCombo){c.combo.enable()}if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true},remove:function(a){if(a.combo instanceof dhtmlXCombo){a.combo.unload();a.combo=null}},getValue:function(a){var c=null;if(a.combo instanceof dhtmlXCombo){c=a.combo.getSelectedValue()}return c},setValue:function(a,c){if(a.combo instanceof dhtmlXCombo){a.combo.setComboValue(c)}},setSkin:function(a,c){if(a.combo instanceof dhtmlXCombo){a.combo.setSkin(c)}}};dhtmlXRibbon.prototype.items.slider={render:function(a,l){var g,h,c={};h={base:a,id:l.id,type:l.type,conf:{text:"",text_pos:"right",size:150,vertical:false,min:0,max:99,value:0,step:1,margin:10,disabled:false,enableTooltip:false}};for(g in l){if(g=="id"||g=="onclick"||g=="type"){continue}h.conf[g]=l[g]}for(g in h.conf){if(g=="text"||g=="text_pos"||g=="isbig"){continue}c[g]=h.conf[g]}h.base.innerHTML="
"+h.conf.text+"
";c.parent=h.base.firstChild.firstChild;h.slider=new dhtmlXSlider(c);if(typeof(this.afterRender)=="function"){this.afterRender(h)}if(h.conf.disable){this.disable(h)}h.slider.attachEvent("onChange",function(m){h._callHandler(h.id,[m]);h.callEvent("onValueChange",[h.id,m])});return h},callAfterInit:function(a){this._detachEventFromItem(a.base)},setSkin:function(a,c){if(a.slider instanceof dhtmlXSlider){a.slider.setSkin(c)}},disable:function(c){var a=c.base.childNodes[1];if(c.slider instanceof dhtmlXSlider){c.slider.disable()}if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(c){var a=c.base.childNodes[1];if(c.slider instanceof dhtmlXSlider){c.slider.enable()}if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true},remove:function(a){if(a.slider instanceof dhtmlXSlider){a.slider.unload();a.slider=null}},getValue:function(a){var c=null;if(a.slider instanceof dhtmlXSlider){c=a.slider.getValue()}return c},setValue:function(a,c){if(a.slider instanceof dhtmlXSlider){a.slider.setValue(c)}}};dhtmlXRibbon.prototype.items._extends=function(g,c){var a;for(a in c){g[a]=g[a]||c[a]}return g};dhtmlXRibbon.prototype._addNewLevel=function(g){var c,a;if(g.conf.mode=="rows"){c=g.contForItems.lastChild;if(c&&/dhxrb_block_rows/i.test(c.className)&&(c.childNodes.length<3)){a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}else{c=document.createElement("div");c.className="dhxrb_block_rows";g.contForItems.appendChild(c);a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}}else{var a=document.createElement("div");a.className="dhxrb_3rows_block";g.contForItems.appendChild(a)}};dhtmlXRibbon.prototype._attachEventForItem=function(a){if(typeof(window.addEventListener)=="function"){a.addEventListener("mouseover",this._doOnHighlight0,false);a.addEventListener("mouseout",this._doOffHighlight0,false);a.addEventListener("mousedown",this._doOnHighlight1,false);a.addEventListener("mouseup",this._doOffHighlight1,false);a.addEventListener("click",this._doOnClick,false)}else{a.attachEvent("onmouseover",this._doOnHighlight0);a.attachEvent("onmouseout",this._doOffHighlight0);a.attachEvent("onmousedown",this._doOnHighlight1);a.attachEvent("onmouseup",this._doOffHighlight1);a.attachEvent("onclick",this._doOnClick)}};dhtmlXRibbon.prototype._detachEventFromItem=function(a){if(typeof(window.addEventListener)=="function"){a.removeEventListener("mouseover",this._doOnHighlight0,false);a.removeEventListener("mouseout",this._doOffHighlight0,false);a.removeEventListener("mousedown",this._doOnHighlight1,false);a.removeEventListener("mouseup",this._doOffHighlight1,false);a.removeEventListener("click",this._doOnClick,false)}else{a.detachEvent("onmouseover",this._doOnHighlight0);a.detachEvent("onmouseout",this._doOffHighlight0);a.detachEvent("onmousedown",this._doOnHighlight1);a.detachEvent("onmouseup",this._doOffHighlight1);a.detachEvent("onclick",this._doOnClick)}};dhtmlXRibbon.prototype._attachEventsToInput=function(a){if(typeof(window.addEventListener)=="function"){a.addEventListener("focus",this._doOnFocus,false);a.addEventListener("blur",this._doOnBlur,false);a.addEventListener("change",this._doOnChange,false);a.addEventListener("keydown",this._doOnKeydown,false)}else{a.attachEvent("onfocus",this._doOnFocus);a.attachEvent("onblur",this._doOnBlur);a.attachEvent("onchange",this._doOnChange);a.attachEvent("onkeydown",this._doOnKeydown)}};dhtmlXRibbon.prototype._detachEventsFromInput=function(a){if(typeof(window.addEventListener)=="function"){a.removeEventListener("focus",this._doOnFocus,false);a.removeEventListener("blur",this._doOnBlur,false);a.removeEventListener("change",this._doOnChange,false);a.removeEventListener("keydown",this._doOnKeydown,false)}else{a.detachEvent("onfocus",this._doOnFocus);a.detachEvent("onblur",this._doOnBlur);a.detachEvent("onchange",this._doOnChange);a.detachEvent("onkeydown",this._doOnKeydown)}};dhtmlXRibbon.prototype._getContainerForSmallItem=function(g){var c=g.contForItems.lastChild,a=null;if(g.conf.mode=="rows"){if(c&&/\s?dhxrb_block_rows/i.test(c.className)){a=c.lastChild;if(!a){a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}}else{c=document.createElement("div");c.className="dhxrb_block_rows";g.contForItems.appendChild(c);a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}}else{if(c&&/dhxrb_3rows_block/i.test(c.className)&&(c.childNodes.length<3)){a=c}else{a=document.createElement("div");a.className="dhxrb_3rows_block";g.contForItems.appendChild(a)}}return a};dhtmlXRibbon.prototype._findItemByNode=function(a){while(a&&!a._dhx_ribbonId){a=a.parentNode}return a};dhtmlXRibbon.prototype._indexOf=function(a,h){var g,c;c=a.length;for(g=0;g0){this.cont.removeChild(this.cont.childNodes[0])}c=null;this.cont.dir="ltr";this.base=document.createElement("DIV");this.base.className="dhxtoolbar_float_left";this.cont.appendChild(this.base);if(window.dhx4.isIPad){this.cont.ontouchstart=function(h){h=h||event;if((String(h.target.tagName||"").toLowerCase()=="input")){return true}if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}h.cancelBubble=true;return false}}this.setSkin(this.conf.skin);this.objPull={};this.anyUsed="none";this._genStr=function(h){var l="";var n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var m=0;m0){l.insertBefore(h,l.childNodes[0])}else{l.appendChild(h)}return h};this._setItemImage=function(n,l,h){if(h==true){n.imgEn=l}else{n.imgDis=l}if((!n.state&&h==true)||(n.state&&h==false)){return}var m=this._getObj(n.obj,"img");if(m==null){m=this._addImgObj(n.obj)}m.src=this.conf.icons_path+l};this._clearItemImage=function(m,h){if(h==true){m.imgEn=""}else{m.imgDis=""}if((!m.state&&h==true)||(m.state&&h==false)){return}var l=this._getObj(m.obj,"img");if(l!=null){l.parentNode.removeChild(l)}};this._setItemText=function(h,m){var l=this._getObj(h.obj,"div");if(m==null||m.length==0){if(l!=null){l.parentNode.removeChild(l)}return}if(l==null){l=document.createElement("DIV");l.className="dhxtoolbar_text";h.obj.appendChild(l)}l.innerHTML=m};this._getItemText=function(h){var l=this._getObj(h.obj,"div");if(l!=null){return l.innerHTML}return""};this._enableItem=function(l){if(l.state){return}l.state=true;if(this.objPull[l.id]["type"]=="buttonTwoState"&&this.objPull[l.id]["obj"]["pressed"]==true){l.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres";l.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}else{l.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";l.obj.renderAs=l.obj.className}if(l.arw){l.arw.className=String(l.obj.className).replace("btn","arw")}var h=this._getObj(l.obj,"img");if(l.imgEn!=""){if(h==null){h=this._addImgObj(l.obj)}h.src=this.conf.icons_path+l.imgEn}else{if(h!=null){h.parentNode.removeChild(h)}}};this._disableItem=function(l){if(!l.state){return}l.state=false;l.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.objPull[l.id]["type"]=="buttonTwoState"&&l.obj.pressed?"pres_":"")+"dis";l.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";if(l.arw){l.arw.className=String(l.obj.className).replace("btn","arw")}var h=this._getObj(l.obj,"img");if(l.imgDis!=""){if(h==null){h=this._addImgObj(l.obj)}h.src=this.conf.icons_path+l.imgDis}else{if(h!=null){h.parentNode.removeChild(h)}}if(l.polygon!=null){if(l.polygon.style.display!="none"){window.dhx4.zim.clear(l.polygon._idd);l.polygon.style.display="none";if(l.polygon._ie6cover){l.polygon._ie6cover.style.display="none"}if(this.conf.skin=="dhx_terrace"){this._improveTerraceButtonSelect(l.id,true)}}}this.anyUsed="none"};this.clearAll=function(){for(var h in this.objPull){this._removeItem(String(h).replace(this.idPrefix,""))}};this._doOnClick=function(h){if(a&&a.forEachItem){a.forEachItem(function(m){if(a.objPull[a.idPrefix+m]["type"]=="buttonSelect"){var l=a.objPull[a.idPrefix+m];if(l.arw._skip===true){l.arw._skip=false}else{if(l.polygon.style.display!="none"){l.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";l.obj.className=l.obj.renderAs;l.arw.className=String(l.obj.renderAs).replace("btn","arw");a.anyUsed="none";window.dhx4.zim.clear(l.polygon._idd);l.polygon.style.display="none";if(l.polygon._ie6cover){l.polygon._ie6cover.style.display="none"}if(a.conf.skin=="dhx_terrace"){a._improveTerraceButtonSelect(l.id,true)}}}}})}};if(window.dhx4.isIPad){document.addEventListener("touchstart",this._doOnClick,false)}else{if(typeof(window.addEventListener)!="undefined"){window.addEventListener("mousedown",this._doOnClick,false)}else{document.body.attachEvent("onmousedown",this._doOnClick)}}if(this.conf.icons_size_autoload!=null){this.setIconSize(this.conf.icons_size_autoload);this.conf.icons_size_autoload=null}if(this.conf.items_autoload!=null){this.loadStruct(this.conf.items_autoload,this.conf.onload_autoload);this.conf.items_autoload=null}else{if(this.conf.json_autoload!=null){this.loadStruct(this.conf.json_autoload,this.conf.onload_autoload);this.conf.json_autoload=null}else{if(this.conf.xml_autoload!=null){this.loadStruct(this.conf.xml_autoload,this.conf.onload_autoload);this.conf.xml_autoload=null}}}if(this.conf.align_autostart!=this.conf.align){this.setAlign(this.conf.align_autostart);this.conf.align_autostart=null}return this}dhtmlXToolbarObject.prototype.addSpacer=function(g){var c=this.idPrefix+g;if(this._spacer!=null){if(this._spacer.idd==g){return}if(this._spacer==this.objPull[c].obj.parentNode){var a=true;while(a){var n=this._spacer.childNodes[0].idd;this.base.appendChild(this._spacer.childNodes[0]);if(n==g||this._spacer.childNodes.length==0){if(this.objPull[c].arw!=null){this.base.appendChild(this.objPull[c].arw)}a=false}}this._spacer.idd=g;this._fixSpacer();return}if(this.base==this.objPull[c].obj.parentNode){var a=true;var m=(this.objPull[c].arw!=null);while(a){var h=this.base.childNodes.length-1;if(m==true){if(this.base.childNodes[h]==this.objPull[c].arw){a=false}}if(this.base.childNodes[h].idd==g){a=false}if(a){if(this._spacer.childNodes.length>0){this._spacer.insertBefore(this.base.childNodes[h],this._spacer.childNodes[0])}else{this._spacer.appendChild(this.base.childNodes[h])}}}this._spacer.idd=g;this._fixSpacer();return}}else{var l=null;for(var h=0;hl+1){this._spacer.appendChild(this.base.childNodes[l+1])}this.cont.appendChild(this._spacer);this._fixSpacer()}}if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype.removeSpacer=function(){if(!this._spacer){return}while(this._spacer.childNodes.length>0){this.base.appendChild(this._spacer.childNodes[0])}this._spacer.parentNode.removeChild(this._spacer);this._spacer=null;if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype._fixSpacer=function(){if(typeof(window.addEventListener)=="undefined"&&this._spacer!=null){this._spacer.style.borderLeft="1px solid #a4bed4";var a=this._spacer;window.setTimeout(function(){a.style.borderLeft="0px solid #a4bed4";a=null},1)}};dhtmlXToolbarObject.prototype.getType=function(g){var h=this.getParentId(g);if(h!=null){var c=null;var a=this.objPull[this.idPrefix+h]._listOptions[g];if(a!=null){if(a.sep!=null){c="buttonSelectSeparator"}else{c="buttonSelectButton"}}return c}else{if(this.objPull[this.idPrefix+g]==null){return null}return this.objPull[this.idPrefix+g]["type"]}};dhtmlXToolbarObject.prototype.getTypeExt=function(c){var a=this.getType(c);if(a=="buttonSelectButton"||a=="buttonSelectSeparator"){if(a=="buttonSelectButton"){a="button"}else{a="separator"}return a}return null};dhtmlXToolbarObject.prototype.inArray=function(g,c){for(var a=0;a0){h.obj.removeChild(h.obj.childNodes[0])}h.obj.parentNode.removeChild(h.obj);h.obj=null;h.id=null;h.type=null;h.state=null;h.enableItem=null;h.disableItem=null;h.isEnabled=null;h.setItemToolTipTemplate=null;h.getItemToolTipTemplate=null;h.setMaxValue=null;h.setMinValue=null;h.getMaxValue=null;h.getMinValue=null;h.setValue=null;h.getValue=null;h.showItem=null;h.hideItem=null;h.isVisible=null}if(g=="separator"){h.obj.onselectstart=null;h.obj.idd=null;h.obj.parentNode.removeChild(h.obj);h.obj=null;h.id=null;h.type=null;h.showItem=null;h.hideItem=null;h.isVisible=null}if(g=="text"){h.obj.onselectstart=null;h.obj.idd=null;h.obj.parentNode.removeChild(h.obj);h.obj=null;h.id=null;h.type=null;h.showItem=null;h.hideItem=null;h.isVisible=null;h.setWidth=null;h.setItemText=null;h.getItemText=null}g=null;h=null;this.objPull[this.idPrefix+l]=null;delete this.objPull[this.idPrefix+l]};(function(){var h="addListOption,removeListOption,showListOption,hideListOption,isListOptionVisible,enableListOption,disableListOption,isListOptionEnabled,setListOptionPosition,getListOptionPosition,setListOptionText,getListOptionText,setListOptionToolTip,getListOptionToolTip,setListOptionImage,getListOptionImage,clearListOptionImage,forEachListOption,getAllListOptions,setListOptionSelected,getListOptionSelected".split(",");var c=function(l){return function(s,n,m,r,q,o){s=this.idPrefix+s;if(this.objPull[s]==null){return}if(this.objPull[s]["type"]!="buttonSelect"){return}return this.objPull[s][l].call(this.objPull[s],n,m,r,q,o)}};for(var g=0;g":""),(c.text!=null?"
"+c.text+"
":""));var g=this;this.obj.onselectstart=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){this.allowClick=true;if(g.state==false){return}if(a.anyUsed!="none"){return}this.className="dhx_toolbar_btn dhxtoolbar_btn_over";this.renderAs=this.className};this.obj._doOnMouseOut=function(){this.allowClick=false;if(g.state==false){return}if(a.anyUsed!="none"){return}this.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.renderAs=this.renderAs};this.obj.onclick=function(l){if(g.state==false){return}if(this.allowClick==false){return}l=l||event;var m=this.idd.replace(a.idPrefix,"");if(this.extAction){try{window[this.extAction](m)}catch(l){}}if(a&&a.callEvent){a.callEvent("onClick",[m])}};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(l){if(g.state==false){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}l.cancelBubble=true;return false}if(a.anyUsed!="none"){return}a.anyUsed=this.idd;this.className="dhx_toolbar_btn dhxtoolbar_btn_pres";this.pressed=true;this.onmouseover=function(){this._doOnMouseOver()};this.onmouseout=function(){a.anyUsed="none";this._doOnMouseOut()};return false};this.obj[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(m){if(g.state==false){return}if(a.anyUsed!="none"){if(a.anyUsed!=this.idd){return}}var l=a.anyUsed;this._doOnMouseUp();if(window.dhx4.isIPad&&l!="none"){a.callEvent("onClick",[this.idd.replace(a.idPrefix,"")])}};if(window.dhx4.isIPad){this.obj.ontouchmove=function(l){this._doOnMouseUp()}}this.obj._doOnMouseUp=function(){a.anyUsed="none";this.className=this.renderAs;this.pressed=false};this.obj._doOnMouseUpOnceAnywhere=function(){this._doOnMouseUp();this.onmouseover=function(){this._doOnMouseOver()};this.onmouseout=function(){this._doOnMouseOut()}};a.base.appendChild(this.obj);this.enableItem=function(){a._enableItem(this)};this.disableItem=function(){a._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setItemText=function(l){a._setItemText(this,l)};this.getItemText=function(){return a._getItemText(this)};this.setItemImage=function(l){a._setItemImage(this,l,true)};this.clearItemImage=function(){a._clearItemImage(this,true)};this.setItemImageDis=function(l){a._setItemImage(this,l,false)};this.clearItemImageDis=function(){a._clearItemImage(this,false)};this.setItemToolTip=function(l){this.obj.title=l};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._buttonSelectObject=function(g,m,l){this.id=g.idPrefix+m;this.state=(l.enabled!=null?(l.enabled=="true"?true:false):true);this.imgEn=(l.img||"");this.imgDis=(l.imgdis||"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.mode=(l.mode||"button");if(this.mode=="select"){this.openAll=true;this.renderSelect=false;if(!l.text||l.text.length==0){l.text=" "}}else{this.openAll=(window.dhx4.s2b(l.openAll)==true);this.renderSelect=(l.renderSelect==null?true:window.dhx4.s2b(l.renderSelect))}this.maxOpen=(!isNaN(l.maxOpen?l.maxOpen:"")?l.maxOpen:null);this._maxOpenTest=function(){if(!isNaN(this.maxOpen)){if(!g._sbw){var o=document.createElement("DIV");o.className="dhxtoolbar_maxopen_test";document.body.appendChild(o);var n=document.createElement("DIV");n.className="dhxtoolbar_maxopen_test2";o.appendChild(n);g._sbw=o.offsetWidth-n.offsetWidth;o.removeChild(n);n=null;document.body.removeChild(o);o=null}}};this._maxOpenTest();this.obj=document.createElement("DIV");this.obj.allowClick=false;this.obj.extAction=(l.action||null);this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=(l.hidden!=null?"none":"");this.obj.renderAs=this.obj.className;this.obj.onselectstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};this.obj.idd=String(m);this.obj.title=(l.title||"");this.obj.pressed=false;this.callEvent=false;this.obj.innerHTML=g._rtlParseBtn((this.img!=""?"":""),(l.text!=null?"
"+l.text+"
":""));g.base.appendChild(this.obj);this.arw=document.createElement("DIV");this.arw.className="dhx_toolbar_arw dhxtoolbar_btn_"+(this.state?"def":"dis");this.arw.style.display=this.obj.style.display;this.arw.innerHTML="
 
";this.arw.title=this.obj.title;this.arw.onselectstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};g.base.appendChild(this.arw);var a=this;this.obj.onmouseover=function(n){n=n||event;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over";a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw")};this.obj.onmouseout=function(){a.obj.allowClick=false;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");a.callEvent=false};this.arw.onmouseover=this.obj.onmouseover;this.arw.onmouseout=this.obj.onmouseout;if(this.openAll==true){}else{this.obj.onclick=function(n){n=n||event;if(!a.obj.allowClick){return}if(!a.state){return}if(g.anyUsed!="none"){return}var o=a.obj.idd.replace(g.idPrefix,"");if(a.obj.extAction){try{window[a.obj.extAction](o)}catch(n){}}g.callEvent("onClick",[o])};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(n){n=n||event;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.allowClick=true;a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_pres";a.callEvent=true};this.obj[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(n){n=n||event;n.cancelBubble=true;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");if(window.dhx4.isIPad&&a.callEvent){var o=a.obj.idd.replace(g.idPrefix,"");g.callEvent("onClick",[o])}}}if(window.dhx4.isIPad){this.obj.ontouchmove=this.obj.onmouseout}this.arw[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(q){q=q||event;var x=(this.className.indexOf("dhx_toolbar_arw")===0?this:this.nextSibling);if(x._skip){q=q||event;q.cancelBubble=true}else{x._skip=true}x=null;if(!a.state){return}if(g.anyUsed==a.obj.idd){a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");g.anyUsed="none";window.dhx4.zim.clear(a.polygon._idd);a.polygon.style.display="none";if(a.polygon._ie6cover){a.polygon._ie6cover.style.display="none"}if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(a.id,true)}}else{if(g.anyUsed!="none"){if(g.objPull[g.idPrefix+g.anyUsed]["type"]=="buttonSelect"){var w=g.objPull[g.idPrefix+g.anyUsed];if(w.polygon.style.display!="none"){w.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";w.obj.className=w.obj.renderAs;w.arw.className=String(a.obj.renderAs).replace("btn","arw");window.dhx4.zim.clear(w.polygon._idd);w.polygon.style.display="none";if(w.polygon._ie6cover){w.polygon._ie6cover.style.display="none"}if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(w.id,true)}}}}a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_over";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_pres";g.anyUsed=a.obj.idd;a.polygon.style.top="0px";a.polygon.style.visibility="hidden";a.polygon.style.zIndex=window.dhx4.zim.reserve(a.polygon._idd);a.polygon.style.display="";if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(a.id,false)}a._fixMaxOpenHeight(a.maxOpen||null);g._autoDetectVisibleArea();var r=window.dhx4.absTop(a.obj)+a.obj.offsetHeight+g.conf.sel_ofs_y;var u=a.polygon.offsetHeight;if(r+u>g.tY2){var s=(a.maxOpen!=null?Math.floor((g.tY2-r)/22):0);if(s>=1){a._fixMaxOpenHeight(s)}else{r=window.dhx4.absTop(a.obj)-u-g.conf.sel_ofs_y;if(r<0){r=0}}}a.polygon.style.top=r+"px";if(g.rtl){a.polygon.style.left=window.dhx4.absLeft(a.obj)+a.obj.offsetWidth-a.polygon.offsetWidth+g.conf.sel_ofs_x+"px"}else{var o=document.body.scrollLeft;var n=o+(window.innerWidth||document.body.clientWidth);var v=window.dhx4.absLeft(a.obj)+g.conf.sel_ofs_x;if(v+a.polygon.offsetWidth>n){v=window.dhx4.absLeft(a.arw)+a.arw.offsetWidth-a.polygon.offsetWidth}a.polygon.style.left=Math.max(v,5)+"px"}a.polygon.style.visibility="visible";if(a.polygon._ie6cover){a.polygon._ie6cover.style.left=a.polygon.style.left;a.polygon._ie6cover.style.top=a.polygon.style.top;a.polygon._ie6cover.style.width=a.polygon.offsetWidth+"px";a.polygon._ie6cover.style.height=a.polygon.offsetHeight+"px";a.polygon._ie6cover.style.display=""}}return false};this.arw.onclick=function(n){n=n||event;n.cancelBubble=true};this.arw[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(n){n=n||event;n.cancelBubble=true};if(this.openAll===true){this.obj.onclick=this.arw.onclick;this.obj.onmousedown=this.arw.onmousedown;this.obj.onmouseup=this.arw.onmouseup;if(window.dhx4.isIPad){this.obj.ontouchstart=this.arw.ontouchstart;this.obj.ontouchend=this.arw.ontouchend}}this.obj.iddPrefix=g.idPrefix;this._listOptions={};this._fixMaxOpenHeight=function(s){var r="auto";var q=false;if(s!==null){var o=0;for(var n in this._listOptions){o++}if(o>s){this._ph=22*s;r=this._ph+"px"}else{q=true}}this.polygon.style.width="auto";this.polygon.style.height="auto";if(!q&&a.maxOpen!=null){this.polygon.style.width=this.p_tbl.offsetWidth+g._sbw+"px";this.polygon.style.height=r}};this._separatorButtonSelectObject=function(q,n,o){this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.className="tr_sep";this.obj.tr.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}return false};this.obj.td=document.createElement("TD");this.obj.td.colSpan="2";this.obj.td.className="td_btn_sep";this.obj.td.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}return false};if(isNaN(o)){o=a.p_tbody.childNodes.length+1}else{if(o<1){o=1}}if(o>a.p_tbody.childNodes.length){a.p_tbody.appendChild(this.obj.tr)}else{a.p_tbody.insertBefore(this.obj.tr,a.p_tbody.childNodes[o-1])}this.obj.tr.appendChild(this.obj.td);this.obj.sep=document.createElement("DIV");this.obj.sep.className="btn_sep";this.obj.sep.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}return false};this.obj.td.appendChild(this.obj.sep);a._listOptions[q]=this.obj;return this};this._buttonButtonSelectObject=function(s,q,r){var o=true;if(typeof(q.enabled)!="undefined"){o=window.dhx4.s2b(q.enabled)}else{if(typeof(q.disabled)!="undefined"){o=window.dhx4.s2b(q.disabled)}}this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.en=o;this.obj.tr.extAction=(q.action||null);this.obj.tr._selected=(q.selected!=null);this.obj.tr.className="tr_btn"+(this.obj.tr.en?(this.obj.tr._selected&&a.renderSelect?" tr_btn_selected":""):" tr_btn_disabled");this.obj.tr.onselectstart=function(u){u=u||event;if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}return false};this.obj.tr.idd=String(s);if(isNaN(r)){r=a.p_tbody.childNodes.length+1}else{if(r<1){r=1}}if(r>a.p_tbody.childNodes.length){a.p_tbody.appendChild(this.obj.tr)}else{a.p_tbody.insertBefore(this.obj.tr,a.p_tbody.childNodes[r-1])}this.obj.td_a=document.createElement("TD");this.obj.td_a.className="td_btn_img";this.obj.td_a.onselectstart=function(u){u=u||event;if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}return false};this.obj.td_b=document.createElement("TD");this.obj.td_b.className="td_btn_txt";this.obj.td_b.onselectstart=function(u){u=u||event;if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}return false};if(g.rtl){this.obj.tr.appendChild(this.obj.td_b);this.obj.tr.appendChild(this.obj.td_a)}else{this.obj.tr.appendChild(this.obj.td_a);this.obj.tr.appendChild(this.obj.td_b)}if(q.img!=null){this.obj.td_a.innerHTML="";this.obj.tr._img=q.img}else{this.obj.td_a.innerHTML=" "}var n=(q.text!=null?q.text:(q.itemText||""));this.obj.td_b.innerHTML="
"+n+"
";this.obj.tr[window.dhx4.isIPad?"ontouchstart":"onmouseover"]=function(){if(!this.en||(this._selected&&a.renderSelect)){return}this.className="tr_btn tr_btn_over"};this.obj.tr.onmouseout=function(){if(!this.en){return}if(this._selected&&a.renderSelect){if(String(this.className).search("tr_btn_selected")==-1){this.className="tr_btn tr_btn_selected"}}else{this.className="tr_btn"}};this.obj.tr[window.dhx4.isIPad?"ontouchend":"onclick"]=function(u){u=u||event;u.cancelBubble=true;if(!this.en){return}a.setListOptionSelected(this.idd.replace(g.idPrefix,""));a.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");window.dhx4.zim.clear(a.polygon._idd);a.polygon.style.display="none";if(a.polygon._ie6cover){a.polygon._ie6cover.style.display="none"}if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(a.id,true)}g.anyUsed="none";var v=this.idd.replace(g.idPrefix,"");if(this.extAction){try{window[this.extAction](v)}catch(u){}}g.callEvent("onClick",[v])};a._listOptions[s]=this.obj;return this};this.polygon=document.createElement("DIV");this.polygon.dir="ltr";this.polygon.style.display="none";this.polygon.className="dhx_toolbar_poly_"+g.conf.skin+" dhxtoolbar_icons_"+g.conf.iconSize;this.polygon.onselectstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};this.polygon.onmousedown=function(n){n=n||event;n.cancelBubble=true};this.polygon.style.overflowY="auto";this.polygon._idd=window.dhx4.newId();if(window.dhx4.isIPad){this.polygon.ontouchstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}n.cancelBubble=true;return false}}this.p_tbl=document.createElement("TABLE");this.p_tbl.className="buttons_cont";this.p_tbl.cellSpacing="0";this.p_tbl.cellPadding="0";this.p_tbl.border="0";this.polygon.appendChild(this.p_tbl);this.p_tbody=document.createElement("TBODY");this.p_tbl.appendChild(this.p_tbody);if(l.options!=null){for(var h=0;h0){n.td_a.removeChild(n.td_a.childNodes[0])}while(n.td_b.childNodes.length>0){n.td_b.removeChild(n.td_b.childNodes[0])}n.tr.onselectstart=null;n.tr.onmouseover=null;n.tr.onmouseout=null;n.tr.onclick=null;while(n.tr.childNodes.length>0){n.tr.removeChild(n.tr.childNodes[0])}n.tr.parentNode.removeChild(n.tr);n.td_a=null;n.td_b=null;n.tr=null}else{n.sep.onselectstart=null;n.td.onselectstart=null;n.tr.onselectstart=null;while(n.td.childNodes.length>0){n.td.removeChild(n.td.childNodes[0])}while(n.tr.childNodes.length>0){n.tr.removeChild(n.tr.childNodes[0])}n.tr.parentNode.removeChild(n.tr);n.sep=null;n.td=null;n.tr=null}n=null;this._listOptions[q]=null;try{delete this._listOptions[q]}catch(o){}};this.showListOption=function(n){if(!this._isListButton(n,true)){return}this._listOptions[n].tr.style.display=""};this.hideListOption=function(n){if(!this._isListButton(n,true)){return}this._listOptions[n].tr.style.display="none"};this.isListOptionVisible=function(n){if(!this._isListButton(n,true)){return}return(this._listOptions[n].tr.style.display!="none")};this.enableListOption=function(n){if(!this._isListButton(n)){return}this._listOptions[n].tr.en=true;this._listOptions[n].tr.className="tr_btn"+(this._listOptions[n].tr._selected&&g.renderSelect?" tr_btn_selected":"")};this.disableListOption=function(n){if(!this._isListButton(n)){return}this._listOptions[n].tr.en=false;this._listOptions[n].tr.className="tr_btn tr_btn_disabled"};this.isListOptionEnabled=function(n){if(!this._isListButton(n)){return}return this._listOptions[n].tr.en};this.setListOptionPosition=function(q,o){if(!this._listOptions[q]||this.getListOptionPosition(q)==o||isNaN(o)){return}if(o<1){o=1}var n=this._listOptions[q].tr;this.p_tbody.removeChild(n);if(o>this.p_tbody.childNodes.length){this.p_tbody.appendChild(n)}else{this.p_tbody.insertBefore(n,this.p_tbody.childNodes[o-1])}n=null};this.getListOptionPosition=function(r){var o=-1;if(!this._listOptions[r]){return o}for(var n=0;n0){q.childNodes[0].src=g.conf.icons_path+n}else{var o=document.createElement("IMG");o.className="btn_sel_img";o.src=g.conf.icons_path+n;q.appendChild(o)}q=null};this.getListOptionImage=function(q){if(!this._isListButton(q)){return}var o=this._listOptions[q].tr.childNodes[(g.rtl?1:0)];var n=null;if(o.childNodes.length>0){n=o.childNodes[0].src}o=null;return n};this.clearListOptionImage=function(o){if(!this._isListButton(o)){return}var n=this._listOptions[o].tr.childNodes[(g.rtl?1:0)];while(n.childNodes.length>0){n.removeChild(n.childNodes[0])}n.innerHTML=" ";n=null};this.setListOptionText=function(o,n){if(!this._isListButton(o)){return}this._listOptions[o].tr.childNodes[(g.rtl?0:1)].childNodes[0].innerHTML=n};this.getListOptionText=function(n){if(!this._isListButton(n)){return}return this._listOptions[n].tr.childNodes[(g.rtl?0:1)].childNodes[0].innerHTML};this.setListOptionToolTip=function(o,n){if(!this._isListButton(o)){return}this._listOptions[o].tr.title=n};this.getListOptionToolTip=function(n){if(!this._isListButton(n)){return}return this._listOptions[n].tr.title};this.forEachListOption=function(o){for(var n in this._listOptions){o(n)}};this.getAllListOptions=function(){var o=new Array();for(var n in this._listOptions){o[o.length]=n}return o};this.setListOptionSelected=function(q){for(var n in this._listOptions){var o=this._listOptions[n];if(o.td_a!=null&&o.td_b!=null&&o.tr.en){if(n==q){o.tr._selected=true;o.tr.className="tr_btn"+(this.renderSelect?" tr_btn_selected":"");if(this.mode=="select"){if(o.tr._img){this.setItemImage(o.tr._img)}else{this.clearItemImage()}this.setItemText(this.getListOptionText(q))}}else{o.tr._selected=false;o.tr.className="tr_btn"}}o=null}};this.getListOptionSelected=function(){var o=null;for(var n in this._listOptions){if(this._listOptions[n].tr._selected==true){o=n}}return o};this._isListButton=function(o,n){if(this._listOptions[o]==null){return false}if(!n&&this._listOptions[o].tr.className=="tr_sep"){return false}return true};this.setMaxOpen=function(n){this._ph=null;if(typeof(n)=="number"){this.maxOpen=n;this._maxOpenTest();return}this.maxOpen=null};if(l.width){this.setWidth(l.width)}if(this.mode=="select"&&typeof(l.selected)!="undefined"){this.setListOptionSelected(l.selected)}return this};dhtmlXToolbarObject.prototype._buttonInputObject=function(g,l,h){this.id=g.idPrefix+l;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.obj.style.display=(h.hidden!=null?"none":"");this.obj.idd=String(l);this.obj.w=(h.width!=null?h.width:100);this.obj.title=(h.title!=null?h.title:"");this.obj.innerHTML="";var c=g;var a=this;this.obj.childNodes[0].onkeydown=function(m){m=m||event;if(m.keyCode==13){c.callEvent("onEnter",[a.obj.idd,this.value])}};g.base.appendChild(this.obj);this.enableItem=function(){this.obj.childNodes[0].disabled=false};this.disableItem=function(){this.obj.childNodes[0].disabled=true};this.isEnabled=function(){return(!this.obj.childNodes[0].disabled)};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display!="none")};this.setValue=function(m){this.obj.childNodes[0].value=m};this.getValue=function(){return this.obj.childNodes[0].value};this.setWidth=function(m){this.obj.w=m;this.obj.childNodes[0].style.width=this.obj.w+"px"};this.getWidth=function(){return this.obj.w};this.setItemToolTip=function(m){this.obj.title=m};this.getItemToolTip=function(){return this.obj.title};this.getInput=function(){return this.obj.firstChild};if(typeof(h.enabled)!="undefined"&&window.dhx4.s2b(h.enabled)==false){this.disableItem()}return this};dhtmlXToolbarObject.prototype._buttonTwoStateObject=function(a,h,c){this.id=a.idPrefix+h;this.state=(c.enabled!=null?false:true);this.imgEn=(c.img!=null?c.img:"");this.imgDis=(c.imgdis!=null?c.imgdis:"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.obj=document.createElement("DIV");this.obj.pressed=(c.selected!=null);this.obj.extAction=(c.action||null);this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.obj.pressed?"pres"+(this.state?"":"_dis"):(this.state?"def":"dis"));this.obj.style.display=(c.hidden!=null?"none":"");this.obj.renderAs=this.obj.className;this.obj.idd=String(h);this.obj.title=(c.title||"");if(this.obj.pressed){this.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}this.obj.innerHTML=a._rtlParseBtn((this.img!=""?"":""),(c.text!=null?"
"+c.text+"
":""));a.base.appendChild(this.obj);var g=this;this.obj.onselectstart=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){if(g.state==false){return}if(a.anyUsed!="none"){return}if(this.pressed){this.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over";return}this.className="dhx_toolbar_btn dhxtoolbar_btn_over";this.renderAs=this.className};this.obj._doOnMouseOut=function(){if(g.state==false){return}if(a.anyUsed!="none"){return}if(this.pressed){this.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";return}this.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.renderAs=this.className};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(l){if(a.checkEvent("onBeforeStateChange")){if(!a.callEvent("onBeforeStateChange",[this.idd.replace(a.idPrefix,""),this.pressed])){return}}if(g.state==false){return}if(a.anyUsed!="none"){return}this.pressed=!this.pressed;this.className=(this.pressed?"dhx_toolbar_btn dhxtoolbar_btn_pres":this.renderAs);var m=this.idd.replace(a.idPrefix,"");if(this.extAction){try{window[this.extAction](m,this.pressed)}catch(l){}}a.callEvent("onStateChange",[m,this.pressed]);return false};this.setItemState=function(l,n){if(this.obj.pressed!=l){if(l==true){this.obj.pressed=true;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres"+(this.state?"":"_dis");this.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}else{this.obj.pressed=false;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.renderAs=this.obj.className}if(n==true){var o=this.obj.idd.replace(a.idPrefix,"");if(this.obj.extAction){try{window[this.obj.extAction](o,this.obj.pressed)}catch(m){}}a.callEvent("onStateChange",[o,this.obj.pressed])}}};this.getItemState=function(){return this.obj.pressed};this.enableItem=function(){a._enableItem(this)};this.disableItem=function(){a._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setItemText=function(l){a._setItemText(this,l)};this.getItemText=function(){return a._getItemText(this)};this.setItemImage=function(l){a._setItemImage(this,l,true)};this.clearItemImage=function(){a._clearItemImage(this,true)};this.setItemImageDis=function(l){a._setItemImage(this,l,false)};this.clearItemImageDis=function(){a._clearItemImage(this,false)};this.setItemToolTip=function(l){this.obj.title=l};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._sliderObject=function(h,m,l){this.id=h.idPrefix+m;this.state=(l.enabled!=null?(l.enabled=="true"?true:false):true);this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=(l.hidden!=null?"none":"");this.obj.onselectstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};this.obj.idd=String(m);this.obj.len=(l.length!=null?Number(l.length):50);this.obj.innerHTML="
"+(l.textMin||"")+"
"+(l.textMax||"")+"
";h.base.appendChild(this.obj);var a=this;this.pen=document.createElement("DIV");this.pen.className="dhxtoolbar_sl_pen";this.obj.appendChild(this.pen);var g=this.pen;this.label=document.createElement("DIV");this.label.dir="ltr";this.label.className="dhx_toolbar_slider_label_"+h.conf.skin+(h.rtl?"_rtl":"");this.label.style.display="none";this.label.tip=(l.toolTip||"%v");this.label._zi=window.dhx4.newId();document.body.appendChild(this.label);var c=this.label;this.pen.valueMin=(l.valueMin!=null?Number(l.valueMin):0);this.pen.valueMax=(l.valueMax!=null?Number(l.valueMax):100);if(this.pen.valueMin>this.pen.valueMax){this.pen.valueMin=this.pen.valueMax}this.pen.valueNow=(l.valueNow!=null?Number(l.valueNow):this.pen.valueMax);if(this.pen.valueNow>this.pen.valueMax){this.pen.valueNow=this.pen.valueMax}if(this.pen.valueNowwindow.dhx4.absLeft(g)+Math.round(g.offsetWidth/2)&&g.nowX==g.maxX){return}g.newNowX=g.nowX+q;if(g.newNowXg.maxX){g.newNowX=g.maxX}g.nowX=g.newNowX;g.style.left=g.nowX+"px";g.initXY=n;g.newValueNow=Math.round((g.valueMax-g.valueMin)*(g.newNowX-g.minX)/(g.maxX-g.minX)+g.valueMin);if(c.tip!=""){c.innerHTML=c.tip.replace(/%v/gi,g.newValueNow);c.style.left=Math.round(window.dhx4.absLeft(g)+g.offsetWidth/2-c.offsetWidth/2)+"px";c.style.top=window.dhx4.absTop(g)-c.offsetHeight-3+"px"}o.cancelBubble=true;if(o.preventDefault){o.preventDefault()}else{o.returnValue=false}return false};this.pen._doOnMouseMoveEnd=function(){if(!g.allowMove){return}g.className="dhxtoolbar_sl_pen";g.allowMove=false;g.nowX=g.newNowX;g.valueNow=g.newValueNow;if(c.tip!=""){c.style.display="none";window.dhx4.zim.clear(c._zi)}h.callEvent("onValueChange",[a.obj.idd.replace(h.idPrefix,""),g.valueNow])};if(window.dhx4.isIPad){document.addEventListener("touchmove",g._doOnMouseMoveStart,false);document.addEventListener("touchend",g._doOnMouseMoveEnd,false)}else{if(typeof(window.addEventListener)!="undefined"){window.addEventListener("mousemove",g._doOnMouseMoveStart,false);window.addEventListener("mouseup",g._doOnMouseMoveEnd,false)}else{document.body.attachEvent("onmousemove",g._doOnMouseMoveStart);document.body.attachEvent("onmouseup",g._doOnMouseMoveEnd)}}this.enableItem=function(){if(this.state){return}this.state=true;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def"};this.disableItem=function(){if(!this.state){return}this.state=false;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_dis"};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setValue=function(n,o){n=Number(n);if(nthis.pen.valueMax){n=this.pen.valueMax}this.pen.valueNow=n;this.pen._definePos();if(o==true){h.callEvent("onValueChange",[this.obj.idd.replace(h.idPrefix,""),this.pen.valueNow])}};this.getValue=function(){return this.pen.valueNow};this.setMinValue=function(o,n){o=Number(o);if(o>this.pen.valueMax){return}this.obj.childNodes[0].innerHTML=n;this.obj.childNodes[0].style.display=(n.length>0?"":"none");this.pen.valueMin=o;if(this.pen.valueNow0?"":"none");this.pen.valueMax=o;if(this.pen.valueNow>this.pen.valueMax){this.pen.valueNow=this.pen.valueMax}this.pen._detectLimits();this.pen._definePos()};this.getMinValue=function(){var n=this.obj.childNodes[0].innerHTML;var o=this.pen.valueMin;return new Array(o,n)};this.getMaxValue=function(){var n=this.obj.childNodes[4].innerHTML;var o=this.pen.valueMax;return new Array(o,n)};this.setItemToolTipTemplate=function(n){this.label.tip=n};this.getItemToolTipTemplate=function(){return this.label.tip};return this};dhtmlXToolbarObject.prototype.unload=function(){if(this.conf.isIPad){document.removeEventListener("touchstart",this._doOnClick,false)}else{if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousedown",this._doOnClick,false)}else{document.body.detachEvent("onmousedown",this._doOnClick)}}this._doOnClick=null;this.clearAll();this.objPull=null;if(this._xmlLoader){this._xmlLoader.destructor();this._xmlLoader=null}while(this.base.childNodes.length>0){this.base.removeChild(this.base.childNodes[0])}this.cont.removeChild(this.base);this.base=null;while(this.cont.childNodes.length>0){this.cont.removeChild(this.cont.childNodes[0])}this.cont.className="";this.cont=null;window.dhx4._enableDataLoading(this,null,null,null,"clear");window.dhx4._eventable(this,"clear");this.tX1=null;this.tX2=null;this.tY1=null;this.tY2=null;this.anyUsed=null;this.idPrefix=null;this.rootTypes=null;this._rtl=null;this._rtlParseBtn=null;this.setRTL=null;this._sbw=null;this._getObj=null;this._addImgObj=null;this._setItemImage=null;this._clearItemImage=null;this._setItemText=null;this._getItemText=null;this._enableItem=null;this._disableItem=null;this._xmlParser=null;this._addItemToStorage=null;this._genStr=null;this._addItem=null;this._getPosition=null;this._setPosition=null;this._getIdByPosition=null;this._separatorObject=null;this._textObject=null;this._buttonObject=null;this._buttonSelectObject=null;this._buttonInputObject=null;this._buttonTwoStateObject=null;this._sliderObject=null;this._autoDetectVisibleArea=null;this._removeItem=null;this.setAlign=null;this.setSkin=null;this.setIconsPath=null;this.setIconPath=null;this.loadXML=null;this.loadXMLString=null;this.clearAll=null;this.addSpacer=null;this.removeSpacer=null;this.getType=null;this.getTypeExt=null;this.inArray=null;this.getParentId=null;this.addButton=null;this.addText=null;this.addButtonSelect=null;this.addButtonTwoState=null;this.addSeparator=null;this.addSlider=null;this.addInput=null;this.forEachItem=null;this.showItem=null;this.hideItem=null;this.isVisible=null;this.enableItem=null;this.disableItem=null;this.isEnabled=null;this.setItemText=null;this.getItemText=null;this.setItemToolTip=null;this.getItemToolTip=null;this.setItemImage=null;this.setItemImageDis=null;this.clearItemImage=null;this.clearItemImageDis=null;this.setItemState=null;this.getItemState=null;this.setItemToolTipTemplate=null;this.getItemToolTipTemplate=null;this.setValue=null;this.getValue=null;this.setMinValue=null;this.getMinValue=null;this.setMaxValue=null;this.getMaxValue=null;this.setWidth=null;this.getWidth=null;this.getPosition=null;this.setPosition=null;this.removeItem=null;this.addListOption=null;this.removeListOption=null;this.showListOption=null;this.hideListOption=null;this.isListOptionVisible=null;this.enableListOption=null;this.disableListOption=null;this.isListOptionEnabled=null;this.setListOptionPosition=null;this.getListOptionPosition=null;this.setListOptionText=null;this.getListOptionText=null;this.setListOptionToolTip=null;this.getListOptionToolTip=null;this.setListOptionImage=null;this.getListOptionImage=null;this.clearListOptionImage=null;this.forEachListOption=null;this.getAllListOptions=null;this.setListOptionSelected=null;this.getListOptionSelected=null;this.unload=null;this.setUserData=null;this.getUserData=null;this.setMaxOpen=null;this.items=null;this.conf=null};dhtmlXToolbarObject.prototype._autoDetectVisibleArea=function(){var a=window.dhx4.screenDim();this.tX1=a.left;this.tX2=a.right;this.tY1=a.top;this.tY2=a.bottom};dhtmlXToolbarObject.prototype._initObj=function(c){for(var a=0;a=0&&g[o][c-1]!=null&&h[g[o][c-1].type])){l=true}}r.node.style.borderRightWidth=(s?"1px":"0px");r.node.style.borderTopRightRadius=r.node.style.borderBottomRightRadius=(s?this.conf.terrace_radius:"0px");if(r.type=="buttonSelect"){r.node.previousSibling.style.borderTopLeftRadius=r.node.previousSibling.style.borderBottomLeftRadius=(l?this.conf.terrace_radius:"0px");r.node.previousSibling._br=s;r.node.previousSibling._bl=l}else{r.node.style.borderTopLeftRadius=r.node.style.borderBottomLeftRadius=(l?this.conf.terrace_radius:"0px")}r.node._br=s;r.node._bl=l}}for(var o=0;o0){this.base.removeChild(this.base.childNodes[0])}var l=(window.dhx4.isIE?this.base.currentStyle.position:window.getComputedStyle(this.base,null).getPropertyValue("position"));if(!(l=="relative"||l=="absolute")){this.base.style.position="relative"}this.cell=new dhtmlXEditorCell(window.dhx4.newId(),this);this.base.appendChild(this.cell.cell);this.setSizes();this.cBlock=document.createElement("DIV");this.cBlock.className="dhxcont_content_blocker";this.cBlock.style.display="none";this.base.appendChild(this.cBlock);this.editor=document.createElement("IFRAME");this.editor.className="dhxeditor_mainiframe";this.editor.frameBorder=0;if(window.dhx4.isOpera){this.editor.scrolling="yes"}var a=this.editor;if(typeof(window.addEventListener)!="undefined"){a.onload=function(){for(var m=0;m")}else{if(window.dhx4.isKHTML){m.write("")}else{if(window.dhx4.isIE){m.write("")}else{m.write("")}}}m.close();if(window.dhx4.isIE){m.contentEditable=(r!==true)}else{m.designMode=(r!==true?"On":"Off")}if(window.dhx4.isFF){try{m.execCommand("useCSS",false,true)}catch(q){}}if(o===true&&this.setContent!=null){this.setContent(n)}};this._prepareContent();this._doOnResize=function(){window.clearTimeout(c.conf.resizeTM);c.conf.resizeTM=window.setTimeout(function(){if(c.setSizes){c.setSizes()}},c.conf.resizeTMTime)};this._runCommand=function(o,r){if(this.conf.roMode===true){return}if(arguments.length<2){r=null}if(window.dhx4.isIE){this.edWin.focus()}try{var n=this.editor.contentWindow.document;n.execCommand(o,false,r)}catch(q){}if(window.dhx4.isIE){this.edWin.focus();var m=this;window.setTimeout(function(){m.edWin.focus();m=null},1)}};this.applyBold=function(){this._runCommand("Bold")};this.applyItalic=function(){this._runCommand("Italic")};this.applyUnderscore=function(){this._runCommand("Underline")};this.clearFormatting=function(){this._runCommand("RemoveFormat")};this._doOnClick=function(o){var n=o||window.event;var m=n.target||n.srcElement;c._showInfo(m)};this._doOnMouseDown=function(o){var n=o||window.event;var m=n.target||n.srcElement;c._showInfo(m)};this._doOnKeyUp=function(q){var o=q||window.event;var m=o.keyCode;var n=o.target||o.srcElement;if({37:1,38:1,39:1,40:1,13:1}[m]==1){c._showInfo(n)}};this._getParentByTag=function(m,o){o=o.toLowerCase();var n=m;do{if(o==""||n.nodeName.toLowerCase()==o){return n}}while(n=n.parentNode);return m};this._isStyleProperty=function(o,r,m,q){r=r.toLowerCase();var s=o;do{if((s.nodeName.toLowerCase()==r)&&(s.style[m]==q)){return true}}while(s=s.parentNode);return false};this._setStyleProperty=function(m,q){this.style[q]=false;var o=this._getParentByTag(m,q);if(o&&(o.tagName.toLowerCase()==q)){this.style[q]=true}if(q=="del"&&this._getParentByTag(m,"strike")&&this._getParentByTag(m,"strike").tagName.toLowerCase()=="strike"){this.style.del=true}};this._showInfo=function(n){var n=(this._getSelectionBounds().end)?this._getSelectionBounds().end:n;if(!n||!this._setStyleProperty){return}try{if(this.edWin.getComputedStyle){var m=this.edWin.getComputedStyle(n,null);var o=((m.getPropertyValue("font-weight")==401)?700:m.getPropertyValue("font-weight"));this.style={fontStyle:m.getPropertyValue("font-style"),fontSize:m.getPropertyValue("font-size"),textDecoration:m.getPropertyValue("text-decoration"),fontWeight:o,fontFamily:m.getPropertyValue("font-family"),textAlign:m.getPropertyValue("text-align")};if(window.dhx4.isKHTML){this.style.fontStyle=m.getPropertyValue("font-style");this.style.vAlign=m.getPropertyValue("vertical-align");this.style.del=this._isStyleProperty(n,"span","textDecoration","line-through");this.style.u=this._isStyleProperty(n,"span","textDecoration","underline")}}else{var m=n.currentStyle;this.style={fontStyle:m.fontStyle,fontSize:m.fontSize,textDecoration:m.textDecoration,fontWeight:m.fontWeight,fontFamily:m.fontFamily,textAlign:m.textAlign}}this._setStyleProperty(n,"h1");this._setStyleProperty(n,"h2");this._setStyleProperty(n,"h3");this._setStyleProperty(n,"h4");if(!window.dhx4.isKHTML){this._setStyleProperty(n,"del");this._setStyleProperty(n,"sub");this._setStyleProperty(n,"sup");this._setStyleProperty(n,"u")}this.callEvent("onFocusChanged",[this.style,m])}catch(q){return null}};this._getSelectionBounds=function(){var r,o,u,n;if(this.edWin.getSelection){var s=this.edWin.getSelection();r=s.getRangeAt(s.rangeCount-1);u=r.startContainer;n=r.endContainer;o=r.commonAncestorContainer;if(u.nodeName=="#text"){o=o.parentNode}if(u.nodeName=="#text"){u=u.parentNode}if(u.nodeName.toLowerCase()=="body"){u=u.firstChild}if(n.nodeName=="#text"){n=n.parentNode}if(n.nodeName.toLowerCase()=="body"){n=n.lastChild}if(u==n){o=u}return{root:o,start:u,end:n}}else{if(this.edWin.document.selection){r=this.edDoc.selection.createRange();if(!r.duplicate){return null}o=r.parentElement();var q=r.duplicate();var m=r.duplicate();q.collapse(true);m.moveToElementText(q.parentElement());m.setEndPoint("EndToStart",q);u=q.parentElement();q=r.duplicate();m=r.duplicate();m.collapse(false);q.moveToElementText(m.parentElement());q.setEndPoint("StartToEnd",m);n=m.parentElement();if(u.nodeName.toLowerCase()=="body"){u=u.firstChild}if(n.nodeName.toLowerCase()=="body"){n=n.lastChild}if(u==n){o=u}return{root:o,start:u,end:n}}}return null};this.getContent=function(){if(!this.edDoc.body){return""}else{if(window.dhx4.isFF){return this.editor.contentWindow.document.body.innerHTML.replace(/<\/{0,}br\/{0,}>\s{0,}$/gi,"")}if(window.dhx4.isIE&&this.edDoc.body.innerText.length==0){return""}return this.edDoc.body.innerHTML}};this.setContent=function(o){o=o||"";if(this.edDoc.body){var n=false;if(window.dhx4.isFF){var m=navigator.userAgent.match(/Firefox\/(\d*)/);n=(m!=null&&m[1]<28)}if(n){if(typeof(this.conf.ffTest)=="undefined"){this.editor.contentWindow.document.body.innerHTML="";this._runCommand("InsertHTML","test");this.conf.ffTest=(this.editor.contentWindow.document.body.innerHTML.length>0)}if(this.conf.ffTest){this.editor.contentWindow.document.body.innerHTML=o}else{this.editor.contentWindow.document.body.innerHTML="";if(o.length==0){o=" "}this._runCommand("InsertHTML",o)}}else{this.editor.contentWindow.document.body.innerHTML=o}this.callEvent("onContentSet",[])}else{if(!this.conf.firstLoadEv){this.conf.firstLoadEv=true;this.conf.firstLoadData=o;this._onFirstLoad=function(){c.setContent(c.conf.firstLoadData);if(typeof(window.addEventListener)=="function"){c.edWin.removeEventListener("load",c._onFirstLoad,false)}else{c.edWin.detachEvent("onload",c._onFirstLoad)}c.conf.firstLoadData=null;c.conf.firstLoadEv=false;c._onFirstLoad=null};if(typeof(window.addEventListener)=="function"){this.edWin.addEventListener("load",this._onFirstLoad,false)}else{this.edWin.attachEvent("onload",this._onFirstLoad)}}}};this.setContentHTML=function(m){window.dhx4.ajax.get(m,function(n){if(n.xmlDoc.responseText!=null){c.setContent(n.xmlDoc.responseText)}})};window.dhx4._eventable(this);this.attachEvent("onFocusChanged",function(m){if(typeof(this._doOnFocusChanged)=="function"){this._doOnFocusChanged(m)}else{if(typeof(this._doOnFocusChanged)=="string"&&typeof(window[this._doOnFocusChanged])=="function"){window[this._doOnFocusChanged](m)}}});if(typeof(window.addEventListener)=="function"){window.addEventListener("resize",this._doOnResize,false);this.edDoc.addEventListener("click",this._doOnClick,false);this.edDoc.addEventListener("keyup",this._doOnKeyUp,false);if(window.dhx4.isOpera){this.edDoc.addEventListener("mousedown",this._doOnMouseDown,false)}}else{window.attachEvent("onresize",this._doOnResize);this.edDoc.attachEvent("onclick",this._doOnClick);this.edDoc.attachEvent("onkeyup",this._doOnKeyUp)}this.unload=function(){if(typeof(window.addEventListener)=="function"){window.removeEventListener("resize",this._doOnResize,false);this.edDoc.removeEventListener("click",this._doOnClick,false);this.edDoc.removeEventListener("keyup",this._doOnKeyUp,false);if(window.dhx4.isOpera){this.edDoc.removeEventListener("mousedown",this._doOnMouseDown,false)}for(var m=0;m0){this.base.removeChild(this.base.childNodes[0])}this.base=null;this._doOnClick=null;this._doOnKeyUp=null;this._doOnMouseDown=null;this._ev=null;this._focus=null;this._prepareContent=null;this._doOnResize=null;this.setIconsPath=null;this.init=null;this.setSizes=null;this._runCommand=null;this.applyBold=null;this.applyItalic=null;this.applyUnderscore=null;this.clearFormatting=null;this._showInfo=null;this._getSelectionBounds=null;this.getContent=null;this.setContent=null;this.setContentHTML=null;this.setReadonly=null;this.isReadonly=null;this.unload=null;c=a=null};if(this.conf.toolbar==true&&typeof(this.attachToolbar)=="function"&&typeof(window.dhtmlXToolbarObject)=="function"){this.attachToolbar(this.conf.iconsPath)}this.setIconsPath=function(m){this.conf.iconsPath=m};if(this.conf.content.length>0){this.setContent(this.conf.content);this.conf.content=""}else{if(this.conf.contentHTML.length>0){this.setContentHTML(this.conf.contentHTML);this.conf.contentHTML=""}}return this}dhtmlXEditor.prototype.setSizes=function(){this.cell._setSize(0,0,this.base.clientWidth,this.base.clientHeight)};dhtmlXEditor.prototype.setReadonly=function(a){this.conf.roMode=(a===true);this._prepareContent(true,this.conf.roMode);this.cBlock.style.display=(this.conf.roMode?"":"none")};dhtmlXEditor.prototype.isReadonly=function(a){return(this.conf.roMode||false)};dhtmlXEditor.prototype.setSkin=function(a){this.base.className=String(this.base.className).replace(new RegExp("dhxeditor_"+this.conf.skin),"dhxeditor_"+a);this.conf.skin=this.cell.conf.skin=a;if(this.tb){this.cell.detachToolbar(a);this.tb=null;this.attachToolbar()}this.setSizes()};window.dhtmlXEditorCell=function(g,a){dhtmlXCellObject.apply(this,[g,"_editor"]);var c=this;this.editor=a;this.conf.skin=this.editor.conf.skin;this.attachEvent("_onCellUnload",function(){this._stbUnload();this.editor=null;c=null});this._stbInit();return this};dhtmlXEditorCell.prototype=new dhtmlXCellObject();dhtmlXEditorCell.prototype._stbInit=function(){var m=this;var l=document.createElement("DIV");l.className="dhx_cell_stb";this.cell.insertBefore(l,this.cell.childNodes[this.conf.idx.cont]);l.onselectstart=function(a){a=a||event;a.cancelBubble=true;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};var h={bold:"applyBold",italic:"applyItalic",underline:"applyUnderscore",clearformat:"clearFormatting"};for(var g in h){var c=document.createElement("A");c.href="javascript:void(0);";c.tabIndex=-1;l.appendChild(c);c.onmousedown=c.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};var n=document.createElement("DIV");n.className="dhx_cell_stb_button btn_"+g;n._actv=g.charAt(0);n._cmd=h[g];c.appendChild(n);n.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};n.onmousedown=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}m.editor[this._cmd]();m.editor.callEvent("onToolbarClick",[this._actv])};n=c=null}l=null;this._stbUnload=function(){var a=this.cell.childNodes[this.conf.idx.stb];a.onselectstart=null;while(a.childNodes.length>0){a.lastChild.onmousedown=a.lastChild.onclick=null;a.lastChild.firstChild.onmousedown=a.lastChild.firstChild.onclick=null;a.lastChild.firstChild._actv=a.lastChild.firstChild._cmd=null;a.lastChild.removeChild(a.lastChild.firstChild);a.removeChild(a.lastChild)}a.parentNode.removeChild(a);a=m=null;this.conf.idx_data.stb=this.conf.ofs_nodes.t._getStbHeight=null;delete this.conf.ofs_nodes.t._getStbHeight;delete this.conf.idx_data.stb;this._updateIdx()};this.conf.ofs_nodes.t._getStbHeight="func";this.conf.idx_data.stb="dhx_cell_stb";this._updateIdx()};dhtmlXEditorCell.prototype._stbHide=function(){this.cell.childNodes[this.conf.idx.stb].style.display="none"};dhtmlXEditorCell.prototype._getStbHeight=function(){return this.cell.childNodes[this.conf.idx.stb].offsetHeight};dhtmlXEditor.prototype.attachToolbar=function(c){if(this.tb!=null){return}if(c!=null){this.conf.iconsPath=c}this.cell._stbHide();this.tb=this.cell.attachToolbar({icons_path:this.conf.iconsPath+"/dhxeditor_"+String(this.conf.skin).replace(/^dhx_/,"")+"/",skin:this.conf.skin});this.setSizes();this._availFonts=new Array("Arial","Arial Narrow","Comic Sans MS","Courier","Georgia","Impact","Tahoma","Times New Roman","Verdana");this._initFont=this._availFonts[0];this._xmlFonts="";for(var m=0;m]]>'}this._availSizes={"1":"8pt","2":"10pt","3":"12pt","4":"14pt","5":"18pt","6":"24pt","7":"36pt"};this._xmlSizes="";for(var g in this._availSizes){this._xmlSizes+=''}this.tbXML='';this.tb.loadStruct(this.tbXML);this._checkAlign=function(a){this.tb.setItemState("alignCenter",false);this.tb.setItemState("alignRight",false);this.tb.setItemState("alignJustify",false);this.tb.setItemState("alignLeft",false);if(a){this.tb.setItemState(a,true)}};this._checkH=function(a){this.tb.setItemState("applyH1",false);this.tb.setItemState("applyH2",false);this.tb.setItemState("applyH3",false);this.tb.setItemState("applyH4",false);if(a){this.tb.setItemState(a,true)}};this._doOnFocusChanged=function(o){if(!o.h1&&!o.h2&&!o.h3&&!o.h4){var a=(String(o.fontWeight).search(/bold/i)!=-1)||(Number(o.fontWeight)>=700);this.tb.setItemState("applyBold",a)}else{this.tb.setItemState("applyBold",false)}var n="alignLeft";if(String(o.textAlign).search(/center/)!=-1){n="alignCenter"}if(String(o.textAlign).search(/right/)!=-1){n="alignRight"}if(String(o.textAlign).search(/justify/)!=-1){n="alignJustify"}this.tb.setItemState(n,true);this._checkAlign(n);this.tb.setItemState("applyH1",o.h1);this.tb.setItemState("applyH2",o.h2);this.tb.setItemState("applyH3",o.h3);this.tb.setItemState("applyH4",o.h4);if(window._KHTMLrv){o.sub=(o.vAlign=="sub");o.sup=(o.vAlign=="super")}this.tb.setItemState("applyItalic",(o.fontStyle=="italic"));this.tb.setItemState("applyStrikethrough",o.del);this.tb.setItemState("applySub",o.sub);this.tb.setItemState("applySuper",o.sup);this.tb.setItemState("applyUnderscore",o.u)};this._doOnToolbarClick=function(n){var a=String(n).split(":");if(this[a[0]]!=null){if(typeof(this[a[0]])=="function"){this[a[0]](a[1]);this.callEvent("onToolbarClick",[n])}}};this._doOnStateChange=function(n,a){this[n]();switch(n){case"alignLeft":case"alignCenter":case"alignRight":case"alignJustify":this._checkAlign(n);break;case"applyH1":case"applyH2":case"applyH3":case"applyH4":this._checkH(n);break}this.callEvent("onToolbarClick",[n])};this._doOnBeforeStateChange=function(n,a){if((n=="alignLeft"||n=="alignCenter"||n=="alignRight"||n=="alignJustify")&&a==true){return false}return true};var l=this;this.tb.attachEvent("onClick",function(a){l._doOnToolbarClick(a)});this.tb.attachEvent("onStateChange",function(n,a){l._doOnStateChange(n,a)});this.tb.attachEvent("onBeforeStateChange",function(n,a){return l._doOnBeforeStateChange(n,a)});this.applyBold=function(){this._runCommand("Bold")};this.applyItalic=function(){this._runCommand("Italic")};this.applyUnderscore=function(){this._runCommand("Underline")};this.applyStrikethrough=function(){this._runCommand("StrikeThrough")};this.alignLeft=function(){this._runCommand("JustifyLeft")};this.alignRight=function(){this._runCommand("JustifyRight")};this.alignCenter=function(){this._runCommand("JustifyCenter")};this.alignJustify=function(){this._runCommand("JustifyFull")};this.applySub=function(){this._runCommand("Subscript")};this.applySuper=function(){this._runCommand("Superscript")};this.applyH1=function(){this._runCommand("FormatBlock","

")};this.applyH2=function(){this._runCommand("FormatBlock","

")};this.applyH3=function(){this._runCommand("FormatBlock","

")};this.applyH4=function(){this._runCommand("FormatBlock","

")};this.createNumList=function(){this._runCommand("InsertOrderedList")};this.createBulList=function(){this._runCommand("InsertUnorderedList")};this.increaseIndent=function(){this._runCommand("Indent")};this.decreaseIndent=function(){this._runCommand("Outdent")};this.clearFormatting=function(){this._runCommand("RemoveFormat");this.tb.setItemState("applyBold",false);this.tb.setItemState("applyItalic",false);this.tb.setItemState("applyStrikethrough",false);this.tb.setItemState("applySub",false);this.tb.setItemState("applySuper",false);this.tb.setItemState("applyUnderscore",false)}};dhtmlx.Group={_init:function(){dhtmlx.assert(this.data,"DataStore required for grouping");this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(){if(this._settings.group){this.group(this._settings.group,false)}},this));this.attachEvent("onBeforeRender",dhtmlx.bind(function(a){if(this._settings.sort){a.block();a.sort(this._settings.sort);a.unblock()}},this));this.attachEvent("onBeforeSort",dhtmlx.bind(function(){this._settings.sort=null},this))},_init_group_data_event:function(c,a){c.attachEvent("onClearAll",dhtmlx.bind(function(){this.ungroup(false);this.block();this.clearAll();this.unblock()},a))},sum:function(c,a){c=dhtmlx.Template.setter(c);a=a||this.data;var g=0;a.each(function(h){g+=c(h)*1});return g},min:function(g,c){g=dhtmlx.Template.setter(g);c=c||this.data;var a=Infinity;c.each(function(h){if(g(h)*1a){a=g(h)*1}});return a},_split_data_by:function(l){var m=function(r,q){r=dhtmlx.Template.setter(r);return r(q[0])};var h=dhtmlx.Template.setter(l.by);if(!l.map[h]){l.map[h]=[h,m]}var a={};var o=[];this.data.each(function(q){var r=h(q);if(!a[r]){o.push({id:r});a[r]=dhtmlx.toArray()}a[r].push(q)});for(var n in l.map){var c=(l.map[n][1]||m);if(typeof c!="function"){c=this[c]}for(var g=0;g11?"pm":"am")+"';case"%A":return'"+(date.getHours()>11?"PM":"AM")+"';case"%s":return'"+dhtmlx.Date.to_fixed(date.getSeconds())+"';case"%W":return'"+dhtmlx.Date.to_fixed(dhtmlx.Date.getISOWeek(date))+"';default:return g}});if(a){c=c.replace(/date\.get/g,"date.getUTC")}return new Function("date",'return "'+c+'";')},str_to_date:function(l,g){var m="var temp=date.split(/[^0-9a-zA-Z]+/g);";var a=l.match(/%[a-zA-Z]/g);for(var c=0;c50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":m+="set[3]=temp["+c+"]||0;";break;case"%i":m+="set[4]=temp["+c+"]||0;";break;case"%Y":m+="set[0]=temp["+c+"]||0;";break;case"%a":case"%A":m+="set[3]=set[3]%12+((temp["+c+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":m+="set[5]=temp["+c+"]||0;";break}}var h="set[0],set[1],set[2],set[3],set[4],set[5]";if(g){h=" Date.UTC("+h+")"}return new Function("date","var set=[0,0,1,0,0,0]; "+m+" return new Date("+h+");")},getISOWeek:function(g){if(!g){return false}var c=g.getDay();if(c===0){c=7}var h=new Date(g.valueOf());h.setDate(g.getDate()+(4-c));var a=h.getFullYear();var m=Math.floor((h.getTime()-new Date(a,0,1).getTime())/86400000);var l=1+Math.floor(m/7);return l},getUTCISOWeek:function(a){return this.getISOWeek(a)}};dhtmlx.math={};dhtmlx.math._toHex=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];dhtmlx.math.toHex=function(c,a){c=parseInt(c,10);str="";while(c>0){str=this._toHex[c%16]+str;c=Math.floor(c/16)}while(str.length255){l=0}if(h<0||h>255){h=0}if(a<0||a>255){a=0}return[l,h,a]};dhtmlx.math.hsvToRgb=function(n,A,x){var m,u,l,c,y,a,o,w;m=Math.floor((n/60))%6;u=n/60-m;l=x*(1-A);c=x*(1-u*A);y=x*(1-(1-u)*A);a=0;o=0;w=0;switch(m){case 0:a=x;o=y;w=l;break;case 1:a=c;o=x;w=l;break;case 2:a=l;o=x;w=y;break;case 3:a=l;o=c;w=x;break;case 4:a=y;o=l;w=x;break;case 5:a=x;o=l;w=c;break}a=Math.floor(a*255);o=Math.floor(o*255);w=Math.floor(w*255);return[a,o,w]};dhtmlx.math.rgbToHsv=function(c,o,q){var m,l,u,a,w,y,n,x;m=c/255;l=o/255;u=q/255;var a=Math.min(m,l,u);var w=Math.max(m,l,u);n=0;y=w==0?0:(1-a/w);x=w;if(w==a){n=0}else{if(w==m&&l>=u){n=60*(l-u)/(w-a)+0}else{if(w==m&&l")},addSector:function(a,r,q,n,l,g,h,m){var o=[];o.push(n);o.push(Math.floor(l*h));for(var c=r;c"+this._map.join("\n")+"";a._htmlmap=g;this._map=[]}};dhtmlx.chart={};dhtmlx.chart.scatter={pvt_render_scatter:function(r,m,q,o,n,a){if(!this._settings.xValue){return dhtmlx.log("warning","Undefined propery: xValue")}var g=this._getLimits();var l=this._getLimits("h","xValue");if(!n){if(!this.canvases.x){this.canvases.x=new dhtmlx.ui.Canvas(this._obj,"axis_x")}if(!this.canvases.y){this.canvases.y=new dhtmlx.ui.Canvas(this._obj,"axis_y")}this._drawYAxis(this.canvases.y.getCanvas(),m,q,o,g.min,g.max);this._drawHXAxis(this.canvases.x.getCanvas(),m,q,o,l.min,l.max)}g={min:this._settings.yAxis.start,max:this._settings.yAxis.end};l={min:this._settings.xAxis.start,max:this._settings.xAxis.end};var c=this._getScatterParams(r,m,q,o,l,g);this._mapStart=q;for(var h=0;ha.max){m=o[c.toLowerCase()]}if(r=o;M-=r){if(D.fixNum){M=parseFloat((new Number(M)).toFixed(D.fixNum))}J.push(Math.floor(N*g)+0.5);if(A){M=Math.round(M*A)/A}var q=v-n+J[J.length-1];this.canvases.scale.renderTextAt("middle","left",w,q,a.template(M.toString()),"dhx_axis_item_y dhx_radar");if(C.length<2){this._drawScaleSector(I,"arc",w,v,n-J[J.length-1],-Math.PI/2,3*Math.PI/2,M);return}var l=-Math.PI/2;var H=l;var F;for(L=0;LMath.PI){h=-u}if(o>Math.PI/2){l=-g}if(Math.abs(o+Math.PI/2)0;A--){h-=C.cellWidth;g=H[A].$startY;if(g){o.push([h,g])}}}o.push([o[0][0],o[0][1]]);q.globalAlpha=this._settings.alpha.call(this,H[0]);q.fillStyle=this._settings.color.call(this,H[0]);q.beginPath();this._path(q,o);q.fill();for(A=0;Ag.y){D=g.y}var C=this._getSplineYPoint(s+1,w,u,n.a,n.b,n.c,n.d);if(Cg.y){C=g.y}this._drawLine(q,s,D,s+1,C,F.line.color(I[u]),F.line.width)}this._drawLine(q,v-1,this._getSplineYPoint(s,w,u,n.a,n.b,n.c,n.d),v,a,F.line.color(I[u]),F.line.width)}this._drawItem(q,w,c,I[o[u].index],F.label(I[o[u].index]),r,H)}}},_getSplineParameters:function(A){var o,D,C,E,y,x,w,r,q=[],l=[],g=A.length;for(o=0;o=1;o--){E[o]=(C[o]-q[o]*E[o+1])/D[o]}y=[];x=[];w=[];r=[];for(o=0;oE){u=E/this._series.length-4}r=Math.floor((E-u*this._series.length)/2);n=(typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(u/5));L=false;a=this._settings.gradient;if(a&&typeof(a)!="function"){L=a;a=false}else{if(a){a=A.createLinearGradient(m.x,m.y,l.x,m.y);this._settings.gradient(a)}}if(!q){this._drawLine(A,m.x-0.5,m.y,m.x-0.5,l.y,"#000000",1)}for(H=0;HK){y=K}y-=v;y*=c;J=m.x;g=m.y+r+H*E+(u+1)*C;if((y<0&&this._settings.origin=="auto")||(this._settings.xAxis&&y===0&&!(this._settings.origin!="auto"&&this._settings.origin>v))){this.canvases[C].renderTextAt("middle","right",J+10,g+u/2+r,this._settings.label(N[H]));continue}if(y<0&&this._settings.origin!="auto"&&this._settings.origin>v){y=0}if(!q){y+=w/s}D=a||this._settings.color.call(this,N[H]);if(this._settings.border){this._drawBarHBorder(A,J,g,u,v,n,s,y,D)}A.globalAlpha=this._settings.alpha.call(this,N[H]);var F=this._drawBarH(A,l,J,g,u,v,n,s,y,D,a,L);if(L!=false){this._drawBarHGradient(A,J,g,u,v,n,s,y,D,L)}A.globalAlpha=1;if(F[3]==g){this.canvases[C].renderTextAt("middle","left",F[0]-5,F[3]+Math.floor(u/2),this._settings.label(N[H]));M.addRect(N[H].id,[F[0]-m.x,F[3]-m.y,F[2]-m.x,F[3]+u-m.y],C)}else{this.canvases[C].renderTextAt("middle",false,F[2]+5,F[1]+Math.floor(u/2),this._settings.label(N[H]));M.addRect(N[H].id,[F[0]-m.x,g-m.y,F[2]-m.x,F[3]-m.y],C)}}},_setBarHPoints:function(x,h,v,y,n,w,u,m,l){var c=0;if(n>w*u){var s=(n-w*u)/n;c=-Math.asin(s)+Math.PI/2}x.moveTo(h,v+m);var g=h+w*u-n-(n?0:m);if(n0){x.arc(g,r,n-m,-Math.PI/2+c,0,false)}var q=v+y-n-(n?0:m);var a=g+n-(n?m:0);x.lineTo(a,q);if(n&&n>0){x.arc(g,q,n-m,0,Math.PI/2-c,false)}var o=v+y-m;x.lineTo(h,o);if(!l){x.lineTo(h,v+m)}return[a,o]},_drawHScales:function(g,n,m,l,o,c,h){var a=0;if(this._settings.xAxis){if(!this.canvases.x){this.canvases.x=new dhtmlx.ui.Canvas(this._obj)}a=this._drawHXAxis(this.canvases.x.getCanvas(),n,m,l,o,c)}if(this._settings.yAxis){if(!this.canvases.y){this.canvases.y=new dhtmlx.ui.Canvas(this._obj)}this._drawHYAxis(this.canvases.y.getCanvas(),n,m,l,h,a)}},_drawHYAxis:function(u,l,q,n,g,a){if(!this._settings.yAxis){return}var m;var c=parseInt((a?a:q.x),10)-0.5;var r=n.y+0.5;var o=q.y;this._drawLine(u,c,r,c,o,this._settings.yAxis.color,1);for(var h=0;hh)){l+=(this._settings.origin-h)*n;c=l;m=m-(this._settings.origin-h);if(m<0){m*=(-1);o.translate(l,g+q);o.rotate(Math.PI);l=0.5;g=0}l+=0.5}return{value:m,x0:l,y0:g,start:c}},_drawBarH:function(v,l,C,h,q,r,m,o,u,w,a,n){v.save();var s=this._correctBarHParams(v,C,h,u,o,q,r);v.fillStyle=w;v.beginPath();var x=this._setBarHPoints(v,s.x0,s.y0,q,m,o,s.value,(this._settings.border?1:0));if(a&&!n){v.lineTo(l.x,s.y0+(this._settings.border?1:0))}v.fill();v.restore();var g=s.y0;var c=(s.y0!=h?h:x[1]);var A=(s.y0!=h?(s.start-x[0]):s.start);var y=(s.y0!=h?s.start:x[0]);return[A,g,y,c]},_drawBarHBorder:function(q,c,n,r,l,h,o,m,g){q.save();var a=this._correctBarHParams(q,c,n,m,o,r,l);q.beginPath();this._setBorderStyles(q,g);q.globalAlpha=0.9;this._setBarHPoints(q,a.x0,a.y0,r,h,o,a.value,q.lineWidth/2,1);q.stroke();q.restore()},_drawBarHGradient:function(s,g,q,u,n,m,r,o,h,a){s.save();var c=this._correctBarHParams(s,g,q,o,r,u,n);var l=this._setBarGradient(s,c.x0,c.y0+u,c.x0+r*c.value,c.y0,a,h,"x");s.fillStyle=l.gradient;s.beginPath();this._setBarHPoints(s,c.x0,c.y0+l.offset,u-l.offset*2,m,r,c.value,l.offset);s.fill();s.globalAlpha=1;s.restore()}};dhtmlx.assert(dhtmlx.chart.barH);dhtmlx.chart.stackedBarH={pvt_render_stackedBarH:function(D,Q,l,h,E,P){var O,w;var c;var x;var A=h.x-l.x;var o=!!this._settings.yAxis;var n=this._getStackedLimits(Q);O=n.max;w=n.min;var H=Math.floor((h.y-l.y)/Q.length);if(!E){this._drawHScales(D,Q,l,h,w,O,H)}if(o){O=parseFloat(this._settings.xAxis.end);w=parseFloat(this._settings.xAxis.start)}var L=this._getRelativeValue(w,O);x=L[0];c=L[1];var u=(x?A/x:10);if(!o){var y=10;u=(x?(A-y)/x:10)}var v=parseInt(this._settings.width,10);if((v+4)>H){v=H-4}var q=(H-v)/2;var m=0;var r=false;var a=this._settings.gradient;if(a){r=true}if(!o){this._drawLine(D,l.x-0.5,l.y,l.x-0.5,h.y,"#000000",1)}var N=0;var K=0;for(J=0;JO){C=O}C-=w;C*=c;var M=l.x;var g=l.y+q+J*H;if(!K){Q[J].$startX=M}else{M=Q[J].$startX}if(C<0||(this._settings.yAxis&&C===0)){this.canvases.y.renderTextAt("middle",true,M+10,g+v/2,this._settings.label(Q[J]));continue}if(!o){C+=y/u}var F=this._settings.color.call(this,Q[J]);D.globalAlpha=this._settings.alpha.call(this,Q[J]);D.fillStyle=this._settings.color.call(this,Q[J]);D.beginPath();var I=this._setBarHPoints(D,M,g,v,m,u,C,(this._settings.border?1:0));if(a&&!r){D.lineTo(l.x+A,g+(this._settings.border?1:0))}D.fill();if(r!=false){var s=this._setBarGradient(D,M,g+v,M,g,r,F,"x");D.fillStyle=s.gradient;D.beginPath();I=this._setBarHPoints(D,M,g,v,m,u,C,0);D.fill()}if(this._settings.border){this._drawBarHBorder(D,M,g,v,w,m,u,C,F)}D.globalAlpha=1;this.canvases[E].renderTextAt("middle",true,Q[J].$startX+(I[0]-Q[J].$startX)/2-1,g+(I[1]-g)/2,this._settings.label(Q[J]));P.addRect(Q[J].id,[Q[J].$startX-l.x,g-l.y,I[0]-l.x,I[1]-l.y],E);Q[J].$startX=I[0]}}};dhtmlx.chart.stackedBar={pvt_render_stackedBar:function(y,M,h,g,A,L){var J,u;var a;var v;var w=g.y-h.y;var m=!!this._settings.yAxis;var K=!!this._settings.xAxis;var l=this._getStackedLimits(M);J=l.max;u=l.min;var D=Math.floor((g.x-h.x)/M.length);if(!A){this._drawScales(M,h,g,u,J,D)}if(m){J=parseFloat(this._settings.yAxis.end);u=parseFloat(this._settings.yAxis.start)}var H=this._getRelativeValue(u,J);v=H[0];a=H[1];var r=(v?w/v:10);var s=parseInt(this._settings.width,10);if(s+4>D){s=D-4}var n=Math.floor((D-s)/2);var o=(this._settings.gradient?this._settings.gradient:false);if(!K){this._drawLine(y,h.x,g.y+0.5,g.x,g.y+0.5,"#000000",1)}for(var F=0;F=0;m--){v.globalAlpha=a[m];v.strokeStyle="#d0d0d0";v.beginPath();this._strokeChartItem(v,g,u+2*o/3,o+m+1,h.type);v.stroke()}v.beginPath();v.globalAlpha=0.3;v.fillStyle="#bdbdbd";this._strokeChartItem(v,g,u+2*o/3,o+1,h.type);v.fill()}v.restore();v.lineWidth=h.borderWidth;v.fillStyle=h.color.call(this,q);v.strokeStyle=h.borderColor.call(this,q);v.globalAlpha=h.alpha.call(this,q);v.beginPath();this._strokeChartItem(v,g,u,o+1,h.type);v.fill();v.stroke();v.globalAlpha=1}if(s){this.canvases[r].renderTextAt(false,true,g,u-o-this._settings.labelOffset,this._settings.label.call(this,q))}var l=(this._settings.eventRadius||o+1);c.addRect(q.id,[g-l-n.x,u-l-n.y,g+l-n.x,u+l-n.y],r)},_strokeChartItem:function(a,c,l,h,g){var m=[];c=parseInt(c,10);l=parseInt(l,10);if(g&&(g=="square"||g=="s")){h*=Math.sqrt(2)/2;m=[[c-h-a.lineWidth/2,l-h],[c+h,l-h],[c+h,l+h],[c-h,l+h],[c-h,l-h]]}else{if(g&&(g=="diamond"||g=="d")){var n=(a.lineWidth>1?a.lineWidth*Math.sqrt(2)/4:0);m=[[c,l-h],[c+h,l],[c,l+h],[c-h,l],[c+n,l-h-n]]}else{if(g&&(g=="triangle"||g=="t")){m=[[c,l-h],[c+Math.sqrt(3)*h/2,l+h/2],[c-Math.sqrt(3)*h/2,l+h/2],[c,l-h]]}else{m=[[c,l,h,0,Math.PI*2,true]]}}}this._path(a,m)},_getPointY:function(g,o,m,a){var n=a.minValue;var h=a.maxValue;var r=a.unit;var c=a.valueFactor;var q=this._settings.value(g);var s=(parseFloat(q||0)-n)*c;if(!this._settings.yAxis){s+=a.startValue/r}var l=m.y-r*s;if(this._settings.fixOverflow&&(this._settings.view=="line"||this._settings.view=="area")){if(q>h){l={y:o.y,y0:l,out:"max"}}else{if(s<0||qh){l=o.y}if(s<0||qv){this._drawXAxis(A,Q,l,h,E,h.y-s*(this._settings.origin-v))}u=parseInt(this._settings.width,10);var L=0;var H=0;for(I=0;IE){u=parseInt(E/L-4,10)}var q=(E-u*L)/2;var m=(typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(u/5));var r=false;var a=this._settings.gradient;if(a&&typeof(a)!="function"){r=a;a=false}else{if(a){a=A.createLinearGradient(0,h.y,0,l.y);this._settings.gradient(a)}}if(!M){this._drawLine(A,l.x,h.y+0.5,h.x,h.y+0.5,"#000000",1)}for(I=0;IN){y=N}y-=v;y*=c;var K=l.x+q+parseInt(I*E,10)+(u+1)*H;var g=h.y;if(y<0||(this._settings.yAxis&&y===0&&!(this._settings.origin!="auto"&&this._settings.origin>v))){this.canvases[C].renderTextAt(true,true,K+Math.floor(u/2),g,this._settings.label(Q[I]));continue}if(!o&&!(this._settings.origin!="auto"&&M)){y+=x/s}var D=a||this._settings.color.call(this,Q[I]);A.globalAlpha=this._settings.alpha.call(this,Q[I]);var F=this._drawBar(A,l,K,g,u,v,m,s,y,D,a,r);if(r){this._drawBarGradient(A,K,g,u,v,m,s,y,D,r)}if(this._settings.border){this._drawBarBorder(A,K,g,u,v,m,s,y,D)}A.globalAlpha=1;if(F[0]!=K){this.canvases[C].renderTextAt(false,true,K+Math.floor(u/2),F[1],this._settings.label(Q[I]))}else{this.canvases[C].renderTextAt(true,true,K+Math.floor(u/2),F[3],this._settings.label(Q[I]))}P.addRect(Q[I].id,[K-l.x,F[3]-l.y,F[2]-l.x,F[1]-l.y],C)}},_correctBarParams:function(o,l,g,m,n,q,h){var a=this._settings.xAxis;var c=g;if(!!a&&this._settings.origin!="auto"&&(this._settings.origin>h)){g-=(this._settings.origin-h)*n;c=g;m=m-(this._settings.origin-h);if(m<0){m*=(-1);o.translate(l+q,g);o.rotate(Math.PI);l=0;g=0}g-=0.5}return{value:m,x0:l,y0:g,start:c}},_drawBar:function(v,l,C,h,q,r,m,o,u,w,a,n){v.save();v.fillStyle=w;var s=this._correctBarParams(v,C,h,u,o,q,r);var x=this._setBarPoints(v,s.x0,s.y0,q,m,o,s.value,(this._settings.border?1:0));if(a&&!n){v.lineTo(s.x0+(this._settings.border?1:0),l.y)}v.fill();v.restore();var A=s.x0;var y=(s.x0!=C?C+x[0]:x[0]);var g=(s.x0!=C?(s.start-x[1]-s.y0):s.y0);var c=(s.x0!=C?s.start-s.y0:x[1]);return[A,g,y,c]},_drawBarBorder:function(q,c,n,r,l,h,o,m,g){var a;q.save();a=this._correctBarParams(q,c,n,m,o,r,l);this._setBorderStyles(q,g);this._setBarPoints(q,a.x0,a.y0,r,h,o,a.value,q.lineWidth/2,1);q.stroke();q.restore()},_drawBarGradient:function(u,h,r,v,o,n,s,q,l,c){u.save();var g=this._correctBarParams(u,h,r,q,s,v,o);var m=this._setBarGradient(u,g.x0,g.y0,g.x0+v,g.y0-s*g.value+2,c,l,"y");var a=this._settings.border?1:0;u.fillStyle=m.gradient;this._setBarPoints(u,g.x0+m.offset,g.y0,v-m.offset*2,n,s,g.value,m.offset+a);u.fill();u.restore()},_setBarPoints:function(x,h,u,y,o,v,s,l,n){x.beginPath();var c=0;if(o>v*s){var m=(o-v*s)/o;if(m<=1&&m>=-1){c=-Math.acos(m)+Math.PI/2}}x.moveTo(h+l,u);var r=u-Math.floor(v*s)+o+(o?0:l);if(o0){x.arc(g,r,o-l,-Math.PI+c,-Math.PI/2,false)}var a=h+y-o-l;var q=r-o+(o?l:0);x.lineTo(a,q);if(o&&o>0){x.arc(a,r,o-l,-Math.PI/2,0-c,false)}var w=h+y-l;x.lineTo(w,u);if(!n){x.lineTo(h+l,u)}return[w,q]}};dhtmlx.chart.pie={pvt_render_pie:function(c,h,a,m,g,l){this._renderPie(c,h,a,m,1,l,g)},_renderPie:function(s,F,l,h,D,E,u){if(!F.length){return}var v=this._getPieParameters(l,h);var n=(this._settings.radius?this._settings.radius:v.radius);if(n<0){return}var a=this._getValues(F);var m=this._getTotalValue(a);var o=this._getRatios(a,m);var C=(this._settings.x?this._settings.x:v.x);var g=(this._settings.y?this._settings.y:v.y);if(D==1&&this._settings.shadow){this._addShadow(s,C,g,n)}g=g/D;var r=-Math.PI/2;var x=[];s.scale(1,D);if(this._settings.gradient){var A=(D!=1?C+n/3:C);var c=(D!=1?g+n/3:g);this._showRadialGradient(s,C,g,n,A,c)}for(var y=0;y=0)||(g>=0&&a<=Math.PI)||(Math.abs(g-Math.PI)>0.003&&g<=Math.PI&&a>=Math.PI))){return}if(g<=0&&a>=0){g=0;c=false;this._drawSectorLine(h,l,n,m,g,a)}if(g<=Math.PI&&a>=Math.PI){a=Math.PI;c=false;this._drawSectorLine(h,l,n,m,g,a)}var o=(this._settings.height||Math.floor(m/4))/this._settings.cant;h.beginPath();h.arc(l,n,m,g,a,false);h.lineTo(l+m*Math.cos(a),n+m*Math.sin(a)+o);h.arc(l,n+o,m,a,g,true);h.lineTo(l+m*Math.cos(g),n+m*Math.sin(g));h.fill();if(c){h.stroke()}},_drawSectorLine:function(g,h,m,l,c,a){g.beginPath();g.arc(h,m,l,c,a,false);g.stroke()},_addShadow:function(c,a,m,h){c.globalAlpha=0.5;var l=["#c4c4c4","#c6c6c6","#cacaca","#dcdcdc","#dddddd","#e0e0e0","#eeeeee","#f5f5f5","#f8f8f8"];for(var g=l.length-1;g>-1;g--){c.beginPath();c.fillStyle=l[g];c.arc(a+1,m+1,h+g,0,Math.PI*2,true);c.fill()}c.globalAlpha=1},_getGrayGradient:function(a){a.addColorStop(0,"#ffffff");a.addColorStop(0.7,"#7a7a7a");a.addColorStop(1,"#000000");return a},_showRadialGradient:function(g,c,n,a,h,l){g.beginPath();var m;if(typeof this._settings.gradient!="function"){m=g.createRadialGradient(h,l,a/4,c,n,a);m=this._getGrayGradient(m)}else{m=this._settings.gradient(m)}g.fillStyle=m;g.arc(c,n,a,0,Math.PI*2,true);g.fill();g.globalAlpha=0.7},_drawSectorLabel:function(E,c,h,A,w,F,v,a){var u=this.canvases[0].renderText(0,0,v,0,1);if(!u){return}var H=u.scrollWidth;u.style.width=H+"px";if(H>E){H=E}var C=(w-A<0.2?4:8);if(a){C=H/1.8}var g=A+(w-A)/2;h=h-(C-8)/2;var o=-C;var n=-8;var D="right";if(g>=Math.PI/2&&g=Math.PI){o=-H-o+1;D="left"}var l=0;if(!a&&F<1&&(g>0&&g=Math.PI/2&&g=Math.PI)){r+=H/3}}}u.style.top=q+"px";u.style.left=r+"px";u.style.width=H+"px";u.style.textAlign=D;u.style.whiteSpace="nowrap"}};dhtmlx.chart.pie3D={pvt_render_pie3D:function(c,h,a,m,g,l){this._renderPie(c,h,a,m,this._settings.cant,l)}};dhtmlx.chart.donut={pvt_render_donut:function(u,l,r,q,n,c){if(!l.length){return}this._renderPie(u,l,r,q,1,c);var h=this._settings;var m=this._getPieParameters(r,q);var a=(h.radius?h.radius:m.radius);var o=((h.innerRadius&&(h.innerRadius1){if(a){if(l.className.indexOf("hidden")!=-1){this.showSeries(h)}else{this.hideSeries(h)}}}}}},on_dblclick:{},on_mouse_move:{},bind:function(){dhx.BaseBind.legacyBind.apply(this,arguments)},sync:function(){dhx.BaseBind.legacySync.apply(this,arguments)},resize:function(){for(var a in this.canvases){this.canvases[a]._resizeCanvas()}this.render()},view_setter:function(a){if(!dhtmlx.chart[a]){dhtmlx.error("Chart type extension is not loaded: "+a)}if(typeof this._settings.offset=="undefined"){this._settings.offset=!(a=="area"||a=="stackedArea")}if(a=="radar"&&!this._settings.yAxis){this.define("yAxis",{})}if(a=="scatter"){if(!this._settings.yAxis){this.define("yAxis",{})}if(!this._settings.xAxis){this.define("xAxis",{})}}return a},clearCanvas:function(){if(this.canvases&&typeof this.canvases=="object"){for(var a in this.canvases){this.canvases[a].clearCanvas()}}},render:function(){var g,c,h,l,a;if(!this.callEvent("onBeforeRender",[this.data])){return}if(this.canvases&&typeof this.canvases=="object"){for(c in this.canvases){this.canvases[c].clearCanvas()}}else{this.canvases={}}if(this._settings.legend){if(!this.canvases.legend){this.canvases.legend=new dhtmlx.ui.Canvas(this._obj,"legend")}this._drawLegend(this.data.getRange(),this._obj.offsetWidth)}g=this._getChartBounds(this._obj.offsetWidth,this._obj.offsetHeight);l=new dhtmlx.ui.Map(this._id);a=this._settings;h=this._getChartData();for(c=0;c5?10:5);l=parseInt(m,10)*a;if(l>Math.abs(r)){h=(r<0?-l:0)}else{var s=Math.abs(r);var q=Math.floor(this._log10(s));var o=s/Math.pow(10,q);h=Math.ceil(o*10)/10*Math.pow(10,q)-l;if(s>1&&l>0.1){h=Math.ceil(h)}while(r<0?h<=r:h>=r){h-=l}if(r<0){h=-h-2*l}}n=h;while(n1){for(var h=1;ho){o=a}if(g2){m.setAttribute("series_id",c)}a.appendChild(m);return m},_drawLegendMarker:function(C,u,s,l,A,m,o){var c=[];var n=this._settings.legend.marker;var w=this._settings.legend.values;var r=(w&&w[o].markerType?w[o].markerType:n.type);if(l){C.fillStyle=l;C.strokeStyle=this._getDarkenColor(l,0.75)}C.beginPath();if(r=="round"||!n.radius){C.lineWidth=n.height;C.lineCap=r;u+=C.lineWidth/2+5;s+=A/2;C.moveTo(u,s);var a=u+n.width-n.height+1;C.lineTo(a,s)}else{if(r=="item"){if(this._settings.line&&this._settings.view!="scatter"&&!this._settings.disableLines){C.beginPath();C.lineWidth=this._series[o].line.width;C.strokeStyle=m?l:this._series[o].line.color.call(this,{});var g=u+5;var v=s+A/2;C.moveTo(g,v);var a=g+n.width;C.lineTo(a,v);C.stroke()}var h=this._series[o].item;var q=parseInt(h.radius.call(this,{}),10)||0;if(q){C.beginPath();if(m){C.lineWidth=h.borderWidth;C.strokeStyle=l;C.fillStyle=l}else{C.lineWidth=h.borderWidth;C.fillStyle=h.color.call(this,{});C.strokeStyle=h.borderColor.call(this,{});C.globalAlpha=h.alpha.call(this,{})}C.beginPath();u+=n.width/2+5;s+=A/2;this._strokeChartItem(C,u,s,q+1,h.type);C.fill();C.stroke()}C.globalAlpha=1}else{C.lineWidth=1;u+=5;s+=parseInt(A/2-n.height/2,10);c=[[u+n.radius,s+n.radius,n.radius,Math.PI,3*Math.PI/2,false],[u+n.width-n.radius,s],[u+n.width-n.radius,s+n.radius,n.radius,-Math.PI/2,0,false],[u+n.width,s+n.height-n.radius],[u+n.width-n.radius,s+n.height-n.radius,n.radius,0,Math.PI/2,false],[u+n.radius,s+n.height],[u+n.radius,s+n.height-n.radius,n.radius,Math.PI/2,Math.PI,false],[u,s+n.radius]];this._path(C,c)}}C.stroke();C.fill()},_getDarkenColor:function(a,h){var g,c;c=dhtmlx.math.toRgb(a);g=dhtmlx.math.rgbToHsv(c[0],c[1],c[2]);g[2]=g[2]*h;return"rgb("+dhtmlx.math.hsvToRgb(g[0],g[1],g[2])+")"},_getChartBounds:function(a,n){var q,g,o,c;q=this._settings.padding.left;g=this._settings.padding.top;o=a-this._settings.padding.right;c=n-this._settings.padding.bottom;if(this._settings.legend){var l=this._settings.legend;var m=this._settings.legend.width;var h=this._settings.legend.height;if(l.layout=="x"){if(l.valign=="center"){if(l.align=="right"){o-=m}else{if(l.align=="left"){q+=m}}}else{if(l.valign=="bottom"){c-=h}else{g+=h}}}else{if(l.align=="right"){o-=m}else{if(l.align=="left"){q+=m}}}}return{start:{x:q,y:g},end:{x:o,y:c}}},_getStackedLimits:function(l){var c,a,m,h,g;if(this._settings.yAxis&&(typeof this._settings.yAxis.end!="undefined")&&(typeof this._settings.yAxis.start!="undefined")&&this._settings.yAxis.step){m=parseFloat(this._settings.yAxis.end);h=parseFloat(this._settings.yAxis.start)}else{for(c=0;cm){m=l[c].$sum}if(l[c].$min0){h=0}}return{max:m,min:h}},_setBarGradient:function(w,c,s,a,q,o,h,g){var r,l,n,m,v,u;if(o=="light"){if(g=="x"){r=w.createLinearGradient(c,s,a,s)}else{r=w.createLinearGradient(c,s,c,q)}u=[[0,"#FFFFFF"],[0.9,h],[1,h]];l=2}else{if(o=="falling"||o=="rising"){if(g=="x"){r=w.createLinearGradient(c,s,a,s)}else{r=w.createLinearGradient(c,s,c,q)}n=dhtmlx.math.toRgb(h);m=dhtmlx.math.rgbToHsv(n[0],n[1],n[2]);m[1]*=1/2;v="rgb("+dhtmlx.math.hsvToRgb(m[0],m[1],m[2])+")";if(o=="falling"){u=[[0,v],[0.7,h],[1,h]]}else{if(o=="rising"){u=[[0,h],[0.3,h],[1,v]]}}l=0}else{w.globalAlpha=0.37;l=0;if(g=="x"){r=w.createLinearGradient(c,q,c,s)}else{r=w.createLinearGradient(c,s,a,s)}u=[[0,"#9d9d9d"],[0.3,"#e8e8e8"],[0.45,"#ffffff"],[0.55,"#ffffff"],[0.7,"#e8e8e8"],[1,"#9d9d9d"]]}}this._gradient(r,u);return{gradient:r,offset:l}},_getPositionByAngle:function(g,c,l,h){g*=(-1);c=c+Math.cos(g)*h;l=l-Math.sin(g)*h;return{x:c,y:l}},_gradient:function(g,c){for(var a=0;a2){h="arc"}a[h].apply(a,g[c])}},_circle:function(c,a,h,g){c.arc(a,h,g,Math.PI*2,true)},_addMapRect:function(h,l,a,g,c){h.addRect(l,[a[0].x-g.x,a[0].y-g.y,a[1].x-g.x,a[1].y-g.y],c)}};dhtmlx.compat("layout");dhtmlx.ui.pager=function(a){this.name="Pager";if(dhtmlx.assert_enabled()){this._assert()}dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_pager");dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.SingleRender);dhtmlx.extend(this,dhtmlx.MouseEvents);this._parseSettings(a,{size:10,page:-1,group:5,count:0,type:"default"});this.data=this._settings;this.refresh()};dhtmlx.ui.pager.prototype={_id:"dhx_p_id",on_click:{dhx_pager_item:function(a,c){this.select(c)}},select:function(a){switch(a){case"next":a=this._settings.page+1;break;case"prev":a=this._settings.page-1;break;case"first":a=0;break;case"last":a=this._settings.limit-1;break;default:break}if(a<0){a=0}if(a>=this.data.limit){a=this.data.limit-1}if(this.callEvent("onBeforePageChange",[this._settings.page,a])){this.data.page=a*1;this.refresh();this.callEvent("onAfterPageChange",[a])}},types:{"default":{template:dhtmlx.Template.fromHTML("{common.pages()}"),pages:function(g){var c="";if(g.page==-1){return""}g.min=g.page-Math.round((g.group-1)/2);g.max=g.min+g.group-1;if(g.min<0){g.max+=g.min*(-1);g.min=0}if(g.max>=g.limit){g.min-=Math.min(g.min,g.max-g.limit+1);g.max=g.limit-1}for(var a=(g.min||0);a<=g.max;a++){c+=this.button({id:a,index:(a+1),selected:(a==g.page?"_selected":"")})}return c},page:function(a){return a.page+1},first:function(){return this.button({id:"first",index:" << ",selected:""})},last:function(){return this.button({id:"last",index:" >> ",selected:""})},prev:function(){return this.button({id:"prev",index:"<",selected:""})},next:function(){return this.button({id:"next",index:">",selected:""})},button:dhtmlx.Template.fromHTML("
{obj.index}
")}},refresh:function(){var a=this._settings;a.limit=Math.ceil(a.count/a.size);if(a.limit&&a.limit!=a.old_limit){a.page=Math.min(a.limit-1,a.page)}var c=a.page;if(c!=-1&&(c!=a.old_page)||(a.limit!=a.old_limit)){this.render();this.callEvent("onRefresh",[]);a.old_limit=a.limit;a.old_page=a.page}},template_item_start:dhtmlx.Template.fromHTML("
"),template_item_end:dhtmlx.Template.fromHTML("
")};dhtmlx.DataProcessor={_dp_init:function(c){var a="_methods";c[a]=["setItemStyle","","changeId","remove"];this.attachEvent("onAfterAdd",function(g){c.setUpdated(g,true,"inserted")});this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(h,g){if(h.getUserData){h.getUserData(g,this._userdata)}},this));this.attachEvent("onBeforeDelete",function(h){if(c._silent_mode){return true}var g=c.getState(h);if(g=="inserted"){c.setUpdated(h,false);return true}if(g=="deleted"){return false}if(g=="true_deleted"){return true}c.setUpdated(h,true,"deleted");return false});this.attachEvent("onAfterEditStop",function(g){c.setUpdated(g,true,"updated")});this.attachEvent("onBindUpdate",function(g){window.setTimeout(function(){c.setUpdated(g.id,true,"updated")},1)});a="_getRowData";c[a]=function(n,g){var l=this.obj.data.get(n);var m={};for(var h in l){if(h.indexOf("_")===0){continue}m[h]=l[h]}return m};a="_clearUpdateFlag";c[a]=function(){};this._userdata={};c.attachEvent("insertCallback",this._dp_callback);c.attachEvent("updateCallback",this._dp_callback);c.attachEvent("deleteCallback",function(g,h){this.obj.setUserData(h,this.action_param,"true_deleted");this.obj.remove(h)});dhtmlx.compat("dataProcessor",c)},_dp_callback:function(a,c){this.obj.data.set(c,dhtmlx.DataDriver.xml.getDetails(a.firstChild));this.obj.data.refresh(c)},setItemStyle:function(g,a){var c=this._locateHTML(g);if(c){c.style.cssText+=";"+a}},changeId:function(c,a){this.data.changeId(c,a);this.refresh()},setUserData:function(g,a,c){if(g){this.data.get(g)[a]=c}else{this._userdata[a]=c}},getUserData:function(c,a){return c?this.data.get(c)[a]:this._userdata[a]}};(function(){var a="_dp_init";dhtmlx.DataProcessor[a]=dhtmlx.DataProcessor._dp_init})();dhtmlx.compat.dnd=function(){if(window.dhtmlDragAndDropObject){var o="_dragged";var h=dhtmlDragAndDropObject.prototype.checkLanding;dhtmlDragAndDropObject.prototype.checkLanding=function(r,s,q){h.apply(this,arguments);if(!q){var u=dhtmlx.DragControl._drag_context=dhtmlx.DragControl._drag_context||{};if(!u.from){u.from=this.dragStartObject}dhtmlx.DragControl._checkLand(r,s,true)}};var c=dhtmlDragAndDropObject.prototype.stopDrag;dhtmlDragAndDropObject.prototype.stopDrag=function(s,q,r){if(!r){if(dhtmlx.DragControl._last){dhtmlx.DragControl._active=n.dragStartNode;dhtmlx.DragControl._stopDrag(s,true)}}c.apply(this,arguments)};var n=new dhtmlDragAndDropObject();var l=dhtmlx.DragControl._startDrag;dhtmlx.DragControl._startDrag=function(){l.apply(this,arguments);var u=dhtmlx.DragControl._drag_context;if(!u){return}var s=[];var r=[];for(var q=0;q"+c.innerHTML+""}};dhtmlx.DragItem={_init:function(){dhtmlx.assert(this.move,"DragItem :: Component doesn't have DataMove interface");dhtmlx.assert(this.locate,"DragItem :: Component doesn't have RenderStack interface");dhtmlx.assert(dhtmlx.DragControl,"DragItem :: DragControl is not included");if(!this._settings||this._settings.drag){dhtmlx.DragItem._initHandlers(this)}else{if(this._settings){this.drag_setter=function(a){if(a){this._initHandlers(this);delete this.drag_setter}return a}}}if(this.dragMarker){this.attachEvent("onBeforeDragIn",this.dragMarker);this.attachEvent("onDragOut",this.dragMarker)}},_initHandlers:function(a){dhtmlx.DragControl.addDrop(a._obj,a,true);dhtmlx.DragControl.addDrag(a._obj,a)},onDragIn:function(h,g,l){var n=this.locate(l)||null;var c=dhtmlx.DragControl._drag_context;var m=dhtmlx.DragControl.getMaster(h);var a=(this._locateHTML(n)||this._obj);if(a==dhtmlx.DragControl._landing){return a}c.target=n;c.to=m;if(!this.callEvent("onBeforeDragIn",[c,l])){c.id=null;return null}dhtmlx.html.addCss(a,"dhx_drag_over");return a},onDragOut:function(h,g,o,l){var m=this.locate(l)||null;if(o!=this._dataobj){m=null}var c=(this._locateHTML(m)||(o?dhtmlx.DragControl.getMaster(o)._obj:window.undefined));if(c==dhtmlx.DragControl._landing){return null}var a=dhtmlx.DragControl._drag_context;dhtmlx.html.removeCss(dhtmlx.DragControl._landing,"dhx_drag_over");a.target=a.to=null;this.callEvent("onDragOut",[a,l]);return null},onDrop:function(g,c,l,h){var a=dhtmlx.DragControl._drag_context;a.to=this;a.index=a.target?this.indexById(a.target):this.dataCount();a.new_id=dhtmlx.uid();if(!this.callEvent("onBeforeDrop",[a,h])){return}if(a.from==a.to){this.move(a.source,a.index)}else{if(a.from){a.from.move(a.source,a.index,a.to,a.new_id)}else{dhtmlx.error("Unsopported d-n-d combination")}}this.callEvent("onAfterDrop",[a,h])},onDrag:function(g,l){var m=this.locate(l);var h=[m];if(m){if(this.getSelected){var c=this.getSelected();if(dhtmlx.PowerArray.find.call(c,m)!=-1){h=c}}var a=dhtmlx.DragControl._drag_context={source:h,start:m};a.from=this;if(this.callEvent("onBeforeDrag",[a,l])){return a.html||this._toHTML(this.get(m))}}return null}};dhtmlx.EditAbility={_init:function(a){this._edit_id=null;this._edit_bind=null;dhtmlx.assert(this.data,"EditAbility :: Component doesn't have DataStore");dhtmlx.assert(this._locateHTML,"EditAbility :: Component doesn't have RenderStack");this.attachEvent("onEditKeyPress",function(g,h,c){if(g==13&&!c){this.stopEdit()}else{if(g==27){this.stopEdit(true)}}});this.attachEvent("onBeforeRender",function(){this.stopEdit()})},isEdit:function(){return this._edit_id},edit:function(c){if(this.stopEdit(false,c)){if(!this.callEvent("onBeforeEditStart",[c])){return}var a=this.data.get(c);if(a.$template){return}a.$template="edit";this.data.refresh(c);this._edit_id=c;this._save_binding(c);this._edit_bind(true,a);this.callEvent("onAfterEditStart",[c])}},stopEdit:function(g,l){if(!this._edit_id){return true}if(this._edit_id==l){return false}var a={};if(!g){this._edit_bind(false,a)}else{a=null}if(!this.callEvent("onBeforeEditStop",[this._edit_id,a])){return false}var c=this.data.get(this._edit_id);c.$template=null;if(!g){this._edit_bind(false,c)}var h=this._edit_id;this._edit_bind=this._edit_id=null;this.data.refresh(h);this.callEvent("onAfterEditStop",[h,a]);return true},_save_binding:function(o){var a=this._locateHTML(o);var g="";var m="";var l=[];if(a){var h=a.getElementsByTagName("*");var n="";for(var c=0;c=0;c--){if(this._selected[c]==g){this._selected[c]=a}}},_data_filtered:function(){for(var a=this._selected.length-1;a>=0;a--){if(this.data.indexById(this._selected[a])<0){var g=this._selected[a]}var c=this.item(g);if(c){delete c.$selected}this._selected.splice(a,1);this.callEvent("onSelectChange",[g])}},_data_updated:function(g,c,a){if(a=="delete"){this._selected.remove(g)}else{if(!this.data.dataCount()&&!this.data._filter_order){this._selected=dhtmlx.toArray()}}},_data_loaded:function(){if(this._settings.select){this.data.each(function(a){if(a.$selected){this.select(a.id)}},this)}},_select_mark:function(g,c,a){if(!a&&!this.callEvent("onBeforeSelect",[g,c])){return false}this.data.item(g).$selected=c;if(a){a.push(g)}else{if(c){this._selected.push(g)}else{this._selected.remove(g)}this._refresh_selection(g)}return true},select:function(h,g,a){if(!h){return this.selectAll()}if(h instanceof Array){for(var c=0;c100||a.length>this.data.dataCount/2},_refresh_selection:function(c){if(typeof c!="object"){c=[c]}if(!c.length){return}if(this._is_mass_selection(c)){this.data.refresh()}else{for(var a=0;ac){if(!g){this.order[c]=dhtmlx.uid();g={id:this.order[c],$template:"loading"};this._unrendered_area.push(this.order[c])}else{if(g.$template=="loading"){this._unrendered_area.push(this.order[c])}}a.push(g)}}return a},render:function(m,h,g,l){if(m){var a=this._locateHTML(m);switch(g){case"update":if(!a){return}var c=this._htmlmap[m]=this._toHTMLObject(h);dhtmlx.html.insertBefore(c,a);dhtmlx.html.remove(a);break;default:this._render_delayed();break}}else{if(this.callEvent("onBeforeRender",[this.data])){this._htmlmap={};this._render_visible_rows(null,true);this._wait_for_render=false;this.callEvent("onAfterRender",[])}}},_render_delayed:function(){if(this._wait_for_render){return}this._wait_for_render=true;window.setTimeout(dhtmlx.bind(function(){this.render()},this),1)},_create_placeholder:function(a){var c=document.createElement("DIV");c.style.cssText="height:"+a+"px; width:100%; overflow:hidden;";return c},_render_visible_rows:function(A,E){this.data._unrendered_area=[];var y=this._getVisibleRange();if(!this._dataobj.firstChild||E){this._dataobj.innerHTML="";this._dataobj.appendChild(this._create_placeholder(y._max));this._htmlrows=[this._dataobj.firstChild]}var l=Math.max(y._from,0);var x=(this.data.max||this.data.max===0)?this.data.max:Infinity;while(l<=y._height){while(this._htmlrows[l]&&this._htmlrows[l]._filled&&l<=y._height){l++}if(l>y._height){break}var o=l;while(!this._htmlrows[o]){o--}var a=this._htmlrows[o];var g=l*y._dx+(this.data.min||0);if(g>x){break}var m=Math.min(g+y._dx-1,x);var r=this._create_placeholder(y._y);var n=this.data.getIndexRange(g,m);if(!n.length){break}r.innerHTML=n.map(this._toHTML,this).join("");for(var v=0;v0){a.style.height=u+"px";this._htmlrows[l+1]=a}else{if(D<0){dhtmlx.html.remove(a)}else{a.style.height=D+"px"}if(u>0){var q=this._htmlrows[l+1]=this._create_placeholder(u);dhtmlx.html.insertBefore(q,r.nextSibling,this._dataobj)}}l++}if(this.data._unrendered_area.length){var s=this.indexById(this.data._unrendered_area[0]);var c=this.indexById(this.data._unrendered_area.pop())+1;if(c>s){if(!this.callEvent("onDataRequest",[s,c-s])){return false}dhtmlx.assert(this.data.feed,"Data feed is missed");this.data.feed.call(this,s,c-s)}}if(dhtmlx._isIE){var C=this._getVisibleRange();if(C._from!=y._from){this._render_visible_rows()}}},_getVisibleRange:function(){var c=dhtmlx.$customScroll?0:18;var n=this._dataobj.scrollTop;var a=Math.max(this._dataobj.scrollWidth,this._dataobj.offsetWidth)-c;var o=this._dataobj.offsetHeight;var r=this.type;var h=this._getDimension();var s=Math.floor(a/h.x)||1;var g=Math.floor(n/h.y);var q=Math.ceil((o+n)/h.y)-1;var l=this.data.max?(this.data.max-this.data.min):this.data.dataCount();var m=Math.ceil(l/s)*h.y;return{_from:g,_height:q,_top:n,_max:m,_y:h.y,_dx:s}}};dhtmlXDataView=function(a){this.name="DataView";this.version="3.0";if(dhtmlx.assert_enabled()){this._assert()}dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_dataview");dhtmlx.extend(this,dhtmlx.AtomDataLoader);dhtmlx.extend(this,dhtmlx.DataLoader);dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.RenderStack);dhtmlx.extend(this,dhtmlx.SelectionModel);dhtmlx.extend(this,dhtmlx.MouseEvents);dhtmlx.extend(this,dhtmlx.KeyEvents);dhtmlx.extend(this,dhtmlx.EditAbility);dhtmlx.extend(this,dhtmlx.DataMove);dhtmlx.extend(this,dhtmlx.DragItem);dhtmlx.extend(this,dhtmlx.DataProcessor);dhtmlx.extend(this,dhtmlx.AutoTooltip);dhtmlx.extend(this,dhtmlx.Destruction);this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render.apply(this,arguments)},this));this._parseSettings(a,{drag:false,edit:false,select:"multiselect",type:"default"});if(this._settings.height!="auto"&&!this._settings.renderAll){dhtmlx.extend(this,dhtmlx.VirtualRenderStack)}this.data.provideApi(this,true);if(dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(this)}};dhtmlXDataView.prototype={bind:function(){dhx.BaseBind.legacyBind.apply(this,arguments)},sync:function(){dhx.BaseBind.legacySync.apply(this,arguments)},dragMarker:function(g,l){var h=this._locateHTML(g.target);if(this.type.drag_marker){if(this._drag_marker){this._drag_marker.style.backgroundImage="";this._drag_marker.style.backgroundRepeat=""}if(h){h.style.backgroundImage="url("+(dhtmlx.image_path||"")+this.type.drag_marker+")";h.style.backgroundRepeat="no-repeat";this._drag_marker=h}}if(h&&this._settings.auto_scroll){var a=h.offsetTop;var m=h.offsetHeight;var c=this._obj.scrollTop;var n=this._obj.offsetHeight;if(a-m>=0&&a-m*0.75c+n){c=c+m}}this._obj.scrollTop=c}return true},_id:"dhx_f_id",on_click:{dhx_dataview_item:function(a,c){if(this.stopEdit(false,c)){if(this._settings.select){if(this._settings.select=="multiselect"){this.select(c,a.ctrlKey,a.shiftKey)}else{this.select(c)}}}}},on_dblclick:{dhx_dataview_item:function(a,c){if(this._settings.edit){this.edit(c)}}},on_mouse_move:{},types:{"default":{css:"default",template:dhtmlx.Template.fromHTML("
{obj.text}
"),template_edit:dhtmlx.Template.fromHTML("
"),template_loading:dhtmlx.Template.fromHTML("
Loading...
"),width:210,height:115,margin:0,padding:10,border:1}},template_item_start:dhtmlx.Template.fromHTML("
"),template_item_end:dhtmlx.Template.fromHTML("
")};dhtmlx.compat("layout");function xmlPointer(a){this.d=a}xmlPointer.prototype={text:function(){if(!_isFF){return this.d.xml}var a=new XMLSerializer();return a.serializeToString(this.d)},get:function(a){return this.d.getAttribute(a)},exists:function(){return !!this.d},content:function(){return this.d.firstChild?(this.d.firstChild.wholeText||this.d.firstChild.data):""},each:function(h,n,m,l){var g=this.d.childNodes;var o=new xmlPointer();if(g.length){for(l=l||0;l0){v=new Object;v.tr=o.childNodes[0].tr.previousSibling}o._has_top=true;for(l=s;l>0;l--){F[l]=F[l-1]}s=0;break}}}var u;if(!(u=this._idpull[m])||u.span!=-1){u=F[s]=new dhtmlXTreeItemObject(m,h,o,this,q,1);m=F[s].id;o.childsCount++}if(!u.htmlNode){u.label=h;u.htmlNode=this._createItem((this.checkBoxOff?1:0),u);u.htmlNode.objBelong=u}if(E){u.images[0]=E}if(D){u.images[1]=D}if(C){u.images[2]=C}var c=this._drawNewTr(u.htmlNode);if((this.XMLloadingWarning)||(this._hAdI)){u.htmlNode.parentNode.parentNode.style.display="none"}if((v)&&v.tr&&(v.tr.nextSibling)){o.htmlNode.childNodes[0].insertBefore(c,v.tr.nextSibling)}else{if(this.parsingOn==o.id){this.parsedArray[this.parsedArray.length]=c}else{o.htmlNode.childNodes[0].appendChild(c)}}if((v)&&(!v.span)){v=null}if(this.XMLsource){if((g)&&(g!=0)){u.XMLload=0}else{u.XMLload=1}}u.tr=c;c.nodem=u;if(o.itemId==0){c.childNodes[0].className="hiddenRow"}if((o._r_logic)||(this._frbtr)){this._setSrc(u.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.imPath+this.radioArray[0])}if(r){var x=r.split(",");for(var y=0;y=2){this._correctPlus(F[o.childsCount-2]);this._correctLine(F[o.childsCount-2])}if(o.childsCount!=2){this._correctPlus(F[0])}if(this.tscheck){this._correctCheckStates(o)}if(this._onradh){if(this.xmlstate==1){var a=this.onXLE;this.onXLE=function(n){this._onradh(m);if(a){a(n)}}}else{this._onradh(m)}}}return u};dhtmlXTreeObject.prototype.enableContextMenu=function(a){if(a){this.cMenu=a}};dhtmlXTreeObject.prototype.setItemContextMenu=function(m,h){var a=m.toString().split(this.dlmtr);for(var g=0;g=0;l--){if(v.childNodes[l]._dmark){this.deleteItem(v.childNodes[l].id)}}}var r=this._globalIdStorageFind(this.parsingOn);for(var l=0;l1){if(((h[1].style.display!="none")||(l==1))&&(l!=2)){this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0";nodestyle="none"}else{nodestyle=""}for(var g=1;g7){a.style.width="999999px"}else{if(!window._KHTMLrv){a.style.width="100%"}}s.span.innerHTML=s.label;a.appendChild(s.span);a.parentObject=s;h.parentObject=s;a.onclick=this.onRowSelect;h.onclick=this.onRowClick;a.ondblclick=this.onRowClick2;if(this.ettip){r.title=s.label}if(this.dragAndDropOff){if(this._aimgs){this.dragger.addDraggableItem(c,this);c.parentObject=s}this.dragger.addDraggableItem(a,this)}s.span.style.paddingLeft="5px";s.span.style.paddingRight="5px";a.style.verticalAlign="";a.style.fontSize="10pt";a.style.cursor=this.style_pointer;r.appendChild(h);r.appendChild(g);r.appendChild(c);r.appendChild(a);n.appendChild(r);v.appendChild(n);if(this.ehlt||this.checkEvent("onMouseIn")||this.checkEvent("onMouseOut")){r.onmousemove=this._itemMouseIn;r[(_isIE)?"onmouseleave":"onmouseout"]=this._itemMouseOut}return v};dhtmlXTreeObject.prototype.setImagePath=function(a){this.imPath=a;this.iconURL=a};dhtmlXTreeObject.prototype.setIconPath=function(a){this.iconURL=a};dhtmlXTreeObject.prototype._getLeafCount=function(h){var g=0;for(var c=0;cthis._getNodeLevel(g,0)){if(!this.dropLower){return this._moveNodeTo(a,h.parentObject)}else{if(g.id!=this.rootId){return this._moveNodeTo(a,g.parentObject,g)}else{return this._moveNodeTo(a,this.htmlNode,null)}}}else{return this._moveNodeTo(a,g.parentObject,g)}}else{return this._moveNodeTo(a,c)}};dhtmlXTreeObject.prototype._fixNodesCollection=function(o,m){var c=0;var h=0;var n=o.childNodes;var a=o.childsCount-1;if(m==n[a]){return}for(var l=0;l=2){this._correctPlus(v[w.childsCount-2]);this._correctLine(v[w.childsCount-2])}}this._correctPlus(v[w.childsCount-1]);if(this.tscheck){this._correctCheckStates(w)}if(g.tscheck){g._correctCheckStates(r)}}if(q>1){g._correctPlus(r.childNodes[q-2]);g._correctLine(r.childNodes[q-2])}g._correctPlus(r);g._correctLine(r);this._fixChildCountLabel(w);g._fixChildCountLabel(r);this.callEvent("onDrop",[u.id,w.id,(s?s.id:null),g,w.treeNod]);return u.id};dhtmlXTreeObject.prototype._clearStyles=function(a){if(!a.htmlNode){return}var h=a.htmlNode.childNodes[0].childNodes[0].childNodes[1];var c=h.nextSibling.nextSibling;a.span.innerHTML=a.label;a.i_sel=false;if(a._aimgs){this.dragger.removeDraggableItem(h.nextSibling)}if(this.checkBoxOff){h.childNodes[0].style.display="";h.childNodes[0].onclick=this.onCheckBoxClick;this._setSrc(h.childNodes[0],this.imPath+this.checkArray[a.checkstate])}else{h.style.display="none"}h.childNodes[0].treeNod=this;this.dragger.removeDraggableItem(c);if(this.dragAndDropOff){this.dragger.addDraggableItem(c,this)}if(this._aimgs){this.dragger.addDraggableItem(h.nextSibling,this)}c.childNodes[0].className="standartTreeRow";c.onclick=this.onRowSelect;c.ondblclick=this.onRowClick2;h.previousSibling.onclick=this.onRowClick;this._correctLine(a);this._correctPlus(a);for(var g=0;g0)){if(g.childNodes[c].unParsed){var a=this._getAllScraggyItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllScraggyItems(g.childNodes[c])}if(a){if(h){h+=this.dlmtr+a}else{h=a}}}else{if(!h){h=""+g.childNodes[c].id}else{h+=this.dlmtr+g.childNodes[c].id}}}return h};dhtmlXTreeObject.prototype._getAllFatItems=function(g){var h="";for(var c=0;c0)){if(!h){h=""+g.childNodes[c].id}else{h+=this.dlmtr+g.childNodes[c].id}if(g.childNodes[c].unParsed){var a=this._getAllFatItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllFatItems(g.childNodes[c])}if(a){h+=this.dlmtr+a}}}return h};dhtmlXTreeObject.prototype._getAllSubItems=function(m,l,h){if(h){c=h}else{var c=this._globalIdStorageFind(m)}if(!c){return 0}l="";for(var g=0;g=c.childsCount)){return null}return c.childNodes[a].id};dhtmlXTreeObject.prototype.getChildItemIdByIndex=function(g,a){var c=this._globalIdStorageFind(g);if((!c)||(a>=c.childsCount)){return null}return c.childNodes[a].id};dhtmlXTreeObject.prototype.setDragHandler=function(a){this.attachEvent("onDrag",a)};dhtmlXTreeObject.prototype._clearMove=function(){if(this._lastMark){this._lastMark.className=this._lastMark.className.replace(/dragAndDropRow/g,"");this._lastMark=null}this.selectionBar.style.display="none";this.allTree.className=this.allTree.className.replace(" selectionBox","")};dhtmlXTreeObject.prototype.enableDragAndDrop=function(c,a){if(c=="temporary_disabled"){this.dADTempOff=false;c=true}else{this.dADTempOff=true}this.dragAndDropOff=convertStringToBoolean(c);if(this.dragAndDropOff){this.dragger.addDragLanding(this.allTree,this)}if(arguments.length>1){this._ddronr=(!convertStringToBoolean(a))}};dhtmlXTreeObject.prototype._setMove=function(l,g,n){if(l.parentObject.span){var h=getAbsoluteTop(l);var c=getAbsoluteTop(this.allTree)-this.allTree.scrollTop;this.dadmodec=this.dadmode;this.dadmodefix=0;if(this.dadmode==2){var m=n-h+(document.body.scrollTop||document.documentElement.scrollTop)-2-l.offsetHeight/2;if((Math.abs(m)-l.offsetHeight/6)>0){this.dadmodec=1;if(m<0){this.dadmodefix=0-l.offsetHeight}}else{this.dadmodec=0}}if(this.dadmodec==0){var a=l.parentObject.span;a.className+=" dragAndDropRow";this._lastMark=a}else{this._clearMove();this.selectionBar.style.top=(h-c+((parseInt(l.parentObject.span.parentNode.previousSibling.childNodes[0].style.height)||18)-1)+this.dadmodefix)+"px";this.selectionBar.style.left="5px";if(this.allTree.offsetWidth>20){this.selectionBar.style.width=(this.allTree.offsetWidth-(_isFF?30:25))+"px"}this.selectionBar.style.display=""}this._autoScroll(null,h,c)}};dhtmlXTreeObject.prototype._autoScroll=function(g,c,a){if(this.autoScroll){if(g){c=getAbsoluteTop(g);a=getAbsoluteTop(this.allTree)-this.allTree.scrollTop}if((c-a-parseInt(this.allTree.scrollTop))>(parseInt(this.allTree.offsetHeight)-50)){this.allTree.scrollTop=parseInt(this.allTree.scrollTop)+20}if((c-a)<(parseInt(this.allTree.scrollTop)+30)){this.allTree.scrollTop=parseInt(this.allTree.scrollTop)-20}}};dhtmlXTreeObject.prototype._createDragNode=function(l,h){if(!this.dADTempOff){return null}var g=l.parentObject;if(!this.callEvent("onBeforeDrag",[g.id,h])){return null}if(!g.i_sel){this._selectItem(g,h)}this._checkMSelectionLogic();var c=document.createElement("div");var m=new Array();if(this._itim_dg){for(var a=0;a"+this._selected[a].span.innerHTML+""}}else{m=this.getSelectedItemText().split(this.dlmtr)}c.innerHTML=m.join("");c.style.position="absolute";c.className="dragSpanDiv";this._dragged=(new Array()).concat(this._selected);return c};dhtmlXTreeObject.prototype._focusNode=function(a){var c=getAbsoluteTop(a.htmlNode)-getAbsoluteTop(this.allTree);if((c>(this.allTree.offsetHeight-30))||(c<0)){this.allTree.scrollTop=c+this.allTree.scrollTop}};dhtmlXTreeObject.prototype._preventNsDrag=function(a){if((a)&&(a.preventDefault)){a.preventDefault();return false}return false};dhtmlXTreeObject.prototype._drag=function(n,o,a){if(this._autoOpenTimer){clearTimeout(this._autoOpenTimer)}if(!a.parentObject){a=this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];this.dadmodec=0}this._clearMove();var m=n.parentObject.treeNod;if((m)&&(m._clearMove)){m._clearMove("")}if((!this.dragMove)||(this.dragMove())){if((!m)||(!m._clearMove)||(!m._dragged)){var h=new Array(n.parentObject)}else{var h=m._dragged}var c=a.parentObject;for(var l=0;l2)?(a.checkstate-3):a.checkstate);this._setCheck(a);if(a.dscheck<3){a.dscheck=false}};dhtmlXTreeObject.prototype.smartRefreshBranch=function(c,a){this._branchUpdate=1;this.smartRefreshItem(c,a)};dhtmlXTreeObject.prototype.smartRefreshItem=function(h,g){var a=this._globalIdStorageFind(h);for(var c=0;c0)){if(g.childNodes[c].unParsed){var a=this._getAllScraggyItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllScraggyItems(g.childNodes[c])}if(a){if(h){h+=this.dlmtr+a}else{h=a}}}else{if(!h){h=""+g.childNodes[c].id}else{h+=this.dlmtr+g.childNodes[c].id}}}return h};dhtmlXTreeObject.prototype._getAllFatItems=function(g){var h="";for(var c=0;c0)){if(!h){h=""+g.childNodes[c].id}else{h+=this.dlmtr+g.childNodes[c].id}if(g.childNodes[c].unParsed){var a=this._getAllFatItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllFatItems(g.childNodes[c])}if(a){h+=this.dlmtr+a}}}return h};dhtmlXTreeObject.prototype.getAllItemsWithKids=function(){return this._getAllFatItems(this.htmlNode)};dhtmlXTreeObject.prototype.getAllFatItems=dhtmlXTreeObject.prototype.getAllItemsWithKids;dhtmlXTreeObject.prototype.getAllChecked=function(){return this._getAllChecked("","",1)};dhtmlXTreeObject.prototype.getAllUnchecked=function(a){if(a){a=this._globalIdStorageFind(a)}return this._getAllChecked(a,"",0)};dhtmlXTreeObject.prototype.getAllPartiallyChecked=function(){return this._getAllChecked("","",2)};dhtmlXTreeObject.prototype.getAllCheckedBranches=function(){var a=[this._getAllChecked("","",1)];var c=this._getAllChecked("","",2);if(c){a.push(c)}return a.join(this.dlmtr)};dhtmlXTreeObject.prototype._getAllChecked=function(h,g,l){if(!h){h=this.htmlNode}if(h.checkstate==l){if(!h.nocheckbox){if(g){g+=this.dlmtr+h.id}else{g=""+h.id}}}var a=h.childsCount;for(var c=0;c";g.span.style.paddingRight=g.span.style.paddingLeft="0px";g.span.onclick=g.span.ondblclick=function(m){(m||event).cancelBubble=true};g.span.childNodes[0].value=h;g.span.childNodes[0].onselectstart=function(m){(m||event).cancelBubble=true;return true};g.span.childNodes[0].onmousedown=function(m){(m||event).cancelBubble=true;return true};g.span.childNodes[0].focus();g.span.childNodes[0].focus();g.span.onclick=function(m){(m||event).cancelBubble=true;return false};g.span.className="";g.span.parentNode.className="";var c=this;g.span.childNodes[0].onkeydown=function(m){if(!m){m=window.event}if(m.keyCode==13){m.cancelBubble=true;c._stopEdit(window.undefined)}else{if(m.keyCode==27){c._stopEdit(window.undefined,true)}}(m||event).cancelBubble=true};this.callEvent("onEdit",[1,l,this])}};function jsonPointer(c,a){this.d=c;this.dp=a}jsonPointer.prototype={text:function(){var a=function(l){var h=[];for(var g=0;g"+cont+"")}window[id]=t;var oninit=obj.getAttribute("oninit");if(oninit){eval(oninit)}return t}function dhx_init_trees(){var c=document.getElementsByTagName("div");for(var a=0;a0)){return a.childNodes[0]}if((a.tr)&&(a.tr.nextSibling)&&(a.tr.nextSibling.nodem)){return a.tr.nextSibling.nodem}if(a.parentObject){return this._getNextVisibleNode(a.parentObject,1)}return a};dhtmlXTreeObject.prototype._getPrevVisibleNode=function(a){if((a.tr)&&(a.tr.previousSibling)&&(a.tr.previousSibling.nodem)){return this._lastVisibleChild(a.tr.previousSibling.nodem)}if(a.parentObject){return a.parentObject}else{return a}};dhtmlXTreeObject.prototype._lastVisibleChild=function(a){if(this._getOpenState(a)>0){return this._lastVisibleChild(a.childNodes[a.childsCount-1])}else{return a}};dhtmlXTreeObject.prototype._searchItemByKey=function(c){if(c.keyCode==8){this._textSearchString="";return true}var a=String.fromCharCode(c.keyCode).toUpperCase();if(a.match(/[A-Z,a-z,0-9\ ]/)){this._textSearchString+=a;this._textSearchInProgress=true;if(!(this.getSelectedItemText()||"").match(RegExp("^"+this._textSearchString,"i"))){this.findItem(this._textSearchString,0)}this._textSearchInProgress=false;if(c.preventDefault){c.preventDefault()}(c||event).cancelBubble=true;return false}return true};dhtmlXTreeObject.prototype.assignKeys=function(a){this._navKeys=a};dhtmlXTreeObject.prototype.enableKeySearch=function(c){this._textSearch=convertStringToBoolean(c);if(!this._textSearch){return}this._textSearchString="";var a=this;this._markItem2=this._markItem;this._markItem=function(g){if(!a._textSearchInProgress){a._textSearchString=""}a._markItem2(g)}};dhtmlXTreeObject.prototype.enableLoadingItem=function(a){this.attachEvent("onXLS",this._showFakeItem);this.attachEvent("onXLE",this._hideFakeItem);this._tfi_text=a||"Loading..."};dhtmlXTreeObject.prototype._showFakeItem=function(a,g){if((g===null)||(this._globalIdStorageFind("fake_load_xml_"+g))){return}var c=this.XMLsource;this.XMLsource=null;this.insertNewItem(g,"fake_load_xml_"+g,this._tfi_text);this.XMLsource=c};dhtmlXTreeObject.prototype._hideFakeItem=function(a,c){if(c===null){return}this.deleteItem("fake_load_xml_"+c)};dhtmlXTreeObject.prototype.isLocked=function(a){if(!this._locker){this._init_lock()}return(this._locker[a]==true)};dhtmlXTreeObject.prototype._lockItem=function(a,l,c){if(!this._locker){this._init_lock()}if(l){if(this._locker[a.id]==true){return}this._locker[a.id]=true;a.bIm0=a.images[0];a.bIm1=a.images[1];a.bIm2=a.images[2];a.images[0]=this.lico0;a.images[1]=this.lico1;a.images[2]=this.lico2;var h=a.span.parentNode;var g=h.previousSibling;this.dragger.removeDraggableItem(h);this.dragger.removeDraggableItem(g)}else{if(this._locker[a.id]!=true){return}this._locker[a.id]=false;a.images[0]=a.bIm0;a.images[1]=a.bIm1;a.images[2]=a.bIm2;var h=a.span.parentNode;var g=h.previousSibling;this.dragger.addDraggableItem(h,this);this.dragger.addDraggableItem(g,this)}if(!c){this._correctPlus(a)}};dhtmlXTreeObject.prototype.lockItem=function(g,c){if(!this._locker){this._init_lock()}this._lockOn=false;var a=this._globalIdStorageFind(g);this._lockOn=true;this._lockItem(a,convertStringToBoolean(c))};dhtmlXTreeObject.prototype.setLockedIcons=function(g,c,a){if(!this._locker){this._init_lock()}this.lico0=g;this.lico1=c;this.lico2=a};dhtmlXTreeObject.prototype._init_lock=function(){this._locker=new Array();this._locker_count="0";this._lockOn=true;this._globalIdStorageFindA=this._globalIdStorageFind;this._globalIdStorageFind=this._lockIdFind;if(this._serializeItem){this._serializeItemA=this._serializeItem;this._serializeItem=this._serializeLockItem;this._serializeTreeA=this.serializeTree;this.serializeTree=this._serializeLockTree}this.setLockedIcons(this.imageArray[0],this.imageArray[1],this.imageArray[2])};dhtmlXTreeObject.prototype._lockIdFind=function(g,a,c){if(!this.skipLock){if((!c)&&(this._lockOn==true)&&(this._locker[g]==true)){return null}}return this._globalIdStorageFindA(g,a,c)};dhtmlXTreeObject.prototype._serializeLockItem=function(a){if(this._locker[a.id]==true){return""}return this._serializeItemA(a)};dhtmlXTreeObject.prototype._serializeLockTree=function(){var a=this._serializeTreeA();return a.replace(/]+locked\=\"1\"[^>]+\/>/g,"")};dhtmlXTreeObject.prototype._moveNodeToA=dhtmlXTreeObject.prototype._moveNodeTo;dhtmlXTreeObject.prototype._moveNodeTo=function(a,g,c){if((g.treeNod.isLocked)&&(g.treeNod.isLocked(g.id))){return false}return this._moveNodeToA(a,g,c)};dhtmlXTreeObject.prototype.lockTree=function(a){if(convertStringToBoolean(a)){this._initTreeLocker()}else{if(this._TreeLocker){this._TreeLocker.parentNode.removeChild(this._TreeLocker);this._TreeLocker=null}}};dhtmlXTreeObject.prototype._initTreeLocker=function(a){if(this._TreeLocker){return}this.parentObject.style.overflow="hidden";if(this.parentObject.style.position!="absolute"){this.parentObject.style.position="relative"}var c=document.createElement("div");c.style.position="absolute";c.style.left="0px";c.style.top="0px";c.className="dhx_tree_opacity";c.style.width=this.allTree.offsetWidth+"px";c.style.backgroundColor="#FFFFFF";c.style.height=this.allTree.offsetHeight+"px";this._TreeLocker=c;this.parentObject.appendChild(this._TreeLocker)};dhtmlXTreeObject.prototype.enableRTL=function(c){var a=convertStringToBoolean(c);if(((a)&&(!this.rtlMode))||((!a)&&(this.rtlMode))){this.rtlMode=a;this._switchToRTL(this.rtlMode)}};dhtmlXTreeObject.prototype._switchToRTL=function(a){if(a){this.allTree.className=this._ltr_line=this.lineArray;this._ltr_min=this.minusArray;this._ltr_plus=this.plusArray;this.lineArray=new Array("line2_rtl.gif","line3_rtl.gif","line4_rtl.gif","blank.gif","blank.gif","line1_rtl.gif");this.minusArray=new Array("minus2_rtl.gif","minus3_rtl.gif","minus4_rtl.gif","minus.gif","minus5_rtl.gif");this.plusArray=new Array("plus2_rtl.gif","plus3_rtl.gif","plus4_rtl.gif","plus.gif","plus5_rtl.gif");this.allTree.className="containerTableStyleRTL"}else{this.allTree.className="containerTableStyle";this.lineArray=this._ltr_line;this.minusArray=this._ltr_min;this.plusArray=this._ltr_plus}if(this.htmlNode.childsCount){this._redrawFrom(this,this.htmlNode)}};dhtmlXTreeObject.prototype.sortTree=function(h,c,g){var a=this._globalIdStorageFind(h);if(!a){return false}this._reorderBranch(a,(c.toString().toLowerCase()=="asc"),convertStringToBoolean(g))};dhtmlXTreeObject.prototype.setCustomSortFunction=function(a){this._csfunca=a};dhtmlXTreeObject.prototype._reorderBranch=function(o,c,q){var a=[];var n=o.childsCount;if(!n){return}var l=o.childNodes[0].tr.parentNode;for(var h=0;hm.span.innerHTML.toUpperCase())?1:((r.span.innerHTML.toUpperCase()==m.span.innerHTML.toUpperCase())?0:-1))})}}else{if(this._csfunca){a.sort(function(r,m){return g._csfunca(m.id,r.id)})}else{a.sort(function(r,m){return((r.span.innerHTML.toUpperCase()m.getAttribute("text"))?1:((q.getAttribute("text")==m.getAttribute("text"))?0:-1))})}else{a.sort(function(q,m){return((q.getAttribute("text")",">"]];dhtmlXTreeObject.prototype.registerXMLEntity=function(a,c){this._serEnts[this._serEnts.length]=[a,c,new RegExp(a,"g")]};dhtmlXTreeObject.prototype.setSerializationLevel=function(a,c,l,m,g){this._xuserData=convertStringToBoolean(a);this._xfullXML=convertStringToBoolean(c);this._dtd=g;this._xescapeEntities=convertStringToBoolean(l);if(convertStringToBoolean(m)){this._apreUC=""}else{}for(var h=0;h'}a+='';if((this._xuserData)&&(this._idpull[this.rootId]._userdatalist)){var g=this._idpull[this.rootId]._userdatalist.split(",");for(var c=0;c'+this._apreUC+this._idpull[this.rootId].userData["t_"+g[c]]+this._apstUC+""}}for(var c=0;c";return a};dhtmlXTreeObject.prototype._serializeItem=function(n){if(n.unParsed){if(document.all){return n.unParsed.d.xml}else{var a=new XMLSerializer();return a.serializeToString(n.unParsed.d)}}var c="";if(this._selected.length){var h=this._selected[0].id}else{h='"'}var m=n.span.innerHTML;if(this._xescapeEntities){for(var g=0;g"}else{c='"}if((this._xuserData)&&(n._userdatalist)){var l=n._userdatalist.split(",");for(var g=0;g'+this._apreUC+n.userData["t_"+l[g]]+this._apstUC+""}}for(var g=0;g";return c};dhtmlXTreeObject.prototype.saveSelectedItem=function(c,a){c=c||"";this.setCookie("treeStateSelected"+c,this.getSelectedItemId(),a)};dhtmlXTreeObject.prototype.restoreSelectedItem=function(a){a=a||"";var c=this.getCookie("treeStateSelected"+a);this.selectItem(c,false)};dhtmlXTreeObject.prototype.enableAutoSavingSelected=function(a,c){this.assMode=convertStringToBoolean(a);if((this.assMode)&&(!this.oldOnSelect)){this.oldOnSelect=this.onRowSelect;this.onRowSelect=function(h,g,l){if(!g){g=this}g.parentObject.treeNod.oldOnSelect(h,g,l);if(g.parentObject.treeNod.assMode){g.parentObject.treeNod.saveSelectedItem(g.parentObject.treeNod.assCookieName)}}}this.assCookieName=c};dhtmlXTreeObject.prototype.saveState=function(g,c){var l=this._escape(this.serializeTree());var a=4000;if(l.length>a){if(navigator.appName.indexOf("Microsoft")!=-1){return false}this.setCookie("treeStatex"+g,Math.ceil(l.length/a));for(var h=0;h0){var h=document.cookie.indexOf(g);if(h!=-1){h+=g.length;var a=document.cookie.indexOf(";",h);if(a==-1){a=document.cookie.length}return document.cookie.substring(h,a)}}};dhtmlXTreeObject.prototype.saveOpenStates=function(c,a){var h=[];for(var g=0;g0){var h=document.cookie.indexOf(g);if(h!=-1){h+=g.length;var a=document.cookie.indexOf(";",h);if(a==-1){a=document.cookie.length}return(document.cookie.substring(h,a))}}}dhtmlXTreeObject.prototype.openAllItemsDynamic=function(a){this.ClosedElem=new Array();this.G_node=null;var c=this._globalIdStorageFind(a||this.rootId);if(c.id!=this.rootId&&this.getOpenState(c.id)!=0){this.openItem(a)}this._openAllNodeChilds(c,0);if(this.ClosedElem.length>0){this.onLoadReserve=this.onXLE;this.onXLE=this._loadAndOpen;this._loadAndOpen(this)}};dhtmlXTreeObject.prototype._openAllNodeChilds=function(c){if((c.XMLload==0)||(c.unParsed)){this.ClosedElem.push(c)}for(var a=0;a0){this._openAllNodeChilds(c.childNodes[a])}if((c.childNodes[a].XMLload==0)||(c.childNodes[a].unParsed)){this.ClosedElem.push(c.childNodes[a])}}};dhtmlXTreeObject.prototype._loadAndOpen=function(a){if(a.G_node){a._openItem(a.G_node);a._openAllNodeChilds(a.G_node);a.G_node=null}if(a.ClosedElem.length>0){a.G_node=a.ClosedElem.shift()}if(a.G_node){if(a.G_node.unParsed){a.reParse(a.G_node)}else{window.setTimeout(function(){a._loadDynXML(a.G_node.id)},100)}}else{a.onXLE=a.onLoadReserve;if(a.onXLE){a.onXLE(a)}a.callEvent("onAllOpenDynamic",[a])}};dhtmlXTreeObject.prototype.openItemsDynamic=function(c,a){if(this.onXLE==this._stepOpen){return}this._opnItmsDnmcFlg=convertStringToBoolean(a);this.onLoadReserve=this.onXLE;this.onXLE=this._stepOpen;this.ClosedElem=c.split(",").reverse();this._stepOpen(this)};dhtmlXTreeObject.prototype._stepOpen=function(c){if(!c.ClosedElem.length){c.onXLE=c.onLoadReserve;if(c._opnItmsDnmcFlg){c.selectItem(c.G_node,true)}if((c.onXLE)&&(arguments[1])){c.onXLE.apply(c,arguments)}c.callEvent("onOpenDynamicEnd",[]);return}c.G_node=c.ClosedElem.pop();c.skipLock=true;var a=c._globalIdStorageFind(c.G_node);if(a){if(a.XMLload===0){c.openItem(c.G_node)}else{c.openItem(c.G_node);c._stepOpen(c)}}c.skipLock=false};var globalActiveDHTMLGridObject;String.prototype._dhx_trim=function(){return this.replace(/ /g," ").replace(/(^[ \t]*)|([ \t]*$)/g,"")};function dhtmlxArray(a){return dhtmlXHeir((a||new Array()),dhtmlxArray._master)}dhtmlxArray._master={_dhx_find:function(c){for(var a=0;a=g;a--){this[a]=this[a-1]}this[g]=c},_dhx_removeAt:function(a){this.splice(a,1)},_dhx_swapItems:function(a,g){var c=this[a];this[a]=this[g];this[g]=c}};function dhtmlXGridObject(id){if(_isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}if(id){if(typeof(id)=="object"){this.entBox=id;if(!this.entBox.id){this.entBox.id="cgrid2_"+this.uid()}}else{this.entBox=document.getElementById(id)}}else{this.entBox=document.createElement("DIV");this.entBox.id="cgrid2_"+this.uid()}this.entBox.innerHTML="";dhtmlxEventable(this);var self=this;this._wcorr=0;this.fontWidth=7;this.cell=null;this.row=null;this.iconURL="";this.editor=null;this._f2kE=true;this._dclE=true;this.combos=new Array(0);this.defVal=new Array(0);this.rowsAr={};this.rowsBuffer=dhtmlxArray();this.rowsCol=dhtmlxArray();this._data_cache={};this._ecache={};this._ud_enabled=true;this.xmlLoader=new dtmlXMLLoaderObject(this.doLoadDetails,this,true,this.no_cashe);this._maskArr=[];this.selectedRows=dhtmlxArray();this.UserData={};this._sizeFix=this._borderFix=0;this.entBox.className+=" gridbox";this.entBox.style.width=this.entBox.getAttribute("width")||(window.getComputedStyle?(this.entBox.style.width||window.getComputedStyle(this.entBox,null)["width"]):(this.entBox.currentStyle?this.entBox.currentStyle.width:this.entBox.style.width||0))||"100%";this.entBox.style.height=this.entBox.getAttribute("height")||(window.getComputedStyle?(this.entBox.style.height||window.getComputedStyle(this.entBox,null)["height"]):(this.entBox.currentStyle?this.entBox.currentStyle.height:this.entBox.style.height||0))||"100%";this.entBox.style.cursor="default";this.entBox.onselectstart=function(){return false};var t_creator=function(name){var t=document.createElement("TABLE");t.cellSpacing=t.cellPadding=0;t.style.cssText="width:100%;table-layout:fixed;";t.className=name.substr(2);return t};this.obj=t_creator("c_obj");this.hdr=t_creator("c_hdr");this.hdr.style.marginRight="20px";this.hdr.style.paddingRight="20px";this.objBox=document.createElement("DIV");this.objBox.style.width="100%";this.objBox.style.overflow="auto";this.objBox.appendChild(this.obj);this.objBox.className="objbox";if(dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(this)}this.hdrBox=document.createElement("DIV");this.hdrBox.style.width="100%";this.hdrBox.style.height="25px";this.hdrBox.style.overflow="hidden";this.hdrBox.className="xhdr";this.preloadImagesAr=new Array(0);this.sortImg=document.createElement("DIV");this.sortImg.style.display="none";this.hdrBox.appendChild(this.sortImg);this.hdrBox.appendChild(this.hdr);this.hdrBox.style.position="relative";this.entBox.appendChild(this.hdrBox);this.entBox.appendChild(this.objBox);this.entBox.grid=this;this.objBox.grid=this;this.hdrBox.grid=this;this.obj.grid=this;this.hdr.grid=this;this.cellWidthPX=[];this.cellWidthPC=[];this.cellWidthType=this.entBox.cellwidthtype||"px";this.delim=this.entBox.delimiter||",";this._csvDelim=",";this.hdrLabels=[];this.columnIds=[];this.columnColor=[];this._hrrar=[];this.cellType=dhtmlxArray();this.cellAlign=[];this.initCellWidth=[];this.fldSort=[];this._srdh=(_isIE&&(document.compatMode!="BackCompat")?22:20);this.imgURL=window.dhx_globalImgPath||"";this.isActive=false;this.isEditable=true;this.useImagesInHeader=false;this.pagingOn=false;this.rowsBufferOutSize=0;dhtmlxEvent(window,"unload",function(){try{if(self.destructor){self.destructor()}}catch(e){}});this.setSkin=function(name){this.skin_name=name;if(this._imgURL){this.setImagePath(this._imgURL)}var classname=this.entBox.className.split(" gridbox")[0];this.entBox.className=classname+" gridbox gridbox_"+name+(_isIE?" isIE":" isModern");this.skin_h_correction=0;this.enableAlterCss("ev_"+name,"odd_"+name,this.isTreeGrid());this._fixAlterCss();switch(name){case"clear":this._topMb=document.createElement("DIV");this._topMb.className="topMumba";this._topMb.innerHTML="";this.entBox.appendChild(this._topMb);this._botMb=document.createElement("DIV");this._botMb.className="bottomMumba";this._botMb.innerHTML="";this.entBox.appendChild(this._botMb);if(this.entBox.style.position!="absolute"){this.entBox.style.position="relative"}this.skin_h_correction=20;break;case"dhx_terrace":this._srdh=33;this.forceDivInHeader=true;break;case"dhx_skyblue":case"dhx_web":case"glassy_blue":case"dhx_black":case"dhx_blue":case"modern":case"light":this._srdh=29;this.forceDivInHeader=true;break;case"xp":this.forceDivInHeader=true;if((_isIE)&&(document.compatMode!="BackCompat")){this._srdh=26}else{this._srdh=22}break;case"mt":if((_isIE)&&(document.compatMode!="BackCompat")){this._srdh=26}else{this._srdh=22}break;case"gray":if((_isIE)&&(document.compatMode!="BackCompat")){this._srdh=22}break;case"sbdark":break}if(_isIE&&this.hdr){var d=this.hdr.parentNode;d.removeChild(this.hdr);d.appendChild(this.hdr)}this.setSizes()};if(_isIE){this.preventIECaching(true)}if(window.dhtmlDragAndDropObject){this.dragger=new dhtmlDragAndDropObject()}this._doOnScroll=function(e,mode){this.callEvent("onScroll",[this.objBox.scrollLeft,this.objBox.scrollTop]);this.doOnScroll(e,mode)};this.doOnScroll=function(e,mode){this.hdrBox.scrollLeft=this.objBox.scrollLeft;if(this.ftr){this.ftr.parentNode.scrollLeft=this.objBox.scrollLeft}if(mode){return}if(this._srnd){if(this._dLoadTimer){window.clearTimeout(this._dLoadTimer)}this._dLoadTimer=window.setTimeout(function(){if(self._update_srnd_view){self._update_srnd_view()}},100)}};this.attachToObject=function(obj){obj.appendChild(this.globalBox?this.globalBox:this.entBox);this.setSizes()};this.init=function(fl){if((this.isTreeGrid())&&(!this._h2)){this._h2=new dhtmlxHierarchy();if((this._fake)&&(!this._realfake)){this._fake._h2=this._h2}this._tgc={imgURL:null}}if(!this._hstyles){return}if(!this.skin_name){this.setSkin("dhx_skyblue")}this.editStop();this.lastClicked=null;this.resized=null;this.fldSorted=this.r_fldSorted=null;this.cellWidthPX=[];this.cellWidthPC=[];if(this.hdr.rows.length>0){var temp=this.xmlFileUrl;this.clearAll(true);this.xmlFileUrl=temp}var hdrRow=this.hdr.insertRow(0);for(var i=0;i0.5){cwidth++;fix--}var rwidth=this.cellWidthPX[i]=Math.floor(cwidth);var fix=fix+cwidth-rwidth}else{if(typeof this.cellWidthPX[i]=="undefined"){this.cellWidthPX[i]=this.initCellWidth[i]}}if(!this._hrrar[i]){summ+=this.cellWidthPX[i]*1}}if(fcols.length){var ms=Math.floor((gridWidth-summ)/fcols.length);if(ms<0){ms=1}for(var i=0;isumm){var last=fcols[fcols.length-1];this.cellWidthPX[last]=this.cellWidthPX[last]+(gridWidth-summ);summ=gridWidth}this._setAutoResize()}this.obj.style.width=summ+"px";this.hdr.style.width=summ+"px";if(this.ftr){this.ftr.style.width=summ+"px"}this.chngCellWidth();return summ};this.setSizes=function(){if((!this.hdr.rows[0])){return}var quirks=this.quirks=(_isIE&&document.compatMode=="BackCompat");var outerBorder=(this.entBox.offsetWidth-this.entBox.clientWidth)/2;if(!this.dontSetSizes){if(this.globalBox){var splitOuterBorder=(this.globalBox.offsetWidth-this.globalBox.clientWidth)/2;if(this._delta_x&&!this._realfake){var ow=this.globalBox.clientWidth;this.globalBox.style.width=this._delta_x;this.entBox.style.width=Math.max(0,(this.globalBox.clientWidth+(quirks?splitOuterBorder*2:0))-this._fake.entBox.clientWidth)+"px";if(ow!=this.globalBox.clientWidth){this._fake._correctSplit(this._fake.entBox.clientWidth)}}if(this._delta_y&&!this._realfake){this.globalBox.style.height=this._delta_y;this.entBox.style.overflow=this._fake.entBox.style.overflow="hidden";this.entBox.style.height=this._fake.entBox.style.height=this.globalBox.clientHeight+(quirks?splitOuterBorder*2:0)+"px"}}else{if(this._delta_x){if(this.entBox.parentNode&&this.entBox.parentNode.tagName=="TD"){this.entBox.style.width="1px";this.entBox.style.width=parseInt(this._delta_x)*this.entBox.parentNode.clientWidth/100-outerBorder*2+"px"}else{this.entBox.style.width=this._delta_x}}if(this._delta_y){this.entBox.style.height=this._delta_y}}}window.clearTimeout(this._sizeTime);if(!this.entBox.offsetWidth&&(!this.globalBox||!this.globalBox.offsetWidth)){this._sizeTime=window.setTimeout(function(){if(self.setSizes){self.setSizes()}},250);return}var border_x=((!this._wthB)&&((this.entBox.cmp||this._delta_x)&&(this.skin_name||"").indexOf("dhx")==0&&!quirks)?2:0);var border_y=((!this._wthB)&&((this.entBox.cmp||this._delta_y)&&(this.skin_name||"").indexOf("dhx")==0&&!quirks)?2:0);if(this._sizeFix){border_x-=this._sizeFix;border_y-=this._sizeFix}var isVScroll=this.parentGrid?false:(this.objBox.scrollHeight>this.objBox.offsetHeight);var scrfix=dhtmlx.$customScroll?0:18;var gridWidth=this.entBox.clientWidth-(this.skin_h_correction||0)*(quirks?0:1)-border_x;var gridWidthActive=this.entBox.clientWidth-(this.skin_h_correction||0)-border_x;var gridHeight=this.entBox.clientHeight-border_y;var summ=this.setColumnSizes(gridWidthActive-(isVScroll?scrfix:0)-(this._correction_x||0));var isHScroll=this.parentGrid?false:((this.objBox.scrollWidth>this.objBox.offsetWidth)||(this.objBox.style.overflowX=="scroll"));var headerHeight=this.hdr.clientHeight;var footerHeight=this.ftr?this.ftr.clientHeight:0;var newWidth=gridWidth;var newHeight=gridHeight-headerHeight-footerHeight;if(this._awdth&&this._awdth[0]&&this._awdth[1]==99999){isHScroll=0}if(this._ahgr){if(this._ahgrMA){newHeight=this.entBox.parentNode.clientHeight-headerHeight-footerHeight}else{newHeight=this.obj.offsetHeight+(isHScroll?scrfix:0)+(this._correction_y||0)}if(this._ahgrM){if(this._ahgrF){newHeight=Math.min(this._ahgrM,newHeight+headerHeight+footerHeight)-headerHeight-footerHeight}else{newHeight=Math.min(this._ahgrM,newHeight)}}if(isVScroll&&newHeight>=this.obj.scrollHeight+(isHScroll?scrfix:0)){isVScroll=false;this.setColumnSizes(gridWidthActive-(this._correction_x||0))}}if((this._awdth)&&(this._awdth[0])){if(this.cellWidthType=="%"){this.cellWidthType="px"}if(this._fake){summ+=this._fake.entBox.clientWidth}var newWidth=Math.min(Math.max(summ+(isVScroll?scrfix:0),this._awdth[2]),this._awdth[1])+(this._correction_x||0);this.objBox.style.overflowX=(!isVScroll&&this.objBox.scrollWidth<=newWidth)?"hidden":"auto";if(this._fake){newWidth-=this._fake.entBox.clientWidth}}newHeight=Math.max(0,newHeight);this._ff_size_delta=(this._ff_size_delta==0.1)?0.2:0.1;if(!_isFF){this._ff_size_delta=0}if(!this.dontSetSizes){this.entBox.style.width=Math.max(0,newWidth+(quirks?2:0)*outerBorder+this._ff_size_delta)+"px";this.entBox.style.height=newHeight+(quirks?2:0)*outerBorder+headerHeight+footerHeight+"px"}this.objBox.style.height=newHeight+((quirks&&!isVScroll)?2:0)*outerBorder+"px";this.hdrBox.style.height=headerHeight+"px";if(newHeight!=gridHeight){this.doOnScroll(0,!this._srnd)}var ext=this["setSizes_"+this.skin_name];if(ext){ext.call(this)}this.setSortImgPos();if(headerHeight!=this.hdr.clientHeight&&this._ahgr){this.setSizes()}this.callEvent("onSetSizes",[])};this.setSizes_clear=function(){var y=this.hdr.offsetHeight;var x=this.entBox.offsetWidth;var y2=y+this.objBox.offsetHeight;this._topMb.style.top=(y||0)+"px";this._topMb.style.width=(x+20)+"px";this._botMb.style.top=(y2-3)+"px";this._botMb.style.width=(x+20)+"px"};this.chngCellWidth=function(){if((_isOpera)&&(this.ftr)){this.ftr.width=this.objBox.scrollWidth+"px"}var l=this._cCount;for(var i=0;i1){var a_sizes=new Array();for(var i=0;i((this._drsclmW&&!this._notresize)?(this._drsclmW[ind]||10):10)){this.obj.rows[0].childNodes[ind].style.width=fcolW+"px";this.hdr.rows[0].childNodes[ind].style.width=fcolW+"px";if(this.ftr){this.ftr.rows[0].childNodes[ind].style.width=fcolW+"px"}if(this.cellWidthType=="px"){this.cellWidthPX[ind]=fcolW}else{var gridWidth=parseInt(this.entBox.offsetWidth);if(this.objBox.scrollHeight>this.objBox.offsetHeight){gridWidth-=17}var pcWidth=Math.round(fcolW/gridWidth*100);this.cellWidthPC[ind]=pcWidth}if(this.sortImg.style.display!="none"){this.setSortImgPos()}}};this.setSortImgState=function(state,ind,order,row){order=(order||"asc").toLowerCase();if(!convertStringToBoolean(state)){this.sortImg.style.display="none";this.fldSorted=this.r_fldSorted=null;return}if(order=="asc"){this.sortImg.className="dhxgrid_sort_asc"}else{this.sortImg.className="dhxgrid_sort_desc"}this.sortImg.style.display="";this.fldSorted=this.hdr.rows[0].childNodes[ind];var r=this.hdr.rows[row||1];if(!r){return}for(var i=0;ilcRowIndex){var strt=lcRowIndex;var end=elRowIndex}else{var strt=elRowIndex;var end=lcRowIndex}for(var i=0;i=strt&&i<=end)){if(this.rowsCol[i]&&(!this.rowsCol[i]._sRow)){if(this.rowsCol[i].className.indexOf("rowselected")==-1&&(this._realfake||this.callEvent("onBeforeSelect",[this.rowsCol[i].idd,psid,el._cellIndex]))){this.rowsCol[i].className+=" rowselected";this.selectedRows[this.selectedRows.length]=this.rowsCol[i]}}else{this.clearSelection();return this.doClick(el,fl,0,show)}}}}else{if(selMethod==2){if(el.parentNode.className.indexOf("rowselected")!=-1){el.parentNode.className=el.parentNode.className.replace(/rowselected/g,"");this.selectedRows._dhx_removeAt(this.selectedRows._dhx_find(el.parentNode));var skipRowSelection=true;show=false}}}this.editStop();if(typeof(el.parentNode.idd)=="undefined"){return true}if((!skipRowSelection)&&(!el.parentNode._sRow)){if(this._realfake||this.callEvent("onBeforeSelect",[el.parentNode.idd,psid,el._cellIndex])){if(this.getSelectedRowId()!=el.parentNode.idd){if(selMethod==0){this.clearSelection()}this.cell=el;if((prow==el.parentNode)&&(this._chRRS)){fl=false}this.row=el.parentNode;this.row.className+=" rowselected";if(this.selectedRows._dhx_find(this.row)==-1){this.selectedRows[this.selectedRows.length]=this.row}}else{this.cell=el;this.row=el.parentNode}}else{fl=false}}if(this.cell&&this.cell.parentNode.className.indexOf("rowselected")!=-1){this.cell.className=this.cell.className.replace(/cellselected/g,"")+" cellselected"}if(selMethod!=1){if(!this.row){return}}this.lastClicked=el.parentNode;var rid=this.row.idd;var cid=this.cell;if(fl&&typeof(rid)!="undefined"&&cid&&!skipRowSelection){self.onRowSelectTime=setTimeout(function(){if(self.callEvent){self.callEvent("onRowSelect",[rid,cid._cellIndex])}},100)}else{this.callEvent("onRowSelectRSOnly",[rid])}if(this.checkEvent("onSelectStateChanged")){var afinal=this.getSelectedId();if(initial!=afinal){this.callEvent("onSelectStateChanged",[afinal,initial])}}}this.isActive=true;if(show!==false&&this.cell&&this.cell.parentNode.idd){this.moveToVisible(this.cell)}};this.selectAll=function(){this.clearSelection();var coll=this.rowsBuffer;if(this.pagingOn){coll=this.rowsCol}for(var i=0;i(this.objBox.offsetWidth+this.objBox.scrollLeft)){if(cell_obj.offsetLeft>this.objBox.scrollLeft){scrollLeft=cell_obj.offsetLeft-(this.objBox.offsetWidth-cell_obj.offsetWidth)+5}}else{if(cell_obj.offsetLeft(this.objBox.offsetHeight+this.objBox.scrollTop)){var scrollTop=distance}else{if(distance(new Date).valueOf()){return}this._Opera_stop=null}}if(this.editor&&this.editor!=null){this.editor.cell.className=this.editor.cell.className.replace("editable","");if(mode){var t=this.editor.val;this.editor.detach();this.editor.setValue(t);this.editor=null;this.callEvent("onEditCancel",[this.row.idd,this.cell._cellIndex,t]);return}if(this.editor.detach()){this.cell.wasChanged=true}var g=this.editor;this.editor=null;var z=this.callEvent("onEditCell",[2,this.row.idd,this.cell._cellIndex,g.getValue(),g.val]);if((typeof(z)=="string")||(typeof(z)=="number")){g[g.setImage?"setLabel":"setValue"](z)}else{if(!z){g[g.setImage?"setLabel":"setValue"](g.val)}}if(this._ahgr&&this.multiLine){this.setSizes()}}};this._nextRowCell=function(row,dir,pos){row=this._nextRow((this._groups?this.rowsCol:this.rowsBuffer)._dhx_find(row),dir);if(!row){return null}return row.childNodes[row._childIndexes?row._childIndexes[pos]:pos]};this._getNextCell=function(acell,dir,i){acell=acell||this.cell;var arow=acell.parentNode;if(this._tabOrder){i=this._tabOrder[acell._cellIndex];if(typeof i!="undefined"){if(i<0){acell=this._nextRowCell(arow,dir,Math.abs(i)-1)}else{acell=arow.childNodes[i]}}}else{var i=acell._cellIndex+dir;if(i>=0&&i=this.rowsBuffer.length){new_ind=this.rowsBuffer.length-1}if(this._srnd&&!this.rowsBuffer[new_ind]){this.objBox.scrollTop+=Math.floor((dir)*this.objBox.offsetHeight/(this._srdh||20))*(this._srdh||20);if(this._fake){this._fake.objBox.scrollTop=this.objBox.scrollTop}master._r_select=new_ind}else{this.selectCell(new_ind,this.cell._cellIndex,true,false,false,(this.multiLine||this._srnd));if(!this.multiLine&&!this._srnd&&!this._realfake){this.objBox.scrollTop=this.getRowById(this.getRowId(new_ind)).offsetTop;if(this._fake){this._fake.objBox.scrollTop=this.objBox.scrollTop}}master._r_select=null}};this.doKey=function(ev){if(!ev){return true}if((ev.target||ev.srcElement).value!==window.undefined){var zx=(ev.target||ev.srcElement);if((!zx.parentNode)||(zx.parentNode.className.indexOf("editable")==-1)){return true}}if((globalActiveDHTMLGridObject)&&(this!=globalActiveDHTMLGridObject)){return globalActiveDHTMLGridObject.doKey(ev)}if(this.isActive==false){return true}if(this._htkebl){return true}if(!this.callEvent("onKeyPress",[ev.keyCode,ev.ctrlKey,ev.shiftKey,ev])){return false}var code="k"+ev.keyCode+"_"+(ev.ctrlKey?1:0)+"_"+(ev.shiftKey?1:0);if(this.cell){if(this._key_events[code]){if(false===this._key_events[code].call(this)){return true}if(ev.preventDefault){ev.preventDefault()}ev.cancelBubble=true;return false}if(this._key_events.k_other){this._key_events.k_other.call(this,ev)}}return true};this.selectRow=function(r,fl,preserve,show){if(typeof(r)!="object"){r=this.render_row(r)}this.selectCell(r,0,fl,preserve,false,show)};this.wasDblClicked=function(ev){var el=this.getFirstParentOfType(_isIE?ev.srcElement:ev.target,"TD");if(el){var rowId=el.parentNode.idd;return this.callEvent("onRowDblClicked",[rowId,el._cellIndex,ev])}};this._onHeaderClick=function(e,el){var that=this.grid;el=el||that.getFirstParentOfType(_isIE?event.srcElement:e.target,"TD");if(this.grid.resized==null){if(!(this.grid.callEvent("onHeaderClick",[el._cellIndexS,(e||window.event)]))){return false}that.sortField(el._cellIndexS,false,el)}this.grid.resized=null};this.deleteSelectedRows=function(){var num=this.selectedRows.length;if(num==0){return}var tmpAr=this.selectedRows;this.selectedRows=dhtmlxArray();for(var i=num-1;i>=0;i--){var node=tmpAr[i];if(!this.deleteRow(node.idd,node)){this.selectedRows[this.selectedRows.length]=node}else{if(node==this.row){var ind=i}}}if(ind){try{if(ind+1>this.rowsCol.length){ind--}this.selectCell(ind,0,true)}catch(er){this.row=null;this.cell=null}}};this.getSelectedRowId=function(){var selAr=new Array(0);var uni={};for(var i=0;i]+)\].*/,"$1");label=label.substr(label.indexOf("]")+1,label.length);hdrHTML+=""}hdrHTML+=label;hdrHTML+="";z.cells[col].innerHTML=hdrHTML;if(this._hstyles[col]){z.cells[col].style.cssText=this._hstyles[col]}}else{z.cells[col].style.textAlign="left";z.cells[col].innerHTML="";var a=new Image();a.src=""+label.replace(/(\.[a-z]+)/,".des$1");this.preloadImagesAr[this.preloadImagesAr.length]=a;var b=new Image();b.src=""+label.replace(/(\.[a-z]+)/,".asc$1");this.preloadImagesAr[this.preloadImagesAr.length]=b}if((label||"").indexOf("#")!=-1){var t=label.match(/(^|{)#([^}]+)(}|$)/);if(t){var tn="_in_header_"+t[2];if(this[tn]){this[tn]((this.forceDivInHeader?z.cells[col].firstChild:z.cells[col]),col,label.split(t[0]))}}}};this.setColLabel=function(a,b,ind,c){return this.setColumnLabel(a,b,(ind||0)+1,c)};this.clearAll=function(header){if(!this.obj.rows[0]){return}if(this._h2){this._h2=new dhtmlxHierarchy();if(this._fake){if(this._realfake){this._h2=this._fake._h2}else{this._fake._h2=this._h2}}}this.limit=this._limitC=0;this.editStop(true);if(this._dLoadTimer){window.clearTimeout(this._dLoadTimer)}if(this._dload){this.objBox.scrollTop=0;this.limit=this._limitC||0;this._initDrF=true}var len=this.rowsCol.length;len=this.obj.rows.length;for(var i=len-1;i>0;i--){var t_r=this.obj.rows[i];t_r.parentNode.removeChild(t_r)}if(header){this._master_row=null;this.obj.rows[0].parentNode.removeChild(this.obj.rows[0]);for(var i=this.hdr.rows.length-1;i>=0;i--){var t_r=this.hdr.rows[i];t_r.parentNode.removeChild(t_r)}if(this.ftr){this.ftr.parentNode.removeChild(this.ftr);this.ftr=null}this._aHead=this.ftr=this.cellWidth=this._aFoot=null;this.cellType=dhtmlxArray();this._hrrar=[];this.columnIds=[];this.combos=[];this._strangeParams=[];this.defVal=[];this._ivizcol=null}this.row=null;this.cell=null;this.rowsCol=dhtmlxArray();this.rowsAr={};this._RaSeCol=[];this.rowsBuffer=dhtmlxArray();this.UserData=[];this.selectedRows=dhtmlxArray();if(this.pagingOn||this._srnd){this.xmlFileUrl=""}if(this.pagingOn){this.changePage(1)}if(this._contextCallTimer){window.clearTimeout(this._contextCallTimer)}if(this._sst){this.enableStableSorting(true)}this._fillers=this.undefined;this.setSortImgState(false);this.setSizes();this.callEvent("onClearAll",[])};this.sortField=function(ind,repeatFl,r_el){if(this.getRowsNum()==0){return false}var el=this.hdr.rows[0].cells[ind];if(!el){return}if(el.tagName=="TH"&&(this.fldSort.length-1)>=el._cellIndex&&this.fldSort[el._cellIndex]!="na"){var data=this.getSortingState();var sortType=(data[0]==ind&&data[1]=="asc")?"des":"asc";if(!this.callEvent("onBeforeSorting",[ind,this.fldSort[ind],sortType])){return}this.sortImg.className="dhxgrid_sort_"+(sortType=="asc"?"asc":"desc");if(this.useImagesInHeader){var cel=this.hdr.rows[1].cells[el._cellIndex].firstChild;if(this.fldSorted!=null){var celT=this.hdr.rows[1].cells[this.fldSorted._cellIndex].firstChild;celT.src=celT.src.replace(/(\.asc\.)|(\.des\.)/,".")}cel.src=cel.src.replace(/(\.[a-z]+)$/,"."+sortType+"$1")}this.sortRows(el._cellIndex,this.fldSort[el._cellIndex],sortType);this.fldSorted=el;this.r_fldSorted=r_el;var c=this.hdr.rows[1];var c=r_el.parentNode;var real_el=c._childIndexes?c._childIndexes[el._cellIndex]:el._cellIndex;this.setSortImgPos(false,false,false,r_el)}};this.setCustomSorting=function(func,col){if(!this._customSorts){this._customSorts=new Array()}this._customSorts[col]=(typeof(func)=="string")?eval(func):func;this.fldSort[col]="cus"};this.enableHeaderImages=function(fl){this.useImagesInHeader=fl};this.setHeader=function(hdrStr,splitSign,styles){if(typeof(hdrStr)!="object"){var arLab=this._eSplit(hdrStr)}else{arLab=[].concat(hdrStr)}var arWdth=new Array(0);var arTyp=new dhtmlxArray(0);var arAlg=new Array(0);var arVAlg=new Array(0);var arSrt=new Array(0);for(var i=0;i";if(this.isTreeGrid()){this._h2.forEachChildF(0,function(el){var temp=this._serializeRow(this.render_row_tree(-1,el.id));out.push(temp);if(temp){return true}else{return false}},this,function(){out.push(close)})}else{for(var i=0;i");if(this._sUDa&&this.UserData[r.idd]){keysAr=this.UserData[r.idd].getKeys();for(var ii=0;ii"+(this._asCDATA?"":"")+"")}}var changeFl=false;for(var jj=0;jj"}if((this._ecspn)&&(zx.cell.colSpan)&&zx.cell.colSpan>1){out.push(' colspan="'+zx.cell.colSpan+'" ')}if(this._chAttr){if(zx.wasChanged()){out.push(' changed="1"');changeFl=true}}else{if((this._onlChAttr)&&(zx.wasChanged())){changeFl=true}}if(this._sAll&&this.cellType[jj]=="tree"){out.push((this._h2?(" image='"+this._h2.get[r.idd].image+"'"):"")+">"+zxVal+"")}else{out.push(">"+zxVal+"")}if((this._ecspn)&&(zx.cell.colSpan)){for(var u=0;u");jj++}}}}if((this._onlChAttr)&&(!changeFl)&&(!r._added)){return""}return out.join("")};this._serialiseConfig=function(){var out="";for(var i=0;i";if(this._asCDATA){out+=""}else{out+=this.getHeaderCol(i)}var z=this.getCombo(i);if(z){for(var j=0;j"+z.values[j]+""}}out+=""}return out+=""};this.serialize=function(){var out='';if(this._mathSerialization){this._agetm="getMathValue"}else{this._agetm="getValue"}if(this._sUDa&&this.UserData.gridglobaluserdata){var keysAr=this.UserData.gridglobaluserdata.getKeys();for(var i=0;i"+this.UserData.gridglobaluserdata.get(keysAr[i])+""}}if(this._sConfig){out+=this._serialiseConfig()}out+=this._serialise();out+="";return out};this.getPosition=function(oNode,pNode){if(!pNode){var pos=getOffset(oNode);return[pos.left,pos.top]}pNode=pNode||document.body;var oCurrentNode=oNode;var iLeft=0;var iTop=0;while((oCurrentNode)&&(oCurrentNode!=pNode)){iLeft+=oCurrentNode.offsetLeft-oCurrentNode.scrollLeft;iTop+=oCurrentNode.offsetTop-oCurrentNode.scrollTop;oCurrentNode=oCurrentNode.offsetParent}if(pNode==document.body){if(_isIE){iTop+=document.body.offsetTop||document.documentElement.offsetTop;iLeft+=document.body.offsetLeft||document.documentElement.offsetLeft}else{if(!_isFF){iLeft+=document.body.offsetLeft;iTop+=document.body.offsetTop}}}return[iLeft,iTop]};this.getFirstParentOfType=function(obj,tag){while(obj&&obj.tagName!=tag&&obj.tagName!="BODY"){obj=obj.parentNode}return obj};this.objBox.onscroll=function(){this.grid._doOnScroll()};this.objBox.ontouchend=function(){this.hdrBox.scrollLeft=this.objBox.scrollLeft};this.hdrBox.onscroll=function(){if(this._try_header_sync){return}this._try_header_sync=true;if(Math.abs(this.grid.objBox.scrollLeft-this.scrollLeft)>1){this.grid.objBox.scrollLeft=this.scrollLeft}this._try_header_sync=false};if((!_isOpera)||(_OperaRv>8.5)){this.hdr.onmousemove=function(e){this.grid.changeCursorState(e||window.event)};this.hdr.onmousedown=function(e){return this.grid.startColResize(e||window.event)}}this.obj.onmousemove=this._drawTooltip;this.objBox.onclick=function(e){(e||event).cancelBubble=true};this.obj.onclick=function(e){this.grid._doClick(e||window.event);if(this.grid._sclE){this.grid.editCell(e||window.event)}else{this.grid.editStop()}(e||event).cancelBubble=true};if(_isMacOS){this.entBox.oncontextmenu=function(e){e.cancelBubble=true;if(e.preventDefault){e.preventDefault()}else{e.returnValue=false}var that=this.grid;if(that._realfake){that=that._fake}return that._doContClick(e||window.event)}}else{this.entBox.onmousedown=function(e){return this.grid._doContClick(e||window.event)};this.entBox.oncontextmenu=function(e){if(this.grid._ctmndx){(e||event).cancelBubble=true}return !this.grid._ctmndx}}this.obj.ondblclick=function(e){if(!this.grid.wasDblClicked(e||window.event)){return false}if(this.grid._dclE){var row=this.grid.getFirstParentOfType((_isIE?event.srcElement:e.target),"TR");if(row==this.grid.row){this.grid.editCell(e||window.event)}}(e||event).cancelBubble=true;if(_isOpera){return false}};this.hdr.onclick=this._onHeaderClick;this.sortImg.onclick=function(){self._onHeaderClick.apply({grid:self},[null,self.r_fldSorted])};this.hdr.ondblclick=this._onHeaderDblClick;if(!document.body._dhtmlxgrid_onkeydown){dhtmlxEvent(document,"keydown",function(e){if(globalActiveDHTMLGridObject){return globalActiveDHTMLGridObject.doKey(e||window.event)}});document.body._dhtmlxgrid_onkeydown=true}dhtmlxEvent(document.body,"click",function(){if(self.editStop){self.editStop()}if(self.isActive){self.setActive(false)}});if(this.entBox.style.height.toString().indexOf("%")!=-1){this._delta_y=this.entBox.style.height}if(this.entBox.style.width.toString().indexOf("%")!=-1){this._delta_x=this.entBox.style.width}if(this._delta_x||this._delta_y){this._setAutoResize()}this.setColHidden=this.setColumnsVisibility;this.enableCollSpan=this.enableColSpan;this.setMultiselect=this.enableMultiselect;this.setMultiLine=this.enableMultiline;this.deleteSelectedItem=this.deleteSelectedRows;this.getSelectedId=this.getSelectedRowId;this.getHeaderCol=this.getColumnLabel;this.isItemExists=this.doesRowExist;this.getColumnCount=this.getColumnsNum;this.setSelectedRow=this.selectRowById;this.setHeaderCol=this.setColumnLabel;this.preventIECashing=this.preventIECaching;this.enableAutoHeigth=this.enableAutoHeight;this.getUID=this.uid;if(dhtmlx.image_path){this.setImagePath(dhtmlx.image_path)}if(dhtmlx.skin){this.setSkin(dhtmlx.skin)}return this}dhtmlXGridObject.prototype={getRowAttribute:function(c,a){return this.getRowById(c)._attrs[a]},setRowAttribute:function(g,a,c){this.getRowById(g)._attrs[a]=c},isTreeGrid:function(){return(this.cellType._dhx_find("tree")!=-1)},setRowHidden:function(m,g){var c=convertStringToBoolean(g);var l=this.getRowById(m);if(!l){return}if(l.expand===""){this.collapseKids(l)}if((g)&&(l.style.display!="none")){l.style.display="none";var h=this.selectedRows._dhx_find(l);if(h!=-1){l.className=l.className.replace("rowselected","");for(var a=0;a0){var c=this[g];this[g]=this[g+1];this[g+1]=c}}l--}}},enableKeyboardSupport:function(a){this._htkebl=!convertStringToBoolean(a)},enableContextMenu:function(a){this._ctmndx=a},setScrollbarWidthCorrection:function(a){},enableTooltips:function(c){this._enbTts=c.split(",");for(var a=0;a-1){a=h.length-a-1}var c=h.indexOf(",");if(c>-1){c=h.length-a-2-c}if(typeof l!="string"){l=this.i18n.decimal_separator}if(typeof n!="string"){n=this.i18n.group_separator}var q=o.split(h)[0];var m=o.split(h)[1];this._maskArr[g]=[a,c,q,m,l,n]},_aplNFb:function(l,h){var c=this._maskArr[h];if(!c){return l}var g=parseFloat(l.toString().replace(/[^0-9]*/g,""));if(l.toString().substr(0,1)=="-"){g=g*-1}if(c[0]>0){g=g/Math.pow(10,c[0])}return g},_aplNF:function(m,l){var g=this._maskArr[l];if(!g){return m}var n=(parseFloat(m)<0?"-":"")+g[2];m=Math.abs(Math.round(parseFloat(m)*Math.pow(10,g[0]>0?g[0]:0))).toString();m=(m.length0){for(var h=(g[0]>0?0:1)+g[0]+g[1];h0){if(this.hdr.rows.length>0){this.clearAll(true)}var a=[[],[],[],[],[],[],[],[],[]];var v=["","width","type","align","sort","color","format","hidden","id"];var u=["",C,"setColTypes","setColAlign","setColSorting","setColumnColor","","","setColumnIds"];for(var A=0;A0){if(!this.UserData.gridglobaluserdata){this.UserData.gridglobaluserdata=new Hashtable()}for(var y=0;y=this.grid._cCount){return}var a=this.grid.cells3(h,m._cellIndex);if(!a||!a.cell||!a.cell._attrs){return}if(g._title){a.cell.title=""}if(!a.cell._attrs.title){g._title=true}if(a){g.title=a.cell._attrs.title||(a.getTitle?a.getTitle():(a.getValue()||"").toString().replace(/<[^>]*>/gi,""))}return true},enableCellWidthCorrection:function(a){if(_isFF){this._wcorr=parseInt(a)}},getAllRowIds:function(g){var a=[];for(var c=0;c1)){if(a._childIndexes){var q=a._childIndexes[x]}else{var q=x;a._childIndexes=new Array();for(var v=0;vg){g=r}}g+=20+(c||0);this._setColumnSizeR(q,g);this._notresize=false;this.setSizes()},detachHeader:function(a,g){g=g||this.hdr;var c=g.rows[a+1];if(c){c.parentNode.removeChild(c)}this.setSizes()},detachFooter:function(a){this.detachHeader(a,this.ftr)},attachHeader:function(a,h,c){if(typeof(a)=="string"){a=this._eSplit(a)}if(typeof(h)=="string"){h=h.split(this.delim)}c=c||"_aHead";if(this.hdr.rows.length){if(a){this._createHRow([a,h],this[(c=="_aHead")?"hdr":"ftr"])}else{if(this[c]){for(var g=0;g1)){var y=r.rows.length-2;var x=false;var o=null;while(!x){var o=r.rows[y];for(var c=0;c"+(g[0][h]||" ")+""}else{q.innerHTML=(g[0][h]||" ")}if((g[0][h]||"").indexOf("#")!=-1){var v=g[0][h].match(/(^|{)#([^}]+)(}|$)/);if(v){var s="_in_header_"+v[2];if(this[s]){this[s]((this.forceDivInHeader?q.firstChild:q),h,g[0][h].split(v[0]))}}}}if(l){q.style.cssText=l[h]}n.appendChild(q)}var u=r;if(_isKHTML){if(r._kTimer){window.clearTimeout(r._kTimer)}r._kTimer=window.setTimeout(function(){r.rows[1].style.display="none";window.setTimeout(function(){r.rows[1].style.display=""},1)},500)}},attachFooter:function(a,c){this.attachHeader(a,c,"_aFoot")},setCellExcellType:function(g,a,c){this.changeCellType(this.getRowById(g),a,c)},changeCellType:function(g,h,c){c=c||this.cellType[h];var l=this.cells3(g,h);var a=l.getValue();l.cell._cellType=c;var l=this.cells3(g,h);l.setValue(a)},setRowExcellType:function(g,c){var h=this.rowsAr[g];for(var a=0;al.c?1:-1)});for(var g=0;g"];for(var a=0;a")}c.push("");g.innerHTML=c.join("");this._master_row=g.firstChild.rows[0]},_prepareRow:function(a){if(!this._master_row){this._build_master_row()}var g=this._master_row.cloneNode(true);for(var c=0;c=0;l--){var o="";for(var g=0;g0){var o=(_isIE||window._FFrv)?Math.min(c,50000):c;var n=this._add_filler(a,o);if(n){this._fillers.push(n)}c-=o;a+=o}}this.setSizes()},render_row:function(c){if(!this.rowsBuffer[c]){return -1}if(this.rowsBuffer[c]._parser){var a=this.rowsBuffer[c];if(this.rowsAr[a.idd]&&this.rowsAr[a.idd].tagName=="TR"){return this.rowsBuffer[c]=this.rowsAr[a.idd]}var g=this._prepareRow(a.idd);this.rowsBuffer[c]=g;this.rowsAr[a.idd]=g;a._parser.call(this,g,a.data);this._postRowProcessing(g);return g}return this.rowsBuffer[c]},_get_cell_value:function(c,a,g){if(c._locator){if(this._c_order){a=this._c_order[a]}return c._locator.call(this,c.data,a)}return this.cells3(c,a)[g?g:"getValue"]()},sortRows:function(g,m,c){this.editStop();c=(c||"asc").toLowerCase();m=(m||this.fldSort[g]);g=g||0;if(this.isTreeGrid()){this.sortTreeRows(g,m,c)}else{var a={};var l=this.cellType[g];var n="getValue";if(l=="link"){n="getContent"}if(l=="dhxCalendar"||l=="dhxCalendarA"){n="getDate"}for(var h=0;h4){m=window[m]}if(m=="cus"){var n=this._customSorts[g];l[h](function(q,o){return n(a[q.idd],a[o.idd],c,q.idd,o.idd)})}else{if(typeof(m)=="function"){l[h](function(q,o){return m(a[q.idd],a[o.idd],c,q.idd,o.idd)})}else{if(m=="str"){l[h](function(q,o){if(c=="asc"){return a[q.idd]>a[o.idd]?1:(a[q.idd]a[o.idd]?-1:0)}})}else{if(m=="int"){l[h](function(r,q){var o=parseFloat(a[r.idd]);o=isNaN(o)?-99999999999999:o;var s=parseFloat(a[q.idd]);s=isNaN(s)?-99999999999999:s;if(c=="asc"){return o-s}else{return s-o}})}else{if(m=="date"){l[h](function(r,q){var o=Date.parse(a[r.idd])||(Date.parse("01/01/1900"));var s=Date.parse(a[q.idd])||(Date.parse("01/01/1900"));if(c=="asc"){return o-s}else{return s-o}})}}}}}},_sortRows:function(g,h,c,a){this._sortCore(g,h,c,a,this.rowsBuffer);this._reset_view();this.callEvent("onGridReconstructed",[])},_reset_view:function(g){if(!this.obj.rows[0]){return}if(this._lahRw){this._unsetRowHover(0,true)}this.callEvent("onResetView",[]);var a=this.obj.rows[0].parentNode;var h=a.removeChild(a.childNodes[0],true);if(_isKHTML){for(var c=a.parentNode.childNodes.length-1;c>=0;c--){if(a.parentNode.childNodes[c].tagName=="TR"){a.parentNode.removeChild(a.parentNode.childNodes[c],true)}}}else{if(_isIE){for(var c=a.childNodes.length-1;c>=0;c--){a.childNodes[c].removeNode(true)}}else{a.innerHTML=""}}a.appendChild(h);this.rowsCol=dhtmlxArray();if(this._sst){this.enableStableSorting(true)}this._fillers=this.undefined;if(!g){if(_isIE&&this._srnd){this.render_dataset()}else{this.render_dataset()}}},deleteRow:function(c,h){if(!h){h=this.getRowById(c)}if(!h){return}this.editStop();if(!this._realfake){if(this.callEvent("onBeforeRowDeleted",[c])==false){return false}}var a=0;if(this.cellType._dhx_find("tree")!=-1&&!this._realfake){a=this._h2.get[c].parent.id;this._removeTrGrRow(h)}else{if(h.parentNode){h.parentNode.removeChild(h)}var m=this.rowsCol._dhx_find(h);if(m!=-1){this.rowsCol._dhx_removeAt(m)}for(var g=0;g=m){this._update_fillers(g,0,-1)}else{if(l[0]+l[1]>m){this._update_fillers(g,-1,0)}}}this._update_srnd_view()}if(this.pagingOn){this.changePage()}if(!this._realfake){this.callEvent("onAfterRowDeleted",[c,a])}this.callEvent("onGridReconstructed",[]);if(this._ahgr){this.setSizes()}return true},_addRow:function(m,n,c){if(c==-1||typeof c=="undefined"){c=this.rowsBuffer.length}if(typeof n=="string"){n=n.split(this.delim)}var o=this._prepareRow(m);o._attrs={};for(var g=0;g=c){l[1]=l[1]+1;var a=l[2].firstChild.style.height=parseInt(l[2].firstChild.style.height)+this._srdh+"px";q=true;if(this._fake){this._fake._fillers[h][1]++;this._fake._fillers[h][2].firstChild.style.height=a}}if(l&&l[0]>c){l[0]=l[0]+1;if(this._fake){this._fake._fillers[h][0]++}}}if(!q){this._fillers.push(this._add_filler(c,1,(c==0?{parentNode:this.obj.rows[0].parentNode,nextSibling:(this.rowsCol[1])}:this.rowsCol[c-1])))}return o}this.rowsBuffer._dhx_insertAt(c,o);return this._insertRowAt(o,c)},addRow:function(a,h,g){var c=this._addRow(a,h,g);if(!this.dragContext){this.callEvent("onRowAdded",[a])}if(this.pagingOn){this.changePage(this.currentPage)}if(this._srnd){this._update_srnd_view()}c._added=true;if(this._ahgr){this.setSizes()}this.callEvent("onGridReconstructed",[]);return c},_insertRowAt:function(g,h,c){this.rowsAr[g.idd]=g;if(this._skipInsert){this._skipInsert=false;return g}if((h<0)||((!h)&&(parseInt(h)!==0))){h=this.rowsCol.length}else{if(h>this.rowsCol.length){h=this.rowsCol.length}}if(this._cssEven){var a=g.className.replace(this._cssUnEven,"");if((this._cssSP?this.getLevel(g.idd):h)%2==1){g.className=a+" "+this._cssUnEven+(this._cssSU?(" "+this._cssUnEven+"_"+this.getLevel(g.idd)):"")}else{g.className=a+" "+this._cssEven+(this._cssSU?(" "+this._cssEven+"_"+this.getLevel(g.idd)):"")}}if(!c){if((h==(this.obj.rows.length-1))||(!this.rowsCol[h])){if(_isKHTML){this.obj.appendChild(g)}else{this.obj.firstChild.appendChild(g)}}else{this.rowsCol[h].parentNode.insertBefore(g,this.rowsCol[h])}}this.rowsCol._dhx_insertAt(h,g);this.callEvent("onRowInserted",[g,h]);return g},getRowById:function(g){var c=this.rowsAr[g];if(c){if(c.tagName!="TR"){for(var a=0;a0){this.smartTabOrder=convertStringToBoolean(a)}else{this.smartTabOrder=true}},setExternalTabOrder:function(l,a){var c=this;this.tabStart=(typeof(l)=="object")?l:document.getElementById(l);var g=this.tabStart.onkeydown;this.tabStart.onkeydown=function(n){if(g){g.call(this,n)}var m=(n||window.event);if(m.keyCode==9&&!m.shiftKey){m.cancelBubble=true;c.selectCell(0,0,0,0,1);if(c.smartTabOrder&&c.cells2(0,0).isDisabled()){c._key_events.k9_0_0.call(c)}this.blur();return false}};if(_isOpera){this.tabStart.onkeypress=this.tabStart.onkeydown}this.tabEnd=(typeof(a)=="object")?a:document.getElementById(a);var h=this.tabEnd.onkeydown;this.tabEnd.onkeydown=this.tabEnd.onkeypress=function(n){if(h){h.call(this,n)}var m=(n||window.event);if(m.keyCode==9&&m.shiftKey){m.cancelBubble=true;c.selectCell((c.getRowsNum()-1),(c.getColumnCount()-1),0,0,1);if(c.smartTabOrder&&c.cells2((c.getRowsNum()-1),(c.getColumnCount()-1)).isDisabled()){c._key_events.k9_0_1.call(c)}this.blur();return false}};if(_isOpera){this.tabEnd.onkeypress=this.tabEnd.onkeydown}},uid:function(){if(!this._ui_seed){this._ui_seed=(new Date()).valueOf()}return this._ui_seed++},clearAndLoad:function(){var a=this._pgn_skin;this._pgn_skin=null;this.clearAll();this._pgn_skin=a;this.load.apply(this,arguments)},getStateOfView:function(){if(this.pagingOn){var a=(this.currentPage-1)*this.rowsBufferOutSize;return[this.currentPage,a,Math.min(a+this.rowsBufferOutSize,this.rowsBuffer.length),this.rowsBuffer.length]}return[Math.floor(this.objBox.scrollTop/this._srdh),Math.ceil(parseInt(this.objBox.offsetHeight)/this._srdh),this.rowsBuffer.length]}};(function(){function h(n,o){this[n]=o}function m(n,o){this[n].call(this,o)}function g(n,o){this[n].call(this,o.join(this.delim))}function a(n,r){for(var q=0;q1?a:c)])};dhtmlXGridCellObject.prototype.setCTxtValue=function(a){this.cell.innerHTML="";this.cell.appendChild(document.createTextNode(a));this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,a])};dhtmlXGridCellObject.prototype.setLabel=function(a){this.cell.innerHTML=a};dhtmlXGridCellObject.prototype.getMath=function(){if(this._val){return this.val}else{return this.getValue()}};function eXcell(){this.obj=null;this.val=null;this.changeState=function(){return false};this.edit=function(){this.val=this.getValue()};this.detach=function(){return false};this.getPosition=function(h){var a=h;var g=0;var c=0;while(a.tagName!="BODY"){g+=a.offsetLeft;c+=a.offsetTop;a=a.offsetParent}return new Array(g,c)}}eXcell.prototype=new dhtmlXGridCellObject;function eXcell_ed(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){this.cell.atag=((!this.grid.multiLine)&&(_isKHTML||_isMacOS||_isFF))?"INPUT":"TEXTAREA";this.val=this.getValue();this.obj=document.createElement(this.cell.atag);this.obj.setAttribute("autocomplete","off");this.obj.style.height=(this.cell.offsetHeight-(_isIE?4:4))+"px";this.obj.className="dhx_combo_edit";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(c){(c||event).cancelBubble=true};this.obj.onmousedown=function(c){(c||event).cancelBubble=true};this.obj.value=this.val;this.cell.innerHTML="";this.cell.appendChild(this.obj);this.obj.onselectstart=function(c){if(!c){c=event}c.cancelBubble=true;return true};if(_isIE){this.obj.focus();this.obj.blur()}this.obj.focus()};this.getValue=function(){if((this.cell.firstChild)&&((this.cell.atag)&&(this.cell.firstChild.tagName==this.cell.atag))){return this.cell.firstChild.value}if(this.cell._clearCell){return""}return this.cell.innerHTML.toString()._dhx_trim()};this.detach=function(){this.setValue(this.obj.value);return this.val!=this.getValue()}}eXcell_ed.prototype=new eXcell;function eXcell_edtxt(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.getValue=function(){if((this.cell.firstChild)&&((this.cell.atag)&&(this.cell.firstChild.tagName==this.cell.atag))){return this.cell.firstChild.value}if(this.cell._clearCell){return""}return(_isIE?this.cell.innerText:this.cell.textContent)};this.setValue=function(c){if(!c||c.toString()._dhx_trim()==""){c=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(c)}}eXcell_edtxt.prototype=new eXcell_ed;function eXcell_edn(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.getValue=function(){if((this.cell.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA")){return this.cell.firstChild.value}if(this.cell._clearCell){return""}return this.cell._orig_value||this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex)};this.detach=function(){var c=this.obj.value;this.setValue(c);return this.val!=this.getValue()}}eXcell_edn.prototype=new eXcell_ed;eXcell_edn.prototype.setValue=function(a){if(!a||a.toString()._dhx_trim()==""){this.cell._clearCell=true;return this.setCValue(" ",0)}else{this.cell._clearCell=false;this.cell._orig_value=a}this.setCValue(this.grid._aplNF(a,this.cell._cellIndex),a)};function eXcell_ch(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.disabledF=function(c){if((c==true)||(c==1)){this.cell.innerHTML=this.cell.innerHTML.replace("item_chk0.","item_chk0_dis.").replace("item_chk1.","item_chk1_dis.")}else{this.cell.innerHTML=this.cell.innerHTML.replace("item_chk0_dis.","item_chk0.").replace("item_chk1_dis.","item_chk1.")}};this.changeState=function(c){if(c===true&&!this.grid.isActive){if(window.globalActiveDHTMLGridObject!=null&&window.globalActiveDHTMLGridObject!=this.grid&&window.globalActiveDHTMLGridObject.isActive){window.globalActiveDHTMLGridObject.setActive(false)}this.grid.setActive(true)}if((!this.grid.isEditable)||(this.cell.parentNode._locked)||(this.isDisabled())){return}if(this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex])){this.val=this.getValue();if(this.val=="1"){this.setValue("0")}else{this.setValue("1")}this.cell.wasChanged=true;this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")]);this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")])}else{this.editor=null}};this.getValue=function(){return this.cell.chstate?this.cell.chstate.toString():"0"};this.isCheckbox=function(){return true};this.isChecked=function(){if(this.getValue()=="1"){return true}else{return false}};this.setChecked=function(c){this.setValue(c.toString())};this.detach=function(){return this.val!=this.getValue()};this.edit=null}eXcell_ch.prototype=new eXcell;eXcell_ch.prototype.setValue=function(c){this.cell.style.verticalAlign="middle";if(c){c=c.toString()._dhx_trim();if((c=="false")||(c=="0")){c=""}}if(c){c="1";this.cell.chstate="1"}else{c="0";this.cell.chstate="0"}var a=this;this.setCValue("",this.cell.chstate)};function eXcell_ra(a){this.base=eXcell_ch;this.base(a);this.grid=a.parentNode.grid;this.disabledF=function(c){if((c==true)||(c==1)){this.cell.innerHTML=this.cell.innerHTML.replace("radio_chk0.","radio_chk0_dis.").replace("radio_chk1.","radio_chk1_dis.")}else{this.cell.innerHTML=this.cell.innerHTML.replace("radio_chk0_dis.","radio_chk0.").replace("radio_chk1_dis.","radio_chk1.")}};this.changeState=function(c){if(c===false&&this.getValue()==1){return}if((!this.grid.isEditable)||(this.cell.parentNode._locked)||(this.isDisabled())){return}if(this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex])!=false){this.val=this.getValue();if(this.val=="1"){this.setValue("0")}else{this.setValue("1")}this.cell.wasChanged=true;this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")]);this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")])}else{this.editor=null}};this.edit=null}eXcell_ra.prototype=new eXcell_ch;eXcell_ra.prototype.setValue=function(c){this.cell.style.verticalAlign="middle";if(c){c=c.toString()._dhx_trim();if((c=="false")||(c=="0")){c=""}}if(c){if(!this.grid._RaSeCol){this.grid._RaSeCol=[]}if(this.grid._RaSeCol[this.cell._cellIndex]){var a=this.grid.cells4(this.grid._RaSeCol[this.cell._cellIndex]);a.setValue("0");if(this.grid.rowsAr[a.cell.parentNode.idd]){this.grid.callEvent("onEditCell",[1,a.cell.parentNode.idd,a.cell._cellIndex])}}this.grid._RaSeCol[this.cell._cellIndex]=this.cell;c="1";this.cell.chstate="1"}else{c="0";this.cell.chstate="0"}this.setCValue("",this.cell.chstate)};function eXcell_txt(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){this.val=this.getValue();this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_textarea";this.obj.onclick=function(l){(l||event).cancelBubble=true};var g=this.grid.getPosition(this.cell);this.obj.value=this.val;this.obj.style.display="";this.obj.style.textAlign=this.cell.style.textAlign;if(_isFF){var c=document.createElement("DIV");c.appendChild(this.obj);c.style.overflow="auto";c.className="dhx_textarea";this.obj.style.margin="0px 0px 0px 0px";this.obj.style.border="0px";this.obj=c}document.body.appendChild(this.obj);if(_isOpera){this.obj.onkeypress=function(l){if(l.keyCode==9){return false}}}this.obj.onkeydown=function(m){var l=(m||event);if(l.keyCode==9){globalActiveDHTMLGridObject.entBox.focus();globalActiveDHTMLGridObject.doKey({keyCode:l.keyCode,shiftKey:l.shiftKey,srcElement:"0"});return false}};this.obj.style.left=g[0]+"px";this.obj.style.top=g[1]+this.cell.offsetHeight+"px";if(this.cell.offsetWidth<200){var h=200}else{var h=this.cell.offsetWidth}this.obj.style.width=h+(_isFF?18:16)+"px";if(_isFF){this.obj.firstChild.style.width=parseInt(this.obj.style.width)+"px";this.obj.firstChild.style.height=this.obj.offsetHeight-3+"px"}if(_isIE){this.obj.select();this.obj.value=this.obj.value}if(_isFF){this.obj.firstChild.focus()}else{this.obj.focus()}};this.detach=function(){var c="";if(_isFF){c=this.obj.firstChild.value}else{c=this.obj.value}if(c==""){this.cell._clearCell=true}else{this.cell._clearCell=false}this.setValue(c);document.body.removeChild(this.obj);this.obj=null;return this.val!=this.getValue()};this.getValue=function(){if(this.obj){if(_isFF){return this.obj.firstChild.value}else{return this.obj.value}}if(this.cell._clearCell){return""}if(typeof this.cell._brval!="undefined"){return this.cell._brval}if((!this.grid.multiLine)){return this.cell._brval||this.cell.innerHTML}else{return this.cell._brval||this.cell.innerHTML.replace(/]*>/gi,"\n")._dhx_trim()}}}eXcell_txt.prototype=new eXcell;function eXcell_txttxt(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.getValue=function(){if((this.cell.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA")){return this.cell.firstChild.value}if(this.cell._clearCell){return""}if((!this.grid.multiLine)&&this.cell._brval){return this.cell._brval}return(_isIE?this.cell.innerText:this.cell.textContent)};this.setValue=function(c){this.cell._brval=c;if(!c||c.toString()._dhx_trim()==""){c=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(c)}}eXcell_txttxt.prototype=new eXcell_txt;eXcell_txt.prototype.setValue=function(a){this.cell._brval=a;if(!a||a.toString()._dhx_trim()==""){a=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}if((!this.grid.multiLine)||this.cell._clearCell){this.setCValue(a,this.cell._brval)}else{this.setCValue(a.replace(/\n/g,"
"),a)}};function eXcell_co(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.combo=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex));this.editable=true}this.shiftNext=function(){var c=this.list.options[this.list.selectedIndex+1];if(c){c.selected=true}this.obj.value=this.list.options[this.list.selectedIndex].text;return true};this.shiftPrev=function(){if(this.list.selectedIndex!=0){var c=this.list.options[this.list.selectedIndex-1];if(c){c.selected=true}this.obj.value=this.list.options[this.list.selectedIndex].text}return true};this.edit=function(){this.val=this.getValue();this.text=this.getText()._dhx_trim();var h=this.grid.getPosition(this.cell);this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_combo_edit";this.obj.style.height=(this.cell.offsetHeight-4)+"px";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(q){(q||event).cancelBubble=true};this.obj.onmousedown=function(q){(q||event).cancelBubble=true};this.obj.value=this.text;this.obj.onselectstart=function(q){if(!q){q=event}q.cancelBubble=true;return true};var m=this;this.obj.onkeyup=function(s){var r=(s||event).keyCode;if(r==38||r==40||r==9){return}var u=this.readonly?String.fromCharCode(r):this.value;var v=m.list.options;for(var q=0;q ",a);this.cell.firstChild._bg=a};function eXcell_img(a){try{this.cell=a;this.grid=this.cell.parentNode.grid}catch(c){}this.getValue=function(){if(this.cell.firstChild.tagName=="IMG"){return this.cell.firstChild.src+(this.cell.titFl!=null?"^"+this.cell._brval:"")}else{if(this.cell.firstChild.tagName=="A"){var g=this.cell.firstChild.firstChild.src+(this.cell.titFl!=null?"^"+this.cell._brval:"");g+="^"+this.cell.lnk;if(this.cell.trg){g+="^"+this.cell.trg}return g}}};this.isDisabled=function(){return true}}eXcell_img.prototype=new eXcell;eXcell_img.prototype.getTitle=function(){return this.cell._brval};eXcell_img.prototype.setValue=function(g){var c=g;if((g||"").indexOf("^")!=-1){var a=g.split("^");g=a[0];c=this.cell._attrs.title||a[1];if(a.length>2){this.cell.lnk=a[2];if(a[3]){this.cell.trg=a[3]}}this.cell.titFl="1"}this.setCValue("",g);if(this.cell.lnk){this.cell.innerHTML=""+this.cell.innerHTML+""}this.cell._brval=c};function eXcell_price(a){this.base=eXcell_ed;this.base(a);this.getValue=function(){if(this.cell.childNodes.length>1){return this.cell.childNodes[1].innerHTML.toString()._dhx_trim()}else{return"0"}}}eXcell_price.prototype=new eXcell_ed;eXcell_price.prototype.setValue=function(c){if(isNaN(parseFloat(c))){c=this.val||0}var a="green";if(c<0){a="red"}this.setCValue("$"+c+"",c)};function eXcell_dyn(a){this.base=eXcell_ed;this.base(a);this.getValue=function(){return this.cell.firstChild.childNodes[1].innerHTML.toString()._dhx_trim()}}eXcell_dyn.prototype=new eXcell_ed;eXcell_dyn.prototype.setValue=function(g){if(!g||isNaN(Number(g))){if(g!==""){g=0}}if(g>0){var c="green";var a="dyn_up.gif"}else{if(g==0){var c="black";var a="dyn_.gif"}else{var c="red";var a="dyn_down.gif"}}this.setCValue("
"+g+"
",g)};function eXcell_ro(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){};this.isDisabled=function(){return true};this.getValue=function(){return this.cell._clearCell?"":this.cell.innerHTML.toString()._dhx_trim()}}eXcell_ro.prototype=new eXcell;window.eXcell_hidden=function(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){};this.isDisabled=function(){return true};this.getValue=function(){return this.cell.val}};eXcell_hidden.prototype=new eXcell;eXcell_hidden.prototype.setValue=function(a){this.cell.val=a};function eXcell_ron(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return true};this.getValue=function(){return this.cell._clearCell?"":this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex).toString()}}eXcell_ron.prototype=new eXcell;eXcell_ron.prototype.setValue=function(a){if(a===0){}else{if(!a||a.toString()._dhx_trim()==""){this.setCValue(" ");return this.cell._clearCell=true}}this.cell._clearCell=false;this.setCValue(a?this.grid._aplNF(a,this.cell._cellIndex):"0")};function eXcell_rotxt(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return true};this.setValue=function(c){if(!c){c=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(c)};this.getValue=function(){if(this.cell._clearCell){return""}return(_isIE?this.cell.innerText:this.cell.textContent)}}eXcell_rotxt.prototype=new eXcell;function dhtmlXGridComboObject(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray();this.put=function(c,g){for(var a=0;a=0;c--){if(this._checkParent(this.rowsAr[l[c]],l)){l.splice(c,1)}}}var q=this;if(l.length&&this._dndorder){l.sort(function(s,r){return(q.rowsAr[s].rowIndex>q.rowsAr[r].rowIndex?1:-1)})}var a=this.getFirstParentOfType(_isIE?h.srcElement:h.target,"TD");if(a){this._dndExtra=a._cellIndex}this._dragged=new Array();for(var c=0;c=0&&this.tobj._h2.get[this.tobj.rowsBuffer[a].idd].state=="minus")?this.tobj._getOpenLenght(this.tobj.rowsBuffer[a].idd,0):0))};dragContext.prototype.img=function(){if((this.target!="grid")&&(this.sobj._h2)){return this.sobj.getItemImage(this.sid)}else{return null}};dragContext.prototype.slist=function(){var c=new Array();for(var a=0;a(parseInt(this.objBox.offsetHeight)-50)){this.objBox.scrollTop=parseInt(this.objBox.scrollTop)+20}if((g-a+parseInt(this.objBox.scrollTop))<(parseInt(this.objBox.scrollTop)+30)){this.objBox.scrollTop=parseInt(this.objBox.scrollTop)-20}if(l){return 0}if(this.dadmode==2){var n=o-g+(document.body.scrollTop||document.documentElement.scrollTop)-2-m.offsetHeight/2;if((Math.abs(n)-m.offsetHeight/6)>0){this.dadmodec=1;if(n<0){this.dadmodefix=-1}else{this.dadmodefix=1}}else{this.dadmodec=0}}else{this.dadmodec=this.dadmode}if(this.dadmodec){if(!this._sdrgc){this._createSdrgc()}this._sdrgc.style.display="block";this._sdrgc.style.top=g-a+parseInt(this.objBox.scrollTop)+((this.dadmodefix>=0)?m.offsetHeight:0)+"px"}else{this._llSelD=m;if(m.parentNode.tagName=="TR"){for(var h=0;h$/,"columns>");for(var K=2;K=a._fake.hdrLabels.length))){D++;continue}var Q=M[K][J];var P=((Q[0]&&Q[0]>1)?' colspan="'+Q[0]+'" ':"");if(Q[1]&&Q[1]>1){P+=' rowspan="'+Q[1]+'" ';D=-1}var E="";var I=S;if(a._fake&&J"}if(D!=a._cCount){L+="\n"+N+""}}L+="\n";L+=q();return L}function g(){var D=[];if(o){for(var E=0;E"];if(!a.ftr){return""}for(var H=1;H");var K=a.ftr.rows[H];for(var E=0;E=a._fake.hdrLabels.length)){continue}for(var D=0;D")}F.push("")}F.push("");return F.join("\n")}function n(E,D){return(window.getComputedStyle?(window.getComputedStyle(E,null)[D]):(E.currentStyle?E.currentStyle[D]:null))||""}function v(H){if(!a.rowsBuffer[H]){return""}var D=a.render_row(H);if(D.style.display=="none"){return""}var E=a.isTreeGrid()?' level="'+a.getLevel(D.idd)+'"':"";var L="";for(var J=0;J"}else{L+=""}L+=""}}return L+""}function s(){var D="";return D}var y=document.createElement("div");y.style.display="none";document.body.appendChild(y);var m="form_"+a.uid();y.innerHTML='
';document.getElementById(m).firstChild.value=encodeURIComponent(A(r).replace("\u2013","-")+g()+s());document.getElementById(m).submit();y.parentNode.removeChild(y);a=null;if(l){l.el.parentNode.className+=" rowselected";l.el.className+=" cellselected"}l=null};dhtmlXGridObject.prototype._serialiseExportConfig=function(m){function l(r){if(typeof(r)!=="string"){return r}r=r.replace(/&/g,"&");r=r.replace(/"/g,""");r=r.replace(/'/g,"'");r=r.replace(//g,">");return r}var c="";for(var g=0;g=this._fake.hdrLabels.length)){continue}var h=this.fldSort[g];if(h=="cus"){h=this._customSorts[g].toString();h=h.replace(/function[\ ]*/,"").replace(/\([^\f]*/,"")}var q=m[1][g];var n=((q[1]&&q[1]>1)?' rowspan="'+q[1]+'" ':"")+((q[0]&&q[0]>1)?' colspan="'+q[0]+'" ':"");c+=""}return c+=""};if(window.eXcell_sub_row_grid){window.eXcell_sub_row_grid.prototype.getContent=function(){return""}}dhtmlXGridObject.prototype.toExcel=function(a,h,n,m,c){if(!document.getElementById("ifr")){var l=document.createElement("iframe");l.style.display="none";l.setAttribute("name","dhx_export_iframe");l.setAttribute("src","");l.setAttribute("id","dhx_export_iframe");document.body.appendChild(l)}var g=' target="dhx_export_iframe"';this.toPDF(a,h,n,m,c,g)};dhtmlXGridObject.prototype.filterBy=function(g,h,c){if(this.isTreeGrid()){return this.filterTreeBy(g,h,c)}if(this._f_rowsBuffer){if(!c){this.rowsBuffer=dhtmlxArray([].concat(this._f_rowsBuffer));if(this._fake){this._fake.rowsBuffer=this.rowsBuffer}}}else{this._f_rowsBuffer=[].concat(this.rowsBuffer)}if(!this.rowsBuffer.length){return}var l=true;this.dma(true);if(typeof(g)=="object"){for(var a=0;a=0;a--){if(h?(this._get_cell_value(this.rowsBuffer[a],c).toString().toLowerCase().indexOf(g)==-1):(!g.call(this,this._get_cell_value(this.rowsBuffer[a],c),this.rowsBuffer[a].idd))){this.rowsBuffer.splice(a,1)}}};dhtmlXGridObject.prototype.getFilterElement=function(a){if(!this.filters){return}for(var c=0;c=this._cCount){continue}c.push(m);var n=this.filters[h][0].old_value=this.filters[h][0].value;if(this.filters[h][0]._filter){n=this.filters[h][0]._filter()}var l;if(typeof n!="function"&&(l=(this.combos[m]||(this._col_combos?this._col_combos[m]:false)))){if(l.values){m=l.values._dhx_find(n);n=(m==-1)?n:l.keys[m]}else{if(l.getOptionByLabel){n=(l.getOptionByLabel(n)?l.getOptionByLabel(n).value:n)}}}g.push(n)}if(!this.callEvent("onFilterStart",[c,g])){return}this.filterBy(c,g);if(this._cssEven){this._fixAlterCss()}this.callEvent("onFilterEnd",[this.filters]);if(this._f_rowsBuffer&&this.rowsBuffer.length==this._f_rowsBuffer.length){this._f_rowsBuffer=null}};dhtmlXGridObject.prototype.makeFilter=function(l,g,c){if(!this.filters){this.filters=[]}if(typeof(l)!="object"){l=document.getElementById(l)}if(!l){return}var a=this;if(!l.style.width){l.style.width="90%"}if(l.tagName=="SELECT"){this.filters.push([l,g]);this._loadSelectOptins(l,g);l.onchange=function(){a.filterByAll()};if(_isIE){l.style.marginTop="1px"}this.attachEvent("onEditCell",function(n,m,o){this._build_m_order();if(n==2&&this.filters&&(this._m_order?(o==this._m_order[g]):(o==g))){this._loadSelectOptins(l,g)}return true})}else{if(l.tagName=="INPUT"){this.filters.push([l,g]);l.old_value=l.value="";l.onkeydown=function(){if(this._timer){window.clearTimeout(this._timer)}this._timer=window.setTimeout(function(){if(l.value!=l.old_value){a.filterByAll();l.old_value=l.value}},500)}}else{if(l.tagName=="DIV"&&l.className=="combo"){this.filters.push([l,g]);l.style.padding="0px";l.style.margin="0px";if(!window.dhx_globalImgPath){window.dhx_globalImgPath=this.imgURL}var h=new dhtmlXCombo(l,"_filter","90%");h.filterSelfA=h.filterSelf;h.filterSelf=function(){if(this.getSelectedIndex()==0){this.setComboText("")}this.filterSelfA.apply(this,arguments);this.optionsArr[0].hide(false)};h.enableFilteringMode(true);l.combo=h;l.value="";this._loadComboOptins(l,g);h.attachEvent("onChange",function(){l.value=h.getSelectedValue();if(l.value===null){l.value=""}a.filterByAll()})}}}if(l.parentNode){l.parentNode.className+=" filter"}this._filters_ready()};dhtmlXGridObject.prototype.findCell=function(m,n,h,l){var l=l||(function(q,o){return o.toString().toLowerCase().indexOf(q)!=-1});if(l===true){l=function(q,o){return o.toString().toLowerCase()==q}}var g=new Array();m=m.toString().toLowerCase();if(typeof h!="number"){h=h?1:0}if(!this.rowsBuffer.length){return g}for(var c=(n||0);c";c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};c.onselectstart=function(){return(event.cancelBubble=true)};this.makeFilter(c.firstChild,a)};dhtmlXGridObject.prototype._in_header_text_filter_inc=function(c,a){c.innerHTML="";c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};c.onselectstart=function(){return(event.cancelBubble=true)};this.makeFilter(c.firstChild,a);c.firstChild._filter=function(){if(c.firstChild.value==""){return""}return function(g){return(g.toString().toLowerCase().indexOf(c.firstChild.value.toLowerCase())==0)}};this._filters_ready()};dhtmlXGridObject.prototype._in_header_select_filter=function(c,a){c.innerHTML="";c.onclick=function(g){(g||event).cancelBubble=true;return false};this.makeFilter(c.firstChild,a)};dhtmlXGridObject.prototype._in_header_select_filter_strict=function(g,c){g.innerHTML="";g.onclick=function(h){(h||event).cancelBubble=true;return false};this.makeFilter(g.firstChild,c);var a=this.combos;g.firstChild._filter=function(){var h=g.firstChild.value;if(!h){return""}if(a[c]){h=a[c].keys[a[c].values._dhx_find(h)]}h=h.toLowerCase();return function(l){return(l.toString().toLowerCase()==h)}};this._filters_ready()};dhtmlXGridObject.prototype._in_header_combo_filter=function(c,a){c.innerHTML="
";c.onselectstart=function(){return(event.cancelBubble=true)};c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};this.makeFilter(c.firstChild,a)};dhtmlXGridObject.prototype._search_common=function(c,a){c.innerHTML="";c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};c.onselectstart=function(){return(event.cancelBubble=true)}};dhtmlXGridObject.prototype._in_header_text_search=function(g,c,a){this._search_common(g,c);this.makeSearch(g.firstChild,c)};dhtmlXGridObject.prototype._in_header_text_search_strict=function(c,a){this._search_common(c,a);this.makeSearch(c.firstChild,a,true)};dhtmlXGridObject.prototype._in_header_numeric_filter=function(c,a){this._in_header_text_filter.call(this,c,a);c.firstChild._filter=function(){var g=this.value;var l;var n="==";var h=parseFloat(g.replace("=",""));var m=null;if(g){if(g.indexOf("..")!=-1){g=g.split("..");h=parseFloat(g[0]);m=parseFloat(g[1]);return function(o){if(o>=h&&o<=m){return true}return false}}l=g.match(/>=|<=|>|"+l[1];var a=this;h.getElementsByTagName("input")[0].onclick=function(m){a._build_m_order();var c=a._m_order?a._m_order[g]:g;var n=this.checked?1:0;a.forEachRowA(function(q){var o=this.cells(q,c);if(o.isCheckbox()){o.setValue(n);o.cell.wasChanged=true}this.callEvent("onEditCell",[1,q,c,n]);this.callEvent("onCheckbox",[q,c,n])});(m||event).cancelBubble=true}};dhtmlXGridObject.prototype._in_header_stat_total=function(g,a,l){var h=function(){var o=0;this._build_m_order();var n=this._m_order?this._m_order[a]:a;for(var m=0;mh&&g){g--}for(var s=g;h=n){break}}if(h>=n){break}h++;if(m.cell){zxVal=m[this._agetm]()}else{zxVal=""}if((this._chAttr)&&(m.wasChanged())){v=true}o[o.length]=((zxVal===null)?"":zxVal);if(this._ecspn&&l.colSpan&&l.colSpan>1){l=l.colSpan-1;for(var w=0;w0&&!g[r].length){g.splice(r,1)}return g},str:function(g,a,h){for(var c=0;c";if(!this.parentGrid){q+=(s||"")}q+='';var r=Math.max(this.rowsBuffer.length,this.rowsCol.length);var o=this._cCount;var u=this._printWidth();q+='';for(var A=0;A'+this.getHeaderCol(A)+"";A+=a-1}q+="";for(var A=2;A";var h=this.hdr.rows[A].childNodes;for(var y=0;y"}else{q+=""+(this._fake?this._fake.hdr.rows[A].innerHTML:"")+this.hdr.rows[A].innerHTML+""}}for(var A=0;A";if(this.rowsCol[A]&&this.rowsCol[A]._cntr){q+=this.rowsCol[A].innerHTML.replace(/]*>/gi,"")+"";continue}if(this.rowsCol[A]&&this.rowsCol[A].style.display=="none"){continue}var n;if(this.rowsCol[A]){n=this.rowsCol[A].idd}else{if(this.rowsBuffer[A]){n=this.rowsBuffer[A].idd}else{continue}}for(var y=0;y"+(v===""?" ":v)+"";if(D){y+=D-1}}q+="";if(this.rowsCol[A]&&this.rowsCol[A]._expanded){var m=this.cells4(this.rowsCol[A]._expanded.ctrl);if(m.getSubGrid){q+='"}else{q+='"}}}if(this.ftr){for(var A=1;A"+((this._fake)?this._fake.ftr.childNodes[0].rows[A].innerHTML:"")+this.ftr.childNodes[0].rows[A].innerHTML+""}}q+="
'+m.getSubGrid().printView()+"
'+this.rowsCol[A]._expanded.innerHTML+"
";if(this.parentGrid){return q}q+=(g||"");var E=window.open("","_blank");E.document.write(q);E.document.write("