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

Please contact sales@dhtmlx.com to obtain necessary 
license for usage of dhtmlx components.
[*] Cracked by Antoor<http://weibo.com/antoor> :)
===================================================================
*/

if(typeof(window.dhx4)=="undefined"){window.dhx4={version:"4.4",skin:null,skinDetect:function(a){return{10:"dhx_skyblue",20:"dhx_web",30:"dhx_terrace"}[this.readFromCss(a+"_skin_detect")]||null},readFromCss:function(e,g){var c=document.createElement("DIV");c.className=e;if(document.body.firstChild!=null){document.body.insertBefore(c,document.body.firstChild)}else{document.body.appendChild(c)}var a=c[g||"offsetWidth"];c.parentNode.removeChild(c);c=null;return a},lastId:1,newId:function(){return this.lastId++},zim:{data:{},step:5,first:function(){return 100},last:function(){var e=this.first();for(var c in this.data){e=Math.max(e,this.data[c])}return e},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){if(typeof(a)=="string"){a=a.toLowerCase()}return(a==true||a==1||a=="true"||a=="1"||a=="yes"||a=="y"||a=="on")},s2j:function(s){var obj=null;dhx4.temp=null;try{eval("dhx4.temp="+s)}catch(e){dhx4.temp=null}obj=dhx4.temp;dhx4.temp=null;return obj},absLeft:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this.getOffset(a).left},absTop:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this.getOffset(a).top},_aOfs:function(a){var e=0,c=0;while(a){e=e+parseInt(a.offsetTop);c=c+parseInt(a.offsetLeft);a=a.offsetParent}return{top:e,left:c}},_aOfsRect:function(g){var m=g.getBoundingClientRect();var n=document.body;var c=document.documentElement;var a=window.pageYOffset||c.scrollTop||n.scrollTop;var h=window.pageXOffset||c.scrollLeft||n.scrollLeft;var l=c.clientTop||n.clientTop||0;var o=c.clientLeft||n.clientLeft||0;var q=m.top+a-l;var e=m.left+h-o;return{top:Math.round(q),left:Math.round(e)}},getOffset:function(a){if(a.getBoundingClientRect){return this._aOfsRect(a)}else{return this._aOfs(a)}},_isObj:function(a){return(a!=null&&typeof(a)=="object"&&typeof(a.length)=="undefined")},_copyObj:function(g){if(this._isObj(g)){var e={};for(var c in g){if(typeof(g[c])=="object"&&g[c]!=null){e[c]=this._copyObj(g[c])}else{e[c]=g[c]}}}else{var e=[];for(var c=0;c<g.length;c++){if(typeof(g[c])=="object"&&g[c]!=null){e[c]=this._copyObj(g[c])}else{e[c]=g[c]}}}return e},screenDim:function(){var a=(navigator.userAgent.indexOf("MSIE")>=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 e={MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd",OTransition:"oTransitionEnd",msTransition:"transitionend",transition:"transitionend"};for(var c in e){if(this.transData.transProp==false&&document.documentElement.style[c]!=null){this.transData.transProp=c;this.transData.transEv=e[c]}}e=null}return this.transData},_xmlNodeValue:function(a){var e="";for(var c=0;c<a.childNodes.length;c++){e+=(a.childNodes[c].nodeValue!=null?a.childNodes[c].nodeValue.toString().replace(/^[\n\r\s]{0,}/,"").replace(/[\n\r\s]{0,}$/,""):"")}return e}};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.isIE8=(navigator.userAgent.indexOf("MSIE 8.0")>=0&&navigator.userAgent.indexOf("Trident")>=0);window.dhx4.isIE9=(navigator.userAgent.indexOf("MSIE 9.0")>=0&&navigator.userAgent.indexOf("Trident")>=0);window.dhx4.isIE10=(navigator.userAgent.indexOf("MSIE 10.0")>=0&&navigator.userAgent.indexOf("Trident")>=0&&window.navigator.pointerEnabled!=true);window.dhx4.isIE11=(navigator.userAgent.indexOf("Trident")>=0&&window.navigator.pointerEnabled==true);window.dhx4.isEdge=(navigator.userAgent.indexOf("Edge")>=0);window.dhx4.isOpera=(navigator.userAgent.indexOf("Opera")>=0);window.dhx4.isChrome=(navigator.userAgent.indexOf("Chrome")>=0)&&!window.dhx4.isEdge;window.dhx4.isKHTML=(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0)&&!window.dhx4.isEdge;window.dhx4.isFF=(navigator.userAgent.indexOf("Firefox")>=0);window.dhx4.isIPad=(navigator.userAgent.search(/iPad/gi)>=0);window.dhx4.dnd={evs:{},p_en:((window.dhx4.isIE||window.dhx4.isEdge)&&(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)),_mTouch:function(a){return(window.dhx4.isIE10&&a.pointerType==a.MSPOINTER_TYPE_MOUSE||window.dhx4.isIE11&&a.pointerType=="mouse"||window.dhx4.isEdge&&a.pointerType=="mouse")},_touchOn:function(a){if(a==null){a=document.body}a.style.touchAction=a.style.msTouchAction="";a=null},_touchOff:function(a){if(a==null){a=document.body}a.style.touchAction=a.style.msTouchAction="none";a=null}};if(window.navigator.pointerEnabled==true){window.dhx4.dnd.evs={start:"pointerdown",move:"pointermove",end:"pointerup"}}else{if(window.navigator.msPointerEnabled==true){window.dhx4.dnd.evs={start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}}else{if(typeof(window.addEventListener)!="undefined"){window.dhx4.dnd.evs={start:"touchstart",move:"touchmove",end:"touchend"}}}}}if(typeof(window.dhx4.template)=="undefined"){window.dhx4.trim=function(a){return String(a).replace(/^\s{1,}/,"").replace(/\s{1,}$/,"")};window.dhx4.template=function(c,e,a){return c.replace(/#([a-z0-9_-]{1,})(\|([^#]*))?#/gi,function(){var m=arguments[1];var l=window.dhx4.trim(arguments[3]);var n=null;var h=[e[m]];if(l.length>0){l=l.split(":");var g=[];for(var o=0;o<l.length;o++){if(o>0&&g[g.length-1].match(/\\$/)!=null){g[g.length-1]=g[g.length-1].replace(/\\$/,"")+":"+l[o]}else{g.push(l[o])}}n=g[0];for(var o=1;o<g.length;o++){h.push(g[o])}}if(typeof(n)=="string"&&typeof(window.dhx4.template[n])=="function"){return window.dhx4.template[n].apply(window.dhx4.template,h)}if(m.length>0&&typeof(e[m])!="undefined"){if(a==true){return window.dhx4.trim(e[m])}return String(e[m])}return""})};window.dhx4.template.date=function(a,c){if(a!=null){if(a instanceof Date){return window.dhx4.date2str(a,c)}else{a=a.toString();if(a.match(/^\d*$/)!=null){return window.dhx4.date2str(new Date(parseInt(a)),c)}return a}}return""};window.dhx4.template.maxlength=function(c,a){return String(c).substr(0,a)};window.dhx4.template.number_format=function(g,h,e,a){var c=window.dhx4.template._parseFmt(h,e,a);if(c==false){return g}return window.dhx4.template._getFmtValue(g,c)};window.dhx4.template.lowercase=function(a){if(typeof(a)=="undefined"||a==null){a=""}return String(a).toLowerCase()};window.dhx4.template.uppercase=function(a){if(typeof(a)=="undefined"||a==null){a=""}return String(a).toUpperCase()};window.dhx4.template._parseFmt=function(m,e,a){var g=m.match(/^([^\.\,0-9]*)([0\.\,]*)([^\.\,0-9]*)/);if(g==null||g.length!=4){return false}var c={i_len:false,i_sep:(typeof(e)=="string"?e:","),d_len:false,d_sep:(typeof(a)=="string"?a:"."),s_bef:(typeof(g[1])=="string"?g[1]:""),s_aft:(typeof(g[3])=="string"?g[3]:"")};var l=g[2].split(".");if(l[1]!=null){c.d_len=l[1].length}var h=l[0].split(",");if(h.length>1){c.i_len=h[h.length-1].length}return c};window.dhx4.template._getFmtValue=function(value,fmt){var r=String(value).match(/^(-)?([0-9]{1,})(\.([0-9]{1,}))?$/);if(r!=null&&r.length==5){var v0="";if(r[1]!=null){v0+=r[1]}v0+=fmt.s_bef;if(fmt.i_len!==false){var i=0;var v1="";for(var q=r[2].length-1;q>=0;q--){v1=""+r[2].charAt(q)+v1;if(++i==fmt.i_len&&q>0){v1=fmt.i_sep+v1;i=0}}v0+=v1}else{v0+=r[2]}if(fmt.d_len!==false){if(r[4]==null){r[4]=""}while(r[4].length<fmt.d_len){r[4]+="0"}eval("dhx4.temp = new RegExp(/\\d{"+fmt.d_len+"}/);");var t1=(r[4]).match(dhx4.temp);if(t1!=null){v0+=fmt.d_sep+t1}dhx4.temp=t1=null}v0+=fmt.s_aft;return v0}return value}}if(typeof(window.dhx4.dateLang)=="undefined"){window.dhx4.dateLang="en";window.dhx4.dateStrings={en:{monthFullName:["January","February","March","April","May","June","July","August","September","October","November","December"],monthShortName:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayFullName:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayShortName:["Su","Mo","Tu","We","Th","Fr","Sa"]}};window.dhx4.dateFormat={en:"%Y-%m-%d"};window.dhx4.date2str=function(l,g,a){if(g==null||typeof(g)=="undefnied"){g=window.dhx4.dateFormat[window.dhx4.dateLang]}if(a==null||typeof(a)=="undefnied"){a=window.dhx4.dateStrings[window.dhx4.dateLang]}if(l instanceof Date){var h=function(m){return(String(m).length==1?"0"+String(m):m)};var c=function(o){switch(o){case"%d":return h(l.getDate());case"%j":return l.getDate();case"%D":return a.dayShortName[l.getDay()];case"%l":return a.dayFullName[l.getDay()];case"%m":return h(l.getMonth()+1);case"%n":return l.getMonth()+1;case"%M":return a.monthShortName[l.getMonth()];case"%F":return a.monthFullName[l.getMonth()];case"%y":return h(l.getYear()%100);case"%Y":return l.getFullYear();case"%g":return(l.getHours()+11)%12+1;case"%h":return h((l.getHours()+11)%12+1);case"%G":return l.getHours();case"%H":return h(l.getHours());case"%i":return h(l.getMinutes());case"%s":return h(l.getSeconds());case"%a":return(l.getHours()>11?"pm":"am");case"%A":return(l.getHours()>11?"PM":"AM");case"%%":return"%";case"%u":return l.getMilliseconds();case"%P":if(window.dhx4.temp_calendar!=null&&window.dhx4.temp_calendar.tz!=null){return window.dhx4.temp_calendar.tz}var r=l.getTimezoneOffset();var q=Math.abs(Math.floor(r/60));var n=Math.abs(r)-q*60;return(r>0?"-":"+")+h(q)+":"+h(n);default:return o}};var e=String(g||window.dhx4.dateFormat).replace(/%[a-zA-Z]/g,c)}return(e||String(l))};window.dhx4.str2date=function(l,A,E){if(A==null||typeof(A)=="undefnied"){A=window.dhx4.dateFormat[window.dhx4.dateLang]}if(E==null||typeof(E)=="undefnied"){E=window.dhx4.dateStrings[window.dhx4.dateLang]}A=A.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\\:|]/g,"\\$&");var D=[];var o=[];A=A.replace(/%[a-z]/gi,function(e){switch(e){case"%d":case"%m":case"%y":case"%h":case"%H":case"%i":case"%s":o.push(e);return"(\\d{2})";case"%D":case"%l":case"%M":case"%F":o.push(e);return"([a-zéûä\u0430-\u044F\u0451]{1,})";case"%j":case"%n":case"%g":case"%G":o.push(e);return"(\\d{1,2})";case"%Y":o.push(e);return"(\\d{4})";case"%a":o.push(e);return"([a|p]m)";case"%A":o.push(e);return"([A|P]M)";case"%u":o.push(e);return"(\\d{1,6})";case"%P":o.push(e);return"([+-]\\d{1,2}:\\d{1,2})"}return e});var F=new RegExp(A,"i");var s=l.match(F);if(s==null||s.length-1!=o.length){return"Invalid Date"}for(var c=1;c<s.length;c++){D.push(s[c])}var g={"%y":1,"%Y":1,"%n":2,"%m":2,"%M":2,"%F":2,"%d":3,"%j":3,"%a":4,"%A":4,"%H":5,"%G":5,"%h":5,"%g":5,"%i":6,"%s":7,"%u":7,"%P":7};var u={};var n={};for(var c=0;c<o.length;c++){if(typeof(g[o[c]])!="undefined"){var h=g[o[c]];if(!u[h]){u[h]=[];n[h]=[]}u[h].push(D[c]);n[h].push(o[c])}}D=[];o=[];for(var c=1;c<=7;c++){if(u[c]!=null){for(var y=0;y<u[c].length;y++){D.push(u[c][y]);o.push(n[c][y])}}}var a=new Date();a.setDate(1);a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);var x=function(v,e){for(var r=0;r<e.length;r++){if(e[r].toLowerCase()==v){return r}}return -1};for(var c=0;c<D.length;c++){switch(o[c]){case"%d":case"%j":case"%n":case"%m":case"%Y":case"%H":case"%G":case"%i":case"%s":case"%u":if(!isNaN(D[c])){a[{"%d":"setDate","%j":"setDate","%n":"setMonth","%m":"setMonth","%Y":"setFullYear","%H":"setHours","%G":"setHours","%i":"setMinutes","%s":"setSeconds","%u":"setMilliseconds"}[o[c]]](Number(D[c])+(o[c]=="%m"||o[c]=="%n"?-1:0))}break;case"%M":case"%F":var m=x(D[c].toLowerCase(),E[{"%M":"monthShortName","%F":"monthFullName"}[o[c]]]);if(m>=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+(x("pm",D)>=0?(C==12?0:12):(C==12?-12:0)))}}break;case"%P":if(window.dhx4.temp_calendar!=null){window.dhx4.temp_calendar.tz=D[c]}break}}return a}}if(typeof(window.dhx4.ajax)=="undefined"){window.dhx4.ajax={cache:false,method:"get",parse:function(a){if(typeof a!=="string"){return a}a=a.replace(/^[\s]+/,"");if(window.DOMParser&&!dhx4.isIE){var c=(new window.DOMParser()).parseFromString(a,"text/xml")}else{if(window.ActiveXObject!==window.undefined){var c=new window.ActiveXObject("Microsoft.XMLDOM");c.async="false";c.loadXML(a)}}return c},xmltop:function(a,h,g){if(typeof h.status=="undefined"||h.status<400){xml=(!h.responseXML)?dhx4.ajax.parse(h.responseText||h):(h.responseXML||h);if(xml&&xml.documentElement!==null){try{if(!xml.getElementsByTagName("parsererror").length){return xml.getElementsByTagName(a)[0]}}catch(c){}}}if(g!==-1){dhx4.callEvent("onLoadXMLError",["Incorrect XML",arguments[1],g])}return document.createElement("DIV")},xpath:function(g,a){if(!a.nodeName){a=a.responseXML||a}if(dhx4.isIE){try{return a.selectNodes(g)||[]}catch(l){return[]}}else{var h=[];var m;var c=(a.ownerDocument||a).evaluate(g,a,null,XPathResult.ANY_TYPE,null);while(m=c.iterateNext()){h.push(m)}return h}},query:function(a){dhx4.ajax._call((a.method||"GET"),a.url,a.data||"",(a.async||true),a.callback,null,a.headers)},get:function(a,c){return this._call("GET",a,null,true,c)},getSync:function(a){return this._call("GET",a,null,false)},put:function(c,a,e){return this._call("PUT",c,a,true,e)},del:function(c,a,e){return this._call("DELETE",c,a,true,e)},post:function(c,a,e){if(arguments.length==1){a=""}else{if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a])=="function")){e=a;a=""}else{a=String(a)}}return this._call("POST",c,a,true,e)},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,e){if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a]))){e=a;a=""}this._call("POST",c,a,true,e,{url:c,postData:a})},_call:function(a,c,e,h,m,q,g){var o=(window.XMLHttpRequest&&!dhx4.isIE?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"));var l=(navigator.userAgent.match(/AppleWebKit/)!=null&&navigator.userAgent.match(/Qt/)!=null&&navigator.userAgent.match(/Safari/)!=null);if(h==true){o.onreadystatechange=function(){if((o.readyState==4)||(l==true&&o.readyState==3)){if(o.status!=200||o.responseText==""){if(!dhx4.callEvent("onAjaxError",[{xmlDoc:o,filePath:c,async:h}])){return}}window.setTimeout(function(){if(typeof(m)=="function"){m.apply(window,[{xmlDoc:o,filePath:c,async:h}])}if(q!=null){if(typeof(q.postData)!="undefined"){dhx4.ajax.postLong(q.url,q.postData,m)}else{dhx4.ajax.getLong(q.url,m)}}m=null;o=null},1)}}}if(a=="GET"&&this.cache!=true){c+=(c.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime()+"=1"}o.open(a,c,h);if(g!=null){for(var n in g){o.setRequestHeader(n,g[n])}}else{if(a=="POST"||a=="PUT"||a=="DELETE"){o.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}else{if(a=="GET"){e=null}}}o.setRequestHeader("X-Requested-With","XMLHttpRequest");o.send(e);return{xmlDoc:o,filePath:c,async:h}}}}if(typeof(window.dhx4._enableDataLoading)=="undefined"){window.dhx4._enableDataLoading=function(m,e,l,h,n){if(n=="clear"){for(var c in m._dhxdataload){m._dhxdataload[c]=null;delete m._dhxdataload[c]}m._loadData=null;m._dhxdataload=null;m.load=null;m.loadStruct=null;m=null;return}m._dhxdataload={initObj:e,xmlToJson:l,xmlRootTag:h,onBeforeXLS:null};m._loadData=function(u,v,w){if(arguments.length==2){w=v;v=null}var s=null;if(arguments.length==3){w=arguments[2]}if(typeof(u)=="string"){var r=u.replace(/^\s{1,}/,"").replace(/\s{1,}$/,"");var A=new RegExp("^<"+this._dhxdataload.xmlRootTag);if(A.test(r.replace(/^<\?xml[^\?]*\?>\s*/,""))){s=dhx4.ajax.parse(u);if(s!=null){s=this[this._dhxdataload.xmlToJson].apply(this,[s])}}if(s==null&&(r.match(/^[\s\S]*{[.\s\S]*}[\s\S]*$/)!=null||r.match(/^[\s\S]*\[[.\s\S]*\][\s\S]*$/)!=null)){s=dhx4.s2j(r)}if(s==null){this.callEvent("onXLS",[]);var q=[];if(typeof(this._dhxdataload.onBeforeXLS)=="function"){var r=this._dhxdataload.onBeforeXLS.apply(this,[u]);if(r!=null&&typeof(r)=="object"){if(r.url!=null){u=r.url}if(r.params!=null){for(var x in r.params){q.push(x+"="+encodeURIComponent(r.params[x]))}}}}var y=this;var o=function(a){var C=null;if((a.xmlDoc.getResponseHeader("Content-Type")||"").search(/xml/gi)>=0||(a.xmlDoc.responseText.replace(/^\s{1,}/,"")).match(/^</)!=null){C=y[y._dhxdataload.xmlToJson].apply(y,[a.xmlDoc.responseXML])}else{C=dhx4.s2j(a.xmlDoc.responseText)}if(C!=null){y[y._dhxdataload.initObj].apply(y,[C,u])}y.callEvent("onXLE",[]);if(w!=null){if(typeof(w)=="function"){w.apply(y,[])}else{if(typeof(window[w])=="function"){window[w].apply(y,[])}}}o=w=null;C=a=y=null};q=q.join("&")+(typeof(v)=="string"?"&"+v:"");if(dhx4.ajax.method=="post"){dhx4.ajax.post(u,q,o)}else{if(dhx4.ajax.method=="get"){dhx4.ajax.get(u+(q.length>0?(u.indexOf("?")>0?"&":"?")+q:""),o)}}return}}else{if(typeof(u.documentElement)=="object"||(typeof(u.tagName)!="undefined"&&typeof(u.getElementsByTagName)!="undefined"&&u.getElementsByTagName(this._dhxdataload.xmlRootTag).length>0)){s=this[this._dhxdataload.xmlToJson].apply(this,[u])}else{s=window.dhx4._copyObj(u)}}if(s!=null){this[this._dhxdataload.initObj].apply(this,[s])}if(w!=null){if(typeof(w)=="function"){w.apply(this,[])}else{if(typeof(window[w])=="function"){window[w].apply(this,[])}}w=null}};if(n!=null){var g={struct:"loadStruct",data:"load"};for(var c in n){if(n[c]==true){m[g[c]]=function(){return this._loadData.apply(this,arguments)}}}}m=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(e,h){e=String(e).toLowerCase();if(!this.dhxevs.data[e]){this.dhxevs.data[e]={}}var g=window.dhx4.newId();this.dhxevs.data[e][g]=h;return g};a.detachEvent=function(l){for(var g in this.dhxevs.data){var h=0;for(var e in this.dhxevs.data[g]){if(e==l){this.dhxevs.data[g][e]=null;delete this.dhxevs.data[g][e]}else{h++}}if(h==0){this.dhxevs.data[g]=null;delete this.dhxevs.data[g]}}};a.checkEvent=function(e){e=String(e).toLowerCase();return(this.dhxevs.data[e]!=null)};a.callEvent=function(g,l){g=String(g).toLowerCase();if(this.dhxevs.data[g]==null){return true}var h=true;for(var e in this.dhxevs.data[g]){h=this.dhxevs.data[g][e].apply(this,l)&&h}return h};a.detachAllEvents=function(){for(var g in this.dhxevs.data){for(var e in this.dhxevs.data[g]){this.dhxevs.data[g][e]=null;delete this.dhxevs.data[g][e]}this.dhxevs.data[g]=null;delete this.dhxevs.data[g]}};a=null};dhx4._eventable(dhx4)}if(!window.dhtmlxValidation){dhtmlxValidation=function(){};dhtmlxValidation.prototype={isEmpty:function(a){return a==""},isNotEmpty:function(a){return(a instanceof Array?a.length>0:!a=="")},isValidBoolean:function(a){return !!a.toString().match(/^(0|1|true|false)$/)},isValidEmail:function(a){return !!a.toString().match(/(^[a-z0-9]([0-9a-z\-_\.]*)@([0-9a-z_\-\.]*)([.][a-z]{3})$)|(^[a-z]([0-9a-z_\.\-]*)@([0-9a-z_\-\.]*)(\.[a-z]{2,4})$)/i)},isValidInteger:function(a){return !!a.toString().match(/(^-?\d+$)/)},isValidNumeric:function(a){return !!a.toString().match(/(^-?\d\d*[\.|,]\d*$)|(^-?\d\d*$)|(^-?[\.|,]\d\d*$)/)},isValidAplhaNumeric:function(a){return !!a.toString().match(/^[_\-a-z0-9]+$/gi)},isValidDatetime:function(c){var a=c.toString().match(/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/);return a&&!!(a[1]<=9999&&a[2]<=12&&a[3]<=31&&a[4]<=59&&a[5]<=59&&a[6]<=59)||false},isValidDate:function(a){var c=a.toString().match(/^(\d{4})-(\d{2})-(\d{2})$/);return c&&!!(c[1]<=9999&&c[2]<=12&&c[3]<=31)||false},isValidTime:function(c){var a=c.toString().match(/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/);return a&&!!(a[1]<=24&&a[2]<=59&&a[3]<=59)||false},isValidIPv4:function(a){var c=a.toString().match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);return c&&!!(c[1]<=255&&c[2]<=255&&c[3]<=255&&c[4]<=255)||false},isValidCurrency:function(a){return a.toString().match(/^\$?\s?\d+?([\.,\,]?\d+)?\s?\$?$/)&&true||false},isValidSSN:function(a){return a.toString().match(/^\d{3}\-?\d{2}\-?\d{4}$/)&&true||false},isValidSIN:function(a){return a.toString().match(/^\d{9}$/)&&true||false}};dhtmlxValidation=new dhtmlxValidation()}if(typeof(window.dhtmlx)=="undefined"){window.dhtmlx={extend:function(e,c){for(var g in c){if(!e[g]){e[g]=c[g]}}return e},extend_api:function(a,g,e){var c=window[a];if(!c){return}window[a]=function(m){if(m&&typeof m=="object"&&!m.tagName){var l=c.apply(this,(g._init?g._init(m):arguments));for(var h in dhtmlx){if(g[h]){this[g[h]](dhtmlx[h])}}for(var h in m){if(g[h]){this[g[h]](m[h])}else{if(h.indexOf("on")===0){this.attachEvent(h,m[h])}}}}else{var l=c.apply(this,arguments)}if(g._patch){g._patch(this)}return l||this};window[a].prototype=c.prototype;if(e){dhtmlx.extend(window[a].prototype,e)}},url:function(a){if(a.indexOf("?")!=-1){return"&"}else{return"?"}}}}function dhtmlDragAndDropObject(){if(window.dhtmlDragAndDrop){return window.dhtmlDragAndDrop}this.lastLanding=0;this.dragNode=0;this.dragStartNode=0;this.dragStartObject=0;this.tempDOMU=null;this.tempDOMM=null;this.waitDrag=0;window.dhtmlDragAndDrop=this;return this}dhtmlDragAndDropObject.prototype.removeDraggableItem=function(a){a.onmousedown=null;a.dragStarter=null;a.dragLanding=null};dhtmlDragAndDropObject.prototype.addDraggableItem=function(a,c){a.onmousedown=this.preCreateDragCopy;a.dragStarter=c;this.addDragLanding(a,c)};dhtmlDragAndDropObject.prototype.addDragLanding=function(a,c){a.dragLanding=c};dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(a){if((a||window.event)&&(a||event).button==2){return}if(window.dhtmlDragAndDrop.waitDrag){window.dhtmlDragAndDrop.waitDrag=0;document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU;document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM;return false}if(window.dhtmlDragAndDrop.dragNode){window.dhtmlDragAndDrop.stopDrag(a)}window.dhtmlDragAndDrop.waitDrag=1;window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove;window.dhtmlDragAndDrop.dragStartNode=this;window.dhtmlDragAndDrop.dragStartObject=this.dragStarter;document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;window.dhtmlDragAndDrop.downtime=new Date().valueOf();if((a)&&(a.preventDefault)){a.preventDefault();return false}return false};dhtmlDragAndDropObject.prototype.callDrag=function(g){if(!g){g=window.event}dragger=window.dhtmlDragAndDrop;if((new Date()).valueOf()-dragger.downtime<100){return}if(!dragger.dragNode){if(dragger.waitDrag){dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode,g);if(!dragger.dragNode){return dragger.stopDrag()}dragger.dragNode.onselectstart=function(){return false};dragger.gldragNode=dragger.dragNode;document.body.appendChild(dragger.dragNode);document.body.onmouseup=dragger.stopDrag;dragger.waitDrag=0;dragger.dragNode.pWindow=window;dragger.initFrameRoute()}else{return dragger.stopDrag(g,true)}}if(dragger.dragNode.parentNode!=window.document.body&&dragger.gldragNode){var a=dragger.gldragNode;if(dragger.gldragNode.old){a=dragger.gldragNode.old}a.parentNode.removeChild(a);var c=dragger.dragNode.pWindow;if(a.pWindow&&a.pWindow.dhtmlDragAndDrop.lastLanding){a.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(a.pWindow.dhtmlDragAndDrop.lastLanding)}if(_isIE){var l=document.createElement("Div");l.innerHTML=dragger.dragNode.outerHTML;dragger.dragNode=l.childNodes[0]}else{dragger.dragNode=dragger.dragNode.cloneNode(true)}dragger.dragNode.pWindow=window;dragger.gldragNode.old=dragger.dragNode;document.body.appendChild(dragger.dragNode);c.dhtmlDragAndDrop.dragNode=dragger.dragNode}dragger.dragNode.style.left=g.clientX+15+(dragger.fx?dragger.fx*(-1):0)+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";dragger.dragNode.style.top=g.clientY+3+(dragger.fy?dragger.fy*(-1):0)+(document.body.scrollTop||document.documentElement.scrollTop)+"px";if(!g.srcElement){var h=g.target}else{h=g.srcElement}dragger.checkLanding(h,g)};dhtmlDragAndDropObject.prototype.calculateFramePosition=function(h){if(window.name){var e=parent.frames[window.name].frameElement.offsetParent;var g=0;var c=0;while(e){g+=e.offsetLeft;c+=e.offsetTop;e=e.offsetParent}if((parent.dhtmlDragAndDrop)){var a=parent.dhtmlDragAndDrop.calculateFramePosition(1);g+=a.split("_")[0]*1;c+=a.split("_")[1]*1}if(h){return g+"_"+c}else{this.fx=g}this.fy=c}return"0_0"};dhtmlDragAndDropObject.prototype.checkLanding=function(c,a){if((c)&&(c.dragLanding)){if(this.lastLanding){this.lastLanding.dragLanding._dragOut(this.lastLanding)}this.lastLanding=c;this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding,this.dragStartNode,a.clientX,a.clientY,a);this.lastLanding_scr=(_isIE?a.srcElement:a.target)}else{if((c)&&(c.tagName!="BODY")){this.checkLanding(c.parentNode,a)}else{if(this.lastLanding){this.lastLanding.dragLanding._dragOut(this.lastLanding,a.clientX,a.clientY,a)}this.lastLanding=0;if(this._onNotFound){this._onNotFound()}}}};dhtmlDragAndDropObject.prototype.stopDrag=function(c,g){dragger=window.dhtmlDragAndDrop;if(!g){dragger.stopFrameRoute();var a=dragger.lastLanding;dragger.lastLanding=null;if(a){a.dragLanding._drag(dragger.dragStartNode,dragger.dragStartObject,a,(_isIE?event.srcElement:c.target))}}dragger.lastLanding=null;if((dragger.dragNode)&&(dragger.dragNode.parentNode==document.body)){dragger.dragNode.parentNode.removeChild(dragger.dragNode)}dragger.dragNode=0;dragger.gldragNode=0;dragger.fx=0;dragger.fy=0;dragger.dragStartNode=0;dragger.dragStartObject=0;document.body.onmouseup=dragger.tempDOMU;document.body.onmousemove=dragger.tempDOMM;dragger.tempDOMU=null;dragger.tempDOMM=null;dragger.waitDrag=0};dhtmlDragAndDropObject.prototype.stopFrameRoute=function(g){if(g){window.dhtmlDragAndDrop.stopDrag(1,1)}for(var a=0;a<window.frames.length;a++){try{if((window.frames[a]!=g)&&(window.frames[a].dhtmlDragAndDrop)){window.frames[a].dhtmlDragAndDrop.stopFrameRoute(window)}}catch(c){}}try{if((parent.dhtmlDragAndDrop)&&(parent!=window)&&(parent!=g)){parent.dhtmlDragAndDrop.stopFrameRoute(window)}}catch(c){}};dhtmlDragAndDropObject.prototype.initFrameRoute=function(g,h){if(g){window.dhtmlDragAndDrop.preCreateDragCopy();window.dhtmlDragAndDrop.dragStartNode=g.dhtmlDragAndDrop.dragStartNode;window.dhtmlDragAndDrop.dragStartObject=g.dhtmlDragAndDrop.dragStartObject;window.dhtmlDragAndDrop.dragNode=g.dhtmlDragAndDrop.dragNode;window.dhtmlDragAndDrop.gldragNode=g.dhtmlDragAndDrop.dragNode;window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag;window.waitDrag=0;if(((!_isIE)&&(h))&&((!_isFF)||(_FFrv<1.8))){window.dhtmlDragAndDrop.calculateFramePosition()}}try{if((parent.dhtmlDragAndDrop)&&(parent!=window)&&(parent!=g)){parent.dhtmlDragAndDrop.initFrameRoute(window)}}catch(c){}for(var a=0;a<window.frames.length;a++){try{if((window.frames[a]!=g)&&(window.frames[a].dhtmlDragAndDrop)){window.frames[a].dhtmlDragAndDrop.initFrameRoute(window,((!g||h)?1:0))}}catch(c){}}};_isFF=false;_isIE=false;_isOpera=false;_isKHTML=false;_isMacOS=false;_isChrome=false;_FFrv=false;_KHTMLrv=false;_OperaRv=false;if(navigator.userAgent.indexOf("Macintosh")!=-1){_isMacOS=true}if(navigator.userAgent.toLowerCase().indexOf("chrome")>-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])}}}}if(typeof(window.dhtmlxEvent)=="undefined"){function dhtmlxEvent(c,e,a){if(c.addEventListener){c.addEventListener(e,a,false)}else{if(c.attachEvent){c.attachEvent("on"+e,a)}}}}if(dhtmlxEvent.touchDelay==null){dhtmlxEvent.touchDelay=2000}if(typeof(dhtmlxEvent.initTouch)=="undefined"){dhtmlxEvent.initTouch=function(){var g;var h;var c,a;dhtmlxEvent(document.body,"touchstart",function(l){h=l.touches[0].target;c=l.touches[0].clientX;a=l.touches[0].clientY;g=window.setTimeout(e,dhtmlxEvent.touchDelay)});function e(){if(h){var l=document.createEvent("HTMLEvents");l.initEvent("dblclick",true,true);h.dispatchEvent(l);g=h=null}}dhtmlxEvent(document.body,"touchmove",function(l){if(g){if(Math.abs(l.touches[0].clientX-c)>50||Math.abs(l.touches[0].clientY-a)>50){window.clearTimeout(g);g=h=false}}});dhtmlxEvent(document.body,"touchend",function(l){if(g){window.clearTimeout(g);g=h=false}});dhtmlxEvent.initTouch=function(){}}}if(!window.dhtmlx){dhtmlx={}}dhtmlx.assert=function(c,a){if(!c){dhtmlx.error(a)}};dhtmlx.assert_enabled=function(){return false};dhtmlx.assert_event=function(l,e){if(!l._event_check){l._event_check={};l._event_check_size={}}for(var c in e){l._event_check[c.toLowerCase()]=e[c];var h=-1;for(var g in e[c]){h++}l._event_check_size[c.toLowerCase()]=h}};dhtmlx.assert_method_info=function(h,c,g,l){var a=[];for(var e=0;e<l.length;e++){a.push(l[e][0]+" : "+l[e][1]+"\n   "+l[e][2].describe()+(l[e][3]?"; optional":""))}return h.name+"."+c+"\n"+g+"\n Arguments:\n - "+a.join("\n - ")};dhtmlx.assert_method=function(e,a){for(var c in a){dhtmlx.assert_method_process(e,c,a[c].descr,a[c].args,(a[c].min||99),a[c].skip)}};dhtmlx.assert_method_process=function(l,c,h,m,e,g){var a=l[c];if(!g){l[c]=function(){if(arguments.length!=m.length&&arguments.length<e){dhtmlx.log("warn","Incorrect count of parameters\n"+l[c].describe()+"\n\nExpecting "+m.length+" but have only "+arguments.length)}else{for(var n=0;n<m.length;n++){if(!m[n][3]&&!m[n][2](arguments[n])){dhtmlx.log("warn","Incorrect method call\n"+l[c].describe()+"\n\nActual value of "+(n+1)+" parameter: {"+(typeof arguments[n])+"} "+arguments[n])}}}return a.apply(this,arguments)}}l[c].describe=function(){return dhtmlx.assert_method_info(l,c,h,m)}};dhtmlx.assert_event_call=function(e,c,a){if(e._event_check){if(!e._event_check[c]){dhtmlx.log("warn","Not expected event call :"+c)}else{if(dhtmlx.isNotDefined(a)){dhtmlx.log("warn","Event without parameters :"+c)}else{if(e._event_check_size[c]!=a.length){dhtmlx.log("warn","Incorrect event call, expected "+e._event_check_size[c]+" parameter(s), but have "+a.length+" parameter(s), for "+c+" event")}}}}};dhtmlx.assert_event_attach=function(c,a){if(c._event_check&&!c._event_check[a]){dhtmlx.log("warn","Unknown event name: "+a)}};dhtmlx.assert_property=function(c,a){if(!c._settings_check){c._settings_check={}}dhtmlx.extend(c._settings_check,a)};dhtmlx.assert_check=function(e,c){if(typeof e=="object"){for(var a in e){dhtmlx.assert_settings(a,e[a],c)}}};dhtmlx.assert_settings=function(n,h,g){g=g||this._settings_check;if(g){if(!g[n]){return dhtmlx.log("warn","Unknown propery: "+n)}var m="";var c="";var a=false;for(var e=0;e<g[n].length;e++){var l=g[n][e];if(typeof l=="string"){continue}if(typeof l=="function"){a=a||l(h)}else{if(typeof l=="object"&&typeof l[1]=="function"){a=a||l[1](h);if(a&&l[2]){dhtmlx.assert_check(h,l[2])}}}if(a){break}}if(!a){dhtmlx.log("warn","Invalid configuration\n"+dhtmlx.assert_info(n,g)+"\nActual value: {"+(typeof h)+"} "+h)}}};dhtmlx.assert_info=function(c,l){var a=l[c];var h="";var g=[];for(var e=0;e<a.length;e++){if(typeof rule=="string"){h=a[e]}else{if(a[e].describe){g.push(a[e].describe())}else{if(a[e][1]&&a[e][1].describe){g.push(a[e][1].describe())}}}}return"Property: "+c+", "+h+" \nExpected value: \n - "+g.join("\n - ")};if(dhtmlx.assert_enabled()){dhtmlx.assert_rule_color=function(a){if(typeof a!="string"){return false}if(a.indexOf("#")!==0){return false}if(a.substr(1).replace(/[0-9A-F]/gi,"")!==""){return false}return true};dhtmlx.assert_rule_color.describe=function(){return"{String} Value must start from # and contain hexadecimal code of color"};dhtmlx.assert_rule_template=function(a){if(typeof a=="function"){return true}if(typeof a=="string"){return true}return false};dhtmlx.assert_rule_template.describe=function(){return"{Function},{String} Value must be a function which accepts data object and return text string, or a sting with optional template markers"};dhtmlx.assert_rule_boolean=function(a){if(typeof a=="boolean"){return true}return false};dhtmlx.assert_rule_boolean.describe=function(){return"{Boolean} true or false"};dhtmlx.assert_rule_object=function(a,c){if(typeof a=="object"){return true}return false};dhtmlx.assert_rule_object.describe=function(){return"{Object} Configuration object"};dhtmlx.assert_rule_string=function(a){if(typeof a=="string"){return true}return false};dhtmlx.assert_rule_string.describe=function(){return"{String} Plain string"};dhtmlx.assert_rule_htmlpt=function(a){return !!dhtmlx.toNode(a)};dhtmlx.assert_rule_htmlpt.describe=function(){return"{Object},{String} HTML node or ID of HTML Node"};dhtmlx.assert_rule_notdocumented=function(a){return false};dhtmlx.assert_rule_notdocumented.describe=function(){return"This options wasn't documented"};dhtmlx.assert_rule_key=function(c){var a=function(e){return c[e]};a.describe=function(){var g=[];for(var e in c){g.push(e)}return"{String} can take one of next values: "+g.join(", ")};return a};dhtmlx.assert_rule_dimension=function(a){if(a*1==a&&!isNaN(a)&&a>=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(e,c){var g=function(a){if(e(a)||c(a)){return true}return false};g.describe=function(){return e.describe()};return g}}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 e in a){c[e]=a[e]}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 l=arguments;var e=l[0];var c=[];for(var h=l.length-1;h>0;h--){if(typeof l[h]=="function"){l[h]=l[h].prototype}for(var g in l[h]){if(g=="_init"){c.push(l[h][g])}else{if(!e[g]){e[g]=l[h][g]}}}}if(l[0]._init){c.push(l[0]._init)}e._init=function(){for(var m=0;m<c.length;m++){c[m].apply(this,arguments)}};e.base=l[1];var a=function(m){this._init(m);if(this._parseSettings){this._parseSettings(m,this.defaults)}};a.prototype=e;e=l=null;return a};dhtmlx.bind=function(c,a){return function(){return c.apply(a,arguments)}};dhtmlx.require=function(a){if(!dhtmlx._modules[a]){dhtmlx.assert(dhtmlx.ajax,"load module is required");dhtmlx.exec(dhtmlx.ajax().sync().get(dhtmlx.codebase+a).responseText);dhtmlx._modules[a]=true}};dhtmlx._modules={};dhtmlx.exec=function(code){if(window.execScript){window.execScript(code)}else{window.eval(code)}};dhtmlx.methodPush=function(a,e,c){return function(){var g=false;g=a[e].apply(a,arguments);return g}};dhtmlx.isNotDefined=function(c){return typeof c=="undefined"};dhtmlx.delay=function(g,c,e,a){setTimeout(function(){var h=g.apply(c,e);g=c=e=null;return h},a||1)};dhtmlx.uid=function(){if(!this._seed){this._seed=(new Date).valueOf()}this._seed++;return this._seed};dhtmlx.toNode=function(a){if(typeof a=="string"){return document.getElementById(a)}return a};dhtmlx.toArray=function(a){return dhtmlx.extend((a||[]),dhtmlx.PowerArray)};dhtmlx.toFunctor=function(str){return(typeof(str)=="string")?eval(str):str};dhtmlx._events={};dhtmlx.event=function(g,e,a,c){g=dhtmlx.toNode(g);var h=dhtmlx.uid();dhtmlx._events[h]=[g,e,a];if(c){a=dhtmlx.bind(a,c)}if(g.addEventListener){g.addEventListener(e,a,false)}else{if(g.attachEvent){g.attachEvent("on"+e,a)}}return h};dhtmlx.eventRemove=function(c){if(!c){return}dhtmlx.assert(this._events[c],"Removing non-existing event");var a=dhtmlx._events[c];if(a[0].removeEventListener){a[0].removeEventListener(a[1],a[2],false)}else{if(a[0].detachEvent){a[0].detachEvent("on"+a[1],a[2])}}delete this._events[c]};dhtmlx.log=function(c,e,a){if(window.console&&console.log){c=c.toLowerCase();if(window.console[c]){window.console[c](e||"unknown error")}else{window.console.log(c+": "+e)}if(a){window.console.log(a)}}};dhtmlx.log_full_time=function(a){dhtmlx._start_time_log=new Date();dhtmlx.log("Info","Timing start ["+a+"]");window.setTimeout(function(){var c=new Date();dhtmlx.log("Info","Timing end ["+a+"]:"+(c.valueOf()-dhtmlx._start_time_log.valueOf())/1000+"s")},1)};dhtmlx.log_time=function(a){var e="_start_time_log"+a;if(!dhtmlx[e]){dhtmlx[e]=new Date();dhtmlx.log("Info","Timing start ["+a+"]")}else{var c=new Date();dhtmlx.log("Info","Timing end ["+a+"]:"+(c.valueOf()-dhtmlx[e].valueOf())/1000+"s");dhtmlx[e]=null}};dhtmlx.error=function(c,a){dhtmlx.log("error",c,a)};dhtmlx.EventSystem={_init:function(){this._events={};this._handlers={};this._map={}},block:function(){this._events._block=true},unblock:function(){this._events._block=false},mapEvent:function(a){dhtmlx.extend(this._map,a)},callEvent:function(e,h){if(this._events._block){return true}e=e.toLowerCase();dhtmlx.assert_event_call(this,e,h);var g=this._events[e.toLowerCase()];var a=true;if(dhtmlx.debug){dhtmlx.log("info","["+this.name+"] event:"+e,h)}if(g){for(var c=0;c<g.length;c++){if(g[c].apply(this,(h||[]))===false){a=false}}}if(this._map[e]&&!this._map[e].callEvent(e,h)){a=false}return a},attachEvent:function(c,a,g){c=c.toLowerCase();dhtmlx.assert_event_attach(this,c);g=g||dhtmlx.uid();a=dhtmlx.toFunctor(a);var e=this._events[c]||dhtmlx.toArray();e.push(a);this._events[c]=e;this._handlers[g]={f:a,t:c};return g},detachEvent:function(g){if(this._handlers[g]){var c=this._handlers[g].t;var a=this._handlers[g].f;var e=this._events[c];e.remove(a);delete this._handlers[g]}}};dhtmlx.PowerArray={removeAt:function(c,a){if(c>=0){this.splice(c,(a||1))}},remove:function(a){this.removeAt(this.find(a))},insertAt:function(c,e){if(!e&&e!==0){this.push(c)}else{var a=this.splice(e,(this.length-e));this[e]=c;this.push.apply(this,a)}},find:function(a){for(i=0;i<this.length;i++){if(a==this[i]){return i}}return -1},each:function(a,e){for(var c=0;c<this.length;c++){a.call((e||this),this[c])}},map:function(a,e){for(var c=0;c<this.length;c++){this[c]=a.call((e||this),this[c])}return this}};dhtmlx.env={};if(navigator.userAgent.indexOf("Opera")!=-1){dhtmlx._isOpera=true}else{dhtmlx._isIE=!!document.all;dhtmlx._isFF=!document.all;dhtmlx._isWebKit=(navigator.userAgent.indexOf("KHTML")!=-1);if(navigator.appVersion.indexOf("MSIE 8.0")!=-1&&document.compatMode!="BackCompat"){dhtmlx._isIE=8}if(navigator.appVersion.indexOf("MSIE 9.0")!=-1&&document.compatMode!="BackCompat"){dhtmlx._isIE=9}}dhtmlx.env={};(function(){dhtmlx.env.transform=false;dhtmlx.env.transition=false;var a={};a.names=["transform","transition"];a.transform=["transform","WebkitTransform","MozTransform","oTransform","msTransform"];a.transition=["transition","WebkitTransition","MozTransition","oTransition"];var g=document.createElement("DIV");var e;for(var c=0;c<a.names.length;c++){while(p=a[a.names[c]].pop()){if(typeof g.style[p]!="undefined"){dhtmlx.env[a.names[c]]=true}}}})();dhtmlx.env.transform_prefix=(function(){var a;if(dhtmlx._isOpera){a="-o-"}else{a="";if(dhtmlx._isFF){a="-moz-"}if(dhtmlx._isWebKit){a="-webkit-"}}return a})();dhtmlx.env.svg=(function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")})();dhtmlx.zIndex={drag:10000};dhtmlx.html={create:function(c,a,e){a=a||{};var g=document.createElement(c);for(var h in a){g.setAttribute(h,a[h])}if(a.style){g.style.cssText=a.style}if(a["class"]){g.className=a["class"]}if(e){g.innerHTML=e}return g},getValue:function(a){a=dhtmlx.toNode(a);if(!a){return""}return dhtmlx.isNotDefined(a.value)?a.innerHTML:a.value},remove:function(c){if(c instanceof Array){for(var a=0;a<c.length;a++){this.remove(c[a])}}else{if(c&&c.parentNode){c.parentNode.removeChild(c)}}},insertBefore:function(c,e,a){if(!c){return}if(e){e.parentNode.insertBefore(c,e)}else{a.appendChild(c)}},locate:function(c,h){c=c||event;var a=c.target||c.srcElement;while(a){if(a.getAttribute){var g=a.getAttribute(h);if(g){return g}}a=a.parentNode}return null},offset:function(g){if(g.getBoundingClientRect){var m=g.getBoundingClientRect();var n=document.body;var c=document.documentElement;var a=window.pageYOffset||c.scrollTop||n.scrollTop;var h=window.pageXOffset||c.scrollLeft||n.scrollLeft;var l=c.clientTop||n.clientTop||0;var o=c.clientLeft||n.clientLeft||0;var q=m.top+a-l;var e=m.left+h-o;return{y:Math.round(q),x:Math.round(e)}}else{var q=0,e=0;while(g){q=q+parseInt(g.offsetTop,10);e=e+parseInt(g.offsetLeft,10);g=g.offsetParent}return{y:q,x:e}}},pos:function(a){a=a||event;if(a.pageX||a.pageY){return{x:a.pageX,y:a.pageY}}var c=((dhtmlx._isIE)&&(document.compatMode!="BackCompat"))?document.documentElement:document.body;return{x:a.clientX+c.scrollLeft-c.clientLeft,y:a.clientY+c.scrollTop-c.clientTop}},preventEvent:function(a){if(a&&a.preventDefault){a.preventDefault()}dhtmlx.html.stopEvent(a)},stopEvent:function(a){(a||event).cancelBubble=true;return false},addCss:function(c,a){c.className+=" "+a},removeCss:function(c,a){c.className=c.className.replace(RegExp(a,"g"),"")}};(function(){var a=document.getElementsByTagName("SCRIPT");dhtmlx.assert(a.length,"Can't locate codebase");if(a.length){a=(a[a.length-1].getAttribute("src")||"").split("/");a.splice(a.length-1,1);dhtmlx.codebase=a.slice(0,a.length).join("/")+"/"}})();if(!dhtmlx.ui){dhtmlx.ui={}}dhtmlx.Destruction={_init:function(){dhtmlx.destructors.push(this)},destructor:function(){this.destructor=function(){};this._htmlmap=null;this._htmlrows=null;if(this._html){document.body.appendChild(this._html)}this._html=null;if(this._obj){this._obj.innerHTML="";this._obj._htmlmap=null}this._obj=this._dataobj=null;this.data=null;this._events=this._handlers={};if(this.render){this.render=function(){}}}};dhtmlx.destructors=[];dhtmlx.event(window,"unload",function(){if(dhtmlx.destructors){for(var e=0;e<dhtmlx.destructors.length;e++){dhtmlx.destructors[e].destructor()}dhtmlx.destructors=[]}for(var c in dhtmlx._events){var g=dhtmlx._events[c];if(g[0].removeEventListener){g[0].removeEventListener(g[1],g[2],false)}else{if(g[0].detachEvent){g[0].detachEvent("on"+g[1],g[2])}}delete dhtmlx._events[c]}});dhtmlx.ajax=function(a,c,e){if(arguments.length!==0){var g=new dhtmlx.ajax();if(e){g.master=e}g.get(a,null,c)}if(!this.getXHR){return new dhtmlx.ajax()}return this};dhtmlx.ajax.prototype={getXHR:function(){if(dhtmlx._isIE){return new ActiveXObject("Microsoft.xmlHTTP")}else{return new XMLHttpRequest()}},send:function(h,o,m){var c=this.getXHR();if(typeof m=="function"){m=[m]}if(typeof o=="object"){var l=[];for(var e in o){var n=o[e];if(n===null||n===dhtmlx.undefined){n=""}l.push(e+"="+encodeURIComponent(n))}o=l.join("&")}if(o&&!this.post){h=h+(h.indexOf("?")!=-1?"&":"?")+o;o=null}c.open(this.post?"POST":"GET",h,!this._sync);if(this.post){c.setRequestHeader("Content-type","application/x-www-form-urlencoded")}var g=this;c.onreadystatechange=function(){if(!c.readyState||c.readyState==4){if(m&&g){for(var a=0;a<m.length;a++){if(m[a]){m[a].call((g.master||g),c.responseText,c.responseXML,c)}}}g.master=null;m=g=null}};c.send(o||null);return c},get:function(a,e,c){this.post=false;return this.send(a,e,c)},post:function(a,e,c){this.post=true;return this.send(a,e,c)},sync:function(){this._sync=true;return this}};dhtmlx.AtomDataLoader={_init:function(a){this.data={};if(a){this._settings.datatype=a.datatype||"json";this._after_init.push(this._load_when_ready)}},_load_when_ready:function(){this._ready_for_data=true;if(this._settings.url){this.url_setter(this._settings.url)}if(this._settings.data){this.data_setter(this._settings.data)}},url_setter:function(a){if(!this._ready_for_data){return a}this.load(a,this._settings.datatype);return a},data_setter:function(a){if(!this._ready_for_data){return a}this.parse(a,this._settings.datatype);return true},load:function(a,c){this.callEvent("onXLS",[]);if(typeof c=="string"){this.data.driver=dhtmlx.DataDriver[c];c=arguments[2]}else{this.data.driver=dhtmlx.DataDriver.xml}dhtmlx.ajax(a,[this._onLoad,c],this)},parse:function(c,a){this.callEvent("onXLS",[]);this.data.driver=dhtmlx.DataDriver[a||"xml"];this._onLoad(c,null)},_onLoad:function(h,c,a){var e=this.data.driver;var g=e.getRecords(e.toObject(h,c))[0];this.data=(e?e.getDetails(g):h);this.callEvent("onXLE",[])},_check_data_feed:function(c){if(!this._settings.dataFeed||this._ignore_feed||!c){return true}var a=this._settings.dataFeed;if(typeof a=="function"){return a.call(this,(c.id||c),c)}a=a+(a.indexOf("?")==-1?"?":"&")+"action=get&id="+encodeURIComponent(c.id||c);this.callEvent("onXLS",[]);dhtmlx.ajax(a,function(g,e){this._ignore_feed=true;this.setValues(dhtmlx.DataDriver.json.toObject(g)[0]);this._ignore_feed=false;this.callEvent("onXLE",[])},this);return false}};dhtmlx.DataDriver={};dhtmlx.DataDriver.json={toObject:function(data){if(!data){data="[]"}if(typeof data=="string"){eval("dhtmlx.temp="+data);return dhtmlx.temp}return data},getRecords:function(a){if(a&&!(a instanceof Array)){return[a]}return a},getDetails:function(a){return a},getInfo:function(a){return{_size:(a.total_count||0),_from:(a.pos||0),_key:(a.dhx_security)}}};dhtmlx.DataDriver.json_ext={toObject:function(data){if(!data){data="[]"}if(typeof data=="string"){var temp;eval("temp="+data);dhtmlx.temp=[];var header=temp.header;for(var i=0;i<temp.data.length;i++){var item={};for(var j=0;j<header.length;j++){if(typeof(temp.data[i][j])!="undefined"){item[header[j]]=temp.data[i][j]}}dhtmlx.temp.push(item)}return dhtmlx.temp}return data},getRecords:function(a){if(a&&!(a instanceof Array)){return[a]}return a},getDetails:function(a){return a},getInfo:function(a){return{_size:(a.total_count||0),_from:(a.pos||0)}}};dhtmlx.DataDriver.html={toObject:function(c){if(typeof c=="string"){var a=null;if(c.indexOf("<")==-1){a=dhtmlx.toNode(c)}if(!a){a=document.createElement("DIV");a.innerHTML=c}return a.getElementsByTagName(this.tag)}return c},getRecords:function(a){if(a.tagName){return a.childNodes}return a},getDetails:function(a){return dhtmlx.DataDriver.xml.tagToObject(a)},getInfo:function(a){return{_size:0,_from:0}},tag:"LI"};dhtmlx.DataDriver.jsarray={toObject:function(data){if(typeof data=="string"){eval("dhtmlx.temp="+data);return dhtmlx.temp}return data},getRecords:function(a){return a},getDetails:function(e){var a={};for(var c=0;c<e.length;c++){a["data"+c]=e[c]}return a},getInfo:function(a){return{_size:0,_from:0}}};dhtmlx.DataDriver.csv={toObject:function(a){return a},getRecords:function(a){return a.split(this.row)},getDetails:function(e){e=this.stringToArray(e);var a={};for(var c=0;c<e.length;c++){a["data"+c]=e[c]}return a},getInfo:function(a){return{_size:0,_from:0}},stringToArray:function(c){c=c.split(this.cell);for(var a=0;a<c.length;a++){c[a]=c[a].replace(/^[ \t\n\r]*(\"|)/g,"").replace(/(\"|)[ \t\n\r]*$/g,"")}return c},row:"\n",cell:","};dhtmlx.DataDriver.xml={toObject:function(c,a){if(a&&(a=this.checkResponse(c,a))){return a}if(typeof c=="string"){return this.fromString(c)}return c},getRecords:function(a){return this.xpath(a,this.records)},records:"/*/item",getDetails:function(a){return this.tagToObject(a,{})},getInfo:function(a){return{_size:(a.documentElement.getAttribute("total_count")||0),_from:(a.documentElement.getAttribute("pos")||0),_key:(a.documentElement.getAttribute("dhx_security"))}},xpath:function(h,q){if(window.XPathResult){var g=h;if(h.nodeName.indexOf("document")==-1){h=h.ownerDocument}var n=[];var c=h.evaluate(q,g,null,XPathResult.ANY_TYPE,null);var o=c.iterateNext();while(o){n.push(o);o=c.iterateNext()}return n}else{var m=true;try{if(typeof(h.selectNodes)=="undefined"){m=false}}catch(l){}if(m){return h.selectNodes(q)}else{var a=q.split("/").pop();return h.getElementsByTagName(a)}}},tagToObject:function(e,o){o=o||{};var h=false;var g=e.attributes;if(g&&g.length){for(var m=0;m<g.length;m++){o[g[m].name]=g[m].value}h=true}var c=e.childNodes;var n={};for(var m=0;m<c.length;m++){if(c[m].nodeType==1){var l=c[m].tagName;if(typeof o[l]!="undefined"){if(!(o[l] instanceof Array)){o[l]=[o[l]]}o[l].push(this.tagToObject(c[m],{}))}else{o[c[m].tagName]=this.tagToObject(c[m],{})}h=true}}if(!h){return this.nodeValue(e)}o.value=this.nodeValue(e);return o},nodeValue:function(a){if(a.firstChild){return a.firstChild.wholeText||a.firstChild.data}return""},fromString:function(c){if(window.DOMParser&&!dhtmlx._isIE){return(new DOMParser()).parseFromString(c,"text/xml")}if(window.ActiveXObject){var a=new ActiveXObject("Microsoft.xmlDOM");a.loadXML(c);return a}dhtmlx.error("Load from xml string is not supported")},checkResponse:function(g,e){if(e&&(e.firstChild&&e.firstChild.tagName!="parsererror")){return e}var c=this.fromString(g.replace(/^[\s]+/,""));if(c){return c}dhtmlx.error("xml can't be parsed",g)}};dhtmlx.DataLoader={_init:function(a){a=a||"";this.name="DataStore";this.data=(a.datastore)||(new dhtmlx.DataStore());this._readyHandler=this.data.attachEvent("onStoreLoad",dhtmlx.bind(this._call_onready,this))},load:function(a,c){dhtmlx.AtomDataLoader.load.apply(this,arguments);if(!this.data.feed){this.data.feed=function(g,e){if(this._load_count){return this._load_count=[g,e]}else{this._load_count=true}this.load(a+((a.indexOf("?")==-1)?"?":"&")+"posStart="+g+"&count="+e,function(){var h=this._load_count;this._load_count=false;if(typeof h=="object"){this.data.feed.apply(this,h)}})}}},_onLoad:function(e,c,a){this.data._parse(this.data.driver.toObject(e,c));this.callEvent("onXLE",[]);if(this._readyHandler){this.data.detachEvent(this._readyHandler);this._readyHandler=null}},dataFeed_setter:function(a){this.data.attachEvent("onBeforeFilter",dhtmlx.bind(function(m,l){if(this._settings.dataFeed){var h={};if(!m&&!h){return}if(typeof m=="function"){if(!l){return}m(l,h)}else{h={text:l}}this.clearAll();var c=this._settings.dataFeed;if(typeof c=="function"){return c.call(this,l,h)}var g=[];for(var e in h){g.push("dhx_filter["+e+"]="+encodeURIComponent(h[e]))}this.load(c+(c.indexOf("?")<0?"?":"&")+g.join("&"),this._settings.datatype);return false}},this));return a},_call_onready:function(){if(this._settings.ready){var a=dhtmlx.toFunctor(this._settings.ready);if(a&&a.call){a.apply(this,arguments)}}}};dhtmlx.DataStore=function(){this.name="DataStore";dhtmlx.extend(this,dhtmlx.EventSystem);this.setDriver("xml");this.pull={};this.order=dhtmlx.toArray()};dhtmlx.DataStore.prototype={setDriver:function(a){dhtmlx.assert(dhtmlx.DataDriver[a],"incorrect DataDriver");this.driver=dhtmlx.DataDriver[a]},_parse:function(h){this.callEvent("onParse",[this.driver,h]);if(this._filter_order){this.filter()}var l=this.driver.getInfo(h);if(l._key){dhtmlx.security_key=l._key}var g=this.driver.getRecords(h);var n=(l._from||0)*1;if(n===0&&this.order[0]){n=this.order.length}var c=0;for(var e=0;e<g.length;e++){var a=this.driver.getDetails(g[e]);var m=this.id(a);if(!this.pull[m]){this.order[c+n]=m;c++}this.pull[m]=a;if(this.extraParser){this.extraParser(a)}if(this._scheme){if(this._scheme.$init){this._scheme.$update(a)}else{if(this._scheme.$update){this._scheme.$update(a)}}}}for(var e=0;e<l._size;e++){if(!this.order[e]){var m=dhtmlx.uid();var a={id:m,$template:"loading"};this.pull[m]=a;this.order[e]=m}}this.callEvent("onStoreLoad",[this.driver,h]);this.refresh()},id:function(a){return a.id||(a.id=dhtmlx.uid())},changeId:function(c,a){dhtmlx.assert(this.pull[c],"Can't change id, for non existing item: "+c);this.pull[a]=this.pull[c];this.pull[a].id=a;this.order[this.order.find(c)]=a;if(this._filter_order){this._filter_order[this._filter_order.find(c)]=a}this.callEvent("onIdChange",[c,a]);if(this._render_change_id){this._render_change_id(c,a)}},get:function(a){return this.item(a)},set:function(c,a){return this.update(c,a)},item:function(a){return this.pull[a]},update:function(c,a){if(this._scheme&&this._scheme.$update){this._scheme.$update(a)}if(this.callEvent("onBeforeUpdate",[c,a])===false){return false}this.pull[c]=a;this.refresh(c)},refresh:function(a){if(this._skip_refresh){return}if(a){this.callEvent("onStoreUpdated",[a,this.pull[a],"update"])}else{this.callEvent("onStoreUpdated",[null,null,null])}},silent:function(a){this._skip_refresh=true;a.call(this);this._skip_refresh=false},getRange:function(g,e){if(g){g=this.indexById(g)}else{g=this.startOffset||0}if(e){e=this.indexById(e)}else{e=Math.min((this.endOffset||Infinity),(this.dataCount()-1));if(e<0){e=0}}if(g>e){var c=e;e=g;g=c}return this.getIndexRange(g,e)},getIndexRange:function(g,e){e=Math.min((e||Infinity),this.dataCount()-1);var a=dhtmlx.toArray();for(var c=(g||0);c<=e;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,g){if(a<0||g<0){dhtmlx.error("DataStore::move","Incorrect indexes");return}var e=this.idByIndex(a);var c=this.item(e);this.order.removeAt(a);this.order.insertAt(e,Math.min(this.order.length,g));this.callEvent("onStoreUpdated",[e,c,"move"])},scheme:function(a){this._scheme=a},sync:function(h,g,a){if(typeof g!="function"){a=g;g=null}if(dhtmlx.debug_bind){this.debug_sync_master=h;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 e=h;if(h.name!="DataStore"){h=h.data}var c=dhtmlx.bind(function(n,l,m){if(m!="update"||g){n=null}if(!n){this.order=dhtmlx.toArray([].concat(h.order));this._filter_order=null;this.pull=h.pull;if(g){this.silent(g)}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(n)}else{a=false}},this);h.attachEvent("onStoreUpdated",c);this.feed=function(m,l){e.loadNext(l,m)};c()},add:function(h,a){if(this._scheme){h=h||{};for(var c in this._scheme){h[c]=h[c]||this._scheme[c]}if(this._scheme){if(this._scheme.$init){this._scheme.$update(h)}else{if(this._scheme.$update){this._scheme.$update(h)}}}}var l=this.id(h);var g=this.dataCount();if(dhtmlx.isNotDefined(a)||a<0){a=g}if(a>g){dhtmlx.log("Warning","DataStore:add","Index of out of bounds");a=Math.min(this.order.length,a)}if(this.callEvent("onBeforeAdd",[l,h,a])===false){return false}if(this.exists(l)){return dhtmlx.error("Not unique ID")}this.pull[l]=h;this.order.insertAt(l,a);if(this._filter_order){var e=this._filter_order.length;if(!a&&this.order.length){e=0}this._filter_order.insertAt(l,e)}this.callEvent("onafterAdd",[l,a]);this.callEvent("onStoreUpdated",[l,h,"add"]);return l},remove:function(e){if(e instanceof Array){for(var a=0;a<e.length;a++){this.remove(e[a])}return}if(this.callEvent("onBeforeDelete",[e])===false){return false}if(!this.exists(e)){return dhtmlx.error("Not existing ID",e)}var c=this.item(e);this.order.remove(e);if(this._filter_order){this._filter_order.remove(e)}delete this.pull[e];this.callEvent("onafterdelete",[e]);this.callEvent("onStoreUpdated",[e,c,"delete"])},clearAll:function(){this.pull={};this.order=dhtmlx.toArray();this.feed=null;this._filter_order=null;this.callEvent("onClearAll",[]);this.refresh()},idByIndex:function(a){if(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(l,c,a){var e=l;if(typeof l=="function"){e={as:l,dir:c}}else{if(typeof l=="string"){e={by:l,dir:c,as:a}}}var h=[e.by,e.dir,e.as];if(!this.callEvent("onbeforesort",h)){return}if(this.order.length){var m=dhtmlx.sort.create(e);var g=this.getRange(this.first(),this.last());g.sort(m);this.order=g.map(function(n){return this.id(n)},this)}this.refresh();this.callEvent("onaftersort",h)},filter:function(h,g){if(!this.callEvent("onBeforeFilter",[h,g])){return}if(this._filter_order){this.order=this._filter_order;delete this._filter_order}if(!this.order.length){return}if(h){var c=h;g=g||"";if(typeof h=="string"){h=dhtmlx.Template.fromHTML(h);g=g.toString().toLowerCase();c=function(n,m){return h(n).toLowerCase().indexOf(m)!=-1}}var e=dhtmlx.toArray();for(var a=0;a<this.order.length;a++){var l=this.order[a];if(c(this.item(l),g)){e.push(l)}}this._filter_order=this.order;this.order=e}this.refresh();this.callEvent("onAfterFilter",[])},each:function(e,c){for(var a=0;a<this.order.length;a++){e.call((c||this),this.item(this.order[a]))}},provideApi:function(g,c){this.debug_bind_master=g;if(c){this.mapEvent({onbeforesort:g,onaftersort:g,onbeforeadd:g,onafteradd:g,onbeforedelete:g,onafterdelete:g,onbeforeupdate:g})}var e=["get","set","sort","add","remove","exists","idByIndex","indexById","item","update","refresh","dataCount","filter","next","previous","clearAll","first","last","serialize"];for(var a=0;a<e.length;a++){g[e[a]]=dhtmlx.methodPush(this,e[a])}if(dhtmlx.assert_enabled()){this.assert_event(g)}},serialize:function(){var e=this.order;var a=[];for(var c=0;c<e.length;c++){a.push(this.pull[e[c]])}return a}};dhtmlx.sort={create:function(a){return dhtmlx.sort.dir(a.dir,dhtmlx.sort.by(a.by,a.as))},as:{"int":function(e,c){e=e*1;c=c*1;return e>c?1:(e<c?-1:0)},string_strict:function(e,c){e=e.toString();c=c.toString();return e>c?1:(e<c?-1:0)},string:function(e,c){e=e.toString().toLowerCase();c=c.toString().toLowerCase();return e>c?1:(e<c?-1:0)}},by:function(c,a){if(!c){return a}if(typeof a!="function"){a=dhtmlx.sort.as[a||"string"]}c=dhtmlx.Template.fromHTML(c);return function(g,e){return a(c(g),c(e))}},dir:function(c,a){if(c=="asc"){return a}return function(g,e){return a(g,e)*-1}}};dhtmlx.KeyEvents={_init:function(){dhtmlx.event(this._obj,"keypress",this._onKeyPress,this)},_onKeyPress:function(c){c=c||event;var a=c.which||c.keyCode;this.callEvent((this._edit_id?"onEditKeyPress":"onKeyPress"),[a,c.ctrlKey,c.shiftKey,c])}};dhtmlx.MouseEvents={_init:function(){if(this.on_click){dhtmlx.event(this._obj,"click",this._onClick,this);dhtmlx.event(this._obj,"contextmenu",this._onContext,this)}if(this.on_dblclick){dhtmlx.event(this._obj,"dblclick",this._onDblClick,this)}if(this.on_mouse_move){dhtmlx.event(this._obj,"mousemove",this._onMouse,this);dhtmlx.event(this._obj,(dhtmlx._isIE?"mouseleave":"mouseout"),this._onMouse,this)}},_onClick:function(a){return this._mouseEvent(a,this.on_click,"ItemClick")},_onDblClick:function(a){return this._mouseEvent(a,this.on_dblclick,"ItemDblClick")},_onContext:function(a){var c=dhtmlx.html.locate(a,this._id);if(c&&!this.callEvent("onBeforeContextMenu",[c,a])){return dhtmlx.html.preventEvent(a)}},_onMouse:function(a){if(dhtmlx._isIE){a=document.createEventObject(event)}if(this._mouse_move_timer){window.clearTimeout(this._mouse_move_timer)}this.callEvent("onMouseMoving",[a]);this._mouse_move_timer=window.setTimeout(dhtmlx.bind(function(){if(a.type=="mousemove"){this._onMouseMove(a)}else{this._onMouseOut(a)}},this),500)},_onMouseMove:function(a){if(!this._mouseEvent(a,this.on_mouse_move,"MouseMove")){this.callEvent("onMouseOut",[a||event])}},_onMouseOut:function(a){this.callEvent("onMouseOut",[a||event])},_mouseEvent:function(m,l,c){m=m||event;var a=m.target||m.srcElement;var g="";var n=null;var h=false;while(a&&a.parentNode){if(!h&&a.getAttribute){n=a.getAttribute(this._id);if(n){if(a.getAttribute("userdata")){this.callEvent("onLocateData",[n,a])}if(!this.callEvent("on"+c,[n,m,a])){return}h=true}}g=a.className;if(g){g=g.split(" ");g=g[0]||g[1];if(l[g]){return l[g].call(this,m,n||dhtmlx.html.locate(m,this._id),a)}}a=a.parentNode}return h}};dhtmlx.Settings={_init:function(){this._settings=this.config={}},define:function(c,a){if(typeof c=="object"){return this._parseSeetingColl(c)}return this._define(c,a)},_define:function(c,a){dhtmlx.assert_settings.call(this,c,a);var e=this[c+"_setter"];return this._settings[c]=e?e.call(this,a):a},_parseSeetingColl:function(e){if(e){for(var c in e){this._define(c,e[c])}}},_parseSettings:function(e,a){var c=dhtmlx.extend({},a);if(typeof e=="object"&&!e.tagName){dhtmlx.extend(c,e)}this._parseSeetingColl(c)},_mergeSettings:function(a,e){for(var c in e){switch(typeof a[c]){case"object":a[c]=this._mergeSettings((a[c]||{}),e[c]);break;case"undefined":a[c]=e[c];break;default:break}}return a},_parseContainer:function(c,a,e){if(typeof c=="object"&&!c.tagName){c=c.container}this._obj=this.$view=dhtmlx.toNode(c);if(!this._obj&&e){this._obj=e(c)}dhtmlx.assert(this._obj,"Incorrect html container");this._obj.className+=" "+a;this._obj.onselectstart=function(){return false};this._dataobj=this._obj},_set_type:function(a){if(typeof a=="object"){return this.type_setter(a)}dhtmlx.assert(this.types,"RenderStack :: Types are not defined");dhtmlx.assert(this.types[a],"RenderStack :: Inccorect type name",a);this.type=dhtmlx.extend({},this.types[a]);this.customize()},customize:function(a){if(a){dhtmlx.extend(this.type,a)}this.type._item_start=dhtmlx.Template.fromHTML(this.template_item_start(this.type));this.type._item_end=this.template_item_end(this.type);this.render()},type_setter:function(a){this._set_type(typeof a=="object"?dhtmlx.Type.add(this,a):a);return a},template_setter:function(a){return this.type_setter({template:a})},css_setter:function(a){this._obj.className+=" "+a;return a}};dhtmlx.Template={_cache:{},empty:function(){return""},setter:function(a){return dhtmlx.Template.fromHTML(a)},obj_setter:function(c){var a=dhtmlx.Template.setter(c);var e=this;return function(){return a.apply(e,arguments)}},fromHTML:function(a){if(typeof a=="function"){return a}if(this._cache[a]){return this._cache[a]}a=(a||"").toString();a=a.replace(/[\r\n]+/g,"\\n");a=a.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"');a=a.replace(/\{common\.([^}\(]*)\}/g,'"+common.$1+"');a=a.replace(/\{common\.([^\}\(]*)\(\)\}/g,'"+(common.$1?common.$1(obj):"")+"');a=a.replace(/\{obj\.([^}]*)\}/g,'"+obj.$1+"');a=a.replace(/#([a-z0-9_]+)#/gi,'"+obj.$1+"');a=a.replace(/\{obj\}/g,'"+obj+"');a=a.replace(/\{-obj/g,"{obj");a=a.replace(/\{-common/g,"{common");a='return "'+a+'";';return this._cache[a]=Function("obj","common",a)}};dhtmlx.Type={add:function(e,c){if(!e.types&&e.prototype.types){e=e.prototype}if(dhtmlx.assert_enabled()){this.assert_event(c)}var a=c.name||"default";this._template(c);this._template(c,"edit");this._template(c,"loading");e.types[a]=dhtmlx.extend(dhtmlx.extend({},(e.types[a]||this._default)),c);return a},_default:{css:"default",template:function(){return""},template_edit:function(){return""},template_loading:function(){return"..."},width:150,height:80,margin:5,padding:0},_template:function(e,a){a="template"+(a?("_"+a):"");var c=e[a];if(c&&(typeof c=="string")){if(c.indexOf("->")!=-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}}e[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";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)}};if(!dhtmlx.attaches){dhtmlx.attaches={}}dhtmlx.attaches.attachAbstract=function(c,a){var h=document.createElement("DIV");h.id="CustomObject_"+dhtmlx.uid();h.style.width="100%";h.style.height="100%";h.cmp="grid";document.body.appendChild(h);this.attachObject(h.id);a.container=h.id;var g=this.vs[this.av];g.grid=new window[c](a);g.gridId=h.id;g.gridObj=h;g.grid.setSizes=function(){if(this.resize){this.resize()}else{this.render()}};var e="_viewRestore";return this.vs[this[e]()].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 dhtmlXCellObject(e,a){this.cell=document.createElement("DIV");this.cell.className="dhx_cell"+(a||"");this._idd=e;this._isCell=true;this.conf={borders:true,idx:{},css:a||"",idx_data:{cont:"dhx_cell_cont",pr1:"dhx_cell_progress_bar",pr2:"dhx_cell_progress_img",menu:"dhx_cell_menu",toolbar:"dhx_cell_toolbar",ribbon:"dhx_cell_ribbon",sb:"dhx_cell_statusbar",cover:"dhx_cell_cover"},ofs_nodes:{t:{},b:{}}};this.dataNodes={};this.views={};var c=document.createElement("DIV");c.className="dhx_cell_cont"+this.conf.css;this.cell.appendChild(c);c=null;this._updateIdx=function(){for(var g in this.conf.idx){this.conf.idx[g]=null;delete this.conf.idx[g]}for(var m=0;m<this.cell.childNodes.length;m++){var h=this.cell.childNodes[m].className;for(var g in this.conf.idx_data){var l=new RegExp(this.conf.idx_data[g]);if(h.match(l)!=null){this.conf.idx[g]=m}}}this.callEvent("_onIdxUpdated",[])};this._adjustAttached=function(){for(var g in this.dataNodes){if(this.dataNodes[g]!=null&&typeof(this.dataNodes[g].setSizes)=="function"){this.dataNodes[g].setSizes()}}if(this.dataObj!=null&&typeof(this.dataObj.setSizes)=="function"){if(this.dataType=="layout"&&typeof(window.dhtmlXLayoutCell)!="undefined"&&this instanceof window.dhtmlXLayoutCell&&this.dataObj._getMainInst()!=this.layout._getMainInst()){this.dataObj.setSizes();return}this.dataObj.setSizes.apply(this.dataObj,arguments)}};this._setSize=function(u,r,v,n,o,q,l,m){if(this.conf.size==null){this.conf.size={}}if(m==null){m={}}var A={left:"x",top:"y",width:"w",height:"h"};this.conf.size.x=u;this.conf.size.y=r;this.conf.size.w=Math.max(v,0);this.conf.size.h=Math.max(n,0);for(var s in A){var g=(m[s]||s);this.cell.style[g]=this.conf.size[A[s]]+"px"}this.callEvent("_onSetSize",[]);if(q!==true){this._adjustCont(o,l)}else{this._adjustAttached(o)}this._adjustProgress()};this._adjustCont=function(o,m){var n=this.cell.childNodes[this.conf.idx.cont];var l=0;for(var g in this.conf.ofs_nodes.t){var h=this.conf.ofs_nodes.t[g];l+=(h=="func"?this[g]():(h==true?this.cell.childNodes[this.conf.idx[g]].offsetHeight:0))}var q=0;for(var g in this.conf.ofs_nodes.b){var h=this.conf.ofs_nodes.b[g];q+=(h=="func"?this[g]():(h==true?this.cell.childNodes[this.conf.idx[g]].offsetHeight:0))}n.style.left="0px";n.style.top=l+"px";if(!this.conf.cells_cont){this.conf.cells_cont={};n.style.width=this.cell.offsetWidth+"px";n.style.height=Math.max(this.cell.offsetHeight-l-q,0)+"px";this.conf.cells_cont.w=parseInt(n.style.width)-n.offsetWidth;this.conf.cells_cont.h=parseInt(n.style.height)-n.offsetHeight}n.style.left="0px";n.style.top=l+"px";n.style.width=Math.max(this.cell.offsetWidth+this.conf.cells_cont.w,0)+"px";n.style.height=Math.max(this.conf.size.h-l-q+this.conf.cells_cont.h,0)+"px";n=null;this._adjustAttached(o);if(m=="expand"&&this.dataType=="editor"&&this.dataObj!=null){this.dataObj._prepareContent(true)}};this._mtbUpdBorder=function(){var h=["menu","toolbar","ribbon"];for(var m=0;m<h.length;m++){if(this.conf.idx[h[m]]!=null){var n=this.cell.childNodes[this.conf.idx[h[m]]];var l="dhx_cell_"+h[m]+"_no_borders";var g="dhx_cell_"+h[m]+"_def";n.className=n.className.replace(new RegExp(this.conf.borders?l:g),this.conf.borders?g:l);n=null}}};this._resetSizeState=function(){this.conf.cells_cont=null};this.conf.view="def";this.conf.views_loaded={};this.conf.views_loaded[this.conf.view]=true;this._viewSave=function(l){this.views[l]={borders:this.conf.borders,ofs_nodes:{t:{},b:{}},url_data:this.conf.url_data,dataType:this.dataType,dataObj:this.dataObj,cellCont:[],dataNodes:{},dataNodesCont:{}};var m=this.cell.childNodes[this.conf.idx.cont];while(m.childNodes.length>0){this.views[l].cellCont.push(m.firstChild);m.removeChild(m.firstChild)}m=null;this.dataType=null;this.dataObj=null;this.conf.url_data=null;for(var h in this.dataNodes){for(var g in this.conf.ofs_nodes){if(typeof(this.conf.ofs_nodes[g][h])!="undefined"){this.views[l].ofs_nodes[g][h]=this.conf.ofs_nodes[g][h];this.conf.ofs_nodes[g][h]=null;delete this.conf.ofs_nodes[g][h]}}this.views[l].dataNodesCont[h]=this.cell.childNodes[this.conf.idx[h]];this.cell.removeChild(this.cell.childNodes[this.conf.idx[h]]);this.views[l].dataNodes[h]=this.dataNodes[h];this.dataNodes[h]=null;delete this.dataNodes[h];this._updateIdx()}this.callEvent("_onViewSave",[l])};this._viewRestore=function(l){if(this.views[l]==null){return}this.dataObj=this.views[l].dataObj;this.dataType=this.views[l].dataType;this.conf.url_data=this.views[l].url_data;for(var m=0;m<this.views[l].cellCont.length;m++){this.cell.childNodes[this.conf.idx.cont].appendChild(this.views[l].cellCont[m])}for(var h in this.views[l].dataNodes){this.dataNodes[h]=this.views[l].dataNodes[h];if(h=="menu"){this.cell.insertBefore(this.views[l].dataNodesCont[h],this.cell.childNodes[this.conf.idx.toolbar||this.conf.idx.cont])}if(h=="toolbar"){this.cell.insertBefore(this.views[l].dataNodesCont[h],this.cell.childNodes[this.conf.idx.cont])}if(h=="sb"){this.cell.appendChild(this.views[l].dataNodesCont[h])}this._updateIdx()}for(var h in this.views[l].ofs_nodes){for(var g in this.views[l].ofs_nodes[h]){this.conf.ofs_nodes[h][g]=this.views[l].ofs_nodes[h][g]}}if(this.conf.borders!=this.views[l].borders){this[this.views[l].borders?"_showBorders":"_hideBorders"](true)}if(this.dataType=="url"&&this.conf.url_data!=null&&this.conf.url_data.ajax==false&&this.conf.url_data.post_data!=null){this.reloadURL()}this.callEvent("_onViewRestore",[l]);this._viewDelete(l)};this._viewDelete=function(l){if(this.views[l]==null){return}this.views[l].borders=null;for(var h in this.views[l].ofs_nodes){for(var g in this.views[l].ofs_nodes[h]){this.views[l].ofs_nodes[h][g]=null}this.views[l].ofs_nodes[h]=null}this.views[l].dataType=null;this.views[l].dataObj=null;this.views[l].url_data=null;for(var m=0;m<this.views[l].cellCont.length;m++){this.views[l].cellCont[m]=null}this.views[l].cellCont=null;for(var h in this.views[l].dataNodes){this.views[l].dataNodes[h]=null;this.views[l].dataNodesCont[h]=null}this.views[l].dataNodes=this.views[l].dataNodesCont=null;this.views[l]=null;delete this.views[l]};window.dhx4._eventable(this);this._updateIdx();return this}dhtmlXCellObject.prototype.showView=function(a){if(this.conf.view==a){return false}this._viewSave(this.conf.view);this._viewRestore(a);this._updateIdx();this._adjustCont();this.conf.view=a;var c=(typeof(this.conf.views_loaded[this.conf.view])=="undefined");this.conf.views_loaded[this.conf.view]=true;return c};dhtmlXCellObject.prototype.getViewName=function(){return this.conf.view};dhtmlXCellObject.prototype.unloadView=function(g){if(g==this.conf.view){var h=this.conf.unloading;this.conf.unloading=true;if(typeof(this.detachMenu)=="function"){this.detachMenu()}if(typeof(this.detachToolbar)=="function"){this.detachToolbar()}if(typeof(this.detachRibbon)=="function"){this.detachRibbon()}this.detachStatusBar();this._detachObject(null,true);this.conf.unloading=h;if(!this.conf.unloading){this._adjustCont(this._idd)}return}if(this.views[g]==null){return}var e=this.views[g];for(var c in e.dataNodes){if(typeof(e.dataNodes[c].unload)=="function"){e.dataNodes[c].unload()}e.dataNodes[c]=null;e.dataNodesCont[c]=null}if(e.dataType=="url"){if(e.cellCont!=null&&e.cellCont[0]!="null"){this._detachURLEvents(e.cellCont[0])}}else{if(e.dataObj!=null){if(typeof(e.dataObj.unload)=="function"){e.dataObj.unload()}else{if(typeof(e.dataObj.destructor)=="function"){e.dataObj.destructor()}}e.dataObj=null}}e=null;this._viewDelete(g);if(typeof(this.conf.views_loaded[g])!="undefined"){delete this.conf.views_loaded[g]}};dhtmlXCellObject.prototype.getId=function(){return this._idd};dhtmlXCellObject.prototype.progressOn=function(){if(this.conf.progress==true){return}this.conf.progress=true;var c=document.createElement("DIV");c.className=this.conf.idx_data.pr1;var a=document.createElement("DIV");a.className=this.conf.idx_data.pr2;if(this.conf.idx.cover!=null){this.cell.insertBefore(a,this.cell.childNodes[this.conf.idx.cover])}else{this.cell.appendChild(a)}this.cell.insertBefore(c,a);c=a=null;this._updateIdx();this._adjustProgress()};dhtmlXCellObject.prototype.progressOff=function(){if(this.conf.progress!=true){return}this.cell.childNodes[this.conf.idx.pr2].parentNode.removeChild(this.cell.childNodes[this.conf.idx.pr2]);this.cell.childNodes[this.conf.idx.pr1].parentNode.removeChild(this.cell.childNodes[this.conf.idx.pr1]);this.conf.progress=false;this._updateIdx()};dhtmlXCellObject.prototype._adjustProgress=function(){if(this.conf.idx.pr1==null){return}if(!this.conf.pr){this.conf.pr={}}var c=this.cell.childNodes[this.conf.idx.pr1];var a=this.cell.childNodes[this.conf.idx.pr2];if(!this.conf.pr.ofs){a.style.width=c.offsetWidth+"px";a.style.height=c.offsetHeight+"px";this.conf.pr.ofs={w:a.offsetWidth-a.clientWidth,h:a.offsetHeight-a.clientHeight}}a.style.width=c.offsetWidth-this.conf.pr.ofs.w+"px";a.style.height=c.offsetHeight-this.conf.pr.ofs.h+"px";c=a=null};dhtmlXCellObject.prototype._showCellCover=function(){if(this.conf.cover==true){return}this.conf.cover=true;var a=document.createElement("DIV");a.className=this.conf.idx_data.cover;this.cell.appendChild(a);a=null;this._updateIdx()};dhtmlXCellObject.prototype._hideCellCover=function(){if(this.conf.cover!=true){return}this.cell.removeChild(this.cell.childNodes[this.conf.idx.cover]);this._updateIdx();this.conf.cover=false};dhtmlXCellObject.prototype._showBorders=function(a){if(this.conf.borders){return}this.conf.borders=true;this.cell.childNodes[this.conf.idx.cont].className="dhx_cell_cont"+this.conf.css;this.conf.cells_cont=null;this._mtbUpdBorder();this.callEvent("_onBorderChange",[true]);if(a!==true){this._adjustCont(this._idd)}};dhtmlXCellObject.prototype._hideBorders=function(a){if(!this.conf.borders){return}this.conf.borders=false;this.cell.childNodes[this.conf.idx.cont].className="dhx_cell_cont"+this.conf.css+" dhx_cell_cont_no_borders";this.conf.cells_cont=null;this._mtbUpdBorder();this.callEvent("_onBorderChange",[false]);if(a!==true){this._adjustCont(this._idd)}};dhtmlXCellObject.prototype._getWidth=function(){return this.cell.offsetWidth};dhtmlXCellObject.prototype._getHeight=function(){return this.cell.offsetHeight};dhtmlXCellObject.prototype.showInnerScroll=function(){this.cell.childNodes[this.conf.idx.cont].style.overflow="auto"};dhtmlXCellObject.prototype._unload=function(){this.conf.unloading=true;this.callEvent("_onCellUnload",[]);this.progressOff();this.unloadView(this.conf.view);this.dataNodes=null;this.cell.parentNode.removeChild(this.cell);this.cell=null;window.dhx4._eventable(this,"clear");for(var c in this.views){this.unloadView(c)}this.conf=null;for(var c in this){this[c]=null}};dhtmlXCellObject.prototype.attachObject=function(g,e){if(window.dhx4.s2b(e)&&!(typeof(window.dhtmlXWindowsCell)!="undefined"&&(this instanceof window.dhtmlXWindowsCell))){e=false}if(typeof(g)=="string"){g=document.getElementById(g)}if(g.parentNode==this.cell.childNodes[this.conf.idx.cont]){g=null;return}if(e){g.style.display="";var a=g.offsetWidth;var c=g.offsetHeight}this._attachObject(g);this.dataType="obj";g.style.display="";g=null;if(e){this._adjustByCont(a,c)}};dhtmlXCellObject.prototype.appendObject=function(a){if(typeof(a)=="string"){a=document.getElementById(a)}if(a.parentNode==this.cell.childNodes[this.conf.idx.cont]){a=null;return}if(!this.conf.append_mode){this.cell.childNodes[this.conf.idx.cont].style.overflow="auto";this.conf.append_mode=true}this._attachObject(a,null,null,true);this.dataType="obj";a.style.display="";a=null};dhtmlXCellObject.prototype.detachObject=function(c,a){this._detachObject(null,c,a)};dhtmlXCellObject.prototype.getAttachedStatusBar=function(){return this.dataNodes.sb};dhtmlXCellObject.prototype.getAttachedObject=function(){if(this.dataType=="obj"||this.dataType=="url"||this.dataType=="url-ajax"){return this.cell.childNodes[this.conf.idx.cont].firstChild}else{return this.dataObj}};dhtmlXCellObject.prototype.attachURL=function(c,q,e){if(e==true){e={}}var g=(typeof(e)!="undefined"&&e!=false&&e!=null);if(!this.conf.url_data){this.conf.url_data={}}this.conf.url_data.url=c;this.conf.url_data.ajax=(q==true);this.conf.url_data.post_data=(e==true?{}:(e||null));if(q==true){var o=this;if(g){var h="";for(var n in e){h+="&"+encodeURIComponent(n)+"="+encodeURIComponent(e[n])}dhx4.ajax.post(c,h,function(a){o.attachHTMLString("<div style='position:relative;width:100%;height:100%;overflow:auto;'>"+a.xmlDoc.responseText+"</div>");if(typeof(o._doOnFrameContentLoaded)=="function"){o._doOnFrameContentLoaded()}o.dataType="url-ajax";o=a=null})}else{dhx4.ajax.get(c,function(a){o.attachHTMLString("<div style='position:relative;width:100%;height:100%;overflow:auto;'>"+a.xmlDoc.responseText+"</div>");if(typeof(o._doOnFrameContentLoaded)=="function"){o._doOnFrameContentLoaded()}o.dataType="url-ajax";o=a=null})}}else{if(this.dataType=="url"){var l=this.getFrame()}else{var l=document.createElement("IFRAME");l.frameBorder=0;l.border=0;l.style.width="100%";l.style.height="100%";l.style.position="relative";this._attachObject(l);this.dataType="url";this._attachURLEvents()}if(g){var m=(typeof(this.conf.url_data.post_ifr)=="undefined");this.conf.url_data.post_ifr=true;if(m){this._attachURLEvents()}l.src="about:blank"}else{l.src=c+(window.dhx4.ajax.cache!=true?(c.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime():"")}l=null}l=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(/<script[^>]*>[^\f]*?<\/script>/g)||[];for(var i=0;i<z.length;i++){var s=z[i].replace(/<([\/]{0,1})script[^>]*>/gi,"");if(s){if(window.execScript){window.execScript(s)}else{window.eval(s)}}}};dhtmlXCellObject.prototype.attachScheduler=function(a,m,c,g){g=g||window.scheduler;var h=false;if(c){var l=document.getElementById(c);if(l){h=true}}if(!h){var e=c||'<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div><div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div><div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>';var l=document.createElement("DIV");l.id="dhxSchedObj_"+new Date().getTime();l.style.width="100%";l.style.height="100%";l.style.position="relative";l.style.overflow="hidden";l.className="dhx_cal_container";l.innerHTML='<div class="dhx_cal_navline"><div class="dhx_cal_prev_button">&nbsp;</div><div class="dhx_cal_next_button">&nbsp;</div><div class="dhx_cal_today_button"></div><div class="dhx_cal_date"></div>'+e+'</div><div class="dhx_cal_header"></div><div class="dhx_cal_data"></div>'}this._attachObject(l);this.dataType="scheduler";this.dataObj=g;this.dataObj.setSizes=function(){this.update_view()};g.init(l.id,a,m);l=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype.attachMap=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(!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._createNode_sb=function(n,g,m,a,l){if(typeof(l)!="undefined"){n=l}else{var c=g||{};var o=(typeof(c.text)=="string"&&c.text.length>0?c.text:"&nbsp;");var e=(typeof(c.height)=="number"?c.height:false);var n=document.createElement("DIV");n.className="dhx_cell_statusbar_def";n.innerHTML="<div class='"+(c.paging==true?"dhx_cell_statusbar_paging":"dhx_cell_statusbar_text")+"'>"+o+"</div>";if(e!=false){n.firstChild.style.height=n.firstChild.style.lineHeight=e+"px"}}if(this.conf.idx.pr1!=null){this.cell.insertBefore(n,this.cell.childNodes[this.conf.idx.pr1])}else{this.cell.appendChild(n)}this.conf.ofs_nodes.b.sb=true;this._updateIdx();this._adjustCont(this._idd);return n};dhtmlXCellObject.prototype.attachStatusBar=function(a){if(this.dataNodes.sb){return}if(a!=null&&window.dhx4.s2b(a.paging)==true){a.height=null}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._attachURLEvents=function(){if(this.dataType!="url"){return}var e=this;var c=this._idd;var a=this.cell.childNodes[this.conf.idx.cont].firstChild;if(typeof(this._doOnFrameMouseDown)!="function"){this._doOnFrameMouseDown=function(g){e.callEvent("_onContentMouseDown",[c,g||event])}}if(typeof(window.addEventListener)=="function"){a.onload=function(){try{if(typeof(e._doOnFrameMouseDown)=="function"){this.contentWindow.document.body.addEventListener("mousedown",e._doOnFrameMouseDown,false)}}catch(g){}try{if(typeof(e._doOnFrameContentLoaded)=="function"){e._doOnFrameContentLoaded()}}catch(g){}}}else{a.onreadystatechange=function(g){if(this.readyState=="complete"){try{if(typeof(e._doOnFrameMouseDown)=="function"){this.contentWindow.document.body.attachEvent("onmousedown",e._doOnFrameMouseDown)}}catch(h){}try{if(typeof(e._doOnFrameContentLoaded)=="function"){e._doOnFrameContentLoaded()}}catch(h){}}}}};dhtmlXCellObject.prototype._doOnFrameContentLoaded=function(){if(this.conf.url_data.post_ifr==true){var l=this.getFrame().contentWindow.document;var h=l.createElement("FORM");h.method="POST";h.action=this.conf.url_data.url;l.body.appendChild(h);var e={};if(window.dhx4.ajax.cache!=true){e["dhxr"+new Date().getTime()]="1"}for(var c in this.conf.url_data.post_data){e[c]=this.conf.url_data.post_data[c]}for(var c in e){var g=l.createElement("INPUT");g.type="hidden";g.name=c;g.value=e[c];h.appendChild(g);g=null}this.conf.url_data.post_ifr=false;h.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(h,c,g,a,e){if(typeof(h)=="string"&&{menu:1,toolbar:1,ribbon:1,sb:1}[h]==1){return this["_createNode_"+h].apply(this,arguments)}if(a!=true){this._detachObject(null,true,null)}if(typeof(g)=="string"){this.cell.childNodes[this.conf.idx.cont].innerHTML=g}else{this.cell.childNodes[this.conf.idx.cont].appendChild(h)}h=null};dhtmlXCellObject.prototype._detachObject=function(h,c,a){this.callEvent("_onBeforeContentDetach",[]);if(h=="menu"||h=="toolbar"||h=="ribbon"||h=="sb"){var g=this.cell.childNodes[this.conf.idx[h]];g.parentNode.removeChild(g);g=null;this.conf.ofs_nodes[h=="sb"?"b":"t"][h]=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 g=this.cell.childNodes[this.conf.idx.cont];while(g.childNodes.length>0){if(a===false){g.removeChild(g.lastChild)}else{g.firstChild.style.display="none";a.appendChild(g.firstChild)}}if(this.conf.append_mode){g.style.overflow="";this.conf.append_mode=false}var e=(this.dataType=="tabbar");this.dataObj=null;this.dataType=null;a=g=null;if(this.conf.unloading!=true&&e){this.showHeader(true);this._showBorders()}};dhtmlXCellObject.prototype._attachFromCell=function(c){this.detachObject(true);var g="layout";if(typeof(window.dhtmlXWindowsCell)!="undefined"&&this instanceof window.dhtmlXWindowsCell){g="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 e in c.dataNodes){this._attachObject(e,null,null,null,c.cell.childNodes[c.conf.idx[e]]);this.dataNodes[e]=c.dataNodes[e];c.dataNodes[e]=null;c.conf.ofs_nodes[e=="sb"?"b":"t"][e]=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(g=="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 e in c.views){this.views[e]=c.views[e];c.views[e]=null;delete c.views[e]}c._updateIdx();c._adjustCont();this._updateIdx();this._adjustCont();if(c.conf.progress==true){c.progressOff();this.progressOn()}else{this.progressOff()}if(g=="window"&&this.wins.w[this._idd].conf.parked){this.wins._winCellSetOpacity(this._idd,"close",false)}};function dhtmlXCellTop(h,c){if(arguments.length==0||typeof(h)=="undefined"){return}var a=this;this.dataNodes={};this.conf.ofs={t:0,b:0,l:0,r:0};this.conf.ofs_nodes={t:{},b:{}};this.conf.progress=false;this.conf.fs_mode=false;this.conf.fs_tm=null;this.conf.fs_resize=false;if(h==document.body){this.conf.fs_mode=true;this.base=h;if(this.base==document.body){var g={dhx_skyblue:{t:2,b:2,l:2,r:2},dhx_web:{t:8,b:8,l:8,r:8},dhx_terrace:{t:9,b:9,l:8,r:8}};this.conf.ofs=(g[this.conf.skin]!=null?g[this.conf.skin]:g.dhx_skyblue)}}else{this.base=(typeof(h)=="string"?document.getElementById(h):h)}this.base.className+=" "+this.conf.css+"_base_"+this.conf.skin;this.cont=document.createElement("DIV");this.cont.className=this.conf.css+"_cont";this.base.appendChild(this.cont);if(c!=null){this.setOffsets(c,false)}else{if(this.base._ofs!=null){this.setOffsets(this.base._ofs,false);this.base._ofs=null;try{delete this.base._ofs}catch(l){}}}this._adjustCont=function(){var n=this.conf.ofs.t;for(var m in this.conf.ofs_nodes.t){n+=(this.conf.ofs_nodes.t[m]==true?this.dataNodes[m].offsetHeight:0)}var e=this.conf.ofs.b;for(var m in this.conf.ofs_nodes.b){e+=(this.conf.ofs_nodes.b[m]==true?this.dataNodes[m].offsetHeight:0)}this.cont.style.left=this.conf.ofs.l+"px";this.cont.style.width=this.base.clientWidth-this.conf.ofs.l-this.conf.ofs.r+"px";this.cont.style.top=n+"px";this.cont.style.height=this.base.clientHeight-n-e+"px"};this._setBaseSkin=function(e){this.base.className=this.base.className.replace(new RegExp(this.conf.css+"_base_"+this.conf.skin,"gi"),this.conf.css+"_base_"+e)};this._initFSResize=function(){if(this.conf.fs_resize==true){return}this._doOnResizeStart=function(){window.clearTimeout(a.conf.fs_tm);a.conf.fs_tm=window.setTimeout(a._doOnResizeEnd,200)};this._doOnResizeEnd=function(){a.setSizes()};if(typeof(window.addEventListener)=="function"){window.addEventListener("resize",this._doOnResizeStart,false)}else{window.attachEvent("onresize",this._doOnResizeStart)}this.conf.fs_resize=true};if(this.conf.fs_mode==true){this._initFSResize()}this._unloadTop=function(){this._mtbUnload();this.detachHeader();this.detachFooter();if(this.conf.fs_mode==true){if(typeof(window.addEventListener)=="function"){window.removeEventListener("resize",this._doOnResizeStart,false)}else{window.detachEvent("onresize",this._doOnResizeStart)}}this.base.removeChild(this.cont);var e=new RegExp("s{0,}"+this.conf.css+"_base_"+this.conf.skin,"gi");this.base.className=this.base.className.replace(e,"");this.cont=this.base=null;a=null};h=null}dhtmlXCellTop.prototype.setOffsets=function(l,h){var g=false;for(var c in l){var e=c.charAt(0);if(typeof(this.conf.ofs[e])!="undefined"&&!isNaN(l[c])){this.conf.ofs[e]=parseInt(l[c]);g=true}}if(h!==false&&typeof(this.setSizes)=="function"&&g==true){this.setSizes()}};dhtmlXCellTop.prototype.attachMenu=function(a){if(this.dataNodes.menu!=null){return}this.dataNodes.menuObj=document.createElement("DIV");this.dataNodes.menuObj.className="dhxcelltop_menu";this.base.insertBefore(this.dataNodes.menuObj,this.dataNodes.toolbarObj||this.dataNodes.ribbonObj||this.cont);if(typeof(a)!="object"||a==null){a={}}a.skin=this.conf.skin;a.parent=this.dataNodes.menuObj;this.dataNodes.menu=new dhtmlXMenuObject(a);this.dataNodes.menuEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.menuObj.style.display=="none"){return}this.dataNodes.menuObj.style.left=this.conf.ofs.l+"px";this.dataNodes.menuObj.style.marginTop=(this.dataNodes.haObj!=null?0:this.conf.ofs.t)+"px";this.dataNodes.menuObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.conf.ofs_nodes.t.menuObj=true;this.setSizes();a.parnt=null;a=null;return this.dataNodes.menu};dhtmlXCellTop.prototype.detachMenu=function(){if(this.dataNodes.menu==null){return}this.dataNodes.menu.unload();this.dataNodes.menu=null;this.dataNodes.menuObj.parentNode.removeChild(this.dataNodes.menuObj);this.dataNodes.menuObj=null;this.detachEvent(this.dataNodes.menuEv);this.dataNodes.menuEv=null;delete this.dataNodes.menu;delete this.dataNodes.menuObj;delete this.dataNodes.menuEv;this.conf.ofs_nodes.t.menuObj=false;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachToolbar=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}this.dataNodes.toolbarObj=document.createElement("DIV");this.dataNodes.toolbarObj.className="dhxcelltop_toolbar";this.base.insertBefore(this.dataNodes.toolbarObj,this.cont);this.dataNodes.toolbarObj.appendChild(document.createElement("DIV"));if(typeof(a)!="object"||a==null){a={}}a.skin=this.conf.skin;a.parent=this.dataNodes.toolbarObj.firstChild;this.dataNodes.toolbar=new dhtmlXToolbarObject(a);this.dataNodes.toolbarEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.toolbarObj.style.display=="none"){return}this.dataNodes.toolbarObj.style.left=this.conf.ofs.l+"px";this.dataNodes.toolbarObj.style.marginTop=(this.dataNodes.haObj!=null||this.dataNodes.menuObj!=null?0:this.conf.ofs.t)+"px";this.dataNodes.toolbarObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.dataNodes.toolbar._masterCell=this;this.dataNodes.toolbar.attachEvent("_onIconSizeChange",function(){this._masterCell.setSizes()});this.conf.ofs_nodes.t.toolbarObj=true;this.setSizes();a.parnt=null;a=null;return this.dataNodes.toolbar};dhtmlXCellTop.prototype.detachToolbar=function(){if(this.dataNodes.toolbar==null){return}this.dataNodes.toolbar._masterCell=null;this.dataNodes.toolbar.unload();this.dataNodes.toolbar=null;this.dataNodes.toolbarObj.parentNode.removeChild(this.dataNodes.toolbarObj);this.dataNodes.toolbarObj=null;this.detachEvent(this.dataNodes.toolbarEv);this.dataNodes.toolbarEv=null;this.conf.ofs_nodes.t.toolbarObj=false;delete this.dataNodes.toolbar;delete this.dataNodes.toolbarObj;delete this.dataNodes.toolbarEv;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachRibbon=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}this.dataNodes.ribbonObj=document.createElement("DIV");this.dataNodes.ribbonObj.className="dhxcelltop_ribbon";this.base.insertBefore(this.dataNodes.ribbonObj,this.cont);this.dataNodes.ribbonObj.appendChild(document.createElement("DIV"));if(typeof(a)!="object"||a==null){a={}}a.skin=this.conf.skin;a.parent=this.dataNodes.ribbonObj.firstChild;this.dataNodes.ribbon=new dhtmlXRibbon(a);this.dataNodes.ribbonEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.ribbonObj.style.display=="none"){return}this.dataNodes.ribbonObj.style.left=this.conf.ofs.l+"px";this.dataNodes.ribbonObj.style.marginTop=(this.dataNodes.haObj!=null||this.dataNodes.menuObj!=null?0:this.conf.ofs.t)+"px";this.dataNodes.ribbonObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px";this.dataNodes.ribbon.setSizes()});this.conf.ofs_nodes.t.ribbonObj=true;var c=this;this.dataNodes.ribbon.attachEvent("_onHeightChanged",function(){c.setSizes()});this.setSizes();a.parnt=null;a=null;return this.dataNodes.ribbon};dhtmlXCellTop.prototype.detachRibbon=function(){if(this.dataNodes.ribbon==null){return}this.dataNodes.ribbon.unload();this.dataNodes.ribbon=null;this.dataNodes.ribbonObj.parentNode.removeChild(this.dataNodes.ribbonObj);this.dataNodes.ribbonObj=null;this.detachEvent(this.dataNodes.ribbonEv);this.dataNodes.ribbonEv=null;this.conf.ofs_nodes.t.ribbonObj=false;delete this.dataNodes.ribbon;delete this.dataNodes.ribbonObj;delete this.dataNodes.ribbonEv;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachStatusBar=function(a){if(this.dataNodes.sbObj){return}if(typeof(a)=="undefined"){a={}}this.dataNodes.sbObj=document.createElement("DIV");this.dataNodes.sbObj.className="dhxcelltop_statusbar";if(this.cont.nextSibling!=null){this.base.insertBefore(this.dataNodes.sbObj,this.cont.nextSibling)}else{this.base.appendChild(this.dataNodes.sbObj)}this.dataNodes.sbObj.innerHTML="<div class='dhxcont_statusbar'>"+(typeof(a.text)=="string"&&a.text.length>0?a.text:"&nbsp;")+"</div>";if(typeof(a.height)=="number"){this.dataNodes.sbObj.firstChild.style.height=this.dataNodes.sbObj.firstChild.style.lineHeight=a.height+"px"}this.dataNodes.sbObj.setText=function(c){this.childNodes[0].innerHTML=c};this.dataNodes.sbObj.getText=function(){return this.childNodes[0].innerHTML};this.dataNodes.sbObj.onselectstart=function(c){return false};this.dataNodes.sbEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.sbObj.style.display=="none"){return}this.dataNodes.sbObj.style.left=this.conf.ofs.l+"px";this.dataNodes.sbObj.style.bottom=(this.dataNodes.faObj!=null?this.dataNodes.faObj.offsetHeight:0)+this.conf.ofs.t+"px";this.dataNodes.sbObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.conf.ofs_nodes.b.sbObj=true;this.setSizes();return this.dataNodes.sbObj};dhtmlXCellTop.prototype.detachStatusBar=function(){if(!this.dataNodes.sbObj){return}this.dataNodes.sbObj.setText=this.dataNodes.sbObj.getText=this.dataNodes.sbObj.onselectstart=null;this.dataNodes.sbObj.parentNode.removeChild(this.dataNodes.sbObj);this.dataNodes.sbObj=null;this.detachEvent(this.dataNodes.sbEv);this.dataNodes.sbEv=null;this.conf.ofs_nodes.b.sbObj=false;delete this.dataNodes.sb;delete this.dataNodes.sbObj;delete this.dataNodes.sbEv;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.showMenu=function(){this._mtbShowHide("menuObj","")};dhtmlXCellTop.prototype.hideMenu=function(){this._mtbShowHide("menuObj","none")};dhtmlXCellTop.prototype.showToolbar=function(){this._mtbShowHide("toolbarObj","")};dhtmlXCellTop.prototype.hideToolbar=function(){this._mtbShowHide("toolbarObj","none")};dhtmlXCellTop.prototype.showRibbon=function(){this._mtbShowHide("ribbonObj","")};dhtmlXCellTop.prototype.hideRibbon=function(){this._mtbShowHide("ribbonObj","none")};dhtmlXCellTop.prototype.showStatusBar=function(){this._mtbShowHide("sbObj","")};dhtmlXCellTop.prototype.hideStatusBar=function(){this._mtbShowHide("sbObj","none")};dhtmlXCellTop.prototype._mtbShowHide=function(c,a){if(this.dataNodes[c]==null){return}this.dataNodes[c].style.display=a;this.setSizes()};dhtmlXCellTop.prototype._mtbUnload=function(c,a){this.detachMenu();this.detachToolbar();this.detachStatusBar();this.detachRibbon()};dhtmlXCellTop.prototype.getAttachedMenu=function(){return this.dataNodes.menu};dhtmlXCellTop.prototype.getAttachedToolbar=function(){return this.dataNodes.toolbar};dhtmlXCellTop.prototype.getAttachedRibbon=function(){return this.dataNodes.ribbon};dhtmlXCellTop.prototype.getAttachedStatusBar=function(){return this.dataNodes.sbObj};dhtmlXCellTop.prototype.progressOn=function(){if(this.conf.progress){return}this.conf.progress=true;var c=document.createElement("DIV");c.className="dhxcelltop_progress";this.base.appendChild(c);var a=document.createElement("DIV");a.className="dhxcelltop_progress_img";this.base.appendChild(a);c=a=null};dhtmlXCellTop.prototype.progressOff=function(){if(!this.conf.progress){return}var g={dhxcelltop_progress:true,dhxcelltop_progress_img:true};for(var e=0;e<this.base.childNodes.length;e++){if(typeof(this.base.childNodes[e].className)!="undefined"&&g[this.base.childNodes[e].className]==true){g[this.base.childNodes[e].className]=this.base.childNodes[e]}}for(var c in g){if(g[c]!=true){this.base.removeChild(g[c])}g[c]=null}this.conf.progress=false;g=null};dhtmlXCellTop.prototype.attachHeader=function(c,a){if(this.dataNodes.haObj!=null){return}if(typeof(c)!="object"){c=document.getElementById(c)}this.dataNodes.haObj=document.createElement("DIV");this.dataNodes.haObj.className="dhxcelltop_hdr";this.dataNodes.haObj.style.height=(a||c.offsetHeight)+"px";this.base.insertBefore(this.dataNodes.haObj,this.dataNodes.menuObj||this.dataNodes.toolbarObj||this.cont);this.dataNodes.haObj.appendChild(c);c.style.visibility="visible";c=null;this.dataNodes.haEv=this.attachEvent("_onSetSizes",function(){this.dataNodes.haObj.style.left=this.conf.ofs.l+"px";this.dataNodes.haObj.style.marginTop=this.conf.ofs.t+"px";this.dataNodes.haObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.conf.ofs_nodes.t.haObj=true;this.setSizes()};dhtmlXCellTop.prototype.detachHeader=function(){if(!this.dataNodes.haObj){return}while(this.dataNodes.haObj.childNodes.length>0){this.dataNodes.haObj.lastChild.style.visibility="hidden";document.body.appendChild(this.dataNodes.haObj.lastChild)}this.dataNodes.haObj.parentNode.removeChild(this.dataNodes.haObj);this.dataNodes.haObj=null;this.detachEvent(this.dataNodes.haEv);this.dataNodes.haEv=null;this.conf.ofs_nodes.t.haObj=false;delete this.dataNodes.haEv;delete this.dataNodes.haObj;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachFooter=function(e,a){if(this.dataNodes.faObj!=null){return}if(typeof(e)!="object"){e=document.getElementById(e)}this.dataNodes.faObj=document.createElement("DIV");this.dataNodes.faObj.className="dhxcelltop_ftr";this.dataNodes.faObj.style.height=(a||e.offsetHeight)+"px";var c=(this.dataNodes.sbObj||this.cont);if(this.base.lastChild==c){this.base.appendChild(this.dataNodes.faObj)}else{this.base.insertBefore(this.dataNodes.faObj,c.nextSibling)}this.dataNodes.faEv=this.attachEvent("_onSetSizes",function(){this.dataNodes.faObj.style.left=this.conf.ofs.l+"px";this.dataNodes.faObj.style.bottom=this.conf.ofs.b+"px";this.dataNodes.faObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.dataNodes.faObj.appendChild(e);e.style.visibility="visible";c=e=null;this.conf.ofs_nodes.b.faObj=true;this.setSizes()};dhtmlXCellTop.prototype.detachFooter=function(){if(!this.dataNodes.faObj){return}while(this.dataNodes.faObj.childNodes.length>0){this.dataNodes.faObj.lastChild.style.visibility="hidden";document.body.appendChild(this.dataNodes.faObj.lastChild)}this.dataNodes.faObj.parentNode.removeChild(this.dataNodes.faObj);this.dataNodes.faObj=null;this.detachEvent(this.dataNodes.faEv);this.dataNodes.faEv=null;this.conf.ofs_nodes.b.faObj=false;delete this.dataNodes.faEv;delete this.dataNodes.faObj;if(!this.conf.unloading){this.setSizes()}};function dhtmlXCalendarObject(l,s){this.i={};var e=null;if(typeof(l)=="string"){var g=document.getElementById(l)}else{var g=l}if(g&&typeof(g)=="object"&&g.tagName&&String(g.tagName).toLowerCase()!="input"){e=g}g=null;if(typeof(l)!="object"||!l.length){l=[l]}for(var c=0;c<l.length;c++){if(typeof(l[c])=="string"){l[c]=(document.getElementById(l[c])||null)}if(l[c]!=null&&l[c].tagName&&String(l[c].tagName).toLowerCase()=="input"){this.i[window.dhx4.newId()]={input:l[c]}}else{if(!(l[c] instanceof Array)&&l[c] instanceof Object&&(l[c].input!=null||l[c].button!=null)){if(l[c].input!=null&&typeof(l[c].input)=="string"){l[c].input=document.getElementById(l[c].input)}if(l[c].button!=null&&typeof(l[c].button)=="string"){l[c].button=document.getElementById(l[c].button)}this.i[window.dhx4.newId()]=l[c]}}l[c]=null}this.conf={skin:(s||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhtmlxcalendar")||"dhx_skyblue"),zi:window.dhx4.newId(),touch:!window.dhx4.isIE,ws_first:true};this.setSkin=function(q,a){if(this.conf.skin==q&&!a){return}this.conf.skin=q;this.base.className="dhtmlxcalendar_"+this.conf.skin;this._ifrSize()};this.base=document.createElement("DIV");this.base.style.display="none";this.base.appendChild(document.createElement("DIV"));if(e!=null){this._hasParent=true;e.appendChild(this.base);e=null}else{document.body.appendChild(this.base)}this.setParent=function(a){if(this._hasParent){if(typeof(a)=="object"){a.appendChild(this.base)}else{if(typeof(a)=="string"){document.getElementById(a).appendChild(this.base)}}}};this.setSkin(this.conf.skin,true);this.base.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}a.cancelBubble=true};this.base.onmousedown=function(){return false};if(this.conf.touch){this.base.ontouchstart=this.base.onclick}this.loadUserLanguage=function(x){if(!this.langData[x]){return}this.lang=x;this.setWeekStartDay(this.langData[this.lang].weekstart);this.setDateFormat(this.langData[this.lang].dateformat||"%Y-%m-%d");if(this.msCont){var v=0;for(var u=0;u<this.msCont.childNodes.length;u++){for(var a=0;a<this.msCont.childNodes[u].childNodes.length;a++){this.msCont.childNodes[u].childNodes[a].innerHTML=this.langData[this.lang].monthesSNames[v++]}}}};this.contMonth=document.createElement("DIV");this.contMonth.className="dhtmlxcalendar_month_cont";this.contMonth.onselectstart=function(a){a=a||event;a.cancelBubble=true;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};this.base.firstChild.appendChild(this.contMonth);var m=document.createElement("UL");m.className="dhtmlxcalendar_line";this.contMonth.appendChild(m);var r=document.createElement("LI");r.className="dhtmlxcalendar_cell dhtmlxcalendar_month_hdr";r.innerHTML="<div class='dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left' onmouseover='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left_hover\";' onmouseout='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left\";'></div><span></span><div class='dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right' onmouseover='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right_hover\";' onmouseout='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right\";'></div>";m.appendChild(r);var h=this;r.onclick=function(v){v=v||event;if(v.type=="touchstart"&&v.preventDefault!=null){v.preventDefault()}var q=(v.target||v.srcElement);if(q.className&&q.className.indexOf("dhtmlxcalendar_month_arrow")===0){h._hideSelector();var u=(q.parentNode.firstChild==q?-1:1);var a=new Date(h._activeMonth);h._drawMonth(new Date(h._activeMonth.getFullYear(),h._activeMonth.getMonth()+u,1,0,0,0,0));h._evOnArrowClick([a,new Date(h._activeMonth)]);return}if(q.className&&q.className=="dhtmlxcalendar_month_label_month"){v.cancelBubble=true;h._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"){v.cancelBubble=true;h._showSelector("year",Math.round(q.offsetLeft+q.offsetWidth/2),q.offsetTop+q.offsetHeight+2,"selector_year",true);return}h._hideSelector()};if(this.conf.touch==true){r.ontouchstart=r.onclick}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 x=document.createElement("UL");x.className="dhtmlxcalendar_line";this.contDays.appendChild(x)}else{var x=this.contDays.firstChild}var u=this._wStart;var v=this.langData[this.lang].daysSNames;v.push(String(this.langData[this.lang].daysSNames[0]).valueOf());for(var y=0;y<8;y++){if(x.childNodes[y]==null){var a=document.createElement("LI");x.appendChild(a)}else{var a=x.childNodes[y]}if(y==0){a.className="dhtmlxcalendar_cell_wn";a.innerHTML="<div class='dhtmlxcalendar_label'>"+(this.langData[this.lang].weekname||"w")+"</div>"}else{a.className="dhtmlxcalendar_cell"+(u>=6?" dhtmlxcalendar_day_weekday_cell":"")+(y==1?"_first":"");a.innerHTML=v[u];if(++u>7){u=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.onclick=function(x){x=x||event;if(x.type=="touchstart"&&x.preventDefault!=null){x.preventDefault()}var q=(x.target||x.srcElement);if(q.parentNode!=null&&q.parentNode._date!=null){q=q.parentNode}if(q._date!=null&&!q._css_dis){var v=h._activeDate.getHours();var u=h._activeDate.getMinutes();var w=q._date;if(h.checkEvent("onBeforeChange")){if(!h.callEvent("onBeforeChange",[new Date(q._date.getFullYear(),q._date.getMonth(),q._date.getDate(),v,u)])){return}}if(h._activeDateCell!=null){h._activeDateCell._css_date=false;h._updateCellStyle(h._activeDateCell._q,h._activeDateCell._w)}var a=(h._activeDate.getFullYear()+"_"+h._activeDate.getMonth()!=w.getFullYear()+"_"+w.getMonth());h._nullDate=false;h._activeDate=new Date(w.getFullYear(),w.getMonth(),w.getDate(),v,u);h._activeDateCell=q;h._activeDateCell._css_date=true;h._activeDateCell._css_hover=false;h._updateCellStyle(h._activeDateCell._q,h._activeDateCell._w);if(a){h._drawMonth(h._activeDate)}if(h._activeInp&&h.i[h._activeInp]&&h.i[h._activeInp].input!=null){h.i[h._activeInp].input.value=h._dateToStr(new Date(h._activeDate.getTime()))}if(!h._hasParent){if(x.type=="touchstart"){window.setTimeout(function(){h._hide()},400)}else{h._hide()}}h._evOnClick([new Date(h._activeDate.getTime())])}};if(this.conf.touch==true){this.contDates.ontouchstart=this.contDates.onclick}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(h._lastHover==a||a._css_hover){return}a._css_hover=true;h._updateCellStyle(a._q,a._w);h._lastHover=a;h._evOnMouseOver([new Date(a._date.getFullYear(),a._date.getMonth(),a._date.getDate(),0,0,0,0),q]);a=null}};this.contDates.onmouseout=function(a){h._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);h._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 m=document.createElement("UL");m.className="dhtmlxcalendar_line";this.contDates.appendChild(m);for(var o=0;o<=7;o++){var r=document.createElement("LI");if(o==0){r.className="dhtmlxcalendar_cell_wn"}else{r.className="dhtmlxcalendar_cell"}m.appendChild(r)}}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 m=document.createElement("UL");m.className="dhtmlxcalendar_line";this.contTime.appendChild(m);var r=document.createElement("LI");r.className="dhtmlxcalendar_cell dhtmlxcalendar_time_hdr";r.innerHTML="<div class='dhtmlxcalendar_time_img'></div><span class='dhtmlxcalendar_label_hours'></span><span class='dhtmlxcalendar_label_colon'> : </span><span class='dhtmlxcalendar_label_minutes'></span>";m.appendChild(r);r.onclick=function(u){u=u||event;if(u.type=="touchstart"&&u.preventDefault!=null){u.preventDefault()}var a=(u.target||u.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"){u.cancelBubble=true;var q=h.contMonth.offsetHeight+h.contDays.offsetHeight+h.contDates.offsetHeight+a.offsetTop;h._showSelector("hours",Math.round(a.offsetLeft+a.offsetWidth/2),q-2,"selector_hours",true);return}if(a.className&&a.className=="dhtmlxcalendar_label_minutes"){u.cancelBubble=true;if(h._minutesInterval==1){var v=h.getFormatedDate("%i");a.innerHTML="<span class='dhtmlxcalendar_selected_date'>"+v.charAt(0)+"</span>"+v.charAt(1);a.firstChild._par=true;h._selectorMode=1}var q=h.contMonth.offsetHeight+h.contDays.offsetHeight+h.contDates.offsetHeight+a.offsetTop;h._showSelector("minutes",Math.round(a.offsetLeft+a.offsetWidth/2),q-2,"selector_minutes",true);return}h._hideSelector()};if(this.conf.touch==true){r.ontouchstart=r.onclick}this._activeMonth=null;this._activeDate=new Date();this._activeDateCell=null;this.setDate=function(q){window.dhx4.temp_calendar={tz:null};this._nullDate=(typeof(q)=="undefined"||q===""||!q);if(!(q instanceof Date)){q=this._strToDate(String(q||""));if(q=="Invalid Date"){q=new Date()}else{this.conf.tz=window.dhx4.temp_calendar.tz}window.dhx4.temp_calendar=null}if(this.conf.tz==null){this.conf.tz=window.dhx4.date2str(q,"%P")}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(u){if(this._nullDate){return null}var a=new Date(this._activeDate.getTime());if(u){window.dhx4.temp_calendar={tz:this.conf.tz};var q=this._dateToStr(a);window.dhx4.temp_calendar=null;return q}return a};this._drawMonth=function(F){if(!(F instanceof Date)){return}if(isNaN(F.getFullYear())){F=new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),1,0,0,0,0)}this._activeMonth=new Date(F.getFullYear(),F.getMonth(),1,0,0,0,0);this._activeDateCell=null;var D=new Date(this._activeMonth.getTime());var v=D.getDay();var J=v-this._wStart;if(J<0){J=J+7}D.setDate(D.getDate()-J);var M=F.getMonth();var N=new Date(this._activeDate.getFullYear(),this._activeDate.getMonth(),this._activeDate.getDate(),0,0,0,0).getTime();var A=0;for(var u=0;u<6;u++){var E=this._wStart;for(var L=0;L<=7;L++){if(L==0){var K=this.getWeekNumber(new Date(D.getFullYear(),D.getMonth(),D.getDate()+A,0,0,0,0));if(K>=52&&this.conf.ws_first==true&&this._activeMonth.getMonth()==0){var y=this.getWeekNumber(new Date(D.getFullYear(),D.getMonth(),D.getDate()+A+7,0,0,0,0));if(y<K&&y>1){K=1}}this.contDates.childNodes[u].childNodes[L].innerHTML="<div class='dhtmlxcalendar_label'>"+K+"</div>"}else{var a=new Date(D.getFullYear(),D.getMonth(),D.getDate()+A,0,0,0,0);if(a.getHours()!=0){var C=(a.getHours()>12?24-a.getHours():a.getHours());a.setTime(a.getTime()+60*60*1000*C)}var I=a.getDay();var x=a.getTime();var H="dhtmlxcalendar_label";if(this._tipData[x]!=null){if(this._tipData[x].usePopup&&typeof(window.dhtmlXPopup)=="function"){this.contDates.childNodes[u].childNodes[L].removeAttribute("title");this._initTooltipPopup()}else{this.contDates.childNodes[u].childNodes[L].setAttribute("title",this._tipData[x].text)}if(this._tipData[x].showIcon){H+=" dhtmlxcalendar_label_title"}}else{this.contDates.childNodes[u].childNodes[L].removeAttribute("title")}this.contDates.childNodes[u].childNodes[L].innerHTML="<div class='"+H+"'>"+a.getDate()+"</div>";this.contDates.childNodes[u].childNodes[L]._date=new Date(x);this.contDates.childNodes[u].childNodes[L]._q=u;this.contDates.childNodes[u].childNodes[L]._w=L;this.contDates.childNodes[u].childNodes[L]._css_month=(a.getMonth()==M);this.contDates.childNodes[u].childNodes[L]._css_date=(!this._nullDate&&x==N);this.contDates.childNodes[u].childNodes[L]._css_weekend=(E>=6);this.contDates.childNodes[u].childNodes[L]._css_dis=this._isOutOfRange(x);this.contDates.childNodes[u].childNodes[L]._css_holiday=(this._holidays[x]==true);this._updateCellStyle(u,L);if(x==N){this._activeDateCell=this.contDates.childNodes[u].childNodes[L]}if(++E>7){E=1}A++}}}this.contMonth.firstChild.firstChild.childNodes[1].innerHTML=this._buildMonthHdr(F)};this._updateCellStyle=function(x,a){var v=this.contDates.childNodes[x].childNodes[a];var u="dhtmlxcalendar_cell dhtmlxcalendar_cell";u+=(v._css_month?"_month":"");u+=(v._css_date?"_date":"");u+=(v._css_weekend?"_weekend":"");u+=(v._css_holiday?"_holiday":"");u+=(v._css_dis?"_dis":"");u+=(v._css_hover&&!v._css_dis?"_hover":"");v.className=u;v=null};this._minutesInterval=5;this._initSelector=function(D,x){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="&nbsp;";this._sel.firstChild.firstChild.firstChild.childNodes[2].innerHTML="&nbsp;";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(h._selHover!=q){h._clearSelHover()}if(String(q.className).match(/^\s{0,}dhtmlxcalendar_selector_cell\s{0,}$/gi)!=null){q.className+=" dhtmlxcalendar_selector_cell_hover";h._selHover=q}}};this._sel.onmouseout=function(){h._clearSelHover()};this._sel.firstChild.firstChild.firstChild.childNodes[0].onclick=function(q){q=q||event;if(q.type=="touchstart"&&q.preventDefault!=null){q.preventDefault()}q.cancelBubble=true;h._scrollYears(-1)};this._sel.firstChild.firstChild.firstChild.childNodes[2].onclick=function(q){q=q||event;if(q.type=="touchstart"&&q.preventDefault!=null){q.preventDefault()}q.cancelBubble=true;h._scrollYears(1)};if(this.conf.touch==true){this._sel.firstChild.firstChild.firstChild.childNodes[0].ontouchstart=this._sel.firstChild.firstChild.firstChild.childNodes[0].onclick;this._sel.firstChild.firstChild.firstChild.childNodes[2].ontouchstart=this._sel.firstChild.firstChild.firstChild.childNodes[2].onclick}this._sel._ta={};this._selHover=null;this._sel.appendChild(document.createElement("DIV"));this._sel.lastChild.className="dhtmlxcalendar_selector_obj_arrow"}if(this._sel._ta[D]==true){return}if(D=="month"){this._msCells={};this.msCont=document.createElement("DIV");this.msCont.className="dhtmlxcalendar_area_"+x;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.msCont);var u=0;for(var a=0;a<4;a++){var C=document.createElement("UL");C.className="dhtmlxcalendar_selector_line";this.msCont.appendChild(C);for(var E=0;E<3;E++){var F=document.createElement("LI");F.innerHTML=this.langData[this.lang].monthesSNames[u];F.className="dhtmlxcalendar_selector_cell";C.appendChild(F);F._month=u;F._cell=true;this._msCells[u++]=F}}this.msCont.onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._month!=null){h._hideSelector();h._updateActiveMonth();h._drawMonth(new Date(h._activeMonth.getFullYear(),q._month,1,0,0,0,0));h._doOnSelectorChange()}};if(this.conf.touch==true){this.msCont.ontouchstart=this.msCont.onclick}}if(D=="year"){this._ysCells={};this.ysCont=document.createElement("DIV");this.ysCont.className="dhtmlxcalendar_area_"+x;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.ysCont);for(var a=0;a<4;a++){var C=document.createElement("UL");C.className="dhtmlxcalendar_selector_line";this.ysCont.appendChild(C);for(var E=0;E<3;E++){var F=document.createElement("LI");F.className="dhtmlxcalendar_selector_cell";F._cell=true;C.appendChild(F)}}this.ysCont.onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._year!=null){h._hideSelector();h._drawMonth(new Date(q._year,h._activeMonth.getMonth(),1,0,0,0,0));h._doOnSelectorChange()}};if(this.conf.touch==true){this.ysCont.ontouchstart=this.ysCont.onclick}}if(D=="hours"){this._hsCells={};this.hsCont=document.createElement("DIV");this.hsCont.className="dhtmlxcalendar_area_"+x;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.hsCont);var u=0;for(var a=0;a<4;a++){var C=document.createElement("UL");C.className="dhtmlxcalendar_selector_line";this.hsCont.appendChild(C);for(var E=0;E<6;E++){var F=document.createElement("LI");F.innerHTML=this._fixLength(u,2);F.className="dhtmlxcalendar_selector_cell";C.appendChild(F);F._hours=u;F._cell=true;this._hsCells[u++]=F}}this.hsCont.onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._hours!=null){h._hideSelector();h._activeDate.setHours(q._hours);h._updateActiveHours();h._updateVisibleHours();h._doOnSelectorChange();h.callEvent("onTimeChange",[new Date(h._activeDate.getTime())])}};if(this.conf.touch==true){this.hsCont.ontouchstart=this.hsCont.onclick}}if(D=="minutes"){var A=4;var v=3;var y=2;if(this._minutesInterval==1){if(this._selectorMode==1){A=2;v=3;y=1}else{A=2;v=5;y=1;x+="5"}}if(this._minutesInterval==10){A=2}if(this._minutesInterval==15){A=1;v=4;x+="4"}this._rsCells={};this.rsCont=document.createElement("DIV");this.rsCont.className="dhtmlxcalendar_area_"+x;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.rsCont);var u=0;for(var a=0;a<A;a++){var C=document.createElement("UL");C.className="dhtmlxcalendar_selector_line";this.rsCont.appendChild(C);for(var E=0;E<v;E++){var F=document.createElement("LI");F.innerHTML=(y>1?this._fixLength(u,y):u);F.className="dhtmlxcalendar_selector_cell";C.appendChild(F);F._minutes=u;F._cell=true;this._rsCells[u]=F;u+=this._minutesInterval}}this.rsCont.onclick=function(H){H=H||event;if(H.type=="touchstart"&&H.preventDefault!=null){H.preventDefault()}H.cancelBubble=true;var w=(H.target||H.srcElement);if(w._minutes!=null){if(h._minutesInterval==1){var q=h.getFormatedDate("%i");if(h._selectorMode==1){q=w._minutes.toString()+q.charAt(1)}else{q=q.charAt(0)+w._minutes.toString()}h._activeDate.setMinutes(Number(q));h.callEvent("onTimeChange",[new Date(h._activeDate.getTime())]);h._hideSelector();if(h._selectorMode==1){h._updateVisibleMinutes(true);h._selectorMode=2;h._showSelector("minutes",h._sel._x,h._sel._y,"selector_minutes",true);h._updateActiveMinutes();return}else{h._selectorMode=1}}else{h._hideSelector();h._activeDate.setMinutes(w._minutes);h._updateActiveMinutes();h.callEvent("onTimeChange",[new Date(h._activeDate.getTime())])}h._updateVisibleMinutes();h._doOnSelectorChange()}};if(this.conf.touch==true){this.rsCont.ontouchstart=this.rsCont.onclick}}this._sel._ta[D]=true};this._showSelector=function(w,q,A,v,a){if(a===true&&this._sel!=null&&this._isSelectorVisible()&&w==this._sel._t){this._hideSelector();return}if(this.conf.skin=="dhx_terrace"){q+=12}if(!this._sel||!this._sel._ta[w]){this._initSelector(w,v)}if(w!=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=A;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=w;this._sel.className="dhtmlxcalendar_selector_obj dhtmlxcalendar_"+v;this._sel.childNodes[0].firstChild.firstChild.childNodes[0].style.display=this._sel.childNodes[0].firstChild.firstChild.childNodes[2].style.display=(w=="year"?"":"none");var u=Math.max(0,q-Math.round(this._sel.offsetWidth/2));if(u+this._sel.offsetWidth>this._sel.parentNode.offsetWidth){u=this._sel.parentNode.offsetWidth-this._sel.offsetWidth}this._sel.style.left=u+"px";if(w=="hours"||w=="minutes"){this._sel.style.top=A-this._sel.offsetHeight+"px"}else{this._sel.style.top=A+"px"}this._sel.childNodes[1].style.width=this._sel.childNodes[0].offsetWidth+"px";this._sel.style.visibility="visible";this._doOnSelectorShow(w)};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(u){if(!this._sel){return}if(!this._sel._ta[u]){return}if(u=="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(u=="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(u=="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(u=="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[u]=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(A){for(var v in this._ysCells){this._ysCells[v]=null;delete this._ysCells[v]}var x=12*Math.floor(A.getFullYear()/12);for(var y=0;y<4;y++){for(var u=0;u<3;u++){this.ysCont.childNodes[y].childNodes[u].innerHTML=x;this.ysCont.childNodes[y].childNodes[u]._year=x;this.ysCont.childNodes[y].childNodes[u].className="dhtmlxcalendar_selector_cell";this._ysCells[x++]=this.ysCont.childNodes[y].childNodes[u]}}this._updateActiveYear()};this._scrollYears=function(a){var u=(a<0?this.ysCont.firstChild.firstChild._year:this.ysCont.lastChild.lastChild._year)+a;var q=new Date(u,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)+"<span class='dhtmlxcalendar_selected_date'>"+a.charAt(1)+"</span>"}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).length<q){a="0"+String(a)}return a};this._dateFormat="";this._dateFormatRE=null;this.setDateFormat=function(w){var v={};if(this._strToDate!=null){for(var q in this.i){if(this.i[q].input!=null&&this.i[q].input.value.length>0){var x=this._strToDate(this.i[q].input.value,this._dateFormat||this.langData[this.lang].dateformat||"%Y-%m-%d");if(x instanceof Date){v[q]=x}}}}this._dateFormat=w;var u=String(this._dateFormat).replace(/%[a-zA-Z]+/g,function(a){var y=a.replace(/%/,"");switch(y){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"("+h.langData[h.lang].monthesSNames.join("|").toLowerCase()+"){1,}";case"F":return"("+h.langData[h.lang].monthesFNames.join("|").toLowerCase()+"){1,}";case"D":return"[a-z]{2}";case"a":case"A":return"AM|PM";case"u":return"\\d{1,6}";case"P":return"[\\+\\-]\\d{1,2}\\:\\d{1,2}"}return a});this._dateFormatRE=new RegExp(u,"i");for(var q in v){this.i[q].input.value=this._dateToStr(v[q])}v=null};this.setDateFormat(this.langData[this.lang].dateformat||"%Y-%m-%d");this._updateDateStr=function(q){if(!this._dateFormatRE||!q.match(this._dateFormatRE)){return}if(q==this.getFormatedDate()){return}var a=this._strToDate(q);if(!(a instanceof Date)){return}if(this.checkEvent("onBeforeChange")){if(!this.callEvent("onBeforeChange",[new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds())])){if(this.i!=null&&this._activeInp!=null&&this.i[this._activeInp]!=null&&this.i[this._activeInp].input!=null){this.i[this._activeInp].input.value=this.getFormatedDate()}return}}this._nullDate=false;this._activeDate=a;this._drawMonth(this._nullDate?new Date():this._activeDate);this._updateVisibleMinutes();this._updateVisibleHours();if(this._sel&&this._isSelectorVisible()){this._doOnSelectorShow(this._sel._t)}this._doOnSelectorChange(true)};this.showMonth=function(a){if(typeof(a)=="string"){a=this._strToDate(a)}if(!(a instanceof Date)){return}this._drawMonth(a)};this.setFormatedDate=function(w,x,q,v){var u=this._strToDate(x,w);if(v){return u}this.setDate(u)};this.getFormatedDate=function(q,a){if(!(a&&a instanceof Date)){if(this._nullDate){return""}a=new Date(this._activeDate)}return this._dateToStr(a,q)};this.getWeekNumber=function(x){if(typeof(x)=="string"){x=this._strToDate(x)}if(!(x instanceof Date)){return"Invalid Date"}if(typeof(this._ftDay)=="undefined"){this._ftDay=4}var F=this._wStart;var w=F+7;var E=4;var u=new Date(x.getFullYear(),0,1,0,0,0,0);var v=u.getDay();if(v==0){v=7}if(E<F){E+=7;v+=7}var C=0;if(v>=F&&v<=E){}else{C=1}var A=v-F;var D=new Date(x.getFullYear(),0,1-A+C*7,0,0,0,0);var I=604800000;var q=new Date(x.getFullYear(),x.getMonth(),x.getDate()+1,0,0,0,0);var H=Math.ceil((q.getTime()-D.getTime())/I);if(H==0){var y=new Date(x.getFullYear(),x.getMonth(),x.getDate(),0,0,0,0);var a=y.getDay()-this._wStart;if(a<0){a=a+7}y.setDate(y.getDate()-a);H=this.getWeekNumber(y)}return H};this.showWeekNumbers=function(){this.base.firstChild.className="dhtmlxcalendar_wn"};this.hideWeekNumbers=function(){this.base.firstChild.className=""};this.show=function(u){if(!u&&this._hasParent){this._show();return}if(typeof(u)=="object"&&typeof(u._dhtmlxcalendar_uid)!="undefined"&&this.i[u._dhtmlxcalendar_uid]==u){this._show(u._dhtmlxcalendar_uid);return}if(typeof(u)=="undefined"){for(var q in this.i){if(!u){u=q}}}if(!u){return}this._show(u)};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 v=(this.i[A].input||this.i[A].button);var q=(navigator.appVersion.indexOf("MSIE")!=-1);var w=Math.max((q?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);var u=w+(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(v)+v.offsetWidth+"px";this.base.style.top=Math.min(this._getTop(v),u-this.base.offsetHeight)+"px"}else{if(this.pos=="bottom"){var y=this._getTop(v)+v.offsetHeight+1;if(y+this.base.offsetHeight>u){var x=this._getTop(v)-this.base.offsetHeight;if(x>=-20){y=x}}this.base.style.left=this._getLeft(v)+"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;v=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 u=0,q=0;while(a){u=u+parseInt(a.offsetTop);q=q+parseInt(a.offsetLeft);a=a.offsetParent}return{top:u,left:q}};this._posGetOffsetRect=function(v){var y=v.getBoundingClientRect();var A=document.body;var q=document.documentElement;var a=window.pageYOffset||q.scrollTop||A.scrollTop;var w=window.pageXOffset||q.scrollLeft||A.scrollLeft;var x=q.clientTop||A.clientTop||0;var C=q.clientLeft||A.clientLeft||0;var D=y.top+a-x;var u=y.left+w-C;return{top:Math.round(D),left:Math.round(u)}};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(v){var a=this._extractDates(v);for(var u=0;u<a.length;u++){this._rangeSet[new Date(a[u].getFullYear(),a[u].getMonth(),a[u].getDate(),0,0,0,0).getTime()]=true}this._drawMonth(this._activeMonth)};this.clearInsensitiveDays=function(){this._clearRangeSet();this._drawMonth(this._activeMonth)};this._holidays={};this.setHolidays=function(u){if(u==null){this._clearHolidays()}else{if(u!=null){var a=this._extractDates(u);for(var v=0;v<a.length;v++){this._holidays[new Date(a[v].getFullYear(),a[v].getMonth(),a[v].getDate(),0,0,0,0).getTime()]=true}}}this._drawMonth(this._activeMonth)};this._extractDates=function(v){if(typeof(v)=="string"||v instanceof Date){v=[v]}var u=[];for(var x=0;x<v.length;x++){if(typeof(v[x])=="string"){var y=v[x].split(",");for(var a=0;a<y.length;a++){u.push(this._strToDate(y[a]))}}else{if(v[x] instanceof Date){u.push(v[x])}}}return u};this._clearRange=function(){this._rangeActive=false;this._rangeType=null;this._rangeFrom=null;this._rangeTo=null};this._clearRangeSet=function(){for(var q in this._rangeSet){this._rangeSet[q]=null;delete this._rangeSet[q]}};this._clearHolidays=function(){for(var q in this._holidays){this._holidays[q]=null;delete this._holidays[q]}};this._isOutOfRange=function(q){if(this._rangeSet[q]==true){return true}if(this._rangeActive){if(this._rangeType=="in"&&(q<this._rangeFrom||q>this._rangeTo)){return true}if(this._rangeType=="out"&&(q>=this._rangeFrom&&q<=this._rangeTo)){return true}if(this._rangeType=="from"&&q<this._rangeFrom){return true}if(this._rangeType=="to"&&q>this._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(v,u,a){var q=false;if(v!=null&&u!=null){if(!(v instanceof Date)){v=this._strToDate(v)}if(!(u instanceof Date)){u=this._strToDate(u)}if(v.getTime()>u.getTime()){return}this._rangeFrom=new Date(v.getFullYear(),v.getMonth(),v.getDate(),0,0,0,0).getTime();this._rangeTo=new Date(u.getFullYear(),u.getMonth(),u.getDate(),0,0,0,0).getTime();this._rangeActive=true;this._rangeType="in";q=true}if(!q&&v!=null&&u==null){if(!(v instanceof Date)){v=this._strToDate(v)}this._rangeFrom=new Date(v.getFullYear(),v.getMonth(),v.getDate(),0,0,0,0).getTime();this._rangeTo=null;if(a===true){this._rangeFrom++}this._rangeActive=true;this._rangeType="from";q=true}if(!q&&v==null&&u!=null){if(!(u instanceof Date)){u=this._strToDate(u)}this._rangeFrom=null;this._rangeTo=new Date(u.getFullYear(),u.getMonth(),u.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(y,x){if(y=="week"){if(typeof(x)!="object"&&typeof(x.length)=="undefined"){x=[x]}if(!this._rangeWeekData){this._rangeWeekData={}}for(var u in this._rangeWeekData){this._rangeWeekData[u]=false;delete this._rangeWeekData[u]}for(var w=0;w<x.length;w++){this._rangeWeekData[x[w]]=true;if(x[w]==7){this._rangeWeekData[0]=true}}this._rangeWeek=true}if(y=="month"){if(typeof(x)!="object"&&typeof(x.length)=="undefined"){x=[x]}if(!this._rangeMonthData){this._rangeMonthData={}}for(var u in this._rangeMonthData){this._rangeMonthData[u]=false;delete this._rangeMonthData[u]}for(var w=0;w<x.length;w++){this._rangeMonthData[x[w]]=true}this._rangeMonth=true}if(y=="year"){var v=this._extractDates(x);if(!this._rangeYearData){this._rangeYearData={}}for(var u in this._rangeYearData){this._rangeYearData[u]=false;delete this._rangeYearData[u]}for(var w=0;w<v.length;w++){this._rangeYearData[v[w].getMonth()+"_"+v[w].getDate()]=true}this._rangeYear=true}this._drawMonth(this._activeMonth)};this.enableDays=function(a){if(a=="week"){this._rangeWeek=false}if(a=="month"){this._rangeMonth=false}if(a=="year"){this._rangeYear=false}this._drawMonth(this._activeMonth)};this._tipData={};this._tipTM=null;this._tipTMTime=400;this._tipEvs=false;this._tipPopup=null;this._tipCellDate=null;this._tipCellDim=null;this.setTooltip=function(v,y,A,a){var w=this._extractDates(v);for(var x=0;x<w.length;x++){var u=new Date(w[x].getFullYear(),w[x].getMonth(),w[x].getDate(),0,0,0,0).getTime();this._tipData[u]={text:y,showIcon:A,usePopup:a}}this._drawMonth(this._activeMonth)};this.clearTooltip=function(u){var v=this._extractDates(u);for(var w=0;w<v.length;w++){var a=new Date(v[w].getFullYear(),v[w].getMonth(),v[w].getDate(),0,0,0,0).getTime();this._tipData[a]=null;delete this._tipData[a]}this._drawMonth(this._activeMonth)};this._initTooltipPopup=function(){if(this._tipEvs){return}this.attachEvent("onMouseOver",function(q){var a=new Date(q.getFullYear(),q.getMonth(),q.getDate(),0,0,0,0).getTime();if(this._tipData[a]!=null){if(this._tipTM){window.clearTimeout(this._tipTM)}this._tipCellDate=q;this._tipCellDim=this.getCellDimension(q);this._tipText=this._tipData[a].text;this._tipTM=window.setTimeout(this._showTooltipPopup,this._tipTMTime)}});this.attachEvent("onMouseOut",this._hideTooltipPopup);this._tipEvs=true};this._showTooltipPopup=function(v,a,A,q,u){if(!h._tipPopup){h._tipPopup=new dhtmlXPopup({mode:"top"})}h._tipPopup.attachHTML(h._tipText);h._tipPopup.show(h._tipCellDim.x,h._tipCellDim.y,h._tipCellDim.w,h._tipCellDim.h);h.callEvent("onPopupShow",[h._tipCellDate])};this._hideTooltipPopup=function(){if(this._tipTM){window.clearTimeout(this._tipTM)}if(this._tipPopup!=null&&this._tipPopup.isVisible()){this._tipPopup.hide();this.callEvent("onPopupHide",[this._tipCellDate])}};this.getPopup=function(){return this._tipPopup};this.getCellDimension=function(v){if(typeof(v)=="string"){v=this._strToDate(v)}if(!(v instanceof Date)){return null}var x=new Date(v.getFullYear(),v.getMonth(),v.getDate(),0,0,0,0).getTime();var u=null;for(var y=0;y<this.contDates.childNodes.length;y++){for(var a=0;a<this.contDates.childNodes[y].childNodes.length;a++){var A=this.contDates.childNodes[y].childNodes[a];if(A._date!=null&&A._date.getTime()==x){u={x:this._getLeft(A),y:this._getTop(A),w:A.offsetWidth,h:A.offsetHeight}}A=null}}return u};this._updateFromInput=function(a){if(this._nullInInput&&((a.value).replace(/\s/g,"")).length==0){if(this.checkEvent("onBeforeChange")){if(!this.callEvent("onBeforeChange",[null])){if(this.i!=null&&this._activeInp!=null&&this.i[this._activeInp]!=null&&this.i[this._activeInp].input!=null){this.i[this._activeInp].input.value=this.getFormatedDate()}return}}this.setDate(null)}else{this._updateDateStr(a.value)}a=null};this._doOnClick=function(q){q=q||event;var a=(q.target||q.srcElement);if(a._dhtmlxcalendar_uid&&a._dhtmlxcalendar_uid!=h._activeInp&&h._isVisible()&&h._activeInp){h._hide();return}if(!a._dhtmlxcalendar_uid||!h.i[a._dhtmlxcalendar_uid]){if(h._isSelectorVisible()){h._hideSelector()}else{if(!h._hasParent&&h._isVisible()){h._hide()}}}};this._doOnKeyDown=function(a){a=a||event;if(a.keyCode==27||a.keyCode==13){if(h._isSelectorVisible()){h._hideSelector()}else{if(h._isVisible()&&!h._hasParent){h._hide()}}}};this._doOnInpClick=function(q){q=q||event;if(q.type=="touchstart"&&q.preventDefault!=null){q.preventDefault()}var a=(q.target||q.srcElement);if(!a._dhtmlxcalendar_uid){return}if(!h._listenerEnabled){h._updateFromInput(a)}h._show(a._dhtmlxcalendar_uid,true)};this._doOnInpKeyUp=function(q){q=q||event;var a=(q.target||q.srcElement);if(q.keyCode==13||!a._dhtmlxcalendar_uid){return}if(!h._listenerEnabled){h._updateFromInput(a)}};this._doOnBtnClick=function(q){q=q||event;if(q.type=="touchstart"&&q.preventDefault!=null){q.preventDefault()}var a=(q.target||q.srcElement);if(!a._dhtmlxcalendar_uid){return}if(h.i[a._dhtmlxcalendar_uid].input!=null){h._updateFromInput(h.i[a._dhtmlxcalendar_uid].input)}h._show(a._dhtmlxcalendar_uid,true)};this._doOnUnload=function(){if(h&&h.unload){h.unload()}};if(typeof(window.addEventListener)=="function"){document.body.addEventListener("click",h._doOnClick,false);window.addEventListener("keydown",h._doOnKeyDown,false);window.addEventListener("unload",h._doOnUnload,false);if(this.conf.touch==true){document.body.addEventListener("touchstart",h._doOnClick,false)}}else{document.body.attachEvent("onclick",h._doOnClick);document.body.attachEvent("onkeydown",h._doOnKeyDown);window.attachEvent("onunload",h._doOnUnload)}this.attachObj=function(u){var q=window.dhx4.newId();if(typeof(u)=="string"){this.i[q]={input:document.getElementById(u)}}else{if(typeof(u.tagName)!="undefined"){this.i[q]={input:u}}else{if(typeof(u)=="object"&&(u.input!=null||u.button!=null)){this.i[q]={};if(u.input!=null){this.i[q].input=(typeof(u.input)=="string"?document.getElementById(u.input):u.input)}if(u.button!=null){this.i[q].button=(typeof(u.button)=="string"?document.getElementById(u.button):u.button)}}}}this._attachEventsToObject(q);return q};this.detachObj=function(v){var u=null;if(this.i[v]!=null){u=v}else{if(typeof(v)=="string"){v=document.getElementById(v);u=v._dhtmlxcalendar_uid}else{if(typeof(v.tagName)!="undefined"){u=v._dhtmlxcalendar_uid}else{if(typeof(v)=="object"&&(v.input!=null||v.button!=null)){if(u==null&&v.input!=null){u=(typeof(v.input)=="string"?document.getElementById(v.input):v.input)._dhtmlxcalendar_uid}if(u==null&&v.button!=null){u=(typeof(v.button)=="string"?document.getElementById(v.button):v.button)._dhtmlxcalendar_uid}}}}}if(u!=null&&this.i[u]!=null){this._detachEventsFromObject(u);for(var q in this.i[q]){this.i[u][q]._dhtmlxcalendar_uid=null;this.i[u][q]=null;delete this.i[u][q]}this.i[u]=null;delete this.i[u];return true}return false};this._attachEventsToObject=function(q){if(this.i[q].button!=null){this.i[q].button._dhtmlxcalendar_uid=q;if(typeof(window.addEventListener)=="function"){this.i[q].button.addEventListener("click",h._doOnBtnClick,false);if(this.conf.touch==true){this.i[q].button.addEventListener("touchstart",h._doOnBtnClick,false)}}else{this.i[q].button.attachEvent("onclick",h._doOnBtnClick)}}else{if(this.i[q].input!=null){this.i[q].input._dhtmlxcalendar_uid=q;if(typeof(window.addEventListener)=="function"){this.i[q].input.addEventListener("click",h._doOnInpClick,false);this.i[q].input.addEventListener("keyup",h._doOnInpKeyUp,false);if(this.conf.touch==true){this.i[q].input.addEventListener("touchstart",h._doOnInpClick,false)}}else{this.i[q].input.attachEvent("onclick",h._doOnInpClick);this.i[q].input.attachEvent("onkeyup",h._doOnInpKeyUp)}}}};this._detachEventsFromObject=function(q){if(this.i[q].button!=null){if(typeof(window.addEventListener)=="function"){this.i[q].button.removeEventListener("click",h._doOnBtnClick,false);if(this.conf.touch==true){this.i[q].button.removeEventListener("touchstart",h._doOnBtnClick,false)}}else{this.i[q].button.detachEvent("onclick",h._doOnBtnClick)}}else{if(this.i[q].input!=null){if(typeof(window.addEventListener)=="function"){this.i[q].input.removeEventListener("click",h._doOnInpClick,false);this.i[q].input.removeEventListener("keyup",h._doOnInpKeyUp,false);if(this.conf.touch==true){this.i[q].input.removeEventListener("touchstart",h._doOnInpClick,false)}}else{this.i[q].input.detachEvent("onclick",h._doOnInpClick);this.i[q].input.detachEvent("onkeyup",h._doOnInpKeyUp)}}}};this.enableListener=function(a){if(!a){return}if(typeof(window.addEventListener)=="function"){a.addEventListener("focus",h._listenerEvFocus,false);a.addEventListener("blur",h._listenerEvBlur,false)}else{a.attachEvent("onfocus",h._listenerEvFocus);a.attachEvent("onblur",h._listenerEvBlur)}a=null};this.disableListener=function(a){if(!a){return}a._f0=false;if(this._tmListener){window.clearTimeout(this._tmListener)}if(typeof(window.addEventListener)=="function"){a.removeEventListener("focus",h._listenerEvFocus,false);a.removeEventListener("blur",h._listenerEvBlur,false)}else{a.detachEvent("onfocus",h._listenerEvFocus);a.detachEvent("onblur",h._listenerEvBlur)}a=null};this._startListener=function(a){if(this._tmListener){window.clearTimeout(this._tmListener)}if(typeof(a._v1)=="undefined"){a._v1=a.value}if(a._v1!=a.value){this._updateFromInput(a);a._v1=a.value}if(a._f0){this._tmListener=window.setTimeout(function(){h._startListener(a)},100)}};this._listenerEvFocus=function(q){q=q||event;var a=q.target||q.srcElement;a._f0=true;h._startListener(a);a=null};this._listenerEvBlur=function(q){q=q||event;var a=q.target||q.srcElement;a._f0=false;a=null};for(var n in this.i){this._attachEventsToObject(n)}window.dhx4._eventable(this);this._evOnArrowClick=function(a){return this.callEvent("onArrowClick",a)};this._evOnClick=function(a){return this.callEvent("onClick",a)};this._evOnMouseOut=function(a){return this.callEvent("onMouseOut",a)};this._evOnMouseOver=function(a){return this.callEvent("onMouseOver",a)};this.unload=function(){this._activeDate=null;this._activeDateCell=null;this._activeInp=null;this._activeMonth=null;this._dateFormat=null;this._dateFormatRE=null;this._lastHover=null;if(this._tmListener){window.clearTimeout(this._tmListener)}this._tmListener=null;if(typeof(window.addEventListener)=="function"){document.body.removeEventListener("click",h._doOnClick,false);window.removeEventListener("keydown",h._doOnKeyDown,false);window.removeEventListener("unload",h._doOnUnload,false);if(this.conf.touch==true){document.body.removeEventListener("touchstart",h._doOnClick,false)}}else{document.body.detachEvent("onclick",h._doOnClick);document.body.detachEvent("onkeydown",h._doOnKeyDown);window.detachEvent("onunload",h._doOnKeyDown)}this._doOnClick=null;this._doOnKeyDown=null;this._doOnUnload=null;for(var q in this.i){this.i[q]._dhtmlxcalendar_uid=null;this._detachEventsFromObject(q);this.disableListener(this.i[q].input);this.i[q]=null;delete this.i[q]}this.i=null;this._doOnInpClick=null;this._doOnInpKeyUp=null;window.dhx4._eventable(this,"clear");this.contMonth.onselectstart=null;this.contMonth.firstChild.firstChild.onclick=null;this.contMonth.firstChild.firstChild.ontouchstart=null;this.contMonth.firstChild.firstChild.firstChild.onmouseover=null;this.contMonth.firstChild.firstChild.firstChild.onmouseout=null;this.contMonth.firstChild.firstChild.lastChild.onmouseover=null;this.contMonth.firstChild.firstChild.lastChild.onmouseout=null;while(this.contMonth.firstChild.firstChild.childNodes.length>0){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=h=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(h){var c=this;var g=function(l){return(String(l).length==1?"0"+String(l):l)};var a=function(l,m){return"<span class='dhtmlxcalendar_month_label_"+l+"'>"+m+"</span>"};var e=String(this.langData[this.lang].hdrformat||("%F %Y")).replace(/%[a-z]/gi,function(l){switch(l){case"%m":return a("month",g(h.getMonth()+1));case"%n":return a("month",h.getMonth()+1);case"%M":return a("month",c.langData[c.lang].monthesSNames[h.getMonth()]);case"%F":return a("month",c.langData[c.lang].monthesFNames[h.getMonth()]);case"%y":return a("year",g(h.getYear()%100));case"%Y":return a("year",h.getFullYear());case"%%":return"%";default:return l}});c=g=a=null;return e};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("<html><head><style>html,body{width:100%;height:100%;overflow:hidden;margin:0px;}</style></head><body</body></html>")};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._dateStrings=function(){var a=this.langData[this.lang];return{monthFullName:a.monthesFNames,monthShortName:a.monthesSNames,dayFullName:a.daysFNames,dayShortName:a.daysSNames}};dhtmlXCalendarObject.prototype._strToDate=function(c,a){return window.dhx4.str2date(c,a||this._dateFormat,this._dateStrings())};dhtmlXCalendarObject.prototype._dateToStr=function(c,a){return window.dhx4.date2str(c,a||this._dateFormat,this._dateStrings())};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(e){a._updateRange("rightCalendar",e,null);a._evOnClick(["left",e])});this.rightCalendar.attachEvent("onClick",function(e){a._updateRange("leftCalendar",null,e);a._evOnClick(["right",e])});this.leftCalendar.attachEvent("onBeforeChange",function(e){return a._evOnBeforeChange(["left",e])});this.rightCalendar.attachEvent("onBeforeChange",function(e){return a._evOnBeforeChange(["right",e])});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(e){this.leftCalendar.setDateFormat(e);this.rightCalendar.setDateFormat(e)};this.setDates=function(g,e){if(g!=null){this.leftCalendar.setDate(g)}if(e!=null){this.rightCalendar.setDate(e)}this._updateRange()};this._updateRange=function(e,h,g){if(arguments.length==3){(e=="leftCalendar"?this.leftCalendar:this.rightCalendar).setSensitiveRange(h,g)}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(e){return this.callEvent("onClick",e)};this._evOnBeforeChange=function(e){return this.callEvent("onBeforeChange",e)};window.dhx4._eventable(this);return this};function dhtmlXCombo(l,r,e,n,h){var m=this;var g=null;var s=null;if(typeof(l)=="object"&&!l.tagName){g=l;l=g.parent;e=g.width;r=g.name;n=g.mode;s=g.skin}this.cont=(typeof(l)=="string"?document.getElementById(l):l);this.conf={skin:null,form_name:r||"dhxcombo",combo_width:(parseInt(e)||this.cont.offsetWidth||120)-(dhx4.isFF||dhx4.isIE||dhx4.isChrome||dhx4.isOpera?2:0),combo_image:false,combo_focus:false,opts_type:(typeof(n)=="string"&&typeof(this.modes[n])!="undefined"?n:"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,btn_left:((window.dhx4.isIE6||window.dhx4.isIE7||window.dhx4.isIE8)&&typeof(window.addEventListener)=="undefined"?1:0),ro_mode:false,ro_text:"",ro_tm:null,ro_tm_time:750,img_path:"",img_def:"",img_def_dis:true,template:{input:"#text#",option:"#text#"},f_func:null,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:"",f_loading:false,s_tm:null,s_time:200,s_mode:"select",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,hdr_ofs:1,scr_ofs:1},dhx_web:{list_ofs:0,hdr_ofs:1,scr_ofs:0},dhx_terrace:{list_ofs:1,hdr_ofs:1,scr_ofs:1}},col_w:null};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="<input type='text' class='dhxcombo_input' style='width:"+(this.conf.combo_width-24-(this.conf.combo_image?23:0))+"px;"+(this.conf.combo_image?"margin-left:23px;":"")+"' autocomplete='off'><input type='hidden' value=''><input type='hidden' value='false'><div class='dhxcombo_select_button'><div class='dhxcombo_select_img'></div></div>"+(this.conf.combo_image?"<div class='dhxcombo_top_image'>"+this.modes[this.conf.opts_type].getTopImage(null,this.conf.enabled)+"</div>":"");this.cont.appendChild(this.base);this.list=document.createElement("DIV");this.list._listId=window.dhx4.newId();this.list.style.display="none";document.body.insertBefore(this.list,document.body.firstChild);this._doOnListScroll=function(){if(m.conf.s_tm!=null){window.clearTimeout(m.conf.s_tm)}m.conf.s_tm=window.setTimeout(m._doOnListScrollAction,m.conf.s_time)};this._doOnListScrollAction=function(){m.conf.s_tm=null;if(m.conf.s_mode=="scroll"&&m.list.scrollHeight-m.list.scrollTop-10<m.list.clientHeight){m._subloadRequest()}};if(typeof(window.addEventListener)=="function"){this.list.addEventListener("scroll",this._doOnListScroll,false)}else{this.list.attachEvent("onscroll",this._doOnListScroll)}this.setSkin(s||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(A){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 v=0;v<this.conf.f_cache_data[w].data.length;v++){this.load(this.conf.f_cache_data[w].data[v])}if(this.conf.f_dyn){this.conf.f_dyn_end=this.conf.f_cache_data[w].dyn_end;this.conf.f_mask=this.conf.f_cache_data[w].mask}if(A!==true){this._showList(true);this._checkForMatch()}}else{this.conf.f_server_tm=window.setTimeout(function(){m.conf.f_server_last=w.toLowerCase();m.conf.f_mask=w;var q="mask="+encodeURIComponent(w);if(m.conf.f_dyn){q+="&pos=0";m.conf.f_dyn_end=false}var a=function(I){if(m.conf.f_cache){if(!m.conf.f_cache_data[w]){m.conf.f_cache_data[w]={data:[],dyn_end:false,mask:w}}m.conf.f_cache_data[w].data.push(I.xmlDoc.responseXML)}m.clearAll();m.load(I.xmlDoc.responseXML);var H=(m.base.offsetWidth>0&&m.base.offsetHeight>0);if(H==true&&m.conf.enabled==true&&m.conf.combo_focus==true&&A!==true){if(m.conf.f_ac&&m.conf.f_mode=="start"&&m.conf.clear_bsp==false&&m.list.firstChild!=null){var F=m.list.firstChild._optId;var J=String(m.t[F].obj.getText(m.list.firstChild,true));if(w==m.base.firstChild.value&&String(J).toLowerCase().indexOf(String(w).toLowerCase())===0){m.base.firstChild.value=J;m.conf.f_ac_text=J.substr(w.length);m._selectRange(w.length,J.length)}}m._showList(true);m._checkForMatch()}a=null};if(window.dhx4.ajax.method=="post"){window.dhx4.ajax.post(m.conf.f_url,q,a)}else{if(window.dhx4.ajax.method=="get"){window.dhx4.ajax.get(m.conf.f_url+(String(m.conf.f_url).indexOf("?")>=0?"&":"?")+q,a)}}},200)}}else{this.conf.f_server_last=w.toLowerCase();var u=(w.length==0?true:new RegExp((this.conf.f_mode=="start"?"^":"")+String(w).replace(/[\\\^\$\*\+\?\.\(\)\|\{\}\[\]]/gi,"\\$&"),"i"));var x=null;for(var C in this.t){var E=false;if(u!==true){if(this.conf.f_func!=null){var y=this._getOption(this.t[C].item._optId,v);E=(this.conf.f_func.apply(window,[w,y])==true)}else{var D=this.t[C].obj.getText(this.t[C].item,true);E=(u.test(D)==true)}}if(u===true||E==true){this.t[C].item.style.display="";if(x==null&&w.length>0){x=String(this.t[C].obj.getText(this.t[C].item,true))}}else{this.t[C].item.style.display="none"}}if(this.conf.f_ac&&this.conf.f_mode=="start"&&this.conf.clear_bsp==false&&x!=null){this.conf.f_ac_text=x.replace(new RegExp("^"+w,"i"),"");this.base.firstChild.value=x;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(A!==true){this._showList(true);this._checkForMatch()}}};this._searchRO=function(u){if(this.conf.ro_tm){window.clearTimeout(this.conf.ro_tm)}this.conf.ro_text+=u;this._showList();for(var v=0;v<this.list.childNodes.length;v++){var a=this.list.childNodes[v]._optId;var w=String(this.t[a].obj.getText(this.list.childNodes[v],true)).toLowerCase();if(w.indexOf(this.conf.ro_text)===0){this._setSelected(a,true,true);this._confirmSelect("script",false);break}}this.conf.ro_tm=window.setTimeout(function(){m.conf.ro_text=""},this.conf.ro_tm_time)};this._initObj=function(a){if(typeof(a.template)!="undefined"){this.setTemplate(a.template)}if(a.add!=true&&this.conf.f_loading!=true){this.clearAll(false)}this.addOption(a.options)};this._xmlToObj=function(P,x,v){var C={add:false,options:[]};var J=(x==true?P:P.getElementsByTagName("complete"));if(J.length>0){if(window.dhx4.s2b(J[0].getAttribute("add"))==true){C.add=true}var I=J[0].childNodes;for(var F=0;F<I.length;F++){if(typeof(I[F].tagName)!="undefined"){if(String(I[F].tagName).toLowerCase()=="template"){var O={};for(var A=0;A<I[F].childNodes.length;A++){var H=I[F].childNodes[A];if(H.tagName!=null){var K=H.tagName;if(typeof(this.conf.template[K])!="undefined"){O[K]=window.dhx4._xmlNodeValue(H)}if(K=="columns"){for(var M=0;M<H.childNodes.length;M++){var y=H.childNodes[M];if(y.tagName!=null&&y.tagName=="column"){var E={};for(var N in {width:1,css:1,header:1,option:1}){if(y.getAttribute(N)!=null){E[N]=y.getAttribute(N)}}for(var N in {header:1,option:1}){var L=y.getElementsByTagName(N);if(L[0]!=null&&L[0].firstChild!=null){E[N]=window.dhx4._xmlNodeValue(L[0])}}if(O.columns==null){O.columns=[]}O.columns.push(E)}y=null}}}H=null}this.setTemplate(O)}if(String(I[F].tagName).toLowerCase()=="option"){var D=false;if(x==true){D=(C.options.length==v)}else{D=window.dhx4.s2b(I[F].getAttribute("selected"))}var u={value:I[F].getAttribute("value"),text:window.dhx4._xmlNodeValue(I[F]),selected:D,checked:window.dhx4.s2b(I[F].getAttribute("checked"))};for(var N in {img:1,img_dis:1,img_src:1,img_src_dis:1,css:1}){if(I[F].getAttribute(N)!=null){u[N]=I[F].getAttribute(N)}}for(var A=0;A<I[F].childNodes.length;A++){if(I[F].childNodes[A].tagName!=null&&String(I[F].childNodes[A].tagName).toLowerCase()=="text"){u.text={};var H=I[F].childNodes[A];for(var M=0;M<H.childNodes.length;M++){if(H.childNodes[M].tagName!=null){u.text[H.childNodes[M].tagName]=window.dhx4._xmlNodeValue(H.childNodes[M])}}}}C.options.push(u)}}}J=I=null}return C};window.dhx4._enableDataLoading(this,"_initObj","_xmlToObj","complete",{data:true});window.dhx4._eventable(this);this._getNearItem=function(u,q){var a=null;while(u!=null){u=u[q<0?"previousSibling":"nextSibling"];if(a==null&&u!=null&&u.style.display==""&&u._optId!=null){a=u;u=null}}return a};this.setName(this.conf.form_name);this._doOnListMouseMove=function(q){q=q||event;var a=q.target||q.srcElement;while(a!=null&&a!=this){if(typeof(a._optId)!="undefined"){if(m.conf.tm_hover){window.clearTimeout(m.conf.tm_hover)}m._setSelected(a._optId)}a=a.parentNode}a=null};this._doOnListMouseDown=function(a){a=a||event;a.cancelBubble=true;m.conf.clear_click=true;window.setTimeout(function(){m.base.firstChild.focus()},1)};this._doOnListMouseUp=function(u){u=u||event;if(u.button!=m.conf.btn_left){return}var a=u.target||u.srcElement;while(a!=null&&a!=this){if(typeof(a._optId)!="undefined"){var q=true;if(typeof(m.t[a._optId].obj.optionClick)=="function"&&m.t[a._optId].obj.optionClick(a,u,m)!==true){q=false}if(q){m._setSelected(a._optId,null,true);m._confirmSelect("click")}}a=a.parentNode}a=null};this._doOnListMouseOut=function(a){if(m.conf.tm_hover){window.clearTimeout(m.conf.tm_hover)}m.conf.tm_hover=window.setTimeout(function(){var q=m.conf.last_match||m.conf.last_selected;if(m.conf.last_match==null&&m.t[q]!=null){if(m.base.firstChild.value!=m.t[q].obj.getText(m.t[q].item,true)){q=null}}m._setSelected(q,null,true)},1)};this._doOnBaseMouseDown=function(w){if(!m.conf.enabled){return}m.conf.clear_click=true;w=w||event;if(w.button!=m.conf.btn_left){return}var q=w.target||w.srcElement;if(q!=this.firstChild){window.setTimeout(function(){m.base.firstChild.focus()},1);var v=q;while(v!=this&&v!=null){if(v==this.lastChild){if(typeof(m.modes[m.conf.opts_type].topImageClick)=="function"){var u=(m.conf.last_hover||m.conf.last_selected);var a=(u!=null?m.t[u].item:null);if(m.modes[m.conf.opts_type].topImageClick(a,m)!==true){u=a=null;return}}v=null}else{v=v.parentNode}}}if(m._isListVisible()){m._hideList()}else{if(q!=this.firstChild){m.conf.clear_blur=true}m._showList();m._setSelected(m.conf.last_selected,true,true)}q=null};this._doOnBodyMouseDown=function(){if(m.conf.clear_click){m.conf.clear_click=false;return}m._confirmSelect("blur")};this._doOnInputFocus=function(){m.conf.clear_blur=false;if(m.conf.tm_confirm_blur){window.clearTimeout(m.conf.tm_confirm_blur)}if(m.conf.combo_focus==false){m.conf.combo_focus=true;m.callEvent("onFocus",[])}};this._doOnInputBlur=function(){if(m.conf.clear_blur==true){m.conf.clear_blur=false;return}if(m.conf.tm_confirm_blur){window.clearTimeout(m.conf.tm_confirm_blur)}m.conf.tm_confirm_blur=window.setTimeout(function(){if(m.conf.clear_click==false){m._confirmSelect("blur");m.conf.combo_focus=false;m.callEvent("onBlur",[])}},20)};this._doOnInputKeyUp=function(a){a=a||event;if(m.conf.f_mode!=false){m.conf.clear_bsp=(a.keyCode==8||a.keyCode==46);m._filterOpts();return}else{m._checkForMatch()}};this._doOnInputKeyDown=function(a){a=a||event;if((a.keyCode==38||a.keyCode==40)&&!a.ctrlKey&&!a.shiftKey&&!a.altKey){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}a.cancelBubble=true;m._keyOnUpDown(a.keyCode==38?-1:1)}if(a.keyCode==113){if(!m._isListVisible()){m._showList();if(m.base.firstChild.value==m.conf.last_text){m._setSelected(m.conf.last_selected,true,true);m.base.firstChild.value=m.conf.last_text;m.conf.f_server_last=m.base.firstChild.value.toLowerCase()}else{m.conf.f_server_last=m.base.firstChild.value.toLowerCase();if(m.conf.f_mode==false){m._checkForMatch()}}}else{}}if(a.keyCode==27){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}a.cancelBubble=true;m._cancelSelect()}if(a.keyCode==13){if(a.preventDefault){a.preventDefault()}m._confirmSelect("kbd")}if(m.conf.ro_mode==true&&((a.keyCode>=48&&a.keyCode<=57)||(a.keyCode>=65&&a.keyCode<=90))){m._searchRO(String.fromCharCode(a.keyCode).toLowerCase());a.cancelBubble=true}m.conf.clear_key=true;m.callEvent("onKeyPressed",[a.keyCode||a.charCode])};this._doOnInputKeyPress=function(a){if(m.conf.clear_key){m.conf.clear_key=false;return}a=a||event;m.callEvent("onKeyPressed",[a.keyCode||a.charCode])};this._keyOnUpDown=function(a){var q=null;if(this.conf.last_hover){q=this.t[this.conf.last_hover].item}else{if(this.conf.last_selected){q=this.t[this.conf.last_selected].item}}if(!q&&this._getListVisibleCount()==0){return}if(q!=null&&q.style.display!=""){q=null}this._showList();if(q!=null){if(this.t[q._optId].obj.isSelected(q)){q=this._getNearItem(q,a)}}else{q=this.list.firstChild;if(q.style.display!=""){q=this._getNearItem(q,1)}}if(q==null){return}this._setSelected(q._optId,true,true);if(this.conf.f_mode==false){this.base.firstChild.value=this.t[q._optId].obj.getText(q,true)}else{var u=String(this.t[q._optId].obj.getText(q,true));if(this.conf.f_mode=="start"&&this.conf.f_ac==true){if(u.toLowerCase().indexOf(this.conf.f_server_last)===0){this.conf.f_ac_text=u.substring(this.conf.f_server_last.length,u.length);this.base.firstChild.value=u;this._selectRange(this.conf.f_server_last.length,this.base.firstChild.value.length)}else{this.base.firstChild.value=u;this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this._selectRange(0,this.base.firstChild.value.length)}}else{this.base.firstChild.value=u;this.conf.f_server_last=this.base.firstChild.value.toLowerCase()}}q=null};this.conf.evs_nodes=[{node:document.body,evs:{mousedown:"_doOnBodyMouseDown"}},{node:this.base,evs:{mousedown:"_doOnBaseMouseDown"}},{node:this.base.firstChild,evs:{keyup:"_doOnInputKeyUp",keydown:"_doOnInputKeyDown",keypress:"_doOnInputKeyPress",focus:"_doOnInputFocus",blur:"_doOnInputBlur"}},{node:this.list,evs:{mousemove:"_doOnListMouseMove",mousedown:"_doOnListMouseDown",mouseup:"_doOnListMouseUp",mouseout:"_doOnListMouseOut"}}];for(var c=0;c<this.conf.evs_nodes.length;c++){for(var o in this.conf.evs_nodes[c].evs){if(typeof(window.addEventListener)=="function"){this.conf.evs_nodes[c].node.addEventListener(o,this[this.conf.evs_nodes[c].evs[o]],false)}else{this.conf.evs_nodes[c].node.attachEvent("on"+o,this[this.conf.evs_nodes[c].evs[o]])}}}this.unload=function(){this.clearAll();this.t=null;for(var v=0;v<this.conf.evs_nodes.length;v++){for(var u in this.conf.evs_nodes[v].evs){if(typeof(window.addEventListener)=="function"){this.conf.evs_nodes[v].node.removeEventListener(u,this[this.conf.evs_nodes[v].evs[u]],false)}else{this.conf.evs_nodes[v].node.detachEvent("on"+u,this[this.conf.evs_nodes[v].evs[u]])}this.conf.evs_nodes[v].evs[u]=null;delete this.conf.evs_nodes[v].evs[u]}this.conf.evs_nodes[v].node=null;this.conf.evs_nodes[v].evs=null;delete this.conf.evs_nodes[v].node;delete this.conf.evs_nodes[v].evs;this.conf.evs_nodes[v]=null}window.dhx4._eventable(this,"clear");window.dhx4._enableDataLoading(this,null,null,null,"clear");this._mcDetachHeader();this.DOMelem_input=this.DOMelem_button=this.DOMlist=this.DOMelem=this.DOMParent=null;for(var u in this.conf){this.conf[u]=null;delete this.conf[u]}this.conf=null;if(typeof(window.addEventListener)=="function"){this.list.removeEventListener("scroll",this._doOnListScroll,false)}else{this.list.detachEvent("onscroll",this._doOnListScroll)}this.base.parentNode.removeChild(this.base);this.list.parentNode.removeChild(this.list);this.base=this.list=this.cont=null;this.modes=null;for(var u in this){if(typeof(this[u])=="function"){this[u]=null}}m=null};this.DOMelem_input=this.base.firstChild;this.DOMelem_button=this.base.childNodes[this.base.childNodes.length-(this.conf.combo_image?2:1)];this.DOMlist=this.list;this.DOMelem=this.base;this.DOMParent=l;l=null;if(g!=null){if(g.filter!=null){if(typeof(g.filter)=="string"){this.enableFilteringMode(true,g.filter,window.dhx4.s2b(g.filter_cache),window.dhx4.s2b(g.filter_sub_load))}else{this.enableFilteringMode(true)}}if(g.image_path!=null){this.setImagePath(g.image_path)}if(g.default_image!=null||g.default_image_dis!=null){this.setDefaultImage(g.default_image,g.default_image_dis)}if(g.items||g.options){this.addOption(g.items||g.options)}if(g.xml||g.json){this.load(g.xml||g.json)}if(typeof(g.readonly)!="undefined"){this.readonly(g.readonly)}g=null}return this}function dhtmlXComboFromSelect(e){if(typeof(e)=="string"){e=document.getElementById(e)}var c=e.offsetWidth;var q=e.getAttribute("name")||null;var g=document.createElement("SPAN");e.parentNode.insertBefore(g,e);var l=e.getAttribute("mode")||e.getAttribute("opt_type")||"option";var h=new dhtmlXCombo(g,q,c,l);g=null;var n=e.getAttribute("imagePath");if(n){h.setImagePath(n)}var o=e.getAttribute("defaultImage");var m=e.getAttribute("defaultImageDis");if(window.dhx4.s2b(m)==true){m=true}if(o!=null||m!=null){h.setDefaultImage(o,m)}var a=h._xmlToObj([e],true,e.selectedIndex);if(a.options.length>0){h.addOption(a.options)}a=null;e.parentNode.removeChild(e);e=null;return h}dhtmlXCombo.prototype.setName=function(a){this.conf.form_name=a;this.base.childNodes[1].name=a;this.base.childNodes[2].name=a.replace(/(\[.*)?$/,"_new_value$1")};dhtmlXCombo.prototype.readonly=function(a){if(window.dhx4.s2b(a)){this.base.firstChild.setAttribute("readOnly","true");this.conf.ro_mode=true}else{this.base.firstChild.removeAttribute("readOnly");this.conf.ro_mode=false}};dhtmlXCombo.prototype.setPlaceholder=function(a){if(typeof(a)=="undefined"||a==null){a=""}this.base.firstChild.setAttribute("placeholder",String(a))};dhtmlXCombo.prototype.setTemplate=function(e){for(var c in e){if(typeof(this.conf.template[c])!="undefined"){this.conf.template[c]=String(e[c])}}if(e.columns!=null){this._mcMakeTemplate(e.columns)}else{this._mcDetachHeader()}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+(this.hdr!=null?" dhxcombolist_multicolumn":"");if(this.hdr!=null){this.hdr.className="dhxcombolist_"+this.conf.skin+" dhxcombolist_hdr"}};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;c++){a.apply(window,[this._getOption(this.list.childNodes[c]._optId,c)])}};dhtmlXCombo.prototype.setFocus=function(){if(this.conf.enabled){this.base.firstChild.focus()}};dhtmlXCombo.prototype.setFontSize=function(a,c){if(a!=null){this.base.firstChild.style.fontSize=a}if(c!=null){this.list.style.fontSize=c}};dhtmlXCombo.prototype.getOption=function(h){var l=null;var e=null;for(var g=0;g<this.list.childNodes.length;g++){if(l==null){var c=this.list.childNodes[g]._optId;if(this.t[c].obj.getValue(this.t[c].item)==h){l=c;e=g}}}return(l==null?null:this._getOption(l,e))};dhtmlXCombo.prototype.getOptionByIndex=function(a){if(a<0){return null}if(this.list.childNodes[a]==null){return null}return this._getOption(this.list.childNodes[a]._optId,a)};dhtmlXCombo.prototype.getOptionByLabel=function(h){var l=null;var e=null;for(var g=0;g<this.list.childNodes.length;g++){if(l==null){var c=this.list.childNodes[g]._optId;if(this.t[c].obj.getText(this.t[c].item,true)==h){l=c;e=g}}}return(l==null?null:this._getOption(l,e))};dhtmlXCombo.prototype.getSelectedIndex=function(){return this._getOptionProp(this.conf.last_selected,"index",-1)};dhtmlXCombo.prototype.getSelectedText=function(){return this._getOptionProp(this.conf.last_selected,"text","")};dhtmlXCombo.prototype.getSelectedValue=function(){return this._getOptionProp(this.conf.last_selected,"value",null)};dhtmlXCombo.prototype.getActualValue=function(){return this.base.childNodes[1].value};dhtmlXCombo.prototype.getComboText=function(){return this.base.childNodes[0].value};dhtmlXCombo.prototype.getIndexByValue=function(c){var a=this.getOption(c);return(a!=null?a.index:-1)};dhtmlXCombo.prototype.setComboText=function(a){if(this.conf.allow_free_text!=true){return}this.unSelectOption();this.conf.last_text=this.base.firstChild.value=a;this.conf.f_server_last=this.base.firstChild.value.toLowerCase()};dhtmlXCombo.prototype.setComboValue=function(c){var a=this.getOption(c);if(a!=null){this.selectOption(a.index)}else{this.conf.last_value=c;this.base.childNodes[1].value=this.conf.last_value;this.base.childNodes[2].value="true"}};dhtmlXCombo.prototype.selectOption=function(c,e,a){if(c<0||c>=this.list.childNodes.length){return}var g=this.list.childNodes[c]._optId;this._setSelected(g,this._isListVisible(),true);this._confirmSelect("script")};dhtmlXCombo.prototype.unSelectOption=function(){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}this.base.firstChild.value="";if(this.conf.f_mode!=false){this._filterOpts(true)}this._hideList();this._updateTopImage(null);this._confirmSelect("script")};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.setFilterHandler=function(a){if(typeof(a)=="function"){this.conf.f_func=a;this.conf.f_mode=true;this.conf.f_dyn=this.conf.f_cache=this.conf.f_url=null}else{if(typeof(a)=="string"&&typeof(window[a])=="function"){this.conf.f_func=window[a];this.conf.f_mode=true;this.conf.f_dyn=this.conf.f_cache=this.conf.f_url=null}else{this.conf.f_func=null}}};dhtmlXCombo.prototype.enableFilteringMode=function(g,c,a,e){if(g==true||g=="between"){this.conf.f_mode=(g==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(e)}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(e,a){for(var g=0;g<this.list.childNodes.length;g++){var c=e.apply(window,[this._getOption(this.list.childNodes[g]._optId,g)]);this.list.childNodes[g].style.display=(c===true?"":"none")}if(typeof(a)=="undefined"||a==true){this._showList(true)}};dhtmlXCombo.prototype.sort=function(e){var a=[];for(var c=0;c<this.list.childNodes.length;c++){var g=this.list.childNodes[c]._optId;a.push([g,this._getOption(g,c)])}if(e=="asc"||e=="desc"){k=true;a.sort(function(l,h){l=l[1].text_option.toLowerCase();h=h[1].text_option.toLowerCase();var m=(e=="asc"?1:-1);return(l>h?m:-1*m)})}else{if(typeof(e)=="function"||typeof(window[e])=="function"){if(typeof(window[e])=="function"){e=window[e]}a.sort(function(l,h){return e.apply(window,[l[1],h[1]])})}}while(this.list.childNodes.length>0){this.list.removeChild(this.list.lastChild)}for(var c=0;c<a.length;c++){this.list.appendChild(this.t[a[c][0]].item)}};dhtmlXCombo.prototype.enableAutocomplete=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.conf.f_ac=a};dhtmlXCombo.prototype.disableAutocomplete=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.enableAutocomplete(!a)};dhtmlXCombo.prototype.allowFreeText=function(a){this.conf.allow_free_text=(typeof(a)=="undefined"?true:window.dhx4.s2b(a))};dhtmlXCombo.prototype._checkForMatch=function(g){var a=window.dhx4.trim(this.base.firstChild.value).toLowerCase();var h=null;var c=this.list.firstChild;while(c!=null){if(c.style.display==""&&c._optId!=null){var e=window.dhx4.trim(this.t[c._optId].obj.getText(c,true)).toLowerCase();if(a==e){h=c._optId;c=null}}if(c!=null){c=c.nextSibling}}if(this.conf.last_match==null){if(h!=null){this._setSelected(h,true,true);this.conf.last_match=h}else{if(this.conf.f_mode!="between"||g==true){this._setSelected(null,true,true);this.conf.last_match=null}}}else{if(h!=null){if(h!=this.conf.last_match){this._setSelected(h,true,true);this.conf.last_match=h}}else{this._setSelected(null,true,true);this.conf.last_match=null}}};dhtmlXCombo.prototype._selectRange=function(c,a){if(this.conf.combo_focus==true){window.dhx4.selectTextRange(this.base.firstChild,c,a)}};dhtmlXCombo.prototype.openSelect=function(){if(!this._isListVisible()){this._showList()}};dhtmlXCombo.prototype.closeAll=function(){this._hideList()};dhtmlXCombo.prototype._showList=function(a){if(this._getListVisibleCount()==0){if(a&&this._isListVisible()){this._hideList()}return}if(this._isListVisible()){this._checkListHeight();return}this.list.style.zIndex=window.dhx4.zim.reserve(this.conf.list_zi_id);if(this.hdr!=null){this.hdr.style.zIndex=Number(this.list.style.zIndex)+1}this.list.style.visibility="hidden";this.list.style.display="";if(this.hdr!=null){this.hdr.style.visibility=this.list.style.visibility;this.hdr.style.display=this.list.style.display}var c=(this.hdr!=null?this.hdr.offsetHeight:0);this.list.style.width=Math.max(this.conf.opts_width||this.conf.col_w||0,this.conf.combo_width)+"px";this.list.style.top=window.dhx4.absTop(this.base)+c+this.base.offsetHeight-1+"px";this.list.style.left=window.dhx4.absLeft(this.base)+"px";if(this.hdr!=null){this.hdr.style.width=this.list.style.width;this.hdr.style.left=this.list.style.left;this.hdr.style.top=parseInt(this.list.style.top)-c+"px"}this._checkListHeight();this.list.style.visibility="visible";if(this.hdr!=null){this.hdr.style.visibility="visible"}this.callEvent("onOpen",[])};dhtmlXCombo.prototype._hideList=function(){if(!this._isListVisible()){return}window.dhx4.zim.clear(this.conf.list_zi_id);this.list.style.display="none";if(this.hdr!=null){this.hdr.style.display="none"}this.conf.clear_click=false;this.callEvent("onClose",[])};dhtmlXCombo.prototype._isListVisible=function(){return(this.list.style.display=="")};dhtmlXCombo.prototype._getListVisibleCount=function(){var a=0;for(var c=0;c<this.list.childNodes.length;c++){a+=(this.list.childNodes[c].style.display==""?1:0)}return a};dhtmlXCombo.prototype._checkListHeight=function(){if(!this._isListVisible()){return}if(this.conf.item_h==null){var q=this.list.firstChild;while(q!=null){if(q.style.display==""){this.conf.item_h=q.offsetHeight+(this.hdr!=null?-1:0);q=null}else{q=q.nextSibling}}q=null}var r=window.dhx4.screenDim();var m=window.dhx4.absTop(this.base);var c=this.base.offsetHeight;var a=(this.hdr!=null?this.hdr.offsetHeight:0);var e=Math.max(0,Math.floor((m+a-r.top)/this.conf.item_h));var o=Math.max(0,Math.floor((r.bottom-(m+c+a))/this.conf.item_h));var u=this._getListVisibleCount();if(o<Math.min(this.conf.opts_count_min,u)&&e>o){o=null}var n=Math.min((o==null?e:o),this.conf.opts_count,u);var g=(n<u?(n*this.conf.item_h)+"px":"");var l=this.conf.sp[this.conf.skin][this.hdr!=null?"hdr_ofs":"list_ofs"];this.list.style.height=g;this.list.style.top=(o==null?m-this.list.offsetHeight+l:m+c+a-l)+"px";if(this.hdr!=null){this.hdr.style.top=(o==null?m-a-this.list.offsetHeight+l:m+c-l)+"px"}};dhtmlXCombo.prototype._scrollToItem=function(h){var g=this.t[h].item.offsetTop;var e=g+this.t[h].item.offsetHeight;var c=this.list.scrollTop;var a=c+this.list.clientHeight;if(g<c){this.list.scrollTop=g+(this.hdr!=null?1:0)}else{if(e>a){this.list.scrollTop=e-this.list.clientHeight+(this.hdr!=null?-this.conf.sp[this.conf.skin].scr_ofs:0)}}};dhtmlXCombo.prototype._setSelected=function(e,c,a){if(a){this._updateTopImage(e)}if(e!=null&&this.conf.last_hover==e){if(c){this._scrollToItem(e)}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(e==null){this.callEvent("onSelectionChange",[])}}if(e!=null){this.t[e].obj.setSelected(this.t[e].item,true);this.conf.last_hover=e;this.callEvent("onSelectionChange",[]);if(this.conf.s_mode=="select"&&this.t[e].item==this.t[e].item.parentNode.lastChild){this._subloadRequest()}if(c){this._scrollToItem(e)}}};dhtmlXCombo.prototype._subloadRequest=function(){if(this.conf.f_url!=null&&this.conf.f_dyn==true&&this.conf.f_dyn_end==false){var e="mask="+encodeURIComponent(this.conf.f_mask)+"&pos="+this.list.childNodes.length;var a=this;var c=function(h){if(a.conf.f_cache){a.conf.f_cache_data[a.conf.f_mask].data.push(h.xmlDoc.responseXML)}var g=a.list.childNodes.length;a.conf.f_loading=true;a.load(h.xmlDoc.responseXML);a.conf.f_loading=false;if(g==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}}c=a=null};if(window.dhx4.ajax.method=="post"){window.dhx4.ajax.post(this.conf.f_url,e,c)}else{if(window.dhx4.ajax.method=="get"){window.dhx4.ajax.get(this.conf.f_url+(String(this.conf.f_url).indexOf("?")>=0?"&":"?")+e,c)}}}};dhtmlXCombo.prototype.addOption=function(l,m,c,a,g){var e=null;if(!(l instanceof Array)){var n=this._renderOption({value:l,text:m,css:c,img:a});if(e==null&&window.dhx4.s2b(g)==true){e=n}}else{for(var h=0;h<l.length;h++){if(typeof(l[h])=="undefined"){continue}if(l[h] instanceof Array){n=this._renderOption({value:l[h][0],text:l[h][1],css:l[h][2],img:l[h][3]});if(e==null&&window.dhx4.s2b(l[h][4])==true){e=n}}else{var n=this._renderOption(l[h]);if(e==null&&window.dhx4.s2b(l[h].selected)==true){e=n}}}}if(e!=null){this._setSelected(e,this._isListVisible(),true);this._confirmSelect("onInit")}};dhtmlXCombo.prototype.updateOption=function(a,e,c,g){var h=this._getOptionId(a);if(h==null){return}this.t[h].obj.update(this.t[h].item,{value:e,text:c,css:g});if(this.conf.last_selected==h){this.conf.last_text=this.base.firstChild.value=this.t[h].obj.getText(this.t[h].item,true);this.conf.f_server_last=this.base.firstChild.value.toLowerCase()}};dhtmlXCombo.prototype.deleteOption=function(g){for(var c in this.t){var e=this.t[c].obj.getValue(this.t[c].item);if(e==g){this._removeOption(c)}}if(this._isListVisible()){this._showList(true)}};dhtmlXCombo.prototype.clearAll=function(c){c=(typeof(c)=="undefined"?true:window.dhx4.s2b(c));for(var e in this.t){this._removeOption(e)}if(this.conf.tm_hover){window.clearTimeout(this.conf.tm_hover)}this.conf.last_hover=null;this.conf.last_selected=null;this.list.scrollTop=0;if(c==true){this._hideList()}};dhtmlXCombo.prototype._renderOption=function(g){var h=window.dhx4.newId();var e=document.createElement("DIV");e._optId=h;e._tpl=this.conf.template;if(typeof(g.img)=="undefined"&&typeof(g.img_src)!="undefined"){g.img=g.img_src;delete g.img_src}if(typeof(g.img_dis)=="undefined"&&typeof(g.img_src_dis)!="undefined"){g.img_dis=g.img_src_dis;delete g.img_src_dis}g.img_path=this.conf.img_path;g.img_def=this.conf.img_def;g.img_def_dis=this.conf.img_def_dis;this.list.appendChild(e);var c=(this._isListVisible()&&window.dhx4.isFF==true);if(c==true){var a=this.list.scrollTop;this.list.scrollTop-=1}if(this.hdr!=null){g.multicol=true}this.t[e._optId]={obj:this.modes[this.conf.opts_type].render(e,g),item:e,conf:{type:this.conf.opts_type}};e=null;if(c==true){this.list.scrollTop+=1}return h};dhtmlXCombo.prototype._removeOption=function(a){this.t[a].obj.destruct(this.t[a].item);this.t[a].obj=null;this.t[a].item.parentNode.removeChild(this.t[a].item);this.t[a].item=null;this.t[a].conf=null;this.t[a]=null;delete this.t[a];if(this.conf.last_hover==a){this.conf.last_hover=null}if(this.conf.last_selected==a){this.conf.last_selected=null;this._confirmSelect("onDelete")}};dhtmlXCombo.prototype._confirmSelect=function(e,a){var c=false;if(typeof(a)=="undefined"){a=true}if(this.conf.f_server_tm){window.clearTimeout(this.conf.f_server_tm)}if(this.conf.last_hover!=null){c=c||(this.conf.last_value!=this._getOptionValue(this.conf.last_hover));this.conf.last_match=this.conf.last_selected=this.conf.last_hover;this.conf.last_value=this._getOptionValue(this.conf.last_selected);this.conf.last_text=this.base.firstChild.value=this.t[this.conf.last_selected].obj.getText(this.t[this.conf.last_selected].item,true);this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this.base.childNodes[1].value=this.conf.last_value;this.base.childNodes[2].value="false"}else{if(this.conf.allow_free_text||(this.base.firstChild.value==""&&this.conf.allow_empty_value)){c=c||(this.conf.last_text!=this.base.firstChild.value);this.conf.last_match=this.conf.last_value=this.conf.last_selected=null;this.conf.last_text=this.base.firstChild.value;this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this.base.childNodes[1].value=this.conf.last_text;this.base.childNodes[2].value="true"}else{this._cancelSelect();this._updateTopImage(this.conf.last_selected);return}}if(this.conf.f_ac&&this.conf.f_mode=="start"){this.conf.f_ac_text="";if(e!="blur"){this._selectRange(this.base.firstChild.value.length,this.base.firstChild.value.length)}}if(a){this._hideList()}if(c==true&&e!="onInit"&&e!="onDelete"){this.callEvent("onChange",[this.conf.last_value,this.conf.last_text])}};dhtmlXCombo.prototype._cancelSelect=function(){this._hideList();this.base.firstChild.value=this.conf.last_text;if(this.conf.f_mode!=false){this._filterOpts(true)}};dhtmlXCombo.prototype._getOption=function(m,g){if(!this.t[m]){return null}if(typeof(g)=="undefined"){g=-1}if(g<0){for(var l=0;l<this.list.childNodes.length;l++){if(g<0&&this.list.childNodes[l]._optId==m){g=l}}}var h={value:this.t[m].obj.getValue(this.t[m].item),text:this.t[m].obj.getText(this.t[m].item),text_input:this.t[m].obj.getText(this.t[m].item,true),text_option:this.t[m].obj.getText(this.t[m].item,null,true),css:this.t[m].obj.getCss(this.t[m].item),selected:(m==this.conf.last_selected),index:g};if(typeof(this.t[m].obj.getExtraData)=="function"){var e=this.t[m].obj.getExtraData(this.t[m].item);for(var c in e){if(typeof(h[c])=="undefined"){h[c]=e[c]}}}return h};dhtmlXCombo.prototype._getOptionProp=function(g,e,c){if(g!=null){var a=this._getOption(g);if(a!=null){return a[e]}}return c};dhtmlXCombo.prototype._getOptionId=function(c){var g=null;for(var a=0;a<this.list.childNodes.length;a++){if(g==null){var e=this.list.childNodes[a]._optId;if(c==this.t[e].obj.getValue(this.t[e].item)){g=e}}}return g};dhtmlXCombo.prototype._getOptionValue=function(a){return this._getOptionProp(a,"value",null)};dhtmlXCombo.prototype.setSize=function(a){this.conf.combo_width=parseInt(a)-(dhx4.isFF||dhx4.isIE||dhx4.isChrome||dhx4.isOpera?2:0);this.base.style.width=Math.max(0,this.conf.combo_width)+"px";this._adjustBase()};dhtmlXCombo.prototype._adjustBase=function(){this.base.firstChild.style.width=Math.max(0,(this.conf.combo_width-24-(this.conf.combo_image?23:0)))+"px";this.base.firstChild.style.marginLeft=(this.conf.combo_image?"23px":"0px")};dhtmlXCombo.prototype.setOptionWidth=function(a){this.conf.opts_width=(parseInt(a)||null)};dhtmlXCombo.prototype.setOptionIndex=function(e,a){if(isNaN(a)||a<0){return}var g=this.getOption(e);if(g==null){return}if(a==g.index){return}var c=this.list.childNodes[g.index];c.parentNode.removeChild(c);if(this.list.childNodes[a]!=null){this.list.insertBefore(c,this.list.childNodes[a])}else{this.list.appendChild(c)}c=null};dhtmlXCombo.prototype.getOptionsCount=function(){return this.list.childNodes.length};dhtmlXCombo.prototype._mcMakeTemplate=function(o){var l="";var g="";this.conf.col_w=0;for(var m=0;m<o.length;m++){var a=Number(parseInt(o[m].width)||50);var e=(o[m].css||"");var n=(m==0&&window.dhx4.isIE6==true?"_first":"");g+="<div class='dhxcombo_cell"+n+" "+e+"' style='width:"+a+"px;'><div class='dhxcombo_cell_text'>"+(o[m].option||"&nbsp;")+"</div></div>";l+="<div class='dhxcombo_hdrcell"+n+" "+e+"' style='width:"+a+"px;'><div class='dhxcombo_hdrcell_text'>"+(o[m].header||"&nbsp;")+"</div></div>";this.conf.col_w+=a+1}var a=500;var c=document.createElement("DIV");c.style.position="absolute";c.style.top="10px";c.style.left=-a*2+"px";c.style.width=a+"px";c.style.height="50px";c.style.overflowY="scroll";c.innerHTML="<div>&nbsp;</div>";document.body.appendChild(c);this.conf.col_w+=a-c.firstChild.offsetWidth+10;c.parentNode.removeChild(c);c=null;this.conf.template.option=g;this._mcAttachHeader(l);this.list.className+=" dhxcombolist_multicolumn"};dhtmlXCombo.prototype._mcAttachHeader=function(a){if(this.hdr==null){this.hdr=document.createElement("DIV");this.hdr.className="dhxcombolist_"+this.conf.skin+" dhxcombolist_hdr";this.hdr.style.display="none";this.list.parentNode.insertBefore(this.hdr,this.list);if(typeof(window.addEventListener)=="function"){this.hdr.addEventListener("mousedown",this._doOnListMouseDown,false)}else{this.hdr.attachEvent("onmousedown",this._doOnListMouseDown)}if(this.conf.opts_type=="checkbox"&&this.conf.combo_image==true){this.conf.combo_image=false;if(this.base.lastChild.className.match(/dhxcombo_top_image/)!=null){this.base.removeChild(this.base.lastChild)}this._adjustBase()}}this.hdr.innerHTML="<div class='dhxcombo_hdrtext'>"+a+"</div>"};dhtmlXCombo.prototype._mcDetachHeader=function(){if(this.hdr!=null){if(typeof(window.addEventListener)=="function"){this.hdr.removeEventListener("mousedown",this._doOnListMouseDown,false)}else{this.hdr.detachEvent("onmousedown",this._doOnListMouseDown)}this.hdr.parentNode.removeChild(this.hdr);this.hdr=null}this.conf.col_w=null;this.conf.item_h=null};dhtmlXCombo.prototype.modes={};dhtmlXCombo.prototype.doWithItem=function(a,m,h,e){var l=(a>=0&&a<this.list.childNodes.length?this.list.childNodes[a]._optId:null);if(l==null){return null}if(typeof(this.t[l].obj[m])!="function"){return null}var g=[this.t[l].item];for(var c=2;c<arguments.length;c++){g.push(arguments[c])}return this.t[l].obj[m].apply(this.t[l].obj,g)};function dhtmlXComboExtend(g,e){for(var c in dhtmlXCombo.prototype.modes[e]){if(typeof(dhtmlXCombo.prototype.modes[g][c])=="undefined"){dhtmlXCombo.prototype.modes[g][c]=dhtmlXCombo.prototype.modes[e][c]}}}dhtmlXCombo.prototype.modes.option={image:false,option_css:"dhxcombo_option_text",render:function(a,c){a._conf={value:c.value,css:""};a.className="dhxcombo_option";a.innerHTML="<div class='"+this.option_css+"'>&nbsp;</div>";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,e){c._conf.text=e;var a=(typeof(e)=="object"?window.dhx4.template(c._tpl.option,c._conf.text,true):window.dhx4.trim(c._conf.text||""));c.lastChild.innerHTML=(a.length==0?"&nbsp;":a)},getText:function(e,a,c){if(window.dhx4.s2b(a)&&typeof(e._conf.text)=="object"){return window.dhx4.template(e._tpl.input,e._conf.text,true)}if(window.dhx4.s2b(c)&&typeof(e._conf.text)=="object"){return window.dhx4.template(e._tpl.option,e._conf.text,true)}return e._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){if(this.image_css_regexp==null){this.image_css_regexp=new RegExp(this.image_css.replace("#state#","\\d*"))}a._conf={value:c.value,css:"",checked:window.dhx4.s2b(c.checked)};a.className="dhxcombo_option";if(c.multicol==true){c.text.checkbox="<div class='"+String(this.image_css).replace("#state#",(a._conf.checked?"1":"0"))+"'></div>&nbsp;";a.innerHTML="<div class='"+dhtmlXCombo.prototype.modes.option.option_css+"'></div>"}else{a.innerHTML="<div class='"+String(this.image_css).replace("#state#",(a._conf.checked?"1":"0"))+"'></div><div class='"+this.option_css+"'>&nbsp;</div>"}if(c.css!=null){a.lastChild.style.cssText+=c.css;a._conf.css=c.css}this.setText(a,c.text);return this},setChecked:function(c,e){c._conf.checked=window.dhx4.s2b(e);var a=String(this.image_css).replace("#state#",(c._conf.checked?"1":"0"));this._changeChbxCss(c.childNodes,a)},_changeChbxCss:function(a,c){for(var e=0;e<a.length;e++){if(a[e].tagName!=null&&a[e].className!=null&&a[e].className.match(this.image_css_regexp)!=null){a[e].className=c}else{if(a[e].childNodes.length>0){this._changeChbxCss(a[e].childNodes,c)}}}},isChecked:function(a){return(a._conf.checked==true)},getExtraData:function(a){return{type:"checkbox",checked:a._conf.checked}},optionClick:function(h,g,l){var e=true;var c=(g.target||g.srcElement);while(e==true&&c!=null&&c!=h&&c.className!=null){if(c.className.match(this.image_css_regexp)!=null){var a=[h._conf.value,!h._conf.checked];if(l.callEvent("onBeforeCheck",a)===true){this.setChecked(h,!this.isChecked(h));l.callEvent("onCheck",a)}e=false;a=null}else{c=c.parentNode}}c=l=h=null;return e},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){var c=[];for(var e=0;e<this.list.childNodes.length;e++){if(this.isChecked(e)){c.push(this._getOptionProp(this.list.childNodes[e]._optId,"value",""))}}return c};dhtmlXCombo.prototype.isChecked=function(a){return this.doWithItem(a,"isChecked")};dhtmlXCombo.prototype.modes.image={image:true,image_css:"dhxcombo_image",option_css:"dhxcombo_option_text dhxcombo_option_text_image",render:function(a,c){a._conf={value:c.value,css:""};a.className="dhxcombo_option";a.innerHTML="<div class='"+this.image_css+"'></div><div class='"+this.option_css+"'>&nbsp;</div>";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(e,a,h,l,g,c){if(a!=null&&a.length>0){a=l+a}else{if(g!=null&&g.length>0){a=l+g}else{a=null}}if(h!=null&&h.length>0){h=l+h}else{if(c!=null&&c.length>0){h=l+c}else{if(c==true){h=a}else{h=null}}}e._conf.img=a;e._conf.img_dis=h;e.firstChild.style.backgroundImage=(a!=null?"url("+a+")":"none")},getExtraData:function(a){return{type:"image"}},getTopImage:function(g,e){var c=(e?"img":"img_dis");if(g!=null&&g._conf[c]!=null){return"<div class='"+this.image_css+"' style='background-image:url("+g._conf[c]+");'></div>"}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(n){if(!(this instanceof dhtmlXColorPicker)){return new dhtmlXColorPicker(n)}dhx4._eventable(this);var h=this,g=undefined,m=null,e,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:-1,blue:-1,green:-1,hue:-1,sat:-1,lum:-1};this._initMoveSelection=function(l){l=l||event;if(typeof(window.addEventListener)=="function"){h._controllerNodes.colorArea.addEventListener("mousemove",h._setMoveSelection,false);document.body.addEventListener("mouseup",h._cleanMoveSelection,false)}else{h._controllerNodes.colorArea.attachEvent("onmousemove",h._setMoveSelection);document.body.attachEvent("onmouseup",h._cleanMoveSelection)}h._setMoveSelection(l,h._controllerNodes.colorArea);return false};this._cleanMoveSelection=function(){if(typeof(window.removeEventListener)=="function"){h._controllerNodes.colorArea.removeEventListener("mousemove",h._setMoveSelection,false);document.body.removeEventListener("mouseup",h._cleanMoveSelection,false)}else{h._controllerNodes.colorArea.detachEvent("onmousemove",h._setMoveSelection);document.body.detachEvent("onmouseup",h._cleanMoveSelection)}return false};this._setMoveSelection=function(l){l=l||event;var o=h._getOffsetPosition(l,h._controllerNodes.colorArea);if(h._controllerNodes.fr_cover){setTimeout(function(){h._setColorAreaXY(o.x,o.y);h._setColorByXYC()},0)}else{h._setColorAreaXY(o.x,o.y);h._setColorByXYC()}return false};this._initMoveContrast=function(l){l=l||event;if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousemove",h._setMoveContrast,false);document.body.addEventListener("mouseup",h._cleanMoveContrast,false)}else{document.body.attachEvent("onmousemove",h._setMoveContrast);document.body.attachEvent("onmouseup",h._cleanMoveContrast)}h._setMoveContrast(l,h._controllerNodes.contrastArea)};this._cleanMoveContrast=function(){if(typeof(window.removeEventListener)=="function"){document.body.removeEventListener("mousemove",h._setMoveContrast,false);document.body.removeEventListener("mouseup",h._cleanMoveContrast,false)}else{document.body.detachEvent("onmousemove",h._setMoveContrast);document.body.detachEvent("onmouseup",h._cleanMoveContrast)}};this._setMoveContrast=function(l){l=l||event;var o=h._getOffsetPosition(l,h._controllerNodes.contrastArea);h._setContrastY(o.y);h._setColorByXYC(true)};this._doOnSelectColor=function(){var l=h.colorAIP.rgb2hex({r:h.value.red,g:h.value.green,b:h.value.blue});if(h.activeNode!=null){if(h.activeNode.valueCont){h.activeNode.valueCont.value=l}if(h.activeNode.valueColor){h.activeNode.valueColor.style.backgroundColor=l}}if(h.base._dhx_remove||h.conf.hideOnSelect){h.hide()}h.callEvent("onSelect",[l,((h.activeNode)?h.activeNode.node:null)])};this._doOnCancel=function(){if(h.callEvent("onCancel",[((h.activeNode)?h.activeNode.node:null)])==true&&h.conf.closeable==true){h.hide()}};this._doOnFocusByInput=function(){var o=(this!=window)?this:event.srcElement;var l=(h.activeNode&&h.activeNode.valueCont&&h.activeNode.valueCont==o)?h.activeNode:h._getNodeByValueCont(o);h.activeNode=l;if(l&&l==h.activeNode){h._initListenerInput()}};this._doOnBlurByInput=function(){var o=(this!=window)?this:event.srcElement;var l=(h.activeNode&&h.activeNode.valueCont&&h.activeNode.valueCont==o)?h.activeNode:h._getNodeByValueCont(o);if(l&&l==h.activeNode){h._removeListenerInput()}};this._doOnClickByNode=function(o){o=o||event;var l=(this!=window)?this:event.srcElement;h.activeNode=(h.activeNode.node!=l)?h._getNodeByElement(l):h.activeNode;if(!h.isVisible()){h.show()}};this.saveColor=function(){h.memory.setValue(h.value)};this._onSelectMemoryEl=function(o){var l;h._refreshCoordinatesByHSL(o.value.hue,o.value.sat,o.value.lum);for(l in o.value){h.value[l]=o.value[l]}h._refreshContrast();h._refreshInputValues();h._refreshColorValue()};this._doOnClickByBody=function(q){q=q||event;var l=true,o=q.target||q.srcElement;if(h._isBaseNode(o)){l=false}if(l&&h.activeNode&&(h.activeNode.node==o||h.activeNode.valueCont==o)){l=false}if(l){h.hide()}};this._doOnChangeHSL=function(){var q=parseInt(h._controllerNodes.hue.value),o=parseInt(h._controllerNodes.sat.value),l=parseInt(h._controllerNodes.lum.value),r;if(isNaN(q)||q>359||q<0){h._controllerNodes.hue.value=h.value.hue}else{h.value.hue=q}if(isNaN(o)||o>100||o<0){h._controllerNodes.sat.value=h.value.sat}else{h.value.sat=o}if(isNaN(l)||l>100||l<0){h._controllerNodes.lum.value=h.value.lum}else{h.value.lum=l}r=h.colorAIP.hsl2rgb(h.value.hue,h.value.sat/100,h.value.lum/100);h.value.red=Math.round(255*r.r);h.value.green=Math.round(255*r.g);h.value.blue=Math.round(255*r.b);h._refreshCoordinatesByHSL(h.value.hue,h.value.sat,h.value.lum);h._refreshContrast();h._refreshInputValues();h._refreshColorValue()};this._doOnChangeRGB=function(){var r=parseInt(h._controllerNodes.red.value),q=parseInt(h._controllerNodes.green.value),l=parseInt(h._controllerNodes.blue.value),o;if(isNaN(r)||r>255||r<0){h._controllerNodes.red.value=h.value.red}else{h.value.red=r}if(isNaN(q)||q>255||q<0){h._controllerNodes.green.value=h.value.green}else{h.value.green=q}if(isNaN(l)||l>255||l<0){h._controllerNodes.blue.value=h.value.blue}else{h.value.blue=l}o=h.colorAIP.rgb2hsl(h.value.red/255,h.value.green/255,h.value.blue/255);h.value.hue=Math.round(o.h);h.value.sat=Math.round(o.s*100);h.value.lum=Math.round(o.l*100);h._refreshCoordinatesByHSL(h.value.hue,h.value.sat,h.value.lum);h._refreshContrast();h._refreshInputValues();h._refreshColorValue()};this._doOnChangeHSV=function(){h._controllerNodes.hsv.value=h.setColor(h._controllerNodes.hsv.value)};this._checkType=function(o){var l;if(o instanceof Array){l=h._checkType(o[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(o==undefined){return null}else{if(typeof(o)=="string"){return"string"}else{if(o.tagName&&o.tagName.toLowerCase()=="input"){return"input"}else{if(o.tagName&&o.tagName.toLowerCase()=="textarea"){return"textarea"}else{if(o.tagName){return"container"}else{if(typeof(o)=="object"){return"object"}else{return undefined}}}}}}}};this._initByObject=function(l){if(l.parent&&l.parent.tagName){h.base=l.parent}else{if(typeof(l.parent)=="string"){h.base=document.getElementById(l.parent)}else{h.base=document.createElement("div");h.base._dhx_remove=true}}if(l.color){h.conf.selectedColor=l.color}if(typeof(l.closeable)!="undefined"){this.conf.closeable=dhx4.s2b(l.closeable)}if(l.custom_colors){this._tempInitCC=function(){var r,q;this.initMemoryColors();this.conf.customColors=true;if(l.custom_colors instanceof Array){q=l.custom_colors.length;for(r=0;r<q;r++){this.setCustomColors(l.custom_colors[r])}}if(this.base.parentNode){this.showMemory()}delete this._tempInitCC}}if(l.hide){h.conf.hide=true}if(l.input){h._addNode(l.input,l.target_color,l.target_value)}var o=l.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxcolorpicker")||"dhx_skyblue";h.setSkin(o);if(l.colors){h.initMemoryColors();h.conf.customColors=true}if(l.link){h._addNode(l.link)}};this.unload=function(){var r,o,q;if(this.isVisible()){this.hide()}this.destructMemory();o=this._nodes.length;for(r=0;r<o;r++){this._detachEventsFromNode(this._nodes[r]);for(q in this._nodes[r]){this._nodes[r][q]=null}delete this._nodes[r]}this._nodes=null;if(!this.base._dhx_remove){this.base.className=this.base.className.replace(/\s?dhtmlxcp_\S*/,"")}else{delete this.base._dhx_remove}if(typeof(window.addEventListener)=="function"){this._controllerNodes.colorArea.removeEventListener("mousedown",this._initMoveSelection,false);this._controllerNodes.colorArea.removeEventListener("dblclick",this._doOnSelectColor,false);this._controllerNodes.contrastArea.removeEventListener("mousedown",this._initMoveContrast,false);this._controllerNodes.button_save.removeEventListener("click",this._doOnSelectColor,false);this._controllerNodes.button_cancel.removeEventListener("click",this._doOnCancel,false);this._controllerNodes.hue.removeEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.sat.removeEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.lum.removeEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.red.removeEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.green.removeEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.blue.removeEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.hsv.removeEventListener("change",this._doOnChangeHSV,false)}else{this._controllerNodes.colorArea.detachEvent("onmousedown",this._initMoveSelection);this._controllerNodes.colorArea.detachEvent("ondblclick",this._doOnSelectColor);this._controllerNodes.contrastArea.detachEvent("onmousedown",this._initMoveContrast);this._controllerNodes.button_save.detachEvent("onclick",this._doOnSelectColor);this._controllerNodes.button_cancel.detachEvent("onclick",this._doOnCancel);this._controllerNodes.hue.detachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.sat.detachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.lum.detachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.red.detachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.green.detachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.blue.detachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.hsv.detachEvent("onchange",this._doOnChangeHSV)}if(this._controllerNodes.fr_cover){if(this._controllerNodes.fr_cover.parentNode){this._controllerNodes.fr_cover.parentNode.removeChild(this._controllerNodes.fr_cover)}delete this._controllerNodes.fr_cover}dhx4.zim.clear(this.conf.cp_id);dhx4._eventable(this,"clear");for(q in this){this[q]=null}h=null,m=null,c=null};g=this._checkType(n);switch(g){case"object":h._initByObject(n);break;case"input":case"textarea":h._initByObject({});this._addNode(n);break;case"string":m=document.getElementById(n);return new dhtmlXColorPicker(m);break;case"container":h._initByObject({parent:n});break;case null:h._initByObject({});break;case"array_string":case"array_input":h._initByObject({});a=n.length;for(e=0;e<a;e++){this._addNode(n[e])}break;case"array_object":h._initByObject({});a=n.length;for(e=0;e<a;e++){c=this._addNode(n[e].input,n[e].target_color,n[e].target_value).conf;c.customColors=(n[e].custom_colors!=undefined)?dhx4.s2b(n[e].custom_colors):c.customColors;c.selectedColor=(n[e].color!=undefined)?n[e].color:c.selectedColor}break}this.base.innerHTML="<div class='dhxcp_g_area'><div class='dhxcp_sub_area'><div class='dhxcp_g_color_area'><div class='dhxcp_color_selector'><div class='dhxcp_v_line'></div><div class='dhxcp_h_line'></div></div><div class='dhxcp_contrast_area'><div class='dhxcp_h_line'></div></div></div><div class='dhxcp_g_input_area'><div class='dhxcp_value_cont'><div class='dhxcp_value_color'></div><input type='text' class='dhxcp_value'/></div><table class='dhxcp_inputs_cont' cellpadding='0' cellspacing='0' border='0'><tr><td class='dhxcp_label_hsl'>"+this.i18n[this.conf.lang].labelHue+"</td><td class='dhxcp_input_hsl'><input type='text' class='dhxcp_input_hsl'/></td><td class='dhxcp_label_rgb'>"+this.i18n[this.conf.lang].labelRed+"</td><td class='dhxcp_input_rgb'><input type='text' class='dhxcp_input_rgb'/></td></tr><tr><td class='dhxcp_label_hsl'>"+this.i18n[this.conf.lang].labelSat+"</td><td class='dhxcp_input_hsl'><input type='text' class='dhxcp_input_hsl'/></td><td class='dhxcp_label_rgb'>"+this.i18n[this.conf.lang].labelGreen+"</td><td class='dhxcp_input_rgb'><input type='text' class='dhxcp_input_rgb'/></td></tr><tr><td class='dhxcp_label_hsl'>"+this.i18n[this.conf.lang].labelLum+"</td><td class='dhxcp_input_hsl'><input type='text' class='dhxcp_input_hsl'/></td><td class='dhxcp_label_rgb'>"+this.i18n[this.conf.lang].labelBlue+"</td><td class='dhxcp_input_rgb'><input type='text' class='dhxcp_input_rgb'/></td></tr></table></div><div class='dhxcp_g_memory_area'></div><div class='dhxcp_buttons_area'><button class='dhx_button_save'>"+this.i18n[this.conf.lang].btnSelect+"</button><button class='dhx_button_cancel'>"+this.i18n[this.conf.lang].btnCancel+"</button></div></div>";"</div>";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)}this.setColor(this.conf.selectedColor||"#ffffff");if(this._nodes.length){for(var e=0;e<this._nodes.length;e++){this._attachEventsToNode(this._nodes[e])}}if(this.conf.hide){this.hide()}if(typeof(this._cpInitFRM)=="function"){this._cpInitFRM()}}dhtmlXColorPicker.prototype.linkTo=function(c,e,g){if(arguments.length==1){e=g=c}var a;c=c||null;g=g||null;if(typeof(e)=="string"){e=document.getElementById(e)}a=this._addNode(e,c,g);if(a){this._attachEventsToNode(a)}return a};dhtmlXColorPicker.prototype._isBaseNode=function(a){if(a==this.base){return true}if(a.parentElement==document.body){return false}else{if(!a.parentElement){return false}else{return this._isBaseNode(a.parentElement)}}};dhtmlXColorPicker.prototype._hasInput=function(e){var c,a,g=false;a=this._nodes.length;for(c=0;c<a;c++){if(this._nodes[c].valueCont==e){g=true;break}}return g};dhtmlXColorPicker.prototype._findNodesByArray=function(h){var e,a,c,g=[];a=h.length;for(e=0;e<a;e++){if(typeof(h[e])=="string"){c=document.getElementById(h[e])}else{c=h[e]}if(c){this._addNode(c)}}};dhtmlXColorPicker.prototype._addNode=function(h,m,l){var c,g,e,a;if(typeof(h)=="string"){c=document.getElementById(h)}else{c=h}if(typeof(m)=="string"){m=document.getElementById(m)}if(typeof(l)=="string"){l=document.getElementById(l)}if(!c){return null}if(dhx4.s2b(c.getAttribute("colorbox"))){g=document.createElement("div");g.style.width=c.offsetWidth+"px";g.style.height=c.offsetHeight+"px";c.style.width=c.offsetWidth-(c.offsetHeight+8)+"px";c.parentNode.insertBefore(g,c);g.style.position="relative";e=document.createElement("div");g.appendChild(c);g.appendChild(e);e.className="dhxcp_colorBox";c.className+=" dhxcp_colorInput";e.style.width=e.style.height=c.offsetHeight+"px"}a={node:c,valueColor:(m!=undefined)?m:e||c,valueCont:(l!=undefined)?l:c,conf:{customColors:(c.getAttribute("customcolors")!=null)?dhx4.s2b(c.getAttribute("customcolors")):null,selectedColor:c.getAttribute("selectedcolor")}};this._nodes.push(a);if(!this.activeNode){this.activeNode=a}return a};dhtmlXColorPicker.prototype.getNode=function(e){var a=null,c=null;if(typeof(e)=="string"){a=document.getElementById(e)}else{a=e}if(a.tagName!=undefined){c=this._getNodeByElement(a)}return c};dhtmlXColorPicker.prototype._getNodeByElement=function(e){var g=null,c,a;a=this._nodes.length;for(c=0;c<a;c++){if(this._nodes[c].node==e){g=this._nodes[c]}}return g};dhtmlXColorPicker.prototype._getNodeByValueCont=function(e){var g=null,c,a;a=this._nodes.length;for(c=0;c<a;c++){if(this._nodes[c].valueCont&&this._nodes[c].valueCont==e){g=this._nodes[c]}}return g};dhtmlXColorPicker.prototype.initMemoryColors=function(){var c=this;this._controllerNodes.memory_block.innerHTML="<div class='dhxcp_memory_button_cont'><button class='dhxcp_save_to_memory'><div class='dhxcp_label_bm'>"+this.i18n[this.conf.lang].btnAddColor+"</div></button></div><div class='dhxcp_memory_els_cont'><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a><a class='dhxcp_memory_el'></a></div>";this.memory=new this.Memory(this._controllerNodes.memory_block.childNodes[1]);this.memory.onSelect=this._onSelectMemoryEl;this.memory.onSave=function(g){var e=c.colorAIP.rgb2hex({r:g.red,g:g.green,b:g.blue});c.callEvent("onSaveColor",[e])};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(n,m,c){var a,g,e;a=Math.round((this.configColorArea.maxX-this.configColorArea.minX)*n/359)+this.configColorArea.minX;g=Math.round((this.configColorArea.maxY-this.configColorArea.minY)*(100-c)/100)+this.configColorArea.minY;e=Math.round((this.configColorArea.maxY-this.configColorArea.minY)*(100-m)/100)+this.configColorArea.minY;this._setColorAreaXY(a,g);this._setContrastY(e)};dhtmlXColorPicker.prototype._parseColor=function(e){if(e instanceof Array){var c={r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}else{if(typeof(e)=="string"){e=e.replace(/\s/g,"");if(/^rgb\((\d{1,3})\,(\d{1,3})\,(\d{1,3})\)$/i.test(e)){var a=e.match(/^rgb\((\d{1,3})\,(\d{1,3})\,(\d{1,3})\)$/i);var c={r:parseInt(a[1]),g:parseInt(a[2]),b:parseInt(a[3])}}else{var c=this.colorAIP.hex2rgb(e)}}}return c};dhtmlXColorPicker.prototype.setColor=function(l){var c=this.colorAIP.rgb2hex({r:this.value.red,g:this.value.green,b:this.value.blue});var e=this._parseColor(l);var h=(e instanceof Object);h=h&&(0<=e.r&&e.r<=255);h=h&&(0<=e.g&&e.g<=255);h=h&&(0<=e.b&&e.b<=255);if(!h){return c}var g=this.colorAIP.rgb2hex({r:e.r,g:e.g,b:e.b});if(g==c){return c}this.value.red=e.r;this.value.green=e.g;this.value.blue=e.b;var a=this.colorAIP.rgb2hsl(e.r/255,e.g/255,e.b/255);this.value.hue=Math.round(a.h);this.value.sat=Math.round(a.s*100);this.value.lum=Math.round(a.l*100);this._refreshCoordinatesByHSL(this.value.hue,this.value.sat,this.value.lum);this._refreshContrast();this._refreshInputValues();this._refreshColorValue();return g};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);this.base.style.visibility="hidden";if(document.body.firstChild){document.body.insertBefore(this.base,document.body.firstChild)}else{document.body.appendChild(this.base)}this._refreshPosition();this.base.style.visibility="visible";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,h){var g=null;var a=parseInt(c);var e=parseInt(h);if(isNaN(a)){g=({right:"right",bottom:"bottom"}[c.toLowerCase()]?c:null)}if(this.base._dhx_remove){if(g==null){}else{this.conf.position=g;this._refreshPosition(g)}}else{if(isNaN(a)||isNaN(e)){}else{this._globalNode.style.left=a+"px";this._globalNode.style.top=e+"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 n=dhx4.absTop(this.activeNode.node);var a=dhx4.absLeft(this.activeNode.node);var g=dhx4.screenDim();var e=this._globalNode.offsetWidth;var h=this._globalNode.offsetHeight;var m=0;c=c||this.conf.position;switch(c){case"bottom":var m=n+this.activeNode.node.offsetHeight+this.conf.indent;var l=a;if(l+e>g.left+g.right){l=a+this.activeNode.node.offsetWidth-e}if(l<g.left){l=a}if(m+h>g.top+g.bottom){m=n-h-this.conf.indent}if(m-g.top<0){m=g.top+this.conf.indent}this._globalNode.style.top=m+"px";this._globalNode.style.left=l+"px";break;default:var l=a+this.activeNode.node.offsetWidth+this.conf.indent;m=n;if(c=="right"){if(l+e>g.left+g.right){l=a-e-this.conf.indent}if(l<g.left){l=a+this.activeNode.node.offsetWidth+this.conf.indent}}if(g.bottom-(m+h)<=0){m=n+this.activeNode.node.offsetHeight-h}if(m-g.top<0){m=g.top+this.conf.indent}this._globalNode.style.left=l+"px";this._globalNode.style.top=m+"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,e){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}}}e=parseInt(e);if(c.minY>e){this.conf.y=c.minY}else{if(e>c.maxY){this.conf.y=c.maxY}else{if(!isNaN(e)){this.conf.y=e}}}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 g=this.colorAIP.hsl2rgb(this.value.hue,0,this.value.lum/100);var h=this.colorAIP.hsl2rgb(this.value.hue,1,this.value.lum/100);var e=this._checkIeVersion();if(e&&e<=9){var l=this._controllerNodes.contrastArea.firstChild;if(l==this._controllerNodes.contrast_line){l=document.createElement("div");l.className+="dhxcp_ie_gradient";this._controllerNodes.contrastArea.appendChild(l);this._controllerNodes.contrastArea.appendChild(this._controllerNodes.contrast_line)}var c=this.colorAIP.rgb2hex({r:Math.round(255*g.r),g:Math.round(255*g.g),b:Math.round(255*g.b)});var a=this.colorAIP.rgb2hex({r:Math.round(255*h.r),g:Math.round(255*h.g),b:Math.round(255*h.b)});l.style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr='"+a+"', endColorstr='"+c+"', GradientType=0)"}else{g=[Math.round(255*g.r),Math.round(255*g.g),Math.round(255*g.b)];h=[Math.round(255*h.r),Math.round(255*h.g),Math.round(255*h.b)];this._controllerNodes.contrastArea.style.backgroundImage="linear-gradient(to top, rgb("+g.join(",")+"), rgb("+h.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(h){var e=parseInt(h.r),c=parseInt(h.g),a=parseInt(h.b);e=e||0,c=c||0,a=a||0;return"#"+((e)?((e<16)?"0"+e.toString(16):e.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(o,n,e){var m,l,c;var a=Math.max(o,n,e),h=Math.min(o,n,e);c=0.5*(a+h);if(a==h){m=0}else{if(a==o){m=60*(n-e)/(a-h);if(n<e){m+=360}}else{if(a==n){m=60*(e-o)/(a-h)+120}else{m=60*(o-n)/(a-h)+240}}}if(c==0||a==h){l=0}else{if(c<=0.5){l=0.5*(a-h)/c}else{l=0.5*(a-h)/(1-c)}}return{h:m,s:l,l:c}},hsl2rgb:function(o,e,m){var h,l,n;var c=[],a=[];if(m<=0.5){h=m*(1+e)}else{h=m+e-(m*e)}l=2*m-h;n=o/360;c.push(n+1/3);c.push(n);c.push(n-1/3);for(var g=0;g<3;g++){if(c[g]<0){c[g]+=1}else{if(c[g]>1){c[g]-=1}}if(c[g]<1/6){a.push(l+(h-l)*6*c[g])}else{if(c[g]<0.5){a.push(h)}else{if(c[g]<2/3){a.push(l+(h-l)*(2/3-c[g])*6)}else{a.push(l)}}}}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 g,e,m,c,h,a;e=arguments.length;for(g=0;g<e;g++){if(arguments[g] instanceof Array){m=this._rgb2value(arguments[g][0],arguments[g][1],arguments[g][2]);this.memory.setValue(m,null,false);continue}else{if(typeof(arguments[g])=="string"){c=arguments[g].match(/^rgb\((\d{1,3})\,(\d{1,3})\,(\d{1,3})\)$/i);if(c instanceof Array){m=this._rgb2value(c[1],c[2],c[3]);this.memory.setValue(m,null,false);continue}c=arguments[g].match(/(#[\da-f]{6})/ig);if(c instanceof Array){a=c.length;for(h=0;h<a;h++){m=this._hex2value(c[h]);this.memory.setValue(m,null,false)}}}}}};dhtmlXColorPicker.prototype.getCustomColors=function(){var c=[];if(this.memory!=null&&this.conf.customColors==true){for(var e=0;e<this.memory.controllers.length;e++){var a=this.memory.controllers[e].value;c.push(this.colorAIP.rgb2hex({r:a.red,g:a.green,b:a.blue}))}}return c};dhtmlXColorPicker.prototype._rgb2value=function(h,e,a){var c=this.colorAIP.rgb2hsl(h/255,e/255,a/255);return{red:h,green:e,blue:a,hue:Math.round(c.h),sat:Math.round(c.s*100),lum:Math.round(c.l*100)}};dhtmlXColorPicker.prototype._hex2value=function(e){var c,a;c=this.colorAIP.hex2rgb(e);a=this.colorAIP.rgb2hsl(c.r/255,c.g/255,c.b/255);return{red:c.r,green:c.g,blue:c.b,hue:Math.round(a.h),sat:Math.round(a.s*100),lum:Math.round(a.l*100)}};dhtmlXColorPicker.prototype.showMemory=function(){if(this.memory==null){this.initMemoryColors()}if(!this._globalNode.className.match(/dhxcp_add_memory/)){this._globalNode.className+=" dhxcp_add_memory"}this.conf.customColors=true};dhtmlXColorPicker.prototype.hideMemory=function(){if(this.memory!=null){this._globalNode.className=this._globalNode.className.replace(/\sdhxcp_add_memory/,"")}this.conf.customColors=false};dhtmlXColorPicker.prototype.setSkin=function(h){h=h.toLowerCase();var e,c=-1,a,g="dhtmlxcp";e=this.base.className.match(/\S\w+/ig);if(e instanceof Array){for(a in this._skinCollection){if(c==-1){c=this._indexOf(e,g+"_"+a)}else{break}}c=(c==-1)?e.length:c}else{e=[];c=0}e[c]=g+"_"+h;this.base.className=e.join(" ");this.skin=h};dhtmlXColorPicker.prototype.hideOnSelect=function(a){a=dhx4.s2b(a);this.conf.hideOnSelect=a};dhtmlXColorPicker.prototype._indexOf=function(a,g){var e,c,h=-1;c=a.length;for(e=c;e>=0;e--){if(a[e]==g){h=e;break}}return h};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(e){var c=this,a=null,g={red:255,blue:255,green:255,hue:0,sat:0,lum:100};this.select=function(){var l=(this!=window)?this:event.srcElement;var h=h||l.dhxpc_memory;if(a!=null){c.unSelect()}a=h;h.domElement.className+=" dhxcp_memory_el_select";if(typeof(c.onSelect)=="function"){c.onSelect(h)}};this.onSelect=null;this.onSave=null;this._createMemoryController=function(h){var l={domElement:h,value:dhx4._copyObj(g)};h.dhxpc_memory=l;if(typeof(window.addEventListener)=="function"){h.addEventListener("click",c.select,false)}else{h.attachEvent("onclick",c.select)}return l};this._findMemoryControllers=function(q){var n=q.getElementsByTagName("a"),m,h,o=[];h=n.length;for(m=0;m<h;m++){o.push(this._createMemoryController(n[m]))}return o};this.controllers=this._findMemoryControllers(e);this.unSelect=function(){if(a){a.domElement.className=a.domElement.className.replace(/\s.*$/i,"")}a=null};this.setActiveNext=function(){var m=null,h;if(a==null){a=this.controllers[0]}else{m=this.getIndex(a);h=this.controllers.length;this.unSelect();a=(m+1<h)?this.controllers[m+1]:this.controllers[0]}a.domElement.className+=" dhxcp_memory_el_next";return a};this.setValue=function(l,h,m){a=h||a;if(a==null){a=this.controllers[0]}a.value.red=l.red;a.value.blue=l.blue;a.value.green=l.green;a.value.hue=l.hue;a.value.sat=l.sat;a.value.lum=l.lum;a.domElement.style.backgroundColor="rgb("+[l.red,l.green,l.blue].join(", ")+")";this.setActiveNext();if((m!=false)&&(typeof(this.onSave)=="function")){this.onSave(l)}};this.clean=function(){var h=this.controllers.length,n;for(var m=0;m<h;m++){n=this.controllers[m];n.value=dhx4._copyObj(g);n.domElement.style.backgroundColor="rgb("+[g.red,g.green,g.blue].join(", ")+")"}this.unSelect();a=this.controllers[0]};this.getIndex=function(n){var m,h,o=-1;h=this.controllers.length;for(m=0;m<h;m++){if(this.controllers[m]==n){o=m;break}}return o};this.remove=function(){var m,h;h=this.controllers.length;for(m=0;m<h;m++){if(typeof(window.addEventListener)=="function"){this.controllers[m].domElement.removeEventListener("click",this.select,false)}else{this.controllers[m].domElement.detachEvent("onclick",this.select)}delete this.controllers[m].domElement.dhxpc_memory}delete this.onSelect;delete this.controllers;delete this.onSave}};if(window.dhx4.isIE6){dhtmlXColorPicker.prototype._cpInitFRM=function(){var a;if(!this._controllerNodes.fr_cover){a=document.createElement("IFRAME");a.className="dhxcp_frm";a.border=0;a.frameBorder=0;this._controllerNodes.fr_cover=a}if(!this.base._dhx_remove){this.base.insertBefore(a,this._globalNode)}}}function dhtmlXSlider(c){var a=this;this.conf={size:null,skin:null,vertical:false,min:0,max:99,value:0,step:1,decimals:0,margin:2,border:1,inverse:false,disabled:false,tooltip:false,visible:true,linkTo:null,range:false,bg:null,bg_mode:"left"};this._attachedNode={};this._movingInitialValues=null;this.base=null;if(arguments.length>1){return new dhtmlXSlider(this._renderArgumets(arguments))}else{if(typeof(c)=="string"||(typeof(c)=="object"&&c.tagName)){return new dhtmlXSlider({parent:c})}}if(typeof(c.parent)=="string"){this.base=document.getElementById(c.parent)}else{this.base=c.parent}this._mergeConfig(this._readAttFormNode(this.base));this._mergeConfig(c);if(this.conf.bg==null){this.conf.bg=(this.conf.range==true)}if(this.conf.range==true){if(!(this.conf.value instanceof Array)){this.conf.value=[this.conf.value]}if(this.conf.value.length<2){this.conf.value.push(this.conf.value[0])}if(!(this.conf.linkTo instanceof Array)){this.conf.linkTo=[this.conf.linkTo]}}this._detectDecimals();if(this.conf.size==null||typeof(this.conf.size)=="undefined"){if(this.conf.vertical){this.conf.size=this.base.offsetHeight}else{this.conf.size=this.base.offsetWidth}}var e=this.conf.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxslider")||"dhx_skyblue";this.setSkin(e);this.base.innerHTML="<div class='dhxsl_container'><div class='dhxsl_track'>"+(this.conf.bg==true?"<div class='dhxsl_track_bg'></div>":"")+"</div><div class='dhxsl_runner'></div>"+(this.conf.range==true?"<div class='dhxsl_runner'></div>":"")+"</div>";this._nodes={cont:this.base.firstChild,track:this.base.firstChild.firstChild,runner:this.base.firstChild.childNodes[1],runner2:this.base.firstChild.childNodes[2]};this._nodes.cont.onmousedown=this._nodes.track.onmousedown=this._nodes.cont.onselectstart=this._nodes.track.onselectstart=function(g){g=g||event;if(typeof(g.preventDefault)=="function"){g.preventDefault()}else{g.returnValue=false}return false};this._r_actv=null;if(this.conf.range==true){this.conf.value=this._normalizeRange(this.conf.value,this.conf.min,this.conf.max)}else{this.conf.value=this._normalize(this.conf.value,this.conf.min,this.conf.max)}this._setOrient(this.conf.vertical);this.setSize(this.conf.size);this._initMover=function(l,g){if(a.conf.disabled){return}l=l||event;if(typeof(l.preventDefault)=="function"){l.preventDefault()}if(g!=null){a._r_actv=a._nodes[g==0?"runner":"runner2"]}else{a._r_actv=l.target||l.srcElement;if(a._r_actv.className.indexOf("dhxsl_runner")==-1){a._r_actv=a._nodes.runner}}a._r_actv.className="dhxsl_runner dhxsl_runner_actv";var h=(l.type=="mousedown"?"client":"page")+(a.conf.vertical?"Y":"X");a._movingInitialValues={};if(a.conf.range==true){a._movingInitialValues.index=(a._r_actv==a._nodes.runner?0:1);a._movingInitialValues.value=a.conf.value[a._movingInitialValues.index]}else{a._movingInitialValues.value=a.conf.value}a._movingInitialValues.coord=(typeof(l[h])!="undefined"?l[h]:l.touches[0][h]);if(a.conf.disabled==false){if(typeof(window.addEventListener)=="function"){window.addEventListener("mousemove",a._move,false);window.addEventListener("mouseup",a._cleanMove,false);window.addEventListener("touchmove",a._move,false);window.addEventListener("touchend",a._cleanMove,false)}else{document.body.attachEvent("onmousemove",a._move);document.body.attachEvent("onmouseup",a._cleanMove)}}a.callEvent("onMouseDown",[a._r_actv==a._nodes.runner?0:1]);return false};this._move=function(q){if(a.conf.disabled){return}q=q||event;if(typeof(q.preventDefault)=="function"){q.preventDefault()}var n=(q.type=="mousemove"?"client":"page")+(a.conf.vertical?"Y":"X");var o=(a.conf.vertical)?a._r_actv.offsetHeight:a._r_actv.offsetWidth;var l=a.conf.max-a.conf.min;var h=(typeof(q[n])!="undefined"?q[n]:q.touches[0][n]);var m=a._movingInitialValues.value+(h-a._movingInitialValues.coord)*l/(a.conf.size-o)*(a.conf.inverse?-1:1);if(a.conf.range==true){var g=[a.conf.value[0],a.conf.value[1]];if(a._movingInitialValues.index==0){g[0]=Math.min(g[1],m)}else{if(a._movingInitialValues.index==1){g[1]=Math.max(g[0],m)}}a.setValue(g,true)}else{a.setValue(m,true)}};this._cleanMove=function(g){if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",a._move,false);window.removeEventListener("mouseup",a._cleanMove,false);window.removeEventListener("touchmove",a._move,false);window.removeEventListener("touchend",a._cleanMove,false)}else{document.body.detachEvent("onmousemove",a._move);document.body.detachEvent("onmouseup",a._cleanMove)}a._movingInitialValues=null;a._r_actv.className=a._r_actv.className.replace(/\s{0,}dhxsl_runner_actv/gi,"");a.callEvent("onSlideEnd",[a.conf.value]);a.callEvent("onMouseUp",[a._r_actv==a._nodes.runner?0:1]);a._r_actv=null};this._doOnSetValue=function(r){if(a.conf.disabled){return}if(a._movingInitialValues!=null){return false}r=r||event;if(typeof(r.preventDefault)=="function"){r.preventDefault()}var q=0;var m=r.target||r.srcElement;if(m.className.match(/dhxsl_track_bg/)!=null){q=parseInt(m.style[a.conf.vertical?"top":"left"])}var o=(a.conf.vertical?(r.offsetY||r.layerY):(r.offsetX||r.layerX))+q;var n=(a.conf.vertical?a._nodes.runner.offsetHeight:a._nodes.runner.offsetWidth)+q;var g=a.conf.max-a.conf.min;var h=null;var l=null;if(a.conf.inverse==true){l=a.conf.max-(o*g/(a.conf.size))}else{l=(o*g/(a.conf.size)+a.conf.min)}if(a.conf.range==true){h=(Math.abs(a.conf.value[0]-l)<=Math.abs(a.conf.value[1]-l)?0:1);l=[h==0?l:a.conf.value[0],h==1?l:a.conf.value[1]]}a.conf.init_index=h;a.setValue(l,true);a.conf.init_index=null;if(a._movingInitialValues==null){a._initMover(r,h)}return false};this._doOnChangeInput=function(h){h=h||event;var g=h.target||h.srcElement;a.setValue(g.value)};this._doOnKeyDown=function(h){h=h||event;var g=h.target||h.srcElement;if(h.keyCode==13){a.setValue(g.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(this._nodes.runner2){delete this._nodes.runner2}if(/\s?dhtmlxslider_\S*/.test(this.base.className)){this.base.className=this.base.className.replace(/\s?dhtmlxslider_\S*/,"")}for(var g in this){this[g]=null}a=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.runner.addEventListener("touchstart",this._initMover,false);a.cont.addEventListener("mousedown",this._doOnSetValue,false);a.cont.addEventListener("touchstart",this._doOnSetValue,false);if(a.runner2){a.runner2.addEventListener("mousedown",this._initMover,false);a.runner2.addEventListener("touchstart",this._initMover,false)}}else{a.runner.attachEvent("onmousedown",this._initMover);a.cont.attachEvent("onmousedown",this._doOnSetValue);if(a.runner2){a.runner2.attachEvent("onmousedown",this._initMover)}}};dhtmlXSlider.prototype._detachEvents=function(a){if(typeof(window.addEventListener)=="function"){a.runner.removeEventListener("mousedown",this._initMover,false);a.runner.removeEventListener("touchstart",this._initMover,false);a.cont.removeEventListener("mousedown",this._doOnSetValue,false);a.cont.removeEventListener("touchstart",this._doOnSetValue,false);if(a.runner2){a.runner2.removeEventListener("mousedown",this._initMover,false);a.runner2.removeEventListener("touchstart",this._initMover,false)}}else{a.runner.detachEvent("onmousedown",this._initMover);a.cont.detachEvent("onmousedown",this._doOnSetValue);if(a.runner2){a.runner2.detachEvent("onmousedown",this._initMover)}}};dhtmlXSlider.prototype._mergeConfig=function(c){for(var a in c){switch(a.toLowerCase()){case"min":case"max":case"size":case"step":case"value":case"inverse":this.conf[a]=c[a];break;case"tooltip":case"visible":case"vertical":case"disabled":case"range":case"bg":this.conf[a]=dhx4.s2b(c[a]);break;case"bg_mode":this.conf[a]=({left:"left",right:"right"}[c[a]])||"left";break;case"parent":continue;break;default:this.conf[a]=c[a]}}};dhtmlXSlider.prototype._readAttFormNode=function(g){var m=g.attributes,a=m.length,e,h={},c;for(e=0;e<a;e++){c=m[e];switch(c.name.toLowerCase()){case"size":case"min":case"max":case"value":case"step":h[c.name]=Number(c.value);break;case"skin":h[c.name]=c.value;break;case"vertical":case"disabled":case"visible":case"range":case"bg":h[c.name]=dhx4.s2b(c.value);break;case"linkto":h[c.name]=c.value;break;case"tooltip":h[c.name]=dhx4.s2b(c.value);break;case"bg_mode":h[c.name]=({left:"left",right:"right"}[c.value])||"left";break}}return h};dhtmlXSlider.prototype._renderArgumets=function(a){var g={},e,c;c=a.length;for(e=0;e<c;e++){switch(e){case 0:g.parent=a[e];break;case 1:g.size=a[e];break;case 2:g.skin=a[e];break;case 3:g.vertical=a[e];break;case 4:g.min=a[e];break;case 5:g.max=a[e];break;case 6:g.value=a[e];break;case 7:g.step=a[e];break}}return g};dhtmlXSlider.prototype._skinCollection={dhx_skyblue:true,dhx_web:true,dhx_terrace:true};dhtmlXSlider.prototype._indexOf=function(a,g){var e,c,h=-1;c=a.length;for(e=c;e>=0;e--){if(a[e]==g){h=e;break}}return h};dhtmlXSlider.prototype._refreshRunner=function(h){var g=(this.conf.vertical==true?{x:"top",y:"left",ofs_w:"offsetHeight",ofs_h:"offsetWidth"}:{x:"left",y:"top",ofs_w:"offsetWidth",ofs_h:"offsetHeight"});var a=this._nodes.cont[g.ofs_w]-this._nodes.runner[g.ofs_w];var e=this._nodes.runner;var c=this._nodes.runner2;if(h==null||h==0){var l=this._getCoord(a,(this.conf.value instanceof Array?this.conf.value[0]:this.conf.value));e.style[g.x]=l+this.conf.border+"px";e.style[g.y]=Math.round((this._nodes.cont[g.ofs_h]-e[g.ofs_h])/2)+"px"}if(this.conf.range==true&&(h==null||h==1)){var l=this._getCoord(a,this.conf.value[1]);c.style[g.x]=l+this.conf.border+"px";c.style[g.y]=Math.round((this._nodes.cont[g.ofs_h]-e[g.ofs_h])/2)+"px"}if(this.conf.range==true){if(e.style[g.x]==c.style[g.x]&&this.conf.value[1]==this.conf.max){if(e.style.zIndex!=2){e.style.zIndex=2}}else{if(e.style.zIndex==2){e.style.zIndex=1}}}e=c=null;this._refreshBG()};dhtmlXSlider.prototype._setValueByCoord=function(g){var a=dhx4.absLeft(this._nodes.cont),h=dhx4.absTop(this._nodes.cont),e,c;if(this.conf.vertical){c=(g.y-h-this._nodes.runner.offsetHeight/2)/(this._nodes.cont.offsetHeight-this._nodes.runner.offsetHeight)}else{c=(g.x-a-this._nodes.runner.offsetWidth/2)/(this._nodes.cont.offsetWidth-this._nodes.runner.offsetWidth)}e=(this.conf.max-this.conf.min)*c+this.conf.min;this.setValue(e,true)};dhtmlXSlider.prototype._getCoord=function(a,g){var e=(this.conf.inverse?this._inverseValue(g):g);var c=(e-this.conf.min)/(this.conf.max-this.conf.min);return Math.round(a*c)};dhtmlXSlider.prototype._normalize=function(g,e,a){g=Number(g);g=Math.round(g/this.conf.step)*this.conf.step;var c=Math.pow(10,this.conf.decimals);g=Math.round(g*c)/c;g=Math.max(e,Math.min(a,g));return g};dhtmlXSlider.prototype._normalizeRange=function(e,c,a){if(e[1]<e[0]){e[1]=e[0]}e[0]=this._normalize(e[0],c,Math.min(a,e[1]));e[1]=this._normalize(e[1],Math.max(c,e[0]),a);return e};dhtmlXSlider.prototype._refreshBG=function(){if(this.conf.bg!=true){return}var g=this._nodes.track.firstChild;var e=this._nodes.runner;var a=e.nextSibling;var c=(this.conf.vertical==true?{x:"top",w:"height",ofs:"offsetHeight"}:{x:"left",w:"width",ofs:"offsetWidth"});if(this.conf.range==true){g.style[c.x]=Math.floor(parseInt(e.style[c.x])+e[c.ofs]/2)+"px";g.style[c.w]=Math.max(Math.floor(parseInt(a.style[c.x])+a[c.ofs]/2)-parseInt(g.style[c.x]),0)+"px"}else{var h=(this.conf.inverse==true?{left:"right",right:"left"}[this.conf.bg_mode]:this.conf.bg_mode);g.style[c.x]=(h=="left"?"0":Math.floor(parseInt(e.style[c.x])+e[c.ofs]/2))+"px";g.style[c.w]=(h=="left"?Math.floor(parseInt(e.style[c.x])+e[c.ofs]/2):this._nodes.track[c.ofs]-parseInt(g.style[c.x]))+"px"}g=e=a=null};dhtmlXSlider.prototype._attachNode=function(e,a){this._detachNode(a);var c=e.tagName.toLowerCase();if(!c){return}this._attachedNode["node_"+a]=e;switch(c){case"input":case"select":if(typeof(window.addEventListener)=="function"){e.addEventListener("change",this._doOnChangeInput,false);e.addEventListener("keydown",this._doOnKeyDown,false)}else{e.attachEvent("onchange",this._doOnChangeInput);e.attachEvent("onkeydown",this._doOnKeyDown)}this._attachedNode.setValue=function(m,g,l){var h=(m instanceof Array?m[l||0]:m);this["node_"+(l||0)].value=dhtmlXSlider.prototype._atatchedNodeFixDec(h,g)};break;default:this._attachedNode.setValue=function(m,g,l){var h=(m instanceof Array?m[l||0]:m);this["node_"+(l||0)].innerHTML=dhtmlXSlider.prototype._atatchedNodeFixDec(h,g)}}this._attachedNode.setValue(this.conf.value,this.conf.decimals,a)};dhtmlXSlider.prototype._detachNode=function(a){var e=this._attachedNode["node_"+a];if(!e){return}var c=e.tagName;switch(c){case"input":case"select":if(typeof(window.addEventListener)=="function"){e.removeEventListener("change",this._doOnChangeInput,false);e.removeEventListener("keydown",this._doOnChangeInput,false)}else{e.detachEvent("change",this._doOnChangeInput);e.detachEvent("keydown",this._doOnChangeInput)}break}delete this._attachedNode["node_"+a];delete this._attachedNode.setValue;e=null};dhtmlXSlider.prototype._atatchedNodeFixDec=function(g,a){g=String(g);if(a>0){var c=g.match(/\.\d{1,}$/);if(c!=null){a=Math.max(a-c[0].length+1)}g+=(g.indexOf(".")<0?".":"");for(var e=0;e<a;e++){g+="0"}}return g};dhtmlXSlider.prototype._detectDecimals=function(){var a=this.conf.step.toString().match(/\.(\d*)$/);this.conf.decimals=(a!=null?a[1].length:0)};dhtmlXSlider.prototype.setSize=function(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(h){h=h.toLowerCase();var e,c=-1,a,g="dhtmlxslider";e=this.base.className.match(/\S\w+/ig);if(e instanceof Array){for(a in this._skinCollection){if(c==-1){c=this._indexOf(e,g+"_"+a)}else{break}}c=(c==-1)?e.length:c}else{e=[];c=0}e[c]=g+"_"+h;this.base.className=e.join(" ");this.conf.skin=h;if(this._nodes){this._refreshRunner()}};dhtmlXSlider.prototype.setValue=function(g,h){h=h||false;var c=null;var e=false;if(this.conf.range==true){if(this._r_actv!=null){c=(this._r_actv==this._nodes.runner?0:1)}g=this._normalizeRange(g,this.conf.min,this.conf.max);e=(this.conf.value[0]!=g[0]||this.conf.value[1]!=g[1])}else{g=this._normalize(g,this.conf.min,this.conf.max);e=(this.conf.value!=g)}if(e=true){this.conf.value=g;this._refreshRunner(c);this._refreshTooltip();if(h){var a=[g,this];if(this.conf.range==true){if(this._r_actv!=null){a.push(this._r_actv==this._nodes.runner?0:1)}else{if(this.conf.init_index!=null){a.push(this.conf.init_index.valueOf())}}}this.callEvent("onChange",a)}}if(typeof(this._attachedNode.setValue)=="function"){if(c==null){c=this.conf.init_index}this._attachedNode.setValue(this.conf.value,this.conf.decimals,c)}};dhtmlXSlider.prototype.getValue=function(){if(this.conf.range==true){return[this.conf.value[0].valueOf(),this.conf.value[1].valueOf()]}else{return this.conf.value.valueOf()}};dhtmlXSlider.prototype._inverseValue=function(a){return this.conf.max+this.conf.min-a};dhtmlXSlider.prototype.disable=function(h){h=(h==false)?false:true;var g=null;if(h){for(var c in this._nodes){if(c=="cont"){continue}var e=(c=="runner2"?"runner":c);if(this._nodes[c]!=null){g=new RegExp("\\s?dhxsl_"+e+"_dis","i");if(!g.test(this._nodes[c].className)){this._nodes[c].className+=" dhxsl_"+e+"_dis"}}}this.conf.disabled=true}else{this.enable()}};dhtmlXSlider.prototype.enable=function(){var g;for(var c in this._nodes){if(c=="cont"){continue}var e=(c=="runner2"?"runner":c);if(this._nodes[c]!=null){g=new RegExp("\\s?dhxsl_"+e+"_dis","i");if(g.test(this._nodes[c].className)){this._nodes[c].className=this._nodes[c].className.replace(g,"")}}}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.conf.tooltip=true;this._refreshTooltip()}else{this.disableTooltip()}};dhtmlXSlider.prototype.setMax=function(a){if(!isNaN(a)&&this.conf.min<a){this.conf.max=a;this.setValue(this.conf.value)}};dhtmlXSlider.prototype.getMax=function(){return this.conf.max};dhtmlXSlider.prototype.setMin=function(a){if(!isNaN(a)&&this.conf.max>a){this.conf.min=a;this.setValue(this.conf.value)}};dhtmlXSlider.prototype.getMin=function(){return this.conf.min};dhtmlXSlider.prototype.setStep=function(a){var c=this.conf.max-this.conf.min;if(!isNaN(a)&&a<c){this.conf.step=a;this._detectDecimals();this.setValue(this.conf.value)}};dhtmlXSlider.prototype.getStep=function(){return this.conf.step};dhtmlXSlider.prototype.show=function(){if(/\s?dhxsl_hidden/i.test(this._nodes.cont.className)){this._nodes.cont.className=this._nodes.cont.className.replace(/\s?dhxsl_hidden/i,"")}this.conf.visible=true};dhtmlXSlider.prototype.hide=function(){if(!/\s?dhxsl_hidden/i.test(this._nodes.cont.className)){this._nodes.cont.className+=" dhxsl_hidden"}this.conf.visible=false};dhtmlXSlider.prototype.isVisible=function(){return this.conf.visible};dhtmlXSlider.prototype.linkTo=function(a){if(!(a instanceof Array)){a=[a]}for(var c=0;c<a.length&&c<2;c++){if(a[c]!=null){if(typeof(a[c])=="string"){a[c]=document.getElementById(a[c])}this._attachNode(a[c],c)}}};dhtmlXSlider.prototype._refreshTooltip=function(){if(this.conf.tooltip==true){if(this.conf.value instanceof Array){this._nodes.cont.title=this.conf.value.join(", ")}else{this._nodes.cont.title=this.conf.value}}};dhtmlXSlider.prototype.getRunnerIndex=function(){if(this._r_actv==null){return -1}return(this._r_actv==this._nodes.runner?0:1)};function dhtmlXPopup(e){var g=this;this.conf=e||{};e=null;this.mode=(this.conf.mode||"bottom");this.conf.zi=window.dhx4.newId();this.conf.context=(this.conf.context==null?true:window.dhx4.s2b(this.conf.context));this.conf.IE6_display_fix=(this.conf.IE6_display_fix==null?false:window.dhx4.s2b(this.conf.IE6_display_fix));this.conf.last_p_click=this.conf.last_body_click=null;this.p=document.createElement("DIV");this.p.style.display="none";this.p.innerHTML="<div class='dhx_popup_area"+(window.dhx4.isIE?" dhx_popup_area_ie":"")+"'><table cellspacing='0' cellpadding='0' border='0' class='dhx_popup_table'><tbody></tbody></table></div><div class='dhx_popup_arrow dhx_popup_arrow_"+this.mode+"'></div>";document.body.appendChild(this.p);this.p.oncontextmenu=function(a){if(g.conf.context==false){a=a||event;a.returnValue=false;return false}};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.ontouchstart=this.p.onclick=function(l){l=l||event;var h=(g.conf.last_p_click!=null&&g.conf.last_p_click!=l.type);g.conf.last_p_click=l.type;if(h==true){return}g._clearClick=true;if(g._nodeObj!=null){g.callEvent("onContentClick",[]);return true}var a=(l.target||l.srcElement);var m=null;while(a!=g.p&&a!=null){if(typeof(a._idd)!="undefined"&&!a._isSeparator){m=a._idd;a=null}else{a=a.parentNode}}a=null;if(m!=null){g.callEvent("onClick",[m]);if(g!=null&&g.isVisible!=null&&g.isVisible()&&g.callEvent("onBeforeHide",["select",l,m])===true){l.cancelBubble=true;g.hide()}}};this.separator="DHXSEP_"+window.dhx4.newId();this.tpl=[];this._setTemplate=function(a){this.tpl=a.split(",")};this.show=function(h){var a=null;if(arguments.length==1){if(!h){h=this.conf.id[0]}else{if(!this._idExists(h)){return}}if(this.conf.toolbar){a=this.conf.toolbar._getItemDim(h)}if(this.conf.ribbon){a=this.conf.ribbon._getItemDim(h)}if(this.conf.form){a=this.conf.form._getItemDim(h)}}else{if(arguments.length==4){this._clearClick=true;a={left:arguments[0],top:arguments[1],width:arguments[2],height:arguments[3]};h=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=h;this.callEvent("onShow",[h])};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(v<N.left){var M=Math.min(v+C,N.left);C=v+C-M;v=M}if(v+C>N.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(m<N.left-A){m=Math.min(N.left-A,K)}else{if(m+this.p.offsetWidth>N.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(s<N.top){var l=Math.min(s+L,N.top);L=s+L-l;s=l}if(s+L>N.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(H<N.top-A){H=Math.min(N.top-A,Q)}else{if(H+this.p.offsetHeight>N.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);if(this.conf.IE6_display_fix==true){E.style.visibility="hidden"}window.setTimeout(function(){E.style.visibility="visible";E=null},1)}};this._getAvailPos=function(r,o){var l={top:["bottom","right","left"],bottom:["top","right","left"],left:["right","bottom","top"],right:["left","bottom","top"]};var m=null;for(var n=0;n<l[r].length;n++){if(m==null&&o[l[r][n]]>0){m=l[r][n]}}if(m==null){m="bottom";for(var h in o){if(o[h]>o[m]){m=h}}}if(m==r){return false}return m};this._repaint=function(){if(this.isVisible()){this._setPos(this._posData)}};this.clear=function(){if(this._nodeObj){if(window.dhx4.isIE&&typeof(window.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 h=0;h<this._nodeObjEv.length;h++){this.detachEvent(this._nodeObjEv[h])}this._nodeObjEv=null}}if(this._IEHoverInited){this._IEHoverClear()}var a=this.p.firstChild.firstChild.firstChild;while(a.childNodes.length>0){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.conf.last_p_click=this.conf.last_body_click=null}};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(l,s){this._setTemplate(l);this.clear();var m=this.p.firstChild.firstChild.firstChild;for(var o=0;o<s.length;o++){var n=document.createElement("TR");if(s[o]!=this.separator){if(typeof(s[o].id)=="undefined"||s[o].id==null){n._idd=window.dhx4.newId();while(this.itemData[n._idd]!=null){n._idd=window.dhx4.newId()}}else{n._idd=s[o].id}this.itemData[n._idd]=s[o]}m.appendChild(n);if(s[o]==this.separator){n.className="dhx_popup_sep";n._isSeparator=true;var u=document.createElement("TD");u.className="dhx_popup_sep";u.colSpan=this.tpl.length;u.innerHTML="<div class='dhx_popup_sep'>&nbsp;</div>";n.appendChild(u);u=null}else{for(var a=0;a<this.tpl.length;a++){var h="dhx_popup_td";if(this._IEFirstLast&&(this.tpl.length==1||a==0||a==this.tpl.length-1)){if(this.tpl.length==1){h+=" dhx_popup_td_single"}else{h+=(a==0?" dhx_popup_td_first":" dhx_popup_td_last")}}var u=document.createElement("TD");u.className=h;u.innerHTML=s[o][this.tpl[a]]||"&nbsp;";n.appendChild(u);u=null}if(this._IEHover){n._IEHover=true;if(!this._IEHoverInited){this._IEHoverInit()}}}n=null}m=null;this._repaint()};this._attachNode=function(m,l){this.clear();this._nodeId="dhxpopup_node_"+window.dhx4.newId();var a=this.p.firstChild.firstChild.firstChild;var h=document.createElement("TR");h.className="dhxnode";a.appendChild(h);var n=document.createElement("TD");n.className="dhx_popup_td";n.innerHTML="<div id='"+this._nodeId+"' style='position:relative;'></div>";if(l.width){n.firstChild.style.width=l.width+"px"}if(l.height){n.firstChild.style.height=l.height+"px"}h.appendChild(n);n=h=a=null;if(typeof(this["_attach_init_"+m])=="function"){this["_attach_init_"+m](l);this._enableIEVFix()}this._repaint();return this._nodeObj};this.unload=function(){if(typeof(window.addEventListener)=="function"){window.removeEventListener("touchstart",this._doOnClick,false);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)}window.dhx4.detachEvent(this.conf.ev_grid_click);this.clear();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!=null){for(var l=0;l<this.conf.slider_events.length;l++){this.conf.slider.detachEvent(this.conf.slider_events[l])}this.conf.slider_events=null;this._sliderShow=this._sliderHide=null;this.conf.slider=null}window.dhx4._eventable(this,"clear");this.p.onclick=this.p.ontouchstart=this.p.oncontextmenu=null;this.p.parentNode.removeChild(this.p);this.p=null;for(var h in this.conf){this.conf[h]=null}for(var h in this){this[h]=null}g=null};window.dhx4._eventable(this);this._doOnClick=function(q){q=q||event;var a=(g.conf.last_body_click!=null&&g.conf.last_body_click!=q.type);g.conf.last_body_click=q.type;if(a==true){return}if(g._clearClick==true){g._clearClick=false;return}if(g.conf.form!=null){var l;var s=(q.target||q.srcElement);if((s.tagName||"").toLowerCase()=="option"){s=s.parentNode}if(s.className!=null&&s.className.search("dhxform")>=0){if(s.parentNode!=null&&s.parentNode.parentNode!=null&&s.parentNode.parentNode._idd!=null){l=s.parentNode.parentNode._idd;if(s.parentNode.parentNode._type=="ra"){l=[s.parentNode.parentNode._group,s.parentNode.parentNode._value]}}}else{var n=true;var o=false;while(n&&!o){var m=(s.className||"").toLowerCase();if(m.length>0){o=(m=="dhxform_btn"||m.search(/dhxeditor_inside/gi)>=0||m=="dhxcombo_input"||m.search(/dhxcombolist/gi)>=0)}s=s.parentNode;n=(s!=null)}if(o){return}}s=null;if(l!=null&&g._idExists(l)){return}}if(typeof(window.dhtmlXForm)!="undefined"&&g._nodeObj instanceof window.dhtmlXForm){var u={};var m=0;var h=g._nodeObj;h.forEachItem(function(r){if(h.getItemType(r)=="combo"){u[h.getCombo(r).list._listId]=true;m++}});h=null;if(m>0){var s=(q.target||q.srcElement);var n=true;var o=false;while(n==true&&o!=true){var m=(s.className||"").toLowerCase();if(m.length>0&&m.search(/^dhxcombolist/gi)>=0&&s._listId!=null&&u[s._listId]==true){o=true;s=null}else{s=s.parentNode;n=(s!=null)}}if(o==true){return}}}if(g.isVisible()&&g.callEvent("onBeforeHide",["click",q])===true){g.hide()}};this._doOnKeyUp=function(a){a=a||event;if(a.keyCode==27){if(g.isVisible()&&g.callEvent("onBeforeHide",["esc",a])===true){g.hide()}}};this._doOnUnload=function(){g.unload()};if(typeof(window.addEventListener)=="function"){window.addEventListener("touchstart",this._doOnClick,false);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.conf.ev_grid_click=window.dhx4.attachEvent("_onGridClick",function(h,a){if(g._nodeObj!=null&&g._nodeObj==a){return}g._clearClick=false;g._doOnClick(h)});this._idExists=function(l){var a=false;for(var h=0;h<this.conf.id.length;h++){if(this.conf.id[h] instanceof Array){a=a||(this.conf.id[h][0]==l[0]&&this.conf.id[h][1]==l[1])}else{a=a||this.conf.id[h]==l}}return a};this._IEDisp=(window.dhx4.isIE6||document.compatMode!="CSS1Compat");this._IEHover=(window.dhx4.isIE6==true);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(g._IEHoverTM){window.clearTimeout(g._IEHoverTM)}if(g._lastIEHover==a){return}g._IEHoverRender(a);a=null}};this.p.onmouseout=function(){if(g._IEHoverTM){window.clearTimeout(g._IEHoverTM)}g._IEHoverTM=window.setTimeout(function(){g._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";g._lastIEHover=a}};this._IEHoverInited=true};this._IEHoverClear=function(){this.p.onmouseover=null;this.p.onmouseout=null;this._IEHoverInited=false}}this._IEFirstLast=(window.dhx4.isIE6||window.dhx4.isIE7||window.dhx4.isIE8);this._enableIEVFix=function(){if(window.dhx4.isIE6||window.dhx4.isIE7){var h=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(h,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(h){for(var a=0;a<g.conf.id.length;a++){if(h==g.conf.id[a]){if(h!=g._lastId){g.show(h);g._clearClick=true}}}};if(typeof(dhtmlXToolbarObject.prototype._getItemDim)=="undefined"){dhtmlXToolbarObject.prototype._getItemDim=function(l){var a=this.objPull[this.idPrefix+l];var h={left:window.dhx4.absLeft(a.obj),top:window.dhx4.absTop(a.obj),width:a.obj.offsetWidth+(a.arw?a.arw.offsetWidth:0),height:a.obj.offsetHeight};a=null;return h}}this.conf.toolbarEvent=this.conf.toolbar.attachEvent("onClick",this._doOnToolbarClick)}if(typeof(window.dhtmlXRibbon)!="undefined"&&this.conf.ribbon!=null&&this.conf.ribbon instanceof window.dhtmlXRibbon&&this.conf.id!=null){if(!(this.conf.id instanceof Array)){this.conf.id=[this.conf.id]}this.skinParent=this.conf.ribbon.conf.skin;this._doOnRibbonClick=function(h){for(var a=0;a<g.conf.id.length;a++){if(h==g.conf.id[a]){if(h!=g._lastId){g.show(h);g._clearClick=true}}}};if(typeof(dhtmlXRibbon.prototype._getItemDim)=="undefined"){dhtmlXRibbon.prototype._getItemDim=function(l){var a=this._items[l].base;var h={left:window.dhx4.absLeft(a),top:window.dhx4.absTop(a),width:a.offsetWidth,height:a.offsetHeight};a=null;return h}}this.conf.ribbonEvent=this.conf.ribbon.attachEvent("_showPopup",this._doOnRibbonClick)}if(typeof(window.dhtmlXForm)!="undefined"&&this.conf.form!=null&&this.conf.form instanceof window.dhtmlXForm&&this.conf.id!=null){if(!(this.conf.id instanceof Array)){this.conf.id=[this.conf.id]}if(!this.conf.mode){this.mode="right"}this.skinParent=this.conf.form.skin;if(typeof(dhtmlXForm.prototype._getItemDim)=="undefined"){dhtmlXForm.prototype._getItemDim=function(a,h){return this.doWithItem(a,"_getDim")};for(var c in {input:1,password:1,select:1,multiselect:1,checkbox:1,radio:1,button:1,combo:1,btn2state:1,calendar:1,colorpicker:1,editor:1}){if(dhtmlXForm.prototype.items[c]!=null){dhtmlXForm.prototype.items[c]._getDim=function(h){var a=h;if({ta:true,pw:true,se:true,calendar:true,colorpicker:1,editor:true}[h._type]){a=h.childNodes[h._ll?1:0].childNodes[0]}if({ch:true,ra:true,btn2state:true}[h._type]){a=h.childNodes[h._ll?1:0].childNodes[1]}if({bt:true}[h._type]){a=h.firstChild}if({combo:true}[h._type]){a=h._combo.DOMParent.firstChild}var l={left:window.dhx4.absLeft(a),top:window.dhx4.absTop(a),width:a.offsetWidth,height:a.offsetHeight};a=null;return l}}}}}if(typeof(window.dhtmlXSlider)!="undefined"&&this.conf.slider!=null&&this.conf.slider instanceof window.dhtmlXSlider){if(!this.conf.mode){this.mode="top"}this.conf.slider_tm=null;this._sliderShow=function(){if(g.conf.slider_tm){window.clearTimeout(g.conf.slider_tm)}var a=g.conf.slider._r_actv;if(a!=null){var h={left:window.dhx4.absLeft(a),top:window.dhx4.absTop(a),width:a.offsetWidth,height:a.offsetHeight};g.show(h.left,h.top,h.width,h.height);a=null}};this._sliderHide=function(){g.conf.slider_tm=window.setTimeout(function(){g.hide()},200)};this.conf.slider_events=[this.conf.slider.attachEvent("onMouseDown",this._sliderShow),this.conf.slider.attachEvent("onMouseUp",this._sliderHide),this.conf.slider.attachEvent("onChange",this._sliderShow)]}this.setSkin(this.skinParent||this.conf.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhx_popup")||"dhx_skyblue");return this}dhtmlXPopup.prototype.attachObject=function(a){return this._attachNode("object",{obj:a})};dhtmlXPopup.prototype._attach_init_object=function(a){this._nodeObj=(typeof(a.obj)=="string"?document.getElementById(a.obj):a.obj);a.obj=null;document.getElementById(this._nodeId).appendChild(this._nodeObj);this._nodeObj.style.display="";this._nodeObj.style.visibility="visible"};dhtmlXPopup.prototype.attachHTML=function(a){return this._attachNode("html",{html:a})};dhtmlXPopup.prototype._attach_init_html=function(a){document.getElementById(this._nodeId).innerHTML=a.html;this._nodeObj={text:a.html}};dhtmlXPopup.prototype.attachForm=function(c,a){return this._attachNode("form",{struct:c,width:a})};dhtmlXPopup.prototype._attach_init_form=function(c){var a=this;this._nodeObj=new dhtmlXForm(this._nodeId,c.struct);this._nodeObj.setSkin(this.conf.skin);this._nodeObj.attachEvent("_onBeforeEditorAccess",function(){a._clearClick=true});if(this.conf.editorEv!=null&&this.checkEvent(this.conf.editorEv)==false){this.conf.editorEv=null}if(dhtmlXForm.prototype.items.editor!=null&&this.conf.editorEv==null){this.conf.editorEv=this.attachEvent("onShow",function(){var h=dhtmlXForm.prototype.items.editor.editor;for(var e in h){var l=h[e].base;var g=false;while(l!=null){if(l==this.p){g=true;l=null}else{l=l.parentNode}}l=null;if(g==true){h[e].cell.conf.cells_cont=null;h[e].setSizes()}}h=null;this.detachEvent(this.conf.editorEv);this.conf.editorEv=null});if(this._nodeObjEv==null){this._nodeObjEv=[]}this._nodeObjEv.push(this.conf.editorEv)}};dhtmlXPopup.prototype.attachCalendar=function(a){return this._attachNode("calendar",a||{})};dhtmlXPopup.prototype._attach_init_calendar=function(a){if(a["double"]==true){this._nodeObj=new dhtmlXDoubleCalendarObject(this._nodeId);this._nodeObj.leftCalendar.setSkin(this.conf.skin);this._nodeObj.rightCalendar.setSkin(this.conf.skin)}else{this._nodeObj=new dhtmlXCalendarObject(this._nodeId);this._nodeObj.setSkin(this.conf.skin)}this._nodeObj.show()};dhtmlXPopup.prototype.attachGrid=function(c,a){return this._attachNode("grid",{width:c||400,height:a||200})};dhtmlXPopup.prototype._attach_init_grid=function(){this._nodeObj=new dhtmlXGridObject(this._nodeId);this._nodeObj.setSkin(this.conf.skin)};dhtmlXPopup.prototype.attachTree=function(e,c,a){return this._attachNode("tree",{width:e||400,height:c||200,rootId:a||0})};dhtmlXPopup.prototype._attach_init_tree=function(a){this._nodeObj=new dhtmlXTreeObject(this._nodeId,"100%","100%",(a.rootId))};dhtmlXPopup.prototype.attachLayout=function(c,a,e){return this._attachNode("layout",{width:c||400,height:a||200,pattern:e||"3L"})};dhtmlXPopup.prototype._attach_init_layout=function(a){this._nodeObj=new dhtmlXLayoutObject(this._nodeId,a.pattern,this.conf.skin)};dhtmlXPopup.prototype.attachAccordion=function(e,a,c){return this._attachNode("accordion",{width:e||400,height:a||200,conf:c||{}})};dhtmlXPopup.prototype._attach_init_accordion=function(a){a.conf.parent=this._nodeId;a.conf.skin=this.conf.skin;this._nodeObj=new dhtmlXAccordion(a.conf)};dhtmlXPopup.prototype.attachTabbar=function(e,a,c){if(typeof(c)=="string"){c={mode:c}}else{if(typeof(c)!="object"||c==null){c={}}}return this._attachNode("tabbar",{width:e||400,height:a||200,conf:c})};dhtmlXPopup.prototype._attach_init_tabbar=function(a){a.conf.parent=this._nodeId;a.conf.skin=this.conf.skin;this._nodeObj=new dhtmlXTabBar(a.conf)};dhtmlXPopup.prototype.attachSidebar=function(e,a,c){if(c==null){c={}}return this._attachNode("sidebar",{width:e||400,height:a||200,conf:c})};dhtmlXPopup.prototype._attach_init_sidebar=function(a){a.conf.parent=this._nodeId;a.conf.skin=this.conf.skin;this._nodeObj=new dhtmlXSideBar(a.conf)};dhtmlXPopup.prototype.attachEditor=function(e,a,c){return this._attachNode("editor",{width:e||400,height:a||200,conf:c||{}})};dhtmlXPopup.prototype._attach_init_editor=function(c){document.getElementById(this._nodeId).className="dhxeditor_"+this.conf.skin;c.conf.parent=this._nodeId;if(c.conf.skin==null){c.conf.skin=this.conf.skin}this._nodeObj=new dhtmlXEditor(c.conf);var a=this.attachEvent("onShow",function(){if(this._nodeObj instanceof window.dhtmlXEditor){this._nodeObj.setSizes()}});if(this._nodeObjEv==null){this._nodeObjEv=[]}this._nodeObjEv.push(a)};dhtmlXPopup.prototype.attachColorPicker=function(a){if(typeof(a)!="object"||a==null){a={}}return this._attachNode("colorpicker",{conf:a})};dhtmlXPopup.prototype._attach_init_colorpicker=function(a){a.conf.skin=this.conf.skin;a.conf.parent=this._nodeId;this._nodeObj=new dhtmlXColorPicker(a.conf)};dhtmlXPopup.prototype.attachCarousel=function(e,a,c){if(c==null){c={}}return this._attachNode("carousel",{width:e||400,height:a||300,conf:c})};dhtmlXPopup.prototype._attach_init_carousel=function(a){a.conf.parent=this._nodeId;a.conf.skin=this.conf.skin;this._nodeObj=new dhtmlXCarousel(a.conf)};function dhtmlXMenuObject(h,l){var g=this;this.conf={skin:(l||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxmenu")||"dhx_skyblue"),mode:"web",align:"left",is_touched:false,selected:-1,last_click:-1,fixed_pos:false,rtl:false,icons_path:"",arrow_ff_fix:(navigator.userAgent.indexOf("MSIE")>=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,of_ah:{dhx_skyblue:24,dhx_web:25,dhx_terrace:27},of_ih:{dhx_skyblue:24,dhx_web:24,dhx_terrace:24},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(h)=="object"&&h!=null&&typeof(h.tagName)=="undefined"){if(h.icons_path!=null||h.icon_path!=null){this.conf.icons_path=(h.icons_path||h.icon_path)}if(h.skin!=null){this.conf.skin=h.skin}if(h.visible_area){this.conf.v_enabled=true;this.conf.v={x1:h.visible_area.x1,x2:h.visible_area.x2,y1:h.visible_area.y1,y2:h.visible_area.y2}}for(var e 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(h[e]!=null){this.conf.autoload[e]=h[e]}}h=h.parent}if(h==null){this.base=document.body}else{var c=(typeof(h)=="string"?document.getElementById(h):h);if(c!=null){this.base=c;if(!this.base.id){this.base.id="menuBaseId_"+new Date().getTime()}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(n){var o=this.conf.skin;this.conf.skin=n;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_"+o+"_Middle","")+" dhtmlxMenu_"+this.conf.skin+"_Middle"}for(var m in this.idPull){this.idPull[m].className=String(this.idPull[m].className).replace(o,this.conf.skin)}};this.setSkin(this.conf.skin);this._addSubItemToSelected=function(n,m){var a=true;for(var o=0;o<this.conf.selected_sub.length;o++){if((this.conf.selected_sub[o][0]==n)&&(this.conf.selected_sub[o][1]==m)){a=false}}if(a==true){this.conf.selected_sub.push(new Array(n,m))}return a};this._removeSubItemFromSelected=function(r,o){var a=new Array();var n=false;for(var s=0;s<this.conf.selected_sub.length;s++){if((this.conf.selected_sub[s][0]==r)&&(this.conf.selected_sub[s][1]==o)){n=true}else{a[a.length]=this.conf.selected_sub[s]}}if(n==true){this.conf.selected_sub=a}return n};this._getSubItemToDeselectByPolygon=function(r){var a=new Array();for(var s=0;s<this.conf.selected_sub.length;s++){if(this.conf.selected_sub[s][1]==r){a[a.length]=this.conf.selected_sub[s][0];a=a.concat(this._getSubItemToDeselectByPolygon(this.conf.selected_sub[s][0]));var o=true;for(var n=0;n<this.conf.opened_poly.length;n++){if(this.conf.opened_poly[n]==this.conf.selected_sub[s][0]){o=false}}if(o==true){this.conf.opened_poly[this.conf.opened_poly.length]=this.conf.selected_sub[s][0]}this.conf.selected_sub[s][0]=-1;this.conf.selected_sub[s][1]=-1}}return a};this._hidePolygon=function(a){if(this.idPull["polygon_"+a]!=null){if(this.idPull["polygon_"+a]._zId!=null){window.dhx4.zim.clear(this.idPull["polygon_"+a]._zId)}if(typeof(this._menuEffect)!="undefined"&&this._menuEffect!==false){this._hidePolygonEffect("polygon_"+a)}else{if(this.idPull["polygon_"+a].style.display=="none"){return}this.idPull["polygon_"+a].style.display="none";if(this.idPull["arrowup_"+a]!=null){this.idPull["arrowup_"+a].style.display="none"}if(this.idPull["arrowdown_"+a]!=null){this.idPull["arrowdown_"+a].style.display="none"}this._updateItemComplexState(a,true,false);if(window.dhx4.isIE6&&this.idPull["polygon_"+a+"_ie6cover"]!=null){this.idPull["polygon_"+a+"_ie6cover"].style.display="none"}}a=String(a).replace(this.idPrefix,"");if(a==this.topId){a=null}this.callEvent("onHide",[a]);if(a!=null&&this.conf.skin=="dhx_terrace"&&this.itemPull[this.idPrefix+a].parent==this.idPrefix+this.topId){this._improveTerraceButton(this.idPrefix+a,true)}}};this._showPolygon=function(H,n){var M=this._countVisiblePolygonItems(H);if(M==0){return}var I="polygon_"+H;if((this.idPull[I]!=null)&&(this.idPull[H]!=null)){if(this.conf.top_mode&&this.conf.mode=="web"&&!this.conf.context){if(!this.idPull[H]._mouseOver&&n==this.conf.dir_toplv){return}}if(!this.conf.fixed_pos){this._autoDetectVisibleArea()}var J=0;var L=0;var O=null;var D=null;if(this.idPull[I]._zId==null){this.idPull[I]._zId=window.dhx4.newId()}this.idPull[I]._zInd=window.dhx4.zim.reserve(this.idPull[I]._zId);this.idPull[I].style.visibility="hidden";this.idPull[I].style.left="0px";this.idPull[I].style.top="0px";this.idPull[I].style.display="";this.idPull[I].style.zIndex=this.idPull[I]._zInd;if(this.conf.auto_overflow){if(this.idPull[I].childNodes[1].childNodes[0].offsetHeight>this.conf.v.y2-this.conf.v.y1){var C=Math.max(Math.floor((this.conf.v.y2-this.conf.v.y1-this.conf.of_ah[this.conf.skin]*2)/this.conf.of_ih[this.conf.skin]),1);this.conf.overflow_limit=C}else{this.conf.overflow_limit=0;if(this.idPull["arrowup_"+H]!=null){this._removeUpArrow(String(H).replace(this.idPrefix,""))}if(this.idPull["arrowdown_"+H]!=null){this._removeDownArrow(String(H).replace(this.idPrefix,""))}}}if(this.conf.overflow_limit>0&&this.conf.overflow_limit<M){if(this.idPull["arrowup_"+H]==null){this._addUpArrow(String(H).replace(this.idPrefix,""))}if(this.idPull["arrowdown_"+H]==null){this._addDownArrow(String(H).replace(this.idPrefix,""))}O=this.idPull["arrowup_"+H];O.style.display="none";D=this.idPull["arrowdown_"+H];D.style.display="none"}if(this.conf.overflow_limit>0&&this.conf.overflow_limit<M){this.idPull[I].childNodes[1].style.height=24*this.conf.overflow_limit+"px";O.style.width=D.style.width=this.idPull[I].childNodes[1].style.width=this.idPull[I].childNodes[1].childNodes[0].offsetWidth+"px";this.idPull[I].childNodes[1].scrollTop=0;O.style.display="";J=O.offsetHeight;D.style.display="";L=D.offsetHeight}else{this.idPull[I].childNodes[1].style.height="";this.idPull[I].childNodes[1].style.width=""}if(this.itemPull[H]!=null){var v="polygon_"+this.itemPull[H]["parent"]}else{if(this.conf.context){var v=this.idPull[this.idPrefix+this.topId]}}var a=(this.idPull[H].tagName!=null?window.dhx4.absLeft(this.idPull[H]):this.idPull[H][0]);var N=(this.idPull[H].tagName!=null?window.dhx4.absTop(this.idPull[H]):this.idPull[H][1]);var m=(this.idPull[H].tagName!=null?this.idPull[H].offsetWidth:0);var o=(this.idPull[H].tagName!=null?this.idPull[H].offsetHeight:0);var u=0;var s=0;var A=this.idPull[I].offsetWidth;var K=this.idPull[I].offsetHeight;if(n=="bottom"){if(this.conf.rtl){u=a+(m!=null?m:0)-A}else{if(this.conf.align=="right"){u=a+m-A}else{u=a-1+(n==this.conf.dir_toplv?this.conf.tl_rmarg:0)}}s=N-1+o+this.conf.tl_botmarg}if(n=="right"){u=a+m-1;s=N+2}if(n=="left"){u=a-this.idPull[I].offsetWidth+2;s=N+2}if(n=="top"){u=a-1;s=N-K+2}if(this.conf.fixed_pos){var F=65536;var E=65536}else{var F=(this.conf.v.x2!=null?this.conf.v.x2:0);var E=(this.conf.v.y2!=null?this.conf.v.y2:0);if(F==0){if(window.innerWidth){F=window.innerWidth;E=window.innerHeight}else{F=document.body.offsetWidth;E=document.body.scrollHeight}}}if(u+A>F&&!this.conf.rtl){u=a-A+2}if(u<this.conf.v.x1&&this.conf.rtl){u=a+m-2}if(u<0){u=0}if(s+K>E&&this.conf.v.y2!=null){s=Math.max(N+o-K+2,(this.conf.v_enabled?this.conf.v.y1+2:2));if(this.conf.context&&this.idPrefix+this.topId==H&&D!=null){s=s-2}if(this.itemPull[H]!=null&&!this.conf.context){if(this.itemPull[H]["parent"]==this.idPrefix+this.topId){s=s-this.base.offsetHeight}}}this.idPull[I].style.left=u+"px";this.idPull[I].style.top=s+"px";if(typeof(this._menuEffect)!="undefined"&&this._menuEffect!==false){this._showPolygonEffect(I)}else{this.idPull[I].style.visibility="";if(this.conf.overflow_limit>0&&this.conf.overflow_limit<M){this.idPull[I].childNodes[1].scrollTop=0;this._checkArrowsState(H)}if(window.dhx4.isIE6){var r=I+"_ie6cover";if(this.idPull[r]==null){var q=document.createElement("IFRAME");q.className="dhtmlxMenu_IE6CoverFix_"+this.conf.skin;q.frameBorder=0;q.setAttribute("src","javascript:false;");document.body.insertBefore(q,document.body.firstChild);this.idPull[r]=q}this.idPull[r].style.left=u+"px";this.idPull[r].style.top=s+"px";this.idPull[r].style.width=this.idPull[I].offsetWidth+"px";this.idPull[r].style.height=this.idPull[I].offsetHeight+"px";this.idPull[r].style.zIndex=this.idPull[I].style.zIndex-1;this.idPull[r].style.display=""}}H=String(H).replace(this.idPrefix,"");if(H==this.topId){H=null}this.callEvent("onShow",[H]);if(H!=null&&this.conf.skin=="dhx_terrace"&&this.itemPull[this.idPrefix+H].parent==this.idPrefix+this.topId){this._improveTerraceButton(this.idPrefix+H,false)}}};this._redistribSubLevelSelection=function(r,o){while(this.conf.opened_poly.length>0){this.conf.opened_poly.pop()}var a=this._getSubItemToDeselectByPolygon(o);this._removeSubItemFromSelected(-1,-1);for(var m=0;m<a.length;m++){if((this.idPull[a[m]]!=null)&&(a[m]!=r)){if(this.itemPull[a[m]]["state"]=="enabled"){this.idPull[a[m]].className="sub_item"}}}for(var m=0;m<this.conf.opened_poly.length;m++){if(this.conf.opened_poly[m]!=o){this._hidePolygon(this.conf.opened_poly[m])}}if(this.itemPull[r]["state"]=="enabled"){this.idPull[r].className="sub_item_selected";if(this.itemPull[r]["complex"]&&this.conf.dload&&(this.itemPull[r]["loaded"]=="no")){if(this.conf.dload_icon==true){this._updateLoaderIcon(r,true)}this.itemPull[r].loaded="get";var n=r.replace(this.idPrefix,"");this._dhxdataload.onBeforeXLS=function(){var s={params:{}};s.params[this.conf.dload_pid]=n;for(var q in this.conf.dload_params){s.params[q]=this.conf.dload_params[q]}return s};this.loadStruct(this.conf.dload_url)}if(this.itemPull[r]["complex"]||(this.conf.dload&&(this.itemPull[r]["loaded"]=="yes"))){if((this.itemPull[r]["complex"])&&(this.idPull["polygon_"+r]!=null)){this._updateItemComplexState(r,true,true);this._showPolygon(r,this.conf.dir_sublv)}}this._addSubItemToSelected(r,o);this.conf.selected=r}};this._doOnClick=function(n,x,r){this.conf.last_click=n;if(this.itemPull[this.idPrefix+n]["href_link"]!=null&&this.itemPull[this.idPrefix+n].state=="enabled"){var s=document.createElement("FORM");var v=String(this.itemPull[this.idPrefix+n]["href_link"]).split("?");s.action=v[0];if(v[1]!=null){var o=String(v[1]).split("&");for(var a=0;a<o.length;a++){var w=String(o[a]).split("=");var u=document.createElement("INPUT");u.type="hidden";u.name=(w[0]||"");u.value=(w[1]||"");s.appendChild(u)}}if(this.itemPull[this.idPrefix+n]["href_target"]!=null){s.target=this.itemPull[this.idPrefix+n]["href_target"]}s.style.display="none";document.body.appendChild(s);s.submit();if(s!=null){document.body.removeChild(s);s=null}return}if(x.charAt(0)=="c"){return}if(x.charAt(1)=="d"){return}if(x.charAt(2)=="s"){return}if(this.checkEvent("onClick")){this.callEvent("onClick",[n,this.conf.ctx_zoneid,r])}else{if((x.charAt(1)=="d")||(this.conf.mode=="win"&&x.charAt(2)=="t")){return}}if(this.conf.context&&this._isContextMenuVisible()&&this.conf.ctx_autohide){this._hideContextMenu()}else{if(this._clearAndHide){this._clearAndHide()}}};this._doOnTouchMenu=function(a){if(this.conf.is_touched==false){this.conf.is_touched=true;if(this.checkEvent("onTouch")){this.callEvent("onTouch",[a])}}};this._searchMenuNode=function(o,s){var a=new Array();for(var r=0;r<s.length;r++){if(typeof(s[r])=="object"){if(s[r].length==5){if(typeof(s[r][0])!="object"){if((s[r][0].replace(this.idPrefix,"")==o)&&(r==0)){a=s}}}var n=this._searchMenuNode(o,s[r]);if(n.length>0){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 m="dhxId_";var o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var n=0;n<a;n++){m+=o.charAt(Math.round(Math.random()*(o.length-1)))}return m};this.getItemType=function(a){a=this.idPrefix+a;if(this.itemPull[a]==null){return null}return this.itemPull[a]["type"]};this.forEachItem=function(n){for(var m in this.itemPull){n(String(m).replace(this.idPrefix,""))}};this._clearAndHide=function(){g.conf.selected=-1;g.conf.last_click=-1;while(g.conf.opened_poly.length>0){g.conf.opened_poly.pop()}for(var a=0;a<g.conf.selected_sub.length;a++){var m=g.conf.selected_sub[a][0];if(g.idPull[m]!=null){if(g.itemPull[m]["state"]=="enabled"){if(g.idPull[m].className=="sub_item_selected"){g.idPull[m].className="sub_item"}if(g.idPull[m].className=="dhtmlxMenu_"+g.conf.skin+"_TopLevel_Item_Selected"){if(g.itemPull[m]["cssNormal"]!=null){g.idPull[m].className=g.itemPull[m]["cssNormal"]}else{g.idPull[m].className="dhtmlxMenu_"+g.conf.skin+"_TopLevel_Item_Normal"}}}}g._hidePolygon(m)}g.conf.is_touched=false;if(g.conf.context&&g.conf.ctx_hideall){g._hidePolygon(g.idPrefix+g.topId)}};this._showSubLevelItem=function(m,a){if(document.getElementById("arrow_"+this.idPrefix+m)!=null){document.getElementById("arrow_"+this.idPrefix+m).style.display=(a?"none":"")}if(document.getElementById("image_"+this.idPrefix+m)!=null){document.getElementById("image_"+this.idPrefix+m).style.display=(a?"none":"")}if(document.getElementById(this.idPrefix+m)!=null){document.getElementById(this.idPrefix+m).style.display=(a?"":"none")}};this._hideSubLevelItem=function(a){this._showSubLevelItem(a,true)};this.idPrefix=this._genStr(12)+"_";this._bodyClick=function(a){a=a||event;if(a.button==2||(window.dhx4.isOpera&&a.ctrlKey==true)){return}if(g.conf.context){if(g.conf.ctx_autohide&&(!window.dhx4.isOpera||(g._isContextMenuVisible()&&window.dhx4.isOpera))){g._hideContextMenu()}}else{if(g._clearAndHide){g._clearAndHide()}}};this._bodyContext=function(n){n=n||event;var m=String((n.srcElement||n.target).className);if(m.search("dhtmlxMenu")!=-1&&m.search("SubLevelArea")!=-1){return}var a=true;var o=n.target||n.srcElement;while(o!=null){if(o.id!=null){if(g.isContextZone(o.id)){a=false}}if(o==document.body){a=false}o=o.parentNode}if(a){g.hideContextMenu()}};if(typeof(window.addEventListener)!="undefined"){window.addEventListener("click",this._bodyClick,false);window.addEventListener("contextmenu",this._bodyContext,false)}else{document.body.attachEvent("onclick",this._bodyClick);document.body.attachEvent("oncontextmenu",this._bodyContext)}this.unload=function(){window.dhx4._eventable(this,"clear");dhtmlXMenuObject.prototype.liveInst[this.conf.live_id]=null;try{delete dhtmlXMenuObject.prototype.liveInst[this.conf.live_id]}catch(n){}this.conf.live_id=null;if(typeof(window.addEventListener)=="function"){window.removeEventListener("click",this._bodyClick,false);window.removeEventListener("contextmenu",this._bodyContext,false)}else{document.body.detachEvent("onclick",this._bodyClick);document.body.detachEvent("oncontextmenu",this._bodyContext)}this._bodyClick=null;this._bodyContext=null;this.removeItem(this.idPrefix+this.topId,true);this.itemPull=null;this.idPull=null;if(this.conf.context){for(var m in this.conf.ctx_zones){this.removeContextZone(m)}}if(this.cont!=null){this.cont.className="";this.cont.parentNode.removeChild(this.cont);this.cont=null}if(this.base!=null){if(!this.conf.context){this.base.className=""}if(!this.conf.context){this.base.oncontextmenu=(this.base._oldContextMenuHandler||null)}this.base.onselectstart=null;this.base=null}for(var m in this){this[m]=null}g=null};dhtmlXMenuObject.prototype.liveInst[this.conf.live_id]=this;window.dhx4._enableDataLoading(this,"_initObj","_xmlToJson",this.conf.tags.root,{struct:true});window.dhx4._eventable(this);if(window.dhx4.s2b(this.conf.autoload.context)==true){this.renderAsContextMenu()}if(this.conf.autoload.dynamic!=null){this.enableDynamicLoading(this.conf.autoload.dynamic,window.dhx4.s2b(this.conf.autoload.dynamic_icon))}else{if(this.conf.autoload.items!=null){this.loadStruct(this.conf.autoload.items,this.conf.autoload.onload)}else{if(this.conf.autoload.json!=null){this.loadStruct(this.conf.autoload.json,this.conf.autoload.onload)}else{if(this.conf.autoload.xml!=null){this.loadStruct(this.conf.autoload.xml,this.conf.autoload.onload)}}}}for(var e in {onclick:1,oncheckboxclick:1,onradioclick:1}){if(this.conf.autoload[e]!=null){if(typeof(this.conf.autoload[e])=="function"){this.attachEvent(e,this.conf.autoload[e])}else{if(typeof(window[this.conf.autoload[e]])=="function"){this.attachEvent(e,window[this.conf.autoload[e]])}}}}if(this.conf.autoload.top_text!=null){this.setTopText(this.conf.autoload.top_text)}if(this.conf.autoload.align!=null){this.setAlign(this.conf.autoload.align)}if(this.conf.autoload.open_mode!=null){this.setOpenMode(this.conf.autoload.open_mode)}if(this.conf.autoload.overflow!=null){this.setOverflowHeight(this.conf.autoload.overflow)}for(var e in this.conf.autoload){this.conf.autoload[e]=null;delete this.conf.autoload[e]}this.conf.autoload=null;return this}dhtmlXMenuObject.prototype._init=function(){if(this._isInited==true){return}if(this.conf.dload){this._dhxdataload.onBeforeXLS=function(){var e={params:{}};for(var c in this.conf.dload_params){e.params[c]=this.conf.dload_params[c]}return e};this.loadStruct(this.conf.dload_url)}else{this._initTopLevelMenu();this._isInited=true}};dhtmlXMenuObject.prototype._countVisiblePolygonItems=function(l){var g=0;for(var c in this.itemPull){var e=this.itemPull[c]["parent"];var h=this.itemPull[c]["type"];if(this.idPull[c]!=null){if(e==l&&(h=="item"||h=="radio"||h=="checkbox")&&this.idPull[c].style.display!="none"){g++}}}return g};dhtmlXMenuObject.prototype._redefineComplexState=function(c){if(this.idPrefix+this.topId==c){return}if((this.idPull["polygon_"+c]!=null)&&(this.idPull[c]!=null)){var a=this._countVisiblePolygonItems(c);if((a>0)&&(!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(h,e,g){if((!this.conf.context)&&(this._getItemLevelType(h.replace(this.idPrefix,""))=="TopLevel")){this.itemPull[h]["complex"]=e;return}if((this.idPull[h]==null)||(this.itemPull[h]==null)){return}this.itemPull[h]["complex"]=e;if(h==this.idPrefix+this.topId){return}var a=null;var c=this.idPull[h].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[h]["complex"]){if(a==null){a=document.createElement("DIV");a.className="complex_arrow";a.id="arrow_"+h;while(c.childNodes.length>0){c.removeChild(c.childNodes[0])}c.appendChild(a)}if(this.conf.dload&&(this.itemPull[h].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[h]["complex"])&&(a!=null)){c.removeChild(a);if(this.itemPull[h]["hotkey_backup"]!=null&&this.setHotKey){this.setHotKey(h.replace(this.idPrefix,""),this.itemPull[h]["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 o=this.itemPull[g]["type"];if(o=="checkbox"||o=="radio"){return}var l=(this.itemPull[g]["parent"]==this.idPrefix+this.topId&&!this.conf.context);var m=null;if(l){for(var a=0;a<this.idPull[g].childNodes.length;a++){try{if(this.idPull[g].childNodes[a].className=="dhtmlxMenu_TopLevel_Item_Icon"){m=this.idPull[g].childNodes[a]}}catch(n){}}}else{try{var m=this.idPull[g].childNodes[this.conf.rtl?2:0].childNodes[0]}catch(n){}if(!(m!=null&&typeof(m.className)!="undefined"&&m.className=="sub_icon")){m=null}}var s=this.itemPull[g][(this.itemPull[g]["state"]=="enabled"?"imgen":"imgdis")];if(s.length>0){if(m!=null){m.src=this.conf.icons_path+s}else{if(l){var m=document.createElement("IMG");m.className="dhtmlxMenu_TopLevel_Item_Icon";m.src=this.conf.icons_path+s;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+s;m.border="0";m.id="image_"+g;var r=this.idPull[g].childNodes[this.conf.rtl?2:0];while(r.childNodes.length>0){r.removeChild(r.childNodes[0])}r.appendChild(m)}}}else{if(m!=null){var c=m.parentNode;c.removeChild(m);c.innerHTML="&nbsp;";c=m=null}}};dhtmlXMenuObject.prototype._getAllParents=function(l){var e=new Array();for(var c in this.itemPull){if(this.itemPull[c]["parent"]==l){e[e.length]=this.itemPull[c]["id"];if(this.itemPull[c]["complex"]){var g=this._getAllParents(this.itemPull[c]["id"]);for(var h=0;h<g.length;h++){e[e.length]=g[h]}}}}return e};dhtmlXMenuObject.prototype._autoDetectVisibleArea=function(){if(this.conf.v_enabled){return}var a=window.dhx4.screenDim();this.conf.v.x1=a.left;this.conf.v.x2=a.right;this.conf.v.y1=a.top;this.conf.v.y2=a.bottom};dhtmlXMenuObject.prototype.getItemPosition=function(h){h=this.idPrefix+h;var g=-1;if(this.itemPull[h]==null){return g}var a=this.itemPull[h]["parent"];var e=(this.idPull["polygon_"+a]!=null?this.idPull["polygon_"+a].tbd:this.cont);for(var c=0;c<e.childNodes.length;c++){if(e.childNodes[c]==this.idPull["separator_"+h]||e.childNodes[c]==this.idPull[h]){g=c}}return g};dhtmlXMenuObject.prototype.setItemPosition=function(m,l){m=this.idPrefix+m;if(this.idPull[m]==null){return}var c=(this.itemPull[m]["parent"]==this.idPrefix+this.topId);var a=this.idPull[m];var g=this.getItemPosition(m.replace(this.idPrefix,""));var e=this.itemPull[m]["parent"];var h=(this.idPull["polygon_"+e]!=null?this.idPull["polygon_"+e].tbd:this.cont);h.removeChild(h.childNodes[g]);if(l<0){l=0}if(c&&l<1){l=1}if(l<h.childNodes.length){h.insertBefore(a,h.childNodes[l])}else{h.appendChild(a)}};dhtmlXMenuObject.prototype.getParentId=function(a){a=this.idPrefix+a;if(this.itemPull[a]==null){return null}return((this.itemPull[a]["parent"]!=null?this.itemPull[a]["parent"]:this.topId).replace(this.idPrefix,""))};dhtmlXMenuObject.prototype.hide=function(){this._clearAndHide()};dhtmlXMenuObject.prototype.clearAll=function(){this.removeItem(this.idPrefix+this.topId,true);this._isInited=false;this.idPrefix=this._genStr(12)+"_";this.itemPull={}};if(typeof(dhtmlXMenuObject.prototype.liveInst)=="undefined"){dhtmlXMenuObject.prototype.liveInst={}}dhtmlXMenuObject.prototype._redistribTopLevelSelection=function(g,c){var a=this._getSubItemToDeselectByPolygon("parent");this._removeSubItemFromSelected(-1,-1);for(var e=0;e<a.length;e++){if(a[e]!=g){this._hidePolygon(a[e])}if((this.idPull[a[e]]!=null)&&(a[e]!=g)){this.idPull[a[e]].className=this.idPull[a[e]].className.replace(/Selected/g,"Normal")}}if(this.itemPull[this.idPrefix+g]["state"]=="enabled"){this.idPull[this.idPrefix+g].className="dhtmlxMenu_"+this.conf.skin+"_TopLevel_Item_Selected";this._addSubItemToSelected(this.idPrefix+g,"parent");this.conf.selected=(this.conf.mode=="win"?(this.conf.selected!=-1?g:this.conf.selected):g);if((this.itemPull[this.idPrefix+g]["complex"])&&(this.conf.selected!=-1)){this._showPolygon(this.idPrefix+g,this.conf.dir_toplv)}}};dhtmlXMenuObject.prototype._initTopLevelMenu=function(){this.conf.dir_toplv="bottom";this.conf.dir_sublv=(this.conf.rtl?"left":"right");if(this.conf.context){this.idPull[this.idPrefix+this.topId]=new Array(0,0);this._addSubMenuPolygon(this.idPrefix+this.topId,this.idPrefix+this.topId)}else{var a=this._getMenuNodes(this.idPrefix+this.topId);for(var c=0;c<a.length;c++){if(this.itemPull[a[c]]["type"]=="item"){this._renderToplevelItem(a[c],null)}if(this.itemPull[a[c]]["type"]=="separator"){this._renderSeparator(a[c],null)}}}};dhtmlXMenuObject.prototype._renderToplevelItem=function(n,l){var h=this;var a=document.createElement("DIV");a.id=n;if(this.itemPull[n]["state"]=="enabled"&&this.itemPull[n]["cssNormal"]!=null){a.className=this.itemPull[n]["cssNormal"]}else{a.className="dhtmlxMenu_"+this.conf.skin+"_TopLevel_Item_"+(this.itemPull[n]["state"]=="enabled"?"Normal":"Disabled")}if(this.itemPull[n]["title"]!=""){var g=document.createElement("DIV");g.className="top_level_text";g.innerHTML=this.itemPull[n]["title"];a.appendChild(g)}if(this.itemPull[n]["tip"].length>0){a.title=this.itemPull[n]["tip"]}if((this.itemPull[n]["imgen"]!="")||(this.itemPull[n]["imgdis"]!="")){var e=this.itemPull[n][(this.itemPull[n]["state"]=="enabled")?"imgen":"imgdis"];if(e){var c=document.createElement("IMG");c.border="0";c.id="image_"+n;c.src=this.conf.icons_path+e;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(l!=null){l++;if(l<0){l=0}if(l>this.cont.childNodes.length-1){l=null}}if(l!=null){this.cont.insertBefore(a,this.cont.childNodes[l])}else{this.cont.appendChild(a)}this.idPull[a.id]=a;if(this.itemPull[n]["complex"]&&(!this.conf.dload)){this._addSubMenuPolygon(this.itemPull[n]["id"],this.itemPull[n]["id"])}a.onmouseover=function(){if(h.conf.mode=="web"){window.clearTimeout(h.conf.tm_handler)}var m=h._getSubItemToDeselectByPolygon("parent");h._removeSubItemFromSelected(-1,-1);for(var r=0;r<m.length;r++){if(m[r]!=this.id){h._hidePolygon(m[r])}if((h.idPull[m[r]]!=null)&&(m[r]!=this.id)){if(h.itemPull[m[r]]["cssNormal"]!=null){h.idPull[m[r]].className=h.itemPull[m[r]]["cssNormal"]}else{if(h.idPull[m[r]].className=="sub_item_selected"){h.idPull[m[r]].className="sub_item"}h.idPull[m[r]].className=h.idPull[m[r]].className.replace(/Selected/g,"Normal")}}}if(h.itemPull[this.id]["state"]=="enabled"){this.className="dhtmlxMenu_"+h.conf.skin+"_TopLevel_Item_Selected";h._addSubItemToSelected(this.id,"parent");h.conf.selected=(h.conf.mode=="win"?(h.conf.selected!=-1?this.id:h.conf.selected):this.id);if(h.conf.dload){if(h.itemPull[this.id].loaded=="no"){this._dynLoadTM=new Date().getTime();h.itemPull[this.id].loaded="get";var s=this.id.replace(h.idPrefix,"");h._dhxdataload.onBeforeXLS=function(){var u={params:{}};u.params[this.conf.dload_pid]=s;for(var q in this.conf.dload_params){u.params[q]=this.conf.dload_params[q]}return u};h.loadStruct(h.conf.dload_url)}if(h.conf.top_mode&&h.conf.mode=="web"&&!h.conf.context){this._mouseOver=true}}if((!h.conf.dload)||(h.conf.dload&&(!h.itemPull[this.id]["loaded"]||h.itemPull[this.id]["loaded"]=="yes"))){if((h.itemPull[this.id]["complex"])&&(h.conf.selected!=-1)){if(h.conf.top_mode&&h.conf.mode=="web"&&!h.conf.context){this._mouseOver=true;var o=this.id;this._menuOpenTM=window.setTimeout(function(){h._showPolygon(o,h.conf.dir_toplv)},h.conf.top_tmtime)}else{h._showPolygon(this.id,h.conf.dir_toplv)}}}}h._doOnTouchMenu(this.id.replace(h.idPrefix,""))};a.onmouseout=function(){if(!((h.itemPull[this.id]["complex"])&&(h.conf.selected!=-1))&&(h.itemPull[this.id]["state"]=="enabled")){if(h.itemPull[this.id]["cssNormal"]!=null){a.className=h.itemPull[this.id]["cssNormal"]}else{a.className="dhtmlxMenu_"+h.conf.skin+"_TopLevel_Item_Normal"}}if(h.conf.mode=="web"){window.clearTimeout(h.conf.tm_handler);h.conf.tm_handler=window.setTimeout(function(){h._clearAndHide()},h.conf.tm_sec,"JavaScript")}if(h.conf.top_mode&&h.conf.mode=="web"&&!h.conf.context){this._mouseOver=false;window.clearTimeout(this._menuOpenTM)}};a.onclick=function(r){if(h.conf.mode=="web"){window.clearTimeout(h.conf.tm_handler)}if(h.conf.mode!="web"&&h.itemPull[this.id]["state"]=="disabled"){return}r=r||event;r.cancelBubble=true;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}if(h.conf.mode=="win"){if(h.itemPull[this.id]["complex"]){if(h.conf.selected==this.id){h.conf.selected=-1;var q=false}else{h.conf.selected=this.id;var q=true}if(q){h._showPolygon(this.id,h.conf.dir_toplv)}else{h._hidePolygon(this.id)}}}var m=(h.itemPull[this.id]["complex"]?"c":"-");var u=(h.itemPull[this.id]["state"]!="enabled"?"d":"-");var o={ctrl:r.ctrlKey,alt:r.altKey,shift:r.shiftKey};h._doOnClick(this.id.replace(h.idPrefix,""),m+u+"t",o);return false};if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXMenuObject.prototype._addSubMenuPolygon=function(l,h){var c=this._renderSublevelPolygon(l,h);var a=this._getMenuNodes(h);for(e=0;e<a.length;e++){if(this.itemPull[a[e]]["type"]=="separator"){this._renderSeparator(a[e],null)}else{this._renderSublevelItem(a[e],null)}}if(l==h){var g="topLevel"}else{var g="subLevel"}for(var e=0;e<a.length;e++){if(this.itemPull[a[e]]["complex"]){this._addSubMenuPolygon(l,this.itemPull[a[e]]["id"])}}};dhtmlXMenuObject.prototype._renderSublevelPolygon=function(h,g){var c=document.createElement("DIV");c.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_Polygon "+(this.conf.rtl?"dir_right":"");c.dir="ltr";c.oncontextmenu=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}l.cancelBubble=true;return false};c.id="polygon_"+g;c.onclick=function(l){l=l||event;l.cancelBubble=true};c.style.display="none";document.body.insertBefore(c,document.body.firstChild);c.innerHTML='<div style="position:relative;"></div><div style="position: relative; overflow:hidden;"></div><div style="position:relative;"></div>';var e=document.createElement("TABLE");e.className="dhtmlxMebu_SubLevelArea_Tbl";e.cellSpacing=0;e.cellPadding=0;e.border=0;var a=document.createElement("TBODY");e.appendChild(a);c.childNodes[1].appendChild(e);c.tbl=e;c.tbd=a;this.idPull[c.id]=c;if(this.sxDacProc!=null){this.idPull["sxDac_"+g]=new this.sxDacProc(c,c.className);if(window.dhx4.isIE){this.idPull["sxDac_"+g]._setSpeed(this.dacSpeedIE);this.idPull["sxDac_"+g]._setCustomCycle(this.dacCyclesIE)}else{this.idPull["sxDac_"+g]._setSpeed(this.dacSpeed);this.idPull["sxDac_"+g]._setCustomCycle(this.dacCycles)}}return c};dhtmlXMenuObject.prototype._renderSublevelItem=function(a,q){var n=this;var o=document.createElement("TR");o.className=(this.itemPull[a]["state"]=="enabled"?"sub_item":"sub_item_dis");var m=document.createElement("TD");m.className="sub_item_icon";var r=this.itemPull[a][(this.itemPull[a]["state"]=="enabled"?"imgen":"imgdis")];if(r!=""){var v=this.itemPull[a]["type"];if(v=="checkbox"||v=="radio"){var h=document.createElement("DIV");h.id="image_"+this.itemPull[a]["id"];h.className="sub_icon "+r;m.appendChild(h)}if(!(v=="checkbox"||v=="radio")){var h=document.createElement("IMG");h.id="image_"+this.itemPull[a]["id"];h.className="sub_icon";h.src=this.conf.icons_path+r;m.appendChild(h)}}else{m.innerHTML="&nbsp;"}var l=document.createElement("TD");l.className="sub_item_text";if(this.itemPull[a]["title"]!=""){var u=document.createElement("DIV");u.className="sub_item_text";u.innerHTML=this.itemPull[a]["title"];l.appendChild(u)}else{l.innerHTML="&nbsp;"}var g=document.createElement("TD");g.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"];g.appendChild(c)}else{if(this.itemPull[a]["hotkey"].length>0&&!this.itemPull[a]["complex"]){var e=document.createElement("DIV");e.className="sub_item_hk";e.innerHTML=this.itemPull[a]["hotkey"];g.appendChild(e)}else{g.innerHTML="&nbsp;"}}o.appendChild(this.conf.rtl?g:m);o.appendChild(l);o.appendChild(this.conf.rtl?m:g);o.id=this.itemPull[a]["id"];o.parent=this.itemPull[a]["parent"];if(this.itemPull[a]["tip"].length>0){o.title=this.itemPull[a]["tip"]}o.onselectstart=function(w){w=w||event;if(w.preventDefault){w.preventDefault()}else{w.returnValue=false}return false};o.onmouseover=function(w){if(n.conf.hide_tm[this.id]){window.clearTimeout(n.conf.hide_tm[this.id])}if(n.conf.mode=="web"){window.clearTimeout(n.conf.tm_handler)}if(!this._visible){n._redistribSubLevelSelection(this.id,this.parent)}this._visible=true};o.onmouseout=function(){if(n.conf.mode=="web"){if(n.conf.tm_handler){window.clearTimeout(n.conf.tm_handler)}n.conf.tm_handler=window.setTimeout(function(){if(n&&n._clearAndHide){n._clearAndHide()}},n.conf.tm_sec,"JavaScript")}var w=this;if(n.conf.hide_tm[this.id]){window.clearTimeout(n.conf.hide_tm[this.id])}n.conf.hide_tm[this.id]=window.setTimeout(function(){w._visible=false},50)};o.onclick=function(x){if(!n.checkEvent("onClick")&&n.itemPull[this.id]["complex"]){return}x=x||event;x.cancelBubble=true;if(x.preventDefault){x.preventDefault()}else{x.returnValue=false}tc=(n.itemPull[this.id]["complex"]?"c":"-");td=(n.itemPull[this.id]["state"]=="enabled"?"-":"d");var w={ctrl:x.ctrlKey,alt:x.altKey,shift:x.shiftKey};switch(n.itemPull[this.id]["type"]){case"checkbox":n._checkboxOnClickHandler(this.id.replace(n.idPrefix,""),tc+td+"n",w);break;case"radio":n._radioOnClickHandler(this.id.replace(n.idPrefix,""),tc+td+"n",w);break;case"item":n._doOnClick(this.id.replace(n.idPrefix,""),tc+td+"n",w);break}return false};var s=this.idPull["polygon_"+this.itemPull[a]["parent"]];if(q!=null){q++;if(q<0){q=0}if(q>s.tbd.childNodes.length-1){q=null}}if(q!=null&&s.tbd.childNodes[q]!=null){s.tbd.insertBefore(o,s.tbd.childNodes[q])}else{s.tbd.appendChild(o)}this.idPull[o.id]=o};dhtmlXMenuObject.prototype._renderSeparator=function(c,m){var a=(this.conf.context?"SubLevelArea":(this.itemPull[c]["parent"]==this.idPrefix+this.topId?"TopLevel":"SubLevelArea"));if(a=="TopLevel"&&this.conf.context){return}var h=this;if(a!="TopLevel"){var l=document.createElement("TR");l.className="sub_sep";var e=document.createElement("TD");e.colSpan="3";l.appendChild(e)}var g=document.createElement("DIV");g.id="separator_"+c;g.className=(a=="TopLevel"?"top_sep":"sub_sep");g.onselectstart=function(q){q=q||event;if(q.preventDefault){q.preventDefault()}else{q.returnValue=false}};g.onclick=function(r){r=r||event;r.cancelBubble=true;var q={ctrl:r.ctrlKey,alt:r.altKey,shift:r.shiftKey};h._doOnClick(this.id.replace("separator_"+h.idPrefix,""),"--s",q)};if(a=="TopLevel"){if(m!=null){m++;if(m<0){m=0}if(this.cont.childNodes[m]!=null){this.cont.insertBefore(g,this.cont.childNodes[m])}else{this.cont.appendChild(g)}}else{var o=this.cont.childNodes[this.cont.childNodes.length-1];if(String(o).search("TopLevel_Text")==-1){this.cont.appendChild(g)}else{this.cont.insertBefore(g,o)}}this.idPull[g.id]=g}else{var n=this.idPull["polygon_"+this.itemPull[c]["parent"]];if(m!=null){m++;if(m<0){m=0}if(m>n.tbd.childNodes.length-1){m=null}}if(m!=null&&n.tbd.childNodes[m]!=null){n.tbd.insertBefore(l,n.tbd.childNodes[m])}else{n.tbd.appendChild(l)}e.appendChild(g);this.idPull[g.id]=l}};dhtmlXMenuObject.prototype.addNewSeparator=function(a,c){c=this.idPrefix+(c!=null?c:this._genStr(24));var e=this.idPrefix+this.getParentId(a);this._addItemIntoGlobalStrorage(c,e,"","separator",false,"","");this._renderSeparator(c,this.getItemPosition(a))};dhtmlXMenuObject.prototype._initObj=function(s,u,m){if(!(s instanceof Array)){m=s.parentId;if(m!=null&&String(m).indexOf(this.idPrefix)!==0){m=this.idPrefix+String(m)}s=s.items}for(var e=0;e<s.length;e++){if(typeof(s[e].id)=="undefined"||s[e].id==null){s[e].id=this._genStr(24)}if(s[e].text==null){s[e].text=""}if(String(s[e].id).indexOf(this.idPrefix)!==0){s[e].id=this.idPrefix+String(s[e].id)}var g={type:"item",tip:"",hotkey:"",state:"enabled",imgen:"",imgdis:""};for(var v in g){if(typeof(s[e][v])=="undefined"){s[e][v]=g[v]}}if(s[e].imgen==""&&s[e].img!=null){s[e].imgen=s[e].img}if(s[e].imgdis==""&&s[e].img_disabled!=null){s[e].imgdis=s[e].img_disabled}if(s[e].title==null&&s[e].text!=null){s[e].title=s[e].text}if(s[e].href!=null){if(s[e].href.link!=null){s[e].href_link=s[e].href.link}if(s[e].href.target!=null){s[e].href_target=s[e].href.target}}if(s[e].userdata!=null){for(var v in s[e].userdata){this.userData[s[e].id+"_"+v]=s[e].userdata[v]}}if(typeof(s[e].enabled)!="undefined"&&window.dhx4.s2b(s[e].enabled)==false){s[e].state="disabled"}else{if(typeof(s[e].disabled)!="undefined"&&window.dhx4.s2b(s[e].disabled)==true){s[e].state="disabled"}}if(typeof(s[e].parent)=="undefined"){s[e].parent=(m!=null?m:this.idPrefix+this.topId)}if(s[e].type=="checkbox"){s[e].checked=window.dhx4.s2b(s[e].checked);s[e].imgen=s[e].imgdis="chbx_"+(s[e].checked?"1":"0")}if(s[e].type=="radio"){s[e].checked=window.dhx4.s2b(s[e].checked);s[e].imgen=s[e].imgdis="rdbt_"+(s[e].checked?"1":"0");if(typeof(s[e].group)=="undefined"||s[e].group==null){s[e].group=this._genStr(24)}if(this.radio[s[e].group]==null){this.radio[s[e].group]=[]}this.radio[s[e].group].push(s[e].id)}this.itemPull[s[e].id]=s[e];if(s[e].items!=null&&s[e].items.length>0){this.itemPull[s[e].id].complex=true;this._initObj(s[e].items,true,s[e].id)}else{if(this.conf.dload&&s[e].complex==true){this.itemPull[s[e].id].loaded="no"}}this.itemPull[s[e].id].items=null}if(u!==true){if(this.conf.dload==true){if(m==null){this._initTopLevelMenu()}else{this._addSubMenuPolygon(m,m);if(this.conf.selected==m){var r=(this.itemPull[m].parent==this.idPrefix+this.topId);var c=(r&&!this.conf.context?this.conf.dir_toplv:this.conf.dir_sublv);var h=false;if(r&&this.conf.top_mode&&this.conf.mode=="web"&&!this.conf.context){var w=this.idPull[m];if(w._mouseOver==true){var l=this.conf.top_tmtime-(new Date().getTime()-w._dynLoadTM);if(l>1){var o=m;var n=this;w._menuOpenTM=window.setTimeout(function(){n._showPolygon(o,c);n=o=null},l);h=true}}}if(!h){this._showPolygon(m,c)}}this.itemPull[m].loaded="yes";if(this.conf.dload_icon==true){this._updateLoaderIcon(m,false)}}}else{this._init()}}};dhtmlXMenuObject.prototype._xmlToJson=function(h,g){var m=[];if(g==null){var n=h.getElementsByTagName(this.conf.tags.root);if(n==null||(n!=null&&n.length==0)){return{items:[]}}n=n[0]}else{n=h}if(n.getAttribute("parentId")!=null){g=this.idPrefix+n.getAttribute("parentId")}for(var c=0;c<n.childNodes.length;c++){if(typeof(n.childNodes[c].tagName)!="undefined"&&String(n.childNodes[c].tagName).toLowerCase()==this.conf.tags.item){var a=n.childNodes[c];var u={id:this.idPrefix+(a.getAttribute("id")||this._genStr(24)),title:a.getAttribute("text")||"",imgen:a.getAttribute("img")||"",imgdis:a.getAttribute("imgdis")||"",tip:"",hotkey:"",type:a.getAttribute("type")||"item"};if(a.getAttribute("cssNormal")!=null){u.cssNormal=a.getAttribute("cssNormal")}if(u.type=="checkbox"){u.checked=a.getAttribute("checked")}if(u.type=="radio"){u.checked=a.getAttribute("checked");u.group=a.getAttribute("group")}u.state="enabled";if(a.getAttribute("enabled")!=null&&window.dhx4.s2b(a.getAttribute("enabled"))==false){u.state="disabled"}else{if(a.getAttribute("disabled")!=null&&window.dhx4.s2b(a.getAttribute("disabled"))==true){u.state="disabled"}}u.parent=(g!=null?g:this.idPrefix+this.topId);if(this.conf.dload){u.complex=(a.getAttribute("complex")!=null);if(u.complex){u.loaded="no"}}else{var e=this._xmlToJson(a,u.id);u.items=e.items;u.complex=(u.items.length>0)}for(var o=0;o<a.childNodes.length;o++){if(typeof(a.childNodes[o].tagName)!="undefined"){var s=String(a.childNodes[o].tagName||"").toLowerCase();if(s==this.conf.tags.userdata){var l=a.childNodes[o];if(l.getAttribute("name")!=null){this.userData[u.id+"_"+l.getAttribute("name")]=(l.firstChild!=null&&l.firstChild.nodeValue!=null?l.firstChild.nodeValue:"")}}if(s==this.conf.tags.text_ext){u.title=a.childNodes[o].firstChild.nodeValue}if(s==this.conf.tags.tooltip){u.tip=a.childNodes[o].firstChild.nodeValue}if(s==this.conf.tags.hotkey){u.hotkey=a.childNodes[o].firstChild.nodeValue}if(s==this.conf.tags.href&&u.type=="item"){u.href_link=a.childNodes[o].firstChild.nodeValue;if(a.childNodes[o].getAttribute("target")!=null){u.href_target=a.childNodes[o].getAttribute("target")}}}}m.push(u)}}var a={parentId:g,items:m};return a};dhtmlXMenuObject.prototype.enableDynamicLoading=function(a,c){this.conf.dload=true;this.conf.dload_url=a;this.conf.dload_sign=(String(this.conf.dload_url).search(/\?/)==-1?"?":"&");this.conf.dload_icon=c;this._init()};dhtmlXMenuObject.prototype._updateLoaderIcon=function(g,e){if(this.idPull[g]==null){return}if(String(this.idPull[g].className).search("TopLevel_Item")>=0){return}var c=(this.conf.rtl?0:2);if(!this.idPull[g].childNodes[c]){return}if(!this.idPull[g].childNodes[c].childNodes[0]){return}var a=this.idPull[g].childNodes[c].childNodes[0];if(String(a.className).search("complex_arrow")===0){a.className="complex_arrow"+(e?"_loading":"")}};dhtmlXMenuObject.prototype.addNewSibling=function(g,h,a,c,e,n){var m=this.idPrefix+(h!=null?h:this._genStr(24));var l=this.idPrefix+(g!=null?this.getParentId(g):this.topId);this._addItemIntoGlobalStrorage(m,l,a,"item",c,e,n);if((l==this.idPrefix+this.topId)&&(!this.conf.context)){this._renderToplevelItem(m,this.getItemPosition(g))}else{this._renderSublevelItem(m,this.getItemPosition(g))}};dhtmlXMenuObject.prototype.addNewChild=function(m,l,g,a,c,e,h){if(m==null){if(this.conf.context){m=this.topId}else{this.addNewSibling(m,g,a,c,e,h);if(l!=null){this.setItemPosition(g,l)}return}}g=this.idPrefix+(g!=null?g:this._genStr(24));if(this.setHotKey){this.setHotKey(m,"")}m=this.idPrefix+m;this._addItemIntoGlobalStrorage(g,m,a,"item",c,e,h);if(this.idPull["polygon_"+m]==null){this._renderSublevelPolygon(m,m)}this._renderSublevelItem(g,l-1);this._redefineComplexState(m)};dhtmlXMenuObject.prototype.removeItem=function(g,l,h){if(!l){g=this.idPrefix+g}var m=null;if(g!=this.idPrefix+this.topId){if(this.itemPull[g]==null){return}if(this.idPull["polygon_"+g]&&this.idPull["polygon_"+g]._tmShow){window.clearTimeout(this.idPull["polygon_"+g]._tmShow)}var u=this.itemPull[g]["type"];if(u=="separator"){var s=this.idPull["separator_"+g];if(this.itemPull[g]["parent"]==this.idPrefix+this.topId){s.onclick=null;s.onselectstart=null;s.id=null;s.parentNode.removeChild(s)}else{s.childNodes[0].childNodes[0].onclick=null;s.childNodes[0].childNodes[0].onselectstart=null;s.childNodes[0].childNodes[0].id=null;s.childNodes[0].removeChild(s.childNodes[0].childNodes[0]);s.removeChild(s.childNodes[0]);s.parentNode.removeChild(s)}this.idPull["separator_"+g]=null;this.itemPull[g]=null;delete this.idPull["separator_"+g];delete this.itemPull[g];s=null}else{m=this.itemPull[g]["parent"];var s=this.idPull[g];s.onclick=null;s.oncontextmenu=null;s.onmouseover=null;s.onmouseout=null;s.onselectstart=null;s.id=null;while(s.childNodes.length>0){s.removeChild(s.childNodes[0])}s.parentNode.removeChild(s);this.idPull[g]=null;this.itemPull[g]=null;delete this.idPull[g];delete this.itemPull[g];s=null}u=null}for(var o in this.itemPull){if(this.itemPull[o]["parent"]==g){this.removeItem(o,true,true)}}var r=new Array(g);if(m!=null&&!h){if(this.idPull["polygon_"+m]!=null){if(this.idPull["polygon_"+m].tbd.childNodes.length==0){r.push(m);this._updateItemComplexState(m,false,false)}}}for(var c=0;c<r.length;c++){if(this.idPull["polygon_"+r[c]]){var e=this.idPull["polygon_"+r[c]];e.onclick=null;e.oncontextmenu=null;e.tbl.removeChild(e.tbd);e.tbd=null;e.childNodes[1].removeChild(e.tbl);e.tbl=null;e.id=null;e.parentNode.removeChild(e);e=null;if(window.dhx4.isIE6){var n="polygon_"+r[c]+"_ie6cover";if(this.idPull[n]!=null){document.body.removeChild(this.idPull[n]);delete this.idPull[n]}}if(this.idPull["arrowup_"+g]!=null&&this._removeArrow){this._removeArrow("arrowup_"+g)}if(this.idPull["arrowdown_"+g]!=null&&this._removeArrow){this._removeArrow("arrowdown_"+g)}this.idPull["polygon_"+r[c]]=null;delete this.idPull["polygon_"+r[c]]}}r=null;if(this.conf.skin=="dhx_terrace"&&arguments.length==1){this._improveTerraceSkin()}};dhtmlXMenuObject.prototype._addItemIntoGlobalStrorage=function(n,a,e,m,g,c,l){var h={id:n,title:e,imgen:(c!=null?c:""),imgdis:(l!=null?l:""),type:m,state:(g==true?"disabled":"enabled"),parent:a,complex:false,hotkey:"",tip:""};this.itemPull[h.id]=h};dhtmlXMenuObject.prototype.renderAsContextMenu=function(){this.conf.context=true;if(this.base._autoSkinUpdate==true){this.base.className=this.base.className.replace("dhtmlxMenu_"+this.conf.skin+"_Middle","");this.base._autoSkinUpdate=false}if(this.conf.ctx_baseid!=null){this.addContextZone(this.conf.ctx_baseid)}};dhtmlXMenuObject.prototype.addContextZone=function(c){if(c==document.body){c="document.body."+this.idPrefix;var g=document.body}else{if(typeof(c)=="string"){var g=document.getElementById(c)}else{var g=c}}var l=false;for(var e in this.conf.ctx_zones){l=l||(e==c)||(this.conf.ctx_zones[e]==g)}if(l==true){return false}this.conf.ctx_zones[c]=g;var h=this;if(window.dhx4.isOpera){this.operaContext=function(a){h._doOnContextMenuOpera(a,h)};g.addEventListener("mouseup",this.operaContext,false)}else{if(g.oncontextmenu!=null&&!g._oldContextMenuHandler){g._oldContextMenuHandler=g.oncontextmenu}g.oncontextmenu=function(m){for(var a in dhtmlXMenuObject.prototype.liveInst){if(a!=h.conf.live_id){if(dhtmlXMenuObject.prototype.liveInst[a].context){dhtmlXMenuObject.prototype.liveInst[a]._hideContextMenu()}}}m=m||event;m.cancelBubble=true;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}h._doOnContextBeforeCall(m,this);return false}}};dhtmlXMenuObject.prototype._doOnContextMenuOpera=function(g,a){for(var c in dhtmlXMenuObject.prototype.liveInst){if(c!=a.conf.live_id){if(dhtmlXMenuObject.prototype.liveInst[c].context){dhtmlXMenuObject.prototype.liveInst[c]._hideContextMenu()}}}g.cancelBubble=true;if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}if(g.button==0&&g.ctrlKey==true){a._doOnContextBeforeCall(g,this)}return false};dhtmlXMenuObject.prototype.removeContextZone=function(a){if(!this.isContextZone(a)){return false}if(a==document.body){a="document.body."+this.idPrefix}var c=this.conf.ctx_zones[a];if(window.dhx4.isOpera){c.removeEventListener("mouseup",this.operaContext,false)}else{c.oncontextmenu=(c._oldContextMenuHandler!=null?c._oldContextMenuHandler:null);c._oldContextMenuHandler=null}try{this.conf.ctx_zones[a]=null;delete this.conf.ctx_zones[a]}catch(g){}return true};dhtmlXMenuObject.prototype.isContextZone=function(a){if(a==document.body&&this.conf.ctx_zones["document.body."+this.idPrefix]!=null){return true}var c=false;if(this.conf.ctx_zones[a]!=null){if(this.conf.ctx_zones[a]==document.getElementById(a)){c=true}}return c};dhtmlXMenuObject.prototype._isContextMenuVisible=function(){if(this.idPull["polygon_"+this.idPrefix+this.topId]==null){return false}return(this.idPull["polygon_"+this.idPrefix+this.topId].style.display=="")};dhtmlXMenuObject.prototype._showContextMenu=function(c,e,a){this._clearAndHide();if(this.idPull["polygon_"+this.idPrefix+this.topId]==null){return false}window.clearTimeout(this.conf.tm_handler);this.idPull[this.idPrefix+this.topId]=new Array(c,e);this._showPolygon(this.idPrefix+this.topId,"bottom");this.callEvent("onContextMenu",[a])};dhtmlXMenuObject.prototype._hideContextMenu=function(){if(this.idPull["polygon_"+this.idPrefix+this.topId]==null){return false}this._clearAndHide();this._hidePolygon(this.idPrefix+this.topId)};dhtmlXMenuObject.prototype._doOnContextBeforeCall=function(l,n){this.conf.ctx_zoneid=n.id;this._clearAndHide();this._hideContextMenu();var h=(l.srcElement||l.target);var c=(window.dhx4.isIE||window.dhx4.isOpera||window.dhx4.isKHTML||window.dhx4.isEdge?l.offsetX:l.layerX);var a=(window.dhx4.isIE||window.dhx4.isOpera||window.dhx4.isKHTML||window.dhx4.isEdge?l.offsetY:l.layerY);var m=window.dhx4.absLeft(h)+c;var g=window.dhx4.absTop(h)+a;if(this.checkEvent("onBeforeContextMenu")){if(this.callEvent("onBeforeContextMenu",[n.id,l])){if(this.conf.ctx_autoshow){this._showContextMenu(m,g,n.id);this.callEvent("onAfterContextMenu",[n.id,l])}}}else{if(this.conf.ctx_autoshow){this._showContextMenu(m,g,n.id);this.callEvent("onAfterContextMenu",[n.id])}}};dhtmlXMenuObject.prototype.showContextMenu=function(a,c){this._showContextMenu(a,c,false)};dhtmlXMenuObject.prototype.hideContextMenu=function(){this._hideContextMenu()};dhtmlXMenuObject.prototype.setAutoShowMode=function(a){this.conf.ctx_autoshow=(a==true?true:false)};dhtmlXMenuObject.prototype.setAutoHideMode=function(a){this.conf.ctx_autohide=(a==true?true:false)};dhtmlXMenuObject.prototype.setContextMenuHideAllMode=function(a){this.conf.ctx_hideall=(a==true?true:false)};dhtmlXMenuObject.prototype.getContextMenuHideAllMode=function(){return this.conf.ctx_hideall};dhtmlXMenuObject.prototype._improveTerraceSkin=function(){for(var e in this.itemPull){if(this.itemPull[e].parent==this.idPrefix+this.topId&&this.idPull[e]!=null){var h=false;var g=false;if(this.idPull[e].parentNode.firstChild==this.idPull[e]){h=true}if(this.idPull[e].parentNode.lastChild==this.idPull[e]){g=true}for(var c in this.itemPull){if(this.itemPull[c].type=="separator"&&this.itemPull[c].parent==this.idPrefix+this.topId){if(this.idPull[e].nextSibling==this.idPull["separator_"+c]){g=true}if(this.idPull[e].previousSibling==this.idPull["separator_"+c]){h=true}}}this.idPull[e].style.borderLeftWidth=(h?"1px":"0px");this.idPull[e].style.borderTopLeftRadius=this.idPull[e].style.borderBottomLeftRadius=(h?"3px":"0px");this.idPull[e].style.borderTopRightRadius=this.idPull[e].style.borderBottomRightRadius=(g?"3px":"0px");this.idPull[e]._bl=h;this.idPull[e]._br=g}}};dhtmlXMenuObject.prototype._improveTerraceButton=function(c,a){if(a){this.idPull[c].style.borderBottomLeftRadius=(this.idPull[c]._bl?"3px":"0px");this.idPull[c].style.borderBottomRightRadius=(this.idPull[c]._br?"3px":"0px")}else{this.idPull[c].style.borderBottomLeftRadius="0px";this.idPull[c].style.borderBottomRightRadius="0px"}};if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype._createNode_menu=function(h,c,g,a,e){if(typeof(e)!="undefined"){h=e}else{h=document.createElement("DIV");h.className="dhx_cell_menu_"+(this.conf.borders?"def":"no_borders");h.appendChild(document.createElement("DIV"))}this.cell.insertBefore(h,this.cell.childNodes[this.conf.idx.toolbar||this.conf.idx.cont]);this.conf.ofs_nodes.t.menu=true;this._updateIdx();return h};dhtmlXCellObject.prototype.attachMenu=function(a){if(this.dataNodes.menu){return}this.callEvent("_onBeforeContentAttach",["menu"]);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;this.callEvent("_onContentAttach",[]);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.getAttachedMenu=function(){return this.dataNodes.menu}}dhtmlXMenuObject.prototype.setItemEnabled=function(a){this._changeItemState(a,"enabled",this._getItemLevelType(a))};dhtmlXMenuObject.prototype.setItemDisabled=function(a){this._changeItemState(a,"disabled",this._getItemLevelType(a))};dhtmlXMenuObject.prototype.isItemEnabled=function(a){return(this.itemPull[this.idPrefix+a]!=null?(this.itemPull[this.idPrefix+a]["state"]=="enabled"):false)};dhtmlXMenuObject.prototype._changeItemState=function(h,g,c){var e=false;var a=this.idPrefix+h;if((this.itemPull[a]!=null)&&(this.idPull[a]!=null)){if(this.itemPull[a]["state"]!=g){this.itemPull[a]["state"]=g;if(this.itemPull[a]["parent"]==this.idPrefix+this.topId&&!this.conf.context){this.idPull[a].className="dhtmlxMenu_"+this.conf.skin+"_TopLevel_Item_"+(this.itemPull[a]["state"]=="enabled"?"Normal":"Disabled")}else{this.idPull[a].className="sub_item"+(this.itemPull[a]["state"]=="enabled"?"":"_dis")}this._updateItemComplexState(this.idPrefix+h,this.itemPull[this.idPrefix+h]["complex"],false);this._updateItemImage(h,c);if((this.idPrefix+this.conf.last_click==a)&&(c!="TopLevel")){this._redistribSubLevelSelection(a,this.itemPull[a]["parent"])}if(c=="TopLevel"&&!this.conf.context){}}}return e};dhtmlXMenuObject.prototype.getItemText=function(a){return(this.itemPull[this.idPrefix+a]!=null?this.itemPull[this.idPrefix+a]["title"]:"")};dhtmlXMenuObject.prototype.setItemText=function(l,h){l=this.idPrefix+l;if((this.itemPull[l]!=null)&&(this.idPull[l]!=null)){this._clearAndHide();this.itemPull[l]["title"]=h;if(this.itemPull[l]["parent"]==this.idPrefix+this.topId&&!this.conf.context){var g=null;for(var a=0;a<this.idPull[l].childNodes.length;a++){try{if(this.idPull[l].childNodes[a].className=="top_level_text"){g=this.idPull[l].childNodes[a]}}catch(c){}}if(String(this.itemPull[l]["title"]).length==""||this.itemPull[l]["title"]==null){if(g!=null){g.parentNode.removeChild(g)}}else{if(!g){g=document.createElement("DIV");g.className="top_level_text";if(this.conf.rtl&&this.idPull[l].childNodes.length>0){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;a<this.idPull[l].childNodes[1].childNodes.length;a++){if(String(this.idPull[l].childNodes[1].childNodes[a].className||"")=="sub_item_text"){g=this.idPull[l].childNodes[1].childNodes[a]}}if(String(this.itemPull[l]["title"]).length==""||this.itemPull[l]["title"]==null){if(g){g.parentNode.removeChild(g);g=null;this.idPull[l].childNodes[1].innerHTML="&nbsp;"}}else{if(!g){g=document.createElement("DIV");g.className="sub_item_text";this.idPull[l].childNodes[1].innerHTML="";this.idPull[l].childNodes[1].appendChild(g)}g.innerHTML=this.itemPull[l]["title"]}}}};dhtmlXMenuObject.prototype.loadFromHTML=function(e,l,g){var c=this.conf.tags.item;this.conf.tags.item="div";var h=(typeof(e)=="string"?document.getElementById(e):e);var a=this._xmlToJson(h,this.idPrefix+this.topId);this._initObj(a);this.conf.tags.item=c;if(l){h.parentNode.removeChild(h)}h=objOd=null;if(onload!=null){if(typeof(g)=="function"){g()}else{if(typeof(window[g])=="function"){window[g]()}}}};dhtmlXMenuObject.prototype.hideItem=function(a){this._changeItemVisible(a,false)};dhtmlXMenuObject.prototype.showItem=function(a){this._changeItemVisible(a,true)};dhtmlXMenuObject.prototype.isItemHidden=function(c){var a=null;if(this.idPull[this.idPrefix+c]!=null){a=(this.idPull[this.idPrefix+c].style.display=="none")}return a};dhtmlXMenuObject.prototype._changeItemVisible=function(e,c){var a=this.idPrefix+e;if(this.itemPull[a]==null){return}if(this.itemPull[a]["type"]=="separator"){a="separator_"+a}if(this.idPull[a]==null){return}this.idPull[a].style.display=(c?"":"none");this._redefineComplexState(this.itemPull[this.idPrefix+e]["parent"])};dhtmlXMenuObject.prototype.setUserData=function(e,a,c){this.userData[this.idPrefix+e+"_"+a]=c};dhtmlXMenuObject.prototype.getUserData=function(c,a){return(this.userData[this.idPrefix+c+"_"+a]!=null?this.userData[this.idPrefix+c+"_"+a]:null)};dhtmlXMenuObject.prototype.setOpenMode=function(a){this.conf.mode=(a=="win"?"win":"web")};dhtmlXMenuObject.prototype.setWebModeTimeout=function(a){this.conf.tm_sec=(!isNaN(a)?a:400)};dhtmlXMenuObject.prototype.getItemImage=function(c){var a=new Array(null,null);c=this.idPrefix+c;if(this.itemPull[c]["type"]=="item"){a[0]=this.itemPull[c]["imgen"];a[1]=this.itemPull[c]["imgdis"]}return a};dhtmlXMenuObject.prototype.setItemImage=function(e,a,c){if(this.itemPull[this.idPrefix+e]["type"]!="item"){return}this.itemPull[this.idPrefix+e]["imgen"]=a;this.itemPull[this.idPrefix+e]["imgdis"]=c;this._updateItemImage(e,this._getItemLevelType(e))};dhtmlXMenuObject.prototype.clearItemImage=function(a){this.setItemImage(a,"","")};dhtmlXMenuObject.prototype.setVisibleArea=function(c,a,g,e){this.conf.v_enabled=true;this.conf.v.x1=c;this.conf.v.x2=a;this.conf.v.y1=g;this.conf.v.y2=e};dhtmlXMenuObject.prototype.setTooltip=function(c,a){c=this.idPrefix+c;if(!(this.itemPull[c]!=null&&this.idPull[c]!=null)){return}this.idPull[c].title=(a.length>0?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(e,a,c){if(this.itemPull[this.idPrefix+e]==null){return}this.itemPull[this.idPrefix+e]["href_link"]=a;if(c!=null){this.itemPull[this.idPrefix+e]["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(g,a,c){if(a.charAt(1)=="d"){return}if(this.itemPull[this.idPrefix+g]==null){return}var e=this._getCheckboxState(g);if(this.checkEvent("onCheckboxClick")){if(this.callEvent("onCheckboxClick",[g,e,this.conf.ctx_zoneid,c])){this.setCheckboxState(g,!e)}}else{this.setCheckboxState(g,!e)}if(this.checkEvent("onClick")){this.callEvent("onClick",[g])}};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(n,g,o,q,r,a,h){if(this.conf.context&&g==this.topId){}else{if(this.itemPull[this.idPrefix+g]==null){return}if(n=="child"&&this.itemPull[this.idPrefix+g]["type"]!="item"){return}}var l="chbx_"+(a?"1":"0");var e=l;if(n=="sibling"){var c=this.idPrefix+(q!=null?q:this._genStr(24));var m=this.idPrefix+this.getParentId(g);this._addItemIntoGlobalStrorage(c,m,r,"checkbox",h,l,e);this.itemPull[c]["checked"]=a;this._renderSublevelItem(c,this.getItemPosition(g))}else{var c=this.idPrefix+(q!=null?q:this._genStr(24));var m=this.idPrefix+g;this._addItemIntoGlobalStrorage(c,m,r,"checkbox",h,l,e);this.itemPull[c]["checked"]=a;if(this.idPull["polygon_"+m]==null){this._renderSublevelPolygon(m,m)}this._renderSublevelItem(c,o-1);this._redefineComplexState(m)}};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 e=this._getSubItemToDeselectByPolygon(a);for(var c=0;c<this.conf.opened_poly.length;c++){if(this.conf.opened_poly[c]!=a){this._hidePolygon(this.conf.opened_poly[c])}}for(var c=0;c<e.length;c++){if(this.idPull[e[c]]!=null&&this.itemPull[e[c]]["state"]=="enabled"){this.idPull[e[c]].className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_Item_Normal"}}};dhtmlXMenuObject.prototype._checkArrowsState=function(g){var c=this.idPull["polygon_"+g].childNodes[1];var e=this.idPull["arrowup_"+g];var a=this.idPull["arrowdown_"+g];if(c.scrollTop==0){e.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowUp_Disabled"}else{e.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowUp"+(e.over?"_Over":"")}if(c.scrollTop+c.offsetHeight<c.scrollHeight){a.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowDown"+(a.over?"_Over":"")}else{a.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowDown_Disabled"}c=e=a=null};dhtmlXMenuObject.prototype._addUpArrow=function(g){var c=this;var e=document.createElement("DIV");e.pId=this.idPrefix+g;e.id="arrowup_"+this.idPrefix+g;e.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowUp";e.over=false;e.onselectstart=function(h){h=h||event;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}return false};e.oncontextmenu=function(h){h=h||event;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}return false};e.onmouseover=function(){if(c.conf.mode=="web"){window.clearTimeout(c.conf.tm_handler)}c._clearAllSelectedSubItemsInPolygon(this.pId);if(this.className=="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowUp_Disabled"){return}this.className="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowUp_Over";this.over=true;c._canScrollUp=true;c._doScrollUp(this.pId,true)};e.onmouseout=function(){if(c.conf.mode=="web"){window.clearTimeout(c.conf.tm_handler);c.conf.tm_handler=window.setTimeout(function(){c._clearAndHide()},c.conf.tm_sec,"JavaScript")}this.over=false;c._canScrollUp=false;if(this.className=="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowUp_Disabled"){return}this.className="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowUp";window.clearTimeout(c.conf.of_utm)};e.onclick=function(h){h=h||event;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}h.cancelBubble=true;return false};var a=this.idPull["polygon_"+this.idPrefix+g];a.childNodes[0].appendChild(e);this.idPull[e.id]=e;a=e=null};dhtmlXMenuObject.prototype._addDownArrow=function(g){var c=this;var e=document.createElement("DIV");e.pId=this.idPrefix+g;e.id="arrowdown_"+this.idPrefix+g;e.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowDown";e.over=false;e.onselectstart=function(h){h=h||event;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}return false};e.oncontextmenu=function(h){h=h||event;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}return false};e.onmouseover=function(){if(c.conf.mode=="web"){window.clearTimeout(c.conf.tm_handler)}c._clearAllSelectedSubItemsInPolygon(this.pId);if(this.className=="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowDown_Disabled"){return}this.className="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowDown_Over";this.over=true;c._canScrollDown=true;c._doScrollDown(this.pId,true)};e.onmouseout=function(){if(c.conf.mode=="web"){window.clearTimeout(c.conf.tm_handler);c.conf.tm_handler=window.setTimeout(function(){c._clearAndHide()},c.conf.tm_sec,"JavaScript")}this.over=false;c._canScrollDown=false;if(this.className=="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowDown_Disabled"){return}this.className="dhtmlxMenu_"+c.conf.skin+"_SubLevelArea_ArrowDown";window.clearTimeout(c.conf.of_dtm)};e.onclick=function(h){h=h||event;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}h.cancelBubble=true;return false};var a=this.idPull["polygon_"+this.idPrefix+g];a.childNodes[2].appendChild(e);this.idPull[e.id]=e;a=e=null};dhtmlXMenuObject.prototype._removeUpArrow=function(c){var a="arrowup_"+this.idPrefix+c;this._removeArrow(a)};dhtmlXMenuObject.prototype._removeDownArrow=function(c){var a="arrowdown_"+this.idPrefix+c;this._removeArrow(a)};dhtmlXMenuObject.prototype._removeArrow=function(a){var c=this.idPull[a];c.onselectstart=null;c.oncontextmenu=null;c.onmouseover=null;c.onmouseout=null;c.onclick=null;if(c.parentNode){c.parentNode.removeChild(c)}c=null;this.idPull[a]=null;try{delete this.idPull[a]}catch(g){}};dhtmlXMenuObject.prototype._isArrowExists=function(a){if(this.idPull["arrowup_"+a]!=null&&this.idPull["arrowdown_"+a]!=null){return true}return false};dhtmlXMenuObject.prototype._doScrollUp=function(l,g){var a=this.idPull["polygon_"+l].childNodes[1];if(this._canScrollUp&&a.scrollTop>0){var e=false;var h=a.scrollTop-this.conf.of_ustep;if(h<0){e=true;h=0}a.scrollTop=h;if(!e){var c=this;this.conf.of_utm=window.setTimeout(function(){c._doScrollUp(l,false);c=null},this.conf.of_utime)}else{g=true}}else{this._canScrollUp=false;this._checkArrowsState(l)}if(g){this._checkArrowsState(l)}};dhtmlXMenuObject.prototype._doScrollDown=function(l,g){var a=this.idPull["polygon_"+l].childNodes[1];if(this._canScrollDown&&a.scrollTop+a.offsetHeight<=a.scrollHeight){var e=false;var h=a.scrollTop+this.conf.of_dstep;if(h+a.offsetHeight>=a.scrollHeight){e=true;h=a.scrollHeight-a.offsetHeight}a.scrollTop=h;if(!e){var c=this;this.conf.of_dtm=window.setTimeout(function(){c._doScrollDown(l,false);c=null},this.conf.of_dtime)}else{g=true}}else{this._canScrollDown=false;this._checkArrowsState(l)}if(g){this._checkArrowsState(l)}};dhtmlXMenuObject.prototype._countPolygonItems=function(l){var g=0;for(var c in this.itemPull){var e=this.itemPull[c]["parent"];var h=this.itemPull[c]["type"];if(e==this.idPrefix+l&&(h=="item"||h=="radio"||h=="checkbox")){g++}}return g};dhtmlXMenuObject.prototype.setOverflowHeight=function(g){if(g==="auto"){this.conf.overflow_limit=0;this.conf.auto_overflow=true;return}if(this.conf.overflow_limit==0&&g<=0){return}this._clearAndHide();if(this.conf.overflow_limit>=0&&g>0){this.conf.overflow_limit=g;return}if(this.conf.overflow_limit>0&&g<=0){for(var e in this.itemPull){if(this._isArrowExists(e)){var c=String(e).replace(this.idPrefix,"");this._removeUpArrow(c);this._removeDownArrow(c);this.idPull["polygon_"+e].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(g,e){var c=this._getRadioImgObj(g);if(c!=null){var a=this.itemPull[this.idPrefix+g];a.checked=e;a.imgen="rdbt_"+(a.checked?"1":"0");a.imgdis=a.imgen;c.className="sub_icon "+a.imgen}};dhtmlXMenuObject.prototype._radioOnClickHandler=function(g,a,c){if(a.charAt(1)=="d"||this.itemPull[this.idPrefix+g]["group"]==null){return}var e=this.itemPull[this.idPrefix+g]["group"];if(this.checkEvent("onRadioClick")){if(this.callEvent("onRadioClick",[e,this.getRadioChecked(e),g,this.conf.ctx_zoneid,c])){this.setRadioChecked(e,g)}}else{this.setRadioChecked(e,g)}if(this.checkEvent("onClick")){this.callEvent("onClick",[g])}};dhtmlXMenuObject.prototype.getRadioChecked=function(g){var l=null;for(var e=0;e<this.radio[g].length;e++){var h=this.radio[g][e].replace(this.idPrefix,"");var a=this._getRadioImgObj(h);if(a!=null){var c=(a.className).match(/rdbt_1$/gi);if(c!=null){l=h}}}return l};dhtmlXMenuObject.prototype.setRadioChecked=function(c,g){if(this.radio[c]==null){return}for(var a=0;a<this.radio[c].length;a++){var e=this.radio[c][a].replace(this.idPrefix,"");this._setRadioState(e,(e==g))}};dhtmlXMenuObject.prototype.addRadioButton=function(o,h,q,r,s,u,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 e=this.idPrefix+(r!=null?r:this._genStr(24));var m="rdbt_"+(a?"1":"0");var c=m;if(o=="sibling"){var n=this.idPrefix+this.getParentId(h);this._addItemIntoGlobalStrorage(e,n,s,"radio",l,m,c);this._renderSublevelItem(e,this.getItemPosition(h))}else{var n=this.idPrefix+h;this._addItemIntoGlobalStrorage(e,n,s,"radio",l,m,c);if(this.idPull["polygon_"+n]==null){this._renderSublevelPolygon(n,n)}this._renderSublevelItem(e,q-1);this._redefineComplexState(n)}var g=(u!=null?u:this._genStr(24));this.itemPull[e]["group"]=g;if(this.radio[g]==null){this.radio[g]=new Array()}this.radio[g][this.radio[g].length]=e;if(a==true){this.setRadioChecked(g,String(e).replace(this.idPrefix,""))}};dhtmlXMenuObject.prototype.serialize=function(){var a="<menu>"+this._readLevel(this.idPrefix+this.topId)+"</menu>";return a};dhtmlXMenuObject.prototype._readLevel=function(g){var h="";for(var o in this.itemPull){if(this.itemPull[o]["parent"]==g){var c="";var e="";var r="";var n=String(this.itemPull[o]["id"]).replace(this.idPrefix,"");var m="";var q=(this.itemPull[o]["title"]!=""?' text="'+this.itemPull[o]["title"]+'"':"");var l="";if(this.itemPull[o]["type"]=="item"){if(this.itemPull[o]["imgen"]!=""){c=' img="'+this.itemPull[o]["imgen"]+'"'}if(this.itemPull[o]["imgdis"]!=""){e=' imgdis="'+this.itemPull[o]["imgdis"]+'"'}if(this.itemPull[o]["hotkey"]!=""){r="<hotkey>"+this.itemPull[o]["hotkey"]+"</hotkey>"}}if(this.itemPull[o]["type"]=="separator"){m=' type="separator"'}else{if(this.itemPull[o]["state"]=="disabled"){l=' enabled="false"'}}if(this.itemPull[o]["type"]=="checkbox"){m=' type="checkbox"'+(this.itemPull[o]["checked"]?' checked="true"':"")}if(this.itemPull[o]["type"]=="radio"){m=' type="radio" group="'+this.itemPull[o]["group"]+'" '+(this.itemPull[o]["checked"]?' checked="true"':"")}h+="<item id='"+n+"'"+q+m+c+e+l+">";h+=r;if(this.itemPull[o]["complex"]){h+=this._readLevel(o)}h+="</item>"}}return h};dhtmlXMenuObject.prototype.enableEffect=function(e,h,g){this._menuEffect=(e=="opacity"||e=="slide"||e=="slide+"?e: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(h)=="undefined"?100:h)/(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=g||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(e,c){if(!this.idPull){return}if(this.idPull[e]._tmShow){window.clearTimeout(this.idPull[e]._tmShow)}this.idPull[e]._h=Math.max(0,Math.min(c,this.idPull[e]._max_h));if(this._menuEffect.search(/slide/)===0){this.idPull[e].style.height=this.idPull[e]._h+"px"}c+=this.idPull[e]._step_h;if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[e]._op=Math.max(0,Math.min(this._pOpMax,this.idPull[e]._op+this.idPull[e].op_step));this._pOpacityApply(e)}if((this.idPull[e]._step_h>0&&c<=this.idPull[e]._max_h)||(this.idPull[e]._step_h<0&&c>=0)){var a=this;this.idPull[e]._tmShow=window.setTimeout(function(){a._pEffectSet(e,c)},this.idPull[e]._step_tm)}else{if(this._menuEffect.search(/slide/)===0){this.idPull[e].style.height=""}if(this.idPull[e]._step_h<0){this.idPull[e].style.visibility="hidden"}if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[e]._op=(this.idPull[e]._step_h<0?(this._pOpStyleIE?100:1):this._pOpMax);this._pOpacityApply(e)}this.idPull[e]._tmShow=null;this.idPull[e]._h=null;this.idPull[e]._max_h=null;this.idPull[e]._step_tm=null}};function dhtmlXRibbon(g){var e=this,c,a;this.conf={type:"ribbon",icons_path:(g&&g.icons_path)?g.icons_path:"",arrows_mode:(g&&g.arrows_mode)?g.arrows_mode:null,skin:"dhx_skyblue"};this._eventHandlers={};this._base=null;this._items={};this._tabbar=null;this.childIds=[];if(typeof(g)=="string"){a=g}else{if(g&&g.tagName){a=g}else{if(g&&g.parent){if(g.parent.tagName||typeof(g.parent)=="string"){a=g.parent}}}}this._doOnHighlight0=function(n){n=n||event;var m=n.target||n.srcElement;var h=e._findItemByNode(m);var l=e._items[h._dhx_ribbonId];if(l.conf.disable){return}if(e.items[l.type]&&typeof(e.items[l.type].mouseover)=="function"){if(e.items[l.type].mouseover(l,e,n)!=true){return false}}if(!/dhxrb_highlight0/.test(h.className)){h.className+=" dhxrb_highlight0"}};this._doOffHighlight0=function(n){n=n||event;var m=n.target||n.srcElement;var h=e._findItemByNode(m);var l=e._items[h._dhx_ribbonId];if(l.conf.disable){return}if(e.items[l.type]&&typeof(e.items[l.type].mouseout)=="function"){if(e.items[l.type].mouseout(l,e,n)!=true){return false}}if(/dhxrb_highlight1/.test(h.className)){h.className=h.className.replace(/\s?dhxrb_highlight1/,"")}if(/dhxrb_highlight0/.test(h.className)){h.className=h.className.replace(/\s?dhxrb_highlight0/,"")}};this._doOnHighlight1=function(n){n=n||event;var m=n.target||n.srcElement;var h=e._findItemByNode(m);var l=e._items[h._dhx_ribbonId];if(l.conf.disable){return}e.callEvent("_showPopup",[l.id]);if(e.items[l.type]&&typeof(e.items[l.type].mousedown)=="function"){if(e.items[l.type].mousedown(l,e,n)!=true){return false}}if(!/dhxrb_highlight1/.test(h.className)){h.className+=" dhxrb_highlight1"}};this._doOffHighlight1=function(n){n=n||event;var m=n.target||n.srcElement;var h=e._findItemByNode(m);var l=e._items[h._dhx_ribbonId];if(l.conf.disable){return}if(e.items[l.type]&&typeof(e.items[l.type].mouseup)=="function"){if(e.items[l.type].mouseup(l,e,n)!=true){return false}}if(/dhxrb_highlight1/.test(h.className)){h.className=h.className.replace(/\s?dhxrb_highlight1/,"")}};this._doOnClick=function(n){n=n||event;var m=n.target||n.srcElement;var h=e._findItemByNode(m);var l=e._items[h._dhx_ribbonId];if(l.conf.disable){return}if(e.items[l.type]&&typeof(e.items[l.type].click)=="function"){e.items[l.type].click(l,e,n)}};this._doOnFocus=function(n){n=n||event;var m=n.target||n.srcElement;var h=e._findItemByNode(m);var l=e._items[h._dhx_ribbonId];if(l.conf.disable){return}e.callEvent("_showPopup",[l.id]);if(e.items[l.type]&&typeof(e.items[l.type].focus)=="function"){e.items[l.type].focus(l,e,n)}};this._doOnBlur=function(n){n=n||event;var m=n.target||n.srcElement;var h=e._findItemByNode(m);var l=e._items[h._dhx_ribbonId];if(l.conf.disable){return}if(e.items[l.type]&&typeof(e.items[l.type].blur)=="function"){e.items[l.type].blur(l,e,n)}};this._doOnChange=function(n){n=n||event;var m=n.target||n.srcElement;var h=e._findItemByNode(m);var l=e._items[h._dhx_ribbonId];if(l.conf.disable){return}if(e.items[l.type]&&typeof(e.items[l.type].change)=="function"){e.items[l.type].change(l,e,n)}};this._doOnKeydown=function(n){n=n||event;var m=n.target||n.srcElement;var h=e._findItemByNode(m);var l=e._items[h._dhx_ribbonId];if(l.conf.disable){return}if(e.items[l.type]&&typeof(e.items[l.type].keydown)=="function"){e.items[l.type].keydown(l,e,n)}};this._tabCustomApi={enable:function(n,m){var l=null,h=null;m=m||false;if(m!=true){l=e._items[this._idd];for(h in l.childIds){h=parseInt(h);e.enable(l.childIds[h])}}return e._tabOriginalApi.enable.apply(this,[n])},disable:function(n,m){var l=null,h=null;if(m!=false){l=e._items[this._idd];for(h in l.childIds){h=parseInt(h);e.disable(l.childIds[h])}}return e._tabOriginalApi.disable.apply(this,[n])},close:function(m){var l=e._items[this._idd],h;e._removeTab(l);e._tabOriginalApi.close.apply(this,[m]);for(h in e._tabOriginalApi){this[h]=null}}};this._attachEventTabbar=function(){this._tabbar.attachEvent("onSelect",function(){return e.callEvent("onSelect",arguments)});this._tabbar.attachEvent("onTabClick",function(){return e.callEvent("onTabClick",arguments)});this._tabbar.attachEvent("onTabClose",function(){return e.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(g)=="object"&&g.skin){c=g.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="<div class='dhxrb_background_area'></div>";if(g!=null){if(g.json){this.loadStruct(g.json,g.onload)}else{if(g.xml){this.loadStruct(g.xml,g.onload)}else{this._renderData(g)}}}this.unload=function(){var l=null,h=[];for(l in this.childIds){l=parseInt(l);h.push(this.childIds[l])}dhx4._enableDataLoading(this,null,null,null,"clear");dhx4._eventable(this,"clear");for(l in h){l=parseInt(l);if(this._items[h[l]].type=="tab"){this.tabs(h[l]).close(false)}else{this.removeItem(h[l])}}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(l in this){this[l]=null}e=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);if(this.conf.arrows_mode!=null){this._tabbar.setArrowsMode(this.conf.arrows_mode)}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="<div class='dhxrb_g_area'></div>";this.childIds=this._appendBlocks(c.items,a.firstChild)}}this.callEvent("_onHeightChanged",[])}};dhtmlXRibbon.prototype._xmlToJson=function(c){var a=c.lastChild||null,g={},e=[];if(a&&a.tagName=="ribbon"){e=this._convertXmlNodeListIntoObject(a.childNodes)}if(e[0]&&e[0].type&&e[0].type.toLowerCase()=="block"){g.items=e}else{g.tabs=e}return g};dhtmlXRibbon.prototype._convertXmlNodeListIntoObject=function(c){var e,a,h=[],g;a=c.length;for(e=0;e<a;e++){g=this._covertXmlNodeToObject(c[e]);if(g){h.push(g)}}return h};dhtmlXRibbon.prototype._covertXmlNodeToObject=function(g){if(!g||!g.tagName||!(g.tagName.toLowerCase()=="item"||g.tagName.toLowerCase()=="tab")){return null}var e,a,c=g.attributes,h={};a=c.length;for(e=0;e<a;e++){switch(c[e].name){case"isbig":h.isbig=dhx4.s2b(c[e].value);break;case"state":h.state=dhx4.s2b(c[e].value);break;default:h[c[e].name]=c[e].value}}if(g.childNodes.length){if(g.getAttribute("type")=="buttonCombo"||g.getAttribute("type")=="buttonSelect"){h.data=g}else{if(g.tagName.toLowerCase()=="tab"){h.items=this._convertXmlNodeListIntoObject(g.childNodes)}else{h.list=this._convertXmlNodeListIntoObject(g.childNodes)}}}return h};dhtmlXRibbon.prototype._appendTabs=function(h){var c,a,e,g=[];a=h.length;for(c=0;c<a;c++){e=this._addTab(h[c]);if(h[c].items instanceof Array){e.childIds=this._appendBlocks(h[c].items,e.base,e)}g.push(e.id)}return g};dhtmlXRibbon.prototype._addTab=function(e){var a,g,c={conf:{active:false,text:"",width:null,position:null,disable:false},base:document.createElement("div"),type:"tab",childIds:[]};for(a in e){if(a=="items"){continue}c.conf[a]=e[a]}if(!e.id){c.id=dhx4.newId()}else{c.id=e.id}while(this._items[c.id]){c.id=dhx4.newId()}this._tabbar.addTab(c.id,c.conf.text,c.conf.width,c.conf.position,c.conf.active);c.base.className="dhxrb_g_area";c.base._dhx_ribbonId=c.id;this.tabs(c.id).attachObject(c.base);this._changeApiForTab(this.tabs(c.id));this._items[c.id]=c;return c};dhtmlXRibbon.prototype._changeApiForTab=function(c){var a;for(a in this._tabOriginalApi){this._tabOriginalApi[a]=this._tabOriginalApi[a]||c[a];c[a]=this._tabCustomApi[a]}};dhtmlXRibbon.prototype._tabOriginalApi={enable:null,disable:null,close:null};dhtmlXRibbon.prototype._appendBlocks=function(a,s,e){var m,g,n,h,o,c,r=[];e=e||null;g=a.length;for(m=0;m<g;m++){if(typeof(a[m])=="object"&&a[m].type=="block"){n=this._addBlock(a[m],s);if(a[m].list&&(a[m].list instanceof Array)){h=a[m].list;o=h.length;for(c=0;c<o;c++){this._addItem(n.id,null,null,h[c])}}if(e!=null){n.parentId=e.id}if(n.conf.disable){this.disable(n.id)}r.push(n.id)}}return r};dhtmlXRibbon.prototype._addBlock=function(h,g){var e,a,m,c;m={conf:{text:"",text_pos:"bottom",type:"block",mode:"cols",disable:false},type:"block",childIds:[],base:document.createElement("div"),contForItems:document.createElement("div"),contForText:document.createElement("div")};for(c in h){if(c=="list"||c=="type"||c=="id"){continue}m.conf[c]=h[c]}if(!h.id){m.id=dhx4.newId()}else{m.id=h.id}while(this._items[m.id]){m.id=dhx4.newId()}m.base.className="dhxrb_block_base";g.appendChild(m.base);m.contForItems.className="dhxrb_block_items";m.contForText.className="dhxrb_block_label";m.base.appendChild(m.contForItems);if(m.conf.text){m.contForText.innerHTML=m.conf.text;if(m.conf.text_pos=="top"){m.base.insertBefore(m.contForText,m.contForItems)}else{m.base.appendChild(m.contForText)}}m.base._dhx_ribbonId=m.id;this._items[m.id]=m;return m};dhtmlXRibbon.prototype._addItem=function(e,c,o,m){var h=this._items[e],a,l,r=null,n=this,g;if(m.type!="newLevel"&&!this.items[m.type]){return null}if(m.type=="newLevel"){this._addNewLevel(h)}else{if(h.type=="group"){a=document.createElement("div");a.className="dhxrb_in_group";h.base.appendChild(a)}else{if(m.isbig){a=document.createElement("div");a.className="dhxrb_big_button";h.contForItems.appendChild(a)}else{l=this._getContainerForSmallItem(h);a=document.createElement("div");a.className=(h.conf.mode=="rows")?"dhxrb_in_row":"dhxrb_3rows_button";l.appendChild(a)}}}if(a){this._attachEventForItem(a);g={icons_path:m.icons_path||this.conf.icons_path,skin:this.conf.skin};for(var q in m){g[q]=m[q]}if(!g.id){g.id=dhx4.newId()}while(this._items[g.id]){g.id=dhx4.newId()}r=(this.items[g.type]&&this.items[g.type].render)?this.items[g.type].render(a,g):null}if(r!=null){this._items[r.id]=r;r.parentId=h.id;h.childIds.push(r.id);a._dhx_ribbonId=r.id;if(g.onclick&&(typeof(g.onclick)=="function")){this._eventHandlers[r.id]=this._eventHandlers[r.id]||{};this._eventHandlers[r.id]["onclick"]=g.onclick}r.callEvent=function(){n.callEvent.apply(n,arguments)};r._callHandler=function(){n._callHandler.apply(n,arguments)};if(this.items[g.type]&&typeof(this.items[g.type].callAfterInit)=="function"){this.items[g.type].callAfterInit.apply(this,[r])}}return r};dhtmlXRibbon.prototype._callHandler=function(c,a){if(this._eventHandlers[c]&&this._eventHandlers[c].onclick){this._eventHandlers[c].onclick.apply(this,a)}};dhtmlXRibbon.prototype.items={};dhtmlXRibbon.prototype.items.button={render:function(c,a){var e,g;g={base:c,id:a.id,type:a.type,conf:{text:"",text_pos:(a.isbig)?"bottom":"right",img:null,imgdis:null,isbig:false,disable:false,skin:a.skin}};for(e in a){if(e=="id"||e=="onclick"||e=="type"){continue}g.conf[e]=a[e]}c.innerHTML="<img class='dhxrb_image"+((g.conf.img)?"'":" dhxrb_invisible'")+" src='"+((g.conf.img)?g.conf.icons_path+g.conf.img:"")+"' /><div class='dhxrb_label_button'>"+g.conf.text+"</div>";if(typeof(this.afterRender)=="function"){this.afterRender(g)}if(g.conf.disable){this.disable(g)}return g},getText:function(a){return a.conf.text},setText:function(c,e){var a=c.base.childNodes[1];c.conf.text=e;a.innerHTML=e},setImage:function(c,a){c.conf.img=a;if(c.conf.disable==false){c.base.childNodes[0].src=c.conf.icons_path+c.conf.img}},setImageDis:function(c,a){c.conf.imgdis=a;if(c.conf.disable==true){c.base.childNodes[0].src=c.conf.icons_path+c.conf.imgdis}},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 e=c.base.childNodes[0],a=c.base.childNodes[1];if(c.conf.imgdis){e.src=c.conf.icons_path+c.conf.imgdis;if(/\s?dhxrb_invisible/i.test(e.className)){e.className=e.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 e=c.base.childNodes[0],a=c.base.childNodes[1];if(c.conf.img){e.src=c.conf.icons_path+c.conf.img}else{if(!/\s?dhxrb_invisible/i.test(e.className)){e.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,e){e=e||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(e){a.callEvent("onStateChange",[a.id,a.conf.state])}},getState:function(a){return(a.conf.state==true)}};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,h,g){g=g||false;var e=null,c=dhx4.s2b(a.conf.state);if(c==false){e=this._getSelectedNeighbor(a,h);if(e!=null){this._unSelect(e)}if(!/dhxrb_highlight1/.test(a.base.className)){a.base.className+=" dhxrb_highlight1"}a.conf.state=true;if(g){h._callHandler(a.id,[a.id,(e?e.id:null)]);h.callEvent("onStateChange",[a.id,(e?e.id:null)])}}},remove:function(e,m){var h=dhx4.s2b(e.conf.state),l=null,a=0,c=m._items[e.parentId],g;if(h){while(c.childIds[a]&&l==null){g=m._items[c.childIds[a]];if(g.type=="buttonSegment"&&g!=e){l=g}a++}if(l){this.setState(l,m)}}},_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(g,n){var e=n._items[g.parentId],c,a,m,h=null;a=e.childIds.length;for(c=0;c<a;c++){m=n._items[e.childIds[c]];if(m.type=="buttonSegment"&&m.conf.state){h=m;break}}return h}};dhtmlXRibbon.prototype.items.buttonSelect={itemCollection:[],_isAttachedEventInWindow:false,afterRender:function(c){var a=c.base.childNodes[1];a.innerHTML+="<span class='dhxrb_arrow'>&nbsp;</span>";c.menu=null;this.itemCollection.push(c);this._attachEventToWindow();a=null},setText:function(a,e){var c=a.base.childNodes[1].lastChild;a.conf.text=e;a.base.childNodes[1].innerHTML=e;a.base.childNodes[1].appendChild(c)},setOptionText:function(a,e,c){if(a.menu!=null){a.menu.setItemText(e,c)}else{this._loopThroughItems(a.conf.items,e,c,false)}},getOptionText:function(a,c){if(a.menu!=null){return a.menu.getItemText(c)}return this._loopThroughItems(a.conf.items,c,null,true)},_loopThroughItems:function(a,l,h,g){for(var e=0;e<a.length;e++){if(a[e].id==l){if(g!=true){a[e].text=h;return true}else{return a[e].text}}if(a[e].items!=null){var c=this._loopThroughItems(a[e].items,l,h,g);if(c!=null){return c}}}return null},_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),e=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(g){if(g==null){dhtmlXRibbon.prototype.items.buttonSelect._doOnHideMenu(c)}});c.menu.attachEvent("onShow",function(g){if(g==null){dhtmlXRibbon.prototype.items.buttonSelect._doOnShowMenu(c)}});c.menu.attachEvent("onClick",function(g){c.callEvent("onClick",[g,c.id])});c.base.oncontextmenu=function(){return false};dhtmlXRibbon.prototype.items.buttonSelect.showMenu(c)}else{c.menu.showContextMenu(a,e)}},hideMenu:function(a){if(a.menu instanceof dhtmlXMenuObject){a.menu.hideContextMenu()}},remove:function(c){var e,a;if(c.menu instanceof dhtmlXMenuObject){c.menu.unload();c.menu=null}c.base.oncontextmenu=null;e=dhtmlXRibbon.prototype._indexOf(dhtmlXRibbon.prototype.items.buttonSelect.itemCollection,c);if(e!=-1){dhtmlXRibbon.prototype.items.buttonSelect.itemCollection.splice(e,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 e,g;g={base:c,id:a.id,type:a.type,conf:{disable:false,skin:a.skin},childIds:[]};c.className="dhxrb_group";for(e in a){if(e=="id"||e=="onclick"||e=="type"){continue}g.conf[e]=a[e]}return g},callAfterInit:function(h){this._detachEventFromItem(h.base);var g,a,m=h.conf.list,n,e,c;a=(m)?m.length:0;for(g=0;g<a;g++){n=this._addItem(h.id,null,null,m[g]);if(n==null){continue}e=n.base.childNodes[1];if(e&&!e.innerHTML&&!/\s?dhxrb_label_hide/i.test(e.className)){e.className+=" dhxrb_label_hide"}}dhtmlXRibbon.prototype.items.group.normalize(h);if(h.conf.disable){this.disable(h.id)}m=undefined},normalize:function(n){var a=n.base.children;var e=a.length,c=false,o=0;var g,m;for(var h=0;h<e;h++){if(!/dhxrb_separator_group/i.test(a[h].className)){if(/dhxrb_item_hide/i.test(a[h].className)){o++;continue}}if((Math.ceil((h-o)/2)-Math.floor((h-o)/2))==0){if(/dhxrb_separator_group/i.test(a[h].className)){a[h].parentNode.removeChild(a[h]);c=true;break}}else{if(!/dhxrb_separator_group/i.test(a[h].className)){g=document.createElement("div");g.className="dhxrb_separator_groupp";n.base.insertBefore(g,a[h]);c=true;break}}}if(c){this.normalize(n)}else{m=n.base.lastChild;if(m&&/dhxrb_separator_group/i.test(m.className)){m.parentNode.removeChild(m)}}},hideChild:function(c,g){var a=dhtmlXRibbon.prototype._indexOf(c.base.children,g.base);if(a==0){a++}else{if(a!=-1){a--}else{return}}var e=c.base.children[a];if(e&&/dhxrb_separator_group/i.test(e.className)){e.parentNode.removeChild(e)}},showChild:function(a){this.normalize(a)}};dhtmlXRibbon.prototype.items.input={render:function(c,a){var e,g;g={base:c,id:a.id,type:a.type,conf:{text:"",text_pos:(a.isbig)?"bottom":"right",img:null,imgdis:null,isbig:false,disable:false,skin:a.skin,value:""}};for(e in a){if(e=="id"||e=="onclick"||e=="type"){continue}g.conf[e]=a[e]}c.innerHTML="<input type='text' class='dhxrb_input'><div class='dhxrb_label_button'>"+g.conf.text+"</div>";if(typeof(this.afterRender)=="function"){this.afterRender(g)}if(g.conf.disable){this.disable(g)}if(g.conf.width){this.setWidth(g,g.conf.width)}if(g.conf.value){this.setValue(g,g.conf.value)}return g},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,e){var a=c.base.childNodes[0];e._detachEventsFromInput(a)},getValue:function(c){var a=c.base.childNodes[0],e;e=a.value;a=undefined;return e},setValue:function(c,e){var a=c.base.childNodes[0],e;a.value=e;c.conf.value=e},setWidth:function(c,e){var a=c.base.childNodes[0];a.style.width=parseInt(e)+"px"},disable:function(e){var c=e.base.childNodes[0],a=e.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(e){var c=e.base.childNodes[0],a=e.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},getInput:function(a){return a.base.childNodes[0]}};dhtmlXRibbon.prototype.getInput=function(c){var a=this._items[c];if(a==null||a.type!="input"){return null}return this.items[a.type].getInput(a)};dhtmlXRibbon.prototype.items.checkbox={render:function(c,a){var e,g;g={base:c,id:a.id,type:a.type,conf:{text:"",text_pos:(a.isbig)?"bottom":"right",disable:false,checked:false}};for(e in a){if(e=="id"||e=="onclick"||e=="type"){continue}g.conf[e]=a[e]}c.innerHTML="<div class='dhxrb_checkbox'></div><div class='dhxrb_label_checkbox'>"+g.conf.text+"</div>";if(typeof(this.afterRender)=="function"){this.afterRender(g)}if(g.conf.checked){this.check(g)}return g},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])}},isChecked:function(a){if(a.type!="checkbox"){return false}return(a.conf.checked==true)},disable:function(a){return true},enable:function(a){return true}};dhtmlXRibbon.prototype.items.text={render:function(a,g){var e={base:a,id:g.id,type:g.type,conf:{text:""}};for(var c in g){if(c=="id"||c=="type"){continue}e.conf[c]=g[c]}a.innerHTML="<div class='dhxrb_item_text'>"+e.conf.text+"</div>";if(typeof(this.afterRender)=="function"){this.afterRender(e)}return e},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 e,g,h={};g={base:a,id:c.id,type:c.type,conf:{text:"",text_pos:"right",width:140,skin:c.skin,callEvent:true}};for(e in c){if(e=="id"||e=="onclick"||e=="type"){continue}g.conf[e]=c[e]}for(e in g.conf){if(e=="text"||e=="text_pos"||e=="disable"||e=="data"){continue}h[e]=g.conf[e]}g.base.className+=" dhxrb_buttoncombo_cont";g.base.innerHTML="<div class='dhxrb_buttoncombo'></div><div class='dhxrb_label_button'>"+g.conf.text+"</div>";h.parent=g.base.firstChild;g.combo=new dhtmlXCombo(h);g.combo.setSkin(h.skin);g.combo.attachEvent("onChange",function(l,m){g._callHandler(g.id,[l,m]);if(g.conf.callEvent==true){g.callEvent("onSelectOption",[g.id,l,m])}g.conf.callEvent=true});if(g.conf.data){g.combo.load(g.conf.data);delete g.conf.data}if(typeof(this.afterRender)=="function"){this.afterRender(g)}if(g.conf.disable){this.disable(g)}return g},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,e){if(a.combo instanceof dhtmlXCombo){a.conf.callEvent=e;a.combo.setComboValue(c)}},setSkin:function(a,c){if(a.combo instanceof dhtmlXCombo){a.combo.setSkin(c)}}};dhtmlXRibbon.prototype.items.slider={render:function(a,h){var e,g,c={};g={base:a,id:h.id,type:h.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(e in h){if(e=="id"||e=="onclick"||e=="type"){continue}g.conf[e]=h[e]}for(e in g.conf){if(e=="text"||e=="text_pos"||e=="isbig"){continue}c[e]=g.conf[e]}g.base.innerHTML="<center><div class='dhxrb_slider'></div></center><div class='dhxrb_label_button'>"+g.conf.text+"</div>";c.parent=g.base.firstChild.firstChild;g.slider=new dhtmlXSlider(c);if(typeof(this.afterRender)=="function"){this.afterRender(g)}if(g.conf.disable){this.disable(g)}g.slider.attachEvent("onChange",function(l){g._callHandler(g.id,[l]);g.callEvent("onValueChange",[g.id,l])});return g},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(e,c){var a;for(a in c){e[a]=e[a]||c[a]}return e};dhtmlXRibbon.prototype._addNewLevel=function(e){var c,a;if(e.conf.mode=="rows"){c=e.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";e.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";e.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(e){var c=e.contForItems.lastChild,a=null;if(e.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";e.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";e.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,g){var e,c;c=a.length;for(e=0;e<c;e++){if(a[e]==g){return e}}return -1};dhtmlXRibbon.prototype._removeItem=function(e){var a,g=-1,c=this._items[e.parentId];if(e.type=="group"){this._removeGroup(e);return}delete this._items[e.id];a=e.base.parentNode;this._detachEventFromItem(e.base);a.removeChild(e.base);if(c.type=="block"){if(a!=c.contForItems&&a.childNodes.length==0){a.parentNode.removeChild(a)}}else{if(c.type=="group"){dhtmlXRibbon.prototype.items.group.normalize(c)}}g=this._indexOf(c.childIds,e.id);if(g!=-1){c.childIds.splice(g,1)}if(this.items[e.type]&&(typeof(this.items[e.type].remove)=="function")){this.items[e.type].remove(e,this)}};dhtmlXRibbon.prototype._removeGroup=function(g){var c=[],h,e=this._items[g.parentId],a=g.base.parentNode;for(h in g.childIds){h=parseInt(h);c.push(this._items[g.childIds[h]])}for(h in c){h=parseInt(h);this._removeItem(c[h])}delete this._items[g.id];if(g.base.parentNode){a.removeChild(g.base)}if(a.childNodes.length==0){a.parentNode.removeChild(a)}h=this._indexOf(e.childIds,g.id);if(h!=-1){e.childIds.splice(h,1)}if(this.items[g.type]&&(typeof(this.items[g.type].remove)=="function")){this.items[g.type].remove(g)}};dhtmlXRibbon.prototype._removeBlock=function(g){var a=[],e,c;for(e in g.childIds){e=parseInt(e);a.push(this._items[g.childIds[e]])}for(e in a){e=parseInt(e);this._removeItem(a[e])}delete this._items[g.id];g.base.parentNode.removeChild(g.base);if(g.parentId){c=this._items[g.parentId]}else{c=this}e=this._indexOf(c.childIds,g.id);if(e!=-1){c.childIds.splice(e,1)}};dhtmlXRibbon.prototype._removeTab=function(c,a){var g=[],e;for(e in c.childIds){e=parseInt(e);g.push(this._items[c.childIds[e]])}for(e in g){e=parseInt(e);this._removeBlock(g[e])}delete this._items[c.id];e=this._indexOf(this.childIds,c.id);if(e!=-1){this.childIds.splice(e,1)}};dhtmlXRibbon.prototype._skinCollection={dhx_skyblue:true,dhx_web:true,dhx_terrace:true};dhtmlXRibbon.prototype._setSkinForItems=function(e){var a,c;for(a in this._items){c=this._items[a];c.conf.skin=e;if(dhtmlXRibbon.prototype.items[c.type]&&typeof(dhtmlXRibbon.prototype.items[c.type].setSkin)=="function"){dhtmlXRibbon.prototype.items[c.type].setSkin(c,e)}}c=undefined,a=undefined};dhtmlXRibbon.prototype._setBlockText=function(a,c){a.conf.text=c;a.contForText.innerHTML=c;if(!c&&(c!=0)&&a.contForText.parentNode){a.contForText.parentNode.removeChild(a.contForText)}else{if(!a.contForText.parentNode){if(a.conf.text_pos=="top"){a.base.insertBefore(a.contForText,a.contForItems)}else{a.base.appendChild(a.contForText)}}}};dhtmlXRibbon.prototype.hide=function(e){var c=this._items[e];if(this.items[c.type]&&(typeof(this.items[c.type].hide)=="function")){if(this.items[c.type].hide(c)!=true){return}}if(c.type=="tab"){return}else{if(!/\s?dhxrb_item_hide/i.test(c.base.className)){c.base.className+=" dhxrb_item_hide"}}var a=this._items[c.parentId];if(a&&this.items[a.type]&&(typeof(this.items[a.type].hideChild)=="function")){this.items[a.type].hideChild(a,c)}};dhtmlXRibbon.prototype.show=function(e){var c=this._items[e];if(this.items[c.type]&&(typeof(this.items[c.type].show)=="function")){if(this.items[c.type].show(c)!=true){return}}if(c.type=="tab"){return}else{if(/\s?dhxrb_item_hide/i.test(c.base.className)){c.base.className=c.base.className.replace(/\s?dhxrb_item_hide/i,"")}}var a=this._items[c.parentId];if(a&&this.items[a.type]&&(typeof(this.items[a.type].showChild)=="function")){this.items[a.type].showChild(a,c)}};dhtmlXRibbon.prototype.check=function(e,c){c=dhx4.s2b(c);var a=this._items[e];if(a&&!a.conf.checked&&typeof(this.items[a.type].check)=="function"){this.items[a.type].check(a);if(c){this.callEvent("onCheck",[a.id,a.conf.checked])}}};dhtmlXRibbon.prototype.uncheck=function(e,c){c=dhx4.s2b(c);var a=this._items[e];if(a&&a.conf.checked&&typeof(this.items[a.type].uncheck)=="function"){this.items[a.type].uncheck(a);if(c){this.callEvent("onCheck",[a.id,a.conf.checked])}}};dhtmlXRibbon.prototype.isChecked=function(c){var a=this._items[c];if(a&&typeof(this.items[a.type].isChecked)=="function"){return this.items[a.type].isChecked(a)}};dhtmlXRibbon.prototype.disable=function(g,c){var e=this._items[g],a;if(this.items[e.type]&&(typeof(this.items[e.type].disable)=="function")){if(this.items[e.type].disable(e)!=true){return}}if(e.type=="tab"){return}else{if(e.type=="block"||e.type=="group"){for(a in e.childIds){a=parseInt(a);this.disable(e.childIds[a])}}}if(!/\s?dhxrb_item_disable/i.test(e.base.className)){e.base.className+=" dhxrb_item_disable"}e.conf.disable=true};dhtmlXRibbon.prototype.enable=function(g,c){var e=this._items[g],a;if(this.items[e.type]&&(typeof(this.items[e.type].enable)=="function")){if(this.items[e.type].enable(e)!=true){return}}if(e.type=="tab"){return}else{if(e.type=="block"||e.type=="group"){for(a in e.childIds){a=parseInt(a);this.enable(e.childIds[a])}}}if(/\s?dhxrb_item_disable/i.test(e.base.className)){e.base.className=e.base.className.replace(/\s?dhxrb_item_disable/i,"")}e.conf.disable=false};dhtmlXRibbon.prototype.isEnabled=function(c){var a=this._items[c];if(this.items[a.type]&&typeof(this.items[a.type].isEnabled)=="function"){return this.items[a.type].isEnabled(a)}if(a.type=="tab"){return}else{return a.conf.disable!=true}};dhtmlXRibbon.prototype.isVisible=function(c){var a=this._items[c];if(this.items[a.type]&&(typeof(this.items[a.type].isVisible)=="function")){return this.items[a.type].isVisible(a)}if(a.type=="tab"){return}else{return !/\s?dhxrb_item_hide/i.test(a.base.className)}};dhtmlXRibbon.prototype.setItemState=function(g,c,e){c=dhx4.s2b(c);e=dhx4.s2b(e);var a=this._items[g];if(a&&(typeof(this.items[a.type].setState)=="function")){switch(a.type){case"buttonSegment":this.items[a.type].setState(a,this,e);break;default:this.items[a.type].setState(a,c,e)}}};dhtmlXRibbon.prototype.getItemState=function(c){var a=this._items[c];if(a&&(typeof(this.items[a.type].getState)=="function")){switch(a.type){case"buttonTwoState":case"buttonSegment":return this.items[a.type].getState(a);break}}return null};dhtmlXRibbon.prototype.setIconPath=function(a){this.conf.icons_path=a};dhtmlXRibbon.prototype.removeItem=function(c){var a=this._items[c];if(a==null){return}switch(a.type){case"tab":break;case"block":this._removeBlock(a);break;case"group":this._removeGroup(a);break;default:this._removeItem(a)}};dhtmlXRibbon.prototype.setSkin=function(h){h=(typeof(h)=="string")?h.toLowerCase():"";if(this._skinCollection[h]!=true){return}var e,c=-1,a,g="dhtmlxribbon";e=this._base.className.match(/\S\w+/ig);if(e instanceof Array){for(a in this._skinCollection){if(c==-1){c=this._indexOf(e,g+"_"+a)}else{break}}c=(c==-1)?e.length:c}else{e=[];c=0}e[c]=g+"_"+h;this._base.className=e.join(" ");this.conf.skin=h;if(this._tabbar!=null){this._tabbar.setSkin(h)}this._setSkinForItems(h)};dhtmlXRibbon.prototype.tabs=function(a){if(this._tabbar instanceof dhtmlXTabBar){return this._tabbar.tabs(a)}else{return undefined}};dhtmlXRibbon.prototype.getItemType=function(c){var a=this._items[c];if(a){return a.type}else{return undefined}};dhtmlXRibbon.prototype.getValue=function(e){var a=this._items[e],c=undefined;if(a&&this.items[a.type]&&typeof(this.items[a.type].getValue)=="function"){c=this.items[a.type].getValue(a)}return c};dhtmlXRibbon.prototype.setValue=function(g,c,e){var a=this._items[g];e=(e===false?false:true);if(a&&this.items[a.type]&&typeof(this.items[a.type].setValue)=="function"){this.items[a.type].setValue(a,c,e)}};dhtmlXRibbon.prototype.getItemText=function(c){var a=this._items[c];if(!a){return null}else{if(a.type=="tab"){return this.tabs(a.id).getText()}else{if(a.type=="block"){return this.items.button.getText(a)}else{if(this.items[a.type]&&typeof(this.items[a.type].getText)=="function"){return this.items[a.type].getText(a)}else{return null}}}}};dhtmlXRibbon.prototype.setItemText=function(e,c){var a=this._items[e];if(!a){return}else{if(a.type=="tab"){this.tabs(a.id).setText(c)}else{if(a.type=="block"){this._setBlockText(a,c)}else{if(this.items[a.type]&&typeof(this.items[a.type].setText)=="function"){this.items[a.type].setText(a,c)}}}}};dhtmlXRibbon.prototype.setItemOptionText=function(g,e,c){var a=this._items[g];if(a.type=="buttonSelect"){this.items[a.type].setOptionText(a,e,c)}};dhtmlXRibbon.prototype.getItemOptionText=function(e,c){var a=this._items[e];if(a.type=="buttonSelect"){return this.items[a.type].getOptionText(a,c)}return null};dhtmlXRibbon.prototype.setItemImage=function(e,a){var c=this._items[e];if(c!=null&&this.items[c.type]!=null&&typeof(this.items[c.type].setImage)=="function"){this.items[c.type].setImage(c,a)}};dhtmlXRibbon.prototype.setItemImageDis=function(e,a){var c=this._items[e];if(c!=null&&this.items[c.type]!=null&&typeof(this.items[c.type].setImageDis)=="function"){this.items[c.type].setImageDis(c,a)}};dhtmlXRibbon.prototype.getCombo=function(c){var a=this._items[c];if(a!=null&&a.type=="buttonCombo"){return a.combo}return null};(function(){var a=dhtmlXRibbon.prototype.items;a.buttonTwoState=a._extends(a.buttonTwoState,a.button);a.buttonSelect=a._extends(a.buttonSelect,a.buttonTwoState);a.buttonSegment=a._extends(a.buttonSegment,a.buttonTwoState)})();if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype._createNode_ribbon=function(h,c,g,a,e){if(typeof(e)!="undefined"){h=e}else{h=document.createElement("DIV");h.className="dhx_cell_ribbon_"+(this.conf.borders?"def":"no_borders");h.appendChild(document.createElement("DIV"))}this.cell.insertBefore(h,this.cell.childNodes[this.conf.idx.cont]);this.conf.ofs_nodes.t.ribbon=true;this._updateIdx();this._adjustCont(this._idd);return h};dhtmlXCellObject.prototype.attachRibbon=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}this.callEvent("_onBeforeContentAttach",["ribbon"]);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;this.callEvent("_onContentAttach",[]);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.getAttachedRibbon=function(){return this.dataNodes.ribbon}}function dhtmlXToolbarObject(c,e){var a=this;this.conf={skin:(e||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxtoolbar")||"dhx_skyblue"),align:"left",align_autostart:"left",icons_path:"",iconSize:18,sel_ofs_x:0,sel_ofs_y:0,xml_autoload:null,items_autoload:null};if(typeof(c)=="object"&&c!=null&&typeof(c.tagName)=="undefined"){if(c.icons_path!=null||c.icon_path!=null){this.conf.icons_path=(c.icons_path||c.icon_path)}if(c.icons_size!=null){this.conf.icons_size_autoload=c.icons_size}if(c.json!=null){this.conf.json_autoload=c.json}if(c.xml!=null){this.conf.xml_autoload=c.xml}if(c.onload!=null){this.conf.onload_autoload=c.onload}if(c.onclick!=null||c.onClick!=null){this.conf.auto_onclick=(c.onclick||c.onClick)}if(c.items!=null){this.conf.items_autoload=c.items}if(c.skin!=null){this.conf.skin=c.skin}if(c.align!=null){this.conf.align_autostart=c.align}c=c.parent}this.cont=(typeof(c)!="object")?document.getElementById(c):c;while(this.cont.childNodes.length>0){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(g){g=g||event;if((String(g.target.tagName||"").toLowerCase()=="input")){return true}if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}g.cancelBubble=true;return false}}this.setSkin(this.conf.skin);this.objPull={};this.anyUsed="none";this._genStr=function(g){var h="dhxId_";var m="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var l=0;l<g;l++){h+=m.charAt(Math.round(Math.random()*(m.length-1)))}return h};this.rootTypes=new Array("button","buttonSelect","buttonTwoState","separator","label","slider","text","buttonInput");this.idPrefix=this._genStr(12);window.dhx4._enableDataLoading(this,"_initObj","_xmlToJson","toolbar",{struct:true});window.dhx4._eventable(this);this._getObj=function(m,g){var h=null;for(var l=0;l<m.childNodes.length;l++){if(m.childNodes[l].tagName!=null){if(String(m.childNodes[l].tagName).toLowerCase()==String(g).toLowerCase()){h=m.childNodes[l]}}}return h};this._addImgObj=function(h){var g=document.createElement("IMG");if(h.childNodes.length>0){h.insertBefore(g,h.childNodes[0])}else{h.appendChild(g)}return g};this._setItemImage=function(m,h,g){if(g==true){m.imgEn=h}else{m.imgDis=h}if((!m.state&&g==true)||(m.state&&g==false)){return}var l=this._getObj(m.obj,"img");if(l==null){l=this._addImgObj(m.obj)}l.src=this.conf.icons_path+h};this._clearItemImage=function(l,g){if(g==true){l.imgEn=""}else{l.imgDis=""}if((!l.state&&g==true)||(l.state&&g==false)){return}var h=this._getObj(l.obj,"img");if(h!=null){h.parentNode.removeChild(h)}};this._setItemText=function(g,l){var h=this._getObj(g.obj,"div");if(l==null||l.length==0){if(h!=null){h.parentNode.removeChild(h)}return}if(h==null){h=document.createElement("DIV");h.className="dhxtoolbar_text";g.obj.appendChild(h)}h.innerHTML=l};this._getItemText=function(g){var h=this._getObj(g.obj,"div");if(h!=null){return h.innerHTML}return""};this._enableItem=function(h){if(h.state){return}h.state=true;if(this.objPull[h.id]["type"]=="buttonTwoState"&&this.objPull[h.id]["obj"]["pressed"]==true){h.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres";h.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}else{h.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";h.obj.renderAs=h.obj.className}if(h.arw){h.arw.className=String(h.obj.className).replace("btn","arw")}var g=this._getObj(h.obj,"img");if(h.imgEn!=""){if(g==null){g=this._addImgObj(h.obj)}g.src=this.conf.icons_path+h.imgEn}else{if(g!=null){g.parentNode.removeChild(g)}}};this._disableItem=function(h){if(!h.state){return}h.state=false;h.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.objPull[h.id]["type"]=="buttonTwoState"&&h.obj.pressed?"pres_":"")+"dis";h.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";if(h.arw){h.arw.className=String(h.obj.className).replace("btn","arw")}var g=this._getObj(h.obj,"img");if(h.imgDis!=""){if(g==null){g=this._addImgObj(h.obj)}g.src=this.conf.icons_path+h.imgDis}else{if(g!=null){g.parentNode.removeChild(g)}}if(h.polygon!=null){if(h.polygon.style.display!="none"){window.dhx4.zim.clear(h.polygon._idd);h.polygon.style.display="none";if(h.polygon._ie6cover){h.polygon._ie6cover.style.display="none"}if(this.conf.skin=="dhx_terrace"){this._improveTerraceButtonSelect(h.id,true)}}}this.anyUsed="none"};this.clearAll=function(){for(var g in this.objPull){this._removeItem(String(g).replace(this.idPrefix,""))}};this._doOnClick=function(g){if(a&&a.forEachItem){a.forEachItem(function(l){if(a.objPull[a.idPrefix+l]["type"]=="buttonSelect"){var h=a.objPull[a.idPrefix+l];if(h.arw._skip===true){h.arw._skip=false}else{if(h.polygon.style.display!="none"){h.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";h.obj.className=h.obj.renderAs;h.arw.className=String(h.obj.renderAs).replace("btn","arw");a.anyUsed="none";window.dhx4.zim.clear(h.polygon._idd);h.polygon.style.display="none";if(h.polygon._ie6cover){h.polygon._ie6cover.style.display="none"}if(a.conf.skin=="dhx_terrace"){a._improveTerraceButtonSelect(h.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}if(typeof(this.conf.auto_onclick)=="function"){this.attachEvent("onClick",this.conf.auto_onclick)}else{if(typeof(this.conf.auto_onclick)=="string"&&typeof(window[this.conf.auto_onclick])=="function"){this.attachEvent("onClick",window[this.conf.auto_onclick])}}return this}dhtmlXToolbarObject.prototype.addSpacer=function(e){var c=this.idPrefix+e;if(this._spacer!=null){if(this._spacer.idd==e){return}if(this._spacer==this.objPull[c].obj.parentNode){var a=true;while(a){var m=this._spacer.childNodes[0].idd;this.base.appendChild(this._spacer.childNodes[0]);if(m==e||this._spacer.childNodes.length==0){if(this.objPull[c].arw!=null){this.base.appendChild(this.objPull[c].arw)}a=false}}this._spacer.idd=e;this._fixSpacer();return}if(this.base==this.objPull[c].obj.parentNode){var a=true;var l=(this.objPull[c].arw!=null);while(a){var g=this.base.childNodes.length-1;if(l==true){if(this.base.childNodes[g]==this.objPull[c].arw){a=false}}if(this.base.childNodes[g].idd==e){a=false}if(a){if(this._spacer.childNodes.length>0){this._spacer.insertBefore(this.base.childNodes[g],this._spacer.childNodes[0])}else{this._spacer.appendChild(this.base.childNodes[g])}}}this._spacer.idd=e;this._fixSpacer();return}}else{var h=null;for(var g=0;g<this.base.childNodes.length;g++){if(this.base.childNodes[g]==this.objPull[this.idPrefix+e].obj){h=g;if(this.objPull[this.idPrefix+e].arw!=null){h=g+1}}}if(h!=null){this._spacer=document.createElement("DIV");this._spacer.className=(this.conf.align=="right"?" dhxtoolbar_float_left":" dhxtoolbar_float_right");this._spacer.dir="ltr";this._spacer.idd=e;while(this.base.childNodes.length>h+1){this._spacer.appendChild(this.base.childNodes[h+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(e){var g=this.getParentId(e);if(g!=null){var c=null;var a=this.objPull[this.idPrefix+g]._listOptions[e];if(a!=null){if(a.sep!=null){c="buttonSelectSeparator"}else{c="buttonSelectButton"}}return c}else{if(this.objPull[this.idPrefix+e]==null){return null}return this.objPull[this.idPrefix+e]["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(e,c){for(var a=0;a<e.length;a++){if(e[a]==c){return true}}return false};dhtmlXToolbarObject.prototype.getParentId=function(g){var h=null;for(var e in this.objPull){if(this.objPull[e]._listOptions){for(var c in this.objPull[e]._listOptions){if(c==g){h=String(e).replace(this.idPrefix,"")}}}}return h};dhtmlXToolbarObject.prototype._addItem=function(a,c){if(typeof(a.text)=="string"){a.text=window.dhx4.trim(a.text);if(a.text.length==0){a.text=null}}this._addItemToStorage(a,c);if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype.addButton=function(h,g,c,a,e){this._addItem({id:h,type:"button",text:c,img:a,imgdis:e},g)};dhtmlXToolbarObject.prototype.addText=function(e,c,a){this._addItem({id:e,type:"text",text:a},c)};dhtmlXToolbarObject.prototype.addButtonSelect=function(g,n,s,a,c,o,m,w,h,l){var v=[];for(var e=0;e<a.length;e++){var r={};if(a[e] instanceof Array){r.id=a[e][0];r.type=(a[e][1]=="obj"?"button":"separator");r.text=(a[e][2]||null);r.img=(a[e][3]||null)}else{if(a[e] instanceof Object&&a[e]!=null&&typeof(a[e].id)!="undefined"&&typeof(a[e].type)!="undefined"){r.id=a[e].id;r.type=(a[e].type=="obj"?"button":"separator");r.text=a[e].text;r.img=a[e].img}}v.push(r)}this._addItem({id:g,type:"buttonSelect",text:s,img:c,imgdis:o,renderSelect:m,openAll:w,options:v,maxOpen:h,mode:l},n)};dhtmlXToolbarObject.prototype.addButtonTwoState=function(h,g,c,a,e){this._addItem({id:h,type:"buttonTwoState",img:a,imgdis:e,text:c},g)};dhtmlXToolbarObject.prototype.addSeparator=function(c,a){this._addItem({id:c,type:"separator"},a)};dhtmlXToolbarObject.prototype.addSlider=function(c,m,h,g,o,e,l,a,n){this._addItem({id:c,type:"slider",length:h,valueMin:g,valueMax:o,valueNow:e,textMin:l,textMax:a,toolTip:n},m)};dhtmlXToolbarObject.prototype.addInput=function(g,e,c,a){this._addItem({id:g,type:"buttonInput",value:c,width:a},e)};dhtmlXToolbarObject.prototype.forEachItem=function(e){for(var c in this.objPull){if(this.inArray(this.rootTypes,this.objPull[c]["type"])){e(this.objPull[c]["id"].replace(this.idPrefix,""))}}};(function(){var l="isVisible,enableItem,disableItem,isEnabled,setItemText,getItemText,setItemToolTip,getItemToolTip,getInput,setItemImage,setItemImageDis,clearItemImage,clearItemImageDis,setItemState,getItemState,setItemToolTipTemplate,getItemToolTipTemplate,setValue,getValue,setMinValue,getMinValue,setMaxValue,getMaxValue,setWidth,getWidth,setMaxOpen".split(",");var e=[false,"","",false,"","","","","","","","","",false,"","","",null,"",[null,null],"",[null,null],"",null];var c=function(m,n){return function(r,q,o){r=this.idPrefix+r;if(this.objPull[r][m]!=null){return this.objPull[r][m].call(this.objPull[r],q,o)}else{return n}}};for(var h=0;h<l.length;h++){var a=l[h];var g=e[h];dhtmlXToolbarObject.prototype[a]=c(a,g)}})();dhtmlXToolbarObject.prototype.showItem=function(a){a=this.idPrefix+a;if(this.objPull[a]!=null&&this.objPull[a].showItem!=null){this.objPull[a].showItem();if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}}};dhtmlXToolbarObject.prototype.hideItem=function(a){a=this.idPrefix+a;if(this.objPull[a]!=null&&this.objPull[a].hideItem!=null){this.objPull[a].hideItem();if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}}};dhtmlXToolbarObject.prototype.getPosition=function(a){return this._getPosition(a)};dhtmlXToolbarObject.prototype._getPosition=function(h,e){if(this.objPull[this.idPrefix+h]==null){return null}var g=null;var a=0;for(var c=0;c<this.base.childNodes.length;c++){if(this.base.childNodes[c].idd!=null){if(this.base.childNodes[c].idd==h){g=a}a++}}if(!g&&this._spacer!=null){for(var c=0;c<this._spacer.childNodes.length;c++){if(this._spacer.childNodes[c].idd!=null){if(this._spacer.childNodes[c].idd==h){g=a}a++}}}return g};dhtmlXToolbarObject.prototype.setPosition=function(a,c){this._setPosition(a,c)};dhtmlXToolbarObject.prototype._setPosition=function(h,g){if(this.objPull[this.idPrefix+h]==null){return}if(isNaN(g)){g=this.base.childNodes.length}if(g<0){g=0}var a=null;if(this._spacer){a=this._spacer.idd;this.removeSpacer()}var e=this.objPull[this.idPrefix+h];this.base.removeChild(e.obj);if(e.arw){this.base.removeChild(e.arw)}var c=this._getIdByPosition(g,true);if(c[0]==null){this.base.appendChild(e.obj);if(e.arw){this.base.appendChild(e.arw)}}else{this.base.insertBefore(e.obj,this.base.childNodes[c[1]]);if(e.arw){this.base.insertBefore(e.arw,this.base.childNodes[c[1]+1])}}if(a!=null){this.addSpacer(a)}};dhtmlXToolbarObject.prototype._getIdByPosition=function(l,c){var h=null;var a=0;var e=0;for(var g=0;g<this.base.childNodes.length;g++){if(this.base.childNodes[g]["idd"]!=null&&h==null){if((a++)==l){h=this.base.childNodes[g]["idd"]}}if(h==null){e++}}e=(h==null?null:e);return(c==true?new Array(h,e):h)};dhtmlXToolbarObject.prototype.removeItem=function(a){this._removeItem(a);if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype._removeItem=function(h){var e=this.getType(h);h=this.idPrefix+h;var g=this.objPull[h];if(e=="button"){g.obj._doOnMouseOver=null;g.obj._doOnMouseOut=null;g.obj._doOnMouseUp=null;g.obj._doOnMouseUpOnceAnywhere=null;g.obj.onclick=null;g.obj.onmouseover=null;g.obj.onmouseout=null;g.obj.onmouseup=null;g.obj.onmousedown=null;g.obj.onselectstart=null;g.obj.renderAs=null;g.obj.idd=null;g.obj.parentNode.removeChild(g.obj);g.obj=null;g.id=null;g.state=null;g.img=null;g.imgEn=null;g.imgDis=null;g.type=null;g.enableItem=null;g.disableItem=null;g.isEnabled=null;g.showItem=null;g.hideItem=null;g.isVisible=null;g.setItemText=null;g.getItemText=null;g.setItemImage=null;g.clearItemImage=null;g.setItemImageDis=null;g.clearItemImageDis=null;g.setItemToolTip=null;g.getItemToolTip=null}if(e=="buttonTwoState"){g.obj._doOnMouseOver=null;g.obj._doOnMouseOut=null;g.obj.onmouseover=null;g.obj.onmouseout=null;g.obj.onmousedown=null;g.obj.onselectstart=null;g.obj.renderAs=null;g.obj.idd=null;g.obj.parentNode.removeChild(g.obj);g.obj=null;g.id=null;g.state=null;g.img=null;g.imgEn=null;g.imgDis=null;g.type=null;g.enableItem=null;g.disableItem=null;g.isEnabled=null;g.showItem=null;g.hideItem=null;g.isVisible=null;g.setItemText=null;g.getItemText=null;g.setItemImage=null;g.clearItemImage=null;g.setItemImageDis=null;g.clearItemImageDis=null;g.setItemToolTip=null;g.getItemToolTip=null;g.setItemState=null;g.getItemState=null}if(e=="buttonSelect"){for(var c in g._listOptions){this.removeListOption(h,c)}g._listOptions=null;if(g.polygon._ie6cover){document.body.removeChild(g.polygon._ie6cover);g.polygon._ie6cover=null}g.p_tbl.removeChild(g.p_tbody);g.polygon.removeChild(g.p_tbl);g.polygon.onselectstart=null;document.body.removeChild(g.polygon);g.p_tbody=null;g.p_tbl=null;g.polygon=null;g.obj.onclick=null;g.obj.onmouseover=null;g.obj.onmouseout=null;g.obj.onmouseup=null;g.obj.onmousedown=null;g.obj.onselectstart=null;g.obj.idd=null;g.obj.iddPrefix=null;g.obj.parentNode.removeChild(g.obj);g.obj=null;g.arw.onclick=null;g.arw.onmouseover=null;g.arw.onmouseout=null;g.arw.onmouseup=null;g.arw.onmousedown=null;g.arw.onselectstart=null;g.arw.parentNode.removeChild(g.arw);g.arw=null;g.renderSelect=null;g.state=null;g.type=null;g.id=null;g.img=null;g.imgEn=null;g.imgDis=null;g.openAll=null;g._isListButton=null;g._separatorButtonSelectObject=null;g._buttonButtonSelectObject=null;g.setWidth=null;g.enableItem=null;g.disableItem=null;g.isEnabled=null;g.showItem=null;g.hideItem=null;g.isVisible=null;g.setItemText=null;g.getItemText=null;g.setItemImage=null;g.clearItemImage=null;g.setItemImageDis=null;g.clearItemImageDis=null;g.setItemToolTip=null;g.getItemToolTip=null;g.addListOption=null;g.removeListOption=null;g.showListOption=null;g.hideListOption=null;g.isListOptionVisible=null;g.enableListOption=null;g.disableListOption=null;g.isListOptionEnabled=null;g.setListOptionPosition=null;g.getListOptionPosition=null;g.setListOptionImage=null;g.getListOptionImage=null;g.clearListOptionImage=null;g.setListOptionText=null;g.getListOptionText=null;g.setListOptionToolTip=null;g.getListOptionToolTip=null;g.forEachListOption=null;g.getAllListOptions=null;g.setListOptionSelected=null;g.getListOptionSelected=null}if(e=="buttonInput"){g.obj.childNodes[0].onkeydown=null;g.obj.removeChild(g.obj.childNodes[0]);g.obj.w=null;g.obj.idd=null;g.obj.parentNode.removeChild(g.obj);g.obj=null;g.id=null;g.type=null;g.enableItem=null;g.disableItem=null;g.isEnabled=null;g.showItem=null;g.hideItem=null;g.isVisible=null;g.setItemToolTip=null;g.getItemToolTip=null;g.setWidth=null;g.getWidth=null;g.setValue=null;g.getValue=null;g.setItemText=null;g.getItemText=null}if(e=="slider"){if(window.dhx4.isIPad){document.removeEventListener("touchmove",pen._doOnMouseMoveStart,false);document.removeEventListener("touchend",pen._doOnMouseMoveEnd,false)}else{if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",g.pen._doOnMouseMoveStart,false);window.removeEventListener("mouseup",g.pen._doOnMouseMoveEnd,false)}else{document.body.detachEvent("onmousemove",g.pen._doOnMouseMoveStart);document.body.detachEvent("onmouseup",g.pen._doOnMouseMoveEnd)}}g.pen.allowMove=null;g.pen.initXY=null;g.pen.maxX=null;g.pen.minX=null;g.pen.nowX=null;g.pen.newNowX=null;g.pen.valueMax=null;g.pen.valueMin=null;g.pen.valueNow=null;g.pen._definePos=null;g.pen._detectLimits=null;g.pen._doOnMouseMoveStart=null;g.pen._doOnMouseMoveEnd=null;g.pen.onmousedown=null;g.obj.removeChild(g.pen);g.pen=null;g.label.tip=null;document.body.removeChild(g.label);g.label=null;g.obj.onselectstart=null;g.obj.idd=null;while(g.obj.childNodes.length>0){g.obj.removeChild(g.obj.childNodes[0])}g.obj.parentNode.removeChild(g.obj);g.obj=null;g.id=null;g.type=null;g.state=null;g.enableItem=null;g.disableItem=null;g.isEnabled=null;g.setItemToolTipTemplate=null;g.getItemToolTipTemplate=null;g.setMaxValue=null;g.setMinValue=null;g.getMaxValue=null;g.getMinValue=null;g.setValue=null;g.getValue=null;g.showItem=null;g.hideItem=null;g.isVisible=null}if(e=="separator"){g.obj.onselectstart=null;g.obj.idd=null;g.obj.parentNode.removeChild(g.obj);g.obj=null;g.id=null;g.type=null;g.showItem=null;g.hideItem=null;g.isVisible=null}if(e=="text"){g.obj.onselectstart=null;g.obj.idd=null;g.obj.parentNode.removeChild(g.obj);g.obj=null;g.id=null;g.type=null;g.showItem=null;g.hideItem=null;g.isVisible=null;g.setWidth=null;g.setItemText=null;g.getItemText=null}e=null;g=null;this.objPull[this.idPrefix+h]=null;delete this.objPull[this.idPrefix+h]};(function(){var g="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(h){return function(r,m,l,q,o,n){r=this.idPrefix+r;if(this.objPull[r]==null){return}if(this.objPull[r]["type"]!="buttonSelect"){return}return this.objPull[r][h].call(this.objPull[r],m,l,q,o,n)}};for(var e=0;e<g.length;e++){var a=g[e];dhtmlXToolbarObject.prototype[a]=c(a)}})();dhtmlXToolbarObject.prototype._rtlParseBtn=function(c,a){return c+a};dhtmlXToolbarObject.prototype._separatorObject=function(a,e,c){this.id=a.idPrefix+e;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_sep";this.obj.style.display=(c.hidden!=null?"none":"");this.obj.idd=String(e);this.obj.title=(c.title||"");this.obj.onselectstart=function(g){g=g||event;if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}};if(window.dhx4.isIPad){this.obj.ontouchstart=function(g){g=g||event;if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}g.cancelBubble=true;return false}}a.base.appendChild(this.obj);this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};return this};dhtmlXToolbarObject.prototype._textObject=function(a,e,c){this.id=a.idPrefix+e;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_text";this.obj.style.display=(c.hidden!=null?"none":"");this.obj.idd=String(e);this.obj.title=(c.title||"");this.obj.onselectstart=function(g){g=g||event;if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}};if(window.dhx4.isIPad){this.obj.ontouchstart=function(g){g=g||event;if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}g.cancelBubble=true;return false}}this.obj.innerHTML=(c.text||"");a.base.appendChild(this.obj);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(g){this.obj.innerHTML=g};this.getItemText=function(){return this.obj.innerHTML};this.setWidth=function(g){this.obj.style.width=g+"px"};this.setItemToolTip=function(g){this.obj.title=g};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._buttonObject=function(a,g,c){this.id=a.idPrefix+g;this.state=(c.enabled!=null?false:true);this.imgEn=(c.img||"");this.imgDis=(c.imgdis||"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=(c.hidden!=null?"none":"");this.obj.allowClick=false;this.obj.extAction=(c.action||null);this.obj.renderAs=this.obj.className;this.obj.idd=String(g);this.obj.title=(c.title||"");this.obj.pressed=false;this.obj.innerHTML=a._rtlParseBtn((this.img!=""?"<img src='"+a.conf.icons_path+this.img+"'>":""),(c.text!=null?"<div class='dhxtoolbar_text'>"+c.text+"</div>":""));var e=this;this.obj.onselectstart=function(h){h=h||event;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){this.allowClick=true;if(e.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(e.state==false){return}if(a.anyUsed!="none"){return}this.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.renderAs=this.renderAs};this.obj.onclick=function(h){if(e.state==false){return}if(this.allowClick==false){return}h=h||event;var l=this.idd.replace(a.idPrefix,"");if(this.extAction){try{window[this.extAction](l)}catch(h){}}if(a&&a.callEvent){a.callEvent("onClick",[l])}};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(h){if(e.state==false){h=h||event;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}h.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(l){if(e.state==false){return}if(a.anyUsed!="none"){if(a.anyUsed!=this.idd){return}}var h=a.anyUsed;this._doOnMouseUp();if(window.dhx4.isIPad&&h!="none"){a.callEvent("onClick",[this.idd.replace(a.idPrefix,"")])}};if(window.dhx4.isIPad){this.obj.ontouchmove=function(h){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(h){a._setItemText(this,h)};this.getItemText=function(){return a._getItemText(this)};this.setItemImage=function(h){a._setItemImage(this,h,true)};this.clearItemImage=function(){a._clearItemImage(this,true)};this.setItemImageDis=function(h){a._setItemImage(this,h,false)};this.clearItemImageDis=function(){a._clearItemImage(this,false)};this.setItemToolTip=function(h){this.obj.title=h};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._buttonSelectObject=function(e,l,h){this.id=e.idPrefix+l;this.state=(h.enabled!=null?(h.enabled=="true"?true:false):true);this.imgEn=(h.img||"");this.imgDis=(h.imgdis||"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.mode=(h.mode||"button");if(this.mode=="select"){this.openAll=true;this.renderSelect=false;if(!h.text||h.text.length==0){h.text="&nbsp;"}}else{this.openAll=(window.dhx4.s2b(h.openAll)==true);this.renderSelect=(h.renderSelect==null?true:window.dhx4.s2b(h.renderSelect))}this.maxOpen=(!isNaN(h.maxOpen?h.maxOpen:"")?h.maxOpen:null);this._maxOpenTest=function(){if(!isNaN(this.maxOpen)){if(!e._sbw){var n=document.createElement("DIV");n.className="dhxtoolbar_maxopen_test";document.body.appendChild(n);var m=document.createElement("DIV");m.className="dhxtoolbar_maxopen_test2";n.appendChild(m);e._sbw=n.offsetWidth-m.offsetWidth;n.removeChild(m);m=null;document.body.removeChild(n);n=null}}};this._maxOpenTest();this.obj=document.createElement("DIV");this.obj.allowClick=false;this.obj.extAction=(h.action||null);this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=(h.hidden!=null?"none":"");this.obj.renderAs=this.obj.className;this.obj.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}};this.obj.idd=String(l);this.obj.title=(h.title||"");this.obj.pressed=false;this.callEvent=false;this.obj.innerHTML=e._rtlParseBtn((this.img!=""?"<img src='"+e.conf.icons_path+this.img+"'>":""),(h.text!=null?"<div class='dhxtoolbar_text'>"+h.text+"</div>":""));e.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="<div class='arwimg'>&nbsp;</div>";this.arw.title=this.obj.title;this.arw.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}};e.base.appendChild(this.arw);var a=this;this.obj.onmouseover=function(m){m=m||event;if(e.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(e.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(m){m=m||event;if(!a.obj.allowClick){return}if(!a.state){return}if(e.anyUsed!="none"){return}var n=a.obj.idd.replace(e.idPrefix,"");if(a.obj.extAction){try{window[a.obj.extAction](n)}catch(m){}}e.callEvent("onClick",[n])};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(m){m=m||event;if(e.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(m){m=m||event;m.cancelBubble=true;if(e.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 n=a.obj.idd.replace(e.idPrefix,"");e.callEvent("onClick",[n])}}}if(window.dhx4.isIPad){this.obj.ontouchmove=this.obj.onmouseout}this.arw[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(o){o=o||event;var w=(this.className.indexOf("dhx_toolbar_arw")===0?this:this.nextSibling);if(w._skip){o=o||event;o.cancelBubble=true}else{w._skip=true}w=null;if(!a.state){return}if(e.anyUsed==a.obj.idd){a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");e.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(e.conf.skin=="dhx_terrace"){e._improveTerraceButtonSelect(a.id,true)}}else{if(e.anyUsed!="none"){if(e.objPull[e.idPrefix+e.anyUsed]["type"]=="buttonSelect"){var v=e.objPull[e.idPrefix+e.anyUsed];if(v.polygon.style.display!="none"){v.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";v.obj.className=v.obj.renderAs;v.arw.className=String(a.obj.renderAs).replace("btn","arw");window.dhx4.zim.clear(v.polygon._idd);v.polygon.style.display="none";if(v.polygon._ie6cover){v.polygon._ie6cover.style.display="none"}if(e.conf.skin=="dhx_terrace"){e._improveTerraceButtonSelect(v.id,true)}}}}a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_over";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_pres";e.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(e.conf.skin=="dhx_terrace"){e._improveTerraceButtonSelect(a.id,false)}a._fixMaxOpenHeight(a.maxOpen||null);e._autoDetectVisibleArea();var q=window.dhx4.absTop(a.obj)+a.obj.offsetHeight+e.conf.sel_ofs_y;var s=a.polygon.offsetHeight;if(q+s>e.tY2){var r=(a.maxOpen!=null?Math.floor((e.tY2-q)/22):0);if(r>=1){a._fixMaxOpenHeight(r)}else{q=window.dhx4.absTop(a.obj)-s-e.conf.sel_ofs_y;if(q<0){q=0}}}a.polygon.style.top=q+"px";if(e.rtl){a.polygon.style.left=window.dhx4.absLeft(a.obj)+a.obj.offsetWidth-a.polygon.offsetWidth+e.conf.sel_ofs_x+"px"}else{var n=document.body.scrollLeft;var m=n+(window.innerWidth||document.body.clientWidth);var u=window.dhx4.absLeft(a.obj)+e.conf.sel_ofs_x;if(u+a.polygon.offsetWidth>m){u=window.dhx4.absLeft(a.arw)+a.arw.offsetWidth-a.polygon.offsetWidth}a.polygon.style.left=Math.max(u,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(m){m=m||event;m.cancelBubble=true};this.arw[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(m){m=m||event;m.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=e.idPrefix;this._listOptions={};this._fixMaxOpenHeight=function(r){var q="auto";var o=false;if(r!==null){var n=0;for(var m in this._listOptions){n++}if(n>r){this._ph=22*r;q=this._ph+"px"}else{o=true}}this.polygon.style.width="auto";this.polygon.style.height="auto";if(!o&&a.maxOpen!=null){this.polygon.style.width=this.p_tbl.offsetWidth+e._sbw+"px";this.polygon.style.height=q}};this._separatorButtonSelectObject=function(o,m,n){this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.className="tr_sep";this.obj.tr.onselectstart=function(q){q=q||event;if(q.preventDefault){q.preventDefault()}else{q.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(q){q=q||event;if(q.preventDefault){q.preventDefault()}else{q.returnValue=false}return false};if(isNaN(n)){n=a.p_tbody.childNodes.length+1}else{if(n<1){n=1}}if(n>a.p_tbody.childNodes.length){a.p_tbody.appendChild(this.obj.tr)}else{a.p_tbody.insertBefore(this.obj.tr,a.p_tbody.childNodes[n-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(q){q=q||event;if(q.preventDefault){q.preventDefault()}else{q.returnValue=false}return false};this.obj.td.appendChild(this.obj.sep);a._listOptions[o]=this.obj;return this};this._buttonButtonSelectObject=function(r,o,q){var n=true;if(typeof(o.enabled)!="undefined"){n=window.dhx4.s2b(o.enabled)}else{if(typeof(o.disabled)!="undefined"){n=window.dhx4.s2b(o.disabled)}}this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.en=n;this.obj.tr.extAction=(o.action||null);this.obj.tr._selected=(o.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(s){s=s||event;if(s.preventDefault){s.preventDefault()}else{s.returnValue=false}return false};this.obj.tr.idd=String(r);if(isNaN(q)){q=a.p_tbody.childNodes.length+1}else{if(q<1){q=1}}if(q>a.p_tbody.childNodes.length){a.p_tbody.appendChild(this.obj.tr)}else{a.p_tbody.insertBefore(this.obj.tr,a.p_tbody.childNodes[q-1])}this.obj.td_a=document.createElement("TD");this.obj.td_a.className="td_btn_img";this.obj.td_a.onselectstart=function(s){s=s||event;if(s.preventDefault){s.preventDefault()}else{s.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(s){s=s||event;if(s.preventDefault){s.preventDefault()}else{s.returnValue=false}return false};if(e.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(o.img!=null){this.obj.td_a.innerHTML="<img class='btn_sel_img' src='"+e.conf.icons_path+o.img+"' border='0'>";this.obj.tr._img=o.img}else{this.obj.td_a.innerHTML="&nbsp;"}var m=(o.text!=null?o.text:(o.itemText||""));this.obj.td_b.innerHTML="<div class='btn_sel_text'>"+m+"</div>";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(s){s=s||event;s.cancelBubble=true;if(!this.en){return}a.setListOptionSelected(this.idd.replace(e.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(e.conf.skin=="dhx_terrace"){e._improveTerraceButtonSelect(a.id,true)}e.anyUsed="none";var u=this.idd.replace(e.idPrefix,"");if(this.extAction){try{window[this.extAction](u)}catch(s){}}e.callEvent("onClick",[u])};a._listOptions[r]=this.obj;return this};this.polygon=document.createElement("DIV");this.polygon.dir="ltr";this.polygon.style.display="none";this.polygon.className="dhx_toolbar_poly_"+e.conf.skin+" dhxtoolbar_icons_"+e.conf.iconSize;this.polygon.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}};this.polygon.onmousedown=function(m){m=m||event;m.cancelBubble=true};this.polygon.style.overflowY="auto";this.polygon._idd=window.dhx4.newId();if(window.dhx4.isIPad){this.polygon.ontouchstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}m.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(h.options!=null){for(var g=0;g<h.options.length;g++){var c="_"+(h.options[g].type||"")+"ButtonSelectObject";if(h.options[g].id==null){h.options[g].id=e._genStr(24)}if(typeof(this[c])=="function"){new this[c](h.options[g].id,h.options[g])}}}document.body.appendChild(this.polygon);if(window.dhx4.isIE6){this.polygon._ie6cover=document.createElement("IFRAME");this.polygon._ie6cover.frameBorder=0;this.polygon._ie6cover.style.position="absolute";this.polygon._ie6cover.style.border="none";this.polygon._ie6cover.style.backgroundColor="#000000";this.polygon._ie6cover.style.filter="alpha(opacity=100)";this.polygon._ie6cover.style.display="none";this.polygon._ie6cover.setAttribute("src","javascript:false;");document.body.appendChild(this.polygon._ie6cover)}this.setWidth=function(m){this.obj.style.width=m-this.arw.offsetWidth+"px";this.polygon.style.width=this.obj.offsetWidth+this.arw.offsetWidth-2+"px";this.p_tbl.style.width=this.polygon.style.width};this.enableItem=function(){e._enableItem(this)};this.disableItem=function(){e._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display="";this.arw.style.display=""};this.hideItem=function(){this.obj.style.display="none";this.arw.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setItemText=function(m){e._setItemText(this,m)};this.getItemText=function(){return e._getItemText(this)};this.setItemImage=function(m){e._setItemImage(this,m,true)};this.clearItemImage=function(){e._clearItemImage(this,true)};this.setItemImageDis=function(m){e._setItemImage(this,m,false)};this.clearItemImageDis=function(){e._clearItemImage(this,false)};this.setItemToolTip=function(m){this.obj.title=m;this.arw.title=m};this.getItemToolTip=function(){return this.obj.title};this.addListOption=function(s,r,o,q,m){if(!(o=="button"||o=="separator")){return}var n={id:s,type:o,text:q,img:m};new this["_"+o+"ButtonSelectObject"](s,n,r)};this.removeListOption=function(o){if(!this._isListButton(o,true)){return}var m=this._listOptions[o];if(m.td_a!=null&&m.td_b!=null){m.td_a.onselectstart=null;m.td_b.onselectstart=null;while(m.td_a.childNodes.length>0){m.td_a.removeChild(m.td_a.childNodes[0])}while(m.td_b.childNodes.length>0){m.td_b.removeChild(m.td_b.childNodes[0])}m.tr.onselectstart=null;m.tr.onmouseover=null;m.tr.onmouseout=null;m.tr.onclick=null;while(m.tr.childNodes.length>0){m.tr.removeChild(m.tr.childNodes[0])}m.tr.parentNode.removeChild(m.tr);m.td_a=null;m.td_b=null;m.tr=null}else{m.sep.onselectstart=null;m.td.onselectstart=null;m.tr.onselectstart=null;while(m.td.childNodes.length>0){m.td.removeChild(m.td.childNodes[0])}while(m.tr.childNodes.length>0){m.tr.removeChild(m.tr.childNodes[0])}m.tr.parentNode.removeChild(m.tr);m.sep=null;m.td=null;m.tr=null}m=null;this._listOptions[o]=null;try{delete this._listOptions[o]}catch(n){}};this.showListOption=function(m){if(!this._isListButton(m,true)){return}this._listOptions[m].tr.style.display=""};this.hideListOption=function(m){if(!this._isListButton(m,true)){return}this._listOptions[m].tr.style.display="none"};this.isListOptionVisible=function(m){if(!this._isListButton(m,true)){return}return(this._listOptions[m].tr.style.display!="none")};this.enableListOption=function(m){if(!this._isListButton(m)){return}this._listOptions[m].tr.en=true;this._listOptions[m].tr.className="tr_btn"+(this._listOptions[m].tr._selected&&e.renderSelect?" tr_btn_selected":"")};this.disableListOption=function(m){if(!this._isListButton(m)){return}this._listOptions[m].tr.en=false;this._listOptions[m].tr.className="tr_btn tr_btn_disabled"};this.isListOptionEnabled=function(m){if(!this._isListButton(m)){return}return this._listOptions[m].tr.en};this.setListOptionPosition=function(o,n){if(!this._listOptions[o]||this.getListOptionPosition(o)==n||isNaN(n)){return}if(n<1){n=1}var m=this._listOptions[o].tr;this.p_tbody.removeChild(m);if(n>this.p_tbody.childNodes.length){this.p_tbody.appendChild(m)}else{this.p_tbody.insertBefore(m,this.p_tbody.childNodes[n-1])}m=null};this.getListOptionPosition=function(o){var n=-1;if(!this._listOptions[o]){return n}for(var m=0;m<this.p_tbody.childNodes.length;m++){if(this.p_tbody.childNodes[m]==this._listOptions[o].tr){n=m+1}}return n};this.setListOptionImage=function(o,m){if(!this._isListButton(o)){return}var n=this._listOptions[o].tr.childNodes[(e.rtl?1:0)];n.innerHTML="<img src='"+e.conf.icons_path+m+"' class='btn_sel_img'>";n=null};this.getListOptionImage=function(o){if(!this._isListButton(o)){return}var n=this._listOptions[o].tr.childNodes[(e.rtl?1:0)];var m=null;if(n.childNodes.length>0){m=n.childNodes[0].src}n=null;return m};this.clearListOptionImage=function(n){if(!this._isListButton(n)){return}var m=this._listOptions[n].tr.childNodes[(e.rtl?1:0)];while(m.childNodes.length>0){m.removeChild(m.childNodes[0])}m.innerHTML="&nbsp;";m=null};this.setListOptionText=function(n,m){if(!this._isListButton(n)){return}this._listOptions[n].tr.childNodes[(e.rtl?0:1)].childNodes[0].innerHTML=m};this.getListOptionText=function(m){if(!this._isListButton(m)){return}return this._listOptions[m].tr.childNodes[(e.rtl?0:1)].childNodes[0].innerHTML};this.setListOptionToolTip=function(n,m){if(!this._isListButton(n)){return}this._listOptions[n].tr.title=m};this.getListOptionToolTip=function(m){if(!this._isListButton(m)){return}return this._listOptions[m].tr.title};this.forEachListOption=function(n){for(var m in this._listOptions){n(m)}};this.getAllListOptions=function(){var n=new Array();for(var m in this._listOptions){n[n.length]=m}return n};this.setListOptionSelected=function(o){for(var m in this._listOptions){var n=this._listOptions[m];if(n.td_a!=null&&n.td_b!=null&&n.tr.en){if(m==o){n.tr._selected=true;n.tr.className="tr_btn"+(this.renderSelect?" tr_btn_selected":"");if(this.mode=="select"){if(n.tr._img){this.setItemImage(n.tr._img)}else{this.clearItemImage()}this.setItemText(this.getListOptionText(o))}}else{n.tr._selected=false;n.tr.className="tr_btn"}}n=null}};this.getListOptionSelected=function(){var n=null;for(var m in this._listOptions){if(this._listOptions[m].tr._selected==true){n=m}}return n};this._isListButton=function(n,m){if(this._listOptions[n]==null){return false}if(!m&&this._listOptions[n].tr.className=="tr_sep"){return false}return true};this.setMaxOpen=function(m){this._ph=null;if(typeof(m)=="number"){this.maxOpen=m;this._maxOpenTest();return}this.maxOpen=null};if(h.width){this.setWidth(h.width)}if(this.mode=="select"&&typeof(h.selected)!="undefined"){this.setListOptionSelected(h.selected)}return this};dhtmlXToolbarObject.prototype._buttonInputObject=function(e,h,g){this.id=e.idPrefix+h;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.obj.style.display=(g.hidden!=null?"none":"");this.obj.idd=String(h);this.obj.w=(g.width!=null?g.width:100);this.obj.title=(g.title!=null?g.title:"");this.obj.innerHTML="<input class='dhxtoolbar_input' type='text' style='width:"+this.obj.w+"px;'"+(g.value!=null?" value='"+g.value+"'":"")+">";var c=e;var a=this;this.obj.childNodes[0].onkeydown=function(l){l=l||event;if(l.keyCode==13){c.callEvent("onEnter",[a.obj.idd,this.value])}};e.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(l){this.obj.childNodes[0].value=l};this.getValue=function(){return this.obj.childNodes[0].value};this.setWidth=function(l){this.obj.w=l;this.obj.childNodes[0].style.width=this.obj.w+"px"};this.getWidth=function(){return this.obj.w};this.setItemToolTip=function(l){this.obj.title=l};this.getItemToolTip=function(){return this.obj.title};this.getInput=function(){return this.obj.firstChild};if(typeof(g.enabled)!="undefined"&&window.dhx4.s2b(g.enabled)==false){this.disableItem()}return this};dhtmlXToolbarObject.prototype._buttonTwoStateObject=function(a,g,c){this.id=a.idPrefix+g;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(g);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!=""?"<img src='"+a.conf.icons_path+this.img+"'>":""),(c.text!=null?"<div class='dhxtoolbar_text'>"+c.text+"</div>":""));a.base.appendChild(this.obj);var e=this;this.obj.onselectstart=function(h){h=h||event;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){if(e.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(e.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(h){if(a.checkEvent("onBeforeStateChange")){if(!a.callEvent("onBeforeStateChange",[this.idd.replace(a.idPrefix,""),this.pressed])){return}}if(e.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 l=this.idd.replace(a.idPrefix,"");if(this.extAction){try{window[this.extAction](l,this.pressed)}catch(h){}}a.callEvent("onStateChange",[l,this.pressed]);return false};this.setItemState=function(h,m){if(this.obj.pressed!=h){if(h==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(m==true){var n=this.obj.idd.replace(a.idPrefix,"");if(this.obj.extAction){try{window[this.obj.extAction](n,this.obj.pressed)}catch(l){}}a.callEvent("onStateChange",[n,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(h){a._setItemText(this,h)};this.getItemText=function(){return a._getItemText(this)};this.setItemImage=function(h){a._setItemImage(this,h,true)};this.clearItemImage=function(){a._clearItemImage(this,true)};this.setItemImageDis=function(h){a._setItemImage(this,h,false)};this.clearItemImageDis=function(){a._clearItemImage(this,false)};this.setItemToolTip=function(h){this.obj.title=h};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._sliderObject=function(g,l,h){this.id=g.idPrefix+l;this.state=(h.enabled!=null?(h.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=(h.hidden!=null?"none":"");this.obj.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}};this.obj.idd=String(l);this.obj.len=(h.length!=null?Number(h.length):50);this.obj.innerHTML="<div class='dhxtoolbar_text'>"+(h.textMin||"")+"</div><div class='dhxtoolbar_sl_bg_l'></div><div class='dhxtoolbar_sl_bg_m' style='width:"+this.obj.len+"px;'></div><div class='dhxtoolbar_sl_bg_r'></div><div class='dhxtoolbar_text'>"+(h.textMax||"")+"</div>";g.base.appendChild(this.obj);var a=this;this.pen=document.createElement("DIV");this.pen.className="dhxtoolbar_sl_pen";this.obj.appendChild(this.pen);var e=this.pen;this.label=document.createElement("DIV");this.label.dir="ltr";this.label.className="dhx_toolbar_slider_label_"+g.conf.skin+(g.rtl?"_rtl":"");this.label.style.display="none";this.label.tip=(h.toolTip||"%v");this.label._zi=window.dhx4.newId();document.body.appendChild(this.label);var c=this.label;this.pen.valueMin=(h.valueMin!=null?Number(h.valueMin):0);this.pen.valueMax=(h.valueMax!=null?Number(h.valueMax):100);if(this.pen.valueMin>this.pen.valueMax){this.pen.valueMin=this.pen.valueMax}this.pen.valueNow=(h.valueNow!=null?Number(h.valueNow):this.pen.valueMax);if(this.pen.valueNow>this.pen.valueMax){this.pen.valueNow=this.pen.valueMax}if(this.pen.valueNow<this.pen.valueMin){this.pen.valueNow=this.pen.valueMin}this.pen._detectLimits=function(){this.minX=a.obj.childNodes[1].offsetLeft+2;this.maxX=a.obj.childNodes[3].offsetLeft-this.offsetWidth+1};this.pen._detectLimits();this.pen._definePos=function(){this.nowX=Math.round((this.valueNow-this.valueMin)*(this.maxX-this.minX)/(this.valueMax-this.valueMin)+this.minX);this.style.left=this.nowX+"px";this.newNowX=this.nowX};this.pen._definePos();this.pen.initXY=0;this.pen.allowMove=false;this.pen[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(m){if(a.state==false){return}m=m||event;this.initXY=(window.dhx4.isIPad?m.touches[0].clientX:m.clientX);this.newValueNow=this.valueNow;this.allowMove=true;this.className="dhxtoolbar_sl_pen dhxtoolbar_over";if(c.tip!=""){c.style.visibility="hidden";c.style.display="";c.innerHTML=c.tip.replace("%v",this.valueNow);c.style.left=Math.round(window.dhx4.absLeft(this)+this.offsetWidth/2-c.offsetWidth/2)+"px";c.style.top=window.dhx4.absTop(this)-c.offsetHeight-3+"px";c.style.visibility="";c.style.zIndex=window.dhx4.zim.reserve(c._zi)}};this.pen._doOnMouseMoveStart=function(n){n=n||event;if(!e.allowMove){return}var m=(window.dhx4.isIPad?n.touches[0].clientX:n.clientX);var o=m-e.initXY;if(m<window.dhx4.absLeft(e)+Math.round(e.offsetWidth/2)&&e.nowX==e.minX){return}if(m>window.dhx4.absLeft(e)+Math.round(e.offsetWidth/2)&&e.nowX==e.maxX){return}e.newNowX=e.nowX+o;if(e.newNowX<e.minX){e.newNowX=e.minX}if(e.newNowX>e.maxX){e.newNowX=e.maxX}e.nowX=e.newNowX;e.style.left=e.nowX+"px";e.initXY=m;e.newValueNow=Math.round((e.valueMax-e.valueMin)*(e.newNowX-e.minX)/(e.maxX-e.minX)+e.valueMin);if(c.tip!=""){c.innerHTML=c.tip.replace(/%v/gi,e.newValueNow);c.style.left=Math.round(window.dhx4.absLeft(e)+e.offsetWidth/2-c.offsetWidth/2)+"px";c.style.top=window.dhx4.absTop(e)-c.offsetHeight-3+"px"}n.cancelBubble=true;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}return false};this.pen._doOnMouseMoveEnd=function(){if(!e.allowMove){return}e.className="dhxtoolbar_sl_pen";e.allowMove=false;e.nowX=e.newNowX;e.valueNow=e.newValueNow;if(c.tip!=""){c.style.display="none";window.dhx4.zim.clear(c._zi)}g.callEvent("onValueChange",[a.obj.idd.replace(g.idPrefix,""),e.valueNow])};if(window.dhx4.isIPad){document.addEventListener("touchmove",e._doOnMouseMoveStart,false);document.addEventListener("touchend",e._doOnMouseMoveEnd,false)}else{if(typeof(window.addEventListener)!="undefined"){window.addEventListener("mousemove",e._doOnMouseMoveStart,false);window.addEventListener("mouseup",e._doOnMouseMoveEnd,false)}else{document.body.attachEvent("onmousemove",e._doOnMouseMoveStart);document.body.attachEvent("onmouseup",e._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(m,n){m=Number(m);if(m<this.pen.valueMin){m=this.pen.valueMin}if(m>this.pen.valueMax){m=this.pen.valueMax}this.pen.valueNow=m;this.pen._definePos();if(n==true){g.callEvent("onValueChange",[this.obj.idd.replace(g.idPrefix,""),this.pen.valueNow])}};this.getValue=function(){return this.pen.valueNow};this.setMinValue=function(n,m){n=Number(n);if(n>this.pen.valueMax){return}this.obj.childNodes[0].innerHTML=m;this.obj.childNodes[0].style.display=(m.length>0?"":"none");this.pen.valueMin=n;if(this.pen.valueNow<this.pen.valueMin){this.pen.valueNow=this.pen.valueMin}this.pen._detectLimits();this.pen._definePos()};this.setMaxValue=function(n,m){n=Number(n);if(n<this.pen.valueMin){return}this.obj.childNodes[4].innerHTML=m;this.obj.childNodes[4].style.display=(m.length>0?"":"none");this.pen.valueMax=n;if(this.pen.valueNow>this.pen.valueMax){this.pen.valueNow=this.pen.valueMax}this.pen._detectLimits();this.pen._definePos()};this.getMinValue=function(){var m=this.obj.childNodes[0].innerHTML;var n=this.pen.valueMin;return new Array(n,m)};this.getMaxValue=function(){var m=this.obj.childNodes[4].innerHTML;var n=this.pen.valueMax;return new Array(n,m)};this.setItemToolTipTemplate=function(m){this.label.tip=m};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<c.length;a++){this._addItemToStorage(c[a])}if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype._xmlToJson=function(v){var o=[];var A=v.getElementsByTagName("toolbar");if(A!=null&&A[0]!=null){A=A[0];var x=function(e){var h=e.getElementsByTagName("itemText");if(h!=null&&h[0]!=null){return window.dhx4._xmlNodeValue(h[0])}return null};var E=["id","type","hidden","title","text","enabled","img","imgdis","action","openAll","renderSelect","mode","maxOpen","width","value","selected","length","textMin","textMax","toolTip","valueMin","valueMax","valueNow"];var g=["id","type","enabled","disabled","action","selected","img","text"];for(var c=0;c<A.childNodes.length;c++){if(A.childNodes[c].tagName=="item"){var n={};for(var C=0;C<E.length;C++){var l=A.childNodes[c].getAttribute(E[C]);if(l!=null){n[E[C]]=l}}for(var y=0;y<A.childNodes[c].childNodes.length;y++){if(A.childNodes[c].childNodes[y].tagName=="item"&&n.type=="buttonSelect"){var D={};for(var C=0;C<g.length;C++){var l=A.childNodes[c].childNodes[y].getAttribute(g[C]);if(l!=null){D[g[C]]=l}}var s=A.childNodes[c].childNodes[y].getElementsByTagName("userdata");for(var C=0;C<s.length;C++){if(!D.userdata){D.userdata={}}var a={};try{a.name=s[C].getAttribute("name")}catch(m){a.name=null}try{a.value=s[C].firstChild.nodeValue}catch(m){a.value=""}if(a.name!=null){D.userdata[a.name]=a.value}}D.text=x(A.childNodes[c].childNodes[y])||D.text;if(n.options==null){n.options=[]}n.options.push(D)}if(A.childNodes[c].childNodes[y].tagName=="userdata"){if(n.userdata==null){n.userdata={}}var D={};try{D.name=A.childNodes[c].childNodes[y].getAttribute("name")}catch(m){D.name=null}try{D.value=A.childNodes[c].childNodes[y].firstChild.nodeValue}catch(m){D.value=""}if(D.name!=null){n.userdata[D.name]=D.value}}}n.text=x(A.childNodes[c])||n.text;o.push(n)}}x=null}return o};dhtmlXToolbarObject.prototype._addItemToStorage=function(l,n){var m=(l.id||this._genStr(24));var g=(l.type||"");if(g=="spacer"){this.addSpacer(this._lastId)}else{this._lastId=m}if(g!=""&&this["_"+g+"Object"]!=null){if(g=="buttonSelect"){if(l.options!=null){for(var h=0;h<l.options.length;h++){if(l.options[h].type=="obj"){l.options[h].type="button"}if(l.options[h].type=="sep"){l.options[h].type="separator"}}}}if(g=="slider"){var e={tip_template:"toolTip",value_min:"valueMin",value_max:"valueMax",value_now:"valueNow",text_min:"textMin",text_max:"textMax"};for(var c in e){if(l[e[c]]==null&&l[c]!=null){l[e[c]]=l[c]}}}if(g=="buttonInput"){if(l.value==null&&l.text!=null){l.value=l.text}}if(g=="buttonTwoState"){if(typeof(l.selected)=="undefined"&&typeof(l.pressed)!="undefined"&&window.dhx4.s2b(l.pressed)){l.selected=true}}if(typeof(l.enabled)=="undefined"&&typeof(l.disabled)!="undefined"&&window.dhx4.s2b(l.disabled)){l.enabled=false}if(l.imgDis==null&&l.img_disabled!=null){l.imgdis=l.img_disabled}if((typeof(l.openAll)=="undefined"||l.openAll==null)&&this.conf.skin=="dhx_terrace"){l.openAll=true}this.objPull[this.idPrefix+m]=new this["_"+g+"Object"](this,m,l);this.objPull[this.idPrefix+m]["type"]=g;this.setPosition(m,n)}if(l.userdata!=null){for(var c in l.userdata){this.setUserData(m,c,l.userdata[c])}}if(l.options!=null){for(var h=0;h<l.options.length;h++){if(l.options[h].userdata!=null){for(var c in l.options[h].userdata){this.setListOptionUserData(l.id,l.options[h].id,c,l.options[h].userdata[c])}}}}};dhtmlXToolbarObject.prototype.setSkin=function(h,e){if(e===true){this.cont.className=this.cont.className.replace(/dhxtoolbar_icons_\d{1,}/,"dhxtoolbar_icons_"+this.conf.iconSize)}else{this.conf.skin=h;if(this.conf.skin=="dhx_skyblue"){this.conf.sel_ofs_y=1}if(this.conf.skin=="dhx_web"){this.conf.sel_ofs_y=1;this.conf.sel_ofs_x=1}if(this.conf.skin=="dhx_terrace"){this.conf.sel_ofs_y=-1;this.conf.sel_ofs_x=0}this.cont.className="dhx_toolbar_"+this.conf.skin+" dhxtoolbar_icons_"+this.conf.iconSize}for(var c in this.objPull){var g=this.objPull[c];if(g.type=="slider"){g.pen._detectLimits();g.pen._definePos();g.label.className="dhx_toolbar_slider_label_"+this.conf.skin}if(g.type=="buttonSelect"){g.polygon.className="dhx_toolbar_poly_"+this.conf.skin+" dhxtoolbar_icons_"+this.conf.iconSize}}if(h=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype.setAlign=function(a){this.conf.align=(a=="right"?"right":"left");this.base.className=(a=="right"?"dhxtoolbar_float_right":"dhxtoolbar_float_left");if(this._spacer){this._spacer.className=(a=="right"?" dhxtoolbar_float_left":" dhxtoolbar_float_right")}};dhtmlXToolbarObject.prototype.setIconSize=function(a){this.conf.iconSize=({18:true,24:true,32:true,48:true}[a]?a:18);this.setSkin(this.conf.skin,true);this.callEvent("_onIconSizeChange",[this.conf.iconSize])};dhtmlXToolbarObject.prototype.setIconsPath=function(a){this.conf.icons_path=a};dhtmlXToolbarObject.prototype.setUserData=function(e,a,c){e=this.idPrefix+e;if(this.objPull[e]!=null){if(this.objPull[e].userData==null){this.objPull[e].userData={}}this.objPull[e].userData[a]=c}};dhtmlXToolbarObject.prototype.getUserData=function(c,a){c=this.idPrefix+c;if(this.objPull[c]!=null&&this.objPull[c].userData!=null){return this.objPull[c].userData[a]||null}return null};dhtmlXToolbarObject.prototype._isListOptionExists=function(a,e){if(this.objPull[this.idPrefix+a]==null){return false}var c=this.objPull[this.idPrefix+a];if(c.type!="buttonSelect"){return false}if(c._listOptions[e]==null){return false}return true};dhtmlXToolbarObject.prototype.setListOptionUserData=function(a,h,c,g){if(!this._isListOptionExists(a,h)){return}var e=this.objPull[this.idPrefix+a]._listOptions[h];if(e.userData==null){e.userData={}}e.userData[c]=g};dhtmlXToolbarObject.prototype.getListOptionUserData=function(a,g,c){if(!this._isListOptionExists(a,g)){return null}var e=this.objPull[this.idPrefix+a]._listOptions[g];if(!e.userData){return null}return(e.userData[c]?e.userData[c]:null)};dhtmlXToolbarObject.prototype._improveTerraceSkin=function(){if(this.conf.terrace_radius==null){this.conf.terrace_radius="3px"}var g=[];var h={separator:true,text:true};var m=[this.base];if(this._spacer!=null){m.push(this._spacer)}for(var o=0;o<m.length;o++){g[o]=[];for(var c=0;c<m[o].childNodes.length;c++){if(m[o].childNodes[c].idd!=null&&m[o].childNodes[c].style.display!="none"){var n=this.idPrefix+m[o].childNodes[c].idd;if(this.objPull[n]!=null&&this.objPull[n].obj==m[o].childNodes[c]){g[o].push({a:n,type:this.objPull[n].type,node:this.objPull[n][this.objPull[n].type=="buttonSelect"?"arw":"obj"]})}}}m[o]=null}for(var o=0;o<g.length;o++){for(var c=0;c<g[o].length;c++){var r=g[o][c];var s=false;var l=false;if(!h[r.type]){if(c==g[o].length-1||(g[o][c+1]!=null&&h[g[o][c+1].type])){s=true}if(c==0||(c-1>=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;o<g.length;o++){for(var c=0;c<g[o].length;c++){for(var n in g[o][c]){g[o][c][n]=null}g[o][c]=null}g[o]=null}g=m=null};dhtmlXToolbarObject.prototype._improveTerraceButtonSelect=function(e,c){var a=this.objPull[e];if(c==true){a.obj.style.borderBottomLeftRadius=(a.obj._bl?this.conf.terrace_radius:"0px");a.arw.style.borderBottomRightRadius=(a.obj._br?this.conf.terrace_radius:"0px")}else{a.obj.style.borderBottomLeftRadius="0px";a.arw.style.borderBottomRightRadius="0px"}a=null};if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype._createNode_toolbar=function(h,c,g,a,e){if(typeof(e)!="undefined"){h=e}else{h=document.createElement("DIV");h.className="dhx_cell_toolbar_"+(this.conf.borders?"def":"no_borders");h.appendChild(document.createElement("DIV"));h.firstChild.className="dhx_toolbar_base_18_dhx_skyblue"}this.cell.insertBefore(h,this.cell.childNodes[this.conf.idx.cont]);this.conf.ofs_nodes.t.toolbar=true;this._updateIdx();return h};dhtmlXCellObject.prototype.attachToolbar=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}this.callEvent("_onBeforeContentAttach",["toolbar"]);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;this.callEvent("_onContentAttach",[]);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.getAttachedToolbar=function(){return this.dataNodes.toolbar}}function dhtmlXEditor(e,g){var c=this;this.conf={content:"",contentHTML:"",resizeTM:null,resizeTMTime:100,roMode:false,toolbar:false,iconsPath:"",evs:["focus","blur","keydown","keyup","keypress","mouseup","mousedown","click","touchend"],iOSfix:(navigator.userAgent.match(/Mobile/gi)!=null&&navigator.userAgent.match(/iPad/gi)!=null&&navigator.userAgent.match(/AppleWebKit/gi)!=null)};this._doOnFocusChanged=null;this._doOnAccess=null;if(typeof(e)=="object"&&e!=null&&e.tagName==null){g=e.skin;if(e.content!=null){this.conf.content=e.content}if(e.contentHTML!=null){this.conf.contentHTML=e.contentHTML}if(e.iconsPath!=null){this.conf.iconsPath=e.iconsPath}if(e.toolbar!=null){this.conf.toolbar=window.dhx4.s2b(e.toolbar)}if(e.onFocusChanged!=null){this._doOnFocusChanged=e.onFocusChanged}if(e.onAccess!=null){this._doOnAccess=e.onAccess}e=e.parent}this.conf.skin=(g||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxeditor")||"dhx_skyblue");if(typeof(e)=="string"){e=document.getElementById(e)}this.base=e;this.base.className+=" dhxeditor_"+this.conf.skin;while(this.base.childNodes.length>0){this.base.removeChild(this.base.childNodes[0])}var h=(window.dhx4.isIE?this.base.currentStyle.position:window.getComputedStyle(this.base,null).getPropertyValue("position"));if(!(h=="relative"||h=="absolute")){this.base.style.position="relative"}this.cell=new dhtmlXEditorCell(window.dhx4.newId(),this);this.base.appendChild(this.cell.cell);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"}this.setSizes();var a=this.editor;if(typeof(window.addEventListener)!="undefined"){a.onload=function(){for(var l=0;l<c.conf.evs.length;l++){a.contentWindow.addEventListener(c.conf.evs[l],c._ev,false)}}}else{a.onreadystatechange=function(l){if(typeof(a.readyState)!="undefined"&&a.readyState=="complete"){try{for(var m=0;m<c.conf.evs.length;m++){a.contentWindow.document.body.attachEvent("on"+c.conf.evs[m],c._ev)}}catch(n){}}}}this._ev=function(m){m=m||event;var l=m.type;if(c.conf.iOSfix==true&&l=="touchend"){c.editor.contentWindow.focus();return}c.callEvent("onAccess",[l,m]);if(typeof(c._doOnAccess)=="function"){c._doOnAccess(l,m)}else{if(typeof(c._doOnAccess)=="string"&&typeof(window[c._doOnAccess])=="function"){window[c._doOnAccess](l,m)}}};this._focus=function(){if(window.dhx4.isIE){this.editor.contentWindow.document.body.focus()}else{this.editor.contentWindow.focus()}};this.cell.attachObject(this.editor);this.edWin=this.editor.contentWindow;this.edDoc=this.edWin.document;this._prepareContent=function(n,q){var m="";if(n===true&&this.getContent!=null){m=this.getContent()}var l=this.editor.contentWindow.document;l.open("text/html","replace");if(window.dhx4.isOpera){l.write("<html><head><style> html, body { overflow:auto;-webkit-overflow-scrolling: touch; padding:0px; height:100%; margin:0px; font-family:Tahoma; font-size:12px; background-color:#ffffff;} </style></head><body "+(q!==true?"contenteditable='true'":"")+" tabindex='0'></body></html>")}else{if(window.dhx4.isKHTML){l.write("<html><head><style> html {overflow-x: auto;-webkit-overflow-scrolling: touch; overflow-y: auto;} body { overflow: auto; overflow-y: scroll;} html,body { padding:0px; height:100%; margin:0px; font-family:Tahoma; font-size:12px; background-color:#ffffff;} </style></head><body "+(q!==true?"contenteditable='true'":"")+" tabindex='0'></body></html>")}else{if(window.dhx4.isIE){l.write("<html><head><style> html {overflow-y: auto;} body {overflow-y: scroll;-webkit-overflow-scrolling: touch;} html,body { overflow-x: auto; padding:0px; height:100%; margin:0px; font-family:Tahoma; font-size:12px; background-color: #ffffff; outline: none; } </style></head><body "+(q!==true?"contenteditable='true'":"")+" tabindex='0'></body></html>")}else{l.write("<html><head><style> html,body { overflow-x: auto; overflow-y:-webkit-overflow-scrolling: touch; scroll; padding:0px; height:100%; margin:0px; font-family:Tahoma; font-size:12px; background-color:#ffffff;} </style></head><body "+(q!==true?"contenteditable='true'":"")+" tabindex='0'></body></html>")}}}l.close();if(window.dhx4.isIE){l.contentEditable=(q!==true)}else{l.designMode=(q!==true?"On":"Off")}if(window.dhx4.isFF){try{l.execCommand("useCSS",false,true)}catch(o){}}if(n===true&&this.setContent!=null){this.setContent(m)}};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(n,q){if(this.conf.roMode===true){return}if(arguments.length<2){q=null}if(window.dhx4.isIE){this.edWin.focus()}try{var m=this.editor.contentWindow.document;m.execCommand(n,false,q)}catch(o){}if(window.dhx4.isIE){this.edWin.focus();var l=this;window.setTimeout(function(){l.edWin.focus();l=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");var l=this.getContent();l=l.replace(/<\/?h\d>/gi,"");this.setContent(l)};this._doOnClick=function(n){var m=n||window.event;var l=m.target||m.srcElement;c._showInfo(l)};this._doOnMouseDown=function(n){var m=n||window.event;var l=m.target||m.srcElement;c._showInfo(l)};this._doOnKeyUp=function(o){var n=o||window.event;var l=n.keyCode;var m=n.target||n.srcElement;if({37:1,38:1,39:1,40:1,13:1}[l]==1){c._showInfo(m)}};this._getParentByTag=function(l,n){n=n.toLowerCase();var m=l;do{if(n==""||m.nodeName.toLowerCase()==n){return m}}while(m=m.parentNode);return l};this._isStyleProperty=function(m,q,l,o){q=q.toLowerCase();var r=m;do{if((r.nodeName.toLowerCase()==q)&&(r.style[l]==o)){return true}}while(r=r.parentNode);return false};this._setStyleProperty=function(l,o){this.style[o]=false;var m=this._getParentByTag(l,o);if(m&&(m.tagName.toLowerCase()==o)){this.style[o]=true}if(o=="del"&&this._getParentByTag(l,"strike")&&this._getParentByTag(l,"strike").tagName.toLowerCase()=="strike"){this.style.del=true}};this._showInfo=function(m){var m=(this._getSelectionBounds().end)?this._getSelectionBounds().end:m;if(!m||!this._setStyleProperty){return}try{if(this.edWin.getComputedStyle){var l=this.edWin.getComputedStyle(m,null);var n=((l.getPropertyValue("font-weight")==401)?700:l.getPropertyValue("font-weight"));this.style={fontStyle:l.getPropertyValue("font-style"),fontSize:l.getPropertyValue("font-size"),textDecoration:l.getPropertyValue("text-decoration"),fontWeight:n,fontFamily:l.getPropertyValue("font-family"),textAlign:l.getPropertyValue("text-align")};if(window.dhx4.isKHTML){this.style.fontStyle=l.getPropertyValue("font-style");this.style.vAlign=l.getPropertyValue("vertical-align");this.style.del=this._isStyleProperty(m,"span","textDecoration","line-through");this.style.u=this._isStyleProperty(m,"span","textDecoration","underline")}}else{var l=m.currentStyle;this.style={fontStyle:l.fontStyle,fontSize:l.fontSize,textDecoration:l.textDecoration,fontWeight:l.fontWeight,fontFamily:l.fontFamily,textAlign:l.textAlign}}this._setStyleProperty(m,"h1");this._setStyleProperty(m,"h2");this._setStyleProperty(m,"h3");this._setStyleProperty(m,"h4");if(!window.dhx4.isKHTML){this._setStyleProperty(m,"del");this._setStyleProperty(m,"sub");this._setStyleProperty(m,"sup");this._setStyleProperty(m,"u")}this.callEvent("onFocusChanged",[this.style,l])}catch(o){return null}};this._getSelectionBounds=function(){var q,n,s,m;if(this.edWin.getSelection){var r=this.edWin.getSelection();if(window.dhx4.isEdge&&r.rangeCount==0){return{root:null,start:null,end:null}}q=r.getRangeAt(r.rangeCount-1);s=q.startContainer;m=q.endContainer;n=q.commonAncestorContainer;if(s.nodeName=="#text"){n=n.parentNode}if(s.nodeName=="#text"){s=s.parentNode}if(s.nodeName.toLowerCase()=="body"){s=s.firstChild}if(m.nodeName=="#text"){m=m.parentNode}if(m.nodeName.toLowerCase()=="body"){m=m.lastChild}if(s==m){n=s}return{root:n,start:s,end:m}}else{if(this.edWin.document.selection){q=this.edDoc.selection.createRange();if(!q.duplicate){return null}n=q.parentElement();var o=q.duplicate();var l=q.duplicate();o.collapse(true);l.moveToElementText(o.parentElement());l.setEndPoint("EndToStart",o);s=o.parentElement();o=q.duplicate();l=q.duplicate();l.collapse(false);o.moveToElementText(l.parentElement());o.setEndPoint("StartToEnd",l);m=l.parentElement();if(s.nodeName.toLowerCase()=="body"){s=s.firstChild}if(m.nodeName.toLowerCase()=="body"){m=m.lastChild}if(s==m){n=s}return{root:n,start:s,end:m}}}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(n){n=n||"";if(this.edDoc.body){var m=false;if(window.dhx4.isFF){var l=navigator.userAgent.match(/Firefox\/(\d*)/);m=(l!=null&&l[1]<28)}if(m){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=n}else{this.editor.contentWindow.document.body.innerHTML="";if(n.length==0){n=" "}this._runCommand("InsertHTML",n)}}else{this.editor.contentWindow.document.body.innerHTML=n}this.callEvent("onContentSet",[])}else{if(!this.conf.firstLoadEv){this.conf.firstLoadEv=true;this.conf.firstLoadData=n;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(l){window.dhx4.ajax.get(l,function(m){if(m.xmlDoc.responseText!=null){c.setContent(m.xmlDoc.responseText)}})};window.dhx4._eventable(this);this.attachEvent("onFocusChanged",function(l){if(typeof(this._doOnFocusChanged)=="function"){this._doOnFocusChanged(l)}else{if(typeof(this._doOnFocusChanged)=="string"&&typeof(window[this._doOnFocusChanged])=="function"){window[this._doOnFocusChanged](l)}}});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 l=0;l<c.conf.evs.length;l++){a.contentWindow.removeEventListener(c.conf.evs[l],c._ev,false)}if(this.tb!=null&&this.conf.iOSfix==true){this.tb.cont.removeEventListener("touchend",this._doOnIOSFix,false);this._doOnIOSFix=null}}else{window.detachEvent("onresize",this._doOnResize,false);this.edDoc.detachEvent("onclick",this._doOnClick);this.edDoc.detachEvent("onkeyup",this._doOnKeyUp);for(var l=0;l<c.conf.evs.length;l++){a.contentWindow.document.body.detachEvent("on"+c.conf.evs[l],c._ev)}}this._doOnAccess=null;this._doOnFocusChanged=null;if(typeof(window.addEventListener)=="function"){this.editor.onload=null}else{this.editor.onreadystatechange=null}this.editor.parentNode.removeChild(this.editor);this.editor=null;this.edDoc=null;this.edWin=null;this.cell._unload();this.cell=null;this.tb=null;window.dhx4._eventable(this,"clear");this.cBlock.parentNode.removeChild(this.cBlock);this.cBlock=null;this.base.className=String(this.base.className).replace(new RegExp("\\s{0,}dhxeditor_"+this.conf.skin),"");while(this.base.childNodes.length>0){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);if(this.conf.iOSfix==true){this._doOnIOSFix=function(){c.editor.contentWindow.focus()};this.tb.cont.addEventListener("touchend",this._doOnIOSFix,false)}}this.setIconsPath=function(l){this.conf.iconsPath=l};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);if(this.editor!=null){this.editor.style.left="5px";this.editor.style.width=this.base.clientWidth-5+"px"}};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(e,a){dhtmlXCellObject.apply(this,[e,"_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 l=this;var h=document.createElement("DIV");h.className="dhx_cell_stb";this.cell.insertBefore(h,this.cell.childNodes[this.conf.idx.cont]);h.onselectstart=function(a){a=a||event;a.cancelBubble=true;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};var g={bold:"applyBold",italic:"applyItalic",underline:"applyUnderscore",clearformat:"clearFormatting"};for(var e in g){var c=document.createElement("A");c.href="javascript:void(0);";c.tabIndex=-1;h.appendChild(c);c.onmousedown=c.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};var m=document.createElement("DIV");m.className="dhx_cell_stb_button btn_"+e;m._actv=e.charAt(0);m._cmd=g[e];c.appendChild(m);m.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};m.onmousedown=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}l.editor[this._cmd]();l.editor.callEvent("onToolbarClick",[this._actv])};m=c=null}h=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=l=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};dhtmlXCellObject.prototype.attachEditor=function(a){this.callEvent("_onBeforeContentAttach",["editor"]);var e=document.createElement("DIV");e.style.width="100%";e.style.height="100%";e.style.position="relative";e.style.overflow="hidden";this._attachObject(e);if(!(typeof(a)=="object"&&a!=null)){a={}}a.parent=e;this.dataType="editor";this.dataObj=new dhtmlXEditor(a);e=null;a.parent=null;a=null;if(typeof(window.dhtmlXPortalCell)!="undefined"&&this instanceof window.dhtmlXPortalCell){if(this.portal.conf.editor_ev==null){var g=this.portal.attachEvent("onBeforeDrag",function(h){if(this.cdata[h].dataType=="editor"){this.cdata[h].conf.editor_cont=this.cdata[h].dataObj.getContent()}return true});var c=this.portal.attachEvent("onDrop",function(h){if(this.cdata[h].dataType=="editor"){this.cdata[h].dataObj.setContent(this.cdata[h].conf.editor_cont);this.cdata[h].dataObj._prepareContent(true);this.cdata[h].conf.editor_cont=null}});this.portal.conf.editor_ev=[g,c]}this.conf.editor_ev=this.attachEvent("_onBeforeContentDetach",function(){this.detachEvent(this.conf.editor_ev);this.conf.editor_ev=null;if(this instanceof window.dhtmlXPortalCell){var l=false;for(var h in this.portal.cdata){if(this.portal.cdata[h]!=this&&this.portal.cdata[h].dataType=="editor"){l=true}}if(l==false){for(var m=0;m<this.portal.conf.editor_ev.length;m++){this.portal.detachEvent(this.portal.conf.editor_ev[m])}this.portal.conf.editor_ev=null}}})}this.callEvent("_onContentAttach",[]);return this.dataObj};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 l=0;l<this._availFonts.length;l++){var g=String(this._availFonts[l]).replace(/\s/g,"_");this._xmlFonts+='<item type="button" id="applyFontFamily:'+g+'"><itemText><![CDATA[<img src="'+this.tb.imagePath+"font_"+String(g).toLowerCase()+'.gif" border="0" style="/*margin-top:1px;margin-bottom:1px;*/width:110px;height:16px;">]]></itemText></item>'}this._availSizes={"1":"8pt","2":"10pt","3":"12pt","4":"14pt","5":"18pt","6":"24pt","7":"36pt"};this._xmlSizes="";for(var e in this._availSizes){this._xmlSizes+='<item type="button" id="applyFontSize:'+e+":"+this._availSizes[e]+'" text="'+this._availSizes[e]+'"/>'}this.tbXML='<toolbar><item id="applyH1" type="buttonTwoState" img="h1.gif" imgdis="h4_dis.gif" title="H1"/><item id="applyH2" type="buttonTwoState" img="h2.gif" imgdis="h4_dis.gif" title="H2"/><item id="applyH3" type="buttonTwoState" img="h3.gif" imgdis="h4_dis.gif" title="H3"/><item id="applyH4" type="buttonTwoState" img="h4.gif" imgdis="h4_dis.gif" title="H4"/><item id="separ01" type="separator"/><item id="applyBold" type="buttonTwoState" img="bold.gif" imgdis="bold_dis.gif" title="Bold Text"/><item id="applyItalic" type="buttonTwoState" img="italic.gif" imgdis="italic_dis.gif" title="Italic Text"/><item id="applyUnderscore" type="buttonTwoState" img="underline.gif" imgdis="underline_dis.gif" title="Underscore Text"/><item id="applyStrikethrough" type="buttonTwoState" img="strike.gif" imgdis="strike_dis.gif" title="Strikethrough Text"/><item id="separ02" type="separator"/><item id="alignLeft" type="buttonTwoState" img="align_left.gif" imgdis="align_left_dis.gif" title="Left Alignment"/><item id="alignCenter" type="buttonTwoState" img="align_center.gif" imgdis="align_center_dis.gif" title="Center Alignment"/><item id="alignRight" type="buttonTwoState" img="align_right.gif" imgdis="align_right_dis.gif" title="Right Alignment"/><item id="alignJustify" type="buttonTwoState" img="align_justify.gif" title="Justified Alignment"/><item id="separ03" type="separator"/><item id="applySub" type="buttonTwoState" img="script_sub.gif" imgdis="script_sub.gif" title="Subscript"/><item id="applySuper" type="buttonTwoState" img="script_super.gif" imgdis="script_super_dis.gif" title="Superscript"/><item id="separ04" type="separator"/><item id="createNumList" type="button" img="list_number.gif" imgdis="list_number_dis.gif" title="Number List"/><item id="createBulList" type="button" img="list_bullet.gif" imgdis="list_bullet_dis.gif" title="Bullet List"/><item id="separ05" type="separator"/><item id="increaseIndent" type="button" img="indent_inc.gif" imgdis="indent_inc_dis.gif" title="Increase Indent"/><item id="decreaseIndent" type="button" img="indent_dec.gif" imgdis="indent_dec_dis.gif" title="Decrease Indent"/><item id="separ06" type="separator"/><item id="clearFormatting" type="button" img="clear.gif" title="Clear Formatting"/></toolbar>';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(n){if(!n.h1&&!n.h2&&!n.h3&&!n.h4){var a=(String(n.fontWeight).search(/bold/i)!=-1)||(Number(n.fontWeight)>=700);this.tb.setItemState("applyBold",a)}else{this.tb.setItemState("applyBold",false)}var m="alignLeft";if(String(n.textAlign).search(/center/)!=-1){m="alignCenter"}if(String(n.textAlign).search(/right/)!=-1){m="alignRight"}if(String(n.textAlign).search(/justify/)!=-1){m="alignJustify"}this.tb.setItemState(m,true);this._checkAlign(m);this.tb.setItemState("applyH1",n.h1);this.tb.setItemState("applyH2",n.h2);this.tb.setItemState("applyH3",n.h3);this.tb.setItemState("applyH4",n.h4);if(window._KHTMLrv){n.sub=(n.vAlign=="sub");n.sup=(n.vAlign=="super")}this.tb.setItemState("applyItalic",(n.fontStyle=="italic"));this.tb.setItemState("applyStrikethrough",n.del);this.tb.setItemState("applySub",n.sub);this.tb.setItemState("applySuper",n.sup);this.tb.setItemState("applyUnderscore",n.u)};this._doOnToolbarClick=function(m){var a=String(m).split(":");if(this[a[0]]!=null){if(typeof(this[a[0]])=="function"){this[a[0]](a[1]);this.callEvent("onToolbarClick",[m])}}};this._doOnStateChange=function(m,a){this[m]();switch(m){case"alignLeft":case"alignCenter":case"alignRight":case"alignJustify":this._checkAlign(m);break;case"applyH1":case"applyH2":case"applyH3":case"applyH4":this._checkH(m);break}this.callEvent("onToolbarClick",[m])};this._doOnBeforeStateChange=function(m,a){if((m=="alignLeft"||m=="alignCenter"||m=="alignRight"||m=="alignJustify")&&a==true){return false}return true};var h=this;this.tb.attachEvent("onClick",function(a){h._doOnToolbarClick(a)});this.tb.attachEvent("onStateChange",function(m,a){h._doOnStateChange(m,a)});this.tb.attachEvent("onBeforeStateChange",function(m,a){return h._doOnBeforeStateChange(m,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","<H1>")};this.applyH2=function(){this._runCommand("FormatBlock","<H2>")};this.applyH3=function(){this._runCommand("FormatBlock","<H3>")};this.applyH4=function(){this._runCommand("FormatBlock","<H4>")};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);var a=this.getContent();a=a.replace(/<\/?h\d>/gi,"");this.setContent(a)}};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.data.attachEvent("onClearAll",dhtmlx.bind(function(){this.data._not_grouped_order=this.data._not_grouped_pull=null},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 e=0;a.each(function(g){e+=c(g)*1});return e},min:function(e,c){e=dhtmlx.Template.setter(e);c=c||this.data;var a=Infinity;c.each(function(g){if(e(g)*1<a){a=e(g)*1}});return a*1},max:function(e,c){e=dhtmlx.Template.setter(e);c=c||this.data;var a=-Infinity;c.each(function(g){if(e(g)*1>a){a=e(g)*1}});return a},_split_data_by:function(l){var n=function(r,q){r=dhtmlx.Template.setter(r);return r(q[0])};var o=dhtmlx.Template.setter(l.by);if(!l.map[o]){l.map[o]=[o,n]}var e={};var m=[];this.data.each(function(q){var r=o(q);if(!e[r]){m.push({id:r});e[r]=dhtmlx.toArray()}e[r].push(q)});for(var a in l.map){var h=(l.map[a][1]||n);if(typeof h!="function"){h=this[h]}for(var g=0;g<m.length;g++){m[g][a]=h.call(this,l.map[a][0],e[m[g].id])}}this.data._not_grouped_order=this.data.order;this.data._not_grouped_pull=this.data.pull;this.data.order=dhtmlx.toArray();this.data.pull={};for(var g=0;g<m.length;g++){var c=this.data.id(m[g]);this.data.pull[c]=m[g];this.data.order.push(c)}this.callEvent("onStoreUpdated",[])},group:function(a,c){this.ungroup(false);this._split_data_by(a);if(c!==false){this.data.callEvent("onStoreUpdated",[])}},ungroup:function(a){if(this.data._not_grouped_order){this.data.order=this.data._not_grouped_order;this.data.pull=this.data._not_grouped_pull;this.data._not_grouped_pull=this.data._not_grouped_order=null}if(a!==false){this.data.callEvent("onStoreUpdated",[])}},group_setter:function(a){dhtmlx.assert(typeof a=="object","Incorrect group value");dhtmlx.assert(a.by,"group.by is mandatory");dhtmlx.assert(a.map,"group.map is mandatory");return a},sort_setter:function(a){if(typeof a!="object"){a={by:a}}this._mergeSettings(a,{as:"string",dir:"asc"});return a}};dhtmlx.Date={Locale:{month_full:["January","February","March","April","May","June","July","August","September","October","November","December"],month_short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],day_full:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],day_short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},date_part:function(a){a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);return a},time_part:function(a){return(a.valueOf()/1000-a.getTimezoneOffset()*60)%86400},week_start:function(c){var a=c.getDay();if(this.config.start_on_monday){if(a===0){a=6}else{a--}}return this.date_part(this.add(c,-1*a,"day"))},month_start:function(a){a.setDate(1);return this.date_part(a)},year_start:function(a){a.setMonth(0);return this.month_start(a)},day_start:function(a){return this.date_part(a)},add:function(c,e,g){var a=new Date(c.valueOf());switch(g){case"day":a.setDate(a.getDate()+e);break;case"week":a.setDate(a.getDate()+7*e);break;case"month":a.setMonth(a.getMonth()+e);break;case"year":a.setYear(a.getFullYear()+e);break;case"hour":a.setHours(a.getHours()+e);break;case"minute":a.setMinutes(a.getMinutes()+e);break;default:return dhtmlx.Date["add_"+g](c,e,g)}return a},to_fixed:function(a){if(a<10){return"0"+a}return a},copy:function(a){return new Date(a.valueOf())},date_to_str:function(c,a){c=c.replace(/%[a-zA-Z]/g,function(e){switch(e){case"%d":return'"+dhtmlx.Date.to_fixed(date.getDate())+"';case"%m":return'"+dhtmlx.Date.to_fixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+dhtmlx.Date.to_fixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+dhtmlx.Date.Locale.day_short[date.getDay()]+"';case"%l":return'"+dhtmlx.Date.Locale.day_full[date.getDay()]+"';case"%M":return'"+dhtmlx.Date.Locale.month_short[date.getMonth()]+"';case"%F":return'"+dhtmlx.Date.Locale.month_full[date.getMonth()]+"';case"%h":return'"+dhtmlx.Date.to_fixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+dhtmlx.Date.to_fixed(date.getHours())+"';case"%i":return'"+dhtmlx.Date.to_fixed(date.getMinutes())+"';case"%a":return'"+(date.getHours()>11?"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 e}});if(a){c=c.replace(/date\.get/g,"date.getUTC")}return new Function("date",'return "'+c+'";')},str_to_date:function(h,e){var l="var temp=date.split(/[^0-9a-zA-Z]+/g);";var a=h.match(/%[a-zA-Z]/g);for(var c=0;c<a.length;c++){switch(a[c]){case"%j":case"%d":l+="set[2]=temp["+c+"]||1;";break;case"%n":case"%m":l+="set[1]=(temp["+c+"]||1)-1;";break;case"%y":l+="set[0]=temp["+c+"]*1+(temp["+c+"]>50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":l+="set[3]=temp["+c+"]||0;";break;case"%i":l+="set[4]=temp["+c+"]||0;";break;case"%Y":l+="set[0]=temp["+c+"]||0;";break;case"%a":case"%A":l+="set[3]=set[3]%12+((temp["+c+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":l+="set[5]=temp["+c+"]||0;";break}}var g="set[0],set[1],set[2],set[3],set[4],set[5]";if(e){g=" Date.UTC("+g+")"}return new Function("date","var set=[0,0,1,0,0,0]; "+l+" return new Date("+g+");")},getISOWeek:function(e){if(!e){return false}var c=e.getDay();if(c===0){c=7}var g=new Date(e.valueOf());g.setDate(e.getDate()+(4-c));var a=g.getFullYear();var l=Math.floor((g.getTime()-new Date(a,0,1).getTime())/86400000);var h=1+Math.floor(l/7);return h},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.length<a){str="0"+str}return str};dhtmlx.math.hexToDec=function(a){return parseInt(a,16)};dhtmlx.math.toRgb=function(c){var h,e,a,l;if(typeof(c)!="string"){h=c[0];e=c[1];a=c[2]}else{if(c.indexOf("rgb")!=-1){l=c.substr(c.indexOf("(")+1,c.lastIndexOf(")")-c.indexOf("(")-1).split(",");h=l[0];e=l[1];a=l[2]}else{if(c.substr(0,1)=="#"){c=c.substr(1)}h=this.hexToDec(c.substr(0,2));e=this.hexToDec(c.substr(2,2));a=this.hexToDec(c.substr(4,2))}}h=(parseInt(h,10)||0);e=(parseInt(e,10)||0);a=(parseInt(a,10)||0);if(h<0||h>255){h=0}if(e<0||e>255){e=0}if(a<0||a>255){a=0}return[h,e,a]};dhtmlx.math.hsvToRgb=function(m,y,w){var l,o,e,c,x,a,n,u;l=Math.floor((m/60))%6;o=m/60-l;e=w*(1-y);c=w*(1-o*y);x=w*(1-(1-o)*y);a=0;n=0;u=0;switch(l){case 0:a=w;n=x;u=e;break;case 1:a=c;n=w;u=e;break;case 2:a=e;n=w;u=x;break;case 3:a=e;n=c;u=w;break;case 4:a=x;n=e;u=w;break;case 5:a=w;n=e;u=c;break}a=Math.floor(a*255);n=Math.floor(n*255);u=Math.floor(u*255);return[a,n,u]};dhtmlx.math.rgbToHsv=function(c,n,o){var l,e,q,a,u,x,m,w;l=c/255;e=n/255;q=o/255;var a=Math.min(l,e,q);var u=Math.max(l,e,q);m=0;x=u==0?0:(1-a/u);w=u;if(u==a){m=0}else{if(u==l&&e>=q){m=60*(e-q)/(u-a)+0}else{if(u==l&&e<q){m=60*(e-q)/(u-a)+360}else{if(u==e){m=60*(q-l)/(u-a)+120}else{if(u==q){m=60*(l-e)/(u-a)+240}}}}}return[m,x,w]};if(!dhtmlx.presets){dhtmlx.presets={}}dhtmlx.presets.chart={simple:{item:{borderColor:"#ffffff",color:"#2b7100",shadow:false,borderWidth:2},line:{color:"#8ecf03",width:2}},plot:{color:"#1293f8",item:{borderColor:"#636363",borderWidth:1,color:"#ffffff",type:"r",shadow:false},line:{color:"#1293f8",width:2}},diamond:{color:"#b64040",item:{borderColor:"#b64040",color:"#b64040",type:"d",radius:3,shadow:true},line:{color:"#ff9000",width:2}},point:{color:"#fe5916",disableLines:true,fill:false,disableItems:false,item:{color:"#feb916",borderColor:"#fe5916",radius:2,borderWidth:1,type:"r"},alpha:1},line:{line:{color:"#3399ff",width:2},item:{color:"#ffffff",borderColor:"#3399ff",radius:2,borderWidth:2,type:"d"},fill:false,disableItems:false,disableLines:false,alpha:1},area:{fill:"#3399ff",line:{color:"#3399ff",width:1},disableItems:true,alpha:0.2,disableLines:false},round:{item:{radius:3,borderColor:"#3f83ff",borderWidth:1,color:"#3f83ff",type:"r",shadow:false,alpha:0.6}},square:{item:{radius:3,borderColor:"#447900",borderWidth:2,color:"#69ba00",type:"s",shadow:false,alpha:1}},column:{color:"RAINBOW",gradient:false,width:45,radius:0,alpha:1,border:true},stick:{width:5,gradient:false,color:"#67b5c9",radius:2,alpha:1,border:false},alpha:{color:"#b9a8f9",width:70,gradient:"falling",radius:0,alpha:0.5,border:true}};dhtmlx.ui.Map=function(a){this.name="Map";this._id="map_"+dhtmlx.uid();this._key=a;this._map=[]};dhtmlx.ui.Map.prototype={addRect:function(e,c,a){this._createMapArea(e,"RECT",c,a)},addPoly:function(e,c,a){this._createMapArea(e,"POLY",c,a)},_createMapArea:function(h,c,g,e){var a="";if(arguments.length==4){a="userdata='"+e+"'"}this._map.push("<area "+this._key+"='"+h+"' shape='"+c+"' coords='"+g.join()+"' "+a+"></area>")},addSector:function(a,q,o,m,h,e,g,l){var n=[];n.push(m);n.push(Math.floor(h*g));for(var c=q;c<o;c+=Math.PI/18){n.push(Math.floor(m+e*Math.cos(c)));n.push(Math.floor((h+e*Math.sin(c))*g))}n.push(Math.floor(m+e*Math.cos(o)));n.push(Math.floor((h+e*Math.sin(o))*g));n.push(m);n.push(Math.floor(h*g));return this.addPoly(a,n,l)},render:function(a){var e=dhtmlx.html.create("DIV");e.style.cssText="position:absolute; width:100%; height:100%; top:0px; left:0px;";a.appendChild(e);var c=dhtmlx._isIE?"":"src='data:image/gif;base64,R0lGODlhEgASAIAAAP///////yH5BAUUAAEALAAAAAASABIAAAIPjI+py+0Po5y02ouz3pwXADs='";e.innerHTML="<map id='"+this._id+"' name='"+this._id+"'>"+this._map.join("\n")+"</map><img "+c+" class='dhx_map_img' usemap='#"+this._id+"' onmousedown='return false;'>";a._htmlmap=e;this._map=[]}};dhtmlx.chart={};dhtmlx.chart.scatter={pvt_render_scatter:function(q,l,o,n,m,a){if(!this._settings.xValue){return dhtmlx.log("warning","Undefined propery: xValue")}var e=this._getLimits();var h=this._getLimits("h","xValue");if(!m){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(),l,o,n,e.min,e.max);this._drawHXAxis(this.canvases.x.getCanvas(),l,o,n,h.min,h.max)}e={min:this._settings.yAxis.start,max:this._settings.yAxis.end};h={min:this._settings.xAxis.start,max:this._settings.xAxis.end};var c=this._getScatterParams(q,l,o,n,h,e);this._mapStart=o;for(var g=0;g<l.length;g++){this._drawScatterItem(q,a,o,n,c,h,e,l[g],m)}},_getScatterParams:function(a,g,e,c,m,l){var h={};h.totalHeight=c.y-e.y;h.totalWidth=c.x-e.x;this._calcScatterUnit(h,m.min,m.max,h.totalWidth,"X");this._calcScatterUnit(h,l.min,l.max,h.totalHeight,"Y");return h},_drawScatterItem:function(r,a,o,n,e,h,g,l,m){var c=this._calculateScatterItemPosition(e,n,o,h,l,"X");var q=this._calculateScatterItemPosition(e,o,n,g,l,"Y");this._drawItem(r,c,q,l,this._settings.label.call(this,l),m,a)},_calculateScatterItemPosition:function(e,n,m,a,h,c){var q=this._settings[c=="X"?"xValue":"value"].call(this,h);var g=e["valueFactor"+c];var r=(parseFloat(q||0)-a.min)*g;var o=e["unit"+c];var l=m[c.toLowerCase()]-(c=="X"?(-1):1)*Math.floor(o*r);if(r<0){l=m[c.toLowerCase()]}if(q>a.max){l=n[c.toLowerCase()]}if(q<a.min){l=m[c.toLowerCase()]}return l},_calcScatterUnit:function(l,e,a,c,g){var h=this._getRelativeValue(e,a);g=(g||"");l["relValue"+g]=h[0];l["valueFactor"+g]=h[1];l["unit"+g]=(l["relValue"+g]?c/l["relValue"+g]:10)}};dhtmlx.chart.radar={pvt_render_radar:function(c,g,a,l,e,h){this._renderRadarChart(c,g,a,l,e,h)},_renderRadarChart:function(u,h,r,q,o,a){if(!h.length){return}var m=this._getPieParameters(r,q);var n=(this._settings.radius?this._settings.radius:m.radius);var c=(this._settings.x?this._settings.x:m.x);var s=(this._settings.y?this._settings.y:m.y);var e=[];for(var g=0;g<h.length;g++){e.push(1)}var l=this._getRatios(e,h.length);this._mapStart=r;if(!o){this._drawRadarAxises(l,c,s,n,h)}this._drawRadarData(u,l,c,s,n,h,o,a)},_drawRadarData:function(C,s,n,m,h,N,D,M){var A,v,L,J,E,I,g,e,F,K,H,u,c,w,q,o,a,r,l;L=this._settings;E=L.yAxis.start;I=L.yAxis.end;l=this._getRelativeValue(E,I);u=l[0];r=(u?h/u:h/2);a=l[1];c=-Math.PI/2;A=v=c;F=[];e=0;for(J=0;J<N.length;J++){if(!o){w=L.value(N[J]);q=(parseFloat(w||0)-E)*a}else{q=o}K=Math.floor(r*q);w=L.value((J!=(N.length-1))?N[J+1]:N[0]);o=(parseFloat(w||0)-E)*a;H=Math.floor(r*o);A=v;v=((J!=(N.length-1))?(c+s[J]-0.0001):c);g=(e||this._getPositionByAngle(A,n,m,K));e=this._getPositionByAngle(v,n,m,H);F.push(g)}if(L.fill){this._fillRadarChart(C,F,N)}if(!L.disableLines){this._strokeRadarChart(C,F,N)}if(!L.disableItems){this._drawRadarItemMarkers(C,F,N,D,M)}F=null},_drawRadarItemMarkers:function(a,e,h,g,l){for(var c=0;c<e.length;c++){this._drawItem(a,e[c].x,e[c].y,h[c],this._settings.label.call(this,h),g,l)}},_fillRadarChart:function(a,g,l){var h,e;a.globalAlpha=this._settings.alpha.call(this,{});a.beginPath();for(var c=0;c<g.length;c++){a.fillStyle=this._settings.fill.call(this,l[c]);h=g[c];e=(g[c+1]||g[0]);if(!c){a.moveTo(h.x,h.y)}a.lineTo(e.x,e.y)}a.fill();a.globalAlpha=1},_strokeRadarChart:function(a,g,l){var h,e;for(var c=0;c<g.length;c++){h=g[c];e=(g[c+1]||g[0]);this._drawLine(a,h.x,h.y,e.x,e.y,this._settings.line.color.call(this,l[c]),this._settings.line.width)}},_drawRadarAxises:function(A,v,u,m,O){var a=this._settings.yAxis;var g=this._settings.xAxis;var n=a.start;var l=a.end;var q=a.step;var C={};var N=this._configYAxis;if(typeof N.step=="undefined"||typeof N.start=="undefined"||typeof N.end=="undefined"){var r=this._getLimits();C=this._calculateScale(r.min,r.max);n=C.start;l=C.end;q=C.step;a.end=l;a.start=n}var I=[];var L,K,D;var M=0;var e=m*q/(l-n);var s,w;if(q<1){s=Math.min(this._log10(q),(n<=0?0:this._log10(n)));w=Math.pow(10,-s)}var J=[];if(!this.canvases.scale){this.canvases.scale=new dhtmlx.ui.Canvas(this._obj,"radar_scale")}var H=this.canvases.scale.getCanvas();for(L=l;L>=n;L-=q){if(C.fixNum){L=parseFloat((new Number(L)).toFixed(C.fixNum))}I.push(Math.floor(M*e)+0.5);if(w){L=Math.round(L*w)/w}var o=u-m+I[I.length-1];this.canvases.scale.renderTextAt("middle","left",v,o,a.template(L.toString()),"dhx_axis_item_y dhx_radar");if(A.length<2){this._drawScaleSector(H,"arc",v,u,m-I[I.length-1],-Math.PI/2,3*Math.PI/2,L);return}var h=-Math.PI/2;var F=h;var E;for(K=0;K<A.length;K++){if(L==l){J.push(F)}E=h+A[K]-0.0001;this._drawScaleSector(H,(N.lineShape||"line"),v,u,m-I[I.length-1],F,E,L,K,O[L]);F=E}M++}for(L=0;L<J.length;L++){D=this._getPositionByAngle(J[L],v,u,m);if(g.lines.call(this,O[L],L)){this._drawLine(H,v,u,D.x,D.y,(g?g.lineColor.call(this,O[L]):"#cfcfcf"),1)}this._drawRadarScaleLabel(H,v,u,m,J[L],(g?g.template.call(this,O[L]):"&nbsp;"))}},_drawScaleSector:function(s,l,r,o,h,c,a,g,e){var q,n;if(h<0){return false}q=this._getPositionByAngle(c,r,o,h);n=this._getPositionByAngle(a,r,o,h);var m=this._settings.yAxis;if(m.bg){s.beginPath();s.moveTo(r,o);if(l=="arc"){s.arc(r,o,h,c,a,false)}else{s.lineTo(q.x,q.y);s.lineTo(n.x,n.y)}s.fillStyle=m.bg(g,e);s.moveTo(r,o);s.fill();s.closePath()}if(m.lines.call(this,g)){s.lineWidth=1;s.beginPath();if(l=="arc"){s.arc(r,o,h,c,a,false)}else{s.moveTo(q.x,q.y);s.lineTo(n.x,n.y)}s.strokeStyle=m.lineColor.call(this,g);s.stroke()}},_drawRadarScaleLabel:function(w,o,m,c,n,u){var v=this.canvases.scale.renderText(0,0,u,"dhx_axis_radar_title",1);var e=v.scrollWidth;var s=v.offsetHeight;var q=0.001;var l=this._getPositionByAngle(n,o,m,c+5);var h=0,g=0;if(n<0||n>Math.PI){g=-s}if(n>Math.PI/2){h=-e}if(Math.abs(n+Math.PI/2)<q||Math.abs(n-Math.PI/2)<q){h=-e/2}else{if(Math.abs(n)<q||Math.abs(n-Math.PI)<q){g=-s/2}}v.style.top=l.y+g+"px";v.style.left=l.x+h+"px";v.style.width=e+"px";v.style.whiteSpace="nowrap"}};dhtmlx.chart.area={pvt_render_area:function(n,E,h,g,o,A){var r,y,s,q,l,x,m,D,C,w,v,c,u,a,e;x=this._calculateLineParams(n,E,h,g,o);y=this._settings;q=(y.eventRadius||Math.floor(x.cellWidth/2));if(E.length){m=[];w=(!y.offset?h.x:h.x+x.cellWidth*0.5);for(s=0;s<E.length;s++){l=E[s];C=this._getPointY(l,h,g,x);u=w+x.cellWidth*s;if(C){a=(typeof C=="object"?C.y0:C);if(s&&this._settings.fixOverflow){D=this._getPointY(E[s-1],h,g,x);if(D.out&&D.out==C.out){continue}v=x.cellWidth*(s-1)-0.5+w;c=(typeof D=="object"?D.y0:D);if(D.out){e=(D.out=="min"?g.y:h.y);m.push([this._calcOverflowX(v,u,c,a,e),e])}if(C.out){e=(C.out=="min"?g.y:h.y);m.push([this._calcOverflowX(v,u,c,a,e),e]);if(s==(E.length-1)&&e==h.y){m.push([u,h.y])}}}if(!C.out){m.push([u,a]);A.addRect(l.id,[u-q-h.x,a-q-h.y,u+q-h.x,a+q-h.y],o)}if(!y.yAxis){r=(!y.offset&&(s==E.length-1)?"left":"center");this.canvases[o].renderTextAt(false,r,u,a-y.labelOffset,y.label(l))}}}if(m.length){m.push([u,g.y]);m.push([m[0][0],g.y])}n.globalAlpha=this._settings.alpha.call(this,E[0]);n.fillStyle=this._settings.color.call(this,E[0]);n.beginPath();this._path(n,m);n.fill();if(y.border){n.lineWidth=y.borderWidth||1;if(y.borderColor){n.strokeStyle=y.borderColor.call(this,E[0])}else{this._setBorderStyles(n,n.fillStyle)}n.beginPath();this._path(n,m);n.stroke()}n.lineWidth=1;n.globalAlpha=1}}};dhtmlx.chart.stackedArea={pvt_render_stackedArea:function(o,F,c,a,q,D){var I,H,u,C,w,v,h,s,l,A,n,g,e,m;A=this._calculateLineParams(o,F,c,a,q);C=this._settings;s=(C.eventRadius||Math.floor(A.cellWidth/2));if(F.length){n=[];m=[];g=(!C.offset?c.x:c.x+A.cellWidth*0.5);var E=function(x,J){return q?(F[x].$startY?J-a.y+F[x].$startY:0):J};var r=function(y,L,K){var J=(K.y-L.y)/(K.x-L.x);return J*y+L.y-J*L.x};for(w=0;w<F.length;w++){l=F[w];if(!w){e=E(w,a.y);n.push([g,e])}else{g+=A.cellWidth}e=E(w,this._getPointY(l,c,a,A));m.push((isNaN(e)&&!w)?(F[w].$startY||a.y):e);if(e){n.push([g,e]);D.addRect(l.id,[g-s-c.x,e-s-c.y,g+s-c.x,e+s-c.y],q);if(!C.yAxis){u=(!C.offset&&h?"left":"center");this.canvases[q].renderTextAt(false,u,g,e-C.labelOffset,C.label(l))}}}n.push([g,E(w-1,a.y)]);if(q){for(w=F.length-2;w>0;w--){g-=A.cellWidth;e=F[w].$startY;if(e){n.push([g,e])}}}n.push([n[0][0],n[0][1]]);o.globalAlpha=this._settings.alpha.call(this,F[0]);o.fillStyle=this._settings.color.call(this,F[0]);o.beginPath();this._path(o,n);o.fill();for(w=0;w<F.length;w++){e=m[w];if(!e){if(w==F.length-1){e=F[w].$startY}for(v=w+1;v<F.length;v++){if(m[v]){I={x:c.x,y:m[0]};H={x:(c.x+A.cellWidth*v),y:m[v]};e=r(c.x+A.cellWidth*w,I,H);break}}}F[w].$startY=e}}}};dhtmlx.chart.spline={pvt_render_spline:function(o,H,g,e,q,F){var E,s,n,r,D,m,l,w,v,u,h,c,a;D=this._calculateLineParams(o,H,g,e,q);E=this._settings;this._mapStart=g;n=[];if(H.length){w=(E.offset?g.x+D.cellWidth*0.5:g.x);for(s=0;s<H.length;s++){h=this._getPointY(H[s],g,e,D);if(h){l=((!s)?w:D.cellWidth*s-0.5+w);n.push({x:l,y:h,index:s})}}m=this._getSplineParameters(n);for(s=0;s<n.length;s++){v=n[s].x;c=n[s].y;if(s<n.length-1){u=n[s+1].x;a=n[s+1].y;for(r=v;r<u;r++){var C=this._getSplineYPoint(r,v,s,m.a,m.b,m.c,m.d);if(C<g.y){C=g.y}if(C>e.y){C=e.y}var A=this._getSplineYPoint(r+1,v,s,m.a,m.b,m.c,m.d);if(A<g.y){A=g.y}if(A>e.y){A=e.y}this._drawLine(o,r,C,r+1,A,E.line.color(H[s]),E.line.width)}this._drawLine(o,u-1,this._getSplineYPoint(r,v,s,m.a,m.b,m.c,m.d),u,a,E.line.color(H[s]),E.line.width)}this._drawItem(o,v,c,H[n[s].index],E.label(H[n[s].index]),q,F)}}},_getSplineParameters:function(y){var l,C,A,D,x,w,r,q,o=[],g=[],e=y.length;for(l=0;l<e-1;l++){o[l]=y[l+1].x-y[l].x;g[l]=(y[l+1].y-y[l].y)/o[l]}C=[];A=[];C[0]=0;C[1]=2*(o[0]+o[1]);A[0]=0;A[1]=6*(g[1]-g[0]);for(l=2;l<e-1;l++){C[l]=2*(o[l-1]+o[l])-o[l-1]*o[l-1]/C[l-1];A[l]=6*(g[l]-g[l-1])-o[l-1]*A[l-1]/C[l-1]}D=[];D[e-1]=D[0]=0;for(l=e-2;l>=1;l--){D[l]=(A[l]-o[l]*D[l+1])/C[l]}x=[];w=[];r=[];q=[];for(l=0;l<e-1;l++){x[l]=y[l].y;w[l]=-o[l]*D[l+1]/6-o[l]*D[l]/3+(y[l+1].y-y[l].y)/o[l];r[l]=D[l]/2;q[l]=(D[l+1]-D[l])/(6*o[l])}return{a:x,b:w,c:r,d:q}},_getSplineYPoint:function(g,l,m,h,e,o,n){return h[m]+(g-l)*(e[m]+(g-l)*(o[m]+(g-l)*n[m]))}};dhtmlx.chart.barH={pvt_render_barH:function(y,M,l,h,A,L){var q,s,D,C,a,F,n,J,u,K,c,w,m,H,v,g,x,r,I,e,o;D=(h.y-l.y)/M.length;n=this._getLimits("h");J=n.max;u=n.min;g=h.x-l.x;o=!!this._settings.yAxis;if(!A){this._drawHScales(y,M,l,h,u,J,D)}if(o){J=parseFloat(this._settings.xAxis.end);u=parseFloat(this._settings.xAxis.start)}H=this._getRelativeValue(u,J);w=H[0];c=H[1];r=(w?g/w:10);if(!o){v=10;r=(w?(g-v)/w:10)}s=parseInt(this._settings.width,10);if((s*this._series.length+4)>D){s=D/this._series.length-4}q=Math.floor((D-s*this._series.length)/2);m=(typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(s/5));K=false;a=this._settings.gradient;if(a&&typeof(a)!="function"){K=a;a=false}else{if(a){a=y.createLinearGradient(l.x,l.y,h.x,l.y);this._settings.gradient(a)}}if(!o){this._drawLine(y,l.x-0.5,l.y,l.x-0.5,h.y,"#000000",1)}for(F=0;F<M.length;F++){x=parseFloat(this._settings.value(M[F]||0));if(x>J){x=J}x-=u;x*=c;I=l.x;e=l.y+q+F*D+(s+1)*A;if((x<0&&this._settings.origin=="auto")||(this._settings.xAxis&&x===0&&!(this._settings.origin!="auto"&&this._settings.origin>u))){this.canvases[A].renderTextAt("middle","right",I+10,e+s/2+q,this._settings.label(M[F]));continue}if(x<0&&this._settings.origin!="auto"&&this._settings.origin>u){x=0}if(!o){x+=v/r}C=a||this._settings.color.call(this,M[F]);if(this._settings.border){this._drawBarHBorder(y,I,e,s,u,m,r,x,C)}y.globalAlpha=this._settings.alpha.call(this,M[F]);var E=this._drawBarH(y,h,I,e,s,u,m,r,x,C,a,K);if(K!=false){this._drawBarHGradient(y,I,e,s,u,m,r,x,C,K)}y.globalAlpha=1;if(E[3]==e){this.canvases[A].renderTextAt("middle","left",E[0]-5,E[3]+Math.floor(s/2),this._settings.label(M[F]));L.addRect(M[F].id,[E[0]-l.x,E[3]-l.y,E[2]-l.x,E[3]+s-l.y],A)}else{this.canvases[A].renderTextAt("middle",false,E[2]+5,E[1]+Math.floor(s/2),this._settings.label(M[F]));L.addRect(M[F].id,[E[0]-l.x,e-l.y,E[2]-l.x,E[3]-l.y],A)}}},_setBarHPoints:function(w,g,u,x,m,v,s,l,h){var c=0;if(m>v*s){var r=(m-v*s)/m;c=-Math.asin(r)+Math.PI/2}w.moveTo(g,u+l);var e=g+v*s-m-(m?0:l);if(m<v*s){w.lineTo(e,u+l)}var q=u+m;if(m&&m>0){w.arc(e,q,m-l,-Math.PI/2+c,0,false)}var o=u+x-m-(m?0:l);var a=e+m-(m?l:0);w.lineTo(a,o);if(m&&m>0){w.arc(e,o,m-l,0,Math.PI/2-c,false)}var n=u+x-l;w.lineTo(g,n);if(!h){w.lineTo(g,u+l)}return[a,n]},_drawHScales:function(e,m,l,h,n,c,g){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(),m,l,h,n,c)}if(this._settings.yAxis){if(!this.canvases.y){this.canvases.y=new dhtmlx.ui.Canvas(this._obj)}this._drawHYAxis(this.canvases.y.getCanvas(),m,l,h,g,a)}},_drawHYAxis:function(s,h,o,m,e,a){if(!this._settings.yAxis){return}var l;var c=parseInt((a?a:o.x),10)-0.5;var q=m.y+0.5;var n=o.y;this._drawLine(s,c,q,c,n,this._settings.yAxis.color,1);for(var g=0;g<h.length;g++){var r=((this._settings.origin!="auto")&&(this._settings.view=="barH")&&(parseFloat(this._settings.value(h[g]))<this._settings.origin));l=n+e/2+g*e;this.canvases.y.renderTextAt("middle",(r?false:"left"),(r?c+5:c-5),l,this._settings.yAxis.template(h[g]),"dhx_axis_item_y",(r?0:c-10));if(this._settings.yAxis.lines.call(this,h[g])){this._drawLine(s,o.x,l,m.x,l,this._settings.yAxis.lineColor.call(this,h[g]),1)}}this._drawLine(s,o.x+0.5,n+0.5,m.x,n+0.5,this._settings.yAxis.lineColor.call(this,{}),1);this._setYAxisTitle(o,m)},_drawHXAxis:function(A,s,x,w,e,o){var m;var h={};var n=this._settings.xAxis;if(!n){return}var y=w.y+0.5;var g=x.x-0.5;var a=w.x-0.5;var r=x.x;this._drawLine(A,g,y,a,y,n.color,1);if(n.step){m=parseFloat(n.step)}if(typeof this._configXAxis.step=="undefined"||typeof this._configXAxis.start=="undefined"||typeof this._configXAxis.end=="undefined"){h=this._calculateScale(e,o);e=h.start;o=h.end;m=h.step;this._settings.xAxis.end=o;this._settings.xAxis.start=e;this._settings.xAxis.step=m}if(m===0){return}var l=(a-g)*m/(o-e);var v=0;for(var q=e;q<=o;q+=m){if(h.fixNum){q=parseFloat((new Number(q)).toFixed(h.fixNum))}var u=Math.floor(g+v*l)+0.5;if(!(q==e&&this._settings.origin=="auto")&&n.lines.call(this,q)){this._drawLine(A,u,y,u,x.y,this._settings.xAxis.lineColor.call(this,q),1)}if(q==this._settings.origin){r=u+1}this.canvases.x.renderTextAt(false,true,u,y+2,n.template(q.toString()),"dhx_axis_item_x");v++}this.canvases.x.renderTextAt(true,false,g,w.y+this._settings.padding.bottom-3,this._settings.xAxis.title,"dhx_axis_title_x",w.x-x.x);if(!n.lines.call(this,{})){this._drawLine(A,g,x.y-0.5,a,x.y-0.5,this._settings.xAxis.color,0.2)}return r},_correctBarHParams:function(n,h,e,l,m,o,g){var a=this._settings.yAxis;var c=h;if(!!a&&this._settings.origin!="auto"&&(this._settings.origin>g)){h+=(this._settings.origin-g)*m;c=h;l=l-(this._settings.origin-g);if(l<0){l*=(-1);n.translate(h,e+o);n.rotate(Math.PI);h=0.5;e=0}h+=0.5}return{value:l,x0:h,y0:e,start:c}},_drawBarH:function(u,h,A,g,o,q,l,n,s,v,a,m){u.save();var r=this._correctBarHParams(u,A,g,s,n,o,q);u.fillStyle=v;u.beginPath();var w=this._setBarHPoints(u,r.x0,r.y0,o,l,n,r.value,(this._settings.border?1:0));if(a&&!m){u.lineTo(h.x,r.y0+(this._settings.border?1:0))}u.fill();u.restore();var e=r.y0;var c=(r.y0!=g?g:w[1]);var y=(r.y0!=g?(r.start-w[0]):r.start);var x=(r.y0!=g?r.start:w[0]);return[y,e,x,c]},_drawBarHBorder:function(o,c,m,q,h,g,n,l,e){o.save();var a=this._correctBarHParams(o,c,m,l,n,q,h);o.beginPath();this._setBorderStyles(o,e);o.globalAlpha=0.9;this._setBarHPoints(o,a.x0,a.y0,q,g,n,a.value,o.lineWidth/2,1);o.stroke();o.restore()},_drawBarHGradient:function(r,e,o,s,m,l,q,n,g,a){r.save();var c=this._correctBarHParams(r,e,o,n,q,s,m);var h=this._setBarGradient(r,c.x0,c.y0+s,c.x0+q*c.value,c.y0,a,g,"x");r.fillStyle=h.gradient;r.beginPath();this._setBarHPoints(r,c.x0,c.y0+h.offset,s-h.offset*2,l,q,c.value,h.offset);r.fill();r.globalAlpha=1;r.restore()}};dhtmlx.assert(dhtmlx.chart.barH);dhtmlx.chart.stackedBarH={pvt_render_stackedBarH:function(C,P,h,g,D,O){var N,v;var c;var w;var y=g.x-h.x;var n=!!this._settings.yAxis;var m=this._getStackedLimits(P);N=m.max;v=m.min;var F=Math.floor((g.y-h.y)/P.length);if(!D){this._drawHScales(C,P,h,g,v,N,F)}if(n){N=parseFloat(this._settings.xAxis.end);v=parseFloat(this._settings.xAxis.start)}var K=this._getRelativeValue(v,N);w=K[0];c=K[1];var s=(w?y/w:10);if(!n){var x=10;s=(w?(y-x)/w:10)}var u=parseInt(this._settings.width,10);if((u+4)>F){u=F-4}var o=(F-u)/2;var l=0;var q=false;var a=this._settings.gradient;if(a){q=true}if(!n){this._drawLine(C,h.x-0.5,h.y,h.x-0.5,g.y,"#000000",1)}var M=0;var J=0;for(I=0;I<this._series.length;I++){if(I==D){J=M}if(this._series[I].view=="stackedBarH"){M++}}for(var I=0;I<P.length;I++){if(!J){P[I].$startX=h.x}var A=parseFloat(this._settings.value(P[I]||0));if(A>N){A=N}A-=v;A*=c;var L=h.x;var e=h.y+o+I*F;if(!J){P[I].$startX=L}else{L=P[I].$startX}if(A<0||(this._settings.yAxis&&A===0)){this.canvases.y.renderTextAt("middle",true,L+10,e+u/2,this._settings.label(P[I]));continue}if(!n){A+=x/s}var E=this._settings.color.call(this,P[I]);C.globalAlpha=this._settings.alpha.call(this,P[I]);C.fillStyle=this._settings.color.call(this,P[I]);C.beginPath();var H=this._setBarHPoints(C,L,e,u,l,s,A,(this._settings.border?1:0));if(a&&!q){C.lineTo(h.x+y,e+(this._settings.border?1:0))}C.fill();if(q!=false){var r=this._setBarGradient(C,L,e+u,L,e,q,E,"x");C.fillStyle=r.gradient;C.beginPath();H=this._setBarHPoints(C,L,e,u,l,s,A,0);C.fill()}if(this._settings.border){this._drawBarHBorder(C,L,e,u,v,l,s,A,E)}C.globalAlpha=1;this.canvases[D].renderTextAt("middle",true,P[I].$startX+(H[0]-P[I].$startX)/2-1,e+(H[1]-e)/2,this._settings.label(P[I]));O.addRect(P[I].id,[P[I].$startX-h.x,e-h.y,H[0]-h.x,H[1]-h.y],D);P[I].$startX=H[0]}}};dhtmlx.chart.stackedBar={pvt_render_stackedBar:function(x,L,g,e,y,K){var I,s;var a;var u;var v=e.y-g.y;var l=!!this._settings.yAxis;var J=!!this._settings.xAxis;var h=this._getStackedLimits(L);I=h.max;s=h.min;var C=Math.floor((e.x-g.x)/L.length);if(!y){this._drawScales(L,g,e,s,I,C)}if(l){I=parseFloat(this._settings.yAxis.end);s=parseFloat(this._settings.yAxis.start)}var F=this._getRelativeValue(s,I);u=F[0];a=F[1];var q=(u?v/u:10);var r=parseInt(this._settings.width,10);if(r+4>C){r=C-4}var m=Math.floor((C-r)/2);var n=(this._settings.gradient?this._settings.gradient:false);if(!J){this._drawLine(x,g.x,e.y+0.5,e.x,e.y+0.5,"#000000",1)}for(var E=0;E<L.length;E++){var w=parseFloat(this._settings.value(L[E]||0));if(!w){if(!y||!L[E].$startY){L[E].$startY=e.y}continue}if(!y){w-=s}w*=a;var H=g.x+m+E*C;var c=e.y;if(!y){L[E].$startY=c}else{c=L[E].$startY}if(c<(g.y+1)){continue}if(w<0||(this._settings.yAxis&&w===0)){this.canvases.y.renderTextAt(true,true,H+Math.floor(r/2),c,this._settings.label(L[E]));continue}var A=this._settings.color.call(this,L[E]);x.globalAlpha=this._settings.alpha.call(this,L[E]);x.fillStyle=this._settings.color.call(this,L[E]);x.beginPath();var D=this._setStakedBarPoints(x,H-(this._settings.border?0.5:0),c,r+(this._settings.border?0.5:0),q,w,0,g.y);x.fill();if(n){x.save();var o=this._setBarGradient(x,H,c,H+r,D[1],n,A,"y");x.fillStyle=o.gradient;x.beginPath();D=this._setStakedBarPoints(x,H+o.offset,c,r-o.offset*2,q,w,(this._settings.border?1:0),g.y);x.fill();x.restore()}if(this._settings.border){x.save();this._setBorderStyles(x,A);x.beginPath();this._setStakedBarPoints(x,H-0.5,c,r+1,q,w,0,g.y,1);x.stroke();x.restore()}x.globalAlpha=1;this.canvases[y].renderTextAt(false,true,H+Math.floor(r/2),(D[1]+(c-D[1])/2)-7,this._settings.label(L[E]));K.addRect(L[E].id,[H-g.x,D[1]-g.y,D[0]-g.x,(L[E].$startY||c)-g.y],y);L[E].$startY=(this._settings.border?(D[1]+1):D[1])}},_setStakedBarPoints:function(s,c,o,u,q,n,g,e,h){s.moveTo(c,o);var m=o-q*n+g;if(m<e){m=e}s.lineTo(c,m);var a=c+u;var l=m;s.lineTo(a,l);var r=c+u;s.lineTo(r,o);if(!h){s.lineTo(c,o)}return[r,l-2*g]}};dhtmlx.chart.line={pvt_render_line:function(m,A,h,g,n,x){var w,o,l,u,s,r,q,c,a,e,y,v;u=this._calculateLineParams(m,A,h,g,n);w=this._settings;if(A.length){s=(w.offset?h.x+u.cellWidth*0.5:h.x);l=[];for(o=0;o<A.length;o++){v=this._getPointY(A[o],h,g,u);if(v){q=((!o)?s:u.cellWidth*o-0.5+s);a=(typeof v=="object"?v.y0:v);if(o&&this._settings.fixOverflow){y=this._getPointY(A[o-1],h,g,u);if(y.out&&y.out==v.out){continue}r=u.cellWidth*(o-1)-0.5+s;c=(typeof y=="object"?y.y0:y);if(y.out){e=(y.out=="min"?g.y:h.y);l.push({x:this._calcOverflowX(r,q,c,a,e),y:e})}if(v.out){e=(v.out=="min"?g.y:h.y);l.push({x:this._calcOverflowX(r,q,c,a,e),y:e})}}if(!v.out){l.push({x:q,y:v,index:o})}}}this._mapStart=h;for(o=1;o<=l.length;o++){r=l[o-1].x;c=l[o-1].y;if(o<l.length){q=l[o].x;a=l[o].y;this._drawLine(m,r,c,q,a,w.line.color.call(this,A[o-1]),w.line.width);if(w.line&&w.line.shadow){m.globalAlpha=0.3;this._drawLine(m,r+2,c+w.line.width+8,q+2,a+w.line.width+8,"#eeeeee",w.line.width+3);m.globalAlpha=1}}if(typeof l[o-1].index!="undefined"){this._drawItem(m,r,c,A[l[o-1].index],w.label(A[l[o-1].index]),n,x,h)}}}},_calcOverflowX:function(c,a,g,e,h){return c+(h-g)*(a-c)/(e-g)},_drawItem:function(u,e,s,o,r,q,c){var g=this._settings.item;var n=parseInt(g.radius.call(this,o),10)||0;var m=this._mapStart;if(n){u.save();if(g.shadow){u.lineWidth=1;u.strokeStyle="#bdbdbd";u.fillStyle="#bdbdbd";var a=[0.1,0.2,0.3];for(var l=(a.length-1);l>=0;l--){u.globalAlpha=a[l];u.strokeStyle="#d0d0d0";u.beginPath();this._strokeChartItem(u,e,s+2*n/3,n+l+1,g.type);u.stroke()}u.beginPath();u.globalAlpha=0.3;u.fillStyle="#bdbdbd";this._strokeChartItem(u,e,s+2*n/3,n+1,g.type);u.fill()}u.restore();u.lineWidth=g.borderWidth;u.fillStyle=g.color.call(this,o);u.strokeStyle=g.borderColor.call(this,o);u.globalAlpha=g.alpha.call(this,o);u.beginPath();this._strokeChartItem(u,e,s,n+1,g.type);u.fill();u.stroke();u.globalAlpha=1}if(r){this.canvases[q].renderTextAt(false,true,e,s-n-this._settings.labelOffset,this._settings.label.call(this,o))}var h=(this._settings.eventRadius||n+1);c.addRect(o.id,[e-h-m.x,s-h-m.y,e+h-m.x,s+h-m.y],q)},_strokeChartItem:function(a,c,h,g,e){var l=[];c=parseInt(c,10);h=parseInt(h,10);if(e&&(e=="square"||e=="s")){g*=Math.sqrt(2)/2;l=[[c-g-a.lineWidth/2,h-g],[c+g,h-g],[c+g,h+g],[c-g,h+g],[c-g,h-g]]}else{if(e&&(e=="diamond"||e=="d")){var m=(a.lineWidth>1?a.lineWidth*Math.sqrt(2)/4:0);l=[[c,h-g],[c+g,h],[c,h+g],[c-g,h],[c+m,h-g-m]]}else{if(e&&(e=="triangle"||e=="t")){l=[[c,h-g],[c+Math.sqrt(3)*g/2,h+g/2],[c-Math.sqrt(3)*g/2,h+g/2],[c,h-g]]}else{l=[[c,h,g,0,Math.PI*2,true]]}}}this._path(a,l)},_getPointY:function(e,n,l,a){var m=a.minValue;var g=a.maxValue;var q=a.unit;var c=a.valueFactor;var o=this._settings.value(e);var r=(parseFloat(o||0)-m)*c;if(!this._settings.yAxis){r+=a.startValue/q}var h=l.y-q*r;if(this._settings.fixOverflow&&(this._settings.view=="line"||this._settings.view=="area")){if(o>g){h={y:n.y,y0:h,out:"max"}}else{if(r<0||o<m){h={y:l.y,y0:h,out:"min"}}}}else{if(o>g){h=n.y}if(r<0||o<m){h=l.y}}return h},_calculateLineParams:function(o,g,m,l,h){var c={};var q;c.totalHeight=l.y-m.y;c.cellWidth=(l.x-m.x)/((!this._settings.offset)?(g.length-1):g.length);var e=!!this._settings.yAxis;var a=(this._settings.view.indexOf("stacked")!=-1?this._getStackedLimits(g):this._getLimits());c.maxValue=a.max;c.minValue=a.min;if(!h){this._drawScales(g,m,l,c.minValue,c.maxValue,c.cellWidth)}if(e){c.maxValue=parseFloat(this._settings.yAxis.end);c.minValue=parseFloat(this._settings.yAxis.start)}var n=this._getRelativeValue(c.minValue,c.maxValue);q=n[0];c.valueFactor=n[1];c.unit=(q?c.totalHeight/q:10);c.startValue=0;if(!e){c.startValue=10;if(c.unit!=c.totalHeight){c.unit=(q?(c.totalHeight-c.startValue)/q:10)}}return c}};dhtmlx.chart.bar={pvt_render_bar:function(y,P,h,g,A,O){var s,D,H,m,M,u,v,c,I,w,r,L,n,N=g.y-h.y;n=!!this._settings.yAxis;L=!!this._settings.xAxis;m=this._getLimits();M=m.max;u=m.min;D=(g.x-h.x)/P.length;if(!A&&!(this._settings.origin!="auto"&&!n)){this._drawScales(P,h,g,u,M,D)}if(n){M=parseFloat(this._settings.yAxis.end);u=parseFloat(this._settings.yAxis.start)}I=this._getRelativeValue(u,M);v=I[0];c=I[1];r=(v?N/v:v);if(!n&&!(this._settings.origin!="auto"&&L)){w=10;r=(v?(N-w)/v:w)}if(!A&&(this._settings.origin!="auto"&&!n)&&this._settings.origin>u){this._drawXAxis(y,P,h,g,D,g.y-r*(this._settings.origin-u))}s=parseInt(this._settings.width,10);var K=0;var F=0;for(H=0;H<this._series.length;H++){if(H==A){F=K}if(this._series[H].view=="bar"){K++}}if(this._series&&(s*K+4)>D){s=parseInt(D/K-4,10)}var o=(D-s*K)/2;var l=(typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(s/5));var q=false;var a=this._settings.gradient;if(a&&typeof(a)!="function"){q=a;a=false}else{if(a){a=y.createLinearGradient(0,g.y,0,h.y);this._settings.gradient(a)}}if(!L){this._drawLine(y,h.x,g.y+0.5,g.x,g.y+0.5,"#000000",1)}for(H=0;H<P.length;H++){var x=parseFloat(this._settings.value(P[H])||0);if(isNaN(x)){continue}if(x>M){x=M}x-=u;x*=c;var J=h.x+o+parseInt(H*D,10)+(s+1)*F;var e=g.y;if(x<0||(this._settings.yAxis&&x===0&&!(this._settings.origin!="auto"&&this._settings.origin>u))){this.canvases[A].renderTextAt(true,true,J+Math.floor(s/2),e,this._settings.label(P[H]));continue}if(!n&&!(this._settings.origin!="auto"&&L)){x+=w/r}var C=a||this._settings.color.call(this,P[H]);y.globalAlpha=this._settings.alpha.call(this,P[H]);var E=this._drawBar(y,h,J,e,s,u,l,r,x,C,a,q);if(q){this._drawBarGradient(y,J,e,s,u,l,r,x,C,q)}if(this._settings.border){this._drawBarBorder(y,J,e,s,u,l,r,x,C)}y.globalAlpha=1;if(E[0]!=J){this.canvases[A].renderTextAt(false,true,J+Math.floor(s/2),E[1],this._settings.label(P[H]))}else{this.canvases[A].renderTextAt(true,true,J+Math.floor(s/2),E[3],this._settings.label(P[H]))}O.addRect(P[H].id,[J-h.x,E[3]-h.y,E[2]-h.x,E[1]-h.y],A)}},_correctBarParams:function(n,h,e,l,m,o,g){var a=this._settings.xAxis;var c=e;if(!!a&&this._settings.origin!="auto"&&(this._settings.origin>g)){e-=(this._settings.origin-g)*m;c=e;l=l-(this._settings.origin-g);if(l<0){l*=(-1);n.translate(h+o,e);n.rotate(Math.PI);h=0;e=0}e-=0.5}return{value:l,x0:h,y0:e,start:c}},_drawBar:function(u,h,A,g,o,q,l,n,s,v,a,m){u.save();u.fillStyle=v;var r=this._correctBarParams(u,A,g,s,n,o,q);var w=this._setBarPoints(u,r.x0,r.y0,o,l,n,r.value,(this._settings.border?1:0));if(a&&!m){u.lineTo(r.x0+(this._settings.border?1:0),h.y)}u.fill();u.restore();var y=r.x0;var x=(r.x0!=A?A+w[0]:w[0]);var e=(r.x0!=A?(r.start-w[1]-r.y0):r.y0);var c=(r.x0!=A?r.start-r.y0:w[1]);return[y,e,x,c]},_drawBarBorder:function(o,c,m,q,h,g,n,l,e){var a;o.save();a=this._correctBarParams(o,c,m,l,n,q,h);this._setBorderStyles(o,e);this._setBarPoints(o,a.x0,a.y0,q,g,n,a.value,o.lineWidth/2,1);o.stroke();o.restore()},_drawBarGradient:function(s,g,q,u,n,m,r,o,h,c){s.save();var e=this._correctBarParams(s,g,q,o,r,u,n);var l=this._setBarGradient(s,e.x0,e.y0,e.x0+u,e.y0-r*e.value+2,c,h,"y");var a=this._settings.border?1:0;s.fillStyle=l.gradient;this._setBarPoints(s,e.x0+l.offset,e.y0,u-l.offset*2,m,r,e.value,l.offset+a);s.fill();s.restore()},_setBarPoints:function(w,g,s,x,n,u,r,h,m){w.beginPath();var c=0;if(n>u*r){var l=(n-u*r)/n;if(l<=1&&l>=-1){c=-Math.acos(l)+Math.PI/2}}w.moveTo(g+h,s);var q=s-Math.floor(u*r)+n+(n?0:h);if(n<u*r){w.lineTo(g+h,q)}var e=g+n;if(n&&n>0){w.arc(e,q,n-h,-Math.PI+c,-Math.PI/2,false)}var a=g+x-n-h;var o=q-n+(n?h:0);w.lineTo(a,o);if(n&&n>0){w.arc(a,q,n-h,-Math.PI/2,0-c,false)}var v=g+x-h;w.lineTo(v,s);if(!m){w.lineTo(g+h,s)}return[v,o]}};dhtmlx.chart.pie={pvt_render_pie:function(c,g,a,l,e,h){this._renderPie(c,g,a,l,1,h,e)},_renderPie:function(r,E,h,g,C,D,s){if(!E.length){return}var u=this._getPieParameters(h,g);var m=(this._settings.radius?this._settings.radius:u.radius);if(m<0){return}var a=this._getValues(E);var l=this._getTotalValue(a);var n=this._getRatios(a,l);var A=(this._settings.x?this._settings.x:u.x);var e=(this._settings.y?this._settings.y:u.y);if(C==1&&this._settings.shadow){this._addShadow(r,A,e,m)}e=e/C;var q=-Math.PI/2;var w=[];r.scale(1,C);if(this._settings.gradient){var y=(C!=1?A+m/3:A);var c=(C!=1?e+m/3:e);this._showRadialGradient(r,A,e,m,y,c)}for(var x=0;x<E.length;x++){if(!a[x]){continue}r.strokeStyle=this._settings.lineColor.call(this,E[x]);r.beginPath();r.moveTo(A,e);w.push(q);alpha1=-Math.PI/2+n[x]-0.0001;r.arc(A,e,m,q,alpha1,false);r.lineTo(A,e);var v=this._settings.color.call(this,E[x]);r.fillStyle=v;r.fill();if(this._settings.pieInnerText){this._drawSectorLabel(A,e,5*m/6,q,alpha1,C,this._settings.pieInnerText(E[x],l),true)}if(this._settings.label){this._drawSectorLabel(A,e,m+this._settings.labelOffset,q,alpha1,C,this._settings.label(E[x]))}if(C!=1){this._createLowerSector(r,A,e,q,alpha1,m,true);r.fillStyle="#000000";r.globalAlpha=0.2;this._createLowerSector(r,A,e,q,alpha1,m,false);r.globalAlpha=1;r.fillStyle=v}D.addSector(E[x].id,q,alpha1,A-h.x,e-h.y/C,m,C,s);q=alpha1}r.globalAlpha=0.8;var o;for(x=0;x<w.length;x++){o=this._getPositionByAngle(w[x],A,e,m);this._drawLine(r,A,e,o.x,o.y,this._settings.lineColor.call(this,E[x]),2)}if(C==1){r.lineWidth=2;r.strokeStyle="#ffffff";r.beginPath();r.arc(A,e,m+1,0,2*Math.PI,false);r.stroke()}r.globalAlpha=1;r.scale(1,1/C)},_getValues:function(e){var a=[];for(var c=0;c<e.length;c++){a.push(parseFloat(this._settings.value(e[c])||0))}return a},_getTotalValue:function(a){var e=0;for(var c=0;c<a.length;c++){e+=a[c]}return e},_getRatios:function(c,a){var l;var h=[];var g=0;a=a||this._getTotalValue(c);for(var e=0;e<c.length;e++){l=c[e];h[e]=Math.PI*2*(a?((l+g)/a):(1/c.length));g+=l}return h},_getPieParameters:function(m,h){var g=h.x-m.x;var c=h.y-m.y;var e=m.x+g/2;var l=m.y+c/2;var a=Math.min(g/2,c/2);return{x:e,y:l,radius:a}},_createLowerSector:function(g,h,m,e,a,l,c){g.lineWidth=1;if(!((e<=0&&a>=0)||(e>=0&&a<=Math.PI)||(Math.abs(e-Math.PI)>0.003&&e<=Math.PI&&a>=Math.PI))){return}if(e<=0&&a>=0){e=0;c=false;this._drawSectorLine(g,h,m,l,e,a)}if(e<=Math.PI&&a>=Math.PI){a=Math.PI;c=false;this._drawSectorLine(g,h,m,l,e,a)}var n=(this._settings.height||Math.floor(l/4))/this._settings.cant;g.beginPath();g.arc(h,m,l,e,a,false);g.lineTo(h+l*Math.cos(a),m+l*Math.sin(a)+n);g.arc(h,m+n,l,a,e,true);g.lineTo(h+l*Math.cos(e),m+l*Math.sin(e));g.fill();if(c){g.stroke()}},_drawSectorLine:function(e,g,l,h,c,a){e.beginPath();e.arc(g,l,h,c,a,false);e.stroke()},_addShadow:function(c,a,l,g){c.globalAlpha=0.5;var h=["#c4c4c4","#c6c6c6","#cacaca","#dcdcdc","#dddddd","#e0e0e0","#eeeeee","#f5f5f5","#f8f8f8"];for(var e=h.length-1;e>-1;e--){c.beginPath();c.fillStyle=h[e];c.arc(a+1,l+1,g+e,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(e,c,m,a,g,h){e.beginPath();var l;if(typeof this._settings.gradient!="function"){l=e.createRadialGradient(g,h,a/4,c,m,a);l=this._getGrayGradient(l)}else{l=this._settings.gradient(l)}e.fillStyle=l;e.arc(c,m,a,0,Math.PI*2,true);e.fill();e.globalAlpha=0.7},_drawSectorLabel:function(D,c,g,w,v,E,u,a){var s=this.canvases[0].renderText(0,0,u,0,1);if(!s){return}var F=s.scrollWidth;s.style.width=F+"px";if(F>D){F=D}var A=(v-w<0.2?4:8);if(a){A=F/1.8}var e=w+(v-w)/2;g=g-(A-8)/2;var n=-A;var m=-8;var C="right";if(e>=Math.PI/2&&e<Math.PI||e<=3*Math.PI/2&&e>=Math.PI){n=-F-n+1;C="left"}var h=0;if(!a&&E<1&&(e>0&&e<Math.PI)){h=(this._settings.height||Math.floor(g/4))/E}var o=(c+Math.floor((g+h)*Math.sin(e)))*E+m;var q=D+Math.floor((g+A/2)*Math.cos(e))+n;var l=(v<Math.PI/2+0.01);var r=(w<Math.PI/2);if(r&&l){q=Math.max(q,D+3)}else{if(!r&&!l){q=Math.min(q,D-F)}else{if(!a&&(e>=Math.PI/2&&e<Math.PI||e<=3*Math.PI/2&&e>=Math.PI)){q+=F/3}}}s.style.top=o+"px";s.style.left=q+"px";s.style.width=F+"px";s.style.textAlign=C;s.style.whiteSpace="nowrap"}};dhtmlx.chart.pie3D={pvt_render_pie3D:function(c,g,a,l,e,h){this._renderPie(c,g,a,l,this._settings.cant,h)}};dhtmlx.chart.donut={pvt_render_donut:function(s,h,q,o,m,c){if(!h.length){return}this._renderPie(s,h,q,o,1,c);var g=this._settings;var l=this._getPieParameters(q,o);var a=(g.radius?g.radius:l.radius);var n=((g.innerRadius&&(g.innerRadius<a))?g.innerRadius:a/3);var e=(g.x?g.x:l.x);var r=(g.y?g.y:l.y);s.fillStyle="#ffffff";s.beginPath();s.arc(e,r,n,0,Math.PI*2,true);s.fill()}};dhtmlx.DataDriver.dhtmlxgrid={_grid_getter:"_get_cell_value",toObject:function(a){this._grid=a;return a},getRecords:function(a){return a.rowsBuffer},getDetails:function(e){var a={};for(var c=0;c<this._grid.getColumnsNum();c++){a["data"+c]=this._grid[this._grid_getter](e,c)}return a},getInfo:function(a){return{_size:0,_from:0}}};dhtmlx.ui.Canvas=function(c,e,h){this._canvas_labels=[];this._canvas_name=e;this._obj=c;var g=c.offsetWidth*(window.devicePixelRatio||1);var a=c.offsetHeight*(window.devicePixelRatio||1);var h=h||"";h+=";width:"+c.offsetWidth+"px;height:"+c.offsetHeight+"px;";this._prepareCanvas(e,h,g,a)};dhtmlx.ui.Canvas.prototype={_prepareCanvas:function(c,g,e,a){this._canvas=dhtmlx.html.create("canvas",{width:e,height:a,canvas_id:c,style:(g||"")});this._obj.appendChild(this._canvas);if(!this._canvas.getContext){if(dhtmlx._isIE){dhtmlx.require("thirdparty/excanvas/excanvas.js");G_vmlCanvasManager.init_(document);G_vmlCanvasManager.initElement(this._canvas)}else{dhtmlx.error("Canvas is not supported in the current browser")}}return this._canvas},getCanvas:function(c){var a=(this._canvas||this._prepareCanvas()).getContext(c||"2d");if(!this._webixDevicePixelRatio){this._webixDevicePixelRatio=true;a.scale(window.devicePixelRatio||1,window.devicePixelRatio||1)}return a},_resizeCanvas:function(){if(this._canvas){var a=this._canvas.parentNode.offsetWidth;var c=this._canvas.parentNode.offsetHeight;this._canvas.setAttribute("width",a*(window.devicePixelRatio||1));this._canvas.setAttribute("height",c*(window.devicePixelRatio||1));this._canvas.style.width=a+"px";this._canvas.style.height=c+"px";this._webixDevicePixelRatio=false}},renderText:function(a,l,h,g,c){if(!h){return}var e=dhtmlx.html.create("DIV",{"class":"dhx_canvas_text"+(g?(" "+g):""),style:"left:"+a+"px; top:"+l+"px;"},h);this._obj.appendChild(e);this._canvas_labels.push(e);if(c){e.style.width=c+"px"}return e},renderTextAt:function(h,o,a,n,g,m,e){var l=this.renderText.call(this,a,n,g,m,e);if(l){if(h){if(h=="middle"){l.style.top=parseInt(n-l.offsetHeight/2,10)+"px"}else{l.style.top=n-l.offsetHeight+"px"}}if(o){if(o=="left"){l.style.left=a-l.offsetWidth+"px"}else{l.style.left=parseInt(a-l.offsetWidth/2,10)+"px"}}}return l},clearCanvas:function(a){var c=[],e;for(e=0;e<this._canvas_labels.length;e++){this._obj.removeChild(this._canvas_labels[e])}this._canvas_labels=[];if(!a&&this._obj._htmlmap){c=this._getMapAreas();while(c.length){c[0].parentNode.removeChild(c[0]);c.splice(0,1)}c=null;if(!this._obj._htmlmap.getElementsByTagName("AREA").length){this._obj._htmlmap.parentNode.removeChild(this._obj._htmlmap);this._obj._htmlmap=null}}this.getCanvas().clearRect(0,0,this._obj.offsetWidth*(window.devicePixelRatio||1),this._obj.offsetWidth*(window.devicePixelRatio||1))},toggleCanvas:function(){this._toggleCanvas(this._canvas.style.display=="none")},showCanvas:function(){this._toggleCanvas(true)},hideCanvas:function(){this._toggleCanvas(false)},_toggleCanvas:function(a){var c,e;for(e=0;e<this._canvas_labels.length;e++){this._canvas_labels[e].style.display=(a?"":"none")}if(this._obj._htmlmap){c=this._getMapAreas();for(e=0;e<c.length;e++){if(a){c[e].removeAttribute("disabled")}else{c[e].setAttribute("disabled","true")}}}this._canvas.style.display=(a?"":"none")},_getMapAreas:function(){var e=[],a,c;a=this._obj._htmlmap.getElementsByTagName("AREA");for(c=0;c<a.length;c++){if(a[c].getAttribute("userdata")==this._canvas_name){e.push(a[c])}}return e}};dhtmlXChart=function(a){this.name="Chart";if(dhtmlx.assert_enabled()){this._assert()}dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_chart");dhtmlx.extend(this,dhtmlx.AtomDataLoader);dhtmlx.extend(this,dhtmlx.DataLoader);this.data.provideApi(this,true);dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.MouseEvents);dhtmlx.extend(this,dhtmlx.Destruction);dhtmlx.extend(this,dhtmlx.Group);dhtmlx.extend(this,dhtmlx.AutoTooltip);for(var c in dhtmlx.chart){dhtmlx.extend(this,dhtmlx.chart[c])}if(a.preset){this.definePreset(a)}this._parseSettings(a,this.defaults);this._series=[this._settings];this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render()},this));this.attachEvent("onLocateData",this._switchSerie)};dhtmlXChart.prototype={_id:"dhx_area_id",on_click:{dhx_chart_legend_item:function(m,n,l){var h=l.getAttribute("series_id");if(this.callEvent("onLegendClick",[m,h,l])){var g=this._settings;var c=g.legend.values;var a=(c&&(typeof c[h].toggle!="undefined"))?c[h].toggle:g.legend.toggle;if((typeof h!="undefined")&&this._series.length>1){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 e,c,g,h,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)}e=this._getChartBounds(this._obj.offsetWidth,this._obj.offsetHeight);h=new dhtmlx.ui.Map(this._id);a=this._settings;g=this._getChartData();for(c=0;c<this._series.length;c++){this._settings=this._series[c];if(!this.canvases[c]){this.canvases[c]=new dhtmlx.ui.Canvas(this._obj,c,"z-index:"+(2+c))}this["pvt_render_"+this._settings.view](this.canvases[c].getCanvas(),g,e.start,e.end,c,h)}h.render(this._obj);this._obj.lastChild.style.zIndex=1000;this._applyBounds(this._obj.lastChild,e);this.callEvent("onAfterRender",[]);this._settings=a},_applyBounds:function(e,c){var a={};a.left=c.start.x;a.top=c.start.y;a.width=c.end.x-c.start.x;a.height=c.end.y-c.start.y;for(var g in a){e.style[g]=a[g]+"px"}},_getChartData:function(){var g,m,e,h,l,q,a,n,o,c;h=this.data.getRange();g=(this._settings.view.toLowerCase().indexOf("barh")!=-1?"yAxis":"xAxis");m=this._settings[g];if(m&&m.units&&(typeof m.units=="object")){e=m.units;n=[];if(typeof e.start!="undefined"&&typeof e.end!="undefined"&&typeof e.next!="undefined"){a=e.start;while(a<=e.end){n.push(a);a=e.next.call(this,a)}}else{if(Object.prototype.toString.call(e)==="[object Array]"){n=e}}q=[];if(n.length){o=m.value;c={};for(l=0;l<h.length;l++){c[o(h[l])]=l}for(l=0;l<n.length;l++){if(typeof c[n[l]]!="undefined"){h[c[n[l]]].$unit=n[l];q.push(h[c[n[l]]])}else{q.push({$unit:n[l]})}}}return q}return h},value_setter:dhtmlx.Template.obj_setter,xValue_setter:dhtmlx.Template.obj_setter,yValue_setter:function(a){this.define("value",a)},alpha_setter:dhtmlx.Template.obj_setter,label_setter:dhtmlx.Template.obj_setter,lineColor_setter:dhtmlx.Template.obj_setter,borderColor_setter:dhtmlx.Template.obj_setter,pieInnerText_setter:dhtmlx.Template.obj_setter,gradient_setter:function(a){if((typeof(a)!="function")&&a&&(a===true)){a="light"}return a},colormap:{RAINBOW:function(a){var c=Math.floor(this.indexById(a.id)/this.dataCount()*1536);if(c==1536){c-=1}return this._rainbow[Math.floor(c/256)](c%256)}},color_setter:function(a){return this.colormap[a]||dhtmlx.Template.obj_setter(a)},fill_setter:function(a){return((!a||a==0)?false:dhtmlx.Template.obj_setter(a))},definePreset:function(a){this.define("preset",a.preset);delete a.preset},preset_setter:function(h){var e,c,g;this.defaults=dhtmlx.extend({},this.defaults);if(typeof dhtmlx.presets.chart[h]=="object"){g=dhtmlx.presets.chart[h];for(e in g){if(typeof g[e]=="object"){if(!this.defaults[e]||typeof this.defaults[e]!="object"){this.defaults[e]=dhtmlx.extend({},g[e])}else{this.defaults[e]=dhtmlx.extend({},this.defaults[e]);for(c in g[e]){this.defaults[e][c]=g[e][c]}}}else{this.defaults[e]=g[e]}}return h}return false},legend_setter:function(a){if(!a){if(this.legendObj){this.legendObj.innerHTML="";this.legendObj=null}return false}if(typeof(a)!="object"){a={template:a}}this._mergeSettings(a,{width:150,height:18,layout:"y",align:"left",valign:"bottom",template:"",toggle:(this._settings.view.toLowerCase().indexOf("stacked")!=-1?"":"hide"),marker:{type:"square",width:15,height:15,radius:3},margin:4,padding:3});a.template=dhtmlx.Template.setter(a.template);return a},defaults:{color:"RAINBOW",alpha:"1",label:false,value:"{obj.value}",padding:{},view:"pie",lineColor:"#ffffff",cant:0.5,width:30,labelWidth:100,line:{width:2,color:"#1293f8"},item:{radius:3,borderColor:"#636363",borderWidth:1,color:"#ffffff",alpha:1,type:"r",shadow:false},shadow:true,gradient:false,border:true,labelOffset:20,origin:"auto"},item_setter:function(a){if(typeof(a)!="object"){a={color:a,borderColor:a}}this._mergeSettings(a,dhtmlx.extend({},this.defaults.item));var e=["alpha","borderColor","color","radius"];for(var c=0;c<e.length;c++){a[e[c]]=dhtmlx.Template.setter(a[e[c]])}return a},line_setter:function(a){if(typeof(a)!="object"){a={color:a}}dhtmlx.extend(this.defaults.line,a);a=dhtmlx.extend({},this.defaults.line);a.color=dhtmlx.Template.setter(a.color);return a},padding_setter:function(a){if(typeof(a)!="object"){a={left:a,right:a,top:a,bottom:a}}this._mergeSettings(a,{left:50,right:20,top:35,bottom:40});return a},xAxis_setter:function(a){if(!a){return false}if(typeof(a)!="object"){a={template:a}}if(!a.value){a.value=a.template}this._mergeSettings(a,{title:"",color:"#000000",lineColor:"#cfcfcf",template:"{obj}",value:"{obj}",lines:true});var c=["lineColor","template","lines","value"];this._converToTemplate(c,a);this._configXAxis=dhtmlx.extend({},a);return a},yAxis_setter:function(a){this._mergeSettings(a,{title:"",color:"#000000",lineColor:"#cfcfcf",template:"{obj}",lines:true,bg:"#ffffff"});var c=["lineColor","template","lines","bg"];this._converToTemplate(c,a);this._configYAxis=dhtmlx.extend({},a);return a},_converToTemplate:function(a,c){for(var e=0;e<a.length;e++){c[a[e]]=dhtmlx.Template.setter(c[a[e]])}},_drawScales:function(h,g,e,m,a,c){var l=0;if(this._settings.yAxis){if(!this.canvases.y){this.canvases.y=new dhtmlx.ui.Canvas(this._obj,"axis_y")}l=this._drawYAxis(this.canvases.y.getCanvas(),h,g,e,m,a)}if(this._settings.xAxis){if(!this.canvases.x){this.canvases.x=new dhtmlx.ui.Canvas(this._obj,"axis_x")}this._drawXAxis(this.canvases.x.getCanvas(),h,g,e,c,l)}return l},_drawXAxis:function(u,l,r,q,g,o){var e=r.x-0.5;var s=parseInt((o?o:q.y),10)+0.5;var c=q.x;var m;var a=true;for(var h=0;h<l.length;h++){if(this._settings.offset===true){m=e+g/2+h*g}else{m=(h==l.length-1)?q.x:e+h*g;a=!!h}m=Math.ceil(m)-0.5;var n=((this._settings.origin!="auto")&&(this._settings.view=="bar")&&(parseFloat(this._settings.value(l[h]))<this._settings.origin));this._drawXAxisLabel(m,s,l[h],a,n);if((this._settings.offset||h)&&this._settings.xAxis.lines.call(this,l[h])){this._drawXAxisLine(u,m,q.y,r.y,l[h])}}this.canvases.x.renderTextAt(true,false,e,q.y+this._settings.padding.bottom-3,this._settings.xAxis.title,"dhx_axis_title_x",q.x-r.x);this._drawLine(u,e,s,c,s,this._settings.xAxis.color,1);if(!this._settings.xAxis.lines.call(this,{})||!this._settings.offset){return}this._drawLine(u,c+0.5,q.y,c+0.5,r.y+0.5,this._settings.xAxis.color,0.2)},_drawYAxis:function(w,D,l,h,n,m){var o;var u={};if(!this._settings.yAxis){return}var y=l.x-0.5;var g=h.y;var e=l.y;var v=h.y;if(this._settings.yAxis.step){o=parseFloat(this._settings.yAxis.step)}if(typeof this._configYAxis.step=="undefined"||typeof this._configYAxis.start=="undefined"||typeof this._configYAxis.end=="undefined"){u=this._calculateScale(n,m);n=u.start;m=u.end;o=u.step;this._settings.yAxis.end=m;this._settings.yAxis.start=n}this._setYAxisTitle(l,h);if(o===0){m=n;o=1}var a=(m==n?g-e:(g-e)*o/(m-n));var A=0;for(var x=n;x<=m;x+=o){if(u.fixNum){x=parseFloat((new Number(x)).toFixed(u.fixNum))}var C=Math.floor(g-A*a)+0.5;if(!(x==n&&this._settings.origin=="auto")&&this._settings.yAxis.lines.call(this,x)){this._drawLine(w,y,C,h.x,C,this._settings.yAxis.lineColor.call(this,x),1)}if(x==this._settings.origin){v=C}var q=x;if(o<1){var r=Math.min(this._log10(o),(n<=0?0:this._log10(n)));var s=Math.pow(10,-r);q=Math.round(x*s)/s;x=q}this.canvases.y.renderText(0,C-5,this._settings.yAxis.template(q.toString()),"dhx_axis_item_y",l.x-5);A++}this._drawLine(w,y,g+1,y,e,this._settings.yAxis.color,1);return v},_setYAxisTitle:function(e,c){var a="dhx_axis_title_y"+(dhtmlx._isIE&&dhtmlx._isIE!=9?" dhx_ie_filter":"");var g=this.canvases.y.renderTextAt("middle",false,0,parseInt((c.y-e.y)/2+e.y,10),this._settings.yAxis.title,a);if(g){g.style.left=(dhtmlx.env.transform?(g.offsetHeight-g.offsetWidth)/2:0)+"px"}},_calculateScale:function(q,c){if(this._settings.origin!="auto"&&this._settings.origin<q){q=this._settings.origin}var h,g,m;h=((c-q)/8)||1;var e=Math.floor(this._log10(h));var a=Math.pow(10,e);var l=h/a;l=(l>5?10:5);h=parseInt(l,10)*a;if(h>Math.abs(q)){g=(q<0?-h:0)}else{var r=Math.abs(q);var o=Math.floor(this._log10(r));var n=r/Math.pow(10,o);g=Math.ceil(n*10)/10*Math.pow(10,o)-h;if(r>1&&h>0.1){g=Math.ceil(g)}while(q<0?g<=q:g>=q){g-=h}if(q<0){g=-g-2*h}}m=g;while(m<c){m+=h;m=parseFloat((new Number(m)).toFixed(Math.abs(e)))}return{start:g,end:m,step:h,fixNum:Math.abs(e)}},_getLimits:function(c,m){var n,l;var h=((arguments.length&&c=="h")?this._configXAxis:this._configYAxis);m=m||"value";if(h&&(typeof h.end!="undefined")&&(typeof h.start!="undefined")&&h.step){n=parseFloat(h.end);l=parseFloat(h.start)}else{n=this.max(this._series[0][m]);l=(h&&(typeof h.start!="undefined"))?parseFloat(h.start):this.min(this._series[0][m]);if(this._series.length>1){for(var g=1;g<this._series.length;g++){var a=this.max(this._series[g][m]);var e=this.min(this._series[g][m]);if(a>n){n=a}if(e<l){l=e}}}}return{max:n,min:l}},_log10:function(c){var a="log";return Math.floor((Math[a](c)/Math.LN10))},_drawXAxisLabel:function(c,l,h,a,g){if(!this._settings.xAxis){return}var e=this.canvases.x.renderTextAt(g,a,c,l-(g?2:0),this._settings.xAxis.template(h));if(e){e.className+=" dhx_axis_item_x"}},_drawXAxisLine:function(c,a,g,e,h){if(!this._settings.xAxis||!this._settings.xAxis.lines){return}this._drawLine(c,a,g,a,e,this._settings.xAxis.lineColor.call(this,h),1)},_drawLine:function(a,g,m,e,h,c,l){a.strokeStyle=c;a.lineWidth=l;a.beginPath();a.moveTo(g,m);a.lineTo(e,h);a.stroke();a.lineWidth=1},_getRelativeValue:function(g,h){var e,a;var c=1;if(h!=g){e=h-g}else{e=g}return[e,c]},_rainbow:[function(a){return"#FF"+dhtmlx.math.toHex(a/2,2)+"00"},function(a){return"#FF"+dhtmlx.math.toHex(a/2+128,2)+"00"},function(a){return"#"+dhtmlx.math.toHex(255-a,2)+"FF00"},function(a){return"#00FF"+dhtmlx.math.toHex(a,2)},function(a){return"#00"+dhtmlx.math.toHex(255-a,2)+"FF"},function(a){return"#"+dhtmlx.math.toHex(a,2)+"00FF"}],addSeries:function(c){var a=this._settings;this._settings=dhtmlx.extend({},a);this._parseSettings(c,{});this._series.push(this._settings);this._settings=a},_switchSerie:function(g,a){var e;this._active_serie=a.getAttribute("userdata");if(!this._series[this._active_serie]){return}for(var c=0;c<this._series.length;c++){e=this._series[c].tooltip;if(e){e.disable()}}if(!a.getAttribute("disabled")){e=this._series[this._active_serie].tooltip;if(e){e.enable()}}},hideSeries:function(a){this.canvases[a].hideCanvas();if(this._settings.legend.values&&this._settings.legend.values[a]){this._settings.legend.values[a].$hidden=true}this._drawLegend()},showSeries:function(a){this.canvases[a].showCanvas();if(this._settings.legend.values&&this._settings.legend.values[a]){delete this._settings.legend.values[a].$hidden}this._drawLegend()},_setBorderStyles:function(a,c){var g,e;e=dhtmlx.math.toRgb(c);g=dhtmlx.math.rgbToHsv(e[0],e[1],e[2]);g[2]/=2;c="rgb("+dhtmlx.math.hsvToRgb(g[0],g[1],g[2])+")";a.strokeStyle=c;if(a.globalAlpha==1){a.globalAlpha=0.9}},_drawLegend:function(g,c){var h,q,w,r,l,s,a,n=0,m=0,v,o,e,u;g=g||[];c=c||this._obj.offsetWidth;v=this.canvases.legend.getCanvas();q=this._settings.legend;a=(this._settings.legend.layout!="x"?"width:"+q.width+"px":"");if(this.legendObj){this.legendObj.innerHTML="";this.legendObj.parentNode.removeChild(this.legendObj)}this.canvases.legend.clearCanvas(true);w=dhtmlx.html.create("DIV",{"class":"dhx_chart_legend",style:"left:"+n+"px; top:"+m+"px;"+a},"");if(q.padding){w.style.padding=q.padding+"px"}this.legendObj=w;this._obj.appendChild(w);l=[];if(!q.values){for(h=0;h<g.length;h++){l.push(this._drawLegendText(w,q.template(g[h])))}}else{for(h=0;h<q.values.length;h++){l.push(this._drawLegendText(w,q.values[h].text,(typeof q.values[h].id!="undefined"?typeof q.values[h].id:h),q.values[h].$hidden))}}s=w.offsetWidth;r=w.offsetHeight;if(s<this._obj.offsetWidth){if(q.layout=="x"&&q.align=="center"){n=(this._obj.offsetWidth-s)/2}if(q.align=="right"){n=this._obj.offsetWidth-s}if(q.margin&&q.align!="center"){n+=(q.align=="left"?1:-1)*q.margin}}if(r<this._obj.offsetHeight){if(q.valign=="middle"&&q.align!="center"&&q.layout!="x"){m=(this._obj.offsetHeight-r)/2}else{if(q.valign=="bottom"){m=this._obj.offsetHeight-r}}if(q.margin&&q.valign!="middle"){m+=(q.valign=="top"?1:-1)*q.margin}}w.style.left=n+"px";w.style.top=m+"px";v.save();for(h=0;h<l.length;h++){u=l[h];if(q.values&&q.values[h].$hidden){e=true;o=(q.values[h].disableColor?q.values[h].disableColor:"#d9d9d9")}else{e=false;o=(q.values?q.values[h].color:this._settings.color.call(this,g[h]))}this._drawLegendMarker(v,u.offsetLeft+n,u.offsetTop+m,o,u.offsetHeight,e,h)}v.restore();l=null},_drawLegendText:function(a,h,c,g){var e="";if(this._settings.legend.layout=="x"){e="float:left;"}var l=dhtmlx.html.create("DIV",{style:e+"padding-left:"+(10+this._settings.legend.marker.width)+"px","class":"dhx_chart_legend_item"+(g?" hidden":"")},h);if(arguments.length>2){l.setAttribute("series_id",c)}a.appendChild(l);return l},_drawLegendMarker:function(A,s,r,h,w,l,n){var c=[];var m=this._settings.legend.marker;var v=this._settings.legend.values;var q=(v&&v[n].markerType?v[n].markerType:m.type);if(h){A.fillStyle=h;A.strokeStyle=this._getDarkenColor(h,0.75)}A.beginPath();if(q=="round"||!m.radius){A.lineWidth=m.height;A.lineCap=q;s+=A.lineWidth/2+5;r+=w/2;A.moveTo(s,r);var a=s+m.width-m.height+1;A.lineTo(a,r)}else{if(q=="item"){if(this._settings.line&&this._settings.view!="scatter"&&!this._settings.disableLines){A.beginPath();A.lineWidth=this._series[n].line.width;A.strokeStyle=l?h:this._series[n].line.color.call(this,{});var e=s+5;var u=r+w/2;A.moveTo(e,u);var a=e+m.width;A.lineTo(a,u);A.stroke()}var g=this._series[n].item;var o=parseInt(g.radius.call(this,{}),10)||0;if(o){A.beginPath();if(l){A.lineWidth=g.borderWidth;A.strokeStyle=h;A.fillStyle=h}else{A.lineWidth=g.borderWidth;A.fillStyle=g.color.call(this,{});A.strokeStyle=g.borderColor.call(this,{});A.globalAlpha=g.alpha.call(this,{})}A.beginPath();s+=m.width/2+5;r+=w/2;this._strokeChartItem(A,s,r,o+1,g.type);A.fill();A.stroke()}A.globalAlpha=1}else{A.lineWidth=1;s+=5;r+=parseInt(w/2-m.height/2,10);c=[[s+m.radius,r+m.radius,m.radius,Math.PI,3*Math.PI/2,false],[s+m.width-m.radius,r],[s+m.width-m.radius,r+m.radius,m.radius,-Math.PI/2,0,false],[s+m.width,r+m.height-m.radius],[s+m.width-m.radius,r+m.height-m.radius,m.radius,0,Math.PI/2,false],[s+m.radius,r+m.height],[s+m.radius,r+m.height-m.radius,m.radius,Math.PI/2,Math.PI,false],[s,r+m.radius]];this._path(A,c)}}A.stroke();A.fill()},_getDarkenColor:function(a,g){var e,c;c=dhtmlx.math.toRgb(a);e=dhtmlx.math.rgbToHsv(c[0],c[1],c[2]);e[2]=e[2]*g;return"rgb("+dhtmlx.math.hsvToRgb(e[0],e[1],e[2])+")"},_getChartBounds:function(a,m){var o,e,n,c;o=this._settings.padding.left;e=this._settings.padding.top;n=a-this._settings.padding.right;c=m-this._settings.padding.bottom;if(this._settings.legend){var h=this._settings.legend;var l=this._settings.legend.width;var g=this._settings.legend.height;if(h.layout=="x"){if(h.valign=="center"){if(h.align=="right"){n-=l}else{if(h.align=="left"){o+=l}}}else{if(h.valign=="bottom"){c-=g}else{e+=g}}}else{if(h.align=="right"){n-=l}else{if(h.align=="left"){o+=l}}}}return{start:{x:o,y:e},end:{x:n,y:c}}},_getStackedLimits:function(h){var c,a,l,g,e;if(this._settings.yAxis&&(typeof this._settings.yAxis.end!="undefined")&&(typeof this._settings.yAxis.start!="undefined")&&this._settings.yAxis.step){l=parseFloat(this._settings.yAxis.end);g=parseFloat(this._settings.yAxis.start)}else{for(c=0;c<h.length;c++){h[c].$sum=0;h[c].$min=Infinity;for(a=0;a<this._series.length;a++){e=parseFloat(this._series[a].value(h[c])||0);if(isNaN(e)){continue}if(this._series[a].view.toLowerCase().indexOf("stacked")!=-1){h[c].$sum+=e}if(e<h[c].$min){h[c].$min=e}}}l=-Infinity;g=Infinity;for(c=0;c<h.length;c++){if(h[c].$sum>l){l=h[c].$sum}if(h[c].$min<g){g=h[c].$min}}if(g>0){g=0}}return{max:l,min:g}},_setBarGradient:function(v,c,r,a,o,n,g,e){var q,h,m,l,u,s;if(n=="light"){if(e=="x"){q=v.createLinearGradient(c,r,a,r)}else{q=v.createLinearGradient(c,r,c,o)}s=[[0,"#FFFFFF"],[0.9,g],[1,g]];h=2}else{if(n=="falling"||n=="rising"){if(e=="x"){q=v.createLinearGradient(c,r,a,r)}else{q=v.createLinearGradient(c,r,c,o)}m=dhtmlx.math.toRgb(g);l=dhtmlx.math.rgbToHsv(m[0],m[1],m[2]);l[1]*=1/2;u="rgb("+dhtmlx.math.hsvToRgb(l[0],l[1],l[2])+")";if(n=="falling"){s=[[0,u],[0.7,g],[1,g]]}else{if(n=="rising"){s=[[0,g],[0.3,g],[1,u]]}}h=0}else{v.globalAlpha=0.37;h=0;if(e=="x"){q=v.createLinearGradient(c,o,c,r)}else{q=v.createLinearGradient(c,r,a,r)}s=[[0,"#9d9d9d"],[0.3,"#e8e8e8"],[0.45,"#ffffff"],[0.55,"#ffffff"],[0.7,"#e8e8e8"],[1,"#9d9d9d"]]}}this._gradient(q,s);return{gradient:q,offset:h}},_getPositionByAngle:function(e,c,h,g){e*=(-1);c=c+Math.cos(e)*g;h=h-Math.sin(e)*g;return{x:c,y:h}},_gradient:function(e,c){for(var a=0;a<c.length;a++){e.addColorStop(c[a][0],c[a][1])}},_path:function(a,e){var c,g;for(c=0;c<e.length;c++){g=(c?"lineTo":"moveTo");if(e[c].length>2){g="arc"}a[g].apply(a,e[c])}},_circle:function(c,a,g,e){c.arc(a,g,e,Math.PI*2,true)},_addMapRect:function(g,h,a,e,c){g.addRect(h,[a[0].x-e.x,a[0].y-e.y,a[1].x-e.x,a[1].y-e.y],c)}};dhtmlx.compat("layout");if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachChart=function(a){this.callEvent("_onBeforeContentAttach",["chart"]);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}}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(e){var c="";if(e.page==-1){return""}e.min=e.page-Math.round((e.group-1)/2);e.max=e.min+e.group-1;if(e.min<0){e.max+=e.min*(-1);e.min=0}if(e.max>=e.limit){e.min-=Math.min(e.min,e.max-e.limit+1);e.max=e.limit-1}for(var a=(e.min||0);a<=e.max;a++){c+=this.button({id:a,index:(a+1),selected:(a==e.page?"_selected":"")})}return c},page:function(a){return a.page+1},first:function(){return this.button({id:"first",index:" &lt;&lt; ",selected:""})},last:function(){return this.button({id:"last",index:" &gt;&gt; ",selected:""})},prev:function(){return this.button({id:"prev",index:"&lt;",selected:""})},next:function(){return this.button({id:"next",index:"&gt;",selected:""})},button:dhtmlx.Template.fromHTML("<div dhx_p_id='{obj.id}' class='dhx_pager_item{obj.selected}'>{obj.index}</div>")}},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("<div>"),template_item_end:dhtmlx.Template.fromHTML("</div>")};dhtmlx.DataProcessor={_dp_init:function(c){var a="_methods";c[a]=["setItemStyle","","changeId","remove"];this.attachEvent("onAfterAdd",function(e){c.setUpdated(e,true,"inserted")});this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(g,e){if(g.getUserData){g.getUserData(e,this._userdata)}},this));this.attachEvent("onBeforeDelete",function(g){if(c._silent_mode){return true}var e=c.getState(g);if(e=="inserted"){c.setUpdated(g,false);return true}if(e=="deleted"){return false}if(e=="true_deleted"){return true}c.setUpdated(g,true,"deleted");return false});this.attachEvent("onAfterEditStop",function(e){c.setUpdated(e,true,"updated")});this.attachEvent("onBindUpdate",function(e){window.setTimeout(function(){c.setUpdated(e.id,true,"updated")},1)});a="_getRowData";c[a]=function(m,e){var h=this.obj.data.get(m);var l={};for(var g in h){if(g.indexOf("_")===0){continue}l[g]=h[g]}return l};a="_clearUpdateFlag";c[a]=function(){};this._userdata={};c.attachEvent("insertCallback",this._dp_callback);c.attachEvent("updateCallback",this._dp_callback);c.attachEvent("deleteCallback",function(e,g){this.obj.setUserData(g,this.action_param,"true_deleted");this.obj.remove(g)});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(e,a){var c=this._locateHTML(e);if(c){c.style.cssText+=";"+a}},changeId:function(c,a){this.data.changeId(c,a);this.refresh()},setUserData:function(e,a,c){if(e){this.data.get(e)[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 n="_dragged";var g=dhtmlDragAndDropObject.prototype.checkLanding;dhtmlDragAndDropObject.prototype.checkLanding=function(q,r,o){g.apply(this,arguments);if(!o){var s=dhtmlx.DragControl._drag_context=dhtmlx.DragControl._drag_context||{};if(!s.from){s.from=this.dragStartObject}dhtmlx.DragControl._checkLand(q,r,true)}};var c=dhtmlDragAndDropObject.prototype.stopDrag;dhtmlDragAndDropObject.prototype.stopDrag=function(r,o,q){if(!q){if(dhtmlx.DragControl._last){dhtmlx.DragControl._active=m.dragStartNode;dhtmlx.DragControl._stopDrag(r,true)}}c.apply(this,arguments)};var m=new dhtmlDragAndDropObject();var h=dhtmlx.DragControl._startDrag;dhtmlx.DragControl._startDrag=function(){h.apply(this,arguments);var s=dhtmlx.DragControl._drag_context;if(!s){return}var r=[];var q=[];for(var o=0;o<s.source.length;o++){r[o]={idd:s.source[o]};q.push(s.source[o])}m.dragStartNode={parentNode:{},parentObject:{idd:r,id:(q.length==1?q[0]:q),treeNod:{object:s.from}}};m.dragStartNode.parentObject.treeNod[n]=r;m.dragStartObject=s.from};var l=dhtmlx.DragControl._checkLand;dhtmlx.DragControl._checkLand=function(q,r,o){l.apply(this,arguments);if(!this._last&&!o){q=m.checkLanding(q,r,true)}};var a=dhtmlx.DragControl._stopDrag;dhtmlx.DragControl._stopDrag=function(q,o){a.apply(this,arguments);if(m.lastLanding&&!o){m.stopDrag(q,false,true)}};var e=dhtmlx.DragControl.getMaster;dhtmlx.DragControl.getMaster=function(q){var r=null;if(q){r=e.apply(this,arguments)}if(!r){r=m.dragStartObject;var s=[];var u=r[n];for(var o=0;o<u.length;o++){s.push(u[o].idd||u[o].id)}dhtmlx.DragControl._drag_context.source=s}return r}}};dhtmlx.DataMove={_init:function(){dhtmlx.assert(this.data,"DataMove :: Component doesn't have DataStore")},copy:function(c,h,a,g){var e=this.get(c);if(!e){dhtmlx.log("Warning","Incorrect ID in DataMove::copy");return}if(a){dhtmlx.assert(a.externalData,"DataMove :: External object doesn't support operation");e=a.externalData(e)}a=a||this;return a.add(a.externalData(e,g),h)},move:function(e,m,c,l){if(e instanceof Array){for(var g=0;g<e.length;g++){var a=(c||this).indexById(this.move(e[g],m,c,e[g]));if(e[g+1]){m=a+(this.indexById(e[g+1])<a?0:1)}}return}nid=e;if(m<0){dhtmlx.log("Info","DataMove::move - moving outside of bounds is ignored");return}var h=this.get(e);if(!h){dhtmlx.log("Warning","Incorrect ID in DataMove::move");return}if(!c||c==this){this.data.move(this.indexById(e),m)}else{dhtmlx.assert(c.externalData,"DataMove :: External object doesn't support operation");nid=c.add(c.externalData(h,l),m);this.remove(e)}return nid},moveUp:function(c,a){return this.move(c,this.indexById(c)-(a||1))},moveDown:function(c,a){return this.moveUp(c,(a||1)*-1)},moveTop:function(a){return this.move(a,0)},moveBottom:function(a){return this.move(a,this.data.dataCount()-1)},externalData:function(a,e){var c=dhtmlx.extend({},a);c.id=e||dhtmlx.uid();c.$selected=c.$template=null;return c}};dhtmlx.DragControl={_drag_masters:dhtmlx.toArray(["dummy"]),addDrop:function(c,e,a){c=dhtmlx.toNode(c);c.dhx_drop=this._getCtrl(e);if(a){c.dhx_master=true}},_getCtrl:function(c){c=c||dhtmlx.DragControl;var a=this._drag_masters.find(c);if(a<0){a=this._drag_masters.length;this._drag_masters.push(c)}return a},addDrag:function(a,c){a=dhtmlx.toNode(a);a.dhx_drag=this._getCtrl(c);dhtmlx.event(a,"mousedown",this._preStart,a)},_preStart:function(a){if(dhtmlx.DragControl._active){dhtmlx.DragControl._preStartFalse();dhtmlx.DragControl.destroyDrag()}dhtmlx.DragControl._active=this;dhtmlx.DragControl._start_pos={x:a.pageX,y:a.pageY};dhtmlx.DragControl._dhx_drag_mm=dhtmlx.event(document.body,"mousemove",dhtmlx.DragControl._startDrag);dhtmlx.DragControl._dhx_drag_mu=dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl._preStartFalse);dhtmlx.DragControl._dhx_drag_sc=dhtmlx.event(this,"scroll",dhtmlx.DragControl._preStartFalse);a.cancelBubble=true;return false},_preStartFalse:function(a){dhtmlx.DragControl._dhx_drag_mm=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mm);dhtmlx.DragControl._dhx_drag_mu=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mu);dhtmlx.DragControl._dhx_drag_sc=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_sc)},_startDrag:function(a){var c={x:a.pageX,y:a.pageY};if(Math.abs(c.x-dhtmlx.DragControl._start_pos.x)<5&&Math.abs(c.y-dhtmlx.DragControl._start_pos.y)<5){return}dhtmlx.DragControl._preStartFalse();if(!dhtmlx.DragControl.createDrag(a)){return}dhtmlx.DragControl.sendSignal("start");dhtmlx.DragControl._dhx_drag_mm=dhtmlx.event(document.body,"mousemove",dhtmlx.DragControl._moveDrag);dhtmlx.DragControl._dhx_drag_mu=dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl._stopDrag);dhtmlx.DragControl._moveDrag(a)},_stopDrag:function(a){dhtmlx.DragControl._dhx_drag_mm=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mm);dhtmlx.DragControl._dhx_drag_mu=dhtmlx.eventRemove(dhtmlx.DragControl._dhx_drag_mu);if(dhtmlx.DragControl._last){dhtmlx.DragControl.onDrop(dhtmlx.DragControl._active,dhtmlx.DragControl._last,this._landing,a);dhtmlx.DragControl.onDragOut(dhtmlx.DragControl._active,dhtmlx.DragControl._last,null,a)}dhtmlx.DragControl.destroyDrag();dhtmlx.DragControl.sendSignal("stop")},_moveDrag:function(a){var c=dhtmlx.html.pos(a);dhtmlx.DragControl._html.style.top=c.y+dhtmlx.DragControl.top+"px";dhtmlx.DragControl._html.style.left=c.x+dhtmlx.DragControl.left+"px";if(dhtmlx.DragControl._skip){dhtmlx.DragControl._skip=false}else{dhtmlx.DragControl._checkLand((a.srcElement||a.target),a)}a.cancelBubble=true;return false},_checkLand:function(a,c){while(a&&a.tagName!="BODY"){if(a.dhx_drop){if(this._last&&(this._last!=a||a.dhx_master)){this.onDragOut(this._active,this._last,a,c)}if(!this._last||this._last!=a||a.dhx_master){this._last=null;this._landing=this.onDragIn(dhtmlx.DragControl._active,a,c);if(this._landing){this._last=a}return}return}a=a.parentNode}if(this._last){this._last=this._landing=this.onDragOut(this._active,this._last,null,c)}},sendSignal:function(a){dhtmlx.DragControl.active=(a=="start")},getMaster:function(a){return this._drag_masters[a.dhx_drag||a.dhx_drop]},getContext:function(a){return this._drag_context},createDrag:function(l){var g=dhtmlx.DragControl._active;var h=this._drag_masters[g.dhx_drag];var c;if(h.onDragCreate){c=h.onDragCreate(g,l);c.style.position="absolute";c.style.zIndex=dhtmlx.zIndex.drag;c.onmousemove=dhtmlx.DragControl._skip_mark}else{var m=dhtmlx.DragControl.onDrag(g,l);if(!m){return false}var c=document.createElement("DIV");c.innerHTML=m;c.className="dhx_drag_zone";c.onmousemove=dhtmlx.DragControl._skip_mark;document.body.appendChild(c)}dhtmlx.DragControl._html=c;return true},_skip_mark:function(){dhtmlx.DragControl._skip=true},destroyDrag:function(){var c=dhtmlx.DragControl._active;var e=this._drag_masters[c.dhx_drag];if(e&&e.onDragDestroy){e.onDragDestroy(c,dhtmlx.DragControl._html)}else{dhtmlx.html.remove(dhtmlx.DragControl._html)}dhtmlx.DragControl._landing=dhtmlx.DragControl._active=dhtmlx.DragControl._last=dhtmlx.DragControl._html=null},top:5,left:5,onDragIn:function(g,c,h){var a=this._drag_masters[c.dhx_drop];if(a.onDragIn&&a!=this){return a.onDragIn(g,c,h)}c.className=c.className+" dhx_drop_zone";return c},onDragOut:function(g,c,l,h){var a=this._drag_masters[c.dhx_drop];if(a.onDragOut&&a!=this){return a.onDragOut(g,c,l,h)}c.className=c.className.replace("dhx_drop_zone","");return null},onDrop:function(g,c,l,h){var a=this._drag_masters[c.dhx_drop];dhtmlx.DragControl._drag_context.from=dhtmlx.DragControl.getMaster(g);if(a.onDrop&&a!=this){return a.onDrop(g,c,l,h)}c.appendChild(g)},onDrag:function(c,g){var a=this._drag_masters[c.dhx_drag];if(a.onDrag&&a!=this){return a.onDrag(c,g)}dhtmlx.DragControl._drag_context={source:c,from:c};return"<div style='"+c.style.cssText+"'>"+c.innerHTML+"</div>"}};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(e,g,c){if(e==13&&!c){this.stopEdit()}else{if(e==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(e,h){if(!this._edit_id){return true}if(this._edit_id==h){return false}var a={};if(!e){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(!e){this._edit_bind(false,c)}var g=this._edit_id;this._edit_bind=this._edit_id=null;this.data.refresh(g);this.callEvent("onAfterEditStop",[g,a]);return true},_save_binding:function(n){var a=this._locateHTML(n);var e="";var l="";var h=[];if(a){var g=a.getElementsByTagName("*");var m="";for(var c=0;c<g.length;c++){if(g[c].nodeType==1&&(m=g[c].getAttribute("bind"))){e+="els["+h.length+"].value="+m+";";l+=m+"=els["+h.length+"].value;";h.push(g[c]);g[c].className+=" dhx_allow_selection";g[c].onselectstart=this._block_native}}g=null}e=Function("obj","els",e);l=Function("obj","els",l);this._edit_bind=function(q,o){if(q){e(o,h);if(h.length&&h[0].select){h[0].select()}}else{l(o,h)}}},_block_native:function(a){(a||event).cancelBubble=true;return true}};dhtmlx.SelectionModel={_init:function(){this._selected=dhtmlx.toArray();dhtmlx.assert(this.data,"SelectionModel :: Component doesn't have DataStore");this.data.attachEvent("onStoreUpdated",dhtmlx.bind(this._data_updated,this));this.data.attachEvent("onStoreLoad",dhtmlx.bind(this._data_loaded,this));this.data.attachEvent("onAfterFilter",dhtmlx.bind(this._data_filtered,this));this.data.attachEvent("onIdChange",dhtmlx.bind(this._id_changed,this))},_id_changed:function(e,a){for(var c=this._selected.length-1;c>=0;c--){if(this._selected[c]==e){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 e=this._selected[a]}var c=this.item(e);if(c){delete c.$selected}this._selected.splice(a,1);this.callEvent("onSelectChange",[e])}},_data_updated:function(e,c,a){if(a=="delete"){this._selected.remove(e)}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(e,c,a){if(!a&&!this.callEvent("onBeforeSelect",[e,c])){return false}this.data.item(e).$selected=c;if(a){a.push(e)}else{if(c){this._selected.push(e)}else{this._selected.remove(e)}this._refresh_selection(e)}return true},select:function(g,e,a){if(!g){return this.selectAll()}if(g instanceof Array){for(var c=0;c<g.length;c++){this.select(g[c],e,a)}return}if(!this.data.exists(g)){dhtmlx.error("Incorrect id in select command: "+g);return}if(a&&this._selected.length){return this.selectAll(this._selected[this._selected.length-1],g)}if(!e&&(this._selected.length!=1||this._selected[0]!=g)){this._silent_selection=true;this.unselectAll();this._silent_selection=false}if(this.isSelected(g)){if(e){this.unselect(g)}return}if(this._select_mark(g,true)){this.callEvent("onAfterSelect",[g])}},unselect:function(a){if(!a){return this.unselectAll()}if(!this.isSelected(a)){return}this._select_mark(a,false)},selectAll:function(g,e){var a;var c=[];if(g||e){a=this.data.getRange(g||null,e||null)}else{a=this.data.getRange()}a.each(function(h){var l=this.data.item(h.id);if(!l.$selected){this._selected.push(h.id);this._select_mark(h.id,true,c)}return h.id},this);this._refresh_selection(c)},unselectAll:function(){var a=[];this._selected.each(function(c){this._select_mark(c,false,a)},this);this._selected=dhtmlx.toArray();this._refresh_selection(a)},isSelected:function(a){return this._selected.find(a)!=-1},getSelected:function(a){switch(this._selected.length){case 0:return a?[]:"";case 1:return a?[this._selected[0]]:this._selected[0];default:return([].concat(this._selected))}},_is_mass_selection:function(a){return a.length>100||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;a<c.length;a++){this.render(c[a],this.data.item(c[a]),"update")}}if(!this._silent_selection){this.callEvent("onSelectChange",[c])}}};dhtmlx.RenderStack={_init:function(){dhtmlx.assert(this.data,"RenderStack :: Component doesn't have DataStore");dhtmlx.assert(dhtmlx.Template,"dhtmlx.Template :: dhtmlx.Template is not accessible");this._html=document.createElement("DIV")},_toHTML:function(a){dhtmlx.assert((!a.$template||this.type["template_"+a.$template]),"RenderStack :: Unknown template: "+a.$template);this.callEvent("onItemRender",[a]);return this.type._item_start(a,this.type)+(a.$template?this.type["template_"+a.$template]:this.type.template)(a,this.type)+this.type._item_end},_toHTMLObject:function(a){this._html.innerHTML=this._toHTML(a);return this._html.firstChild},_locateHTML:function(a){if(this._htmlmap){return this._htmlmap[a]}this._htmlmap={};var e=this._dataobj.childNodes;for(var c=0;c<e.length;c++){var g=e[c].getAttribute(this._id);if(g){this._htmlmap[g]=e[c]}}return this._locateHTML(a)},locate:function(a){return dhtmlx.html.locate(a,this._id)},show:function(c){var a=this._locateHTML(c);if(a){this._dataobj.scrollTop=a.offsetTop-this._dataobj.offsetTop}},render:function(l,g,e,h){if(l){var a=this._locateHTML(l);switch(e){case"update":if(!a){return}var c=this._htmlmap[l]=this._toHTMLObject(g);dhtmlx.html.insertBefore(c,a);dhtmlx.html.remove(a);break;case"delete":if(!a){return}dhtmlx.html.remove(a);delete this._htmlmap[l];break;case"add":var c=this._htmlmap[l]=this._toHTMLObject(g);dhtmlx.html.insertBefore(c,this._locateHTML(this.data.next(l)),this._dataobj);break;case"move":this.render(l,g,"delete");this.render(l,g,"add");break;default:dhtmlx.error("Unknown render command: "+e);break}}else{if(this.callEvent("onBeforeRender",[this.data])){this._dataobj.innerHTML=this.data.getRange().map(this._toHTML,this).join("");this._htmlmap=null}}this.callEvent("onAfterRender",[])},pager_setter:function(c){this.attachEvent("onBeforeRender",function(){var g=this._settings.pager._settings;if(g.page==-1){return false}this.data.min=g.page*g.size;this.data.max=(g.page+1)*g.size-1;return true});var a=new dhtmlx.ui.pager(c);var e=dhtmlx.bind(function(){this.data.refresh()},this);a.attachEvent("onRefresh",e);this.data.attachEvent("onStoreUpdated",function(h){var g=this.dataCount();if(g!=a._settings.count){a._settings.count=g;if(a._settings.page==-1){a._settings.page=0}a.refresh()}});return a},height_setter:function(a){if(a=="auto"){this.attachEvent("onAfterRender",this._correct_height);dhtmlx.event(window,"resize",dhtmlx.bind(this._correct_height,this))}return a},_correct_height:function(){this._dataobj.style.overflow="hidden";this._dataobj.style.height="1px";var a=this._dataobj.scrollHeight;this._dataobj.style.height=a+"px";if(dhtmlx._isFF){var c=this._dataobj.scrollHeight;if(c!=a){this._dataobj.style.height=c+"px"}}this._obj.style.height=this._dataobj.style.height},_getDimension:function(){var a=this.type;var c=(a.border||0)+(a.padding||0)*2+(a.margin||0)*2;return{x:a.width+c,y:a.height+c}},x_count_setter:function(c){var e=this._getDimension();var a=dhtmlx.$customScroll?0:18;this._dataobj.style.width=e.x*c+(this._settings.height!="auto"?a:0)+"px";return c},y_count_setter:function(a){var c=this._getDimension();this._dataobj.style.height=c.y*a+"px";return a}};dhtmlx.VirtualRenderStack={_init:function(){dhtmlx.assert(this.render,"VirtualRenderStack :: Object must use RenderStack first");this._htmlmap={};this._dataobj.style.overflowY="scroll";dhtmlx.event(this._dataobj,"scroll",dhtmlx.bind(this._render_visible_rows,this));dhtmlx.event(window,"resize",dhtmlx.bind(function(){this.render()},this));this.data._unrendered_area=[];this.data.getIndexRange=this._getIndexRange},_locateHTML:function(a){return this._htmlmap[a]},show:function(e){range=this._getVisibleRange();var c=this.data.indexById(e);var a=Math.floor(c/range._dx)*range._y;this._dataobj.scrollTop=a},_getIndexRange:function(h,g){if(g!==0){g=Math.min((g||Infinity),this.dataCount()-1)}var a=dhtmlx.toArray();for(var c=(h||0);c<=g;c++){var e=this.item(this.order[c]);if(this.order.length>c){if(!e){this.order[c]=dhtmlx.uid();e={id:this.order[c],$template:"loading"};this._unrendered_area.push(this.order[c])}else{if(e.$template=="loading"){this._unrendered_area.push(this.order[c])}}a.push(e)}}return a},render:function(l,g,e,h){if(l){var a=this._locateHTML(l);switch(e){case"update":if(!a){return}var c=this._htmlmap[l]=this._toHTMLObject(g);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.className="dhxdataview_placeholder";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;v<n.length;v++){this._htmlmap[this.data.idByIndex(g+v)]=r.childNodes[v]}var w=parseInt(a.style.height,10);var D=(l-o)*y._y;var u=(w-D-y._y);dhtmlx.html.insertBefore(r,D?a.nextSibling:a,this._dataobj);this._htmlrows[l]=r;r._filled=true;if(D<=0&&u>0){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 m=this._dataobj.scrollTop;var a=Math.max(this._dataobj.scrollWidth,this._dataobj.offsetWidth)-c;var n=this._dataobj.offsetHeight;var q=this.type;var g=this._getDimension();var r=Math.floor(a/g.x)||1;var e=Math.floor(m/g.y);var o=Math.ceil((n+m)/g.y)-1;var h=this.data.max?(this.data.max-this.data.min):this.data.dataCount();var l=Math.ceil(h/r)*g.y;return{_from:e,_height:o,_top:m,_max:l,_y:g.y,_dx:r}}};dhtmlXDataView=function(a){this.name="DataView";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(e,h){var g=this._locateHTML(e.target);if(this.type.drag_marker){if(this._drag_marker){this._drag_marker.style.backgroundImage="";this._drag_marker.style.backgroundRepeat=""}if(g){g.style.backgroundImage="url("+(dhtmlx.image_path||"")+this.type.drag_marker+")";g.style.backgroundRepeat="no-repeat";this._drag_marker=g}}if(g&&this._settings.auto_scroll){var a=g.offsetTop;var l=g.offsetHeight;var c=this._obj.scrollTop;var m=this._obj.offsetHeight;if(a-l>=0&&a-l*0.75<c){c=Math.max(a-l,0)}else{if(a+l/0.75>c+m){c=c+l}}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("<div style='padding:10px; white-space:nowrap; overflow:hidden;'>{obj.text}</div>"),template_edit:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'><textarea style='width:100%; height:100%;' bind='obj.text'></textarea></div>"),template_loading:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'>Loading...</div>"),width:210,height:115,margin:0,padding:10,border:1}},template_item_start:dhtmlx.Template.fromHTML("<div dhx_f_id='{-obj.id}' class='dhx_dataview_item dhx_dataview_{obj.css}_item{-obj.$selected?_selected:}' style='width:{obj.width}px; height:{obj.height}px; padding:{obj.padding}px; margin:{obj.margin}px; float:left; overflow:hidden;'>"),template_item_end:dhtmlx.Template.fromHTML("</div>")};dhtmlx.compat("layout");if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachDataView=function(a){this.callEvent("_onBeforeContentAttach",["dataview"]);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}}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(g,m,l,h){var e=this.d.childNodes;var n=new xmlPointer();if(e.length){for(h=h||0;h<e.length;h++){if(e[h].tagName==g){n.d=e[h];if(m.apply(l,[n,h])==-1){return}}}}},get_all:function(){var e={};var c=this.d.attributes;for(var g=0;g<c.length;g++){e[c[g].name]=c[g].value}return e},sub:function(g){var e=this.d.childNodes;var l=new xmlPointer();if(e.length){for(var h=0;h<e.length;h++){if(e[h].tagName==g){l.d=e[h];return l}}}},up:function(a){return new xmlPointer(this.d.parentNode)},set:function(a,c){this.d.setAttribute(a,c)},clone:function(a){return new xmlPointer(this.d)},sub_exists:function(e){var c=this.d.childNodes;if(c.length){for(var g=0;g<c.length;g++){if(c[g].tagName==e){return true}}}return false},through:function(e,m,q,h,r){var n=this.d.childNodes;if(n.length){for(var g=0;g<n.length;g++){if(n[g].tagName==e&&n[g].getAttribute(m)!=null&&n[g].getAttribute(m)!=""&&(!q||n[g].getAttribute(m)==q)){var l=new xmlPointer(n[g]);h.apply(r,[l,g])}var o=this.d;this.d=n[g];this.through(e,m,q,h,r);this.d=o}}}};function dhtmlXTreeObject(m,h,c,a){if(dhtmlxEvent.initTouch){dhtmlxEvent.initTouch()}if(_isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(l){}}if(typeof(m)!="object"){this.parentObject=document.getElementById(m)}else{this.parentObject=m}this.parentObject.style.overflow="hidden";this._itim_dg=true;this.dlmtr=",";this.dropLower=false;this.enableIEImageFix(true);this.xmlstate=0;this.mytype="tree";this.smcheck=true;this.width=h;this.height=c;this.rootId=a;this.childCalc=null;this.def_img_x="18px";this.def_img_y="18px";this.def_line_img_x="18px";this.def_line_img_y="24px";this._dragged=new Array();this._selected=new Array();this.style_pointer="pointer";this._aimgs=true;this.htmlcA=" [";this.htmlcB="]";this.lWin=window;this.cMenu=0;this.mlitems=0;this.iconURL="";this.dadmode=0;this.slowParse=false;this.autoScroll=true;this.hfMode=0;this.nodeCut=new Array();this.XMLsource=0;this.XMLloadingWarning=0;this._idpull={};this._pullSize=0;this.treeLinesOn=true;this.tscheck=false;this.timgen=true;this.dpcpy=false;this._ld_id=null;this._oie_onXLE=[];this.imPath=window.dhx_globalImgPath||"";this.checkArray=new Array("iconUncheckAll.gif","iconCheckAll.gif","iconCheckGray.gif","iconUncheckDis.gif","iconCheckDis.gif","iconCheckDis.gif");this.radioArray=new Array("radio_off.gif","radio_on.gif","radio_on.gif","radio_off.gif","radio_on.gif","radio_on.gif");this.lineArray=new Array("line2.gif","line3.gif","line4.gif","blank.gif","blank.gif","line1.gif");this.minusArray=new Array("minus2.gif","minus3.gif","minus4.gif","minus.gif","minus5.gif");this.plusArray=new Array("plus2.gif","plus3.gif","plus4.gif","plus.gif","plus5.gif");this.imageArray=new Array("leaf.gif","folderOpen.gif","folderClosed.gif");this.cutImg=new Array(0,0,0);this.cutImage="but_cut.gif";dhx4._eventable(this);this.dragger=new dhtmlDragAndDropObject();this.htmlNode=new dhtmlXTreeItemObject(this.rootId,"",0,this);this.htmlNode.htmlNode.childNodes[0].childNodes[0].style.display="none";this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[0].className="hiddenRow";this.allTree=this._createSelf();this.allTree.appendChild(this.htmlNode.htmlNode);if(dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(this)}if(_isFF){this.allTree.childNodes[0].width="100%";this.allTree.childNodes[0].style.overflow="hidden"}var g=this;this.allTree.onselectstart=new Function("return false;");if(_isMacOS){this.allTree.oncontextmenu=function(n){return g._doContClick(n||window.event,true)}}this.allTree.onmousedown=function(n){return g._doContClick(n||window.event)};this.XMLLoader=this._parseXMLTree;if(_isIE){this.preventIECashing(true)}this.selectionBar=document.createElement("DIV");this.selectionBar.className="selectionBar";this.selectionBar.innerHTML="&nbsp;";this.selectionBar.style.display="none";this.allTree.appendChild(this.selectionBar);if(window.addEventListener){window.addEventListener("unload",function(){try{g.destructor()}catch(n){}},false)}if(window.attachEvent){window.attachEvent("onunload",function(){try{g.destructor()}catch(n){}})}this.setImagesPath=this.setImagePath;this.setIconsPath=this.setIconPath;if(dhtmlx.image_path){this.setImagePath(dhtmlx.image_path)}this.setSkin(window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxtree")||"dhx_skyblue");return this}dhtmlXTreeObject.prototype.setDataMode=function(a){this._datamode=a};dhtmlXTreeObject.prototype._doContClick=function(m,a){if(!a&&m.button!=2){if(this._acMenu){if(this._acMenu.hideContextMenu){this._acMenu.hideContextMenu()}else{this.cMenu._contextEnd()}}return true}var c=(_isIE?m.srcElement:m.target);while((c)&&(c.tagName!="BODY")){if(c.parentObject){break}c=c.parentNode}if((!c)||(!c.parentObject)){return true}var h=c.parentObject;if(!this.callEvent("onRightClick",[h.id,m])){(m.srcElement||m.target).oncontextmenu=function(q){(q||event).cancelBubble=true;return false}}this._acMenu=(h.cMenu||this.cMenu);if(this._acMenu){if(!(this.callEvent("onBeforeContextMenu",[h.id]))){return true}if(!_isMacOS){(m.srcElement||m.target).oncontextmenu=function(q){(q||event).cancelBubble=true;return false}}if(this._acMenu.showContextMenu){var g=window.document.documentElement;var e=window.document.body;var n=new Array((g.scrollLeft||e.scrollLeft),(g.scrollTop||e.scrollTop));if(_isIE){var o=m.clientX+n[0];var l=m.clientY+n[1]}else{var o=m.pageX;var l=m.pageY}this._acMenu.showContextMenu(o-1,l-1);this.contextID=h.id;m.cancelBubble=true;this._acMenu._skip_hide=true}else{c.contextMenuId=h.id;c.contextMenu=this._acMenu;c.a=this._acMenu._contextStart;c.a(c,m);c.a=null}return false}return true};dhtmlXTreeObject.prototype.enableIEImageFix=function(a){if(!a){this._getImg=function(c){return document.createElement((c==this.rootId)?"div":"img")};this._setSrc=function(e,c){e.src=c};this._getSrc=function(c){return c.src}}else{this._getImg=function(){var c=document.createElement("DIV");c.innerHTML="&nbsp;";c.className="dhx_bg_img_fix";return c};this._setSrc=function(e,c){e.style.backgroundImage="url("+c+")"};this._getSrc=function(c){var e=c.style.backgroundImage;return e.substr(4,e.length-5).replace(/(^")|("$)/g,"")}}};dhtmlXTreeObject.prototype.destructor=function(){for(var c in this._idpull){var e=this._idpull[c];if(!e){continue}e.parentObject=null;e.treeNod=null;e.childNodes=null;e.span=null;e.tr.nodem=null;e.tr=null;e.htmlNode.objBelong=null;e.htmlNode=null;this._idpull[c]=null}this.parentObject.innerHTML="";this.allTree.onselectstart=null;this.allTree.oncontextmenu=null;this.allTree.onmousedown=null;for(var c in this){this[c]=null}};function cObject(){return this}cObject.prototype=new Object;cObject.prototype.clone=function(){function a(){}a.prototype=this;return new a()};function dhtmlXTreeItemObject(l,c,e,a,g,h){this.htmlNode="";this.acolor="";this.scolor="";this.tr=0;this.childsCount=0;this.tempDOMM=0;this.tempDOMU=0;this.dragSpan=0;this.dragMove=0;this.span=0;this.closeble=1;this.childNodes=new Array();this.userData=new cObject();this.checkstate=0;this.treeNod=a;this.label=c;this.parentObject=e;this.actionHandler=g;this.images=new Array(a.imageArray[0],a.imageArray[1],a.imageArray[2]);this.id=a._globalIdStorageAdd(l,this);if(this.treeNod.checkBoxOff){this.htmlNode=this.treeNod._createItem(1,this,h)}else{this.htmlNode=this.treeNod._createItem(0,this,h)}this.htmlNode.objBelong=this;return this}dhtmlXTreeObject.prototype._globalIdStorageAdd=function(c,a){if(this._globalIdStorageFind(c,1,1)){c=c+"_"+(new Date()).valueOf();return this._globalIdStorageAdd(c,a)}this._idpull[c]=a;this._pullSize++;return c};dhtmlXTreeObject.prototype._globalIdStorageSub=function(a){if(this._idpull[a]){this._unselectItem(this._idpull[a]);this._idpull[a]=null;this._pullSize--}if((this._locker)&&(this._locker[a])){this._locker[a]=false}};dhtmlXTreeObject.prototype._globalIdStorageFind=function(l,a,e,g){var h=this._idpull[l];if(h){if((h.unParsed)&&(!e)){this.reParse(h,0)}if(this._srnd&&!h.htmlNode){this._buildSRND(h,e)}if((g)&&(this._edsbpsA)){for(var c=0;c<this._edsbpsA.length;c++){if(this._edsbpsA[c][2]==l){dhx4.callEvent("ongetItemError",["Requested item still in parsing process.",l]);return null}}}return h}if((this.slowParse)&&(l!=0)&&(!a)){return this.preParse(l)}else{return null}};dhtmlXTreeObject.prototype._getSubItemsXML=function(a){var c=[];a.each("item",function(e){c.push(e.get("id"))},this);return c.join(this.dlmtr)};dhtmlXTreeObject.prototype.enableSmartXMLParsing=function(a){this.slowParse=dhx4.s2b(a)};dhtmlXTreeObject.prototype.findXML=function(c,a,e){};dhtmlXTreeObject.prototype._getAllCheckedXML=function(c,a,g){var e=[];if(g==2){c.through("item","checked",-1,function(h){e.push(h.get("id"))},this)}if(g==1){c.through("item","id",null,function(h){if(h.get("checked")&&(h.get("checked")!=-1)){e.push(h.get("id"))}},this)}if(g==0){c.through("item","id",null,function(h){if(!h.get("checked")||h.get("checked")==0){e.push(h.get("id"))}},this)}if(e.length){return a+(a?this.dlmtr:"")+e.join(this.dlmtr)}if(a){return a}else{return""}};dhtmlXTreeObject.prototype._setSubCheckedXML=function(a,c){var e=a?"1":"";c.through("item","id",null,function(g){if(!g.get("disabled")||g.get("disabled")==0){g.set("checked",e)}},this)};dhtmlXTreeObject.prototype._getAllScraggyItemsXML=function(e,a){var g=[];var c=function(h){if(!h.sub_exists("item")){g.push(h.get("id"))}else{h.each("item",c,this)}};c(e);return g.join(",")};dhtmlXTreeObject.prototype._getAllFatItemsXML=function(e,a){var g=[];var c=function(h){if(!h.sub_exists("item")){return}g.push(h.get("id"));h.each("item",c,this)};c(e);return g.join(",")};dhtmlXTreeObject.prototype._getAllSubItemsXML=function(e,c,a){var c=[];a.through("item","id",null,function(g){c.push(g.get("id"))},this);return c.join(",")};dhtmlXTreeObject.prototype.reParse=function(e){var l=this;if(!this.parsCount){l.callEvent("onXLS",[l,e.id])}this.xmlstate=1;var g=e.unParsed;e.unParsed=0;this.XMLloadingWarning=1;var a=this.parsingOn;var m=this.waitUpdateXML;var o=this.parsedArray;this.parsedArray=new Array();this.waitUpdateXML=false;this.parsingOn=e.id;this.parsedArray=new Array();this.setCheckList="";this._parse(g,e.id,2);var q=this.setCheckList.split(this.dlmtr);for(var h=0;h<this.parsedArray.length;h++){e.htmlNode.childNodes[0].appendChild(this.parsedArray[h])}if(g.get("order")&&g.get("order")!="none"){this._reorderBranch(e,g.get("order"),true)}this.oldsmcheck=this.smcheck;this.smcheck=false;for(var c=0;c<q.length;c++){if(q[c]){this.setCheck(q[c],1)}}this.smcheck=this.oldsmcheck;this.parsingOn=a;this.waitUpdateXML=m;this.parsedArray=o;this.XMLloadingWarning=0;this._redrawFrom(this,e);if(this._srnd&&!e._sready){this.prepareSR(e.id)}this.xmlstate=0;return true};dhtmlXTreeObject.prototype.preParse=function(c){if(!c||!this._p){return null}var a=false;this._p.clone().through("item","id",c,function(g){this._globalIdStorageFind(g.up().get("id"));return a=true},this);if(a){var e=this._globalIdStorageFind(c,true,false);if(!e){dhx4.callEvent("ongetItemError",["The item "+c+" not operable. Seems you have non-unique|incorrect IDs in tree's XML.",c])}}return e};dhtmlXTreeObject.prototype._escape=function(a){switch(this.utfesc){case"none":return a;break;case"utf8":return encodeURIComponent(a);break;default:return escape(a);break}};dhtmlXTreeObject.prototype._drawNewTr=function(h,e){var g=document.createElement("tr");var c=document.createElement("td");var a=document.createElement("td");c.appendChild(document.createTextNode(" "));a.colSpan=3;a.appendChild(h);g.appendChild(c);g.appendChild(a);return g};dhtmlXTreeObject.prototype.loadXMLString=dhtmlXTreeObject.prototype.parse=function(g,e,a){if(typeof e=="string"){a=e;e=null}if(a==="json"){return this.loadJSONObject(g,e)}else{if(a==="csv"){return this.loadCSVString(g,e)}}var c=this;if(!this.parsCount){this.callEvent("onXLS",[c,null])}this.xmlstate=1;this.XMLLoader({responseXML:dhx4.ajax.parse(g)},e)};dhtmlXTreeObject.prototype.loadXML=dhtmlXTreeObject.prototype.load=function(c,h,e){if(typeof h=="string"){e=h;h=null}if(e==="json"){return this.loadJSON(c,h)}else{if(e==="csv"){return this.loadCSV(c,h)}}if(this._datamode&&this._datamode!="xml"){return this["load"+this._datamode.toUpperCase()](c,h)}var g=this;if(!this.parsCount){this.callEvent("onXLS",[g,this._ld_id])}this._ld_id=null;this.xmlstate=1;this.XMLLoader=this._parseXMLTree;var a=this;dhx4.ajax.get(c,function(l){a.XMLLoader(l.xmlDoc,h);a=null})};dhtmlXTreeObject.prototype._attachChildNode=function(m,l,g,o,D,C,A,q,e,u,v){if(u&&u.parentObject){m=u.parentObject}if(((m.XMLload==0)&&(this.XMLsource))&&(!this.XMLloadingWarning)){m.XMLload=1;this._loadDynXML(m.id)}var r=m.childsCount;var E=m.childNodes;if(v&&v.tr.previousSibling){if(v.tr.previousSibling.previousSibling){u=v.tr.previousSibling.nodem}else{q=q.replace("TOP","")+",TOP"}}if(u){var h,y;for(h=0;h<r;h++){if(E[h]==u){for(y=r;y!=h;y--){E[1+y]=E[y]}break}}h++;r=h}if(q){var w=q.split(",");for(var x=0;x<w.length;x++){switch(w[x]){case"TOP":if(m.childsCount>0){u=new Object;u.tr=m.childNodes[0].tr.previousSibling}m._has_top=true;for(h=r;h>0;h--){E[h]=E[h-1]}r=0;break}}}var s;if(!(s=this._idpull[l])||s.span!=-1){s=E[r]=new dhtmlXTreeItemObject(l,g,m,this,o,1);l=E[r].id;m.childsCount++}if(!s.htmlNode){s.label=g;s.htmlNode=this._createItem((this.checkBoxOff?1:0),s);s.htmlNode.objBelong=s}if(D){s.images[0]=D}if(C){s.images[1]=C}if(A){s.images[2]=A}var c=this._drawNewTr(s.htmlNode);if((this.XMLloadingWarning)||(this._hAdI)){s.htmlNode.parentNode.parentNode.style.display="none"}if((u)&&u.tr&&(u.tr.nextSibling)){m.htmlNode.childNodes[0].insertBefore(c,u.tr.nextSibling)}else{if(this.parsingOn==m.id){this.parsedArray[this.parsedArray.length]=c}else{m.htmlNode.childNodes[0].appendChild(c)}}if((u)&&(!u.span)){u=null}if(this.XMLsource){if((e)&&(e!=0)){s.XMLload=0}else{s.XMLload=1}}s.tr=c;c.nodem=s;if(m.itemId==0){c.childNodes[0].className="hiddenRow"}if((m._r_logic)||(this._frbtr)){this._setSrc(s.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.imPath+this.radioArray[0])}if(q){var w=q.split(",");for(var x=0;x<w.length;x++){switch(w[x]){case"SELECT":this.selectItem(l,false);break;case"CALL":this.selectItem(l,true);break;case"CHILD":s.XMLload=0;break;case"CHECKED":if(this.XMLloadingWarning){this.setCheckList+=this.dlmtr+l}else{this.setCheck(l,1)}break;case"HCHECKED":this._setCheck(s,"unsure");break;case"OPEN":s.openMe=1;break}}}if(!this.XMLloadingWarning){if((this._getOpenState(m)<0)&&(!this._hAdI)){this.openItem(m.id)}if(u){this._correctPlus(u);this._correctLine(u)}this._correctPlus(m);this._correctLine(m);this._correctPlus(s);if(m.childsCount>=2){this._correctPlus(E[m.childsCount-2]);this._correctLine(E[m.childsCount-2])}if(m.childsCount!=2){this._correctPlus(E[0])}if(this.tscheck){this._correctCheckStates(m)}if(this._onradh){if(this.xmlstate==1){var a=this.onXLE;this.onXLE=function(n){this._onradh(l);if(a){a(n)}}}else{this._onradh(l)}}}return s};dhtmlXTreeObject.prototype.enableContextMenu=function(a){if(a){this.cMenu=a}};dhtmlXTreeObject.prototype.setItemContextMenu=function(h,g){var a=h.toString().split(this.dlmtr);for(var e=0;e<a.length;e++){var c=this._globalIdStorageFind(a[e]);if(!c){continue}c.cMenu=g}};dhtmlXTreeObject.prototype.insertNewItem=function(g,n,q,e,m,l,h,c,a){var r=this._globalIdStorageFind(g);if(!r){return(-1)}var o=this._attachChildNode(r,n,q,e,m,l,h,c,a);if(!this._idpull[this.rootId].XMLload){this._idpull[this.rootId].XMLload=1}if((!this.XMLloadingWarning)&&(this.childCalc)){this._fixChildCountLabel(r)}return o};dhtmlXTreeObject.prototype.insertNewChild=function(g,n,o,e,m,l,h,c,a){return this.insertNewItem(g,n,o,e,m,l,h,c,a)};dhtmlXTreeObject.prototype._parseXMLTree=function(a,e){var c=new xmlPointer(dhx4.ajax.xmltop("tree",a));this._parse(c);this._p=c;if(e){e.call(this,a)}};dhtmlXTreeObject.prototype._parseItem=function(l,q,h,n){var e;if(this._srnd&&(!this._idpull[e=l.get("id")]||!this._idpull[e].span)){this._addItemSRND(q.id,e,l);return}var m=l.get_all();if((typeof(this.waitUpdateXML)=="object")&&(!this.waitUpdateXML[m.id])){this._parse(l,m.id,1);return}if((m.text===null)||(typeof(m.text)=="undefined")){m.text=l.sub("itemtext");if(m.text){m.text=m.text.content()}}var s=[];if(m.select){s.push("SELECT")}if(m.top){s.push("TOP")}if(m.call){this.nodeAskingCall=m.id}if(m.checked==-1){s.push("HCHECKED")}else{if(m.checked){s.push("CHECKED")}}if(m.open){s.push("OPEN")}if(this.waitUpdateXML){if(this._globalIdStorageFind(m.id)){var o=this.updateItem(m.id,m.text,m.im0,m.im1,m.im2,m.checked,m.child)}else{if(this.npl==0){s.push("TOP")}else{h=q.childNodes[this.npl]}var o=this._attachChildNode(q,m.id,m.text,0,m.im0,m.im1,m.im2,s.join(","),m.child,0,h);m.id=o.id;h=null}}else{var o=this._attachChildNode(q,m.id,m.text,0,m.im0,m.im1,m.im2,s.join(","),m.child,(n||0),h)}if(m.tooltip){o.span.parentNode.parentNode.title=m.tooltip}if(m.style){if(o.span.style.cssText){o.span.style.cssText+=(";"+m.style)}else{o.span.setAttribute("style",o.span.getAttribute("style")+"; "+m.style)}}if(m.radio){o._r_logic=true}if(m.nocheckbox){var r=o.span.parentNode.previousSibling.previousSibling;r.style.display="none";o.nocheckbox=true}if(m.disabled){if(m.checked!=null){this._setCheck(o,m.checked)}this.disableCheckbox(o,1)}o._acc=m.child||0;if(this.parserExtension){this.parserExtension._parseExtension.call(this,l,m,(q?q.id:0))}this.setItemColor(o,m.aCol,m.sCol);if(m.locked=="1"){this.lockItem(o.id,true,true)}if((m.imwidth)||(m.imheight)){this.setIconSize(m.imwidth,m.imheight,o)}if((m.closeable=="0")||(m.closeable=="1")){this.setItemCloseable(o,m.closeable)}var g="";if(m.topoffset){this.setItemTopOffset(o,m.topoffset)}if((!this.slowParse)||(typeof(this.waitUpdateXML)=="object")){if(l.sub_exists("item")){g=this._parse(l,m.id,1)}}else{if((!o.childsCount)&&l.sub_exists("item")){o.unParsed=l.clone()}l.each("userdata",function(a){this.setUserData(m.id,a.get("name"),a.content())},this)}if(g!=""){this.nodeAskingCall=g}l.each("userdata",function(a){this.setUserData(l.get("id"),a.get("name"),a.content())},this)};dhtmlXTreeObject.prototype._parse=function(e,l,a,c){if(this._srnd&&!this.parentObject.offsetHeight){var v=this;return window.setTimeout(function(){v._parse(e,l,a,c)},100)}if(!e.exists()){return}this.skipLock=true;if(!l){l=e.get("id");var s=e.get("dhx_security");if(s){dhtmlx.security_key=s}if(e.get("radio")){this.htmlNode._r_logic=true}this.parsingOn=l;this.parsedArray=new Array();this.setCheckList="";this.nodeAskingCall=""}var u=this._globalIdStorageFind(l);if(!u){return dhx4.callEvent("onDataStructureError",["XML refers to not existing parent"])}this.parsCount=this.parsCount?(this.parsCount+1):1;this.XMLloadingWarning=1;if((u.childsCount)&&(!c)&&(!this._edsbps)&&(!u._has_top)){var m=0}else{var m=0}this.npl=0;e.each("item",function(w,n){u.XMLload=1;this._parseItem(w,u,0,m);if((this._edsbps)&&(this.npl==this._edsbpsC)){this._distributedStart(e,n+1,l,a,u.childsCount);return -1}this.npl++},this,c);if(!a){e.each("userdata",function(n){this.setUserData(e.get("id"),n.get("name"),n.content())},this);u.XMLload=1;if(this.waitUpdateXML){this.waitUpdateXML=false;for(var h=u.childsCount-1;h>=0;h--){if(u.childNodes[h]._dmark){this.deleteItem(u.childNodes[h].id)}}}var q=this._globalIdStorageFind(this.parsingOn);for(var h=0;h<this.parsedArray.length;h++){u.htmlNode.childNodes[0].appendChild(this.parsedArray[h])}this.parsedArray=[];this.lastLoadedXMLId=l;this.XMLloadingWarning=0;var r=this.setCheckList.split(this.dlmtr);for(var g=0;g<r.length;g++){if(r[g]){this.setCheck(r[g],1)}}if((this.XMLsource)&&(this.tscheck)&&(this.smcheck)&&(u.id!=this.rootId)){if(u.checkstate===0){this._setSubChecked(0,u)}else{if(u.checkstate===1){this._setSubChecked(1,u)}}}this._redrawFrom(this,null,c);if(e.get("order")&&e.get("order")!="none"){this._reorderBranch(u,e.get("order"),true)}if(this.nodeAskingCall!=""){this.callEvent("onClick",[this.nodeAskingCall,this.getSelectedItemId()])}if(this._branchUpdate){this._branchUpdateNext(e)}}if(this.parsCount==1){this.parsingOn=null;if(this._srnd&&u.id!=this.rootId){this.prepareSR(u.id);if(this.XMLsource){this.openItem(u.id)}}e.through("item","open",null,function(n){this.openItem(n.get("id"))},this);if((!this._edsbps)||(!this._edsbpsA.length)){var o=this;window.setTimeout(function(){o.callEvent("onXLE",[o,l])},1);this.xmlstate=0}this.skipLock=false}this.parsCount--;var o=this;if(this._edsbps){window.setTimeout(function(){o._distributedStep(l)},this._edsbpsD)}if(!a&&this.onXLE){this.onXLE(this,l)}return this.nodeAskingCall};dhtmlXTreeObject.prototype._branchUpdateNext=function(a){a.each("item",function(g){var e=g.get("id");if(this._idpull[e]&&(!this._idpull[e].XMLload)){return}this._branchUpdate++;this.smartRefreshItem(g.get("id"),g)},this);this._branchUpdate--};dhtmlXTreeObject.prototype.checkUserData=function(c,e){if((c.nodeType==1)&&(c.tagName=="userdata")){var a=c.getAttribute("name");if((a)&&(c.childNodes[0])){this.setUserData(e,a,c.childNodes[0].data)}}};dhtmlXTreeObject.prototype._redrawFrom=function(n,c,m,e){if(!c){var h=n._globalIdStorageFind(n.lastLoadedXMLId);n.lastLoadedXMLId=-1;if(!h){return 0}}else{h=c}var l=0;for(var g=(m?m-1:0);g<h.childsCount;g++){if((!this._branchUpdate)||(this._getOpenState(h)==1)){if((!c)||(e==1)){h.childNodes[g].htmlNode.parentNode.parentNode.style.display=""}}if(h.childNodes[g].openMe==1){this._openItem(h.childNodes[g]);h.childNodes[g].openMe=0}n._redrawFrom(n,h.childNodes[g]);if(this.childCalc!=null){if((h.childNodes[g].unParsed)||((!h.childNodes[g].XMLload)&&(this.XMLsource))){if(h.childNodes[g]._acc){h.childNodes[g].span.innerHTML=h.childNodes[g].label+this.htmlcA+h.childNodes[g]._acc+this.htmlcB}else{h.childNodes[g].span.innerHTML=h.childNodes[g].label}}if((h.childNodes[g].childNodes.length)&&(this.childCalc)){if(this.childCalc==1){h.childNodes[g].span.innerHTML=h.childNodes[g].label+this.htmlcA+h.childNodes[g].childsCount+this.htmlcB}if(this.childCalc==2){var a=h.childNodes[g].childsCount-(h.childNodes[g].pureChilds||0);if(a){h.childNodes[g].span.innerHTML=h.childNodes[g].label+this.htmlcA+a+this.htmlcB}if(h.pureChilds){h.pureChilds++}else{h.pureChilds=1}}if(this.childCalc==3){h.childNodes[g].span.innerHTML=h.childNodes[g].label+this.htmlcA+h.childNodes[g]._acc+this.htmlcB}if(this.childCalc==4){var a=h.childNodes[g]._acc;if(a){h.childNodes[g].span.innerHTML=h.childNodes[g].label+this.htmlcA+a+this.htmlcB}}}else{if(this.childCalc==4){l++}}l+=h.childNodes[g]._acc;if(this.childCalc==3){l++}}}if((!h.unParsed)&&((h.XMLload)||(!this.XMLsource))){h._acc=l}n._correctLine(h);n._correctPlus(h);if((this.childCalc)&&(!c)){n._fixChildCountLabel(h)}};dhtmlXTreeObject.prototype._createSelf=function(){var a=document.createElement("div");a.className="containerTableStyle";a.style.width=this.width;a.style.height=this.height;this.parentObject.appendChild(a);return a};dhtmlXTreeObject.prototype._xcloseAll=function(c){if(c.unParsed){return}if(this.rootId!=c.id){if(!c.htmlNode){return}var g=c.htmlNode.childNodes[0].childNodes;var a=g.length;for(var e=1;e<a;e++){g[e].style.display="none"}this._correctPlus(c)}for(var e=0;e<c.childsCount;e++){if(c.childNodes[e].childsCount){this._xcloseAll(c.childNodes[e])}}};dhtmlXTreeObject.prototype._xopenAll=function(a){this._HideShow(a,2);for(var c=0;c<a.childsCount;c++){this._xopenAll(a.childNodes[c])}};dhtmlXTreeObject.prototype._correctPlus=function(c){if(!c.htmlNode){return}var e=c.htmlNode.childNodes[0].childNodes[0].childNodes[0].lastChild;var h=c.htmlNode.childNodes[0].childNodes[0].childNodes[2].childNodes[0];var a=this.lineArray;if((this.XMLsource)&&(!c.XMLload)){var a=this.plusArray;this._setSrc(h,this.iconURL+c.images[2]);if(this._txtimg){return(e.innerHTML="[+]")}}else{if((c.childsCount)||(c.unParsed)){if((c.htmlNode.childNodes[0].childNodes[1])&&(c.htmlNode.childNodes[0].childNodes[1].style.display!="none")){if(!c.wsign){var a=this.minusArray}this._setSrc(h,this.iconURL+c.images[1]);if(this._txtimg){return(e.innerHTML="[-]")}}else{if(!c.wsign){var a=this.plusArray}this._setSrc(h,this.iconURL+c.images[2]);if(this._txtimg){return(e.innerHTML="[+]")}}}else{this._setSrc(h,this.iconURL+c.images[0])}}var g=2;if(!c.treeNod.treeLinesOn){this._setSrc(e,this.imPath+a[3])}else{if(c.parentObject){g=this._getCountStatus(c.id,c.parentObject)}this._setSrc(e,this.imPath+a[g])}};dhtmlXTreeObject.prototype._correctLine=function(c){if(!c.htmlNode){return}var a=c.parentObject;if(a){if((this._getLineStatus(c.id,a)==0)||(!this.treeLinesOn)){for(var e=1;e<=c.childsCount;e++){if(!c.htmlNode.childNodes[0].childNodes[e]){break}c.htmlNode.childNodes[0].childNodes[e].childNodes[0].style.backgroundImage="";c.htmlNode.childNodes[0].childNodes[e].childNodes[0].style.backgroundRepeat=""}}else{for(var e=1;e<=c.childsCount;e++){if(!c.htmlNode.childNodes[0].childNodes[e]){break}c.htmlNode.childNodes[0].childNodes[e].childNodes[0].style.backgroundImage="url("+this.imPath+this.lineArray[5]+")";c.htmlNode.childNodes[0].childNodes[e].childNodes[0].style.backgroundRepeat="repeat-y"}}}};dhtmlXTreeObject.prototype._getCountStatus=function(c,a){if(a.childsCount<=1){if(a.id==this.rootId){return 4}else{return 0}}if(a.childNodes[0].id==c){if(a.id==this.rootId){return 2}else{return 1}}if(a.childNodes[a.childsCount-1].id==c){return 0}return 1};dhtmlXTreeObject.prototype._getLineStatus=function(c,a){if(a.childNodes[a.childsCount-1].id==c){return 0}return 1};dhtmlXTreeObject.prototype._HideShow=function(c,h){if((this.XMLsource)&&(!c.XMLload)){if(h==1){return}c.XMLload=1;this._loadDynXML(c.id);return}if(c.unParsed){this.reParse(c)}var g=c.htmlNode.childNodes[0].childNodes;var a=g.length;if(a>1){if(((g[1].style.display!="none")||(h==1))&&(h!=2)){this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0";nodestyle="none"}else{nodestyle=""}for(var e=1;e<a;e++){g[e].style.display=nodestyle}}this._correctPlus(c)};dhtmlXTreeObject.prototype._getOpenState=function(a){if(!a.htmlNode){return 0}var c=a.htmlNode.childNodes[0].childNodes;if(c.length<=1){return 0}if(c[1].style.display!="none"){return 1}else{return -1}};dhtmlXTreeObject.prototype.onRowClick2=function(){var a=this.parentObject.treeNod;if(!a.callEvent("onDblClick",[this.parentObject.id,a])){return false}if((this.parentObject.closeble)&&(this.parentObject.closeble!="0")){a._HideShow(this.parentObject)}else{a._HideShow(this.parentObject,2)}if(a.checkEvent("onOpenEnd")){if(!a.xmlstate){a.callEvent("onOpenEnd",[this.parentObject.id,a._getOpenState(this.parentObject)])}else{a._oie_onXLE.push(a.onXLE);a.onXLE=a._epnFHe}}return false};dhtmlXTreeObject.prototype.onRowClick=function(){var a=this.parentObject.treeNod;if(!a.callEvent("onOpenStart",[this.parentObject.id,a._getOpenState(this.parentObject)])){return 0}if((this.parentObject.closeble)&&(this.parentObject.closeble!="0")){a._HideShow(this.parentObject)}else{a._HideShow(this.parentObject,2)}if(a.checkEvent("onOpenEnd")){if(!a.xmlstate){a.callEvent("onOpenEnd",[this.parentObject.id,a._getOpenState(this.parentObject)])}else{a._oie_onXLE.push(a.onXLE);a.onXLE=a._epnFHe}}};dhtmlXTreeObject.prototype._epnFHe=function(c,e,a){if(e!=this.rootId){this.callEvent("onOpenEnd",[e,c.getOpenState(e)])}c.onXLE=c._oie_onXLE.pop();if(!a&&!c._oie_onXLE.length){if(c.onXLE){c.onXLE(c,e)}}};dhtmlXTreeObject.prototype.onRowClickDown=function(c){c=c||window.event;var a=this.parentObject.treeNod;a._selectItem(this.parentObject,c)};dhtmlXTreeObject.prototype.getSelectedItemId=function(){var c=new Array();for(var a=0;a<this._selected.length;a++){c[a]=this._selected[a].id}return(c.join(this.dlmtr))};dhtmlXTreeObject.prototype._selectItem=function(m,n){if(this.checkEvent("onSelect")){this._onSSCFold=this.getSelectedItemId()}if((!this._amsel)||(!n)||((!n.ctrlKey)&&(!n.metaKey)&&(!n.shiftKey))){this._unselectItems()}if((m.i_sel)&&(this._amsel)&&(n)&&(n.ctrlKey||n.metaKey)){this._unselectItem(m)}else{if((!m.i_sel)&&((!this._amselS)||(this._selected.length==0)||(this._selected[0].parentObject==m.parentObject))){if((this._amsel)&&(n)&&(n.shiftKey)&&(this._selected.length!=0)&&(this._selected[this._selected.length-1].parentObject==m.parentObject)){var h=this._getIndex(this._selected[this._selected.length-1]);var g=this._getIndex(m);if(g<h){var q=h;h=g;g=q}for(var l=h;l<=g;l++){if(!m.parentObject.childNodes[l].i_sel){this._markItem(m.parentObject.childNodes[l])}}}else{this._markItem(m)}}}if(this.checkEvent("onSelect")){var o=this.getSelectedItemId();if(o!=this._onSSCFold){this.callEvent("onSelect",[o])}}};dhtmlXTreeObject.prototype._markItem=function(a){if(a.scolor){a.span.style.color=a.scolor}a.span.className="selectedTreeRow";a.i_sel=true;this._selected[this._selected.length]=a};dhtmlXTreeObject.prototype.getIndexById=function(c){var a=this._globalIdStorageFind(c);if(!a){return null}return this._getIndex(a)};dhtmlXTreeObject.prototype._getIndex=function(a){var e=a.parentObject;for(var c=0;c<e.childsCount;c++){if(e.childNodes[c]==a){return c}}};dhtmlXTreeObject.prototype._unselectItem=function(c){if((c)&&(c.i_sel)){c.span.className="standartTreeRow";if(c.acolor){c.span.style.color=c.acolor}c.i_sel=false;for(var a=0;a<this._selected.length;a++){if(!this._selected[a].i_sel){this._selected.splice(a,1);break}}}};dhtmlXTreeObject.prototype._unselectItems=function(){for(var a=0;a<this._selected.length;a++){var c=this._selected[a];c.span.className="standartTreeRow";if(c.acolor){c.span.style.color=c.acolor}c.i_sel=false}this._selected=new Array()};dhtmlXTreeObject.prototype.onRowSelect=function(h,g,m){h=h||window.event;var c=this.parentObject;if(g){c=g.parentObject}var a=c.treeNod;var l=a.getSelectedItemId();if((!h)||(!h.skipUnSel)){a._selectItem(c,h)}if(!m){if(c.actionHandler){c.actionHandler(c.id,l)}else{a.callEvent("onClick",[c.id,l])}}};dhtmlXTreeObject.prototype._correctCheckStates=function(h){if(!this.tscheck){return}if(!h){return}if(h.id==this.rootId){return}var e=h.childNodes;var c=0;var a=0;if(h.childsCount==0){return}for(var g=0;g<h.childsCount;g++){if(e[g].dscheck){continue}if(e[g].checkstate==0){c=1}else{if(e[g].checkstate==1){a=1}else{c=1;a=1;break}}}if((c)&&(a)){this._setCheck(h,"unsure")}else{if(c){this._setCheck(h,false)}else{this._setCheck(h,true)}}this._correctCheckStates(h.parentObject)};dhtmlXTreeObject.prototype.onCheckBoxClick=function(a){if(!this.treeNod.callEvent("onBeforeCheck",[this.parentObject.id,this.parentObject.checkstate])){return}if(this.parentObject.dscheck){return true}if(this.treeNod.tscheck){if(this.parentObject.checkstate==1){this.treeNod._setSubChecked(false,this.parentObject)}else{this.treeNod._setSubChecked(true,this.parentObject)}}else{if(this.parentObject.checkstate==1){this.treeNod._setCheck(this.parentObject,false)}else{this.treeNod._setCheck(this.parentObject,true)}}this.treeNod._correctCheckStates(this.parentObject.parentObject);return this.treeNod.callEvent("onCheck",[this.parentObject.id,this.parentObject.checkstate])};dhtmlXTreeObject.prototype._createItem=function(s,r,n){var u=document.createElement("table");u.cellSpacing=0;u.cellPadding=0;u.border=0;if(this.hfMode){u.style.tableLayout="fixed"}u.style.margin=0;u.style.padding=0;var m=document.createElement("tbody");var q=document.createElement("tr");var g=document.createElement("td");g.className="standartTreeImage";if(this._txtimg){var h=document.createElement("div");g.appendChild(h);h.className="dhx_tree_textSign"}else{var h=this._getImg(r.id);h.border="0";if(h.tagName=="IMG"){h.align="absmiddle"}g.appendChild(h);h.style.padding=0;h.style.margin=0;h.style.width=this.def_line_img_x}var e=document.createElement("td");var o=this._getImg(this.cBROf?this.rootId:r.id);o.checked=0;this._setSrc(o,this.imPath+this.checkArray[0]);o.style.width="18px";o.style.height="18px";if(!s){e.style.display="none"}e.appendChild(o);if((!this.cBROf)&&(o.tagName=="IMG")){o.align="absmiddle"}o.onclick=this.onCheckBoxClick;o.treeNod=this;o.parentObject=r;if(!window._KHTMLrv){e.width="20px"}else{e.width="16px"}var c=document.createElement("td");c.className="standartTreeImage";var l=this._getImg(this.timgen?r.id:this.rootId);l.onmousedown=this._preventNsDrag;l.ondragstart=this._preventNsDrag;l.border="0";if(this._aimgs){l.parentObject=r;if(l.tagName=="IMG"){l.align="absmiddle"}l.onclick=this.onRowSelect}if(!n){this._setSrc(l,this.iconURL+this.imageArray[0])}c.appendChild(l);l.style.padding=0;l.style.margin=0;if(this.timgen){c.style.width=l.style.width=this.def_img_x;l.style.height=this.def_img_y}else{l.style.width="0px";l.style.height="0px";if(_isOpera||window._KHTMLrv){c.style.display="none"}}var a=document.createElement("td");a.className="standartTreeRow";r.span=document.createElement("span");r.span.className="standartTreeRow";if(this.mlitems){r.span.style.width=this.mlitems;r.span.style.display="block"}else{a.noWrap=true}if(dhx4.isIE8){a.style.width="99999px"}else{if(!window._KHTMLrv){a.style.width="100%"}}r.span.innerHTML=r.label;a.appendChild(r.span);a.parentObject=r;g.parentObject=r;a.onclick=this.onRowSelect;g.onclick=this.onRowClick;a.ondblclick=this.onRowClick2;if(this.ettip){q.title=r.label}if(this.dragAndDropOff){if(this._aimgs){this.dragger.addDraggableItem(c,this);c.parentObject=r}this.dragger.addDraggableItem(a,this)}r.span.style.paddingLeft="5px";r.span.style.paddingRight="5px";a.style.verticalAlign="";a.style.fontSize="10pt";a.style.cursor=this.style_pointer;q.appendChild(g);q.appendChild(e);q.appendChild(c);q.appendChild(a);m.appendChild(q);u.appendChild(m);if(this.ehlt||this.checkEvent("onMouseIn")||this.checkEvent("onMouseOut")){q.onmousemove=this._itemMouseIn;q[(_isIE)?"onmouseleave":"onmouseout"]=this._itemMouseOut}return u};dhtmlXTreeObject.prototype.setImagePath=function(a){this.imPath=a;this.iconURL=a};dhtmlXTreeObject.prototype.setIconPath=function(a){this.iconURL=a};dhtmlXTreeObject.prototype._getLeafCount=function(g){var e=0;for(var c=0;c<g.childsCount;c++){if(g.childNodes[c].childsCount==0){e++}}return e};dhtmlXTreeObject.prototype._getChildCounterValue=function(c){var a=this._globalIdStorageFind(c);if(!a){return 0}if((a.unParsed)||((!a.XMLload)&&(this.XMLsource))){return a._acc}switch(this.childCalc){case 1:return a.childsCount;break;case 2:return this._getLeafCount(a);break;case 3:return a._acc;break;case 4:return a._acc;break}};dhtmlXTreeObject.prototype._fixChildCountLabel=function(l,g){if(this.childCalc==null){return}if((l.unParsed)||((!l.XMLload)&&(this.XMLsource))){if(l._acc){l.span.innerHTML=l.label+this.htmlcA+l._acc+this.htmlcB}else{l.span.innerHTML=l.label}return}switch(this.childCalc){case 1:if(l.childsCount!=0){l.span.innerHTML=l.label+this.htmlcA+l.childsCount+this.htmlcB}else{l.span.innerHTML=l.label}break;case 2:var h=this._getLeafCount(l);if(h!=0){l.span.innerHTML=l.label+this.htmlcA+h+this.htmlcB}else{l.span.innerHTML=l.label}break;case 3:if(l.childsCount!=0){var e=0;for(var c=0;c<l.childsCount;c++){if(!l.childNodes[c]._acc){l.childNodes[c]._acc=0}e+=l.childNodes[c]._acc*1}e+=l.childsCount*1;l.span.innerHTML=l.label+this.htmlcA+e+this.htmlcB;l._acc=e}else{l.span.innerHTML=l.label;l._acc=0}if((l.parentObject)&&(l.parentObject!=this.htmlNode)){this._fixChildCountLabel(l.parentObject)}break;case 4:if(l.childsCount!=0){var e=0;for(var c=0;c<l.childsCount;c++){if(!l.childNodes[c]._acc){l.childNodes[c]._acc=1}e+=l.childNodes[c]._acc*1}l.span.innerHTML=l.label+this.htmlcA+e+this.htmlcB;l._acc=e}else{l.span.innerHTML=l.label;l._acc=1}if((l.parentObject)&&(l.parentObject!=this.htmlNode)){this._fixChildCountLabel(l.parentObject)}break}};dhtmlXTreeObject.prototype.setChildCalcMode=function(a){switch(a){case"child":this.childCalc=1;break;case"leafs":this.childCalc=2;break;case"childrec":this.childCalc=3;break;case"leafsrec":this.childCalc=4;break;case"disabled":this.childCalc=null;break;default:this.childCalc=4}};dhtmlXTreeObject.prototype.setChildCalcHTML=function(c,a){this.htmlcA=c;this.htmlcB=a};dhtmlXTreeObject.prototype.setOnRightClickHandler=function(a){this.attachEvent("onRightClick",a)};dhtmlXTreeObject.prototype.setOnClickHandler=function(a){this.attachEvent("onClick",a)};dhtmlXTreeObject.prototype.setOnSelectStateChange=function(a){this.attachEvent("onSelect",a)};dhtmlXTreeObject.prototype.setXMLAutoLoading=function(a){this.XMLsource=a};dhtmlXTreeObject.prototype.setOnCheckHandler=function(a){this.attachEvent("onCheck",a)};dhtmlXTreeObject.prototype.setOnOpenHandler=function(a){this.attachEvent("onOpenStart",a)};dhtmlXTreeObject.prototype.setOnOpenStartHandler=function(a){this.attachEvent("onOpenStart",a)};dhtmlXTreeObject.prototype.setOnOpenEndHandler=function(a){this.attachEvent("onOpenEnd",a)};dhtmlXTreeObject.prototype.setOnDblClickHandler=function(a){this.attachEvent("onDblClick",a)};dhtmlXTreeObject.prototype.openAllItems=function(c){var a=this._globalIdStorageFind(c);if(!a){return 0}this._xopenAll(a)};dhtmlXTreeObject.prototype.getOpenState=function(c){var a=this._globalIdStorageFind(c);if(!a){return""}return this._getOpenState(a)};dhtmlXTreeObject.prototype.closeAllItems=function(c){if(c===window.undefined){c=this.rootId}var a=this._globalIdStorageFind(c);if(!a){return 0}this._xcloseAll(a);this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0"};dhtmlXTreeObject.prototype.setUserData=function(g,c,e){var a=this._globalIdStorageFind(g,0,true);if(!a){return}if(c=="hint"){a.htmlNode.childNodes[0].childNodes[0].title=e}if(typeof(a.userData["t_"+c])=="undefined"){if(!a._userdatalist){a._userdatalist=c}else{a._userdatalist+=","+c}}a.userData["t_"+c]=e};dhtmlXTreeObject.prototype.getUserData=function(e,c){var a=this._globalIdStorageFind(e,0,true);if(!a){return}return a.userData["t_"+c]};dhtmlXTreeObject.prototype.getItemColor=function(e){var a=this._globalIdStorageFind(e);if(!a){return 0}var c=new Object();if(a.acolor){c.acolor=a.acolor}if(a.scolor){c.scolor=a.scolor}return c};dhtmlXTreeObject.prototype.setItemColor=function(e,c,g){if((e)&&(e.span)){var a=e}else{var a=this._globalIdStorageFind(e)}if(!a){return 0}else{if(a.i_sel){if(g){a.span.style.color=g}}else{if(c){a.span.style.color=c}}if(g){a.scolor=g}if(c){a.acolor=c}}};dhtmlXTreeObject.prototype.getItemText=function(c){var a=this._globalIdStorageFind(c);if(!a){return 0}return(a.htmlNode.childNodes[0].childNodes[0].childNodes[3].childNodes[0].innerHTML)};dhtmlXTreeObject.prototype.getParentId=function(c){var a=this._globalIdStorageFind(c);if((!a)||(!a.parentObject)){return""}return a.parentObject.id};dhtmlXTreeObject.prototype.changeItemId=function(c,e){if(c==e){return}var a=this._globalIdStorageFind(c);if(!a){return 0}a.id=e;a.span.contextMenuId=e;this._idpull[e]=this._idpull[c];delete this._idpull[c]};dhtmlXTreeObject.prototype.doCut=function(){if(this.nodeCut){this.clearCut()}this.nodeCut=(new Array()).concat(this._selected);for(var a=0;a<this.nodeCut.length;a++){var c=this.nodeCut[a];c._cimgs=new Array();c._cimgs[0]=c.images[0];c._cimgs[1]=c.images[1];c._cimgs[2]=c.images[2];c.images[0]=c.images[1]=c.images[2]=this.cutImage;this._correctPlus(c)}};dhtmlXTreeObject.prototype.doPaste=function(e){var a=this._globalIdStorageFind(e);if(!a){return 0}for(var c=0;c<this.nodeCut.length;c++){if(this._checkPNodes(a,this.nodeCut[c])){continue}this._moveNode(this.nodeCut[c],a)}this.clearCut()};dhtmlXTreeObject.prototype.clearCut=function(){for(var a=0;a<this.nodeCut.length;a++){var c=this.nodeCut[a];c.images[0]=c._cimgs[0];c.images[1]=c._cimgs[1];c.images[2]=c._cimgs[2];this._correctPlus(c)}this.nodeCut=new Array()};dhtmlXTreeObject.prototype._moveNode=function(a,c){var l=this.dadmodec;if(l==1){var h=c;if(this.dadmodefix<0){while(true){h=this._getPrevNode(h);if((h==-1)){h=this.htmlNode;break}if((h.tr==0)||(h.tr.style.display=="")||(!h.parentObject)){break}}var g=h;var e=c}else{if((h.tr)&&(h.tr.nextSibling)&&(h.tr.nextSibling.nodem)&&(this._getOpenState(h)<1)){h=h.tr.nextSibling.nodem}else{h=this._getNextNode(h);if((h==-1)){h=this.htmlNode}}var e=h;var g=c}if(this._getNodeLevel(g,0)>this._getNodeLevel(e,0)){if(!this.dropLower){return this._moveNodeTo(a,g.parentObject)}else{if(e.id!=this.rootId){return this._moveNodeTo(a,e.parentObject,e)}else{return this._moveNodeTo(a,this.htmlNode,null)}}}else{return this._moveNodeTo(a,e.parentObject,e)}}else{return this._moveNodeTo(a,c)}};dhtmlXTreeObject.prototype._fixNodesCollection=function(n,l){var c=0;var g=0;var m=n.childNodes;var a=n.childsCount-1;if(l==m[a]){return}for(var h=0;h<a;h++){if(m[h]==m[a]){m[h]=m[h+1];m[h+1]=m[a]}}for(var h=0;h<a+1;h++){if(c){var e=m[h];m[h]=c;c=e}else{if(m[h]==l){c=m[h];m[h]=m[a]}}}};dhtmlXTreeObject.prototype._recreateBranch=function(l,n,h,a){var c;var o="";if(h){for(c=0;c<n.childsCount;c++){if(n.childNodes[c]==h){break}}if(c!=0){h=n.childNodes[c-1]}else{o="TOP";h=""}}var e=this._onradh;this._onradh=null;var m=this._attachChildNode(n,l.id,l.label,0,l.images[0],l.images[1],l.images[2],o,0,h);m._userdatalist=l._userdatalist;m.userData=l.userData.clone();if(l._attrs){m._attrs={};for(var g in l._attrs){m._attrs[g]=l._attrs[g]}}m.XMLload=l.XMLload;if(e){this._onradh=e;this._onradh(m.id)}if(l.treeNod.dpcpy){l.treeNod._globalIdStorageFind(l.id)}else{m.unParsed=l.unParsed}this._correctPlus(m);for(var c=0;c<l.childsCount;c++){this._recreateBranch(l.childNodes[c],m,0,1)}if((!a)&&(this.childCalc)){this._redrawFrom(this,n)}return m};dhtmlXTreeObject.prototype._moveNodeTo=function(s,v,r){if(s.treeNod._nonTrivialNode){return s.treeNod._nonTrivialNode(this,v,r,s)}if(this._checkPNodes(v,s)){return false}if(v.mytype){var m=(s.treeNod.lWin!=v.lWin)}else{var m=(s.treeNod.lWin!=v.treeNod.lWin)}if(!this.callEvent("onDrag",[s.id,v.id,(r?r.id:null),s.treeNod,v.treeNod])){return false}if((v.XMLload==0)&&(this.XMLsource)){v.XMLload=1;this._loadDynXML(v.id)}this.openItem(v.id);var e=s.treeNod;var o=s.parentObject.childsCount;var q=s.parentObject;if((m)||(e.dpcpy)){var g=s.id;s=this._recreateBranch(s,v,r);if(!e.dpcpy){e.deleteItem(g)}}else{var h=v.childsCount;var u=v.childNodes;if(h==0){v._open=true}e._unselectItem(s);u[h]=s;s.treeNod=v.treeNod;v.childsCount++;var n=this._drawNewTr(u[h].htmlNode);if(!r){v.htmlNode.childNodes[0].appendChild(n);if(this.dadmode==1){this._fixNodesCollection(v,r)}}else{v.htmlNode.childNodes[0].insertBefore(n,r.tr);this._fixNodesCollection(v,r);u=v.childNodes}}if((!e.dpcpy)&&(!m)){var a=s.tr;if((document.all)&&(navigator.appVersion.search(/MSIE\ 5\.0/gi)!=-1)){window.setTimeout(function(){a.parentNode.removeChild(a)},250)}else{s.parentObject.htmlNode.childNodes[0].removeChild(s.tr)}if((!r)||(v!=s.parentObject)){for(var l=0;l<q.childsCount;l++){if(q.childNodes[l].id==s.id){q.childNodes[l]=0;break}}}else{q.childNodes[q.childsCount-1]=0}e._compressChildList(q.childsCount,q.childNodes);q.childsCount--}if((!m)&&(!e.dpcpy)){s.tr=n;n.nodem=s;s.parentObject=v;if(e!=v.treeNod){if(s.treeNod._registerBranch(s,e)){return}this._clearStyles(s);this._redrawFrom(this,s.parentObject);if(this._onradh){this._onradh(s.id)}}this._correctPlus(v);this._correctLine(v);this._correctLine(s);this._correctPlus(s);if(r){this._correctPlus(r)}else{if(v.childsCount>=2){this._correctPlus(u[v.childsCount-2]);this._correctLine(u[v.childsCount-2])}}this._correctPlus(u[v.childsCount-1]);if(this.tscheck){this._correctCheckStates(v)}if(e.tscheck){e._correctCheckStates(q)}}if(o>1){e._correctPlus(q.childNodes[o-2]);e._correctLine(q.childNodes[o-2])}e._correctPlus(q);e._correctLine(q);this._fixChildCountLabel(v);e._fixChildCountLabel(q);this.callEvent("onDrop",[s.id,v.id,(r?r.id:null),e,v.treeNod]);return s.id};dhtmlXTreeObject.prototype._clearStyles=function(a){if(!a.htmlNode){return}var g=a.htmlNode.childNodes[0].childNodes[0].childNodes[1];var c=g.nextSibling.nextSibling;a.span.innerHTML=a.label;a.i_sel=false;if(a._aimgs){this.dragger.removeDraggableItem(g.nextSibling)}if(this.checkBoxOff){g.childNodes[0].style.display="";g.childNodes[0].onclick=this.onCheckBoxClick;this._setSrc(g.childNodes[0],this.imPath+this.checkArray[a.checkstate])}else{g.style.display="none"}g.childNodes[0].treeNod=this;this.dragger.removeDraggableItem(c);if(this.dragAndDropOff){this.dragger.addDraggableItem(c,this)}if(this._aimgs){this.dragger.addDraggableItem(g.nextSibling,this)}c.childNodes[0].className="standartTreeRow";c.onclick=this.onRowSelect;c.ondblclick=this.onRowClick2;g.previousSibling.onclick=this.onRowClick;this._correctLine(a);this._correctPlus(a);for(var e=0;e<a.childsCount;e++){this._clearStyles(a.childNodes[e])}};dhtmlXTreeObject.prototype._registerBranch=function(c,a){if(a){a._globalIdStorageSub(c.id)}c.id=this._globalIdStorageAdd(c.id,c);c.treeNod=this;for(var e=0;e<c.childsCount;e++){this._registerBranch(c.childNodes[e],a)}return 0};dhtmlXTreeObject.prototype.enableThreeStateCheckboxes=function(a){this.tscheck=dhx4.s2b(a)};dhtmlXTreeObject.prototype.setOnMouseInHandler=function(a){this.ehlt=true;this.attachEvent("onMouseIn",a)};dhtmlXTreeObject.prototype.setOnMouseOutHandler=function(a){this.ehlt=true;this.attachEvent("onMouseOut",a)};dhtmlXTreeObject.prototype.enableMercyDrag=function(a){this.dpcpy=dhx4.s2b(a)};dhtmlXTreeObject.prototype.enableTreeImages=function(a){this.timgen=dhx4.s2b(a)};dhtmlXTreeObject.prototype.enableFixedMode=function(a){this.hfMode=dhx4.s2b(a)};dhtmlXTreeObject.prototype.enableCheckBoxes=function(c,a){this.checkBoxOff=dhx4.s2b(c);this.cBROf=(!(this.checkBoxOff||dhx4.s2b(a)))};dhtmlXTreeObject.prototype.setStdImages=function(a,e,c){this.imageArray[0]=a;this.imageArray[1]=e;this.imageArray[2]=c};dhtmlXTreeObject.prototype.enableTreeLines=function(a){this.treeLinesOn=dhx4.s2b(a)};dhtmlXTreeObject.prototype.setImageArrays=function(g,a,l,h,e,c){switch(g){case"plus":this.plusArray[0]=a;this.plusArray[1]=l;this.plusArray[2]=h;this.plusArray[3]=e;this.plusArray[4]=c;break;case"minus":this.minusArray[0]=a;this.minusArray[1]=l;this.minusArray[2]=h;this.minusArray[3]=e;this.minusArray[4]=c;break}};dhtmlXTreeObject.prototype.openItem=function(c){this.skipLock=true;var a=this._globalIdStorageFind(c);if(!a){return 0}else{return this._openItem(a)}this.skipLock=false};dhtmlXTreeObject.prototype._openItem=function(a){var c=this._getOpenState(a);if((c<0)||(((this.XMLsource)&&(!a.XMLload)))){if(!this.callEvent("onOpenStart",[a.id,c])){return 0}this._HideShow(a,2);if(this.checkEvent("onOpenEnd")){if(this.onXLE==this._epnFHe){this._epnFHe(this,a.id,true)}if(!this.xmlstate||!this.XMLsource){this.callEvent("onOpenEnd",[a.id,this._getOpenState(a)])}else{this._oie_onXLE.push(this.onXLE);this.onXLE=this._epnFHe}}}else{if(this._srnd){this._HideShow(a,2)}}if(a.parentObject&&!this._skip_open_parent){this._openItem(a.parentObject)}};dhtmlXTreeObject.prototype.closeItem=function(c){if(this.rootId==c){return 0}this.skipLock=true;var a=this._globalIdStorageFind(c);if(!a){return 0}if(a.closeble){this._HideShow(a,1)}this.skipLock=false};dhtmlXTreeObject.prototype.getLevel=function(c){var a=this._globalIdStorageFind(c);if(!a){return 0}return this._getNodeLevel(a,0)};dhtmlXTreeObject.prototype.setItemCloseable=function(e,a){a=dhx4.s2b(a);if((e)&&(e.span)){var c=e}else{var c=this._globalIdStorageFind(e)}if(!c){return 0}c.closeble=a};dhtmlXTreeObject.prototype._getNodeLevel=function(a,c){if(a.parentObject){return this._getNodeLevel(a.parentObject,c+1)}return(c)};dhtmlXTreeObject.prototype.hasChildren=function(c){var a=this._globalIdStorageFind(c);if(!a){return 0}else{if((this.XMLsource)&&(!a.XMLload)){return true}else{return a.childsCount}}};dhtmlXTreeObject.prototype._getLeafCount=function(g){var e=0;for(var c=0;c<g.childsCount;c++){if(g.childNodes[c].childsCount==0){e++}}return e};dhtmlXTreeObject.prototype.setItemText=function(g,e,c){var a=this._globalIdStorageFind(g);if(!a){return 0}a.label=e;a.span.innerHTML=e;if(this.childCalc){this._fixChildCountLabel(a)}a.span.parentNode.parentNode.title=c||""};dhtmlXTreeObject.prototype.getItemTooltip=function(c){var a=this._globalIdStorageFind(c);if(!a){return""}return(a.span.parentNode.parentNode._dhx_title||a.span.parentNode.parentNode.title||"")};dhtmlXTreeObject.prototype.refreshItem=function(c){if(!c){c=this.rootId}var a=this._globalIdStorageFind(c);this.deleteChildItems(c);this._loadDynXML(c)};dhtmlXTreeObject.prototype.setItemImage2=function(g,a,h,e){var c=this._globalIdStorageFind(g);if(!c){return 0}c.images[1]=h;c.images[2]=e;c.images[0]=a;this._correctPlus(c)};dhtmlXTreeObject.prototype.setItemImage=function(e,a,g){var c=this._globalIdStorageFind(e);if(!c){return 0}if(g){c.images[1]=a;c.images[2]=g}else{c.images[0]=a}this._correctPlus(c)};dhtmlXTreeObject.prototype.getSubItems=function(e){var a=this._globalIdStorageFind(e,0,1);if(!a){return 0}if(a.unParsed){return(this._getSubItemsXML(a.unParsed))}var c="";for(i=0;i<a.childsCount;i++){if(!c){c=""+a.childNodes[i].id}else{c+=this.dlmtr+a.childNodes[i].id}}return c};dhtmlXTreeObject.prototype._getAllScraggyItems=function(e){var g="";for(var c=0;c<e.childsCount;c++){if((e.childNodes[c].unParsed)||(e.childNodes[c].childsCount>0)){if(e.childNodes[c].unParsed){var a=this._getAllScraggyItemsXML(e.childNodes[c].unParsed,1)}else{var a=this._getAllScraggyItems(e.childNodes[c])}if(a){if(g){g+=this.dlmtr+a}else{g=a}}}else{if(!g){g=""+e.childNodes[c].id}else{g+=this.dlmtr+e.childNodes[c].id}}}return g};dhtmlXTreeObject.prototype._getAllFatItems=function(e){var g="";for(var c=0;c<e.childsCount;c++){if((e.childNodes[c].unParsed)||(e.childNodes[c].childsCount>0)){if(!g){g=""+e.childNodes[c].id}else{g+=this.dlmtr+e.childNodes[c].id}if(e.childNodes[c].unParsed){var a=this._getAllFatItemsXML(e.childNodes[c].unParsed,1)}else{var a=this._getAllFatItems(e.childNodes[c])}if(a){g+=this.dlmtr+a}}}return g};dhtmlXTreeObject.prototype._getAllSubItems=function(l,h,g){if(g){c=g}else{var c=this._globalIdStorageFind(l)}if(!c){return 0}h="";for(var e=0;e<c.childsCount;e++){if(!h){h=""+c.childNodes[e].id}else{h+=this.dlmtr+c.childNodes[e].id}var a=this._getAllSubItems(0,h,c.childNodes[e]);if(a){h+=this.dlmtr+a}}if(c.unParsed){h=this._getAllSubItemsXML(l,h,c.unParsed)}return h};dhtmlXTreeObject.prototype.selectItem=function(g,e,c){e=dhx4.s2b(e);var a=this._globalIdStorageFind(g);if((!a)||(!a.parentObject)){return 0}if(this.XMLloadingWarning){a.parentObject.openMe=1}else{this._openItem(a.parentObject)}var h=null;if(c){h=new Object;h.ctrlKey=true;if(a.i_sel){h.skipUnSel=true}}if(e){this.onRowSelect(h,a.htmlNode.childNodes[0].childNodes[0].childNodes[3],false)}else{this.onRowSelect(h,a.htmlNode.childNodes[0].childNodes[0].childNodes[3],true)}};dhtmlXTreeObject.prototype.getSelectedItemText=function(){var c=new Array();for(var a=0;a<this._selected.length;a++){c[a]=this._selected[a].span.innerHTML}return(c.join(this.dlmtr))};dhtmlXTreeObject.prototype._compressChildList=function(a,e){a--;for(var c=0;c<a;c++){if(e[c]==0){e[c]=e[c+1];e[c+1]=0}}};dhtmlXTreeObject.prototype._deleteNode=function(m,h,o){if((!h)||(!h.parentObject)){return 0}var a=0;var c=0;if(h.tr.nextSibling){a=h.tr.nextSibling.nodem}if(h.tr.previousSibling){c=h.tr.previousSibling.nodem}var l=h.parentObject;var e=l.childsCount;var n=l.childNodes;for(var g=0;g<e;g++){if(n[g].id==m){if(!o){l.htmlNode.childNodes[0].removeChild(n[g].tr)}n[g]=0;break}}this._compressChildList(e,n);if(!o){l.childsCount--}if(a){this._correctPlus(a);this._correctLine(a)}if(c){this._correctPlus(c);this._correctLine(c)}if(this.tscheck){this._correctCheckStates(l)}if(!o){this._globalIdStorageRecSub(h)}};dhtmlXTreeObject.prototype.setCheck=function(e,c){var a=this._globalIdStorageFind(e,0,1);if(!a){return}if(c==="unsure"){this._setCheck(a,c)}else{c=dhx4.s2b(c);if((this.tscheck)&&(this.smcheck)){this._setSubChecked(c,a)}else{this._setCheck(a,c)}}if(this.smcheck){this._correctCheckStates(a.parentObject)}};dhtmlXTreeObject.prototype._setCheck=function(a,e){if(!a){return}if(((a.parentObject._r_logic)||(this._frbtr))&&(e)){if(this._frbtrs){if(this._frbtrL){this.setCheck(this._frbtrL.id,0)}this._frbtrL=a}else{for(var c=0;c<a.parentObject.childsCount;c++){this._setCheck(a.parentObject.childNodes[c],0)}}}var g=a.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];if(e=="unsure"){a.checkstate=2}else{if(e){a.checkstate=1}else{a.checkstate=0}}if(a.dscheck){a.checkstate=a.dscheck}this._setSrc(g,this.imPath+((a.parentObject._r_logic||this._frbtr)?this.radioArray:this.checkArray)[a.checkstate])};dhtmlXTreeObject.prototype.setSubChecked=function(e,c){var a=this._globalIdStorageFind(e);this._setSubChecked(c,a);this._correctCheckStates(a.parentObject)};dhtmlXTreeObject.prototype._setSubChecked=function(e,a){e=dhx4.s2b(e);if(!a){return}if(((a.parentObject._r_logic)||(this._frbtr))&&(e)){for(var c=0;c<a.parentObject.childsCount;c++){this._setSubChecked(0,a.parentObject.childNodes[c])}}if(a.unParsed){this._setSubCheckedXML(e,a.unParsed)}if(a._r_logic||this._frbtr){this._setSubChecked(e,a.childNodes[0])}else{for(var c=0;c<a.childsCount;c++){this._setSubChecked(e,a.childNodes[c])}}var g=a.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];if(e){a.checkstate=1}else{a.checkstate=0}if(a.dscheck){a.checkstate=a.dscheck}this._setSrc(g,this.imPath+((a.parentObject._r_logic||this._frbtr)?this.radioArray:this.checkArray)[a.checkstate])};dhtmlXTreeObject.prototype.isItemChecked=function(c){var a=this._globalIdStorageFind(c);if(!a){return}return a.checkstate};dhtmlXTreeObject.prototype.deleteChildItems=function(g){var a=this._globalIdStorageFind(g);if(!a){return}var c=a.childsCount;for(var e=0;e<c;e++){this._deleteNode(a.childNodes[0].id,a.childNodes[0])}};dhtmlXTreeObject.prototype.deleteItem=function(e,a){if((!this._onrdlh)||(this._onrdlh(e))){var c=this._deleteItem(e,a);if(c){this._fixChildCountLabel(c)}}this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0"};dhtmlXTreeObject.prototype._deleteItem=function(l,c,h){c=dhx4.s2b(c);var a=this._globalIdStorageFind(l);if(!a){return}var e=this.getParentId(l);var g=a.parentObject;this._deleteNode(l,a,h);if(this._editCell&&this._editCell.id==l){this._editCell=null}this._correctPlus(g);this._correctLine(g);if((c)&&(e!=this.rootId)){this.selectItem(e,1)}return g};dhtmlXTreeObject.prototype._globalIdStorageRecSub=function(a){for(var c=0;c<a.childsCount;c++){this._globalIdStorageRecSub(a.childNodes[c]);this._globalIdStorageSub(a.childNodes[c].id)}this._globalIdStorageSub(a.id);var e=a;e.span=null;e.tr.nodem=null;e.tr=null;e.htmlNode=null};dhtmlXTreeObject.prototype.insertNewNext=function(n,r,q,e,l,h,g,c,a){var m=this._globalIdStorageFind(n);if((!m)||(!m.parentObject)){return(0)}var o=this._attachChildNode(0,r,q,e,l,h,g,c,a,m);if((!this.XMLloadingWarning)&&(this.childCalc)){this._fixChildCountLabel(m.parentObject)}return o};dhtmlXTreeObject.prototype.getItemIdByIndex=function(e,a){var c=this._globalIdStorageFind(e);if((!c)||(a>=c.childsCount)){return null}return c.childNodes[a].id};dhtmlXTreeObject.prototype.getChildItemIdByIndex=function(e,a){var c=this._globalIdStorageFind(e);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=dhx4.s2b(c);if(this.dragAndDropOff){this.dragger.addDragLanding(this.allTree,this)}if(arguments.length>1){this._ddronr=(!dhx4.s2b(a))}};dhtmlXTreeObject.prototype._setMove=function(h,e,m){if(h.parentObject.span){var g=dhx4.absTop(h);var c=dhx4.absTop(this.allTree)-this.allTree.scrollTop;this.dadmodec=this.dadmode;this.dadmodefix=0;if(this.dadmode==2){var l=m-g+(document.body.scrollTop||document.documentElement.scrollTop)-2-h.offsetHeight/2;if((Math.abs(l)-h.offsetHeight/6)>0){this.dadmodec=1;if(l<0){this.dadmodefix=0-h.offsetHeight}}else{this.dadmodec=0}}if(this.dadmodec==0){var a=h.parentObject.span;a.className+=" dragAndDropRow";this._lastMark=a}else{this._clearMove();this.selectionBar.style.top=(g-c+((parseInt(h.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,g,c)}};dhtmlXTreeObject.prototype._autoScroll=function(e,c,a){if(this.autoScroll){if(e){c=dhx4.absTop(e);a=dhx4.absTop(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.length;a++){m[a]="<table cellspacing='0' cellpadding='0'><tr><td><img width='18px' height='18px' src='"+this._getSrc(this._selected[a].span.parentNode.previousSibling.childNodes[0])+"'></td><td>"+this._selected[a].span.innerHTML+"</td></tr></table>"}}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=dhx4.absTop(a.htmlNode)-dhx4.absTop(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(m,n,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 l=m.parentObject.treeNod;if((l)&&(l._clearMove)){l._clearMove("")}if((!this.dragMove)||(this.dragMove())){if((!l)||(!l._clearMove)||(!l._dragged)){var g=new Array(m.parentObject)}else{var g=l._dragged}var c=a.parentObject;for(var h=0;h<g.length;h++){var e=this._moveNode(g[h],c);if((this.dadmodec)&&(e!==false)){c=this._globalIdStorageFind(e,true,true)}if((e)&&(!this._sADnD)){this.selectItem(e,0,1)}}}if(l){l._dragged=new Array()}};dhtmlXTreeObject.prototype._dragIn=function(g,c,l,h){if(!this.dADTempOff){return 0}var m=c.parentObject;var a=g.parentObject;if((!a)&&(this._ddronr)){return}if(!this.callEvent("onDragIn",[m.id,a?a.id:null,m.treeNod,this])){if(a){this._autoScroll(g)}return 0}if(!a){this.allTree.className+=" selectionBox"}else{if(m.childNodes==null){this._setMove(g,l,h);return g}var o=m.treeNod;for(var e=0;e<o._dragged.length;e++){if(this._checkPNodes(a,o._dragged[e])){this._autoScroll(g);return 0}}this.selectionBar.parentNode.removeChild(this.selectionBar);a.span.parentNode.appendChild(this.selectionBar);this._setMove(g,l,h);if(this._getOpenState(a)<=0){var n=this;this._autoOpenId=a.id;this._autoOpenTimer=window.setTimeout(function(){n._autoOpenItem(null,n);n=null},1000)}}return g};dhtmlXTreeObject.prototype._autoOpenItem=function(c,a){a.openItem(a._autoOpenId)};dhtmlXTreeObject.prototype._dragOut=function(a){this._clearMove();if(this._autoOpenTimer){clearTimeout(this._autoOpenTimer)}};dhtmlXTreeObject.prototype._getNextNode=function(a,c){if((!c)&&(a.childsCount)){return a.childNodes[0]}if(a==this.htmlNode){return -1}if((a.tr)&&(a.tr.nextSibling)&&(a.tr.nextSibling.nodem)){return a.tr.nextSibling.nodem}return this._getNextNode(a.parentObject,true)};dhtmlXTreeObject.prototype._lastChild=function(a){if(a.childsCount){return this._lastChild(a.childNodes[a.childsCount-1])}else{return a}};dhtmlXTreeObject.prototype._getPrevNode=function(a,c){if((a.tr)&&(a.tr.previousSibling)&&(a.tr.previousSibling.nodem)){return this._lastChild(a.tr.previousSibling.nodem)}if(a.parentObject){return a.parentObject}else{return -1}};dhtmlXTreeObject.prototype.findItem=function(a,e,c){var g=this._findNodeByLabel(a,e,(c?this.htmlNode:null));if(g){this.selectItem(g.id,true);this._focusNode(g);return g.id}else{return null}};dhtmlXTreeObject.prototype.findItemIdByLabel=function(a,e,c){var g=this._findNodeByLabel(a,e,(c?this.htmlNode:null));if(g){return g.id}else{return null}};dhtmlXTreeObject.prototype.findStrInXML=function(c,e,h){if(!c.childNodes&&c.item){return this.findStrInJSON(c,e,h)}if(!c.childNodes){return false}for(var a=0;a<c.childNodes.length;a++){if(c.childNodes[a].nodeType==1){var g=c.childNodes[a].getAttribute(e);if(!g&&c.childNodes[a].tagName=="itemtext"){g=c.childNodes[a].firstChild.data}if((g)&&(g.toLowerCase().search(h)!=-1)){return true}if(this.findStrInXML(c.childNodes[a],e,h)){return true}}}return false};dhtmlXTreeObject.prototype.findStrInJSON=function(c,e,h){for(var a=0;a<c.item.length;a++){var g=c.item[a].text;if((g)&&(g.toLowerCase().search(h)!=-1)){return true}if(c.item[a].item&&this.findStrInJSON(c.item[a],e,h)){return true}}return false};dhtmlXTreeObject.prototype._findNodeByLabel=function(a,h,g){var a=a.replace(new RegExp("^( )+"),"").replace(new RegExp("( )+$"),"");a=new RegExp(a.replace(/([\^\.\?\*\+\\\[\]\(\)]{1})/gi,"\\$1").replace(/ /gi,".*"),"gi");if(!g){g=this._selected[0];if(!g){g=this.htmlNode}}var c=g;if(!h){if((g.unParsed)&&(this.findStrInXML(g.unParsed.d,"text",a))){this.reParse(g)}g=this._getNextNode(c);if(g==-1){g=this.htmlNode.childNodes[0]}}else{var e=this._getPrevNode(c);if(e==-1){e=this._lastChild(this.htmlNode)}if((e.unParsed)&&(this.findStrInXML(e.unParsed.d,"text",a))){this.reParse(e);g=this._getPrevNode(c)}else{g=e}if(g==-1){g=this._lastChild(this.htmlNode)}}while((g)&&(g!=c)){if((g.label)&&(g.label.search(a)!=-1)){return(g)}if(!h){if(g==-1){if(c==this.htmlNode){break}g=this.htmlNode.childNodes[0]}if((g.unParsed)&&(this.findStrInXML(g.unParsed.d,"text",a))){this.reParse(g)}g=this._getNextNode(g);if(g==-1){g=this.htmlNode}}else{var e=this._getPrevNode(g);if(e==-1){e=this._lastChild(this.htmlNode)}if((e.unParsed)&&(this.findStrInXML(e.unParsed.d,"text",a))){this.reParse(e);g=this._getPrevNode(g)}else{g=e}if(g==-1){g=this._lastChild(this.htmlNode)}}}return null};dhtmlXTreeObject.prototype.moveItem=function(n,c,o,a){var h=this._globalIdStorageFind(n);if(!h){return(0)}var l=null;switch(c){case"right":alert("Not supported yet");break;case"item_child":var e=(a||this)._globalIdStorageFind(o);if(!e){return(0)}l=(a||this)._moveNodeTo(h,e,0);break;case"item_sibling":var e=(a||this)._globalIdStorageFind(o);if(!e){return(0)}l=(a||this)._moveNodeTo(h,e.parentObject,e);break;case"item_sibling_next":var e=(a||this)._globalIdStorageFind(o);if(!e){return(0)}if((e.tr)&&(e.tr.nextSibling)&&(e.tr.nextSibling.nodem)){l=(a||this)._moveNodeTo(h,e.parentObject,e.tr.nextSibling.nodem)}else{l=(a||this)._moveNodeTo(h,e.parentObject)}break;case"left":if(h.parentObject.parentObject){l=this._moveNodeTo(h,h.parentObject.parentObject,h.parentObject)}break;case"up":var m=this._getPrevNode(h);if((m==-1)||(!m.parentObject)){return null}l=this._moveNodeTo(h,m.parentObject,m);break;case"up_strict":var m=this._getIndex(h);if(m!=0){l=this._moveNodeTo(h,h.parentObject,h.parentObject.childNodes[m-1])}break;case"down_strict":var m=this._getIndex(h);var g=h.parentObject.childsCount-2;if(m==g){l=this._moveNodeTo(h,h.parentObject)}else{if(m<g){l=this._moveNodeTo(h,h.parentObject,h.parentObject.childNodes[m+2])}}break;case"down":var m=this._getNextNode(this._lastChild(h));if((m==-1)||(!m.parentObject)){return}if(m.parentObject==h.parentObject){var m=this._getNextNode(m)}if(m==-1){l=this._moveNodeTo(h,h.parentObject)}else{if((m==-1)||(!m.parentObject)){return}l=this._moveNodeTo(h,m.parentObject,m)}break}if(_isIE&&_isIE<8){this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0"}return l};dhtmlXTreeObject.prototype.setDragBehavior=function(c,a){this._sADnD=(!dhx4.s2b(a));switch(c){case"child":this.dadmode=0;break;case"sibling":this.dadmode=1;break;case"complex":this.dadmode=2;break}};dhtmlXTreeObject.prototype._loadDynXML=function(e,c){c=c||this.XMLsource;var a=(new Date()).valueOf();this._ld_id=e;if(this.xmlalb=="function"){if(c){c(this._escape(e))}}else{if(this.xmlalb=="name"){this.loadXML(c+this._escape(e))}else{if(this.xmlalb=="xmlname"){this.loadXML(c+this._escape(e)+".xml?uid="+a)}else{this.loadXML(c+dhtmlx.url(c)+"uid="+a+"&id="+this._escape(e))}}}};dhtmlXTreeObject.prototype.enableMultiselection=function(c,a){this._amsel=dhx4.s2b(c);this._amselS=dhx4.s2b(a)};dhtmlXTreeObject.prototype._checkMSelectionLogic=function(){var e=new Array();for(var c=0;c<this._selected.length;c++){for(var a=0;a<this._selected.length;a++){if((c!=a)&&(this._checkPNodes(this._selected[a],this._selected[c]))){e[e.length]=this._selected[a]}}}for(var c=0;c<e.length;c++){this._unselectItem(e[c])}};dhtmlXTreeObject.prototype._checkPNodes=function(c,a){if(this._dcheckf){return false}if(a==c){return 1}if(c.parentObject){return this._checkPNodes(c.parentObject,a)}else{return 0}};dhtmlXTreeObject.prototype.disableDropCheck=function(a){this._dcheckf=dhx4.s2b(a)};dhtmlXTreeObject.prototype.enableDistributedParsing=function(e,c,a){this._edsbps=dhx4.s2b(e);this._edsbpsA=new Array();this._edsbpsC=c||10;this._edsbpsD=a||250};dhtmlXTreeObject.prototype.getDistributedParsingState=function(){return(!((!this._edsbpsA)||(!this._edsbpsA.length)))};dhtmlXTreeObject.prototype.getItemParsingState=function(e){var c=this._globalIdStorageFind(e,true,true);if(!c){return 0}if(this._edsbpsA){for(var a=0;a<this._edsbpsA.length;a++){if(this._edsbpsA[a][2]==e){return -1}}}return 1};dhtmlXTreeObject.prototype._distributedStart=function(c,h,g,e,a){if(!this._edsbpsA){this._edsbpsA=new Array()}this._edsbpsA[this._edsbpsA.length]=[c,h,g,e,a]};dhtmlXTreeObject.prototype._distributedStep=function(g){var c=this;if((!this._edsbpsA)||(!this._edsbpsA.length)){c.XMLloadingWarning=0;return}var h=this._edsbpsA[0];this.parsedArray=new Array();this._parse(h[0],h[2],h[3],h[1]);var a=this._globalIdStorageFind(h[2]);this._redrawFrom(this,a,h[4],this._getOpenState(a));var e=this.setCheckList.split(this.dlmtr);for(var l=0;l<e.length;l++){if(e[l]){this.setCheck(e[l],1)}}this._edsbpsA=(new Array()).concat(this._edsbpsA.slice(1));if((!this._edsbpsA.length)){window.setTimeout(function(){if(c.onXLE){c.onXLE(c,g)}c.callEvent("onXLE",[c,g])},1);c.xmlstate=0}};dhtmlXTreeObject.prototype.enableTextSigns=function(a){this._txtimg=dhx4.s2b(a)};dhtmlXTreeObject.prototype.preventIECaching=function(a){dhx4.ajax.cache=!a};dhtmlXTreeObject.prototype.preventIECashing=dhtmlXTreeObject.prototype.preventIECaching;dhtmlXTreeObject.prototype.disableCheckbox=function(e,c){if(typeof(e)!="object"){var a=this._globalIdStorageFind(e,0,1)}else{var a=e}if(!a){return}a.dscheck=dhx4.s2b(c)?(((a.checkstate||0)%3)+3):((a.checkstate>2)?(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(g,e){var a=this._globalIdStorageFind(g);for(var c=0;c<a.childsCount;c++){a.childNodes[c]._dmark=true}this.waitUpdateXML=true;if(e&&e.exists){this._parse(e,g)}else{this._loadDynXML(g,e)}};dhtmlXTreeObject.prototype.refreshItems=function(c,e){var g=c.toString().split(this.dlmtr);this.waitUpdateXML=new Array();for(var a=0;a<g.length;a++){this.waitUpdateXML[g[a]]=true}this.loadXML((e||this.XMLsource)+dhtmlx.url(e||this.XMLsource)+"ids="+this._escape(c))};dhtmlXTreeObject.prototype.updateItem=function(m,l,g,e,c,h,n){var a=this._globalIdStorageFind(m);a.userData=new cObject();if(l){a.label=l}a.images=new Array(g||this.imageArray[0],e||this.imageArray[1],c||this.imageArray[2]);this.setItemText(m,l);if(h){this._setCheck(a,true)}if(n=="1"&&!this.hasChildren(m)){a.XMLload=0}this._correctPlus(a);a._dmark=false;return a};dhtmlXTreeObject.prototype.setDropHandler=function(a){this.attachEvent("onDrop",a)};dhtmlXTreeObject.prototype.setOnLoadingStart=function(a){this.attachEvent("onXLS",a)};dhtmlXTreeObject.prototype.setOnLoadingEnd=function(a){this.attachEvent("onXLE",a)};dhtmlXTreeObject.prototype.setXMLAutoLoadingBehaviour=function(a){this.xmlalb=a};dhtmlXTreeObject.prototype.enableSmartCheckboxes=function(a){this.smcheck=dhx4.s2b(a)};dhtmlXTreeObject.prototype.getXMLState=function(){return(this.xmlstate==1)};dhtmlXTreeObject.prototype.setItemTopOffset=function(l,g){var e;if(typeof(l)!="object"){e=this._globalIdStorageFind(l)}else{e=l}var h=e.span.parentNode.parentNode;e.span.style.paddingBottom="1px";for(var c=0;c<h.childNodes.length;c++){if(c!=0){if(_isIE){h.childNodes[c].style.height="18px";h.childNodes[c].style.paddingTop=parseInt(g)+"px"}else{h.childNodes[c].style.height=18+parseInt(g)+"px"}}else{var a=h.childNodes[c].firstChild;if(h.childNodes[c].firstChild.tagName!="DIV"){a=document.createElement("DIV");h.childNodes[c].insertBefore(a,h.childNodes[c].firstChild)}if((e.parentObject.id!=this.rootId||e.parentObject.childNodes[0]!=e)&&this.treeLinesOn){h.childNodes[c].style.backgroundImage="url("+this.imPath+this.lineArray[5]+")"}a.innerHTML="&nbsp;";a.style.overflow="hidden"}a.style.verticalAlign=h.childNodes[c].style.verticalAlign="bottom";if(_isIE){this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0"}}};dhtmlXTreeObject.prototype.setIconSize=function(g,c,h){if(h){if((h)&&(h.span)){var a=h}else{var a=this._globalIdStorageFind(h)}if(!a){return(0)}var e=a.span.parentNode.previousSibling.childNodes[0];if(g){e.style.width=g+"px";if(window._KHTMLrv){e.parentNode.style.width=g+"px"}}if(c){e.style.height=c+"px";if(window._KHTMLrv){e.parentNode.style.height=c+"px"}}}else{this.def_img_x=g;this.def_img_y=c}};dhtmlXTreeObject.prototype.getItemImage=function(h,g,c){var e=this._globalIdStorageFind(h);if(!e){return""}var a=e.images[g||0];if(c){a=this.iconURL+a}return a};dhtmlXTreeObject.prototype.enableRadioButtons=function(g,e){if(arguments.length==1){this._frbtr=dhx4.s2b(g);this.checkBoxOff=this.checkBoxOff||this._frbtr;return}var c=this._globalIdStorageFind(g);if(!c){return""}e=dhx4.s2b(e);if((e)&&(!c._r_logic)){c._r_logic=true;for(var a=0;a<c.childsCount;a++){this._setCheck(c.childNodes[a],c.childNodes[a].checkstate)}}if((!e)&&(c._r_logic)){c._r_logic=false;for(var a=0;a<c.childsCount;a++){this._setCheck(c.childNodes[a],c.childNodes[a].checkstate)}}};dhtmlXTreeObject.prototype.enableSingleRadioMode=function(a){this._frbtrs=dhx4.s2b(a)};dhtmlXTreeObject.prototype.openOnItemAdded=function(a){this._hAdI=!dhx4.s2b(a)};dhtmlXTreeObject.prototype.openOnItemAdding=function(a){this._hAdI=!dhx4.s2b(a)};dhtmlXTreeObject.prototype.enableMultiLineItems=function(a){if(a===true){this.mlitems="100%"}else{this.mlitems=a}};dhtmlXTreeObject.prototype.enableAutoTooltips=function(a){this.ettip=dhx4.s2b(a)};dhtmlXTreeObject.prototype.clearSelection=function(a){if(a){this._unselectItem(this._globalIdStorageFind(a))}else{this._unselectItems()}};dhtmlXTreeObject.prototype.showItemSign=function(g,c){var a=this._globalIdStorageFind(g);if(!a){return 0}var e=a.span.parentNode.previousSibling.previousSibling.previousSibling;if(!dhx4.s2b(c)){this._openItem(a);a.closeble=false;a.wsign=true}else{a.closeble=true;a.wsign=false}this._correctPlus(a)};dhtmlXTreeObject.prototype.showItemCheckbox=function(h,g){if(!h){for(var c in this._idpull){this.showItemCheckbox(this._idpull[c],g)}}if(typeof(h)!="object"){h=this._globalIdStorageFind(h,0,0)}if(!h){return 0}h.nocheckbox=!dhx4.s2b(g);var e=h.span.parentNode.previousSibling.previousSibling.childNodes[0];e.parentNode.style.display=(!h.nocheckbox)?"":"none"};dhtmlXTreeObject.prototype.setListDelimeter=function(a){this.dlmtr=a};dhtmlXTreeObject.prototype.setEscapingMode=function(a){this.utfesc=a};dhtmlXTreeObject.prototype.enableHighlighting=function(a){this.ehlt=true;this.ehlta=dhx4.s2b(a)};dhtmlXTreeObject.prototype._itemMouseOut=function(){var c=this.childNodes[3].parentObject;var a=c.treeNod;a.callEvent("onMouseOut",[c.id]);if(c.id==a._l_onMSI){a._l_onMSI=null}if(!a.ehlta){return}c.span.className=c.span.className.replace("_lor","")};dhtmlXTreeObject.prototype._itemMouseIn=function(){var c=this.childNodes[3].parentObject;var a=c.treeNod;if(a._l_onMSI!=c.id){a.callEvent("onMouseIn",[c.id])}a._l_onMSI=c.id;if(!a.ehlta){return}c.span.className=c.span.className.replace("_lor","");c.span.className=c.span.className.replace(/((standart|selected)TreeRow)/,"$1_lor")};dhtmlXTreeObject.prototype.enableActiveImages=function(a){this._aimgs=dhx4.s2b(a)};dhtmlXTreeObject.prototype.focusItem=function(c){var a=this._globalIdStorageFind(c);if(!a){return(0)}this._focusNode(a)};dhtmlXTreeObject.prototype.getAllSubItems=function(a){return this._getAllSubItems(a)};dhtmlXTreeObject.prototype.getAllChildless=function(){return this._getAllScraggyItems(this.htmlNode)};dhtmlXTreeObject.prototype.getAllLeafs=dhtmlXTreeObject.prototype.getAllChildless;dhtmlXTreeObject.prototype._getAllScraggyItems=function(e){var g="";for(var c=0;c<e.childsCount;c++){if((e.childNodes[c].unParsed)||(e.childNodes[c].childsCount>0)){if(e.childNodes[c].unParsed){var a=this._getAllScraggyItemsXML(e.childNodes[c].unParsed,1)}else{var a=this._getAllScraggyItems(e.childNodes[c])}if(a){if(g){g+=this.dlmtr+a}else{g=a}}}else{if(!g){g=""+e.childNodes[c].id}else{g+=this.dlmtr+e.childNodes[c].id}}}return g};dhtmlXTreeObject.prototype._getAllFatItems=function(e){var g="";for(var c=0;c<e.childsCount;c++){if((e.childNodes[c].unParsed)||(e.childNodes[c].childsCount>0)){if(!g){g=""+e.childNodes[c].id}else{g+=this.dlmtr+e.childNodes[c].id}if(e.childNodes[c].unParsed){var a=this._getAllFatItemsXML(e.childNodes[c].unParsed,1)}else{var a=this._getAllFatItems(e.childNodes[c])}if(a){g+=this.dlmtr+a}}}return g};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(g,e,h){if(!g){g=this.htmlNode}if(g.checkstate==h){if(!g.nocheckbox){if(e){e+=this.dlmtr+g.id}else{e=""+g.id}}}var a=g.childsCount;for(var c=0;c<a;c++){e=this._getAllChecked(g.childNodes[c],e,h)}if(g.unParsed){e=this._getAllCheckedXML(g.unParsed,e,h)}if(e){return e}else{return""}};dhtmlXTreeObject.prototype.setItemStyle=function(g,e,c){var c=c||false;var a=this._globalIdStorageFind(g);if(!a){return 0}if(!a.span.style.cssText){a.span.setAttribute("style",a.span.getAttribute("style")+"; "+e)}else{a.span.style.cssText=c?e:a.span.style.cssText+";"+e}};dhtmlXTreeObject.prototype.enableImageDrag=function(a){this._itim_dg=dhx4.s2b(a)};dhtmlXTreeObject.prototype.setOnDragIn=function(a){this.attachEvent("onDragIn",a)};dhtmlXTreeObject.prototype.enableDragAndDropScrolling=function(a){this.autoScroll=dhx4.s2b(a)};dhtmlXTreeObject.prototype.setSkin=function(a){var c=this.parentObject.className.replace(/dhxtree_[^ ]*/gi,"");this.parentObject.className=c+" dhxtree_"+a;if(a=="dhx_terrace"||a=="dhx_web"){this.enableTreeLines(false)}};(function(){dhtmlx.extend_api("dhtmlXTreeObject",{_init:function(a){return[a.parent,(a.width||"100%"),(a.height||"100%"),(a.root_id||0)]},auto_save_selection:"enableAutoSavingSelected",auto_tooltip:"enableAutoTooltips",checkbox:"enableCheckBoxes",checkbox_3_state:"enableThreeStateCheckboxes",checkbox_smart:"enableSmartCheckboxes",context_menu:"enableContextMenu",distributed_parsing:"enableDistributedParsing",drag:"enableDragAndDrop",drag_copy:"enableMercyDrag",drag_image:"enableImageDrag",drag_scroll:"enableDragAndDropScrolling",editor:"enableItemEditor",hover:"enableHighlighting",images:"enableTreeImages",image_fix:"enableIEImageFix",image_path:"setImagePath",lines:"enableTreeLines",loading_item:"enableLoadingItem",multiline:"enableMultiLineItems",multiselect:"enableMultiselection",navigation:"enableKeyboardNavigation",radio:"enableRadioButtons",radio_single:"enableSingleRadioMode",rtl:"enableRTL",search:"enableKeySearch",smart_parsing:"enableSmartXMLParsing",smart_rendering:"enableSmartRendering",text_icons:"enableTextSigns",xml:"loadXML",skin:"setSkin"},{})})();dhtmlXTreeObject.prototype._dp_init=function(a){a.attachEvent("insertCallback",function(g,l,c){var e=dhx4.ajax.xpath(".//item",g);var h=e[0].getAttribute("text");this.obj.insertNewItem(c,l,h,0,0,0,0,"CHILD")});a.attachEvent("updateCallback",function(g,l,c){var e=dhx4.ajax.xpath(".//item",g);var h=e[0].getAttribute("text");this.obj.setItemText(l,h);if(this.obj.getParentId(l)!=c){this.obj.moveItem(l,"item_child",c)}this.setUpdated(l,true,"updated")});a.attachEvent("deleteCallback",function(e,g,c){this.obj.setUserData(g,this.action_param,"true_deleted");this.obj.deleteItem(g,false)});a._methods=["setItemStyle","","changeItemId","deleteItem"];this.attachEvent("onEdit",function(c,e){if(c==3){a.setUpdated(e,true)}return true});this.attachEvent("onDrop",function(l,h,g,e,c){if(e==c){a.setUpdated(l,true)}});this._onrdlh=function(c){var e=a.getState(c);if(e=="inserted"){a.set_invalid(c,false);a.setUpdated(c,false);return true}if(e=="true_deleted"){a.setUpdated(c,false);return true}a.setUpdated(c,true,"deleted");return false};this._onradh=function(c){a.setUpdated(c,true,"inserted")};a._getRowData=function(h){var g={};var l=this.obj._globalIdStorageFind(h);var e=l.parentObject;var c=0;for(c=0;c<e.childsCount;c++){if(e.childNodes[c]==l){break}}g.tr_id=l.id;g.tr_pid=e.id;g.tr_order=c;g.tr_text=l.span.innerHTML;e=(l._userdatalist||"").split(",");for(c=0;c<e.length;c++){g[e[c]]=l.userData["t_"+e[c]]}return g}};if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachTree=function(a){this.callEvent("_onBeforeContentAttach",["tree"]);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}}dhtmlXTreeObject.prototype.makeDraggable=function(c,a){if(typeof(c)!="object"){c=document.getElementById(c)}dragger=new dhtmlDragAndDropObject();dropper=new dhx_dragSomethingInTree();dragger.addDraggableItem(c,dropper);c.dragLanding=null;c.ondragstart=dropper._preventNsDrag;c.onselectstart=new Function("return false;");c.parentObject=new Object;c.parentObject.img=c;c.parentObject.treeNod=dropper;dropper._customDrop=a};dhtmlXTreeObject.prototype.makeDragable=dhtmlXTreeObject.prototype.makeDraggable;dhtmlXTreeObject.prototype.makeAllDraggable=function(c){var e=document.getElementsByTagName("div");for(var a=0;a<e.length;a++){if(e[a].getAttribute("dragInDhtmlXTree")){this.makeDragable(e[a],c)}}};function dhx_dragSomethingInTree(){this.lWin=window;this._createDragNode=function(c){var a=document.createElement("div");a.style.position="absolute";a.innerHTML=(c.innerHTML||c.value);a.className="dragSpanDiv";return a};this._preventNsDrag=function(a){(a||window.event).cancelBubble=true;if((a)&&(a.preventDefault)){a.preventDefault();return false}return false};this._nonTrivialNode=function(c,e,a,g){if(this._customDrop){return this._customDrop(c,g.img.id,e.id,a?a.id:null)}var h=(g.img.getAttribute("image")||"");var m=g.img.id||"new";var l=(g.img.getAttribute("text")||(_isIE?g.img.innerText:g.img.textContent));c[a?"insertNewNext":"insertNewItem"](a?a.id:e.id,m,l,"",h,h,h)}}dhtmlXTreeObject.prototype.enableItemEditor=function(a){this._eItEd=dhx4.s2b(a);if(!this._eItEdFlag){this._edn_click_IE=true;this._edn_dblclick=true;this._ie_aFunc=this.aFunc;this._ie_dblclickFuncHandler=this.dblclickFuncHandler;this.setOnDblClickHandler(function(e,c){if(this._edn_dblclick){this._editItem(e,c)}return true});this.setOnClickHandler(function(e,c){this._stopEditItem(e,c);if((this.ed_hist_clcik==e)&&(this._edn_click_IE)){this._editItem(e,c)}this.ed_hist_clcik=e;return true});this._eItEdFlag=true}};dhtmlXTreeObject.prototype.setOnEditHandler=function(a){this.attachEvent("onEdit",a)};dhtmlXTreeObject.prototype.setEditStartAction=function(a,c){this._edn_click_IE=dhx4.s2b(a);this._edn_dblclick=dhx4.s2b(c)};dhtmlXTreeObject.prototype._stopEdit=function(c,l){if(this._editCell){this.dADTempOff=this.dADTempOffEd;if(this._editCell.id!=c){var g=true;if(!l){g=this.callEvent("onEdit",[2,this._editCell.id,this,this._editCell.span.childNodes[0].value])}else{g=false;this.callEvent("onEditCancel",[this._editCell.id,this._editCell._oldValue])}if(g===true){g=this._editCell.span.childNodes[0].value}else{if(g===false){g=this._editCell._oldValue}}var h=(g!=this._editCell._oldValue);this._editCell.span.innerHTML=g;this._editCell.label=this._editCell.span.innerHTML;var e=this._editCell.i_sel?"selectedTreeRow":"standartTreeRow";this._editCell.span.className=e;this._editCell.span.parentNode.className="standartTreeRow";this._editCell.span.style.paddingRight=this._editCell.span.style.paddingLeft="5px";this._editCell.span.onclick=this._editCell.span.ondblclick=function(){};var m=this._editCell.id;if(this.childCalc){this._fixChildCountLabel(this._editCell)}this._editCell=null;if(!l){this.callEvent("onEdit",[3,m,this,h])}if(this._enblkbrd){this.parentObject.lastChild.focus();this.parentObject.lastChild.focus()}}}};dhtmlXTreeObject.prototype._stopEditItem=function(c,a){this._stopEdit(c)};dhtmlXTreeObject.prototype.stopEdit=function(a){if(this._editCell){this._stopEdit(this._editCell.id+"_non",a)}};dhtmlXTreeObject.prototype.editItem=function(a){this._editItem(a,this)};dhtmlXTreeObject.prototype._editItem=function(h,a){if(this._eItEd){this._stopEdit();var e=this._globalIdStorageFind(h);if(!e){return}var g=this.callEvent("onEdit",[0,h,this,e.span.innerHTML]);if(g===true){g=(typeof e.span.innerText!="undefined"?e.span.innerText:e.span.textContent)}else{if(g===false){return}}this.dADTempOffEd=this.dADTempOff;this.dADTempOff=false;this._editCell=e;e._oldValue=g;e.span.innerHTML="<input type='text' class='intreeeditRow' />";e.span.style.paddingRight=e.span.style.paddingLeft="0px";e.span.onclick=e.span.ondblclick=function(l){(l||event).cancelBubble=true};e.span.childNodes[0].value=g;e.span.childNodes[0].onselectstart=function(l){(l||event).cancelBubble=true;return true};e.span.childNodes[0].onmousedown=function(l){(l||event).cancelBubble=true;return true};e.span.childNodes[0].focus();e.span.childNodes[0].focus();e.span.onclick=function(l){(l||event).cancelBubble=true;return false};e.span.className="";e.span.parentNode.className="";var c=this;e.span.childNodes[0].onkeydown=function(l){if(!l){l=window.event}if(l.keyCode==13){l.cancelBubble=true;c._stopEdit(window.undefined)}else{if(l.keyCode==27){c._stopEdit(window.undefined,true)}}(l||event).cancelBubble=true};this.callEvent("onEdit",[1,h,this])}};function jsonPointer(c,a){this.d=c;this.dp=a}jsonPointer.prototype={text:function(){var a=function(h){var g=[];for(var e=0;e<h.length;e++){g.push("{"+c(h[e])+"}")}return g.join(",")};var c=function(h){var g=[];for(var e in h){if(typeof(h[e])=="object"){if(e.length){g.push('"'+e+'":['+a(h[e])+"]")}else{g.push('"'+e+'":{'+c(h[e])+"}")}}else{g.push('"'+e+'":"'+h[e]+'"')}}return g.join(",")};return"{"+c(this.d)+"}"},get:function(a){return this.d[a]},exists:function(){return !!this.d},content:function(){return this.d.content},each:function(g,m,l){var e=this.d[g];var n=new jsonPointer();if(e){for(var h=0;h<e.length;h++){n.d=e[h];m.apply(l,[n,h])}}},get_all:function(){return this.d},sub:function(a){return new jsonPointer(this.d[a],this.d)},sub_exists:function(a){return !!this.d[a]},each_x:function(g,n,m,l,h){var e=this.d[g];var o=new jsonPointer(0,this.d);if(e){for(h=h||0;h<e.length;h++){if(e[h][n]){o.d=e[h];if(m.apply(l,[o,h])==-1){return}}}}},up:function(a){return new jsonPointer(this.dp,this.d)},set:function(a,c){this.d[a]=c},clone:function(a){return new jsonPointer(this.d,this.dp)},through:function(e,m,q,h,r){var n=this.d[e];if(n.length){for(var g=0;g<n.length;g++){if(n[g][m]!=null&&n[g][m]!=""&&(!q||n[g][m]==q)){var l=new jsonPointer(n[g],this.d);h.apply(r,[l,g])}var o=this.d;this.d=n[g];if(this.sub_exists(e)){this.through(e,m,q,h,r)}this.d=o}}}};dhtmlXTreeObject.prototype.loadJSArrayFile=function(file,callback){if(!this.parsCount){this.callEvent("onXLS",[this,this._ld_id])}this._ld_id=null;this.xmlstate=1;var that=this;this.XMLLoader=function(xml,callback){eval("var z="+xml.responseText);this.loadJSArray(z);if(callback){callback.call(this,xml)}};dhx4.ajax.get(file,function(obj){that.XMLLoader(obj.xmlDoc,callback)})};dhtmlXTreeObject.prototype.loadCSV=function(a,e){if(!this.parsCount){this.callEvent("onXLS",[this,this._ld_id])}this._ld_id=null;this.xmlstate=1;var c=this;this.XMLLoader=function(g,h){this.loadCSVString(g.responseText);if(h){h.call(this,g)}};dhx4.ajax.get(a,function(g){c.XMLLoader(g.xmlDoc,e)})};dhtmlXTreeObject.prototype.loadJSArray=function(a,g){var l=[];for(var c=0;c<a.length;c++){if(!l[a[c][1]]){l[a[c][1]]=[]}l[a[c][1]].push({id:a[c][0],text:a[c][2]})}var h={id:this.rootId};var e=function(o,n){if(l[o.id]){o.item=l[o.id];for(var m=0;m<o.item.length;m++){n(o.item[m],n)}}};e(h,e);this.loadJSONObject(h,g)};dhtmlXTreeObject.prototype.loadCSVString=function(a,l){var n=[];var c=a.split("\n");for(var g=0;g<c.length;g++){var e=c[g].split(",");if(!n[e[1]]){n[e[1]]=[]}n[e[1]].push({id:e[0],text:e[2]})}var m={id:this.rootId};var h=function(r,q){if(n[r.id]){r.item=n[r.id];for(var o=0;o<r.item.length;o++){q(r.item[o],q)}}};h(m,h);this.loadJSONObject(m,l)};dhtmlXTreeObject.prototype.loadJSONObject=function(a,c){if(!this.parsCount){this.callEvent("onXLS",[this,null])}this.xmlstate=1;var e=new jsonPointer(a);this._parse(e);this._p=e;if(c){c()}};dhtmlXTreeObject.prototype.loadJSON=function(file,callback){if(!this.parsCount){this.callEvent("onXLS",[this,this._ld_id])}this._ld_id=null;this.xmlstate=1;var that=this;this.XMLLoader=function(xml,callback){try{eval("var t="+xml.responseText)}catch(e){dhx4.callEvent("onLoadXMLerror",["Incorrect JSON",(xml),this]);return}var p=new jsonPointer(t);this._parse(p);this._p=p;if(callback){callback.call(this,xml)}};dhx4.ajax.get(file,function(obj){that.XMLLoader(obj.xmlDoc,callback)})};dhtmlXTreeObject.prototype.serializeTreeToJSON=function(){var a=['{"id":"'+this.rootId+'", "item":['];var e=[];for(var c=0;c<this.htmlNode.childsCount;c++){e.push(this._serializeItemJSON(this.htmlNode.childNodes[c]))}a.push(e.join(","));a.push("]}");return a.join("")};dhtmlXTreeObject.prototype._serializeItemJSON=function(m){var a=[];if(m.unParsed){return(m.unParsed.text())}if(this._selected.length){var e=this._selected[0].id}else{e=""}var l=m.span.innerHTML;l=l.replace(/\"/g,'\\"',l);if(!this._xfullXML){a.push('{ "id":"'+m.id+'", '+(this._getOpenState(m)==1?' "open":"1", ':"")+(e==m.id?' "select":"1",':"")+' "text":"'+l+'"'+(((this.XMLsource)&&(m.XMLload==0))?', "child":"1" ':""))}else{a.push('{ "id":"'+m.id+'", '+(this._getOpenState(m)==1?' "open":"1", ':"")+(e==m.id?' "select":"1",':"")+' "text":"'+l+'", "im0":"'+m.images[0]+'", "im1":"'+m.images[1]+'", "im2":"'+m.images[2]+'" '+(m.acolor?(', "aCol":"'+m.acolor+'" '):"")+(m.scolor?(', "sCol":"'+m.scolor+'" '):"")+(m.checkstate==1?', "checked":"1" ':(m.checkstate==2?', "checked":"-1"':""))+(m.closeable?', "closeable":"1" ':"")+(((this.XMLsource)&&(m.XMLload==0))?', "child":"1" ':""))}if((this._xuserData)&&(m._userdatalist)){a.push(', "userdata":[');var h=m._userdatalist.split(",");var g=[];for(var c=0;c<h.length;c++){g.push('{ "name":"'+h[c]+'" , "content":"'+m.userData["t_"+h[c]]+'" }')}a.push(g.join(","));a.push("]")}if(m.childsCount){a.push(', "item":[');var g=[];for(var c=0;c<m.childsCount;c++){g.push(this._serializeItemJSON(m.childNodes[c]))}a.push(g.join(","));a.push("]\n")}a.push("}\n");return a.join("")};function dhtmlXTreeFromHTML(obj){if(typeof(obj)!="object"){obj=document.getElementById(obj)}var n=obj;var id=n.id;var cont="";for(var j=0;j<obj.childNodes.length;j++){if(obj.childNodes[j].nodeType=="1"){if(obj.childNodes[j].tagName=="XMP"){var cHead=obj.childNodes[j];for(var m=0;m<cHead.childNodes.length;m++){cont+=cHead.childNodes[m].data}}else{if(obj.childNodes[j].tagName.toLowerCase()=="ul"){cont=dhx_li2trees(obj.childNodes[j],new Array(),0)}}break}}obj.innerHTML="";var t=new dhtmlXTreeObject(obj,"100%","100%",0);var z_all=new Array();for(b in t){z_all[b.toLowerCase()]=b}var atr=obj.attributes;for(var a=0;a<atr.length;a++){if((atr[a].name.indexOf("set")==0)||(atr[a].name.indexOf("enable")==0)){var an=atr[a].name;if(!t[an]){an=z_all[atr[a].name]}t[an].apply(t,atr[a].value.split(","))}}if(typeof(cont)=="object"){t.XMLloadingWarning=1;for(var i=0;i<cont.length;i++){var n=t.insertNewItem(cont[i][0],cont[i][3],cont[i][1]);if(cont[i][2]){t._setCheck(n,cont[i][2])}}t.XMLloadingWarning=0;t.lastLoadedXMLId=0;t._redrawFrom(t)}else{t.loadXMLString("<tree id='0'>"+cont+"</tree>")}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;a<c.length;a++){if(c[a].className=="dhtmlxTree"){dhtmlXTreeFromHTML(c[a])}}}function dhx_li2trees(r,l,e){for(var m=0;m<r.childNodes.length;m++){var q=r.childNodes[m];if((q.nodeType==1)&&(q.tagName.toLowerCase()=="li")){var o="";var n=null;var a=q.getAttribute("checked");for(var h=0;h<q.childNodes.length;h++){var g=q.childNodes[h];if(g.nodeType==3){o+=g.data}else{if(g.tagName.toLowerCase()!="ul"){o+=dhx_outer_html(g)}else{n=g}}}l[l.length]=[e,o,a,(q.id||(l.length+1))];if(n){l=dhx_li2trees(n,l,(q.id||l.length))}}}return l}function dhx_outer_html(c){if(c.outerHTML){return c.outerHTML}var a=document.createElement("DIV");a.appendChild(c.cloneNode(true));a=a.innerHTML;return a}if(window.addEventListener){window.addEventListener("load",dhx_init_trees,false)}else{if(window.attachEvent){window.attachEvent("onload",dhx_init_trees)}}dhtmlXTreeObject.prototype.parserExtension={_parseExtension:function(g,c,e){this._idpull[c.id]._attrs=c}};dhtmlXTreeObject.prototype.getAttribute=function(e,a){this._globalIdStorageFind(e);var c=this._idpull[e]._attrs;return c?c[a]:window.undefined};dhtmlXTreeObject.prototype.setAttribute=function(g,a,e){this._globalIdStorageFind(g);var c=(this._idpull[g]._attrs)||{};c[a]=e;this._idpull[g]._attrs=c};dhtmlXTreeObject.prototype.enableKeyboardNavigation=function(e){this._enblkbrd=dhx4.s2b(e);if(this._enblkbrd){if(_isFF){var c=window.getComputedStyle(this.parentObject,null)["position"];if((c!="absolute")&&(c!="relative")){this.parentObject.style.position="relative"}}this._navKeys=[["up",38],["down",40],["open",39],["close",37],["call",13],["edit",113]];var a=this;var c=document.createElement("INPUT");c.className="a_dhx_hidden_input";c.autocomplete="off";if(window._KHTMLrv){c.style.color="white"}this.parentObject.appendChild(c);this.parentObject[_isOpera?"onkeypress":"onkeydown"]=function(g){if(a.callEvent("onKeyPress",[(g||window.event).keyCode,(g||window.event)])){return a._onKeyDown(g||window.event)}};this.parentObject.onclick=function(g){if(_isFF||_isIE){c.select()}if(window._KHTMLrv||_isOpera){c.focus()}}}else{this.parentObject.onkeydown=null}};dhtmlXTreeObject.prototype._onKeyDown=function(g){if(window.globalActiveDHTMLGridObject&&globalActiveDHTMLGridObject.isActive){return true}var a=this;for(var c=0;c<this._navKeys.length;c++){if(this._navKeys[c][1]==g.keyCode){this["_onkey_"+this._navKeys[c][0]].apply(this,[this.getSelectedItemId()]);if(g.preventDefault){g.preventDefault()}(g||event).cancelBubble=true;return false}}if(this._textSearch){return this._searchItemByKey(g)}return true};dhtmlXTreeObject.prototype._onkey_up=function(e){var a=this._globalIdStorageFind(e);if(!a){return}var c=this._getPrevVisibleNode(a);if(c.id==this.rootId){return}this.focusItem(c.id);this.selectItem(c.id,false)};dhtmlXTreeObject.prototype._onkey_down=function(e){var a=this._globalIdStorageFind(e);if(!a){return}var c=this._getNextVisibleNode(a);if(c.id==this.rootId){return}this.focusItem(c.id);this.selectItem(c.id,false)};dhtmlXTreeObject.prototype._onkey_open=function(a){this.openItem(a)};dhtmlXTreeObject.prototype._onkey_close=function(a){this.closeItem(a)};dhtmlXTreeObject.prototype._onkey_call=function(a){if(this.stopEdit){this.stopEdit();this.parentObject.lastChild.focus();this.parentObject.lastChild.focus();this.selectItem(a,true)}else{this.selectItem(this.getSelectedItemId(),true)}};dhtmlXTreeObject.prototype._onkey_edit=function(a){if(this.editItem){this.editItem(a)}};dhtmlXTreeObject.prototype._getNextVisibleNode=function(a,c){if((!c)&&(this._getOpenState(a)>0)){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=dhx4.s2b(c);if(!this._textSearch){return}this._textSearchString="";var a=this;this._markItem2=this._markItem;this._markItem=function(e){if(!a._textSearchInProgress){a._textSearchString=""}a._markItem2(e)}};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,e){if((e===null)||(this._globalIdStorageFind("fake_load_xml_"+e))){return}var c=this.XMLsource;this.XMLsource=null;this.insertNewItem(e,"fake_load_xml_"+e,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,h,c){if(!this._locker){this._init_lock()}if(h){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 g=a.span.parentNode;var e=g.previousSibling;this.dragger.removeDraggableItem(g);this.dragger.removeDraggableItem(e)}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 g=a.span.parentNode;var e=g.previousSibling;this.dragger.addDraggableItem(g,this);this.dragger.addDraggableItem(e,this)}if(!c){this._correctPlus(a)}};dhtmlXTreeObject.prototype.lockItem=function(e,c){if(!this._locker){this._init_lock()}this._lockOn=false;var a=this._globalIdStorageFind(e);this._lockOn=true;this._lockItem(a,dhx4.s2b(c))};dhtmlXTreeObject.prototype.setLockedIcons=function(e,c,a){if(!this._locker){this._init_lock()}this.lico0=e;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(e,a,c){if(!this.skipLock){if((!c)&&(this._lockOn==true)&&(this._locker[e]==true)){return null}}return this._globalIdStorageFindA(e,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(/<item[^>]+locked\=\"1\"[^>]+\/>/g,"")};dhtmlXTreeObject.prototype._moveNodeToA=dhtmlXTreeObject.prototype._moveNodeTo;dhtmlXTreeObject.prototype._moveNodeTo=function(a,e,c){if((e.treeNod.isLocked)&&(e.treeNod.isLocked(e.id))){return false}return this._moveNodeToA(a,e,c)};dhtmlXTreeObject.prototype.lockTree=function(a){if(dhx4.s2b(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=dhx4.s2b(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(g,c,e){var a=this._globalIdStorageFind(g);if(!a){return false}this._reorderBranch(a,(c.toString().toLowerCase()=="asc"),dhx4.s2b(e))};dhtmlXTreeObject.prototype.setCustomSortFunction=function(a){this._csfunca=a};dhtmlXTreeObject.prototype._reorderBranch=function(n,c,o){var a=[];var l=n.childsCount;if(!l){return}var h=n.childNodes[0].tr.parentNode;for(var g=0;g<l;g++){a[g]=n.childNodes[g];h.removeChild(a[g].tr)}var e=this;if(c==1){if(this._csfunca){a.sort(function(q,m){return e._csfunca(q.id,m.id)})}else{a.sort(function(q,m){return((q.span.innerHTML.toUpperCase()>m.span.innerHTML.toUpperCase())?1:((q.span.innerHTML.toUpperCase()==m.span.innerHTML.toUpperCase())?0:-1))})}}else{if(this._csfunca){a.sort(function(q,m){return e._csfunca(m.id,q.id)})}else{a.sort(function(q,m){return((q.span.innerHTML.toUpperCase()<m.span.innerHTML.toUpperCase())?1:((q.span.innerHTML.toUpperCase()==m.span.innerHTML.toUpperCase())?0:-1))})}}for(var g=0;g<l;g++){h.appendChild(a[g].tr);n.childNodes[g]=a[g];if((o)&&(a[g].unParsed)){a[g].unParsed.set("order",c?1:-1)}else{if((o)&&(a[g].childsCount)){this._reorderBranch(a[g],c,o)}}}for(var g=0;g<l;g++){this._correctPlus(a[g]);this._correctLine(a[g])}};dhtmlXTreeObject.prototype._reorderXMLBranch=function(l){var n=l.getAttribute("order");if(n=="none"){return}var c=(n==1);var h=l.childNodes.length;if(!h){return}var a=new Array();var e=0;for(var g=0;g<h;g++){if(l.childNodes[g].nodeType==1){a[e]=l.childNodes[g];e++}}for(var g=h-1;g!=0;g--){l.removeChild(l.childNodes[g])}if(c){a.sort(function(o,m){return((o.getAttribute("text")>m.getAttribute("text"))?1:((o.getAttribute("text")==m.getAttribute("text"))?0:-1))})}else{a.sort(function(o,m){return((o.getAttribute("text")<m.getAttribute("text"))?1:((o.getAttribute("text")==m.getAttribute("text"))?0:-1))})}for(var g=0;g<e;g++){a[g].setAttribute("order",n);l.appendChild(a[g])}l.setAttribute("order","none")};dhtmlXTreeObject.prototype._serEnts=[["&","&amp;"],["<","&lt;"],[">","&gt;"]];dhtmlXTreeObject.prototype.registerXMLEntity=function(a,c){this._serEnts[this._serEnts.length]=[a,c,new RegExp(a,"g")]};dhtmlXTreeObject.prototype.setSerializationLevel=function(a,c,h,l,e){this._xuserData=dhx4.s2b(a);this._xfullXML=dhx4.s2b(c);this._dtd=e;this._xescapeEntities=dhx4.s2b(h);if(dhx4.s2b(l)){this._apreUC="<![CDATA[";this._apstUC="]]>"}else{}for(var g=0;g<this._serEnts.length;g++){this._serEnts[g][2]=new RegExp(this._serEnts[g][0],"g")}};dhtmlXTreeObject.prototype.serializeTree=function(){if(this.stopEdit){this.stopEdit()}this._apreUC=this._apreUC||"";this._apstUC=this._apstUC||"";var a='<?xml version="1.0"?>';if(this._dtd){a+='<!DOCTYPE tree SYSTEM "'+this._dtd+'">'}a+='<tree id="'+this.rootId+'">';if((this._xuserData)&&(this._idpull[this.rootId]._userdatalist)){var e=this._idpull[this.rootId]._userdatalist.split(",");for(var c=0;c<e.length;c++){a+='<userdata name="'+e[c]+'">'+this._apreUC+this._idpull[this.rootId].userData["t_"+e[c]]+this._apstUC+"</userdata>"}}for(var c=0;c<this.htmlNode.childsCount;c++){a+=this._serializeItem(this.htmlNode.childNodes[c])}a+="</tree>";return a};dhtmlXTreeObject.prototype._serializeItem=function(m){if(m.unParsed){if(document.all){return m.unParsed.d.xml}else{var a=new XMLSerializer();return a.serializeToString(m.unParsed.d)}}var c="";if(this._selected.length){var g=this._selected[0].id}else{g='"'}var l=m.span.innerHTML;if(this._xescapeEntities){for(var e=0;e<this._serEnts.length;e++){l=l.replace(this._serEnts[e][2],this._serEnts[e][1])}}if(!this._xfullXML){c='<item id="'+m.id+'" '+(this._getOpenState(m)==1?' open="1" ':"")+(g==m.id?' select="1"':"")+' text="'+l+'"'+(((this.XMLsource)&&(m.XMLload==0))?' child="1" ':"")+">"}else{c='<item id="'+m.id+'" '+(this._getOpenState(m)==1?' open="1" ':"")+(g==m.id?' select="1"':"")+' text="'+l+'" im0="'+m.images[0]+'" im1="'+m.images[1]+'" im2="'+m.images[2]+'" '+(m.acolor?('aCol="'+m.acolor+'" '):"")+(m.scolor?('sCol="'+m.scolor+'" '):"")+(m.checkstate==1?'checked="1" ':(m.checkstate==2?'checked="-1"':""))+(m.closeable?'closeable="1" ':"")+(((this.XMLsource)&&(m.XMLload==0))?' child="1" ':"")+">"}if((this._xuserData)&&(m._userdatalist)){var h=m._userdatalist.split(",");for(var e=0;e<h.length;e++){c+='<userdata name="'+h[e]+'">'+this._apreUC+m.userData["t_"+h[e]]+this._apstUC+"</userdata>"}}for(var e=0;e<m.childsCount;e++){c+=this._serializeItem(m.childNodes[e])}c+="</item>";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=dhx4.s2b(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(e,c){var h=this._escape(this.serializeTree());var a=4000;if(h.length>a){if(navigator.appName.indexOf("Microsoft")!=-1){return false}this.setCookie("treeStatex"+e,Math.ceil(h.length/a));for(var g=0;g<Math.ceil(h.length/a);g++){this.setCookie("treeStatex"+e+"x"+g,h.substr(g*a,a),c)}}else{this.setCookie("treeStatex"+e,h,c)}var h=this.getCookie("treeStatex"+e);if(!h){this.setCookie("treeStatex"+e,"",c);return false}return true};dhtmlXTreeObject.prototype.loadState=function(a){var g=this.getCookie("treeStatex"+a);if(!g){return false}if(g.length){if(g.toString().length<4){var e="";for(var c=0;c<g;c++){e+=this.getCookie("treeStatex"+a+"x"+c)}g=e}this.loadXMLString((this.utfesc=="utf8")?decodeURI(g):unescape(g))}return true};dhtmlXTreeObject.prototype.setCookie=function(c,e,a){var g=c+"="+e+(a?("; "+a):"");document.cookie=g};dhtmlXTreeObject.prototype.getCookie=function(c){var e=c+"=";if(document.cookie.length>0){var g=document.cookie.indexOf(e);if(g!=-1){g+=e.length;var a=document.cookie.indexOf(";",g);if(a==-1){a=document.cookie.length}return document.cookie.substring(g,a)}}};dhtmlXTreeObject.prototype.saveOpenStates=function(c,a){var g=[];for(var e=0;e<this.htmlNode.childsCount;e++){g=g.concat(this._collectOpenStates(this.htmlNode.childNodes[e]))}g=g.join(this.dlmtr);this.setCookie("treeOpenStatex"+c,g,a)};dhtmlXTreeObject.prototype.loadOpenStates=function(c){for(var e=0;e<this.htmlNode.childsCount;e++){this._xcloseAll(this.htmlNode.childNodes[e])}this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0";var h=getCookie("treeOpenStatex"+c);if(h){var a=h.split(this.dlmtr);for(var e=0;e<a.length;e++){var g=this._globalIdStorageFind(a[e]);if(g){if((this.XMLsource)&&(!g.XMLload)&&(g.id!=this.rootId)){this._delayedLoad(g,"loadOpenStates('"+c+"')");return}else{this.openItem(a[e])}}}}this.callEvent("onAllOpenDynamic",[])};dhtmlXTreeObject.prototype._delayedLoad=function(c,a){this.afterLoadMethod=a;this.onLoadReserve=this.onXLE;this.onXLE=this._delayedLoadStep2;this._loadDynXML(c.id)};dhtmlXTreeObject.prototype._delayedLoadStep2=function(tree){tree.onXLE=tree.onLoadReserve;window.setTimeout(function(){dhtmlx.temp=tree;eval("dhtmlx.temp."+tree.afterLoadMethod)},100);if(tree.onXLE){tree.onXLE(tree)}tree.callEvent("onXLE",[tree])};dhtmlXTreeObject.prototype._collectOpenStates=function(c){var e=[];if(this._getOpenState(c)==1){e.push(c.id);for(var a=0;a<c.childsCount;a++){e=e.concat(this._collectOpenStates(c.childNodes[a]))}}return e};function setCookie(a,c){document.cookie=a+"="+c}function getCookie(c){var e=c+"=";if(document.cookie.length>0){var g=document.cookie.indexOf(e);if(g!=-1){g+=e.length;var a=document.cookie.indexOf(";",g);if(a==-1){a=document.cookie.length}return(document.cookie.substring(g,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;a<c.childsCount;a++){if(this._getOpenState(c.childNodes[a])<0){this._HideShow(c.childNodes[a],2)}if(c.childNodes[a].childsCount>0){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=dhx4.s2b(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(/&nbsp;/g," ").replace(/(^[ \t]*)|([ \t]*$)/g,"")};function dhtmlxArray(a){return dhtmlx.extend((a||new Array()),dhtmlxArray._master)}dhtmlxArray._master={_dhx_find:function(c){for(var a=0;a<this.length;a++){if(c==this[a]){return a}}return -1},_dhx_insertAt:function(e,c){this[this.length]=null;for(var a=this.length-1;a>=e;a--){this[a]=this[a-1]}this[e]=c},_dhx_removeAt:function(a){this.splice(a,1)},_dhx_swapItems:function(a,e){var c=this[a];this[a]=this[e];this[e]=c}};function dhtmlXGridObject(id){if(dhtmlxEvent.initTouch){dhtmlxEvent.initTouch()}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="";dhx4._eventable(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=this.doLoadDetails;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._srdh=window.dhx4.readFromCss("dhxgrid_rh_"+name)+4;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"dhx_terrace":this._srdh=33;this.forceDivInHeader=true;break;case"dhx_web":this.forceDivInHeader=true;this._srdh=31;break;case"dhx_skyblue":this.forceDivInHeader=true;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=this._createHierarchy();if((this._fake)&&(!this._realfake)){this._fake._h2=this._h2}this._tgc={imgURL:null}}if(!this._hstyles){return}if(!this.skin_name){this.setSkin(window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxgrid")||"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;i<this.hdrLabels.length;i++){hdrRow.appendChild(document.createElement("TH"));hdrRow.childNodes[i]._cellIndex=i;hdrRow.childNodes[i].style.height="0px"}if(_isIE&&_isIE<8&&document.body.style.msTouchAction==this.undefined){hdrRow.style.position="absolute"}else{hdrRow.style.height="auto"}var hdrRow=this.hdr.insertRow(_isKHTML?2:1);hdrRow._childIndexes=new Array();var col_ex=0;for(var i=0;i<this.hdrLabels.length;i++){hdrRow._childIndexes[i]=i-col_ex;if((this.hdrLabels[i]==this.splitSign)&&(i!=0)){if(_isKHTML){hdrRow.insertCell(i-col_ex)}hdrRow.cells[i-col_ex-1].colSpan=(hdrRow.cells[i-col_ex-1].colSpan||1)+1;hdrRow.childNodes[i-col_ex-1]._cellIndex++;col_ex++;hdrRow._childIndexes[i]=i-col_ex;continue}hdrRow.insertCell(i-col_ex);hdrRow.childNodes[i-col_ex]._cellIndex=i;hdrRow.childNodes[i-col_ex]._cellIndexS=i;this.setColumnLabel(i,this.hdrLabels[i])}if(col_ex==0){hdrRow._childIndexes=null}this._cCount=this.hdrLabels.length;if(_isIE){window.setTimeout(function(){if(self.setSizes){self.setSizes()}},1)}if(!this.obj.firstChild){this.obj.appendChild(document.createElement("TBODY"))}var tar=this.obj.firstChild;if(!tar.firstChild){tar.appendChild(document.createElement("TR"));tar=tar.firstChild;if(_isIE&&_isIE<8&&document.body.style.msTouchAction==this.undefined){tar.style.position="absolute"}else{tar.style.height="auto"}for(var i=0;i<this.hdrLabels.length;i++){tar.appendChild(document.createElement("TH"));tar.childNodes[i].style.height="0px"}}this._c_order=null;if(this.multiLine!=true){this.obj.className+=" row20px"}this.sortImg.style.position="absolute";this.sortImg.style.display="none";this.sortImg.className="dhxgrid_sort_desc";this.sortImg.defLeft=0;if(this.noHeader){this.hdrBox.style.display="none"}else{this.noHeader=false}if(this._ivizcol){this.setColHidden()}this.attachHeader();this.attachHeader(0,0,"_aFoot");this.setSizes();if(fl){this.parseXML()}this.obj.scrollTop=0;if(this.dragAndDropOff){this.dragger.addDragLanding(this.entBox,this)}if(this._initDrF){this._initD()}dhx4.callEvent("onGridCreated",[this])};this.setColumnSizes=function(gridWidth){var summ=0;var fcols=[];var fix=0;for(var i=0;i<this._cCount;i++){if((this.initCellWidth[i]=="*")&&!this._hrrar[i]){this._awdth=false;fcols.push(i);continue}if(this.cellWidthType=="%"){if(typeof this.cellWidthPC[i]=="undefined"){this.cellWidthPC[i]=this.initCellWidth[i]}var cwidth=(gridWidth*this.cellWidthPC[i]/100)||0;if(fix>0.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;i<fcols.length;i++){var next=Math.max((this._drsclmW?(this._drsclmW[fcols[i]]||0):0),ms);this.cellWidthPX[fcols[i]]=next;summ+=next}if(gridWidth>summ){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){if(!this.globalBox.clientWidth){return}var ow=this.globalBox.clientWidth;var splitOuterBorder=(this.globalBox.offsetWidth-ow)/2;if(this._delta_x&&!this._realfake){this.globalBox.style.width=this._delta_x;var owu=this.globalBox.clientWidth;this.entBox.style.width=Math.max(0,(owu+(quirks?splitOuterBorder*2:0))-this._fake.entBox.clientWidth)+"px";if(owu!=this._lastTimeSplitWidth){this._fake._correctSplit(this._fake.entBox.clientWidth);this._lastTimeSplitWidth=owu}}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.chngCellWidth=function(){if((_isOpera)&&(this.ftr)){this.ftr.width=this.objBox.scrollWidth+"px"}var l=this._cCount;for(var i=0;i<l;i++){this.hdr.rows[0].cells[i].style.width=this.cellWidthPX[i]+"px";this.obj.rows[0].childNodes[i].style.width=this.cellWidthPX[i]+"px";if(this.ftr){this.ftr.rows[0].cells[i].style.width=this.cellWidthPX[i]+"px"}}};this.setDelimiter=function(delim){this.delim=delim};this.setInitWidthsP=function(wp){this.cellWidthType="%";this.initCellWidth=wp.split(this.delim.replace(/px/gi,""));if(!arguments[1]){this._setAutoResize()}};this._setAutoResize=function(){if(this._realfake){return}var el=window;var self=this;dhtmlxEvent(window,"resize",function(){window.clearTimeout(self._resize_timer);if(self._setAutoResize){self._resize_timer=window.setTimeout(function(){if(self.setSizes){self.setSizes()}if(self._fake){self._fake._correctSplit()}},100)}})};this.setInitWidths=function(wp){this.cellWidthType="px";this.initCellWidth=wp.split(this.delim);if(_isFF){for(var i=0;i<this.initCellWidth.length;i++){if(this.initCellWidth[i]!="*"){this.initCellWidth[i]=parseInt(this.initCellWidth[i])}}}};this.enableMultiline=function(state){this.multiLine=dhx4.s2b(state)};this.enableMultiselect=function(state){this.selMultiRows=dhx4.s2b(state)};this.setImagePath=function(path){path=path.replace(/imgs\/dhxgrid_[a-z]*\/$/,"imgs/");this._imgURL=path;this.imgURL=path+"dhxgrid_"+(this.skin_name||"dhx_skyblue").replace("dhx_","")+"/";this.iconTree=this.imgURL+"tree/"};this.setImagesPath=this.setImagePath;this.setIconPath=function(path){this.iconURL=path};this.setIconsPath=this.setIconPath;this.changeCursorState=function(ev){var el=ev.target||ev.srcElement;if(el.tagName!="TD"){el=this.getFirstParentOfType(el,"TD")}if(!el){return}if((el.tagName=="TD")&&(this._drsclmn)&&(!this._drsclmn[el._cellIndex])){return el.style.cursor="default"}var check=(ev.layerX||0)+(((!_isIE)&&(ev.target.tagName=="DIV"))?el.offsetLeft:0);if((el.offsetWidth-(ev.offsetX||(parseInt(this.getPosition(el,this.hdrBox))-check)*-1))<(_isOpera?20:10)){el.style.cursor="E-resize"}else{el.style.cursor="default"}if(_isOpera){this.hdrBox.scrollLeft=this.objBox.scrollLeft}};this.startColResize=function(ev){if(this.resized){this.stopColResize()}this.resized=null;var el=ev.target||ev.srcElement;if(el.tagName!="TD"){el=this.getFirstParentOfType(el,"TD")}var x=ev.clientX;var tabW=this.hdr.offsetWidth;var startW=parseInt(el.offsetWidth);if(el.tagName=="TD"&&el.style.cursor!="default"){if((this._drsclmn)&&(!this._drsclmn[el._cellIndex])){return}self._old_d_mm=document.body.onmousemove;self._old_d_mu=document.body.onmouseup;document.body.onmousemove=function(e){if(self){self.doColResize(e||window.event,el,startW,x,tabW)}};document.body.onmouseup=function(){if(self){self.stopColResize()}}}};this.stopColResize=function(){document.body.onmousemove=self._old_d_mm||"";document.body.onmouseup=self._old_d_mu||"";this.setSizes();this.doOnScroll(0,1);this.callEvent("onResizeEnd",[this])};this.doColResize=function(ev,el,startW,x,tabW){el.style.cursor="E-resize";this.resized=el;var fcolW=startW+(ev.clientX-x);var wtabW=tabW+(ev.clientX-x);if(!(this.callEvent("onResize",[el._cellIndex,fcolW,this]))){return}if(_isIE){this.objBox.scrollLeft=this.hdrBox.scrollLeft}var result=false;if(el.colSpan>1){var a_sizes=new Array();for(var i=0;i<el.colSpan;i++){a_sizes[i]=Math.round(fcolW*this.hdr.rows[0].childNodes[el._cellIndexS+i].offsetWidth/el.offsetWidth)}for(var i=0;i<el.colSpan;i++){result=this._setColumnSizeR(el._cellIndexS+i*1,a_sizes[i])}}else{result=this._setColumnSizeR(el._cellIndex,fcolW)}this.doOnScroll(0,1);this.setSizes();if(this._fake&&this._awdth){this._fake._correctSplit()}return result};this._setColumnSizeR=function(ind,fcolW){if(fcolW>((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()}}else{return false}};this.setSortImgState=function(state,ind,order,row){order=(order||"asc").toLowerCase();if(!dhx4.s2b(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;i<r.childNodes.length;i++){if(r.childNodes[i]._cellIndexS==ind){this.r_fldSorted=r.childNodes[i];return this.setSortImgPos()}}return this.setSortImgState(state,ind,order,(row||1)+1)};this.setSortImgPos=function(ind,mode,hRowInd,el){if(this._hrrar&&this._hrrar[this.r_fldSorted?this.r_fldSorted._cellIndex:ind]){return}if(!el){if(!ind){var el=this.r_fldSorted}else{var el=this.hdr.rows[hRowInd||0].cells[ind]}}if(el!=null){var pos=this.getPosition(el,this.hdrBox);var wdth=el.offsetWidth;this.sortImg.style.left=Number(pos[0]+wdth-13)+"px";this.sortImg.defLeft=parseInt(this.sortImg.style.left);this.sortImg.style.top=Number(pos[1]+5)+"px";if((!this.useImagesInHeader)&&(!mode)){this.sortImg.style.display="inline"}this.sortImg.style.left=this.sortImg.defLeft+"px"}};this.setActive=function(fl){if(arguments.length==0){var fl=true}if(fl==true){if(globalActiveDHTMLGridObject&&(globalActiveDHTMLGridObject!=this)){globalActiveDHTMLGridObject.editStop();globalActiveDHTMLGridObject.callEvent("onBlur",[globalActiveDHTMLGridObject])}globalActiveDHTMLGridObject=this;this.isActive=true}else{this.isActive=false;this.callEvent("onBlur",[this])}};this._doClick=function(ev){var selMethod=0;var el=this.getFirstParentOfType(_isIE?ev.srcElement:ev.target,"TD");if(!el||!el.parentNode||!el.parentNode.idd){return}var fl=true;if(this.markedCells){var markMethod=0;if(ev.shiftKey||ev.metaKey){markMethod=1}if(ev.ctrlKey){markMethod=2}this.doMark(el,markMethod);return true}if(this.selMultiRows!=false){if(ev.shiftKey&&this.row!=null&&this.selectedRows.length){selMethod=1}if(ev.ctrlKey||ev.metaKey){selMethod=2}}return this.doClick(el,fl,selMethod,false)};this._doContClick=function(ev){var el=this.getFirstParentOfType(_isIE?ev.srcElement:ev.target,"TD");if((!el)||(typeof(el.parentNode.idd)=="undefined")){this.callEvent("onEmptyClick",[ev]);return true}if(ev.button==2||(_isMacOS&&ev.ctrlKey)){if(!this.callEvent("onRightClick",[el.parentNode.idd,el._cellIndex,ev])){var z=function(e){(e||event).cancelBubble=true;return false};(ev.srcElement||ev.target).oncontextmenu=z;return z(ev)}if(this._ctmndx){if(!(this.callEvent("onBeforeContextMenu",[el.parentNode.idd,el._cellIndex,this]))){return true}if(_isIE){ev.srcElement.oncontextmenu=function(){event.cancelBubble=true;return false}}if(this._ctmndx.showContextMenu){var dEl0=window.document.documentElement;var dEl1=window.document.body;var corrector=new Array((dEl0.scrollLeft||dEl1.scrollLeft),(dEl0.scrollTop||dEl1.scrollTop));if(_isIE){var x=ev.clientX+corrector[0];var y=ev.clientY+corrector[1]}else{var x=ev.pageX;var y=ev.pageY}this._ctmndx.showContextMenu(x-1,y-1);this.contextID=this._ctmndx.contextMenuZoneId=el.parentNode.idd+"_"+el._cellIndex;this._ctmndx._skip_hide=true}else{el.contextMenuId=el.parentNode.idd+"_"+el._cellIndex;el.contextMenu=this._ctmndx;el.a=this._ctmndx._contextStart;el.a(el,ev);el.a=null}ev.cancelBubble=true;return false}}else{if(this._ctmndx){if(this._ctmndx.hideContextMenu){this._ctmndx.hideContextMenu()}else{this._ctmndx._contextEnd()}}}return true};this.doClick=function(el,fl,selMethod,show){if(!this.selMultiRows){selMethod=0}var psid=this.row?this.row.idd:0;this.setActive(true);if(!selMethod){selMethod=0}if(this.cell!=null){this.cell.className=this.cell.className.replace(/cellselected/g,"")}if(el.tagName=="TD"){if(this.checkEvent("onSelectStateChanged")){var initial=this.getSelectedId()}var prow=this.row;if(selMethod==1){var elRowIndex=this.rowsCol._dhx_find(el.parentNode);var lcRowIndex=this.rowsCol._dhx_find(this.lastClicked);if(elRowIndex>lcRowIndex){var strt=lcRowIndex;var end=elRowIndex}else{var strt=elRowIndex;var end=lcRowIndex}for(var i=0;i<this.rowsCol.length;i++){if((i>=strt&&i<=end)){if(this.rowsCol[i]&&(!this.rowsCol[i]._sRow)){if(!this.rowsCol[i].idd){continue}if(this.rowsCol[i].className.indexOf("rowselected")==-1&&(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.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])}}if(skipRowSelection){return false}}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<coll.length;i++){this.render_row(i).className+=" rowselected"}this.selectedRows=dhtmlxArray([].concat(coll));if(this.selectedRows.length){this.row=this.selectedRows[0];this.cell=this.row.cells[0]}if((this._fake)&&(!this._realfake)){this._fake.selectAll()}};this.selectCell=function(r,cInd,fl,preserve,edit,show){if(!fl){fl=false}if(typeof(r)!="object"){r=this.render_row(r)}if(!r||r==-1){return null}if(r._childIndexes){var c=r.childNodes[r._childIndexes[cInd]]}else{var c=r.childNodes[cInd]}if(!c){c=r.childNodes[0]}if(!this.markedCells){if(preserve){this.doClick(c,fl,3,show)}else{this.doClick(c,fl,0,show)}}else{this.doMark(c,preserve?2:0)}if(edit){this.editCell()}};this.moveToVisible=function(cell_obj,onlyVScroll){if(this.pagingOn){var newPage=Math.floor(this.getRowIndex(cell_obj.parentNode.idd)/this.rowsBufferOutSize)+1;if(newPage!=this.currentPage){this.changePage(newPage)}}try{if(cell_obj.offsetHeight){var distance=cell_obj.offsetLeft+cell_obj.offsetWidth+20;var scrollLeft=0;if(distance>(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.scrollLeft){distance-=cell_obj.offsetWidth*2/3;if(distance<this.objBox.scrollLeft){scrollLeft=cell_obj.offsetLeft-5}}}if((scrollLeft)&&(!onlyVScroll)){this.objBox.scrollLeft=scrollLeft}}if(!cell_obj.offsetHeight){var mask=this._realfake?this._fake.rowsAr[cell_obj.parentNode.idd]:cell_obj.parentNode;distance=this.rowsBuffer._dhx_find(mask)*this._srdh}else{distance=cell_obj.offsetTop}var distancemax=distance+cell_obj.offsetHeight+38;if(distancemax>(this.objBox.offsetHeight+this.objBox.scrollTop)){var scrollTop=distance}else{if(distance<this.objBox.scrollTop){var scrollTop=distance-5}}if(scrollTop){this.objBox.scrollTop=scrollTop}}catch(er){}};this.editCell=function(){if(this.editor&&this.cell==this.editor.cell){return}this.editStop();if((this.isEditable!=true)||(!this.cell)){return false}var c=this.cell;if(c.parentNode._locked){return false}this.editor=this.cells4(c);if(this.editor!=null){if(this.editor.isDisabled()){this.editor=null;return false}if(this.callEvent("onEditCell",[0,this.row.idd,this.cell._cellIndex])!=false&&this.editor.edit){this._Opera_stop=(new Date).valueOf();this.editor.edit();c.className+=" editable";this.callEvent("onEditCell",[1,this.row.idd,this.cell._cellIndex])}else{this.editor=null}}};this.editStop=function(mode){if(_isOpera){if(this._Opera_stop){if((this._Opera_stop*1+50)>(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;if(g==null){return}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._cCount){if(arow._childIndexes){i=arow._childIndexes[acell._cellIndex]+dir}acell=arow.childNodes[i]}else{acell=this._nextRowCell(arow,dir,(dir==1?0:(this._cCount-1)))}}if(!acell){if((dir==1)&&this.tabEnd){this.tabEnd.focus();this.tabEnd.focus();this.setActive(false)}if((dir==-1)&&this.tabStart){this.tabStart.focus();this.tabStart.focus();this.setActive(false)}return null}if(acell.style.display!="none"&&(!this.smartTabOrder||!this.cells(acell.parentNode.idd,acell._cellIndex).isDisabled())){return acell}return this._getNextCell(acell,dir)};this._nextRow=function(ind,dir){var r=this.render_row(ind+dir);if(!r||r==-1){return null}if(r&&r.style.display=="none"){return this._nextRow(ind+dir,dir)}return r};this.scrollPage=function(dir){if(!this.rowsBuffer.length){return}var master=this._realfake?this._fake:this;var new_ind=Math.floor((master._r_select||this.getRowIndex(this.row.idd)||0)+(dir)*this.objBox.offsetHeight/(this._srdh||20));if(new_ind<0){new_ind=0}if(new_ind>=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.className!="dhxcombo_input"&&((!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<this.selectedRows.length;i++){var id=this.selectedRows[i].idd;if(uni[id]){continue}selAr[selAr.length]=id;uni[id]=true}if(selAr.length==0){return null}else{return selAr.join(this.delim)}};this.getSelectedCellIndex=function(){if(this.cell!=null){return this.cell._cellIndex}else{return -1}};this.getColWidth=function(ind){return parseInt(this.cellWidthPX[ind])};this.setColWidth=function(ind,value){if(value=="*"){this.initCellWidth[ind]="*"}else{if(this._hrrar[ind]){return}if(this.cellWidthType=="px"){this.cellWidthPX[ind]=parseInt(value)}else{this.cellWidthPC[ind]=parseInt(value)}}this.setSizes()};this.getRowIndex=function(row_id){for(var i=0;i<this.rowsBuffer.length;i++){if(this.rowsBuffer[i]&&this.rowsBuffer[i].idd==row_id){return i}}return -1};this.getRowId=function(ind){return this.rowsBuffer[ind]?this.rowsBuffer[ind].idd:this.undefined};this.setRowId=function(ind,row_id){this.changeRowId(this.getRowId(ind),row_id)};this.changeRowId=function(oldRowId,newRowId){if(oldRowId==newRowId){return}var row=this.rowsAr[oldRowId];row.idd=newRowId;if(this.UserData[oldRowId]){this.UserData[newRowId]=this.UserData[oldRowId];this.UserData[oldRowId]=null}if(this._h2&&this._h2.get[oldRowId]){this._h2.get[newRowId]=this._h2.get[oldRowId];this._h2.get[newRowId].id=newRowId;delete this._h2.get[oldRowId]}this.rowsAr[oldRowId]=null;this.rowsAr[newRowId]=row;for(var i=0;i<row.childNodes.length;i++){if(row.childNodes[i]._code){row.childNodes[i]._code=this._compileSCL(row.childNodes[i]._val,row.childNodes[i])}}if(this._mat_links&&this._mat_links[oldRowId]){var a=this._mat_links[oldRowId];delete this._mat_links[oldRowId];for(var c in a){for(var i=0;i<a[c].length;i++){this._compileSCL(a[c][i].original,a[c][i])}}}this.callEvent("onRowIdChange",[oldRowId,newRowId])};this.setColumnIds=function(ids){this.columnIds=ids.split(this.delim)};this.setColumnId=function(ind,id){this.columnIds[ind]=id};this.getColIndexById=function(id){for(var i=0;i<this.columnIds.length;i++){if(this.columnIds[i]==id){return i}}};this.getColumnId=function(cin){return this.columnIds[cin]};this.getColumnLabel=function(cin,ind,hdr){var z=(hdr||this.hdr).rows[(ind||0)+1];for(var i=0;i<z.cells.length;i++){if(z.cells[i]._cellIndexS==cin){return(_isIE?z.cells[i].innerText:z.cells[i].textContent)}}return""};this.getColLabel=this.getColumnLabel;this.getFooterLabel=function(cin,ind){return this.getColumnLabel(cin,ind,this.ftr)};this.setRowTextBold=function(row_id){var r=this.getRowById(row_id);if(r){r.style.fontWeight="bold"}};this.setRowTextStyle=function(row_id,styleString){var r=this.getRowById(row_id);if(!r){return}for(var i=0;i<r.childNodes.length;i++){var pfix=r.childNodes[i]._attrs.style||"";if((this._hrrar)&&(this._hrrar[i])){pfix="display:none;"}if(_isIE){r.childNodes[i].style.cssText=pfix+"width:"+r.childNodes[i].style.width+";"+styleString}else{r.childNodes[i].style.cssText=pfix+"width:"+r.childNodes[i].style.width+";"+styleString}}};this.setRowColor=function(row_id,color){var r=this.getRowById(row_id);for(var i=0;i<r.childNodes.length;i++){r.childNodes[i].bgColor=color}};this.setCellTextStyle=function(row_id,ind,styleString){var r=this.getRowById(row_id);if(!r){return}var cell=r.childNodes[r._childIndexes?r._childIndexes[ind]:ind];if(!cell){return}var pfix="";if((this._hrrar)&&(this._hrrar[ind])){pfix="display:none;"}if(_isIE){cell.style.cssText=pfix+"width:"+cell.style.width+";"+styleString}else{cell.style.cssText=pfix+"width:"+cell.style.width+";"+styleString}};this.setRowTextNormal=function(row_id){var r=this.getRowById(row_id);if(r){r.style.fontWeight="normal"}};this.doesRowExist=function(row_id){if(this.getRowById(row_id)!=null){return true}else{return false}};this.getColumnsNum=function(){return this._cCount};this.moveRowUp=function(row_id){var r=this.getRowById(row_id);if(this.isTreeGrid()){return this.moveRowUDTG(row_id,-1)}var rInd=this.rowsCol._dhx_find(r);if((r.previousSibling)&&(rInd!=0)){r.parentNode.insertBefore(r,r.previousSibling);this.rowsCol._dhx_swapItems(rInd,rInd-1);this.setSizes();var bInd=this.rowsBuffer._dhx_find(r);this.rowsBuffer._dhx_swapItems(bInd,bInd-1);if(this._cssEven){this._fixAlterCss(rInd-1)}}};this.moveRowDown=function(row_id){var r=this.getRowById(row_id);if(this.isTreeGrid()){return this.moveRowUDTG(row_id,1)}var rInd=this.rowsCol._dhx_find(r);if(r.nextSibling){this.rowsCol._dhx_swapItems(rInd,rInd+1);if(r.nextSibling.nextSibling){r.parentNode.insertBefore(r,r.nextSibling.nextSibling)}else{r.parentNode.appendChild(r)}this.setSizes();var bInd=this.rowsBuffer._dhx_find(r);this.rowsBuffer._dhx_swapItems(bInd,bInd+1);if(this._cssEven){this._fixAlterCss(rInd)}}};this.getCombo=function(col_ind){if(!this.combos[col_ind]){this.combos[col_ind]=new dhtmlXGridComboObject()}return this.combos[col_ind]};this.setUserData=function(row_id,name,value){if(!row_id){row_id="gridglobaluserdata"}if(!this.UserData[row_id]){this.UserData[row_id]=new Hashtable()}this.UserData[row_id].put(name,value)};this.getUserData=function(row_id,name){if(!row_id){row_id="gridglobaluserdata"}this.getRowById(row_id);var z=this.UserData[row_id];return(z?z.get(name):"")};this.setEditable=function(fl){this.isEditable=dhx4.s2b(fl)};this.selectRowById=function(row_id,multiFL,show,call){if(!call){call=false}this.selectCell(this.getRowById(row_id),0,call,multiFL,false,show)};this.clearSelection=function(){this.editStop();for(var i=0;i<this.selectedRows.length;i++){var r=this.rowsAr[this.selectedRows[i].idd];if(r){r.className=r.className.replace(/rowselected/g,"")}}this.selectedRows=dhtmlxArray();this.row=null;if(this.cell!=null){this.cell.className=this.cell.className.replace(/cellselected/g,"");this.cell=null}this.callEvent("onSelectionCleared",[])};this.copyRowContent=function(from_row_id,to_row_id){var frRow=this.getRowById(from_row_id);if(!this.isTreeGrid()){for(var i=0;i<frRow.cells.length;i++){this.cells(to_row_id,i).setValue(this.cells(from_row_id,i).getValue())}}else{this._copyTreeGridRowContent(frRow,from_row_id,to_row_id)}if(!_isIE){this.getRowById(from_row_id).cells[0].height=frRow.cells[0].offsetHeight}};this.setFooterLabel=function(c,label,ind){return this.setColumnLabel(c,label,ind,this.ftr)};this.setColumnLabel=function(c,label,ind,hdr){var z=(hdr||this.hdr).rows[ind||1];var col=(z._childIndexes?z._childIndexes[c]:c);if(!z.cells[col]){return}if(!this.useImagesInHeader){var hdrHTML="<div class='hdrcell'>";if(label.indexOf("img:[")!=-1){var imUrl=label.replace(/.*\[([^>]+)\].*/,"$1");label=label.substr(label.indexOf("]")+1,label.length);hdrHTML+="<img width='18px' height='18px' align='absmiddle' src='"+imUrl+"' hspace='2'>"}hdrHTML+=label;hdrHTML+="</div>";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="<img src='"+label+"'>";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=this._createHierarchy();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<arLab.length;i++){arWdth[arWdth.length]=Math.round(100/arLab.length);arTyp[arTyp.length]="ed";arAlg[arAlg.length]="left";arVAlg[arVAlg.length]="middle";arSrt[arSrt.length]="na"}this.splitSign=splitSign||"#cspan";this.hdrLabels=arLab;this.cellWidth=arWdth;if(!this.initCellWidth.length){this.setInitWidthsP(arWdth.join(this.delim),true)}this.cellType=arTyp;this.cellAlign=arAlg;this.cellVAlign=arVAlg;this.fldSort=arSrt;this._hstyles=styles||[]};this._eSplit=function(str){if(![].push){return str.split(this.delim)}var a="r"+(new Date()).valueOf();var z=this.delim.replace(/([\|\+\*\^])/g,"\\$1");return(str||"").replace(RegExp(z,"g"),a).replace(RegExp("\\\\"+a,"g"),this.delim).split(a)};this.getColType=function(cInd){return this.cellType[cInd]};this.getColTypeById=function(cID){return this.cellType[this.getColIndexById(cID)]};this.setColTypes=function(typeStr){this.cellType=dhtmlxArray(typeStr.split(this.delim));this._strangeParams=new Array();for(var i=0;i<this.cellType.length;i++){if((this.cellType[i].indexOf("[")!=-1)){var z=this.cellType[i].split(/[\[\]]+/g);this.cellType[i]=z[0];this.defVal[i]=z[1];if(z[1].indexOf("=")==0){this.cellType[i]="math";this._strangeParams[i]=z[0]}}if(!window["eXcell_"+this.cellType[i]]){dhx4.callEvent("onConfigurationError",["Incorrect cell type: "+this.cellType[i],this,this.cellType[i]])}}};this.setColSorting=function(sortStr){this.fldSort=sortStr.split(this.delim);var check={str:1,"int":1,date:1};for(var i=0;i<this.fldSort.length;i++){if((!check[this.fldSort[i]])&&(typeof(window[this.fldSort[i]])=="function")){if(!this._customSorts){this._customSorts=new Array()}this._customSorts[i]=window[this.fldSort[i]];this.fldSort[i]="cus"}}};this.setColAlign=function(alStr){this.cellAlign=alStr.split(this.delim);for(var i=0;i<this.cellAlign.length;i++){this.cellAlign[i]=this.cellAlign[i]._dhx_trim()}};this.setColVAlign=function(valStr){this.cellVAlign=valStr.split(this.delim)};this.setNoHeader=function(fl){this.noHeader=dhx4.s2b(fl)};this.showRow=function(rowID){this.getRowById(rowID);if(this._h2){this.openItem(this._h2.get[rowID].parent.id)}var c=this.getRowById(rowID).childNodes[0];while(c&&c.style.display=="none"){c=c.nextSibling}if(c){this.moveToVisible(c,true)}};this.setStyle=function(ss_header,ss_grid,ss_selCell,ss_selRow){this.ssModifier=[ss_header,ss_grid,ss_selCell,ss_selCell,ss_selRow];var prefs=["#"+this.entBox.id+" table.hdr td","#"+this.entBox.id+" table.obj td","#"+this.entBox.id+" table.obj tr.rowselected td.cellselected","#"+this.entBox.id+" table.obj td.cellselected","#"+this.entBox.id+" table.obj tr.rowselected td"];var index=0;while(!_isIE){try{var temp=document.styleSheets[index].cssRules.length}catch(e){index++;continue}break}for(var i=0;i<prefs.length;i++){if(this.ssModifier[i]){if(_isIE){document.styleSheets[0].addRule(prefs[i],this.ssModifier[i])}else{document.styleSheets[index].insertRule(prefs[i]+(" { "+this.ssModifier[i]+" }"),document.styleSheets[index].cssRules.length)}}}};this.setColumnColor=function(clr){this.columnColor=clr.split(this.delim)};this.enableAlterCss=function(cssE,cssU,perLevel,levelUnique){if(cssE||cssU){this.attachEvent("onGridReconstructed",function(){this._fixAlterCss();if(this._fake){this._fake._fixAlterCss()}})}this._cssSP=perLevel;this._cssSU=levelUnique;this._cssEven=cssE;this._cssUnEven=cssU};this._fixAlterCss=function(ind){if(this._h2&&(this._cssSP||this._cssSU)){return this._fixAlterCssTGR(ind)}if(!this._cssEven&&!this._cssUnEven){return}ind=ind||0;var j=ind;for(var i=ind;i<this.rowsCol.length;i++){if(!this.rowsCol[i]){continue}if(this.rowsCol[i].style.display!="none"){if(this.rowsCol[i]._cntr){j=1;continue}if(this.rowsCol[i].className.indexOf("rowselected")!=-1){if(j%2==1){this.rowsCol[i].className=this._cssUnEven+" rowselected "+(this.rowsCol[i]._css||"")}else{this.rowsCol[i].className=this._cssEven+" rowselected "+(this.rowsCol[i]._css||"")}}else{if(j%2==1){this.rowsCol[i].className=this._cssUnEven+" "+(this.rowsCol[i]._css||"")}else{this.rowsCol[i].className=this._cssEven+" "+(this.rowsCol[i]._css||"")}}j++}}};this.clearChangedState=function(){for(var i=0;i<this.rowsCol.length;i++){var row=this.rowsCol[i];if(row&&row.childNodes){var cols=row.childNodes.length;for(var j=0;j<cols;j++){row.childNodes[j].wasChanged=false}}}};this.getChangedRows=function(and_added){var res=new Array();this.forEachRow(function(id){var row=this.rowsAr[id];if(row.tagName!="TR"){return}var cols=row.childNodes.length;if(and_added&&row._added){res[res.length]=row.idd}else{for(var j=0;j<cols;j++){if(row.childNodes[j].wasChanged){res[res.length]=row.idd;break}}}});return res.join(this.delim)};this._sUDa=false;this._sAll=false;this.setSerializationLevel=function(userData,fullXML,config,changedAttr,onlyChanged,asCDATA){this._sUDa=userData;this._sAll=fullXML;this._sConfig=config;this._chAttr=changedAttr;this._onlChAttr=onlyChanged;this._asCDATA=asCDATA};this.setSerializableColumns=function(list){if(!list){this._srClmn=null;return}this._srClmn=(list||"").split(",");for(var i=0;i<this._srClmn.length;i++){this._srClmn[i]=dhx4.s2b(this._srClmn[i])}};this._serialise=function(rCol,inner,closed){this.editStop();var out=[];var close="</"+this.xml.s_row+">";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<this.rowsBuffer.length;i++){if(this.rowsBuffer[i]){if(this._chAttr&&this.rowsBuffer[i]._locator){continue}var temp=this._serializeRow(this.render_row(i));out.push(temp);if(temp){out.push(close)}}}}return[out.join("")]};this._serializeRow=function(r,i){var out=[];var ra=this.xml.row_attrs;var ca=this.xml.cell_attrs;out.push("<"+this.xml.s_row);out.push(" id='"+r.idd+"'");if((this._sAll)&&this.selectedRows._dhx_find(r)!=-1){out.push(" selected='1'")}if(this._h2&&this._h2.get[r.idd].state=="minus"){out.push(" open='1'")}if(ra.length){for(var i=0;i<ra.length;i++){out.push(" "+ra[i]+"='"+r._attrs[ra[i]]+"'")}}out.push(">");if(this._sUDa&&this.UserData[r.idd]){keysAr=this.UserData[r.idd].getKeys();for(var ii=0;ii<keysAr.length;ii++){out.push("<userdata name='"+keysAr[ii]+"'>"+(this._asCDATA?"<![CDATA[":"")+this.UserData[r.idd].get(keysAr[ii])+(this._asCDATA?"]]>":"")+"</userdata>")}}var changeFl=false;for(var jj=0;jj<this._cCount;jj++){if((!this._srClmn)||(this._srClmn[jj])){var zx=this.cells3(r,jj);out.push("<cell");if(ca.length){for(var i=0;i<ca.length;i++){out.push(" "+ca[i]+"='"+zx.cell._attrs[ca[i]]+"'")}}zxVal=zx[this._agetm]();if(this._asCDATA){zxVal="<![CDATA["+zxVal+"]]>"}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+"</cell>")}else{out.push(">"+zxVal+"</cell>")}if((this._ecspn)&&(zx.cell.colSpan)){for(var u=0;u<zx.cell.colSpan-1;u++){out.push("<cell/>");jj++}}}}if((this._onlChAttr)&&(!changeFl)&&(!r._added)){return""}return out.join("")};this._serialiseConfig=function(){var out="<head>";for(var i=0;i<this.hdr.rows[0].cells.length;i++){if(this._srClmn&&!this._srClmn[i]){continue}var sort=this.fldSort[i];if(sort=="cus"){sort=this._customSorts[i].toString();sort=sort.replace(/function[\ ]*/,"").replace(/\([^\f]*/,"")}out+="<column width='"+this.getColWidth(i)+"' align='"+this.cellAlign[i]+"' type='"+this.cellType[i]+"' sort='"+(sort||"na")+"' color='"+(this.columnColor[i]||"")+"'"+(this.columnIds[i]?(" id='"+this.columnIds[i]+"'"):"")+">";if(this._asCDATA){out+="<![CDATA["+this.getColumnLabel(i)+"]]>"}else{out+=this.getColumnLabel(i)}var z=this.getCombo(i);if(z){for(var j=0;j<z.keys.length;j++){out+="<option value='"+z.keys[j]+"'>"+z.values[j]+"</option>"}}out+="</column>"}return out+="</head>"};this.serialize=function(){var out='<?xml version="1.0"?><rows>';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<keysAr.length;i++){out+="<userdata name='"+keysAr[i]+"'>"+this.UserData.gridglobaluserdata.get(keysAr[i])+"</userdata>"}}if(this._sConfig){out+=this._serialiseConfig()}out+=this._serialise();out+="</rows>";return out};this.getPosition=function(oNode,pNode){if(!pNode){var pos=dhx4.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.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=e||event;e.cancelBubble=true;this.firstChild.grid.setActive(true);window.dhx4.callEvent("_onGridClick",[e,this.firstChild.grid])};this.obj.onclick=function(e){if(this.grid._doClick(e||window.event)!==false){if(this.grid._sclE){this.grid.editCell(e||window.event)}else{this.grid.editStop()}}e=e||event;e.cancelBubble=true;window.dhx4.callEvent("_onGridClick",[e,this.grid])};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(e,a,c){this.getRowById(e)._attrs[a]=c},isTreeGrid:function(){return(this.cellType._dhx_find("tree")!=-1)},setRowHidden:function(l,e){var c=dhx4.s2b(e);var h=this.getRowById(l);if(!h){return}if(h.expand===""){this.collapseKids(h)}if((e)&&(h.style.display!="none")){h.style.display="none";var g=this.selectedRows._dhx_find(h);if(g!=-1){h.className=h.className.replace("rowselected","");for(var a=0;a<h.childNodes.length;a++){h.childNodes[a].className=h.childNodes[a].className.replace(/cellselected/g,"")}this.selectedRows._dhx_removeAt(g)}this.callEvent("onGridReconstructed",[])}if((!e)&&(h.style.display=="none")){h.style.display="";this.callEvent("onGridReconstructed",[])}this.callEvent("onRowHide",[l,e]);this.setSizes()},setColumnHidden:function(e,c){if(!this.hdr.rows.length){if(!this._ivizcol){this._ivizcol=[]}return this._ivizcol[e]=c}if((this.fldSorted)&&(this.fldSorted.cellIndex==e)&&(c)){this.sortImg.style.display="none"}var a=dhx4.s2b(c);if(a){if(!this._hrrar){this._hrrar=new Array()}else{if(this._hrrar[e]){return}}this._hrrar[e]="display:none;";this._hideShowColumn(e,"none")}else{if((!this._hrrar)||(!this._hrrar[e])){return}this._hrrar[e]="";this._hideShowColumn(e,"")}if((this.fldSorted)&&(this.fldSorted.cellIndex==e)&&(!c)){this.sortImg.style.display="inline"}this.setSortImgPos();this.callEvent("onColumnHidden",[e,c])},isColumnHidden:function(a){if((this._hrrar)&&(this._hrrar[a])){return true}return false},setColumnsVisibility:function(c){if(c){this._ivizcol=c.split(this.delim)}if(this.hdr.rows.length&&this._ivizcol){for(var a=0;a<this._ivizcol.length;a++){this.setColumnHidden(a,this._ivizcol[a])}}},_fixHiddenRowsAll:function(n,e,a,c,l){l=l||"_cellIndex";var m=n.rows.length;for(var h=0;h<m;h++){var o=n.rows[h].childNodes;if(o.length!=this._cCount){for(var g=0;g<o.length;g++){if(o[g][l]==e){o[g].style[a]=c;break}}}else{o[e].style[a]=c}}},_hideShowColumn:function(h,g){var a=h;if(this.hdr.rows[1]&&(this.hdr.rows[1]._childIndexes)&&(this.hdr.rows[1]._childIndexes[h]!=h)){a=this.hdr.rows[1]._childIndexes[h]}if(g=="none"){this.hdr.rows[0].cells[h]._oldWidth=this.hdr.rows[0].cells[h].style.width||(this.initCellWidth[h]+"px");this.hdr.rows[0].cells[h]._oldWidthP=this.cellWidthPC[h];this.obj.rows[0].cells[h].style.width="0px";var c={rows:[this.obj.rows[0]]};this.forEachRow(function(l){if(this.rowsAr[l].tagName=="TR"){c.rows.push(this.rowsAr[l])}});this._fixHiddenRowsAll(c,h,"display","none");if(this.isTreeGrid()){this._fixHiddenRowsAllTG(h,"none")}if((_isOpera&&_OperaRv<9)||_isKHTML||(_isFF)){this._fixHiddenRowsAll(this.hdr,h,"display","none","_cellIndexS")}if(this.ftr){this._fixHiddenRowsAll(this.ftr.childNodes[0],h,"display","none")}this._fixHiddenRowsAll(this.hdr,h,"whiteSpace","nowrap","_cellIndexS");if(!this.cellWidthPX.length&&!this.cellWidthPC.length){this.cellWidthPX=[].concat(this.initCellWidth)}if(this.cellWidthPX[h]){this.cellWidthPX[h]=0}if(this.cellWidthPC[h]){this.cellWidthPC[h]=0}}else{if(this.hdr.rows[0].cells[h]._oldWidth){var e=this.hdr.rows[0].cells[h];if(_isOpera||_isKHTML||(_isFF)){this._fixHiddenRowsAll(this.hdr,h,"display","","_cellIndexS")}if(this.ftr){this._fixHiddenRowsAll(this.ftr.childNodes[0],h,"display","")}var c={rows:[this.obj.rows[0]]};this.forEachRow(function(l){if(this.rowsAr[l].tagName=="TR"){c.rows.push(this.rowsAr[l])}});this._fixHiddenRowsAll(c,h,"display","");if(this.isTreeGrid()){this._fixHiddenRowsAllTG(h,"")}this._fixHiddenRowsAll(this.hdr,h,"whiteSpace","normal","_cellIndexS");if(e._oldWidthP){this.cellWidthPC[h]=e._oldWidthP}if(e._oldWidth){this.cellWidthPX[h]=parseInt(e._oldWidth)}}}this.setSizes();if((!_isIE)&&(!_isFF)){this.obj.border=1;this.obj.border=0}},enableColSpan:function(a){this._ecspn=dhx4.s2b(a)},enableRowsHover:function(c,a){this._unsetRowHover(false,true);this._hvrCss=a;if(dhx4.s2b(c)){if(!this._elmnh){this.obj._honmousemove=this.obj.onmousemove;this.obj.onmousemove=this._setRowHover;if(_isIE){this.obj.onmouseleave=this._unsetRowHover}else{this.obj.onmouseout=this._unsetRowHover}this._elmnh=true}}else{if(this._elmnh){this.obj.onmousemove=this.obj._honmousemove;if(_isIE){this.obj.onmouseleave=null}else{this.obj.onmouseout=null}this._elmnh=false}}},enableEditEvents:function(c,e,a){this._sclE=dhx4.s2b(c);this._dclE=dhx4.s2b(e);this._f2kE=dhx4.s2b(a)},enableLightMouseNavigation:function(a){if(dhx4.s2b(a)){if(!this._elmn){this.entBox._onclick=this.entBox.onclick;this.entBox.onclick=function(){return true};this.obj._onclick=this.obj.onclick;this.obj.onclick=function(g){var h=this.grid.getFirstParentOfType(g?g.target:event.srcElement,"TD");if(!h){return}this.grid.editStop();this.grid.doClick(h);this.grid.editCell();(g||event).cancelBubble=true};this.obj._onmousemove=this.obj.onmousemove;this.obj.onmousemove=this._autoMoveSelect;this._elmn=true}}else{if(this._elmn){this.entBox.onclick=this.entBox._onclick;this.obj.onclick=this.obj._onclick;this.obj.onmousemove=this.obj._onmousemove;this._elmn=false}}},_unsetRowHover:function(g,h){if(h){that=this}else{that=this.grid}if((that._lahRw)&&(that._lahRw!=h)){for(var a=0;a<that._lahRw.childNodes.length;a++){that._lahRw.childNodes[a].className=that._lahRw.childNodes[a].className.replace(that._hvrCss,"")}that._lahRw=null}},_setRowHover:function(g){var h=this.grid.getFirstParentOfType(g?g.target:event.srcElement,"TD");if(h&&h.parentNode!=this.grid._lahRw){this.grid._unsetRowHover(0,h);h=h.parentNode;if(!h.idd||h.idd=="__filler__"){return}for(var a=0;a<h.childNodes.length;a++){h.childNodes[a].className+=" "+this.grid._hvrCss}this.grid._lahRw=h}this._honmousemove(g)},_autoMoveSelect:function(a){if(!this.grid.editor){var g=this.grid.getFirstParentOfType(a?a.target:event.srcElement,"TD");if(g.parentNode.idd){this.grid.doClick(g,true,0)}}this._onmousemove(a)},enableDistributedParsing:function(e,a,c){if(dhx4.s2b(e)){this._ads_count=a||10;this._ads_time=c||250}else{this._ads_count=0}},destructor:function(){this.editStop(true);if(this._sizeTime){this._sizeTime=window.clearTimeout(this._sizeTime)}this.entBox.className=(this.entBox.className||"").replace(/gridbox.*/,"");if(this.formInputs){for(var e=0;e<this.formInputs.length;e++){this.parentForm.removeChild(this.formInputs[e])}}var c;for(var e=0;e<this.rowsCol.length;e++){if(this.rowsCol[e]){this.rowsCol[e].grid=null}}for(e in this.rowsAr){if(this.rowsAr[e]){this.rowsAr[e]=null}}this.rowsCol=new dhtmlxArray();this.rowsAr={};this.entBox.innerHTML="";var g=function(){};this.entBox.onclick=this.entBox.onmousedown=this.entBox.onbeforeactivate=this.entBox.onbeforedeactivate=this.entBox.onbeforedeactivate=this.entBox.onselectstart=g;this.setSizes=this._update_srnd_view=this.callEvent=g;this.entBox.grid=this.objBox.grid=this.hdrBox.grid=this.obj.grid=this.hdr.grid=null;if(this._fake){this.globalBox.innerHTML="";this._fake.setSizes=this._fake._update_srnd_view=this._fake.callEvent=g;this.globalBox.onclick=this.globalBox.onmousedown=this.globalBox.onbeforeactivate=this.globalBox.onbeforedeactivate=this.globalBox.onbeforedeactivate=this.globalBox.onselectstart=g}for(c in this){if((this[c])&&(this[c].m_obj)){this[c].m_obj=null}this[c]=null}if(this==globalActiveDHTMLGridObject){globalActiveDHTMLGridObject=null}return null},getSortingState:function(){var a=new Array();if(this.fldSorted){a[0]=this.fldSorted._cellIndex;a[1]=(this.sortImg.className=="dhxgrid_sort_desc"?"des":"asc")}return a},enableAutoHeight:function(e,c,a){this._ahgr=dhx4.s2b(e);this._ahgrF=dhx4.s2b(a);this._ahgrM=c||null;if(arguments.length==1){this.objBox.style.overflowY=e?"hidden":"auto"}if(c=="auto"){this._ahgrM=null;this._ahgrMA=true;this._setAutoResize()}},enableStableSorting:function(a){this._sst=dhx4.s2b(a);this.rowsCol.stablesort=function(l){var h=this.length-1;for(var g=0;g<this.length-1;g++){for(var e=0;e<h;e++){if(l(this[e],this[e+1])>0){var c=this[e];this[e]=this[e+1];this[e+1]=c}}h--}}},enableKeyboardSupport:function(a){this._htkebl=!dhx4.s2b(a)},enableContextMenu:function(a){this._ctmndx=a},setScrollbarWidthCorrection:function(a){},enableTooltips:function(c){this._enbTts=c.split(",");for(var a=0;a<this._enbTts.length;a++){this._enbTts[a]=dhx4.s2b(this._enbTts[a])}},enableResizing:function(c){this._drsclmn=c.split(",");for(var a=0;a<this._drsclmn.length;a++){this._drsclmn[a]=dhx4.s2b(this._drsclmn[a])}},setColumnMinWidth:function(a,c){if(arguments.length==2){if(!this._drsclmW){this._drsclmW=new Array()}this._drsclmW[c]=a}else{this._drsclmW=a.split(",")}},enableCellIds:function(a){this._enbCid=dhx4.s2b(a)},lockRow:function(a,e){var c=this.getRowById(a);if(c){c._locked=dhx4.s2b(e);if((this.cell)&&(this.cell.parentNode.idd==a)){this.editStop()}}},_getRowArray:function(h){var g=new Array();for(var e=0;e<h.childNodes.length;e++){var c=this.cells3(h,e);g[e]=c.getValue()}return g},setDateFormat:function(c,a){this._dtmask=c;this._dtmask_inc=a},setNumberFormat:function(n,e,h,m){var g=n.replace(/[^0\,\.]*/g,"");var a=g.indexOf(".");if(a>-1){a=g.length-a-1}var c=g.indexOf(",");if(c>-1){c=g.length-a-2-c}if(typeof h!="string"){h=this.i18n.decimal_separator}if(typeof m!="string"){m=this.i18n.group_separator}var o=n.split(g)[0];var l=n.split(g)[1];this._maskArr[e]=[a,c,o,l,h,m]},_aplNFb:function(h,g){var c=this._maskArr[g];if(!c){return h}var e=parseFloat(h.toString().replace(/[^0-9]*/g,""));if(h.toString().substr(0,1)=="-"){e=e*-1}if(c[0]>0){e=e/Math.pow(10,c[0])}return e},_aplNF:function(l,h){var e=this._maskArr[h];if(!e){return l}var m=(parseFloat(l)<0?"-":"")+e[2];l=Math.abs(Math.round(parseFloat(l)*Math.pow(10,e[0]>0?e[0]:0))).toString();l=(l.length<e[0]?Math.pow(10,e[0]+1-l.length).toString().substr(1,e[0]+1)+l.toString():l).split("").reverse();l[e[0]]=(l[e[0]]||"0")+e[4];if(e[1]>0){for(var g=(e[0]>0?0:1)+e[0]+e[1];g<l.length;g+=e[1]){l[g]+=e[5]}}return m+l.reverse().join("")+e[3]},_launchCommands:function(a){for(var g=0;g<a.length;g++){var e=new Array();for(var c=0;c<a[g].childNodes.length;c++){if(a[g].childNodes[c].nodeType==1){e[e.length]=a[g].childNodes[c].firstChild.data}}this[a[g].getAttribute("command")].apply(this,e)}},_parseHead:function(h){var g=dhx4.ajax.xpath("./head",h);if(g.length){var l=dhx4.ajax.xpath("./column",g[0]);var m=dhx4.ajax.xpath("./settings",g[0]);var A="setInitWidths";var v=false;if(m[0]){for(var n=0;n<m[0].childNodes.length;n++){switch(m[0].childNodes[n].tagName){case"colwidth":if(m[0].childNodes[n].firstChild&&m[0].childNodes[n].firstChild.data=="%"){A="setInitWidthsP"}break;case"splitat":v=(m[0].childNodes[n].firstChild?m[0].childNodes[n].firstChild.data:false);break}}}this._launchCommands(dhx4.ajax.xpath("./beforeInit/call",g[0]));if(l.length>0){if(this.hdr.rows.length>0){this.clearAll(true)}var a=[[],[],[],[],[],[],[],[],[]];var u=["","width","type","align","sort","color","format","hidden","id"];var r=["",A,"setColTypes","setColAlign","setColSorting","setColumnColor","","","setColumnIds"];for(var y=0;y<l.length;y++){for(var x=1;x<u.length;x++){a[x].push(l[y].getAttribute(u[x]))}a[0].push((l[y].firstChild?l[y].firstChild.data:"").replace(/^\s*((\s\S)*.+)\s*$/gi,"$1"))}this.setHeader(a[0]);for(var y=0;y<r.length;y++){if(r[y]){this[r[y]](a[y].join(this.delim))}}for(var y=0;y<l.length;y++){if((this.cellType[y].indexOf("co")==0)||(this.cellType[y]=="clist")){var o=dhx4.ajax.xpath("./option",l[y]);if(o.length){var w=new Array();if(this.cellType[y]=="clist"){for(var x=0;x<o.length;x++){w[w.length]=o[x].firstChild?o[x].firstChild.data:""}this.registerCList(y,w)}else{var C=this.getCombo(y);for(var x=0;x<o.length;x++){C.put(o[x].getAttribute("value"),o[x].firstChild?o[x].firstChild.data:"")}}}}else{if(a[6][y]){if((this.cellType[y].toLowerCase().indexOf("calendar")!=-1)||(this.fldSort[y]=="date")){this.setDateFormat(a[6][y])}else{this.setNumberFormat(a[6][y],y)}}}}this.init();var e=a[7].join(this.delim);if(this.setColHidden&&e.replace(/,/g,"")!=""){this.setColHidden(e)}if((v)&&(this.splitAt)){this.splitAt(v)}}this._launchCommands(dhx4.ajax.xpath("./afterInit/call",g[0]))}var c=dhx4.ajax.xpath("//rows/userdata",h);if(c.length>0){if(!this.UserData.gridglobaluserdata){this.UserData.gridglobaluserdata=new Hashtable()}for(var x=0;x<c.length;x++){var D="";for(var q=0;q<c[x].childNodes.length;q++){D+=c[x].childNodes[q].nodeValue}this.UserData.gridglobaluserdata.put(c[x].getAttribute("name"),D)}}},getCheckedRows:function(a){var c=new Array();this.forEachRowA(function(g){var e=this.cells(g,a);if(e.changeState&&e.getValue()!=0){c.push(g)}},true);return c.join(",")},checkAll:function(){var c=arguments.length?arguments[0]:1;for(var a=0;a<this.getColumnsNum();a++){if(this.getColType(a)=="ch"){this.setCheckedRows(a,c)}}},uncheckAll:function(){this.checkAll(0)},setCheckedRows:function(c,a){this.forEachRowA(function(e){if(this.cells(e,c).isCheckbox()){this.cells(e,c).setValue(a)}})},_drawTooltip:function(l){var m=this.grid.getFirstParentOfType(l?l.target:event.srcElement,"TD");if(!m||((this.grid.editor)&&(this.grid.editor.cell==m))){return true}var h=m.parentNode;if(!h.idd||h.idd=="__filler__"){return}var g=(l?l.target:event.srcElement);if(h.idd==window.unknown){return true}if(!this.grid.callEvent("onMouseOver",[h.idd,m._cellIndex,(l||window.event)])){return true}if((this.grid._enbTts)&&(!this.grid._enbTts[m._cellIndex])){if(g.title){g.title=""}return true}if(m._cellIndex>=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(e){var a=[];for(var c=0;c<this.rowsBuffer.length;c++){if(this.rowsBuffer[c]){a.push(this.rowsBuffer[c].idd)}}return a.join(e||this.delim)},getAllItemIds:function(){return this.getAllRowIds()},setColspan:function(e,w,g){if(!this._ecspn){return}var a=this.getRowById(e);if((a._childIndexes)&&(a.childNodes[a._childIndexes[w]])){var o=a._childIndexes[w];var h=a.childNodes[o];var l=h.colSpan;h.colSpan=1;if((l)&&(l!=1)){for(var s=1;s<l;s++){var v=document.createElement("TD");if(h.nextSibling){a.insertBefore(v,h.nextSibling)}else{a.appendChild(v)}a._childIndexes[w+s]=o+s;v._cellIndex=w+s;v.style.textAlign=this.cellAlign[s];v.style.verticalAlign=this.cellVAlign[s];h=v;this.cells3(a,w+s).setValue("")}}for(var u=w*1+1*l;u<a._childIndexes.length;u++){a._childIndexes[u]+=(l-1)*1}}if((g)&&(g>1)){if(a._childIndexes){var o=a._childIndexes[w]}else{var o=w;a._childIndexes=new Array();for(var u=0;u<a.childNodes.length;u++){a._childIndexes[u]=u}}a.childNodes[o].colSpan=g;for(var u=1;u<g;u++){a._childIndexes[a.childNodes[o+1]._cellIndex]=o;a.removeChild(a.childNodes[o+1])}var q=a.childNodes[a._childIndexes[w]]._cellIndex;for(var u=q*1+1*g;u<a._childIndexes.length;u++){a._childIndexes[u]-=(g-1)}}},preventIECaching:function(a){dhx4.ajax.cache=!a},enableColumnAutoSize:function(a){this._eCAS=dhx4.s2b(a)},_onHeaderDblClick:function(g){var c=this.grid;var a=c.getFirstParentOfType(_isIE?event.srcElement:g.target,"TD");if(!c._eCAS){return false}c.adjustColumnSize(a._cellIndexS)},adjustColumnSize:function(o,c){if(this._hrrar&&this._hrrar[o]){return}this._notresize=true;var e=0;this._setColumnSizeR(o,20);for(var h=1;h<this.hdr.rows.length;h++){var r=this.hdr.rows[h];r=r.childNodes[(r._childIndexes)?r._childIndexes[o]:o];if((r)&&((!r.colSpan)||(r.colSpan<2))&&r._cellIndex==o){if((r.childNodes[0])&&(r.childNodes[0].className=="hdrcell")){r=r.childNodes[0]}e=Math.max(e,r.scrollWidth)}}var g=this.obj.rows.length;var q=0;var u=this.cellType._dhx_find("tree");for(var n=1;n<g;n++){var s=this.obj.rows[n];if(!this.rowsAr[s.idd]){continue}if(s._childIndexes&&s._childIndexes[o]!=o||!s.childNodes[o]){continue}q=(s.childNodes[o].innerText||s.childNodes[o].textContent||"").length*this.fontWidth;if(this._h2&&o==u){q+=this._h2.get[s.idd].level*22}if(q>e){e=q}}e+=20+(c||0);this._setColumnSizeR(o,e);this._notresize=false;this.setSizes()},detachHeader:function(a,e){e=e||this.hdr;var c=e.rows[a+1];if(c){c.parentNode.removeChild(c)}this.setSizes()},detachFooter:function(a){this.detachHeader(a,this.ftr)},attachHeader:function(a,g,c){if(typeof(a)=="string"){a=this._eSplit(a)}if(typeof(g)=="string"){g=g.split(this.delim)}c=c||"_aHead";if(this.hdr.rows.length){if(a){this._createHRow([a,g],this[(c=="_aHead")?"hdr":"ftr"])}else{if(this[c]){for(var e=0;e<this[c].length;e++){this.attachHeader.apply(this,this[c][e])}}}}else{if(!this[c]){this[c]=new Array()}this[c][this[c].length]=[a,g,c]}},_createHRow:function(e,q){if(!q){if(this.entBox.style.position!="absolute"){this.entBox.style.position="relative"}var m=document.createElement("DIV");m.className="c_ftr".substr(2);this.entBox.appendChild(m);var u=document.createElement("TABLE");u.cellPadding=u.cellSpacing=0;if(!_isIE||_isIE==8){u.width="100%";u.style.paddingRight="20px"}u.style.marginRight="20px";u.style.tableLayout="fixed";m.appendChild(u);u.appendChild(document.createElement("TBODY"));this.ftr=q=u;var l=u.insertRow(0);var a=((this.hdrLabels.length<=1)?e[0].length:this.hdrLabels.length);for(var g=0;g<a;g++){l.appendChild(document.createElement("TH"));l.childNodes[g]._cellIndex=g}if(_isIE&&_isIE<8){l.style.position="absolute"}else{l.style.height="auto"}}var h=e[1];var m=document.createElement("TR");q.rows[0].parentNode.appendChild(m);for(var g=0;g<e[0].length;g++){if(e[0][g]=="#cspan"){var n=m.cells[m.cells.length-1];n.colSpan=(n.colSpan||1)+1;continue}if((e[0][g]=="#rspan")&&(q.rows.length>1)){var x=q.rows.length-2;var v=false;var n=null;while(!v){var n=q.rows[x];for(var c=0;c<n.cells.length;c++){if(n.cells[c]._cellIndex==g){v=c+1;break}}x--}n=n.cells[v-1];n.rowSpan=(n.rowSpan||1)+1;continue}var o=document.createElement("TD");o._cellIndex=o._cellIndexS=g;if(this._hrrar&&this._hrrar[g]&&!_isIE){o.style.display="none"}if(typeof e[0][g]=="object"){o.appendChild(e[0][g])}else{if(this.forceDivInHeader){o.innerHTML="<div class='hdrcell'>"+(e[0][g]||"&nbsp;")+"</div>"}else{o.innerHTML=(e[0][g]||"&nbsp;")}if((e[0][g]||"").indexOf("#")!=-1){var u=e[0][g].match(/(^|{)#([^}]+)(}|$)/);if(u){var r="_in_header_"+u[2];if(this[r]){this[r]((this.forceDivInHeader?o.firstChild:o),g,e[0][g].split(u[0]))}}}}if(h){o.style.cssText=h[g]}m.appendChild(o)}var s=q;if(_isKHTML){if(q._kTimer){window.clearTimeout(q._kTimer)}q._kTimer=window.setTimeout(function(){q.rows[1].style.display="none";window.setTimeout(function(){q.rows[1].style.display=""},1)},500)}},attachFooter:function(a,c){this.attachHeader(a,c,"_aFoot")},setCellExcellType:function(e,a,c){this.changeCellType(this.getRowById(e),a,c)},changeCellType:function(e,g,c){c=c||this.cellType[g];var h=this.cells3(e,g);var a=h.getValue();h.cell._cellType=c;var h=this.cells3(e,g);h.setValue(a)},setRowExcellType:function(e,c){var g=this.rowsAr[e];for(var a=0;a<g.childNodes.length;a++){this.changeCellType(g,a,c)}},setColumnExcellType:function(a,e){for(var c=0;c<this.rowsBuffer.length;c++){if(this.rowsBuffer[c]&&this.rowsBuffer[c].tagName=="TR"){this.changeCellType(this.rowsBuffer[c],a,e)}}if(this.cellType[a]=="math"){this._strangeParams[c]=e}else{this.cellType[a]=e}},forEachRow:function(e){for(var c in this.rowsAr){if(this.rowsAr[c]&&this.rowsAr[c].idd){e.apply(this,[this.rowsAr[c].idd])}}},forEachRowA:function(e){for(var c=0;c<this.rowsBuffer.length;c++){if(this.rowsBuffer[c]){e.call(this,this.render_row(c).idd)}}},forEachCell:function(e,c){var g=this.getRowById(e);if(!g){return}for(var a=0;a<this._cCount;a++){c(this.cells3(g,a),a)}},enableAutoWidth:function(e,a,c){this._awdth=[dhx4.s2b(e),parseInt(a||99999),parseInt(c||0)];if(arguments.length==1){this.objBox.style.overflowX=e?"hidden":"auto"}},updateFromXML:function(a,g,c,e){if(typeof g=="undefined"){g=true}this._refresh_mode=[true,g,c];this.load(a,e)},_refreshFromXML:function(g){if(this._f_rowsBuffer){this.filterBy(0,"")}reset=false;if(window.eXcell_tree){eXcell_tree.prototype.setValueX=eXcell_tree.prototype.setValue;eXcell_tree.prototype.setValue=function(u){var s=this.grid._h2.get[this.cell.parentNode.idd];if(s&&this.cell.parentNode.valTag){this.setLabel(u)}else{this.setValueX(u)}}}var r=this.cellType._dhx_find("tree");var l=dhx4.ajax.xmltop("rows",g);var h=l.getAttribute("parent")||0;var n={};if(this._refresh_mode[2]){if(r!=-1){this._h2.forEachChild(h,function(s){n[s.id]=true},this)}else{this.forEachRow(function(s){n[s]=true})}}var q=dhx4.ajax.xpath("//row",l);for(var e=0;e<q.length;e++){var o=q[e];var a=o.getAttribute("id");n[a]=false;var h=o.parentNode.getAttribute("id")||h;if(this.rowsAr[a]&&this.rowsAr[a].tagName!="TR"){if(this._h2){this._h2.get[a].buff.data=o}else{this.rowsBuffer[this.getRowIndex(a)].data=o}this.rowsAr[a]=o}else{if(this.rowsAr[a]){this._process_xml_row(this.rowsAr[a],o,-1);this._postRowProcessing(this.rowsAr[a],true);if(this._fake&&this._fake.rowsAr[a]){this._fake._process_xml_row(this._fake.rowsAr[a],o,-1)}}else{if(this._refresh_mode[1]){var m={idd:a,data:o,_parser:this._process_xml_row,_locator:this._get_xml_data};var c=this.rowsBuffer.length;if(this._refresh_mode[1]=="top"){this.rowsBuffer.unshift(m);c=0}else{this.rowsBuffer.push(m)}if(this._h2){reset=true;(this._h2.add(a,(o.parentNode.getAttribute("id")||o.parentNode.getAttribute("parent")))).buff=this.rowsBuffer[this.rowsBuffer.length-1]}else{if(this._srnd){reset=true}}this.rowsAr[a]=o;o=this.render_row(c);this._insertRowAt(o,c?-1:0)}}}}if(this._refresh_mode[2]){for(a in n){if(n[a]&&this.rowsAr[a]){this.deleteRow(a)}}}this._refresh_mode=null;if(window.eXcell_tree){eXcell_tree.prototype.setValue=eXcell_tree.prototype.setValueX}if(reset){if(this._h2){this._renderSort()}else{this.render_dataset()}}if(this._f_rowsBuffer){this._f_rowsBuffer=null;this.filterByAll()}},getCustomCombo:function(e,c){var a=this.cells(e,c).cell;if(!a._combo){a._combo=new dhtmlXGridComboObject()}return a._combo},setTabOrder:function(c){var g=c.split(this.delim);this._tabOrder=[];var a=this._cCount||c.length;for(var e=0;e<a;e++){g[e]={c:parseInt(g[e]),ind:e}}g.sort(function(l,h){return(l.c>h.c?1:-1)});for(var e=0;e<a;e++){if(!g[e+1]||(typeof g[e].c=="undefined")){this._tabOrder[g[e].ind]=(g[0].ind+1)*-1}else{this._tabOrder[g[e].ind]=g[e+1].ind}}},i18n:{loading:"Loading",decimal_separator:".",group_separator:","},_key_events:{k13_1_0:function(){var a=this.rowsCol._dhx_find(this.row);this.selectCell(this.rowsCol[a+1],this.cell._cellIndex,true)},k13_0_1:function(){var a=this.rowsCol._dhx_find(this.row);this.selectCell(this.rowsCol[a-1],this.cell._cellIndex,true)},k13_0_0:function(){this.editStop();this.callEvent("onEnter",[(this.row?this.row.idd:null),(this.cell?this.cell._cellIndex:null)]);this._still_active=true},k9_0_0:function(){this.editStop();if(!this.callEvent("onTab",[true])){return true}var a=this._getNextCell(null,1);if(a){this.selectCell(a.parentNode,a._cellIndex,(this.row!=a.parentNode),false,true);this._still_active=true}},k9_0_1:function(){this.editStop();if(!this.callEvent("onTab",[false])){return false}var a=this._getNextCell(null,-1);if(a){this.selectCell(a.parentNode,a._cellIndex,(this.row!=a.parentNode),false,true);this._still_active=true}},k113_0_0:function(){if(this._f2kE){this.editCell()}},k32_0_0:function(){var a=this.cells4(this.cell);if(!a.changeState||(a.changeState()===false)){return false}},k27_0_0:function(){this.editStop(true)},k33_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage-1)}else{this.scrollPage(-1)}},k34_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage+1)}else{this.scrollPage(1)}},k37_0_0:function(){if(!this.editor&&this.isTreeGrid()){this.collapseKids(this.row)}else{return false}},k39_0_0:function(){if(!this.editor&&this.isTreeGrid()){this.expandKids(this.row)}else{return false}},k40_0_0:function(){var c=this._realfake?this._fake:this;if(this.editor&&this.editor.combo){this.editor.shiftNext()}else{if(!this.row.idd){return}var a=Math.max((c._r_select||0),this.getRowIndex(this.row.idd));var e=this._nextRow(a,1);if(e){c._r_select=null;this.selectCell(e,this.cell._cellIndex,true);if(c.pagingOn){c.showRow(e.idd)}}else{if(!this.callEvent("onLastRow",[])){return false}this._key_events.k34_0_0.apply(this,[]);if(this.pagingOn&&this.rowsCol[a+1]){this.selectCell(a+1,0,true)}}}this._still_active=true},k38_0_0:function(){var c=this._realfake?this._fake:this;if(this.editor&&this.editor.combo){this.editor.shiftPrev()}else{if(!this.row.idd){return}var a=this.getRowIndex(this.row.idd)+1;if(a!=-1&&(!this.pagingOn||(a!=1))){var e=this._nextRow(a-1,-1);this.selectCell(e,this.cell._cellIndex,true);if(c.pagingOn&&e){c.showRow(e.idd)}}else{this._key_events.k33_0_0.apply(this,[])}}this._still_active=true}},_build_master_row:function(){var e=document.createElement("DIV");var c=["<table><tr>"];for(var a=0;a<this._cCount;a++){c.push("<td></td>")}c.push("</tr></table>");e.innerHTML=c.join("");this._master_row=e.firstChild.rows[0]},_prepareRow:function(a){if(!this._master_row){this._build_master_row()}var e=this._master_row.cloneNode(true);for(var c=0;c<e.childNodes.length;c++){e.childNodes[c]._cellIndex=c;if(this._enbCid){e.childNodes[c].id="c_"+a+"_"+c}if(this.dragAndDropOff){this.dragger.addDraggableItem(e.childNodes[c],this)}}e.idd=a;e.grid=this;return e},_process_jsarray_row:function(c,e){c._attrs={};for(var a=0;a<c.childNodes.length;a++){c.childNodes[a]._attrs={}}this._fillRow(c,(this._c_order?this._swapColumns(e):e));return c},_get_jsarray_data:function(c,a){return c[a]},_process_json_row:function(a,c){c=this._c_order?this._swapColumns(c.data):c.data;return this._process_some_row(a,c)},_process_some_row:function(c,e){c._attrs={};for(var a=0;a<c.childNodes.length;a++){c.childNodes[a]._attrs={}}this._fillRow(c,e);return c},_get_json_data:function(c,a){return c.data[a]},_process_js_row:function(e,g){var a=[];for(var c=0;c<this.columnIds.length;c++){a[c]=g[this.columnIds[c]];if(!a[c]&&a[c]!==0){a[c]=""}}this._process_some_row(e,a);e._attrs=g;return e},_get_js_data:function(c,a){return c[this.columnIds[a]]},_process_csv_row:function(c,e){c._attrs={};for(var a=0;a<c.childNodes.length;a++){c.childNodes[a]._attrs={}}this._fillRow(c,(this._c_order?this._swapColumns(e.split(this.csv.cell)):e.split(this.csv.cell)));return c},_get_csv_data:function(c,a){return c.split(this.csv.cell)[a]},_process_store_row:function(h,g){var a=[];for(var e=0;e<this.columnIds.length;e++){a[e]=g[this.columnIds[e]]}for(var c=0;c<h.childNodes.length;c++){h.childNodes[c]._attrs={}}h._attrs=g;this._fillRow(h,a)},_process_xml_row:function(a,l){var s=dhx4.ajax.xpath(this.xml.cell,l);var o=[];a._attrs=this._xml_attrs(l);if(this._ud_enabled){var q=dhx4.ajax.xpath("./userdata",l);for(var h=q.length-1;h>=0;h--){var n="";for(var e=0;e<q[h].childNodes.length;e++){n+=q[h].childNodes[e].nodeValue}this.setUserData(a.idd,q[h].getAttribute("name"),n)}}for(var e=0;e<s.length;e++){var g=s[this._c_order?this._c_order[e]:e];if(!g){continue}var c=a._childIndexes?a._childIndexes[e]:e;var m=g.getAttribute("type");if(a.childNodes[c]){if(m){a.childNodes[c]._cellType=m}a.childNodes[c]._attrs=this._xml_attrs(g)}if(!g.getAttribute("xmlcontent")){if(g.firstChild){g=g.firstChild.wholeText||g.firstChild.data}else{g=""}}o.push(g)}for(e<s.length;e<a.childNodes.length;e++){a.childNodes[e]._attrs={}}if(a.parentNode&&a.parentNode.tagName=="row"){a._attrs.parent=a.parentNode.getAttribute("idd")}this._fillRow(a,o);return a},_get_xml_data:function(c,a){c=c.firstChild;while(true){if(!c){return""}if(c.tagName=="cell"){a--}if(a<0){break}c=c.nextSibling}return(c.firstChild?c.firstChild.data:"")},_fillRow:function(g,l){if(this.editor&&this.editor.parentNode&&this.editor.parentNode.idd==g.idd){this.editStop()}for(var c=0;c<g.childNodes.length;c++){if((c<l.length)||(this.defVal[c])){var e=g.childNodes[c]._cellIndex;var h=l[e];var a=this.cells4(g.childNodes[c]);if((this.defVal[e])&&((h=="")||(typeof(h)=="undefined"))){h=this.defVal[e]}if(a){a.setValue(h)}}else{g.childNodes[c].innerHTML="&nbsp;";g.childNodes[c]._clearCell=true}}return g},_postRowProcessing:function(l,n){if(l._attrs["class"]){l._css=l.className=l._attrs["class"]}if(l._attrs.locked){l._locked=true}if(l._attrs.bgColor){l.bgColor=l._attrs.bgColor}var m=0;for(var e=0;e<l.childNodes.length;e++){var o=l.childNodes[e];var h=o._cellIndex;var g=o._attrs.style||l._attrs.style;if(g){o.style.cssText+=";"+g}if(o._attrs["class"]){o.className=o._attrs["class"]}g=o._attrs.align||this.cellAlign[h];if(g){o.align=g}o.vAlign=o._attrs.valign||this.cellVAlign[h];var a=o._attrs.bgColor||this.columnColor[h];if(a){o.bgColor=a}if(o._attrs.colspan&&!n){this.setColspan(l.idd,e+m,o._attrs.colspan);m+=(o._attrs.colspan-1)}if(this._hrrar&&this._hrrar[h]&&!n){o.style.display="none"}}this.callEvent("onRowCreated",[l.idd,l,null])},load:function(a,e,c){this.callEvent("onXLS",[this]);if(arguments.length==2&&typeof e!="function"){c=e;e=null}c=c||"xml";if(!this.xmlFileUrl){this.xmlFileUrl=a}this._data_type=c;this.xmlLoader=this.doLoadDetails;var g=this;this.xmlLoader=function(h){if(!g.callEvent){return}g["_process_"+c](h.xmlDoc);if(!g._contextCallTimer){g.callEvent("onXLE",[g,0,0,h.xmlDoc])}if(e){e();e=null}};return dhx4.ajax.get(a,this.xmlLoader)},loadXMLString:function(c,a){this.parse({responseXML:dhx4.ajax.parse(c)},a,"xml")},loadXML:function(a,c){this.load(a,c,"xml")},parse:function(e,c,a){if(arguments.length==2&&typeof c!="function"){a=c;c=null}a=a||"xml";this._data_type=a;if(a=="xml"&&typeof e=="string"){e={responseXML:dhx4.ajax.parse(e)}}this["_process_"+a](e);if(!this._contextCallTimer){this.callEvent("onXLE",[this,0,0,e])}if(c){c()}},xml:{top:"rows",row:"./row",cell:"./cell",s_row:"row",s_cell:"cell",row_attrs:[],cell_attrs:[]},csv:{row:"\n",cell:","},_xml_attrs:function(c){var e={};if(c.attributes.length){for(var a=0;a<c.attributes.length;a++){e[c.attributes[a].name]=c.attributes[a].value}}return e},_process_xml:function(q){if(this._refresh_mode){return this._refreshFromXML(q)}this._parsing=true;var m=dhx4.ajax.xmltop(this.xml.top,q);if(m.tagName!=this.xml.top){return}var o=m.getAttribute("dhx_security");if(o){dhtmlx.security_key=o}this._parseHead(m);var r=dhx4.ajax.xpath(this.xml.row,m);var l=parseInt(m.getAttribute("pos")||0);var n=parseInt(m.getAttribute("total_count")||0);if(!this.pagingOn){var n=Math.min(n,32000000/this._srdh)}var g=false;if(n&&n!=this.rowsBuffer.length){if(!this.rowsBuffer[n-1]){if(this.rowsBuffer.length){g=true}this.rowsBuffer[n-1]=null}if(n<this.rowsBuffer.length){this.rowsBuffer.splice(n,this.rowsBuffer.length-n);g=true}}if(this.isTreeGrid()){return this._process_tree_xml(m)}for(var c=0;c<r.length;c++){if(this.rowsBuffer[c+l]){continue}var a=r[c].getAttribute("id")||(c+l+1);this.rowsBuffer[c+l]={idd:a,data:r[c],_parser:this._process_xml_row,_locator:this._get_xml_data};this.rowsAr[a]=r[c]}this.callEvent("onDataReady",[]);if(g&&this._srnd){var e=this.objBox.scrollTop;this._reset_view();this.objBox.scrollTop=e}else{this.render_dataset()}this._parsing=false},_process_jsarray:function(data){this._parsing=true;data=data.responseText||data;if(typeof data=="string"){eval("dhtmlx.temp="+data+";");data=dhtmlx.temp}for(var i=0;i<data.length;i++){var id=i+1;this.rowsBuffer.push({idd:id,data:data[i],_parser:this._process_jsarray_row,_locator:this._get_jsarray_data});this.rowsAr[id]=data[i]}this.render_dataset();this._parsing=false},_process_csv:function(g){this._parsing=true;g=g.responseText||g;g=g.replace(/\r/g,"");g=g.split(this.csv.row);if(this._csvHdr){this.clearAll();var e=g.splice(0,1)[0].split(this.csv.cell);if(!this._csvAID){e.splice(0,1)}this.setHeader(e.join(this.delim));this.init()}for(var c=0;c<g.length;c++){if(!g[c]&&c==g.length-1){continue}if(this._csvAID){var h=c+1;this.rowsBuffer.push({idd:h,data:g[c],_parser:this._process_csv_row,_locator:this._get_csv_data})}else{var a=g[c].split(this.csv.cell);var h=a.splice(0,1)[0];this.rowsBuffer.push({idd:h,data:a,_parser:this._process_jsarray_row,_locator:this._get_jsarray_data})}this.rowsAr[h]=g[c]}this.render_dataset();this._parsing=false},_process_js:function(a){return this._process_json(a,"js")},_process_json:function(data,mode){this._parsing=true;var data=data.responseText||data;if(typeof data=="string"){eval("dhtmlx.temp="+data+";");data=dhtmlx.temp}if(mode=="js"){if(data.data){data=data.data}for(var i=0;i<data.length;i++){var row=data[i];var id=row.id||(i+1);this.rowsBuffer.push({idd:id,data:row,_parser:this._process_js_row,_locator:this._get_js_data});this.rowsAr[id]=data[i]}}else{if(data.rows){for(var i=0;i<data.rows.length;i++){var id=data.rows[i].id;this.rowsBuffer.push({idd:id,data:data.rows[i],_parser:this._process_json_row,_locator:this._get_json_data});this.rowsAr[id]=data.rows[i]}}}if(data.dhx_security){dhtmlx.security_key=data.dhx_security}this.callEvent("onDataReady",[]);this.render_dataset();this._parsing=false},render_dataset:function(g,a){if(this._srnd){if(this._fillers){return this._update_srnd_view()}a=Math.min((this._get_view_size()+(this._srnd_pr||0)),this.rowsBuffer.length)}if(this.pagingOn){g=Math.max((g||0),(this.currentPage-1)*this.rowsBufferOutSize);a=Math.min(this.currentPage*this.rowsBufferOutSize,this.rowsBuffer.length)}else{g=g||0;a=a||this.rowsBuffer.length}for(var e=g;e<a;e++){var l=this.render_row(e);if(l==-1){if(this.xmlFileUrl){if(this.callEvent("onDynXLS",[e,(this._dpref?this._dpref:(a-e))])){this.load(this.xmlFileUrl+dhtmlx.url(this.xmlFileUrl)+"posStart="+e+"&count="+(this._dpref?this._dpref:(a-e)),this._data_type)}}a=e;break}if(!l.parentNode||!l.parentNode.tagName){this._insertRowAt(l,e);if(l._attrs.selected||l._attrs.select){this.selectRow(l,l._attrs.call?true:false,true);l._attrs.selected=l._attrs.select=null}}if(this._ads_count&&e-g==this._ads_count){var h=this;this._context_parsing=this._context_parsing||this._parsing;return this._contextCallTimer=window.setTimeout(function(){h._contextCallTimer=null;h.render_dataset(e,a);if(!h._contextCallTimer){if(h._context_parsing){h.callEvent("onXLE",[])}else{h._fixAlterCss()}h.callEvent("onDistributedEnd",[]);h._context_parsing=false}},this._ads_time)}}if(this._ads_count&&e==a){this.callEvent("onDistributedEnd",[])}if(this._srnd&&!this._fillers){var c=this.rowsBuffer.length-a;this._fillers=[];if(this._fake&&!this._realfake){this._fake._fillers=[]}while(c>0){var n=(_isIE||window._FFrv)?Math.min(c,50000):c;var m=this._add_filler(a,n);if(m){this._fillers.push(m)}c-=n;a+=n}}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 e=this._prepareRow(a.idd);this.rowsBuffer[c]=e;this.rowsAr[a.idd]=e;a._parser.call(this,e,a.data);this._postRowProcessing(e);return e}return this.rowsBuffer[c]},_get_cell_value:function(c,a,e){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)[e?e:"getValue"]()},sortRows:function(e,l,c){this.editStop();c=(c||"asc").toLowerCase();l=(l||this.fldSort[e]);e=e||0;if(this.isTreeGrid()){this.sortTreeRows(e,l,c)}else{var a={};var h=this.cellType[e];var m="getValue";if(h=="link"){m="getContent"}if(h=="dhxCalendar"||h=="dhxCalendarA"){m="getDate"}for(var g=0;g<this.rowsBuffer.length;g++){a[this.rowsBuffer[g].idd]=this._get_cell_value(this.rowsBuffer[g],e,m)}this._sortRows(e,l,c,a)}this.callEvent("onAfterSorting",[e,l,c])},_sortCore:function(e,l,c,a,h){var g="sort";if(this._sst){h.stablesort=this.rowsCol.stablesort;g="stablesort"}if(l.length>4){l=window[l]}if(l=="cus"){var m=this._customSorts[e];h[g](function(o,n){return m(a[o.idd],a[n.idd],c,o.idd,n.idd)})}else{if(typeof(l)=="function"){h[g](function(o,n){return l(a[o.idd],a[n.idd],c,o.idd,n.idd)})}else{if(l=="str"){h[g](function(o,n){if(c=="asc"){return a[o.idd]>a[n.idd]?1:(a[o.idd]<a[n.idd]?-1:0)}else{return a[o.idd]<a[n.idd]?1:(a[o.idd]>a[n.idd]?-1:0)}})}else{if(l=="int"){h[g](function(q,o){var n=parseFloat(a[q.idd]);n=isNaN(n)?-99999999999999:n;var r=parseFloat(a[o.idd]);r=isNaN(r)?-99999999999999:r;if(c=="asc"){return n-r}else{return r-n}})}else{if(l=="date"){h[g](function(q,o){var n=Date.parse(a[q.idd])||(Date.parse("01/01/1900"));var r=Date.parse(a[o.idd])||(Date.parse("01/01/1900"));if(c=="asc"){return n-r}else{return r-n}})}}}}}},_sortRows:function(e,g,c,a){this._sortCore(e,g,c,a,this.rowsBuffer);this._reset_view();this.callEvent("onGridReconstructed",[])},_reset_view:function(e){if(!this.obj.rows[0]){return}if(this._lahRw){this._unsetRowHover(0,true)}this.callEvent("onResetView",[]);var a=this.obj.rows[0].parentNode;var g=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(g);this.rowsCol=dhtmlxArray();if(this._sst){this.enableStableSorting(true)}this._fillers=this.undefined;if(!e){if(_isIE&&this._srnd){this.render_dataset()}else{this.render_dataset()}}},deleteRow:function(c,g){if(!g){g=this.getRowById(c)}if(!g){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(g)}else{if(g.parentNode){g.parentNode.removeChild(g)}var l=this.rowsCol._dhx_find(g);if(l!=-1){this.rowsCol._dhx_removeAt(l)}for(var e=0;e<this.rowsBuffer.length;e++){if(this.rowsBuffer[e]&&this.rowsBuffer[e].idd==c){this.rowsBuffer._dhx_removeAt(e);l=e;break}}}this.rowsAr[c]=null;for(var e=0;e<this.selectedRows.length;e++){if(this.selectedRows[e].idd==c){this.selectedRows._dhx_removeAt(e)}}if(this._srnd){for(var e=0;e<this._fillers.length;e++){var h=this._fillers[e];if(!h){continue}if(h[0]>=l){this._update_fillers(e,0,-1)}else{if(h[0]+h[1]>l){this._update_fillers(e,-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(l,m,c){if(c==-1||typeof c=="undefined"){c=this.rowsBuffer.length}if(typeof m=="string"){m=m.split(this.delim)}var n=this._prepareRow(l);n._attrs={};for(var e=0;e<n.childNodes.length;e++){n.childNodes[e]._attrs={}}this.rowsAr[n.idd]=n;if(this._h2){this._h2.get[n.idd].buff=n}this._fillRow(n,m);this._postRowProcessing(n);if(this._skipInsert){this._skipInsert=false;return this.rowsAr[n.idd]=n}if(this.pagingOn){this.rowsBuffer._dhx_insertAt(c,n);this.rowsAr[n.idd]=n;return n}if(this._fillers){this.rowsCol._dhx_insertAt(c,null);this.rowsBuffer._dhx_insertAt(c,n);if(this._fake){this._fake.rowsCol._dhx_insertAt(c,null)}this.rowsAr[n.idd]=n;var o=false;for(var g=0;g<this._fillers.length;g++){var h=this._fillers[g];if(h&&h[0]<=c&&(h[0]+h[1])>=c){h[1]=h[1]+1;var a=h[2].firstChild.style.height=parseInt(h[2].firstChild.style.height)+this._srdh+"px";o=true;if(this._fake){this._fake._fillers[g][1]++;this._fake._fillers[g][2].firstChild.style.height=a}}if(h&&h[0]>c){h[0]=h[0]+1;if(this._fake){this._fake._fillers[g][0]++}}}if(!o){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 n}this.rowsBuffer._dhx_insertAt(c,n);return this._insertRowAt(n,c)},addRow:function(a,g,e){var c=this._addRow(a,g,e);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(e,g,c){this.rowsAr[e.idd]=e;if(this._skipInsert){this._skipInsert=false;return e}if((g<0)||((!g)&&(parseInt(g)!==0))){g=this.rowsCol.length}else{if(g>this.rowsCol.length){g=this.rowsCol.length}}if(this._cssEven){var a=e.className.replace(this._cssUnEven,"");if((this._cssSP?this.getLevel(e.idd):g)%2==1){e.className=a+" "+this._cssUnEven+(this._cssSU?(" "+this._cssUnEven+"_"+this.getLevel(e.idd)):"")}else{e.className=a+" "+this._cssEven+(this._cssSU?(" "+this._cssEven+"_"+this.getLevel(e.idd)):"")}}if(!c){if((g==(this.obj.rows.length-1))||(!this.rowsCol[g])){if(_isKHTML){this.obj.appendChild(e)}else{this.obj.firstChild.appendChild(e)}}else{this.rowsCol[g].parentNode.insertBefore(e,this.rowsCol[g])}}this.rowsCol._dhx_insertAt(g,e);this.callEvent("onRowInserted",[e,g]);return e},getRowById:function(e){var c=this.rowsAr[e];if(c){if(c.tagName!="TR"){for(var a=0;a<this.rowsBuffer.length;a++){if(this.rowsBuffer[a]&&this.rowsBuffer[a].idd==e){return this.render_row(a)}}if(this._h2){return this.render_row(null,c.idd)}}return c}return null},cellById:function(c,a){return this.cells(c,a)},cells:function(g,e){if(arguments.length==0){return this.cells4(this.cell)}else{var h=this.getRowById(g)}var a=(h._childIndexes?h.childNodes[h._childIndexes[e]]:h.childNodes[e]);if(!a&&h._childIndexes){a=h.firstChild||{}}return this.cells4(a)},cellByIndex:function(c,a){return this.cells2(c,a)},cells2:function(g,e){var h=this.render_row(g);var a=(h._childIndexes?h.childNodes[h._childIndexes[e]]:h.childNodes[e]);if(!a&&h._childIndexes){a=h.firstChild||{}}return this.cells4(a)},cells3:function(e,c){var a=(e._childIndexes?e.childNodes[e._childIndexes[c]]:e.childNodes[c]);return this.cells4(a)},cells4:function(a){var c=window["eXcell_"+(a._cellType||this.cellType[a._cellIndex])];if(c){return new c(a)}},cells5:function(a,e){var e=e||(a._cellType||this.cellType[a._cellIndex]);if(!this._ecache[e]){if(!window["eXcell_"+e]){var c=eXcell_ro}else{var c=window["eXcell_"+e]}this._ecache[e]=new c(a)}this._ecache[e].cell=a;return this._ecache[e]},dma:function(a){if(!this._ecache){this._ecache={}}if(a&&!this._dma){this._dma=this.cells4;this.cells4=this.cells5}else{if(!a&&this._dma){this.cells4=this._dma;this._dma=null}}},getRowsNum:function(){return this.rowsBuffer.length},enableEditTabOnly:function(a){if(arguments.length>0){this.smartTabOrder=dhx4.s2b(a)}else{this.smartTabOrder=true}},setExternalTabOrder:function(h,a){var c=this;this.tabStart=(typeof(h)=="object")?h:document.getElementById(h);var e=this.tabStart.onkeydown;this.tabStart.onkeydown=function(m){if(e){e.call(this,m)}var l=(m||window.event);if(l.keyCode==9&&!l.shiftKey){l.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 g=this.tabEnd.onkeydown;this.tabEnd.onkeydown=this.tabEnd.onkeypress=function(m){if(g){g.call(this,m)}var l=(m||window.event);if(l.keyCode==9&&l.shiftKey){l.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 g(m,n){this[m]=n}function l(m,n){this[m].call(this,n)}function e(m,n){this[m].call(this,n.join(this.delim))}function a(m,q){for(var o=0;o<q.length;o++){if(typeof q[o]=="object"){var r=this.getCombo(o);for(var n in q[o]){r.put(n,q[o][n])}}}}function h(m,v,q){var x=1;var u=[];function w(A,y,C){if(!u[y]){u[y]=[]}if(typeof C=="object"){C.toString=function(){return this.text}}u[y][A]=C}for(var r=0;r<v.length;r++){if(typeof(v[r])=="object"&&v[r].length){for(var o=0;o<v[r].length;o++){w(r,o,v[r][o])}}else{w(r,0,v[r])}}for(var r=0;r<u.length;r++){for(var o=0;o<u[0].length;o++){var s=u[r][o];u[r][o]=(s||"").toString()||"&nbsp;";if(s&&s.colspan){for(var n=1;n<s.colspan;n++){w(o+n,r,"#cspan")}}if(s&&s.rowspan){for(var n=1;n<s.rowspan;n++){w(o,r+n,"#rspan")}}}}this.setHeader(u[0]);for(var r=1;r<u.length;r++){this.attachHeader(u[r])}}var c=[{name:"label",def:"&nbsp;",operation:"setHeader",type:h},{name:"id",def:"",operation:"columnIds",type:g},{name:"width",def:"*",operation:"setInitWidths",type:e},{name:"align",def:"left",operation:"cellAlign",type:g},{name:"valign",def:"middle",operation:"cellVAlign",type:g},{name:"sort",def:"na",operation:"fldSort",type:g},{name:"type",def:"ro",operation:"setColTypes",type:e},{name:"options",def:"",operation:"",type:a}];dhtmlx.extend_api("dhtmlXGridObject",{_init:function(m){return[m.parent]},image_path:"setImagePath",columns:"columns",rows:"rows",headers:"headers",skin:"setSkin",smart_rendering:"enableSmartRendering",css:"enableAlterCss",auto_height:"enableAutoHeight",save_hidden:"enableAutoHiddenColumnsSaving",save_cookie:"enableAutoSaving",save_size:"enableAutoSizeSaving",auto_width:"enableAutoWidth",block_selection:"enableBlockSelection",csv_id:"enableCSVAutoID",csv_header:"enableCSVHeader",cell_ids:"enableCellIds",colspan:"enableColSpan",column_move:"enableColumnMove",context_menu:"enableContextMenu",distributed:"enableDistributedParsing",drag:"enableDragAndDrop",drag_order:"enableDragOrder",tabulation:"enableEditTabOnly",header_images:"enableHeaderImages",header_menu:"enableHeaderMenu",keymap:"enableKeyboardSupport",mouse_navigation:"enableLightMouseNavigation",markers:"enableMarkedCells",math_editing:"enableMathEditing",math_serialization:"enableMathSerialization",drag_copy:"enableMercyDrag",multiline:"enableMultiline",multiselect:"enableMultiselect",save_column_order:"enableOrderSaving",hover:"enableRowsHover",rowspan:"enableRowspan",smart:"enableSmartRendering",save_sorting:"enableSortingSaving",stable_sorting:"enableStableSorting",undo:"enableUndoRedo",csv_cell:"setCSVDelimiter",date_format:"setDateFormat",drag_behavior:"setDragBehavior",editable:"setEditable",without_header:"setNoHeader",submit_changed:"submitOnlyChanged",submit_serialization:"submitSerialization",submit_selected:"submitOnlySelected",submit_id:"submitOnlyRowID",xml:"load"},{columns:function(r){for(var m=0;m<c.length;m++){var q=[];for(var n=0;n<r.length;n++){q[n]=r[n][c[m].name]||c[m].def}var o=c[m].type||l;o.call(this,c[m].operation,q,r)}this.init()},rows:function(m){},headers:function(n){for(var m=0;m<n.length;m++){this.attachHeader(n[m])}}})})();dhtmlXGridObject.prototype._dp_init=function(a){a.attachEvent("insertCallback",function(c,g){if(this.obj._h2){this.obj.addRow(g,e,null,parent)}else{this.obj.addRow(g,[],0)}var e=this.obj.getRowById(g);if(e){this.obj._process_xml_row(e,c.firstChild);this.obj._postRowProcessing(e)}});a.attachEvent("updateCallback",function(c,g){var e=this.obj.getRowById(g);if(e){this.obj._process_xml_row(e,c.firstChild);this.obj._postRowProcessing(e)}});a.attachEvent("deleteCallback",function(c,e){this.obj.setUserData(e,this.action_param,"true_deleted");this.obj.deleteRow(e)});a._methods=["setRowTextStyle","setCellTextStyle","changeRowId","deleteRow"];this.attachEvent("onEditCell",function(g,h,e){if(a._columns&&!a._columns[e]){return true}var c=this.cells(h,e);if(g==1){if(c.isCheckbox()){a.setUpdated(h,true)}}else{if(g==2){if(c.wasChanged()){a.setUpdated(h,true)}}}return true});this.attachEvent("onRowPaste",function(c){a.setUpdated(c,true)});this.attachEvent("onUndo",function(c){a.setUpdated(c,true)});this.attachEvent("onRowIdChange",function(g,c){var e=a.findRow(g);if(e<a.updatedRows.length){a.updatedRows[e]=c}});this.attachEvent("onSelectStateChanged",function(c){if(a.updateMode=="row"){a.sendData()}return true});this.attachEvent("onEnter",function(e,c){if(a.updateMode=="row"){a.sendData()}return true});this.attachEvent("onBeforeRowDeleted",function(c){if(a._silent_mode||(!this.rowsAr[c])){return true}if(this.dragContext&&a.dnd){window.setTimeout(function(){a.setUpdated(c,true)},1);return true}var e=a.getState(c);if(this._h2){this._h2.forEachChild(c,function(g){a.setUpdated(g.id,false);a.markRow(g.id,true,"deleted")},this)}if(e=="inserted"){a.set_invalid(c,false);a.setUpdated(c,false);return true}if(e=="deleted"){return false}if(e=="true_deleted"){a.setUpdated(c,false);return true}a.setUpdated(c,true,"deleted");return false});this.attachEvent("onBindUpdate",function(c){if(typeof c=="object"){c=c.id}a.setUpdated(c,true)});this.attachEvent("onRowAdded",function(c){if(this.dragContext&&a.dnd){return true}a.setUpdated(c,true,"inserted");return true});a._getRowData=function(g,s){var m=[];m.gr_id=g;if(this.obj.isTreeGrid()){m.gr_pid=this.obj.getParentId(g)}var e=this.obj.getRowById(g);for(var n=0;n<this.obj._cCount;n++){if(this.obj._c_order){var o=this.obj._c_order[n]}else{var o=n}var q=this.obj.cells(e.idd,n);if(this._changed&&!q.wasChanged()){continue}if(this._endnm){m[this.obj.getColumnId(n)]=q.getValue()}else{m["c"+o]=q.getValue()}}var h=this.obj.UserData[g];if(h){for(var l=0;l<h.keys.length;l++){if(h.keys[l]&&h.keys[l].indexOf("__")!=0){m[h.keys[l]]=h.values[l]}}}var h=this.obj.UserData.gridglobaluserdata;if(h){for(var l=0;l<h.keys.length;l++){m[h.keys[l]]=h.values[l]}}return m};a._clearUpdateFlag=function(e){var g=this.obj.getRowById(e);if(g){for(var c=0;c<this.obj._cCount;c++){this.obj.cells(e,c).cell.wasChanged=false}}};a.checkBeforeUpdate=function(l){var h=true;var c=[];for(var g=0;g<this.obj._cCount;g++){if(this.mandatoryFields[g]){var e=this.mandatoryFields[g].call(this.obj,this.obj.cells(l,g).getValue(),l,g);if(typeof e=="string"){this.messages.push(e);h=false}else{h&=e;c[g]=!e}}}if(!h){this.set_invalid(l,"invalid",c);this.setUpdated(l,false)}return h}};dhx4.attachEvent("onGridCreated",function(c){c._con_f_used=[].concat(c._con_f_used);dhtmlXGridObject.prototype._con_f_used=[];var a=function(l){l=l.replace(/(\?|\&)connector[^\f]*/g,"");return l+(l.indexOf("?")!=-1?"&":"?")+"connector=true"+(this.hdr.rows.length>0?"&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 e=function(m,l,o){var q=[];for(var n=0;n<l.length;n++){q[n]="dhx_filter["+l[n]+"]="+encodeURIComponent(o[n])}this._connector_filter="&"+q.join("&");return h.call(this,m)};c.attachEvent("onCollectValues",function(l){if(this._con_f_used[l]){if(typeof(this._con_f_used[l])=="object"){return this._con_f_used[l]}else{return false}}return true});c.attachEvent("onDynXLS",function(){if(this.xmlFileUrl){this.xmlFileUrl=h.call(this,this.xmlFileUrl)}return true});c.attachEvent("onBeforeSorting",function(o,n,m){if(n=="connector"){var l=this;this.clearAndLoad(g.call(this,this.xmlFileUrl,o,m),function(){l.setSortImgState(true,o,m)});return false}return true});c.attachEvent("onFilterStart",function(m,l){if(this._con_f_used.length){var o=this.getSortingState();var n=this;this.clearAndLoad(e.call(this,this.xmlFileUrl,m,l));if(o.length){n.setSortImgState(true,o[0],o[1])}return false}return true})});dhtmlXGridObject.prototype._con_f_used=[];dhtmlXGridObject.prototype._in_header_connector_text_filter=function(c,a){if(!this._con_f_used[a]){this._con_f_used[a]=1}return this._in_header_text_filter(c,a)};dhtmlXGridObject.prototype._in_header_connector_select_filter=function(c,a){if(!this._con_f_used[a]){this._con_f_used[a]=2}return this._in_header_select_filter(c,a)};if(!dhtmlXGridObject.prototype.load_connector){dhtmlXGridObject.prototype.load_connector=dhtmlXGridObject.prototype.load;dhtmlXGridObject.prototype.load=function(c,h,g){if(!this._colls_loaded&&this.cellType){var a=[];for(var e=0;e<this.cellType.length;e++){if(this.cellType[e].indexOf("co")==0||this.cellType[e].indexOf("clist")==0||this._con_f_used[e]==2){a.push(e)}}if(a.length){arguments[0]+=(arguments[0].indexOf("?")!=-1?"&":"?")+"connector=true&dhx_colls="+a.join(",")}}return this.load_connector.apply(this,arguments)};dhtmlXGridObject.prototype._parseHead_connector=dhtmlXGridObject.prototype._parseHead;dhtmlXGridObject.prototype._parseHead=function(c,u,q){this._parseHead_connector.apply(this,arguments);if(!this._colls_loaded){var r=dhx4.ajax.xpath("./coll_options",arguments[0]);for(var m=0;m<r.length;m++){var o=r[m].getAttribute("for");var s=[];var g=null;if(this.cellType[o]=="combo"){g=this.getColumnCombo(o)}else{if(this.cellType[o].indexOf("co")==0){g=this.getCombo(o)}}var l=dhx4.ajax.xpath("./item",r[m]);var a=[];for(var h=0;h<l.length;h++){var e=l[h].getAttribute("value");if(g){var n=l[h].getAttribute("label")||e;if(g.addOption){a.push([e,n])}else{g.put(e,n)}s[s.length]=n}else{s[s.length]=e}}if(a.length){if(g){g.addOption(a)}}else{if(s.length&&!g){if(this.registerCList){this.registerCList(o*1,s)}}}if(this._con_f_used[o*1]){this._con_f_used[o*1]=s}}this._colls_loaded=true}}}function dhtmlXGridCellObject(a){this.destructor=function(){this.cell.obj=null;this.cell=null;this.grid=null;this.base=null;return null};this.cell=a;this.getValue=function(){if((this.cell.textContent)&&(this.cell.textContent.tagName=="TEXTAREA")){return this.cell.textContent.value}else{return this.cell.innerHTML._dhx_trim()}};this.getMathValue=function(){if(this.cell.original){return this.cell.original}else{return this.getValue()}};this.getFont=function(){arOut=new Array(3);if(this.cell.style.fontFamily){arOut[0]=this.cell.style.fontFamily}if(this.cell.style.fontWeight=="bold"||this.cell.parentNode.style.fontWeight=="bold"){arOut[1]="bold"}if(this.cell.style.fontStyle=="italic"||this.cell.parentNode.style.fontWeight=="italic"){arOut[1]+="italic"}if(this.cell.style.fontSize){arOut[2]=this.cell.style.fontSize}else{arOut[2]=""}return arOut.join("-")};this.getTextColor=function(){if(this.cell.style.color){return this.cell.style.color}else{return"#000000"}};this.getBgColor=function(){if(this.cell.bgColor){return this.cell.bgColor}else{return"#FFFFFF"}};this.getHorAlign=function(){if(this.cell.style.textAlign){return this.cell.style.textAlign}else{if(this.cell.style.textAlign){return this.cell.style.textAlign}else{return"left"}}};this.getWidth=function(){return this.cell.scrollWidth};this.setFont=function(c){fntAr=c.split("-");this.cell.style.fontFamily=fntAr[0];this.cell.style.fontSize=fntAr[fntAr.length-1];if(fntAr.length==3){if(/bold/.test(fntAr[1])){this.cell.style.fontWeight="bold"}if(/italic/.test(fntAr[1])){this.cell.style.fontStyle="italic"}if(/underline/.test(fntAr[1])){this.cell.style.textDecoration="underline"}}};this.setTextColor=function(c){this.cell.style.color=c};this.setBgColor=function(c){if(c==""){c=null}this.cell.style.background=c};this.setHorAlign=function(c){if(c.length==1){if(c=="c"){this.cell.style.textAlign="center"}else{if(c=="l"){this.cell.style.textAlign="left"}else{this.cell.style.textAlign="right"}}}else{this.cell.style.textAlign=c}};this.wasChanged=function(){if(this.cell.wasChanged){return true}else{return false}};this.isCheckbox=function(){var c=this.cell.firstChild;if(c&&c.tagName=="INPUT"){type=c.type;if(type=="radio"||type=="checkbox"){return true}else{return false}}else{return false}};this.isChecked=function(){if(this.isCheckbox()){return this.cell.firstChild.checked}};this.isDisabled=function(){return this.cell._disabled};this.setChecked=function(c){if(this.isCheckbox()){if(c!="true"&&c!=1){c=false}this.cell.firstChild.checked=c}};this.setDisabled=function(c){if(c!="true"&&c!=1){c=false}if(this.isCheckbox()){this.cell.firstChild.disabled=c;if(this.disabledF){this.disabledF(c)}}this.cell._disabled=c}}dhtmlXGridCellObject.prototype={getAttribute:function(a){return this.cell._attrs[a]},setAttribute:function(a,c){this.cell._attrs[a]=c},getInput:function(){if(this.obj&&(this.obj.tagName=="INPUT"||this.obj.tagName=="TEXTAREA")){return this.obj}var a=(this.obj||this.cell).getElementsByTagName("TEXTAREA");if(!a.length){a=(this.obj||this.cell).getElementsByTagName("INPUT")}return a[0]}};dhtmlXGridCellObject.prototype.setValue=function(a){if((typeof(a)!="number")&&(!a||a.toString()._dhx_trim()=="")){a="&nbsp;";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCValue(a)};dhtmlXGridCellObject.prototype.getTitle=function(){return(_isIE?this.cell.innerText:this.cell.textContent)};dhtmlXGridCellObject.prototype.setCValue=function(c,a){this.cell.innerHTML=c;this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,(arguments.length>1?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(g){var a=g;var e=0;var c=0;while(a.tagName!="BODY"){e+=a.offsetLeft;c+=a.offsetTop;a=a.offsetParent}return new Array(e,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)?"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("&nbsp;",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("<img src='"+this.grid.imgURL+"item_chk"+c+".gif' onclick='new eXcell_ch(this.parentNode).changeState(true); (arguments[0]||event).cancelBubble=true; '>",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("<img src='"+this.grid.imgURL+"radio_chk"+c+".gif' onclick='new eXcell_ra(this.parentNode).changeState(false);'>",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(g){(g||event).cancelBubble=true};var c=this.grid.getPosition(this.cell);this.obj.value=this.val;this.obj.style.display="";this.obj.style.textAlign=this.cell.style.textAlign;document.body.appendChild(this.obj);if(_isOpera){this.obj.onkeypress=function(g){if(g.keyCode==9||g.keyCode==27){return false}}}this.obj.onkeydown=function(h){var g=(h||event);if(g.keyCode==9||g.keyCode==27){globalActiveDHTMLGridObject.entBox.focus();globalActiveDHTMLGridObject.doKey({keyCode:g.keyCode,shiftKey:g.shiftKey,srcElement:"0"});return false}};this.obj.style.left=c[0]+"px";this.obj.style.top=c[1]+this.cell.offsetHeight+"px";if(this.cell.offsetWidth<200){var e=200}else{var e=this.cell.offsetWidth}this.obj.style.width=e+16+"px";if(_isIE){this.obj.select();this.obj.value=this.obj.value}this.obj.focus()};this.detach=function(){var c="";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){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(/<br[^>]*>/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="&nbsp;";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,"<br/>"),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 g=this.grid.getPosition(this.cell);this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_combo_edit";this.obj.style.height=(this.cell.offsetHeight-(_isIE?4:4))+"px";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(o){(o||event).cancelBubble=true};this.obj.onmousedown=function(o){(o||event).cancelBubble=true};this.obj.value=this.text;this.obj.onselectstart=function(o){if(!o){o=event}o.cancelBubble=true;return true};var l=this;this.obj.onkeyup=function(r){var q=(r||event).keyCode;if(q==38||q==40||q==9){return}var s=this.readonly?String.fromCharCode(q):this.value;var u=l.list.options;for(var o=0;o<u.length;o++){if(u[o].text.indexOf(s)==0){return u[o].selected=true}}};this.list=document.createElement("SELECT");this.list.className="dhx_combo_select";this.list.style.width=this.cell.offsetWidth+"px";this.list.style.left=g[0]+"px";this.list.style.top=g[1]+this.cell.offsetHeight+"px";this.list.onclick=function(r){var q=r||window.event;var o=q.target||q.srcElement;if(o.tagName=="OPTION"){o=o.parentNode}l.editable=false;l.grid.editStop();q.cancelBubble=true};var c=this.combo.getKeys();var h=false;var n=0;for(var e=0;e<c.length;e++){var m=this.combo.get(c[e]);this.list.options[this.list.options.length]=new Option(m,c[e]);if(c[e]==this.val){n=this.list.options.length-1;h=true}}if(h==false){this.list.options[this.list.options.length]=new Option(this.text,this.val===null?"":this.val);n=this.list.options.length-1}document.body.appendChild(this.list);this.list.size="6";this.cstate=1;if(this.editable){this.cell.innerHTML=""}else{this.obj.style.width="1px";this.obj.style.height="1px"}this.cell.appendChild(this.obj);this.list.options[n].selected=true;if(this.editable){this.obj.focus();this.obj.focus()}if(!this.editable){this.obj.style.visibility="hidden";this.list.focus();this.list.onkeydown=function(o){o=o||window.event;l.grid.setActive(true);if(o.keyCode<30){return l.grid.doKey({target:l.cell,keyCode:o.keyCode,shiftKey:o.shiftKey,ctrlKey:o.ctrlKey})}}}};this.getValue=function(){return((this.cell.combo_value==window.undefined)?"":this.cell.combo_value)};this.detach=function(){if(this.val!=this.getValue()){this.cell.wasChanged=true}if(this.list.parentNode!=null){if(this.editable){var c=this.list.options[this.list.selectedIndex];if(c&&c.text==this.obj.value){this.setValue(this.list.value)}else{var e=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex));var g=e.values._dhx_find(this.obj.value);if(g!=-1){this.setValue(e.keys[g])}else{this.setValue(this.cell.combo_value=this.obj.value)}}}else{this.setValue(this.list.value)}}if(this.list.parentNode){this.list.parentNode.removeChild(this.list)}if(this.obj.parentNode){this.obj.parentNode.removeChild(this.obj)}return this.val!=this.getValue()}}eXcell_co.prototype=new eXcell;eXcell_co.prototype.getText=function(){return this.cell.innerHTML};eXcell_co.prototype.setValue=function(g){if(typeof(g)=="object"){var e=dhx4.ajax.xpath("./option",g);if(e.length){this.cell._combo=new dhtmlXGridComboObject()}for(var c=0;c<e.length;c++){this.cell._combo.put(e[c].getAttribute("value"),e[c].firstChild?e[c].firstChild.data:"")}g=g.firstChild.data}if((g||"").toString()._dhx_trim()==""){g=null}this.cell.combo_value=g;if(g!==null){var a=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(g);this.setCValue(a===null?g:a,g)}else{this.setCValue("&nbsp;",g)}};function eXcell_coro(a){this.base=eXcell_co;this.base(a);this.editable=false}eXcell_coro.prototype=new eXcell_co;function eXcell_cotxt(a){this.base=eXcell_co;this.base(a)}eXcell_cotxt.prototype=new eXcell_co;eXcell_cotxt.prototype.getText=function(){return(_isIE?this.cell.innerText:this.cell.textContent)};eXcell_cotxt.prototype.setValue=function(e){if(typeof(e)=="object"){var c=dhx4.ajax.xpath("./option",e);if(c.length){this.cell._combo=new dhtmlXGridComboObject()}for(var a=0;a<c.length;a++){this.cell._combo.put(c[a].getAttribute("value"),c[a].firstChild?c[a].firstChild.data:"")}e=e.firstChild.data}if((e||"").toString()._dhx_trim()==""){e=null}if(e!==null){this.setCTxtValue((this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(e)||e,e)}else{this.setCTxtValue(" ",e)}this.cell.combo_value=e};function eXcell_corotxt(a){this.base=eXcell_co;this.base(a);this.editable=false}eXcell_corotxt.prototype=new eXcell_cotxt;function eXcell_cp(a){try{this.cell=a;this.grid=this.cell.parentNode.grid}catch(c){}this.edit=function(){this.val=this.getValue();this.obj=document.createElement("SPAN");this.obj.style.border="1px solid black";this.obj.style.position="absolute";var e=this.grid.getPosition(this.cell);this.colorPanel(4,this.obj);document.body.appendChild(this.obj);this.obj.style.left=e[0]+"px";this.obj.style.zIndex=1000;this.obj.style.top=e[1]+this.cell.offsetHeight+"px"};this.toolDNum=function(e){if(e.length==1){e="0"+e}return e};this.colorPanel=function(q,v){var m=document.createElement("TABLE");v.appendChild(m);m.cellSpacing=0;m.editor_obj=this;m.style.cursor="default";m.onclick=function(x){var w=x||window.event;var n=w.target||w.srcElement;var r=n.parentNode.parentNode.parentNode.editor_obj;if(r){r.setValue(n._bg);r.grid.editStop()}};var h=256/q;for(var l=0;l<=(256/h);l++){var e=m.insertRow(l);for(var o=0;o<=(256/h);o++){for(var g=0;g<=(256/h);g++){R=new Number(h*l)-(l==0?0:1);G=new Number(h*o)-(o==0?0:1);B=new Number(h*g)-(g==0?0:1);var u=this.toolDNum(R.toString(16))+""+this.toolDNum(G.toString(16))+""+this.toolDNum(B.toString(16));var s=e.insertCell(o);s.width="10px";s.innerHTML="&nbsp;";s.title=u.toUpperCase();s.style.backgroundColor="#"+u;s._bg="#"+u;if(this.val!=null&&"#"+u.toUpperCase()==this.val.toUpperCase()){s.style.border="2px solid white"}}}}};this.getValue=function(){return this.cell.firstChild._bg||""};this.getRed=function(){return Number(parseInt(this.getValue().substr(1,2),16))};this.getGreen=function(){return Number(parseInt(this.getValue().substr(3,2),16))};this.getBlue=function(){return Number(parseInt(this.getValue().substr(5,2),16))};this.detach=function(){if(this.obj.offsetParent!=null){document.body.removeChild(this.obj)}return this.val!=this.getValue()}}eXcell_cp.prototype=new eXcell;eXcell_cp.prototype.setValue=function(a){this.setCValue("<div style='width:100%;height:"+((this.grid.multiLine?"100%":23))+";background-color:"+(a||"")+";border:0px;'>&nbsp;</div>",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 e=this.cell.firstChild.firstChild.src+(this.cell.titFl!=null?"^"+this.cell._brval:"");e+="^"+this.cell.lnk;if(this.cell.trg){e+="^"+this.cell.trg}return e}}};this.isDisabled=function(){return true}}eXcell_img.prototype=new eXcell;eXcell_img.prototype.getTitle=function(){return this.cell._brval};eXcell_img.prototype.setValue=function(e){var c=e;if((e||"").indexOf("^")!=-1){var a=e.split("^");e=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("<img src='"+this.grid.iconURL+(e||"")._dhx_trim()+"' border='0'>",e);if(this.cell.lnk){this.cell.innerHTML="<a href='"+this.cell.lnk+"' target='"+this.cell.trg+"'>"+this.cell.innerHTML+"</a>"}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("<span>$</span><span style='padding-right:2px;color:"+a+";'>"+c+"</span>",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(e){if(!e||isNaN(Number(e))){if(e!==""){e=0}}if(e>0){var c="green";var a="dyn_up.gif"}else{if(e==0){var c="black";var a="dyn_.gif"}else{var c="red";var a="dyn_down.gif"}}this.setCValue("<div style='position:relative;padding-right:2px; width:100%;overflow:hidden; white-space:nowrap;'><img src='"+this.grid.imgURL+""+a+"' height='15' style='position:absolute;top:0px;left:0px;'><span style=' padding-left:20px; width:100%;color:"+c+";'>"+e+"</span></div>",e)};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.cell._orig_value||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("&nbsp;");return this.cell._clearCell=true}}this.cell._orig_value=a;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,e){for(var a=0;a<this.keys.length;a++){if(this.keys[a]==c){this.values[a]=e;return true}}this.values[this.values.length]=e;this.keys[this.keys.length]=c};this.get=function(c){for(var a=0;a<this.keys.length;a++){if(this.keys[a]==c){return this.values[a]}}return null};this.clear=function(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray()};this.remove=function(c){for(var a=0;a<this.keys.length;a++){if(this.keys[a]==c){this.keys._dhx_removeAt(a);this.values._dhx_removeAt(a);return true}}};this.size=function(){var a=0;for(var c=0;c<this.keys.length;c++){if(this.keys[c]!=null){a++}}return a};this.getKeys=function(){var a=new Array(0);for(var c=0;c<this.keys.length;c++){if(this.keys[c]!=null){a[a.length]=this.keys[c]}}return a};this.save=function(){this._save=new Array();for(var a=0;a<this.keys.length;a++){this._save[a]=[this.keys[a],this.values[a]]}};this.restore=function(){if(this._save){this.keys[a]=new Array();this.values[a]=new Array();for(var a=0;a<this._save.length;a++){this.keys[a]=this._save[a][0];this.values[a]=this._save[a][1]}}};return this}function Hashtable(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray();return this}Hashtable.prototype=new dhtmlXGridComboObject;if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachGrid=function(){this.callEvent("_onBeforeContentAttach",["grid"]);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(typeof(window.dhtmlXTabBarCell)!="undefined"&&this instanceof window.dhtmlXTabBarCell&&navigator.userAgent.match(/7[\.\d]* mobile/gi)!=null&&navigator.userAgent.match(/AppleWebKit/gi)!=null){this.dataObj.objBox.style.webkitOverflowScrolling="auto"}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}}dhtmlXGridObject.prototype.enableDragAndDrop=function(a){if(a=="temporary_disabled"){this.dADTempOff=false;a=true}else{this.dADTempOff=true}this.dragAndDropOff=dhx4.s2b(a);this._drag_validate=true;if(a){this.objBox.ondragstart=function(c){(c||event).cancelBubble=true;return false}}};dhtmlXGridObject.prototype.setDragBehavior=function(a){this.dadmodec=this.dadmodefix=0;switch(a){case"child":this.dadmode=0;this._sbmod=false;break;case"sibling":this.dadmode=1;this._sbmod=false;break;case"sibling-next":this.dadmode=1;this._sbmod=true;break;case"complex":this.dadmode=2;this._sbmod=false;break;case"complex-next":this.dadmode=2;this._sbmod=true;break}};dhtmlXGridObject.prototype.enableDragOrder=function(a){this._dndorder=dhx4.s2b(a)};dhtmlXGridObject.prototype._checkParent=function(g,c){var e=this._h2.get[g.idd].parent;if(!e.parent){return}for(var a=0;a<c.length;a++){if(c[a]==e.id){return true}}return this._checkParent(this.rowsAr[e.id],c)};dhtmlXGridObject.prototype._createDragNode=function(g,h){this.editStop();if(window.dhtmlDragAndDrop.dragNode){return null}if(!this.dADTempOff){return null}g.parentObject=new Object();g.parentObject.treeNod=this;var o=this.callEvent("onBeforeDrag",[g.parentNode.idd,g._cellIndex,h]);if(!o){return null}var l=new Array();l=this.getSelectedId();l=(((l)&&(l!=""))?l.split(this.delim):[]);var m=false;for(var c=0;c<l.length;c++){if(l[c]==g.parentNode.idd){m=true}}if(!m){this.selectRow(this.rowsAr[g.parentNode.idd],false,h.ctrlKey,false);if(!h.ctrlKey){l=[]}l[this.selMultiRows?l.length:0]=g.parentNode.idd}if(this.isTreeGrid()){for(var c=l.length-1;c>=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(r,e){return(q.rowsAr[r].rowIndex>q.rowsAr[e].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<l.length;c++){if(this.rowsAr[l[c]]){this._dragged[this._dragged.length]=this.rowsAr[l[c]];this.rowsAr[l[c]].treeNod=this}}g.parentObject.parentNode=g.parentNode;var n=document.createElement("div");n.innerHTML=(o!==true?o:this.rowToDragElement(g.parentNode.idd));n.style.position="absolute";n.className="dragSpanDiv";return n};dhtmlXGridObject.prototype._createSdrgc=function(){this._sdrgc=document.createElement("DIV");this._sdrgc.innerHTML="&nbsp;";this._sdrgc.className="gridDragLine";this.objBox.appendChild(this._sdrgc)};function dragContext(w,v,u,s,r,q,n,o,m,g){this.source=w||"grid";this.target=v||"grid";this.mode=u||"move";this.dropmode=s||"child";this.sid=r||0;this.tid=q;this.sobj=n||null;this.tobj=o||null;this.sExtra=m||null;this.tExtra=g||null;return this}dragContext.prototype.valid=function(){if(this.sobj!=this.tobj){return true}if(this.sid==this.tid){return false}if(this.target=="treeGrid"){var a=this.tid;while(a=this.tobj.getParentId(a)){if(this.sid==a){return false}}}return true};dragContext.prototype.close=function(){this.sobj=null;this.tobj=null};dragContext.prototype.copy=function(){return new dragContext(this.source,this.target,this.mode,this.dropmode,this.sid,this.tid,this.sobj,this.tobj,this.sExtra,this.tExtra)};dragContext.prototype.set=function(e,c){this[e]=c;return this};dragContext.prototype.uid=function(e,c){this.nid=this.sid;while(this.tobj.rowsAr[this.nid]){this.nid=this.nid+((new Date()).valueOf())}return this};dragContext.prototype.data=function(){if(this.sobj==this.tobj){return this.sobj._getRowArray(this.sobj.rowsAr[this.sid])}if(this.source=="tree"){return this.tobj.treeToGridElement(this.sobj,this.sid,this.tid)}else{return this.tobj.gridToGrid(this.sid,this.sobj,this.tobj)}};dragContext.prototype.attrs=function(){if(this.source=="tree"){return{}}else{return this.sobj.rowsAr[this.sid]._attrs}};dragContext.prototype.childs=function(){if(this.source=="treeGrid"){return this.sobj._h2.get[this.sid]._xml_await?this.sobj._h2.get[this.sid].has_kids:null}return null};dragContext.prototype.pid=function(){if(!this.tid){return 0}if(!this.tobj._h2){return 0}if(this.target=="treeGrid"){if(this.dropmode=="child"){return this.tid}else{var c=this.tobj.rowsAr[this.tid];var a=this.tobj._h2.get[c.idd].parent.id;if((this.alfa)&&(this.tobj._sbmod)&&(c.nextSibling)){var e=this.tobj._h2.get[c.nextSibling.idd].parent.id;if(e==this.tid){return this.tid}if(e!=a){return e}}return a}}};dragContext.prototype.ind=function(){if(this.tid==window.unknown){return this.tobj.rowsBuffer.length}if(this.target=="treeGrid"){if(this.dropmode=="child"){this.tobj.openItem(this.tid)}else{this.tobj.openItem(this.tobj.getParentId(this.tid))}}var a=this.tobj.rowsBuffer._dhx_find(this.tobj.rowsAr[this.tid]);if((this.alfa)&&(this.tobj._sbmod)&&(this.dropmode=="sibling")){var c=this.tobj.rowsAr[this.tid];if((c.nextSibling)&&(this._h2.get[c.nextSibling.idd].parent.id==this.tid)){return a+1}}return(a+1+((this.target=="treeGrid"&&a>=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<this.sid.length;a++){c[c.length]=this.sid[a][(this.source=="tree")?"id":"idd"]}return c.join(",")};dhtmlXGridObject.prototype._drag=function(r,h,q,s){if(this._realfake){return this._fake._drag()}var o=(this.lastLanding);if(this._autoOpenTimer){window.clearTimeout(this._autoOpenTimer)}var g=q.parentNode;var e=r.parentObject;if(!g.idd){g.grid=this;this.dadmodefix=0}var n=new dragContext(0,0,0,((g.grid.dadmode==1||g.grid.dadmodec)?"sibling":"child"));if(e&&e.childNodes){n.set("source","tree").set("sobj",e.treeNod).set("sid",n.sobj._dragged)}else{if(!e){return true}if(e.treeNod.isTreeGrid&&e.treeNod.isTreeGrid()){n.set("source","treeGrid")}n.set("sobj",e.treeNod).set("sid",n.sobj._dragged)}if(g.grid.isTreeGrid()){n.set("target","treeGrid")}else{n.set("dropmode","sibling")}n.set("tobj",g.grid).set("tid",g.idd);if(((n.tobj.dadmode==2)&&(n.tobj.dadmodec==1))&&(n.tobj.dadmodefix<0)){if(n.tobj.obj.rows[1].idd!=n.tid){n.tid=g.previousSibling.idd}else{n.tid=0}}var a=this.getFirstParentOfType(s,"TD");if(a){n.set("tExtra",a._cellIndex)}if(a){n.set("sExtra",n.sobj._dndExtra)}if(n.sobj.dpcpy){n.set("mode","copy")}if(n.tobj._realfake){n.tobj=n.tobj._fake}if(n.sobj._realfake){n.sobj=n.sobj._fake}n.tobj._clearMove();if(e&&e.treeNod&&e.treeNod._nonTrivialRow){e.treeNod._nonTrivialRow(this,n.tid,n.dropmode,e)}else{n.tobj.dragContext=n;if(!n.tobj.callEvent("onDrag",[n.slist(),n.tid,n.sobj,n.tobj,n.sExtra,n.tExtra])){return n.tobj.dragContext=null}var u=new Array();if(typeof(n.sid)=="object"){var m=n.copy();for(var l=0;l<n.sid.length;l++){if(!m.set("alfa",(!l)).set("sid",n.sid[l][(n.source=="tree"?"id":"idd")]).valid()){continue}m.tobj._dragRoutine(m);if(m.target=="treeGrid"&&m.dropmode=="child"){m.tobj.openItem(m.tid)}u[u.length]=m.nid;m.set("dropmode","sibling").set("tid",m.nid)}m.close()}else{n.tobj._dragRoutine(n)}if(n.tobj.laterLink){n.tobj.laterLink()}n.tobj.callEvent("onDrop",[n.slist(),n.tid,u.join(","),n.sobj,n.tobj,n.sExtra,n.tExtra])}n.tobj.dragContext=null;n.close()};dhtmlXGridObject.prototype._dragRoutine=function(r){if((r.sobj==r.tobj)&&(r.source=="grid")&&(r.mode=="move")&&!this._fake){if(r.sobj._dndProblematic){return}var o=r.sobj.rowsAr[r.sid];var q=r.sobj.rowsCol._dhx_find(o);r.sobj.rowsCol._dhx_removeAt(r.sobj.rowsCol._dhx_find(o));r.sobj.rowsBuffer._dhx_removeAt(r.sobj.rowsBuffer._dhx_find(o));r.sobj.rowsBuffer._dhx_insertAt(r.ind(),o);if(r.tobj._fake){r.tobj._fake.rowsCol._dhx_removeAt(q);var s=r.tobj._fake.rowsAr[r.sid];s.parentNode.removeChild(s)}r.sobj._insertRowAt(o,r.ind());r.nid=r.sid;r.sobj.callEvent("onGridReconstructed",[]);return}var n;if(this._h2&&typeof r.tid!="undefined"&&r.dropmode=="sibling"&&(this._sbmod||r.tid)){if(r.alfa&&this._sbmod&&this._h2.get[r.tid].childs.length){this.openItem(r.tid);n=r.uid().tobj.addRowBefore(r.nid,r.data(),this._h2.get[r.tid].childs[0].id,r.img(),r.childs())}else{n=r.uid().tobj.addRowAfter(r.nid,r.data(),r.tid,r.img(),r.childs())}}else{n=r.uid().tobj.addRow(r.nid,r.data(),r.ind(),r.pid(),r.img(),r.childs())}n._attrs=r.attrs();if(r.source=="tree"){this.callEvent("onRowAdded",[r.nid]);var a=r.sobj._globalIdStorageFind(r.sid);if(a.childsCount){var m=r.copy().set("tid",r.nid).set("dropmode",r.target=="grid"?"sibling":"child");for(var g=0;g<a.childsCount;g++){r.tobj._dragRoutine(m.set("sid",a.childNodes[g].id));if(r.mode=="move"){g--}}m.close()}}else{r.tobj._copyUserData(r);this.callEvent("onRowAdded",[r.nid]);if((r.source=="treeGrid")){if(r.sobj==r.tobj){n._xml=r.sobj.rowsAr[r.sid]._xml}var h=r.sobj._h2.get[r.sid];if((h)&&(h.childs.length)){var m=r.copy().set("tid",r.nid);if(r.target=="grid"){m.set("dropmode","sibling")}else{if(!m.tobj.kidsXmlFile){m.tobj.openItem(r.tid)}m.set("dropmode","child")}var e=h.childs.length;if(!m.tobj.kidsXmlFile){for(var g=0;g<e;g++){r.sobj.render_row_tree(null,h.childs[g].id);r.tobj._dragRoutine(m.set("sid",h.childs[g].id));if(e!=h.childs.length){g--;e=h.childs.length}}}m.close()}}}if(r.mode=="move"){r.sobj[(r.source=="tree")?"deleteItem":"deleteRow"](r.sid);if((r.sobj==r.tobj)&&(!r.tobj.rowsAr[r.sid])){r.tobj.changeRowId(r.nid,r.sid);r.nid=r.sid}}};dhtmlXGridObject.prototype.gridToGrid=function(g,a,e){var h=new Array();for(var c=0;c<a.hdr.rows[0].cells.length;c++){h[c]=a.cells(g,c).getValue()}return h};dhtmlXGridObject.prototype.checkParentLine=function(a,c){if((!this._h2)||(!c)||(!a)){return false}if(a.id==c){return true}else{return this.checkParentLine(a.parent,c)}};dhtmlXGridObject.prototype._dragIn=function(l,g,c,m){if(!this.dADTempOff){return 0}var a=this.isTreeGrid();var h=g.parentNode.idd?g.parentNode:g.parentObject;if(this._drag_validate){if(l.parentNode==g.parentNode){return 0}if((a)&&(this==h.grid)&&((this.checkParentLine(this._h2.get[l.parentNode.idd],g.parentNode.idd)))){return 0}}if(!this.callEvent("onDragIn",[h.idd||h.id,l.parentNode.idd,h.grid||h.treeNod,(l.grid||l.parentNode.grid)])){return this._setMove(l,c,m,true)}this._setMove(l,c,m);if((a)&&(l.parentNode.expand!="")){var e=this;this._autoOpenTimer=window.setTimeout(function(){e._autoOpenItem(null,e);e=null},1000);this._autoOpenId=l.parentNode.idd}else{if(this._autoOpenTimer){window.clearTimeout(this._autoOpenTimer)}}return l};dhtmlXGridObject.prototype._autoOpenItem=function(a,c){c.openItem(c._autoOpenId)};dhtmlXGridObject.prototype._dragOut=function(c){this._clearMove();var a=c.parentNode.parentObject?c.parentObject.id:c.parentNode.idd;this.callEvent("onDragOut",[a]);if(this._autoOpenTimer){window.clearTimeout(this._autoOpenTimer)}};dhtmlXGridObject.prototype._setMove=function(l,c,n,h){if(!l.parentNode.idd){return}var e=dhx4.absTop(l);var a=dhx4.absTop(this.objBox);if((e-a)>(parseInt(this.objBox.offsetHeight)-50)){this.objBox.scrollTop=parseInt(this.objBox.scrollTop)+20}if((e-a+parseInt(this.objBox.scrollTop))<(parseInt(this.objBox.scrollTop)+30)){this.objBox.scrollTop=parseInt(this.objBox.scrollTop)-20}if(h){return 0}if(this.dadmode==2){var m=n-e+(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=-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=e-a+parseInt(this.objBox.scrollTop)+((this.dadmodefix>=0)?l.offsetHeight:0)+"px"}else{this._llSelD=l;if(l.parentNode.tagName=="TR"){for(var g=0;g<l.parentNode.childNodes.length;g++){var m=l.parentNode.childNodes[g];m._bgCol=m.style.backgroundColor;m.style.backgroundColor="#FFCCCC"}}}};dhtmlXGridObject.prototype._clearMove=function(){if(this._sdrgc){this._sdrgc.style.display="none"}if((this._llSelD)&&(this._llSelD.parentNode.tagName=="TR")){var c=this._llSelD.parentNode.childNodes;for(var a=0;a<c.length;a++){c[a].style.backgroundColor=c[a]._bgCol}}this._llSelD=null};dhtmlXGridObject.prototype.rowToDragElement=function(a){var c=this.cells(a,0).getValue();return c};dhtmlXGridObject.prototype._copyUserData=function(g){if(!g.tobj.UserData[g.nid]||g.tobj!=g.sobj){g.tobj.UserData[g.nid]=new Hashtable()}else{return}var e=g.sobj.UserData[g.sid];var a=g.tobj.UserData[g.nid];if(e){a.keys=a.keys.concat(e.keys);a.values=a.values.concat(e.values)}};dhtmlXGridObject.prototype.moveRow=function(e,g,a,c){switch(g){case"row_sibling":this.moveRowTo(e,a,"move","sibling",this,c);break;case"up":this.moveRowUp(e);break;case"down":this.moveRowDown(e);break}};dhtmlXGridObject.prototype._nonTrivialNode=function(r,q,m,n,e){if((r.callEvent)&&(!e)){if(!r.callEvent("onDrag",[n.idd,q.id,(m?m.id:null),this,r])){return false}}var o=n.idd;var a=o;while(r._idpull[a]){a+=(new Date()).getMilliseconds().toString()}var h=(this.isTreeGrid()?this.getItemImage(o):"");if(m){for(g=0;g<q.childsCount;g++){if(q.childNodes[g]==m){break}}if(g!=0){m=q.childNodes[g-1]}else{st="TOP";m=""}}var c=r._attachChildNode(q,a,this.gridToTreeElement(r,a,o),"",h,h,h,"","",m);if(this._h2){var l=this._h2.get[o];if(l.childs.length){for(var g=0;g<l.childs.length;g++){this._nonTrivialNode(r,c,0,this.rowsAr[l.childs[g].id],1);if(!this.dpcpy){g--}}}}if(!this.dpcpy){this.deleteRow(o)}if((r.callEvent)&&(!e)){r.callEvent("onDrop",[a,q.id,(m?m.id:null),this,r])}};dhtmlXGridObject.prototype.gridToTreeElement=function(c,e,a){return this.cells(a,0).getValue()};dhtmlXGridObject.prototype.treeToGridElement=function(g,h,a){var c=new Array();var l=this.cellType._dhx_find("tree");if(l==-1){l=0}for(var e=0;e<this.getColumnCount();e++){c[c.length]=(e!=l)?(g.getUserData(h,this.getColumnId(e))||""):g.getItemText(h)}return c};dhtmlXGridObject.prototype.moveRowTo=function(g,e,m,l,a,h){var n=new dragContext((a||this).isTreeGrid()?"treeGrid":"grid",(h||this).isTreeGrid()?"treeGrid":"grid",m,l||"sibling",g,e,a||this,h||this);n.tobj._dragRoutine(n);n.close();return n.nid};dhtmlXGridObject.prototype.enableMercyDrag=function(a){this.dpcpy=dhx4.s2b(a)};dhtmlXGridObject.prototype.toPDF=function(g,q,v,s,n,A){var h={row:this.getSelectedRowId(),col:this.getSelectedCellIndex()};if(h.row===null||h.col===-1){h=false}else{if(h.row&&h.row.indexOf(this.delim)!==-1){var c=this.cells(h.row,h.col).cell;c.parentNode.className=c.parentNode.className.replace(" rowselected","");c.className=c.className.replace(" cellselected","");h.el=c}else{h=false}}q=q||"color";var w=q=="full_color";var a=this;a._asCDATA=true;if(typeof(A)==="undefined"){this.target=' target="_blank"'}else{this.target=A}eXcell_ch.prototype.getContent=function(){return this.getValue()};eXcell_ra.prototype.getContent=function(){return this.getValue()};function y(E){var L=[];for(var J=1;J<a.hdr.rows.length;J++){L[J]=[];for(var I=0;I<a._cCount;I++){var N=a.hdr.rows[J].childNodes[I];if(!L[J][I]){L[J][I]=[0,0]}if(N){L[J][N._cellIndexS]=[N.colSpan,N.rowSpan]}}}var K="<rows profile='"+E+"'";if(v){K+=" header='"+v+"'"}if(s){K+=" footer='"+s+"'"}K+="><head>"+a._serialiseExportConfig(L).replace(/^<head/,"<columns").replace(/head>$/,"columns>");for(var J=2;J<a.hdr.rows.length;J++){var C=0;var Q=a.hdr.rows[J];var M="";for(var I=0;I<a._cCount;I++){if((a._srClmn&&!a._srClmn[I])||(a._hrrar[I]&&(!a._fake||I>=a._fake.hdrLabels.length))){C++;continue}var P=L[J][I];var O=((P[0]&&P[0]>1)?' colspan="'+P[0]+'" ':"");if(P[1]&&P[1]>1){O+=' rowspan="'+P[1]+'" ';C=-1}var D="";var H=Q;if(a._fake&&I<a._fake._cCount){H=a._fake.hdr.rows[J]}for(var F=0;F<H.cells.length;F++){if(H.cells[F]._cellIndexS==I){if(H.cells[F].getElementsByTagName("SELECT").length){D=""}else{D=_isIE?H.cells[F].innerText:H.cells[F].textContent}D=D.replace(/[ \n\r\t\xA0]+/," ");break}}if(!D||D==" "){C++}M+="<column"+O+"><![CDATA["+D+"]]></column>"}if(C!=a._cCount){K+="\n<columns>"+M+"</columns>"}}K+="</head>\n";K+=o();return K}function e(){var C=[];if(n){for(var D=0;D<n.length;D++){C.push(u(a.getRowIndex(n[D])))}}else{for(var D=0;D<a.getRowsNum();D++){C.push(u(D))}}return C.join("\n")}function o(){var E=["<foot>"];if(!a.ftr){return""}for(var F=1;F<a.ftr.rows.length;F++){E.push("<columns>");var J=a.ftr.rows[F];for(var D=0;D<a._cCount;D++){if(a._srClmn&&!a._srClmn[D]){continue}if(a._hrrar[D]&&(!a._fake||D>=a._fake.hdrLabels.length)){continue}for(var C=0;C<J.cells.length;C++){var I="";var H="";if(J.cells[C]._cellIndexS==D){I=_isIE?J.cells[C].innerText:J.cells[C].textContent;I=I.replace(/[ \n\r\t\xA0]+/," ");if(J.cells[C].colSpan&&J.cells[C].colSpan!=1){H=" colspan='"+J.cells[C].colSpan+"' "}if(J.cells[C].rowSpan&&J.cells[C].rowSpan!=1){H=" rowspan='"+J.cells[C].rowSpan+"' "}break}}E.push("<column"+H+"><![CDATA["+I+"]]></column>")}E.push("</columns>")}E.push("</foot>");return E.join("\n")}function m(D,C){return(window.getComputedStyle?(window.getComputedStyle(D,null)[C]):(D.currentStyle?D.currentStyle[C]:null))||""}function u(F){if(!a.rowsBuffer[F]){return""}var C=a.render_row(F);if(C.style.display=="none"){return""}var D=a.isTreeGrid()?' level="'+a.getLevel(C.idd)+'"':"";var K="<row"+D+">";for(var I=0;I<a._cCount;I++){if(((!a._srClmn)||(a._srClmn[I]))&&(!a._hrrar[I]||(a._fake&&I<a._fake.hdrLabels.length))){var O=a.cells(C.idd,I);if(w){var H=m(O.cell,"color");var N=m(O.cell,"backgroundColor");var M=m(O.cell,"font-weight")||m(O.cell,"fontWeight");var J=m(O.cell,"font-style")||m(O.cell,"fontStyle");var L=m(O.cell,"text-align")||m(O.cell,"textAlign");var E=m(O.cell,"font-family")||m(O.cell,"fontFamily");if(N=="transparent"||N=="rgba(0, 0, 0, 0)"){N="rgb(255,255,255)"}K+="<cell bgColor='"+N+"' textColor='"+H+"' bold='"+M+"' italic='"+J+"' align='"+L+"' font='"+E+"'>"}else{K+="<cell>"}K+="<![CDATA["+(O.getContent?O.getContent():O.getTitle())+"]]></cell>"}}return K+"</row>"}function r(){var C="</rows>";return C}var x=document.createElement("div");x.style.display="none";document.body.appendChild(x);var l="form_"+a.uid();x.innerHTML='<form id="'+l+'" method="post" action="'+g+'" accept-charset="utf-8"  enctype="application/x-www-form-urlencoded"'+this.target+'><input type="hidden" name="grid_xml" id="grid_xml"/> </form>';document.getElementById(l).firstChild.value=encodeURIComponent(y(q).replace("\u2013","-")+e()+r());document.getElementById(l).submit();x.parentNode.removeChild(x);a=null;if(h){h.el.parentNode.className+=" rowselected";h.el.className+=" cellselected"}h=null};dhtmlXGridObject.prototype._serialiseExportConfig=function(l){function h(q){if(typeof(q)!=="string"){return q}q=q.replace(/&/g,"&amp;");q=q.replace(/"/g,"&quot;");q=q.replace(/'/g,"&apos;");q=q.replace(/</g,"&lt;");q=q.replace(/>/g,"&gt;");return q}var c="<head>";for(var e=0;e<this.hdr.rows[0].cells.length;e++){if(this._srClmn&&!this._srClmn[e]){continue}if(this._hrrar[e]&&(!this._fake||e>=this._fake.hdrLabels.length)){continue}var g=this.fldSort[e];if(g=="cus"){g=this._customSorts[e].toString();g=g.replace(/function[\ ]*/,"").replace(/\([^\f]*/,"")}var o=l[1][e];var m=((o[1]&&o[1]>1)?' rowspan="'+o[1]+'" ':"")+((o[0]&&o[0]>1)?' colspan="'+o[0]+'" ':"");c+="<column "+m+" width='"+this.getColWidth(e)+"' align='"+this.cellAlign[e]+"' type='"+this.cellType[e]+"' hidden='"+((this.isColumnHidden&&this.isColumnHidden(e))?"true":"false")+"' sort='"+(g||"na")+"' color='"+(this.columnColor[e]||"")+"'"+(this.columnIds[e]?(" id='"+this.columnIds[e]+"'"):"")+">";if(this._asCDATA){c+="<![CDATA["+this.getColumnLabel(e)+"]]>"}else{c+=this.getColumnLabel(e)}var n=this.combos[e]?this.getCombo(e):null;if(n){for(var a=0;a<n.keys.length;a++){c+="<option value='"+h(n.keys[a])+"'><![CDATA["+n.values[a]+"]]></option>"}}c+="</column>"}return c+="</head>"};if(window.eXcell_sub_row_grid){window.eXcell_sub_row_grid.prototype.getContent=function(){return""}}dhtmlXGridObject.prototype.toExcel=function(a,g,m,l,c){if(!document.getElementById("ifr")){var h=document.createElement("iframe");h.style.display="none";h.setAttribute("name","dhx_export_iframe");h.setAttribute("src","");h.setAttribute("id","dhx_export_iframe");document.body.appendChild(h)}var e=' target="dhx_export_iframe"';this.toPDF(a,g,m,l,c,e)};dhtmlXGridObject.prototype.filterBy=function(e,g,c){if(this.isTreeGrid()){return this.filterTreeBy(e,g,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 h=true;this.dma(true);if(typeof(e)=="object"){for(var a=0;a<g.length;a++){this._filterA(e[a],g[a])}}else{this._filterA(e,g)}this.dma(false);if(this.pagingOn&&this.rowsBuffer.length/this.rowsBufferOutSize<(this.currentPage-1)){this.changePage(0)}this._reset_view();this.callEvent("onGridReconstructed",[])};dhtmlXGridObject.prototype._filterA=function(c,e){if(e==""){return}var g=true;if(typeof(e)=="function"){g=false}else{e=(e||"").toString().toLowerCase()}if(!this.rowsBuffer.length){return}for(var a=this.rowsBuffer.length-1;a>=0;a--){if(g?(this._get_cell_value(this.rowsBuffer[a],c).toString().toLowerCase().indexOf(e)==-1):(!e.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.filters.length;c++){if(this.filters[c][1]==a){return(this.filters[c][0].combo||this.filters[c][0])}}return null};dhtmlXGridObject.prototype.collectValues=function(g){var s=this.dhxevs.data.oncollectvalues;if(s){var q=true;for(var r in s){var u=s[r].call(this,g);if(u!==true){q=u||q}}if(q!==true){return q}}if(this.isTreeGrid()){return this.collectTreeValues(g)}this.dma(true);this._build_m_order();g=this._m_order?this._m_order[g]:g;var n={};var l=[];var e=this._f_rowsBuffer||this.rowsBuffer;for(var h=0;h<e.length;h++){var a=this._get_cell_value(e[h],g);if(a&&(!e[h]._childIndexes||e[h]._childIndexes[g]!=e[h]._childIndexes[g-1])){n[a]=true}}this.dma(false);var o=(this.combos[g]||(this._col_combos?this._col_combos[g]:false));for(var m in n){if(n[m]===true){if(o){if(o.get&&o.get(m)){m=o.get(m)}else{if(o.getOption&&o.getOption(m)){m=o.getOption(m).text}}}l.push(m)}}return l.sort()};dhtmlXGridObject.prototype._build_m_order=function(){if(this._c_order){this._m_order=[];for(var a=0;a<this._c_order.length;a++){this._m_order[this._c_order[a]]=a}}};dhtmlXGridObject.prototype.filterByAll=function(){var e=[];var c=[];this._build_m_order();for(var g=0;g<this.filters.length;g++){var l=this._m_order?this._m_order[this.filters[g][1]]:this.filters[g][1];if(l>=this._cCount){continue}c.push(l);var m=this.filters[g][0].old_value=this.filters[g][0].value;if(this.filters[g][0]._filter){m=this.filters[g][0]._filter()}var h;if(typeof m!="function"&&(h=(this.combos[l]||(this._col_combos?this._col_combos[l]:false)))){if(h.values){l=h.values._dhx_find(m);m=(l==-1)?m:h.keys[l]}else{if(h.getOptionByLabel){m=(h.getOptionByLabel(m)?h.getOptionByLabel(m).value:m)}}}e.push(m)}if(!this.callEvent("onFilterStart",[c,e])){return}this.filterBy(c,e);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(h,e,c){if(!this.filters){this.filters=[]}if(typeof(h)!="object"){h=document.getElementById(h)}if(!h){return}var a=this;if(!h.style.width){h.style.width="90%"}if(h.tagName=="SELECT"){this.filters.push([h,e]);this._loadSelectOptins(h,e);h.onchange=function(){a.filterByAll()};if(_isIE){h.style.marginTop="1px"}this.attachEvent("onEditCell",function(m,l,n){this._build_m_order();if(m==2&&this.filters&&(this._m_order?(n==this._m_order[e]):(n==e))){this._loadSelectOptins(h,e)}return true})}else{if(h.tagName=="INPUT"){this.filters.push([h,e]);h.old_value=h.value="";h.onkeydown=function(){if(this._timer){window.clearTimeout(this._timer)}this._timer=window.setTimeout(function(){if(h.value!=h.old_value){a.filterByAll();h.old_value=h.value}},500)}}else{if(h.tagName=="DIV"){this.filters.push([h,e]);h.style.padding="0px";h.style.margin="0px";if(!window.dhx_globalImgPath){window.dhx_globalImgPath=this.imgURL}var g=new dhtmlXCombo(h,"_filter","90%");g.filterSelfA=g.filterSelf;g.filterSelf=function(){if(this.getSelectedIndex()==0){this.setComboText("")}this.filterSelfA.apply(this,arguments);this.optionsArr[0].hide(false)};g.enableFilteringMode(true);h.combo=g;h.value="";this._loadComboOptins(h,e);g.attachEvent("onChange",function(){h.value=g.getSelectedValue();if(h.value===null){h.value=""}a.filterByAll()})}}}if(h.parentNode){h.parentNode.className+=" filter"}this._filters_ready()};dhtmlXGridObject.prototype.findCell=function(l,m,g,h){var h=h||(function(o,n){return n.toString().toLowerCase().indexOf(o)!=-1});if(h===true){h=function(o,n){return n.toString().toLowerCase()==o}}var e=new Array();l=l.toString().toLowerCase();if(typeof g!="number"){g=g?1:0}if(!this.rowsBuffer.length){return e}for(var c=(m||0);c<this._cCount;c++){if(this._h2){this._h2.forEachChild(0,function(n){if(g&&e.length==g){return e}if(h(l,this._get_cell_value(n.buff,c))){e.push([n.id,c])}},this)}else{for(var a=0;a<this.rowsBuffer.length;a++){if(h(l,this._get_cell_value(this.rowsBuffer[a],c))){e.push([this.rowsBuffer[a].idd,c]);if(g&&e.length==g){return e}}}}if(typeof(m)!="undefined"){return e}}return e};dhtmlXGridObject.prototype.makeSearch=function(g,e,a){if(typeof(g)!="object"){g=document.getElementById(g)}if(!g){return}var c=this;if(g.tagName=="INPUT"){g.onkeypress=function(){if(this._timer){window.clearTimeout(this._timer)}this._timer=window.setTimeout(function(){if(g.value==""){return}var h=c.findCell(g.value,e,true,a);if(h.length){if(c._h2){c.openItem(h[0][0])}c.selectCell(c.getRowIndex(h[0][0]),(e||0))}},500)}}if(g.parentNode){g.parentNode.className+=" filter"}};dhtmlXGridObject.prototype._loadSelectOptins=function(h,n){var a=this.collectValues(n);var e=h.value;h.innerHTML="";h.options[0]=new Option("","");var m=this._filter_tr?this._filter_tr[n]:null;for(var g=0;g<a.length;g++){h.options[h.options.length]=new Option(m?m(a[g]):a[g],a[g])}h.value=e};dhtmlXGridObject.prototype.setSelectFilterLabel=function(c,a){if(!this._filter_tr){this._filter_tr=[]}this._filter_tr[c]=a};dhtmlXGridObject.prototype._loadComboOptins=function(g,m){if(!g.combo){return}var a=this.collectValues(m);g.combo.clearAll();var h=[["",""]];for(var e=0;e<a.length;e++){h.push([a[e],a[e]])}g.combo.addOption(h)};dhtmlXGridObject.prototype.refreshFilters=function(){if(!this.filters){return}for(var a=0;a<this.filters.length;a++){switch(this.filters[a][0].tagName.toLowerCase()){case"input":break;case"select":this._loadSelectOptins.apply(this,this.filters[a]);break;case"div":this._loadComboOptins.apply(this,this.filters[a]);break}}};dhtmlXGridObject.prototype._filters_ready=function(c,a){this.attachEvent("onXLE",this.refreshFilters);this.attachEvent("onRowCreated",function(h,g){if(this._f_rowsBuffer){for(var e=0;e<this._f_rowsBuffer.length;e++){if(this._f_rowsBuffer[e].idd==h){return this._f_rowsBuffer[e]=g}}}});this.attachEvent("onClearAll",function(){this._f_rowsBuffer=null;if(!this.hdr.rows.length){this.filters=[]}});this.attachEvent("onSetSizes",this._filters_resize_combo);this.attachEvent("onResize",this._filters_resize_combo);this._filters_ready=function(){}};dhtmlXGridObject.prototype._filters_resize_combo=function(){if(!this.filters){return}for(var a=0;a<this.filters.length;a++){if(this.filters[a][0].combo!=null){this.filters[a][0].combo.setSize(Math.round(this.filters[a][0].offsetWidth*90/100))}}return true};dhtmlXGridObject.prototype._in_header_text_filter=function(c,a){c.innerHTML="<input type='text'>";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="<input type='text'>";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(e){return(e.toString().toLowerCase().indexOf(c.firstChild.value.toLowerCase())==0)}};this._filters_ready()};dhtmlXGridObject.prototype._in_header_select_filter=function(c,a){c.innerHTML="<select></select>";c.onclick=function(g){(g||event).cancelBubble=true;return false};this.makeFilter(c.firstChild,a)};dhtmlXGridObject.prototype._in_header_select_filter_strict=function(e,c){e.innerHTML="<select style='width:90%; font-size:8pt; font-family:Tahoma;'></select>";e.onclick=function(g){(g||event).cancelBubble=true;return false};this.makeFilter(e.firstChild,c);var a=this.combos;e.firstChild._filter=function(){var g=e.firstChild.value;if(!g){return""}if(a[c]){g=a[c].keys[a[c].values._dhx_find(g)]}g=g.toLowerCase();return function(h){return(h.toString().toLowerCase()==g)}};this._filters_ready()};dhtmlXGridObject.prototype._in_header_combo_filter=function(c,a){c.innerHTML="<div style='width:100%; padding-left:2px; overflow:hidden; ' class='combo'></div>";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="<input type='text' style='width:90%; '>";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(e,c,a){this._search_common(e,c);this.makeSearch(e.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 e=this.value;var h;var m="==";var g=parseFloat(e.replace("=",""));var l=null;if(e){if(e.indexOf("..")!=-1){e=e.split("..");g=parseFloat(e[0]);l=parseFloat(e[1]);return function(n){if(n>=g&&n<=l){return true}return false}}h=e.match(/>=|<=|>|</);if(h){m=h[0];g=parseFloat(e.replace(m,""))}return Function("v"," if (v "+m+" "+g+" ) return true; return false;")}return""}};dhtmlXGridObject.prototype._in_header_master_checkbox=function(g,e,h){g.innerHTML=h[0]+"<input type='checkbox' />"+h[1];var a=this;g.getElementsByTagName("input")[0].onclick=function(l){a._build_m_order();var c=a._m_order?a._m_order[e]:e;var m=this.checked?1:0;a.forEachRowA(function(o){var n=this.cells(o,c);if(n.isCheckbox()){n.setValue(m);n.cell.wasChanged=true}this.callEvent("onEditCell",[1,o,c,m]);this.callEvent("onCheckbox",[o,c,m])});(l||event).cancelBubble=true}};dhtmlXGridObject.prototype._in_header_stat_total=function(e,a,h){var g=function(){var n=0;this._build_m_order();var m=this._m_order?this._m_order[a]:a;for(var l=0;l<this.rowsBuffer.length;l++){var c=parseFloat(this._get_cell_value(this.rowsBuffer[l],m));n+=isNaN(c)?0:c}return this._maskArr[m]?this._aplNF(n,m):(Math.round(n*100)/100)};this._stat_in_header(e,g,a,h,h)};dhtmlXGridObject.prototype._in_header_stat_multi_total=function(h,g,o){var n=o[1].split(":");o[1]="";for(var e=0;e<n.length;e++){n[e]=parseInt(n[e])}var l=function(){var s=0;for(var r=0;r<this.rowsBuffer.length;r++){var q=1;for(var c=0;c<n.length;c++){q*=parseFloat(this._get_cell_value(this.rowsBuffer[r],n[c]))}s+=isNaN(q)?0:q}return this._maskArr[g]?this._aplNF(s,g):(Math.round(s*100)/100)};var a=[];for(var m=0;m<n.length;m++){a[n[m]]=true}this._stat_in_header(h,l,a,o,o)};dhtmlXGridObject.prototype._in_header_stat_max=function(e,a,h){var g=function(){this._build_m_order();var l=this._m_order?this._m_order[a]:a;var m=-999999999;if(this.getRowsNum()==0){return"&nbsp;"}for(var c=0;c<this.rowsBuffer.length;c++){m=Math.max(m,parseFloat(this._get_cell_value(this.rowsBuffer[c],l)))}return this._maskArr[a]?this._aplNF(m,a):m};this._stat_in_header(e,g,a,h)};dhtmlXGridObject.prototype._in_header_stat_min=function(e,a,h){var g=function(){this._build_m_order();var l=this._m_order?this._m_order[a]:a;var m=999999999;if(this.getRowsNum()==0){return"&nbsp;"}for(var c=0;c<this.rowsBuffer.length;c++){m=Math.min(m,parseFloat(this._get_cell_value(this.rowsBuffer[c],l)))}return this._maskArr[a]?this._aplNF(m,a):m};this._stat_in_header(e,g,a,h)};dhtmlXGridObject.prototype._in_header_stat_average=function(e,a,h){var g=function(){this._build_m_order();var m=this._m_order?this._m_order[a]:a;var o=0;var n=0;if(this.getRowsNum()==0){return"&nbsp;"}for(var l=0;l<this.rowsBuffer.length;l++){var c=parseFloat(this._get_cell_value(this.rowsBuffer[l],m));if(!isNaN(c)){o+=c;n++}}return this._maskArr[a]?this._aplNF(o/n,a):(Math.round(o/n*100)/100)};this._stat_in_header(e,g,a,h)};dhtmlXGridObject.prototype._in_header_stat_count=function(e,a,h){var g=function(){return this.getRowsNum()};this._stat_in_header(e,g,a,h)};dhtmlXGridObject.prototype._stat_in_header=function(e,g,a,m){var h=this;var l=function(){this.dma(true);e.innerHTML=(m[0]?m[0]:"")+g.call(this)+(m[1]?m[1]:"");this.dma(false);this.callEvent("onStatReady",[])};if(!this._stat_events){this._stat_events=[];this.attachEvent("onClearAll",function(){if(!this.hdr.rows[1]){for(var n=0;n<this._stat_events.length;n++){for(var c=0;c<4;c++){this.detachEvent(this._stat_events[n][c])}}this._stat_events=[]}})}this._stat_events.push([this.attachEvent("onGridReconstructed",l),this.attachEvent("onXLE",l),this.attachEvent("onFilterEnd",l),this.attachEvent("onEditCell",function(c,o,n){if(c==2&&(n==a||(a&&a[n]))){l.call(this)}return true})]);e.innerHTML=""};dhtmlXGridObject.prototype.loadCSVFile=function(c,a){this.load(c,a,"csv")};dhtmlXGridObject.prototype.enableCSVAutoID=function(a){this._csvAID=dhx4.s2b(a)};dhtmlXGridObject.prototype.enableCSVHeader=function(a){this._csvHdr=dhx4.s2b(a)};dhtmlXGridObject.prototype.setCSVDelimiter=function(a){this.csv.cell=a};dhtmlXGridObject.prototype._csvAID=true;dhtmlXGridObject.prototype.loadCSVString=function(a){this.parse(a,"csv")};dhtmlXGridObject.prototype.serializeToCSV=function(n){this.editStop();if(this._mathSerialization){this._agetm="getMathValue"}else{if(this._strictText||n){this._agetm="getTitle"}else{this._agetm="getValue"}}var l=[];if(this._csvHdr){for(var h=1;h<this.hdr.rows.length;h++){var c=[];for(var m=0;m<this._cCount;m++){if((!this._srClmn)||(this._srClmn[m])){c.push(this.getColumnLabel(m,h-1))}}l.push(this.csvParser.str(c,this.csv.cell,this.csv.row))}}var m=0;var g=this.rowsBuffer.length;for(m;m<g;m++){var e=this._serializeRowToCVS(null,m);if(e!=""){l.push(e)}}return this.csvParser.block(l,this.csv.row)};dhtmlXGridObject.prototype._serializeRowToCVS=function(a,o,e,m){var n=new Array();if(!a){a=this.render_row(o);if(this._fake&&!this._fake.rowsAr[a.idd]){this._fake.render_row(o)}}if(!this._csvAID){n[n.length]=a.idd}e=e||0;m=m||this._cCount;var s=false;var g=e;while(a.childNodes[e]._cellIndex>g&&e){e--}for(var q=e;g<m;q++){if(!a.childNodes[q]){break}var c=a.childNodes[q]._cellIndex;if(((!this._srClmn)||(this._srClmn[c]))&&(!this._serialize_visible||!this._hrrar[c])){var h=a.childNodes[q];var l=this.cells(a.idd,c);while(g!=c){g++;n.push("");if(g>=m){break}}if(g>=m){break}g++;if(l.cell){zxVal=l[this._agetm]()}else{zxVal=""}if((this._chAttr)&&(l.wasChanged())){s=true}n[n.length]=((zxVal===null)?"":zxVal);if(this._ecspn&&h.colSpan&&h.colSpan>1){h=h.colSpan-1;for(var v=0;v<h;v++){n[n.length]="";g++}}}else{g++}}if((this._onlChAttr)&&(!s)){return""}return this.csvParser.str(n,this.csv.cell,this.csv.row)};dhtmlXGridObject.prototype.toClipBoard=function(a){if(window.clipboardData){window.clipboardData.setData("Text",a)}else{(new Clipboard()).copy(a)}};dhtmlXGridObject.prototype.fromClipBoard=function(){if(window.clipboardData){return window.clipboardData.getData("Text")}else{return(new Clipboard()).paste()}};dhtmlXGridObject.prototype.cellToClipboard=function(e,c){if((!e)||(!c&&c!==0)){if(!this.selectedRows[0]){return}e=this.selectedRows[0].idd;c=this.cell._cellIndex}var a=this.cells(e,c);this.toClipBoard(((a.getLabel?a.getLabel():a.getValue())||"").toString())};dhtmlXGridObject.prototype.updateCellFromClipboard=function(e,c){if((!e)||(!c)){if(!this.selectedRows[0]){return}e=this.selectedRows[0].idd;c=this.cell._cellIndex}var a=this.cells(e,c);a[a.setImage?"setLabel":"setValue"](this.fromClipBoard())};dhtmlXGridObject.prototype.rowToClipboard=function(g){var a="";if(this._mathSerialization){this._agetm="getMathValue"}else{if(this._strictText){this._agetm="getTitle"}else{this._agetm="getValue"}}this._serialize_visible=!this._fake;if(g){a=this._serializeRowToCVS(this.getRowById(g))}else{var e=[];for(var c=0;c<this.selectedRows.length;c++){e[e.length]=this._serializeRowToCVS(this.selectedRows[c]);a=this.csvParser.block(e,this.csv.row)}}this._serialize_visible=false;this.toClipBoard(a)};dhtmlXGridObject.prototype.updateRowFromClipboard=function(h){var a=this.fromClipBoard();if(!a){return}if(h){var g=this.getRowById(h)}else{var g=this.selectedRows[0]}if(!g){return}var l=this.csvParser;a=l.unblock(a,this.csv.cell,this.csv.row)[0];if(!this._csvAID){a.splice(0,1)}for(var e=0;e<a.length;e++){var c=this.cells3(g,e);c[c.setImage?"setLabel":"setValue"](a[e])}};dhtmlXGridObject.prototype.csvParser={block:function(a,c){return a.join(c)},unblock:function(l,a,h){var g=(l||"").split(h);for(var c=0;c<g.length;c++){g[c]=(g[c]||"").split(a)}var e=g.length-1;if(g[e].length==1&&g[e][0]==""){g.splice(e,1)}return g},str:function(c,a,e){return c.join(a)}};dhtmlXGridObject.prototype.csvExtParser={_quote:RegExp('"',"g"),_quote_esc:RegExp('\\\\"',"g"),block:function(a,c){return a.join(c)},unblock:function(n,r,u){var e=[[]];var c=0;if(!n){return e}var o=/^[ ]*"/;var m=/"[ ]*$/;var a=new RegExp(".*"+u+".*$");var h=n.split(r);for(var g=0;g<h.length;g++){if(h[g].match(o)){var s=h[g].replace(o,"");while(!h[g].match(m)){g++;s+=h[g]}e[c].push(s.replace(m,"").replace(this._quote_esc,'"'))}else{if(h[g].match(a)){var l=h[g].indexOf(u);e[c].push(h[g].substr(0,l));c++;e[c]=[];h[g]=h[g].substr(l+1);g--}else{if(h[g]||g!=h.length-1){e[c].push(h[g])}}}}var q=e.length-1;if(q>0&&!e[q].length){e.splice(q,1)}return e},str:function(e,a,g){for(var c=0;c<e.length;c++){e[c]='"'+e[c].replace(this._quote,'\\"')+'"'}return e.join(a)}};dhtmlXGridObject.prototype.addRowFromClipboard=function(){var a=this.fromClipBoard();if(!a){return}var e=this.csvParser.unblock(a,this.csv.cell,this.csv.row);for(var c=0;c<e.length;c++){if(e[c]){a=e[c];if(!a.length){continue}if(this._csvAID){this.addRow(this.getRowsNum()+2,a)}else{if(this.rowsAr[a[0]]){a[0]=this.uid()}this.addRow(a[0],a.slice(1))}}}};dhtmlXGridObject.prototype.gridToClipboard=function(){this.toClipBoard(this.serializeToCSV())};dhtmlXGridObject.prototype.gridFromClipboard=function(){var a=this.fromClipBoard();if(!a){return}this.loadCSVString(a)};dhtmlXGridObject.prototype.getXLS=function(m){if(!this.xslform){this.xslform=document.createElement("FORM");this.xslform.action=(m||"")+"xls.php";this.xslform.method="post";this.xslform.target=(_isIE?"_blank":"");document.body.appendChild(this.xslform);var h=document.createElement("INPUT");h.type="hidden";h.name="csv";this.xslform.appendChild(h);var g=document.createElement("INPUT");g.type="hidden";g.name="csv_header";this.xslform.appendChild(g)}var n=this.serializeToCSV();this.xslform.childNodes[0].value=n;var e=[];var a=this._cCount;for(var c=0;c<a;c++){e.push(this.getHeaderCol(c))}e=e.join(",");this.xslform.childNodes[1].value=e;this.xslform.submit()};dhtmlXGridObject.prototype.printView=function(r,e){var o="<style>TD { font-family:Arial; text-align:center; padding-left:2px;padding-right:2px; } \n td.filter input, td.filter select { display:none; }   \n  </style>";var A=null;if(this._fake){A=[].concat(this._hrrar);for(var y=0;y<this._fake._cCount;y++){this._hrrar[y]=null}}o+="<base  href='"+(document.location.protocol+"//"+document.location.hostname+document.location.pathname)+"'></base>";if(!this.parentGrid){o+=(r||"")}o+='<table width="100%" border="2px" cellpadding="0" cellspacing="0">';var q=Math.max(this.rowsBuffer.length,this.rowsCol.length);var n=this._cCount;var s=this._printWidth();o+='<tr class="header_row_1">';for(var y=0;y<n;y++){if(this._hrrar&&this._hrrar[y]){continue}var h=this.hdr.rows[1].cells[this.hdr.rows[1]._childIndexes?this.hdr.rows[1]._childIndexes[parseInt(y)]:y];var a=(h.colSpan||1);var F=(h.rowSpan||1);for(var x=1;x<a;x++){s[y]+=s[x]}o+='<td rowspan="'+F+'" width="'+s[y]+'%" style="background-color:lightgrey;" colspan="'+a+'">'+this.getHeaderCol(y)+"</td>";y+=a-1}o+="</tr>";for(var y=2;y<this.hdr.rows.length;y++){if(_isIE){o+="<tr style='background-color:lightgrey' class='header_row_"+y+"'>";var g=this.hdr.rows[y].childNodes;for(var x=0;x<g.length;x++){if(!this._hrrar||!this._hrrar[g[x]._cellIndex]){o+=g[x].outerHTML}}o+="</tr>"}else{o+="<tr class='header_row_"+y+"' style='background-color:lightgrey'>"+(this._fake?this._fake.hdr.rows[y].innerHTML:"")+this.hdr.rows[y].innerHTML+"</tr>"}}for(var y=0;y<q;y++){o+="<tr>";if(this.rowsCol[y]&&this.rowsCol[y]._cntr){o+=this.rowsCol[y].innerHTML.replace(/<img[^>]*>/gi,"")+"</tr>";continue}if(this.rowsCol[y]&&this.rowsCol[y].style.display=="none"){continue}var m;if(this.rowsCol[y]){m=this.rowsCol[y].idd}else{if(this.rowsBuffer[y]){m=this.rowsBuffer[y].idd}else{continue}}for(var x=0;x<n;x++){if(this._hrrar&&this._hrrar[x]){continue}if(this.rowsAr[m]&&this.rowsAr[m].tagName=="TR"){var E=this.cells(m,x);if(E._setState){var u=""}else{if(E.getContent){u=E.getContent()}else{if(E.getImage||E.combo){var u=E.cell.innerHTML}else{var u=E.getValue()}}}}else{var u=this._get_cell_value(this.rowsBuffer[y],x)}var v=this.columnColor[x]?"background-color:"+this.columnColor[x]+";":"";var w=this.cellAlign[x]?"text-align:"+this.cellAlign[x]+";":"";var C=E.getAttribute("colspan");o+='<td style="'+v+w+'" '+(C?'colSpan="'+C+'"':"")+">"+(u===""?"&nbsp;":u)+"</td>";if(C){x+=C-1}}o+="</tr>";if(this.rowsCol[y]&&this.rowsCol[y]._expanded){var l=this.cells4(this.rowsCol[y]._expanded.ctrl);if(l.getSubGrid){o+='<tr><td colspan="'+n+'">'+l.getSubGrid().printView()+"</td></tr>"}else{o+='<tr><td colspan="'+n+'">'+this.rowsCol[y]._expanded.innerHTML+"</td></tr>"}}}if(this.ftr){for(var y=1;y<this.ftr.childNodes[0].rows.length;y++){o+="<tr style='background-color:lightgrey'>"+((this._fake)?this._fake.ftr.childNodes[0].rows[y].innerHTML:"")+this.ftr.childNodes[0].rows[y].innerHTML+"</tr>"}}o+="</table>";if(this.parentGrid){return o}o+=(e||"");var D=window.open("","_blank");D.document.write(o);D.document.write("<script>window.onerror=function(){return true;}<\/script>");D.document.close();if(this._fake){this._hrrar=A}};dhtmlXGridObject.prototype._printWidth=function(){var h=[];var g=0;for(var e=0;e<this._cCount;e++){var a=this.getColWidth(e);h.push(a);g+=a}var m=[];var c=0;for(var e=0;e<h.length;e++){var l=Math.floor((h[e]/g)*100);c+=l;m.push(l)}m[m.length-1]+=100-c;return m};dhtmlXGridObject.prototype.enableBlockSelection=function(e){if(typeof this._bs_mode=="undefined"){var a=this;this.obj.onmousedown=function(g){if(a._bs_mode){a._OnSelectionStart((g||event),this)}return true};this._CSVRowDelimiter=this.csv.row;this.attachEvent("onResize",function(){a._HideSelection();return true});this.attachEvent("onGridReconstructed",function(){a._HideSelection();return true});this.attachEvent("onFilterEnd",this._HideSelection)}if(e===false){this._bs_mode=false;return this._HideSelection()}else{this._bs_mode=true}if(!window.dhx4.isIPad){var c=this._clip_area=document.createElement("textarea");c.style.cssText="position:absolute; width:1px; height:1px; overflow:hidden; color:transparent; background-color:transparent; bottom:1px; right:1px; border:none;";c.onkeydown=function(g){g=g||event;if(g.keyCode==86&&(g.ctrlKey||g.metaKey)){a.pasteBlockFromClipboard()}};document.body.insertBefore(this._clip_area,document.body.firstChild);dhtmlxEvent(this.entBox,"click",function(){if(!a.editor&&a._clip_area){a._clip_area.select()}})}};dhtmlXGridObject.prototype.forceLabelSelection=function(a){this._strictText=dhx4.s2b(a)};dhtmlXGridObject.prototype._OnSelectionStart=function(e,g){var c=this;if(e.button==2){return}var h=e.srcElement||e.target;if(this.editor){if(h.tagName&&(h.tagName=="INPUT"||h.tagName=="TEXTAREA")){return}this.editStop()}c.setActive(true);var m=this.getPosition(this.obj);var a=e.clientX-m[0]+(document.body.scrollLeft||(document.documentElement?document.documentElement.scrollLeft:0));var l=e.clientY-m[1]+(document.body.scrollTop||(document.documentElement?document.documentElement.scrollTop:0));this._CreateSelection(a-4,l-4);if(h==this._selectionObj){this._HideSelection();this._startSelectionCell=null}else{while(h&&(!h.tagName||h.tagName.toLowerCase()!="td")){h=h.parentNode}this._startSelectionCell=h}if(this._startSelectionCell){if(!this.callEvent("onBeforeBlockSelected",[this._startSelectionCell.parentNode.idd,this._startSelectionCell._cellIndex])){return this._startSelectionCell=null}}this.obj.onmousedown=null;this.obj[_isIE?"onmouseleave":"onmouseout"]=function(n){if(c._blsTimer){window.clearTimeout(c._blsTimer)}};this.obj.onmmold=this.obj.onmousemove;this._init_pos=[a,l];this._selectionObj.onmousemove=this.obj.onmousemove=function(n){n=n||e;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}c._OnSelectionMove(n)};this._oldDMP=document.body.onmouseup;document.body.onmouseup=function(n){n=n||e;c._OnSelectionStop(n,this);return true};this.callEvent("onBeforeBlockSelection",[]);document.body.onselectstart=function(){return false}};dhtmlXGridObject.prototype._getCellByPos=function(a,g){a=a;if(this._fake){a+=this._fake.objBox.scrollWidth}g=g;var c=0;for(var e=0;e<this.obj.rows.length;e++){g-=this.obj.rows[e].offsetHeight;if(g<=0){c=this.obj.rows[e];break}}if(!c||!c.idd){return null}for(var e=0;e<this._cCount;e++){a-=this.getColWidth(e);if(a<=0){while(true){if(c._childIndexes&&c._childIndexes[e+1]==c._childIndexes[e]){c=c.previousSibling}else{return this.cells(c.idd,e).cell}}}}return null};dhtmlXGridObject.prototype._OnSelectionMove=function(g){var w=this;this._ShowSelection();var r=this.getPosition(this.obj);var m=g.clientX-r[0]+(document.body.scrollLeft||(document.documentElement?document.documentElement.scrollLeft:0));var l=g.clientY-r[1]+(document.body.scrollTop||(document.documentElement?document.documentElement.scrollTop:0));if((Math.abs(this._init_pos[0]-m)<5)&&(Math.abs(this._init_pos[1]-l)<5)){return this._HideSelection()}var u=this._endSelectionCell;if(this._startSelectionCell==null){this._endSelectionCell=this._startSelectionCell=this.getFirstParentOfType(g.srcElement||g.target,"TD")}else{if(g.srcElement||g.target){if((g.srcElement||g.target).className=="dhtmlxGrid_selection"){this._endSelectionCell=(this._getCellByPos(m,l)||this._endSelectionCell)}else{var v=this.getFirstParentOfType(g.srcElement||g.target,"TD");if(v.parentNode.idd){this._endSelectionCell=v}}}}if(this._endSelectionCell){if(!this.callEvent("onBeforeBlockSelected",[this._endSelectionCell.parentNode.idd,this._endSelectionCell._cellIndex])){this._endSelectionCell=u}}var h=this.objBox.scrollLeft+this.objBox.clientWidth;var c=this.objBox.scrollTop+this.objBox.clientHeight;var o=this.objBox.scrollLeft;var n=this.objBox.scrollTop;var e=false;if(this._blsTimer){window.clearTimeout(this._blsTimer)}if(m+20>=h){this.objBox.scrollLeft=this.objBox.scrollLeft+20;e=true}else{if(m-20<o){this.objBox.scrollLeft=this.objBox.scrollLeft-20;e=true}}if(l+20>=c&&!this._realfake){this.objBox.scrollTop=this.objBox.scrollTop+20;e=true}else{if(l-20<n&&!this._realfake){this.objBox.scrollTop=this.objBox.scrollTop-20;e=true}}this._selectionArea=this._RedrawSelectionPos(this._startSelectionCell,this._endSelectionCell);if(e){var s=g.clientX;var q=g.clientY;this._blsTimer=window.setTimeout(function(){w._OnSelectionMove({clientX:s,clientY:q})},100)}};dhtmlXGridObject.prototype._OnSelectionStop=function(c){var a=this;if(this._blsTimer){window.clearTimeout(this._blsTimer)}this.obj.onmousedown=function(g){if(a._bs_mode){a._OnSelectionStart((g||c),this)}return true};this.obj.onmousemove=this.obj.onmmold||null;this._selectionObj.onmousemove=null;document.body.onmouseup=this._oldDMP||null;if(parseInt(this._selectionObj.style.width)<2&&parseInt(this._selectionObj.style.height)<2){this._HideSelection()}else{var e=this.getFirstParentOfType(c.srcElement||c.target,"TD");if((!e)||(!e.parentNode.idd)){e=this._endSelectionCell}while(e&&(!e.tagName||e.tagName.toLowerCase()!="td")){e=e.parentNode}if(!e){return this._HideSelection()}this._stopSelectionCell=e;this._selectionArea=this._RedrawSelectionPos(this._startSelectionCell,this._stopSelectionCell);this.callEvent("onBlockSelected",[])}document.body.onselectstart=function(){}};dhtmlXGridObject.prototype._RedrawSelectionPos=function(s,m){if(s.parentNode.grid!=m.parentNode.grid){return this._selectionArea}var q={};q.LeftTopCol=s._cellIndex;q.LeftTopRow=this.getRowIndex(s.parentNode.idd);q.RightBottomCol=m._cellIndex;q.RightBottomRow=this.getRowIndex(m.parentNode.idd);var g=s.offsetWidth;var e=s.offsetHeight;s=this.getPosition(s,this.obj);var u=m.offsetWidth;var n=m.offsetHeight;m=this.getPosition(m,this.obj);if(s[0]<m[0]){var h=s[0];var l=m[0]+u}else{var o=q.RightBottomCol;q.RightBottomCol=q.LeftTopCol;q.LeftTopCol=o;var h=m[0];var l=s[0]+g}if(s[1]<m[1]){var r=s[1];var a=m[1]+n}else{var o=q.RightBottomRow;q.RightBottomRow=q.LeftTopRow;q.LeftTopRow=o;var r=m[1];var a=s[1]+e}var v=l-h;var c=a-r;this._selectionObj.style.left=h+"px";this._selectionObj.style.top=r+"px";this._selectionObj.style.width=v+"px";this._selectionObj.style.height=c+"px";return q};dhtmlXGridObject.prototype._CreateSelection=function(a,e){if(this._selectionObj==null){var c=document.createElement("div");c.style.position="absolute";c.style.display="none";c.className="dhtmlxGrid_selection";this._selectionObj=c;this._selectionObj.onmousedown=function(g){g=g||event;if(g.button==2||(_isMacOS&&g.ctrlKey)){return this.parentNode.grid.callEvent("onBlockRightClick",["BLOCK",g])}};this._selectionObj.oncontextmenu=function(g){(g||event).cancelBubble=true;return false};this.objBox.appendChild(this._selectionObj)}this._selectionObj.style.width="0px";this._selectionObj.style.height="0px";this._selectionObj.style.left=a+"px";this._selectionObj.style.top=e+"px";this._selectionObj.startX=a;this._selectionObj.startY=e};dhtmlXGridObject.prototype._ShowSelection=function(){if(this._selectionObj){this._selectionObj.style.display=""}};dhtmlXGridObject.prototype._HideSelection=function(){if(this._selectionObj){this._selectionObj.style.display="none"}this._selectionArea=null;if(this._clip_area){this._clip_area.value="";this._clip_area.blur()}};dhtmlXGridObject.prototype.copyBlockToClipboard=function(){if(!this._clip_area){return}if(this._selectionArea!=null){var e=new Array();if(this._mathSerialization){this._agetm="getMathValue"}else{if(this._strictText){this._agetm="getTitle"}else{this._agetm="getValue"}}this._serialize_visible=true;for(var a=this._selectionArea.LeftTopRow;a<=this._selectionArea.RightBottomRow;a++){var c=this._serializeRowToCVS(this.rowsBuffer[a],null,this._selectionArea.LeftTopCol,this._selectionArea.RightBottomCol+1);if(!this._csvAID){e[e.length]=c.substr(c.indexOf(this.csv.cell)+1)}else{e[e.length]=c}}e=e.join(this._CSVRowDelimiter);this._clip_area.value=e;this._clip_area.select();this._serialize_visible=false}};dhtmlXGridObject.prototype.pasteBlockFromClipboard=function(){if(!this._clip_area){return}this._clip_area.select();var a=this;window.setTimeout(function(){a._pasteBlockFromClipboard();a=null},1)};dhtmlXGridObject.prototype._pasteBlockFromClipboard=function(){var m=this._clip_area.value;if(!m){return}if(this._selectionArea!=null){var v=this._selectionArea.LeftTopRow;var a=this._selectionArea.LeftTopCol}else{if(this.cell!=null&&!this.editor){var v=this.getRowIndex(this.cell.parentNode.idd);var a=this.cell._cellIndex}else{return false}}m=this.csvParser.unblock(m,this.csv.cell,this.csv.row);var o=v+m.length;var s=a+m[0].length;if(s>this._cCount){s=this._cCount}var g=0;for(var q=v;q<o;q++){var w=this.render_row(q);if(w==-1){continue}var e=0;for(var h=a;h<s;h++){if(this._hrrar[h]&&!this._fake){s=Math.min(s+1,this._cCount);continue}var r=this.cells3(w,h);if(r.isDisabled()){e++;continue}if(this._onEditUndoRedo){this._onEditUndoRedo(2,w.idd,h,m[g][e],r.getValue())}if(r.combo){var u=r.combo.values;for(var c=0;c<u.length;c++){if(m[g][e]==u[c]){r.setValue(r.combo.keys[c]);u=null;break}}if(u!=null&&r.editable){r.setValue(m[g][e++])}else{e++}}else{r[r.setImage?"setLabel":"setValue"](m[g][e++])}r.cell.wasChanged=true}this.callEvent("onRowPaste",[w.idd]);g++}};dhtmlXGridObject.prototype.getSelectedBlock=function(){if(this._selectionArea){return this._selectionArea}else{if(this.getSelectedRowId()!==null){return{LeftTopRow:this.getSelectedRowId(),LeftTopCol:this.getSelectedCellIndex(),RightBottomRow:this.getSelectedRowId(),RightBottomCol:this.getSelectedCellIndex()}}else{return null}}};dhtmlXGridObject.prototype.enableSmartRendering=function(e,c,a){if(arguments.length>2){if(c&&!this.rowsBuffer[c-1]){this.rowsBuffer[c-1]=0}c=a}this._srnd=dhx4.s2b(e);this._srdh=this._srdh||20;this._dpref=c||0};dhtmlXGridObject.prototype.enablePreRendering=function(a){this._srnd_pr=parseInt(a||50)};dhtmlXGridObject.prototype.forceFullLoading=function(a,h){for(var e=0;e<this.rowsBuffer.length;e++){if(!this.rowsBuffer[e]){var g=a||(this.rowsBuffer.length-e);if(this.callEvent("onDynXLS",[e,g])){var c=this;this.load(this.xmlFileUrl+dhtmlx.url(this.xmlFileUrl)+"posStart="+e+"&count="+g,function(){window.setTimeout(function(){c.forceFullLoading(a,h)},100)},this._data_type)}return}}if(h){h.call(this)}};dhtmlXGridObject.prototype.setAwaitedRowHeight=function(a){this._srdh=parseInt(a)};dhtmlXGridObject.prototype._get_view_size=function(){return Math.floor(parseInt(this.entBox.offsetHeight)/this._srdh)+2};dhtmlXGridObject.prototype._add_filler=function(m,a,c,g){if(!a){return null}var l="__filler__";var h=this._prepareRow(l);h.firstChild.style.width="1px";h.firstChild.style.padding=h.firstChild.style.margin="0px";for(var e=1;e<h.childNodes.length;e++){h.childNodes[e].style.display="none"}h.firstChild.style.height=a*this._srdh+"px";c=c||this.rowsCol[m];if(c&&c.nextSibling){c.parentNode.insertBefore(h,c.nextSibling)}else{if(_isKHTML){this.obj.appendChild(h)}else{this.obj.rows[0].parentNode.appendChild(h)}}this.callEvent("onAddFiller",[m,a,h,c,g]);return[m,a,h]};dhtmlXGridObject.prototype._update_srnd_view=function(){var l=Math.floor(this.objBox.scrollTop/this._srdh);var c=l+this._get_view_size();if(this.multiLine){var m=this.objBox.scrollTop;l=0;while(m>0){m-=this.rowsCol[l]?this.rowsCol[l].offsetHeight:this._srdh;l++}c=l+this._get_view_size();if(l>0){l--}}c+=(this._srnd_pr||0);if(c>this.rowsBuffer.length){c=this.rowsBuffer.length}for(var g=l;g<c;g++){if(!this.rowsCol[g]){var h=this._add_from_buffer(g);if(h==-1){if(this.xmlFileUrl){if(this._dpref&&this.rowsBuffer[c-1]){var e=this._dpref?this._dpref:(c-g);var a=Math.max(0,Math.min(g,c-this._dpref));this._current_load=[a,c-a]}else{this._current_load=[g,(this._dpref?this._dpref:(c-g))]}if(this.callEvent("onDynXLS",this._current_load)){this.load(this.xmlFileUrl+dhtmlx.url(this.xmlFileUrl)+"posStart="+this._current_load[0]+"&count="+this._current_load[1],this._data_type)}}return}else{if(this._tgle){this._updateLine(this._h2.get[this.rowsBuffer[g].idd],this.rowsBuffer[g]);this._updateParentLine(this._h2.get[this.rowsBuffer[g].idd],this.rowsBuffer[g])}if(g&&g==(this._realfake?this._fake:this)["_r_select"]){this.selectCell(g,this.cell?this.cell._cellIndex:0,true)}}}}if(this._fake&&!this._realfake&&this.multiLine){this._fake.objBox.scrollTop=this.objBox.scrollTop}};dhtmlXGridObject.prototype._add_from_buffer=function(g){var h=this.render_row(g);if(h==-1){return -1}if(h._attrs.selected||h._attrs.select){this.selectRow(h,false,true);h._attrs.selected=h._attrs.select=null}if(!this._cssSP){if(this._cssEven&&g%2==0){h.className=this._cssEven+((h.className.indexOf("rowselected")!=-1)?" rowselected ":" ")+(h._css||"")}else{if(this._cssUnEven&&g%2==1){h.className=this._cssUnEven+((h.className.indexOf("rowselected")!=-1)?" rowselected ":" ")+(h._css||"")}}}else{if(this._h2){var a=this._h2.get[h.idd];h.className+=" "+((a.level%2)?(this._cssUnEven+" "+this._cssUnEven):(this._cssEven+" "+this._cssEven))+"_"+a.level+(this.rowsAr[a.id]._css||"")}}for(var c=0;c<this._fillers.length;c++){var e=this._fillers[c];if(e&&e[0]<=g&&(e[0]+e[1])>g){var l=g-e[0];if(l==0){this._insert_before(g,h,e[2]);this._update_fillers(c,-1,1)}else{if(l==e[1]-1){this._insert_after(g,h,e[2]);this._update_fillers(c,-1,0)}else{this._fillers.push(this._add_filler(g+1,e[1]-l-1,e[2],1));this._insert_after(g,h,e[2]);this._update_fillers(c,-e[1]+l,0)}}return}}};dhtmlXGridObject.prototype._update_fillers=function(e,a,g){var c=this._fillers[e];c[1]=c[1]+a;c[0]=c[0]+g;if(!c[1]){this.callEvent("onRemoveFiller",[c[2]]);c[2].parentNode.removeChild(c[2]);this._fillers.splice(e,1)}else{c[2].firstChild.style.height=parseFloat(c[2].firstChild.style.height)+a*this._srdh+"px";this.callEvent("onUpdateFiller",[c[2]])}};dhtmlXGridObject.prototype._insert_before=function(c,e,a){a.parentNode.insertBefore(e,a);this.rowsCol[c]=e;this.callEvent("onRowInserted",[e,null,a,"before"])};dhtmlXGridObject.prototype._insert_after=function(c,e,a){if(a.nextSibling){a.parentNode.insertBefore(e,a.nextSibling)}else{a.parentNode.appendChild(e)}this.rowsCol[c]=e;this.callEvent("onRowInserted",[e,null,a,"after"])};if(typeof(window.dhtmlxValidation)!="undefined"){dhtmlxValidation.trackInput=function(e,g,c,a){dhtmlxEvent(e,"keyup",function(h){if(dhtmlxValidation._timer){window.clearTimeout(dhtmlxValidation._timer);dhtmlxValidation._timer=null}dhtmlxValidation._timer=window.setTimeout(function(){if(!dhtmlxValidation.checkInput(e,g)){if(!c||c(e,e.value,g)){e.className+=" dhtmlx_live_validation_error"}}else{e.className=e.className.replace(/[ ]*dhtmlx_live_validation_error/g,"");if(a){a(e,e.value,g)}}},250)})};dhtmlxValidation.checkInput=function(a,c){return dhtmlxValidation.checkValue(a.value,c)};dhtmlxValidation.checkValue=function(e,g){if(typeof g=="string"){g=g.split(",")}var a=true;for(var c=0;c<g.length;c++){if(!this["is"+g[c]]){alert("Incorrect validation rule: "+g[c])}else{a=a&&this["is"+g[c]](e)}}return a}}dhtmlXGridObject.prototype.enableValidation=function(c,a){c=dhx4.s2b(c);if(c){this._validators={data:[]}}else{this._validators=false}if(arguments.length>1){this._validators._live=a}if(!this._validators._event){this._validators._event=this.attachEvent("onEditCell",this.validationEvent)}};dhtmlXGridObject.prototype.setColValidators=function(a){if(!this._validators){this.enableValidation(true)}if(typeof a=="string"){a=a.split(this.delim)}this._validators.data=a};dhtmlXGridObject.prototype.validationEvent=function(l,c,g,e,n){var o=this._validators;if(!o){return true}var m=(o.data[g]||this.cells(c,g).getAttribute("validate"))||"";if(l==1&&m){var h=this.editor||(this._fake||{}).editor;if(!h){return true}h.cell.className=h.cell.className.replace(/[ ]*dhtmlx_validation_error/g,"");if(o._live){var a=this;dhtmlxValidation.trackInput(h.getInput(),m,function(q,r,s){return a.callEvent("onLiveValidationError",[c,g,r,q,s])},function(q,r,s){return a.callEvent("onLiveValidationCorrect",[c,g,r,q,s])})}}if(l==2){this.validateCell(c,g,m,e)}return true};dhtmlXGridObject.prototype.validateCell=function(m,h,l,g){l=l||(this._validators.data[h]||this.cells(m,h).getAttribute("validate"));g=g||this.cells(m,h).getValue();if(!l){return}var c=this.cells(m,h).cell;var a=true;if(typeof l=="string"){l=l.split(this.delim)}for(var e=0;e<l.length;e++){if(!dhtmlxValidation.checkValue(g,l[e])){if(this.callEvent("onValidationError",[m,h,g,l[e]])){c.className+=" dhtmlx_validation_error"}a=false}}if(a){this.callEvent("onValidationCorrect",[m,h,g,l]);c.className=c.className.replace(/[ ]*dhtmlx_validation_error/g,"")}return a};function eXcell_stree(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._sub_trees){return}this._sub=this.grid._sub_trees[a._cellIndex];if(!this._sub){return}this._sub=this._sub[0]}this.getValue=function(){return this.cell._val};this.setValue=function(c){this.cell._val=c;c=this._sub.getItemText(this.cell._val);this.setCValue((c||"&nbsp;"),c)};this.edit=function(){this._sub.parentObject.style.display="block";var e=this.grid.getPosition(this.cell);this._sub.parentObject.style.top=e[1]+"px";this._sub.parentObject.style.left=e[0]+"px";this._sub.parentObject.style.position="absolute";var c=this.grid.editStop;this.grid.editStop=function(){};this.grid.editStop=c};this.detach=function(){this._sub.parentObject.style.display="none";if(this.grid._sub_id!=null){var c=this.cell._val;this.setValue(this._sub.getSelectedItemId());this.grid._sub_id=null;return this.cell._val!=c}}}eXcell_stree.prototype=new eXcell;dhtmlXGridObject.prototype.setSubTree=function(a,c){if(!this._sub_trees){this._sub_trees=[]}this._sub_trees[c]=[a];a.parentObject.style.display="none";var e=this;a.parentObject.onclick=function(g){(g||window.event).cancelBubble=true;return false};a.ev_onDblClick=null;a.attachEvent("onDblClick",function(g){e._sub_id=g;e.editStop();return true});a._chRRS=true};function eXcell_link(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.isDisabled=function(){return true};this.edit=function(){};this.getValue=function(){if(this.cell.firstChild.getAttribute){var c=this.cell.firstChild.getAttribute("target");return this.cell.firstChild.innerHTML+"^"+this.cell.firstChild.getAttribute("href")+(c?("^"+c):"")}else{return""}};this.setValue=function(e){if((typeof(e)!="number")&&(!e||e.toString()._dhx_trim()=="")){this.setCValue("&nbsp;",c);return(this.cell._clearCell=true)}var c=e.split("^");if(c.length==1){c[1]=""}else{if(c.length>1){c[1]="href='"+c[1]+"'";if(c.length==3){c[1]+=" target='"+c[2]+"'"}else{c[1]+=" target='_blank'"}}}this.setCValue("<a "+c[1]+" onclick='(_isIE?event:arguments[0]).cancelBubble = true;'>"+c[0]+"</a>",c)}}eXcell_link.prototype=new eXcell;eXcell_link.prototype.getTitle=function(){var a=this.cell.firstChild;return((a&&a.tagName)?a.getAttribute("href"):"")};eXcell_link.prototype.getContent=function(){var a=this.cell.firstChild;return((a&&a.tagName)?a.innerHTML:"")};function eXcell_grid(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._sub_grids){return}this._sub=this.grid._sub_grids[a._cellIndex];if(!this._sub){return}this._sindex=this._sub[1];this._sub=this._sub[0]}this.getValue=function(){return this.cell.val};this.setValue=function(c){this.cell.val=c;if(this._sub.getRowById(c)){c=this._sub.cells(c,this._sindex);if(c){c=c.getValue()}else{c=""}}this.setCValue((c||"&nbsp;"),c)};this.edit=function(){this.val=this.cell.val;this._sub.entBox.style.display="block";var e=this.grid.getPosition(this.cell);this._sub.entBox.style.top=e[1]+"px";this._sub.entBox.style.left=e[0]+"px";this._sub.entBox.style.position="absolute";this._sub.setSizes();var c=this.grid.editStop;this.grid.editStop=function(){};if(this._sub.getRowById(this.cell.val)){this._sub.setSelectedRow(this.cell.val)}this._sub.setActive(true);this.grid.editStop=c};this.detach=function(){var c=this.cell.val;this._sub.entBox.style.display="none";if(this._sub.getSelectedId()===null){return false}this.setValue(this._sub.getSelectedId());this.grid.setActive(true);return this.cell.val!=c}}eXcell_grid.prototype=new eXcell;dhtmlXGridObject.prototype.setSubGrid=function(c,a,g){if(!this._sub_grids){this._sub_grids=[]}this._sub_grids[a]=[c,g];c.entBox.style.display="none";var e=this;c.entBox.onclick=function(h){(h||window.event).cancelBubble=true;return false};c.attachEvent("onRowSelect",function(h){e.editStop();return true});c._chRRS=false};function eXcell_dhxCalendar(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._grid_calendarA){var e=this.grid._grid_calendarA=new dhtmlxCalendarObject();this.grid.callEvent("onDhxCalendarCreated",[e]);var c=this.grid;e.attachEvent("onClick",function(){this._last_operation_calendar=true;window.setTimeout(function(){c.editStop()},1);return true});var g=function(h){(h||event).cancelBubble=true};dhtmlxEvent(e.base,"click",g);e=null}}}eXcell_dhxCalendar.prototype=new eXcell;eXcell_dhxCalendar.prototype.edit=function(){var c=this.grid.getPosition(this.cell);this.grid._grid_calendarA._show(false,false);this.grid._grid_calendarA.setPosition(c[0],c[1]+this.cell.offsetHeight);this.grid._grid_calendarA._last_operation_calendar=false;this.grid.callEvent("onCalendarShow",[this.grid._grid_calendarA,this.cell.parentNode.idd,this.cell._cellIndex]);this.cell._cediton=true;this.val=this.cell.val;this._val=this.cell.innerHTML;var a=this.grid._grid_calendarA.draw;this.grid._grid_calendarA.draw=function(){};this.grid._grid_calendarA.setDateFormat((this.grid._dtmask||"%d/%m/%Y"));this.grid._grid_calendarA.setDate(this.val||(new Date()));this.grid._grid_calendarA.draw=a};eXcell_dhxCalendar.prototype.getDate=function(){if(this.cell.val){return this.cell.val}return null};eXcell_dhxCalendar.prototype.getValue=function(){if(this.cell._clearCell){return""}if(this.grid._dtmask_inc&&this.cell.val){return this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask_inc,this.cell.val).toString()}return this.cell.innerHTML.toString()._dhx_trim()};eXcell_dhxCalendar.prototype.detach=function(){if(!this.grid._grid_calendarA){return}this.grid._grid_calendarA.hide();if(this.cell._cediton){this.cell._cediton=false}else{return}if(this.grid._grid_calendarA._last_operation_calendar){var e=this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"));var c=this.grid._grid_calendarA.getDate();this.cell.val=new Date(c);this.setCValue(e,c);this.cell._clearCell=!e;var a=this.val;this.val=this._val;return(this.cell.val.valueOf()!=a)}return false};eXcell_dhxCalendar.prototype.setValue=function(a){if(a&&typeof a=="object"){this.cell.val=a;this.cell._clearCell=false;this.setCValue(this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),a).toString(),this.cell.val);return}if(!a||a.toString()._dhx_trim()==""){a="&nbsp";this.cell._clearCell=true;this.cell.val=""}else{this.cell._clearCell=false;this.cell.val=new Date(this.grid._grid_calendarA.setFormatedDate((this.grid._dtmask_inc||this.grid._dtmask||"%d/%m/%Y"),a.toString(),null,true));if(this.grid._dtmask_inc){a=this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),this.cell.val)}}if((this.cell.val=="NaN")||(this.cell.val=="Invalid Date")){this.cell._clearCell=true;this.cell.val=new Date();this.setCValue("&nbsp;",0)}else{this.setCValue((a||"").toString(),this.cell.val)}};function eXcell_dhxCalendarA(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._grid_calendarA){var e=this.grid._grid_calendarA=new dhtmlxCalendarObject();this.grid.callEvent("onDhxCalendarCreated",[e]);var c=this.grid;e.attachEvent("onClick",function(){this._last_operation_calendar=true;window.setTimeout(function(){c.editStop()},1);return true});var g=function(h){(h||event).cancelBubble=true};dhtmlxEvent(e.base,"click",g)}}}eXcell_dhxCalendarA.prototype=new eXcell;eXcell_dhxCalendarA.prototype.edit=function(){var c=this.grid.getPosition(this.cell);this.grid._grid_calendarA._show(false,false);this.grid._grid_calendarA.setPosition(c[0]*1+this.cell.offsetWidth,c[1]*1);this.grid.callEvent("onCalendarShow",[this.grid._grid_calendarA,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid._grid_calendarA._last_operation_calendar=false;this.cell._cediton=true;this.val=this.cell.val;this._val=this.cell.innerHTML;var a=this.grid._grid_calendarA.draw;this.grid._grid_calendarA.draw=function(){};this.grid._grid_calendarA.setDateFormat((this.grid._dtmask||"%d/%m/%Y"));this.grid._grid_calendarA.setDate(this.val);this.grid._grid_calendarA.draw=a;this.cell.atag=((!this.grid.multiLine)&&(_isKHTML||_isMacOS||_isFF))?"INPUT":"TEXTAREA";this.obj=document.createElement(this.cell.atag);this.obj.style.height=(this.cell.offsetHeight-4)+"px";this.obj.className="dhx_combo_edit";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.align;this.obj.onclick=function(g){(g||event).cancelBubble=true};this.obj.onmousedown=function(g){(g||event).cancelBubble=true};this.obj.value=this.getValue();this.cell.innerHTML="";this.cell.appendChild(this.obj);if(window.dhx4.isIE){this.obj.style.overflow="visible";if((this.grid.multiLine)&&(this.obj.offsetHeight>=18)&&(this.obj.offsetHeight<40)){this.obj.style.height="36px";this.obj.style.overflow="scroll"}}this.obj.onselectstart=function(g){if(!g){g=event}g.cancelBubble=true;return true};this.obj.focus();this.obj.focus()};eXcell_dhxCalendarA.prototype.getDate=function(){if(this.cell.val){return this.cell.val}return null};eXcell_dhxCalendarA.prototype.getValue=function(){if(this.cell._clearCell){return""}if(this.grid._dtmask_inc&&this.cell.val){return this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask_inc,this.cell.val).toString()}return this.cell.innerHTML.toString()._dhx_trim()};eXcell_dhxCalendarA.prototype.detach=function(){if(!this.grid._grid_calendarA){return}this.grid._grid_calendarA.hide();if(this.cell._cediton){this.cell._cediton=false}else{return}if(this.grid._grid_calendarA._last_operation_calendar){this.grid._grid_calendarA._last_operation_calendar=false;var e=this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask||"%d/%m/%Y");var c=this.grid._grid_calendarA.getDate();this.cell.val=new Date(c);this.setCValue(e,c);this.cell._clearCell=!e;var a=this.val;this.val=this._val;return(this.cell.val.valueOf()!=(a|"").valueOf())}this.setValue(this.obj.value);var a=this.val;this.val=this._val;return(this.cell.val.valueOf()!=(a||"").valueOf())};eXcell_dhxCalendarA.prototype.setValue=function(a){if(a&&typeof a=="object"){this.cell.val=a;this.cell._clearCell=false;this.setCValue(this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),a).toString(),this.cell.val);return}if(!a||a.toString()._dhx_trim()==""){a="&nbsp";this.cell._clearCell=true;this.cell.val=""}else{this.cell._clearCell=false;this.cell.val=new Date(this.grid._grid_calendarA.setFormatedDate((this.grid._dtmask_inc||this.grid._dtmask||"%d/%m/%Y"),a.toString(),null,true));if(this.grid._dtmask_inc){a=this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),this.cell.val)}}if((this.cell.val=="NaN")||(this.cell.val=="Invalid Date")){this.cell.val=new Date();this.cell._clearCell=true;this.setCValue("&nbsp;",0)}else{this.setCValue((a||"").toString(),this.cell.val)}};function eXcell_cntr(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._ex_cntr_ready&&!this._realfake){this.grid._ex_cntr_ready=true;if(this.grid._h2){this.grid.attachEvent("onOpenEn",function(e){this.resetCounter(a._cellIndex)})}var c=function(){var e=this;window.setTimeout(function(){if(!e.resetCounter){return}if(e._fake&&!e._realfake&&a._cellIndex<e._fake._cCount){e._fake.resetCounter(a._cellIndex)}else{e.resetCounter(a._cellIndex)}},1);return true};this.grid.attachEvent("onBeforeSorting",c);this.grid.attachEvent("onFilterEnd",c)}this.edit=function(){};this.getValue=function(){return this.cell.innerHTML};this.setValue=function(g){this.cell.style.paddingRight="2px";var e=this.cell;window.setTimeout(function(){if(!e.parentNode){return}var h=e.parentNode.rowIndex;if(e.parentNode.grid.currentPage||h<0||e.parentNode.grid._srnd){h=e.parentNode.grid.rowsBuffer._dhx_find(e.parentNode)+1}if(h<=0){return}e.innerHTML=h;if(e.parentNode.grid._fake&&e._cellIndex<e.parentNode.grid._fake._cCount&&e.parentNode.grid._fake.rowsAr[e.parentNode.idd]){e.parentNode.grid._fake.cells(e.parentNode.idd,e._cellIndex).setCValue(h)}e=null},100)}}dhtmlXGridObject.prototype.resetCounter=function(c){if(this._fake&&!this._realfake&&c<this._fake._cCount){this._fake.resetCounter(c,this.currentPage)}var a=arguments[0]||0;if(this.currentPage){a=(this.currentPage-1)*this.rowsBufferOutSize}for(a=0;a<this.rowsBuffer.length;a++){if(this.rowsBuffer[a]&&this.rowsBuffer[a].tagName=="TR"&&this.rowsAr[this.rowsBuffer[a].idd]){this.rowsAr[this.rowsBuffer[a].idd].childNodes[c].innerHTML=a+1}}};eXcell_cntr.prototype=new eXcell;function eXcell_acheck(a){try{this.cell=a;this.grid=this.cell.parentNode.grid;this.cell.obj=this}catch(c){}this.changeState=function(){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("<checkbox state='false'>")}else{this.setValue("<checkbox state='true'>")}this.cell.wasChanged=true;this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")]);this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")])}else{this.editor=null}};this.getValue=function(){try{return this.cell.chstate.toString()}catch(e){return null}};this.isCheckbox=function(){return true};this.isChecked=function(){if(this.getValue()=="1"){return true}else{return false}};this.setChecked=function(e){this.setValue(e.toString())};this.detach=function(){return this.val!=this.getValue()};this.drawCurrentState=function(){if(this.cell.chstate==1){return"<div  onclick='(new eXcell_acheck(this.parentNode)).changeState(); (arguments[0]||event).cancelBubble=true;'  style='cursor:pointer; font-weight:bold; text-align:center; '><span style='height:8px; width:8px; background:green; display:inline-block;'></span>&nbsp;Yes</div>"}else{return"<div  onclick='(new eXcell_acheck(this.parentNode)).changeState(); (arguments[0]||event).cancelBubble=true;' style='cursor:pointer;  text-align:center; '><span style='height:8px; width:8px; background:red; display:inline-block;'></span>&nbsp;No</div>"}}}eXcell_acheck.prototype=new eXcell;eXcell_acheck.prototype.setValue=function(c){c=(c||"").toString();if(c.indexOf("1")!=-1||c.indexOf("true")!=-1){c="1";this.cell.chstate="1"}else{c="0";this.cell.chstate="0"}var a=this;this.setCValue(this.drawCurrentState(),this.cell.chstate)};function eXcell_context(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._sub_context){return}this._sub=this.grid._sub_context[a._cellIndex];if(!this._sub){return}this._sindex=this._sub[1];this._sub=this._sub[0]}this.getValue=function(){return _isIE?this.cell.innerText:this.cell.textContent};this.setValue=function(e){this.cell._val=e;var c=this._sub.itemPull[this._sub.idPrefix+this.cell._val];e=c?c.title:e;this.setCValue((e||"&nbsp;"),e)};this.edit=function(){var e=this.grid.getPosition(this.cell);this._sub.showContextMenu(e[0]+this.cell.offsetWidth,e[1]);var c=this.grid.editStop;this.grid.editStop=function(){};this.grid.editStop=c};this.detach=function(){if(this.grid._sub_id!=null){var c=this.cell._val;this.setValue(this.grid._sub_id);this.grid._sub_id=null;return this.cell._val!=c}this._sub.hideContextMenu()}}eXcell_context.prototype=new eXcell;dhtmlXGridObject.prototype.setSubContext=function(a,c,g){var e=this;a.attachEvent("onClick",function(l,h){e._sub_id=l;e.editStop();a.hideContextMenu();return true});if(!this._sub_context){this._sub_context=[]}this._sub_context[c]=[a,g];a.hideContextMenu()};function dhtmlXGridFromTable(obj,init){if(typeof(obj)!="object"){obj=document.getElementById(obj)}var w=document.createElement("DIV");w.setAttribute("width",obj.getAttribute("gridWidth")||(obj.offsetWidth?(obj.offsetWidth+"px"):0)||(window.getComputedStyle?window.getComputedStyle(obj,null)["width"]:(obj.currentStyle?obj.currentStyle.width:0)));w.setAttribute("height",obj.getAttribute("gridHeight")||(obj.offsetHeight?(obj.offsetHeight+"px"):0)||(window.getComputedStyle?window.getComputedStyle(obj,null)["height"]:(obj.currentStyle?obj.currentStyle.height:0)));w.className=obj.className;obj.className="";if(obj.id){w.id=obj.id}var mr=obj;var drag=obj.getAttribute("dragAndDrop");mr.parentNode.insertBefore(w,mr);var f=mr.getAttribute("name")||("name_"+(new Date()).valueOf());var windowf=new dhtmlXGridObject(w);window[f]=windowf;var acs=mr.getAttribute("onbeforeinit");var acs2=mr.getAttribute("oninit");if(acs){eval(acs)}windowf.setImagePath(windowf.imgURL||(mr.getAttribute("imgpath")||mr.getAttribute("image_path")||""));var skin=mr.getAttribute("skin");if(skin){windowf.setSkin(skin)}if(init){init(windowf)}var hrow=mr.rows[0];var za="";var zb="";var zc="";var zd="";var ze="";for(var i=0;i<hrow.cells.length;i++){za+=(za?",":"")+hrow.cells[i].innerHTML;var width=hrow.cells[i].getAttribute("width")||hrow.cells[i].offsetWidth||(window.getComputedStyle?window.getComputedStyle(hrow.cells[i],null)["width"]:(hrow.cells[i].currentStyle?hrow.cells[i].currentStyle.width:0));zb+=(zb?",":"")+(width=="*"?width:parseInt(width));zc+=(zc?",":"")+(hrow.cells[i].getAttribute("align")||"left");zd+=(zd?",":"")+(hrow.cells[i].getAttribute("type")||"ed");ze+=(ze?",":"")+(hrow.cells[i].getAttribute("sort")||"str");var f_a=hrow.cells[i].getAttribute("format");if(f_a){if(hrow.cells[i].getAttribute("type").toLowerCase().indexOf("calendar")!=-1){windowf._dtmask=f_a}else{windowf.setNumberFormat(f_a,i)}}}windowf.setHeader(za);windowf.setInitWidths(zb);windowf.setColAlign(zc);windowf.setColTypes(zd);windowf.setColSorting(ze);if(obj.getAttribute("gridHeight")=="auto"){windowf.enableAutoHeigth(true)}if(obj.getAttribute("multiline")){windowf.enableMultiline(true)}var lmn=mr.getAttribute("lightnavigation");if(lmn){windowf.enableLightMouseNavigation(lmn)}var evr=mr.getAttribute("evenrow");var uevr=mr.getAttribute("unevenrow");if(evr||uevr){windowf.enableAlterCss(evr,uevr)}if(drag){windowf.enableDragAndDrop(true)}windowf.init();if(obj.getAttribute("split")){windowf.splitAt(obj.getAttribute("split"))}windowf._process_inner_html(mr,1);if(acs2){eval(acs2)}if(obj.parentNode&&obj.parentNode.removeChild){obj.parentNode.removeChild(obj)}return windowf}dhtmlXGridObject.prototype._process_html=function(c){if(c.tagName&&c.tagName=="TABLE"){return this._process_inner_html(c,0)}var a=document.createElement("DIV");a.innerHTML=c.xmlDoc.responseText;var e=a.getElementsByTagName("TABLE")[0];this._process_inner_html(e,0)};dhtmlXGridObject.prototype._process_inner_html=function(e,h){var c=e.rows.length;for(var a=h;a<c;a++){var g=e.rows[a].getAttribute("id")||a;this.rowsBuffer.push({idd:g,data:e.rows[a],_parser:this._process_html_row,_locator:this._get_html_data})}this.render_dataset();this.setSizes()};dhtmlXGridObject.prototype._process_html_row=function(n,h){var m=h.getElementsByTagName("TD");var c=[];n._attrs=this._xml_attrs(h);for(var g=0;g<m.length;g++){var l=m[g];var a=l.getAttribute("type");if(n.childNodes[g]){if(a){n.childNodes[g]._cellType=a}n.childNodes[g]._attrs=this._xml_attrs(m[g])}if(l.firstChild){c.push(l.innerHTML)}else{c.push("")}if(l.colSpan>1){n.childNodes[g]._attrs.colspan=l.colSpan;for(var e=1;e<l.colSpan;e++){c.push("")}}}for(g<m.length;g<n.childNodes.length;g++){n.childNodes[g]._attrs={}}this._fillRow(n,(this._c_order?this._swapColumns(c):c));return n};dhtmlXGridObject.prototype._get_html_data=function(c,a){c=c.firstChild;while(true){if(!c){return""}if(c.tagName=="TD"){a--}if(a<0){break}c=c.nextSibling}return(c.firstChild?c.firstChild.data:"")};dhtmlxEvent(window,"load",function(){var e=document.getElementsByTagName("table");for(var c=0;c<e.length;c++){if(e[c].className=="dhtmlxGrid"){dhtmlXGridFromTable(e[c])}}});dhtmlXGridObject.prototype._process_xmlA=function(a){this._parsing=true;var l=dhx4.ajax.xmltop(this.xml.top,a);this._parseHead(l);var h=dhx4.ajax.xpath(this.xml.row,l);var g=parseInt(l.getAttribute("pos")||0);var e=parseInt(l.getAttribute("total_count")||0);if(e&&!this.rowsBuffer[e-1]){this.rowsBuffer[e-1]=null}if(this.isTreeGrid()){this._get_xml_data=this._get_xml_dataA;this._process_xml_row=this._process_xml_rowA;return this._process_tree_xml(a)}for(var c=0;c<h.length;c++){if(this.rowsBuffer[c+g]){continue}var m=h[c].getAttribute("id")||this.uid();this.rowsBuffer[c+g]={idd:m,data:h[c],_parser:this._process_xml_rowA,_locator:this._get_xml_dataA};this.rowsAr[m]=h[c]}this.render_dataset();this._parsing=false};dhtmlXGridObject.prototype._process_xmlB=function(a){this._parsing=true;var l=dhx4.ajax.xmltop(this.xml.top,a);this._parseHead(l);var h=dhx4.ajax.xpath(this.xml.row,l);var g=parseInt(l.getAttribute("pos")||0);var e=parseInt(l.getAttribute("total_count")||0);if(e&&!this.rowsBuffer[e-1]){this.rowsBuffer[e-1]=null}if(this.isTreeGrid()){this._get_xml_data=this._get_xml_dataB;this._process_xml_row=this._process_xml_rowB;return this._process_tree_xml(a)}for(var c=0;c<h.length;c++){if(this.rowsBuffer[c+g]){continue}var m=h[c].getAttribute("id")||this.uid();this.rowsBuffer[c+g]={idd:m,data:h[c],_parser:this._process_xml_rowB,_locator:this._get_xml_dataB};this.rowsAr[m]=h[c]}this.render_dataset();this._parsing=false};dhtmlXGridObject.prototype._process_xml_rowA=function(h,e){var a=[];h._attrs=this._xml_attrs(e);for(var c=0;c<this.columnIds.length;c++){var l=this.columnIds[c];var g=h._attrs[l]||"";if(h.childNodes[c]){h.childNodes[c]._attrs={}}a.push(g)}this._fillRow(h,(this._c_order?this._swapColumns(a):a));return h};dhtmlXGridObject.prototype._get_xml_dataA=function(c,a){return c.getAttribute(this.getColumnId(a))};dhtmlXGridObject.prototype._process_xml_rowB=function(a,h){var n=[];a._attrs=this._xml_attrs(h);if(this._ud_enabled){var o=dhx4.ajax.xpath("./userdata",h);for(var e=o.length-1;e>=0;e--){this.setUserData(o[e].getAttribute("name"),o[e].firstChild?o[e].firstChild.data:"")}}for(var m=0;m<h.childNodes.length;m++){var g=h.childNodes[m];if(!g.tagName){continue}var c=this.getColIndexById(g.tagName);if(isNaN(c)){continue}var l=g.getAttribute("type");if(l){a.childNodes[c]._cellType=l}a.childNodes[c]._attrs=this._xml_attrs(g);if(g.getAttribute("xmlcontent")){}else{if(g.firstChild){g=g.firstChild.data}else{g=""}}n[c]=g}for(var e=0;e<a.childNodes.length;e++){if(!a.childNodes[e]._attrs){a.childNodes[e]._attrs={}}}this._fillRow(a,n);return a};dhtmlXGridObject.prototype._get_xml_dataB=function(c,a){var e=this.getColumnId(a);c=c.firstChild;while(true){if(!c){return""}if(c.tagName==e){return(c.firstChild?c.firstChild.data:"")}c=c.nextSibling}return""};dhtmlXGridObject.prototype.startFastOperations=function(){this._disF=["setSizes","callEvent","_fixAlterCss","cells4","forEachRow","_correctMonolite"];this._disA=[];for(var a=this._disF.length-1;a>=0;a--){this._disA[a]=this[this._disF[a]];this[this._disF[a]]=function(){return true}}this._cellCache=[];this.cells4=function(e){var g=this._cellCache[e._cellIndex];if(!g){g=this._cellCache[e._cellIndex]=this._disA[3].apply(this,[e]);g.destructor=function(){return true};g.setCValue=function(c){g.cell.innerHTML=c}}g.cell=e;g.combo=e._combo||this.combos[e._cellIndex];return g}};dhtmlXGridObject.prototype.stopFastOperations=function(){if(!this._disF){return}for(var a=this._disF.length-1;a>=0;a--){this[this._disF[a]]=this._disA[a]}if(this._correctMonolite){this._correctMonolite()}this.setSizes();this.callEvent("onGridReconstructed",[])};dhtmlXGridObject.prototype._in_header_number_filter=function(e,c){this._in_header_text_filter.call(this,e,c);var a=this;e.firstChild._filter=function(){var g=a._get_filters(this.value,"num");return function(m){var h=g.length>0?false:true;for(var l=0;l<g.length;l++){h=h||g[l](m)}return h}}};dhtmlXGridObject.prototype._in_header_string_filter=function(e,c){this._in_header_text_filter.call(this,e,c);var a=this;e.firstChild._filter=function(){var g=a._get_filters(this.value,"str");return function(m){var h=g.length>0?false:true;for(var l=0;l<g.length;l++){h=h||g[l](m)}return h}}};dhtmlXGridObject.prototype._get_filters=function(l,e){var a=l.split(",");var g=[];for(var c=0;c<a.length;c++){if(a[c]==""){continue}var h=this["_get_"+e+"_filter"](a[c]);g.push(h)}return g};dhtmlXGridObject.prototype._get_str_filter=function(c){if(c=="null"||c=="empty"){return new Function("value",'if (value == null || value == "") return true; return false;')}if(c=="!null"||c=="!empty"){return new Function("value",'if (value == null || value == "") return false; return true;')}if(c.substr(0,1)==="!"){var a=c.substr(1);return new Function("value",'if (value !== "'+a+'") return true; return false;')}if(c.substr(0,1)==="~"){var a=c.substr(1);return new Function("value",'if (value.indexOf("'+a+'") !== -1) return true; return false;')}if(c.substr(0,1)==="^"&&c.substr(c.length-1,1)==="&"){c="="+c.substr(1,c.length-2)}if(c.substr(0,1)==="^"){var a=c.substr(1);return new Function("value","if (value.substr(0, "+a.length+') === "'+a+'") return true; return false;')}if(c.substr(c.length-1,1)==="&"){var a=c.substr(0,c.length-1);return new Function("value","if (value.substr(value.length - "+a.length+') === "'+a+'") return true; return false;')}if(c.substr(0,1)==="="){var a=c.substr(1)}else{var a=c}return new Function("value",'if (value === "'+a+'") return true; return false;')};dhtmlXGridObject.prototype._get_num_filter=function(h){if(h=="null"||h=="empty"){return new Function("value",'if (value == null || value == "") return true; return false;')}if(h=="!null"||h=="!empty"){return new Function("value",'if (value == null || value == "") return false; return true;')}var a=h.split("..");if(a.length==2){var l=parseFloat(a[0]);var g=parseFloat(a[1]);return new Function("value","if (value >= "+l+" && value <= "+g+") return true; return false;")}var e=h.match(/<>|>=|<=|>|<|=/);if(e){var m=e[0];var c=parseFloat(h.replace(m,""))}else{var m="==";c=parseFloat(h)}if(m=="<>"){m="!="}if(m=="="){m="=="}return new Function("value"," if (value "+m+" "+c+" ) return true; return false;")};dhtmlXGridObject.prototype.attachHeaderA=dhtmlXGridObject.prototype.attachHeader;dhtmlXGridObject.prototype.attachHeader=function(){this.attachHeaderA.apply(this,arguments);if(this._realfake){return true}this.formAutoSubmit();if(typeof(this.FormSubmitOnlyChanged)=="undefined"){this.submitOnlyChanged(true)}if(typeof(this._submitAR)=="undefined"){this.submitAddedRows(true)}var a=this;this._added_rows=[];this._deleted_rows=[];this.attachEvent("onRowAdded",function(c){a._added_rows.push(c);a.forEachCell(c,function(e){e.cell.wasChanged=true});return true});this.attachEvent("onBeforeRowDeleted",function(c){a._deleted_rows.push(c);return true});this.attachHeader=this.attachHeaderA};dhtmlXGridObject.prototype.formAutoSubmit=function(){this.parentForm=this.detectParentFormPresent();if(this.parentForm===false){return false}if(this.formEventAttached){return}this.formInputs=new Array();var a=this;dhtmlxEvent(this.parentForm,"submit",function(){if(a.entBox){a.parentFormOnSubmit()}});this.formEventAttached=true};dhtmlXGridObject.prototype.parentFormOnSubmit=function(){this.formCreateInputCollection();if(!this.callEvent("onBeforeFormSubmit",[])){return false}};dhtmlXGridObject.prototype.submitOnlyChanged=function(a){this.FormSubmitOnlyChanged=dhx4.s2b(a)};dhtmlXGridObject.prototype.submitColumns=function(a){if(typeof a=="string"){a=a.split(this.delim)}this._submit_cols=a};dhtmlXGridObject.prototype.setFieldName=function(a){a=a.replace(/\{GRID_ID\}/g,"'+a1+'");a=a.replace(/\{ROW_ID\}/g,"'+a2+'");a=a.replace(/\{ROW_INDEX\}/g,"'+this.getRowIndex(a2)+'");a=a.replace(/\{COLUMN_INDEX\}/g,"'+a3+'");a=a.replace(/\{COLUMN_ID\}/g,"'+this.getColumnId(a3)+'");this._input_mask=Function("a1","a2","a3","return '"+a+"';")};dhtmlXGridObject.prototype.submitSerialization=function(a){this.FormSubmitSerialization=dhx4.s2b(a)};dhtmlXGridObject.prototype.submitAddedRows=function(a){this._submitAR=dhx4.s2b(a)};dhtmlXGridObject.prototype.submitOnlySelected=function(a){this.FormSubmitOnlySelected=dhx4.s2b(a)};dhtmlXGridObject.prototype.submitOnlyRowID=function(a){this.FormSubmitOnlyRowID=dhx4.s2b(a)};dhtmlXGridObject.prototype.createFormInput=function(c,e){var a=document.createElement("input");a.type="hidden";if(this._input_mask&&(typeof c!="string")){a.name=this._input_mask.apply(this,c)}else{a.name=((this.globalBox||this.entBox).id||"dhtmlXGrid")+"_"+c}a.value=e;this.parentForm.appendChild(a);this.formInputs.push(a)};dhtmlXGridObject.prototype.createFormInputRow=function(e){var g=(this.globalBox||this.entBox).id;for(var c=0;c<this._cCount;c++){var a=this.cells3(e,c);if(((!this.FormSubmitOnlyChanged)||a.wasChanged())&&(!this._submit_cols||this._submit_cols[c])){this.createFormInput(this._input_mask?[g,e.idd,c]:(e.idd+"_"+c),a.getValue())}}};dhtmlXGridObject.prototype.formCreateInputCollection=function(){if(this.parentForm==false){return false}for(var a=0;a<this.formInputs.length;a++){this.parentForm.removeChild(this.formInputs[a])}this.formInputs=new Array();if(this.FormSubmitSerialization){this.createFormInput("serialized",this.serialize())}else{if(this.FormSubmitOnlySelected){if(this.FormSubmitOnlyRowID){this.createFormInput("selected",this.getSelectedId())}else{for(var a=0;a<this.selectedRows.length;a++){this.createFormInputRow(this.selectedRows[a])}}}else{if(this._submitAR){if(this._added_rows.length){this.createFormInput("rowsadded",this._added_rows.join(","))}if(this._deleted_rows.length){this.createFormInput("rowsdeleted",this._deleted_rows.join(","))}}this.forEachRow(function(c){if(this.getRowById(c)!==-1){this.createFormInputRow(this.rowsAr[c])}})}}};dhtmlXGridObject.prototype.detectParentFormPresent=function(){var a=false;var c=this.entBox;while(c&&c.tagName&&c!=document.body){if(c.tagName.toLowerCase()=="form"){a=c;break}else{c=c.parentNode}}return a};dhtmlXGridObject.prototype.unGroup=function(){if(!this._groups){return}this._dndProblematic=false;delete this._groups;delete this._gIndex;if(this._fake){this._mirror_rowsCol()}this.forEachRow(function(a){this.rowsAr[a].style.display=""});this._reset_view();this.callEvent("onGridReconstructed",[]);this.callEvent("onUnGroup",[])};dhtmlXGridObject.prototype._mirror_rowsCol=function(){this._fake._groups=this._groups;this._fake._gIndex=this._gIndex;this.rowsBuffer=dhtmlxArray();for(var a=0;a<this.rowsCol.length;a++){if(!this.rowsCol[a]._cntr){this.rowsBuffer.push(this.rowsCol[a])}}this._fake.rowsBuffer=dhtmlxArray();for(var a=0;a<this._fake.rowsCol.length;a++){if(!this._fake.rowsCol[a]._cntr){this._fake.rowsBuffer.push(this._fake.rowsCol[a])}}};dhtmlXGridObject.prototype.groupBy=function(m,g){if(this._groups){this.unGroup()}this._dndProblematic=true;this._groups={};if(!g){g=["#title"];for(var h=1;h<this._cCount;h++){g.push("#cspan")}}this._gmask=document.createElement("TR");this._gmask.origin=g;var l,e=0;for(var h=0;h<g.length;h++){if(g[h]=="#cspan"){l.colSpan=(parseInt(l.colSpan)||1)+1}else{l=document.createElement("TD");l._cellIndex=h;if(this._hrrar[h]){l.style.display="none"}l.className="group_row";l.innerHTML="&nbsp;";if(g[h]=="#title"){this._gmask._title=e}else{l.align=this.cellAlign[h]||"left"}this._gmask.appendChild(l);if(g[h].indexOf("#stat")==0){this._gmask._math=true;l._counter=[this["_g_"+g[h].replace("#","")],h,e]}e++}}for(var c in this._groups){this._groups[c]=this.undefined}this._gIndex=m;if(this._fake&&!this._realfake){this._fake._groups=[];this._fake._gIndex=this._gIndex}this._nextRow=function(o,a){var n=this.rowsCol[o+a];if(n&&(n.style.display=="none"||n._cntr)){return this._nextRow(o+a,a)}return n};if(!this.__sortRowsBG){this._key_events=dhtmlx.extend({},this._key_events);this._key_events.k38_0_0=function(){if(this.editor&&this.editor.combo){this.editor.shiftPrev()}else{var a=this.row.rowIndex;if(!a){return}var n=this._nextRow(a-1,-1);if(n){this.selectCell(n,this.cell._cellIndex,true)}}};this._key_events.k13_1_0=this._key_events.k13_0_1=function(){};this._key_events.k40_0_0=function(){if(this.editor&&this.editor.combo){this.editor.shiftNext()}else{var a=this.row.rowIndex;if(!a){return}var n=this._nextRow(a-1,1);if(n){this.selectCell(n,this.cell._cellIndex,true)}}};this.attachEvent("onFilterStart",function(){if(this._groups){this._groups=this.undefined}return true});this.attachEvent("onFilterEnd",function(){if(typeof this._gIndex!="undefined"){this.groupBy(this._gIndex,this._gmask.origin)}});this.sortRows_bg=this.sortRows;this.sortRows=function(o,n,a){if(typeof(this._groups)=="undefined"){return this.sortRows_bg.apply(this,arguments)}n=n||"str";a=a||"asc";if(this.callEvent("onBeforeSorting",[o,n,a])){if(typeof(this._groups)=="undefined"){return true}if(o==this._gIndex){this._sortByGroup(o,n,a)}else{this._sortInGroup(o,n,a)}this.setSortImgState(true,o,a);if(this._fake){this._mirror_rowsCol();this._fake._groups=[];this._fake._reset_view()}this.setSortImgState(true,o,a);this.callEvent("onAfterSorting",[o,n,a])}return false};this.attachEvent("onClearAll",function(){this.unGroup()});this.attachEvent("onBeforeRowDeleted",function(o){if(!this._groups){return true}if(!this.rowsAr[o]){return true}var n=this.cells(o,this._gIndex).getValue();if(n===""){n=" "}var a=this._groups[n];this._dec_group(a);return true});this.attachEvent("onAfterRowDeleted",function(a){this.updateGroups()});this.attachEvent("onCheckbox",function(o,a,n){this.callEvent("onEditCell",[2,o,a,(n?1:0),(n?0:1)])});this.attachEvent("onXLE",this.updateGroups);this.attachEvent("onColumnHidden",this.hideGroupColumn);this.attachEvent("onEditCell",function(C,s,y,x,D){if(!this._groups){return true}if(C==2&&x!=D&&y==this._gIndex){if(D===""){D=" "}this._dec_group(this._groups[D]);var a=this.rowsAr[s];var A=this.rowsCol._dhx_find(a);var v=this._inc_group(x);var w=this.rowsCol[v];if(a==w){w=w.nextSibling}var q=a.parentNode;var u=a.rowIndex;q.removeChild(a);if(w){q.insertBefore(a,w)}else{q.appendChild(a)}this.rowsCol._dhx_insertAt(v,a);if(v<A){A++}this.rowsCol._dhx_removeAt(A,a);this._fixAlterCss()}else{if(C==2&&x!=D){this.updateGroups();this._updateGroupView(this._groups[this.cells(s,this._gIndex).getValue()||" "])}}return true});this.__sortRowsBG=true}this._groupExisting();if(this._hrrar){for(var h=0;h<this._hrrar.length;h++){if(this._hrrar[h]){this.hideGroupColumn(h,true)}}}this.callEvent("onGroup",[]);if(this._ahgr||this._awdth){this.setSizes()}};dhtmlXGridObject.prototype._sortInGroup=function(e,n,g){var o=this._groups_get();o.reverse();for(var l=0;l<o.length;l++){var m=o[l]._cntr._childs;var q={};for(var h=0;h<m.length;h++){var r=this.cells3(m[h],e);q[m[h].idd]=r.getDate?r.getDate():r.getValue()}this._sortCore(e,n,g,q,m)}this._groups_put(o);this.setSizes();this.callEvent("onGridReconstructed",[])};dhtmlXGridObject.prototype._sortByGroup=function(h,m,e){var c=this._groups_get();var g=[];for(var l=0;l<c.length;l++){c[l].idd="_sort_"+l;g["_sort_"+l]=c[l]._cntr.text}this._sortCore(h,m,e,g,c);this._groups_put(c);this.callEvent("onGridReconstructed",[]);this.setSizes()};dhtmlXGridObject.prototype._inc_group=function(h,e,a){if(h===""){h=" "}if(!this._groups[h]){this._groups[h]={text:h,row:this._addPseudoRow(),count:0,state:e?"plus":"minus"}}var g=this._groups[h];g.row._cntr=g;var c=this.rowsCol._dhx_find(g.row)+g.count+1;g.count++;if(!a){this._updateGroupView(g);this.updateGroups()}return c};dhtmlXGridObject.prototype._dec_group=function(a){if(!a){return}a.count--;if(a.count==0){a.row.parentNode.removeChild(a.row);this.rowsCol._dhx_removeAt(this.rowsCol._dhx_find(a.row));delete this._groups[a.text]}else{this._updateGroupView(a)}if(this._fake&&!this._realfake){this._fake._dec_group(this._fake._groups[a.text])}this.updateGroups();return true};dhtmlXGridObject.prototype._insertRowAt_gA=dhtmlXGridObject.prototype._insertRowAt;dhtmlXGridObject.prototype._insertRowAt=function(e,g,c){if(typeof(this._groups)!="undefined"){if(this._realfake){var h=this._fake._bfs_cells(e.idd,this._gIndex).getValue()}else{if(this._bfs_cells3){var h=this._bfs_cells3(e,this._gIndex).getValue()}else{var h=this.cells3(e,this._gIndex).getValue()}}if(!h){h=" "}g=this._inc_group(h,e.style.display=="none")}var a=this._insertRowAt_gA(e,g,c);if(typeof(this._groups)!="undefined"){this.expandGroup(h);this._updateGroupView(this._groups[h]);this.updateGroups()}return a};dhtmlXGridObject.prototype._updateGroupView=function(e){if(this._fake&&!this._realfake){return e.row.firstChild.innerHTML="&nbsp;"}var a=this._gmask||this._fake._gmask;var c="<img style='margin-bottom:-4px' src='"+this.imgURL+e.state+".gif'> ";if(this.customGroupFormat){c+=this.customGroupFormat(e.text,e.count)}else{c+=e.text+" ( "+e.count+" ) "}e.row.childNodes[a._title].innerHTML=c};dhtmlXGridObject.prototype._addPseudoRow=function(h){var a=this._gmask||this._fake._gmask;var g=a.cloneNode(true);for(var c=0;c<g.childNodes.length;c++){g.childNodes[c]._cellIndex=a.childNodes[c]._cellIndex;if(this._realfake){g.childNodes[c].style.display=""}}var e=this;g.onclick=function(l){if(!e.callEvent("onGroupClick",[this._cntr.text])){return}if(e._fake&&e._realfake){e._fake._switchGroupState(e._fake._groups[this._cntr.text].row)}else{e._switchGroupState(this)}(l||event).cancelBubble="true"};g.ondblclick=function(l){(l||event).cancelBubble="true"};if(!h){if(_isKHTML){this.obj.appendChild(g)}else{this.obj.firstChild.appendChild(g)}this.rowsCol.push(g)}return g};dhtmlXGridObject.prototype._groups_get=function(){var c=[];this._temp_par=this.obj.parentNode;this._temp_par.removeChild(this.obj);var e=[];for(var g=this.rowsCol.length-1;g>=0;g--){if(this.rowsCol[g]._cntr){this.rowsCol[g]._cntr._childs=e;e=[];c.push(this.rowsCol[g])}else{e.push(this.rowsCol[g])}this.rowsCol[g].parentNode.removeChild(this.rowsCol[g])}return c};dhtmlXGridObject.prototype._groups_put=function(a){var h=this.rowsCol.stablesort;this.rowsCol=new dhtmlxArray(0);this.rowsCol.stablesort=h;for(var g=0;g<a.length;g++){var e=a[g]._cntr;this.obj.firstChild.appendChild(e.row);this.rowsCol.push(e.row);e.row.idd=null;for(var c=0;c<e._childs.length;c++){this.obj.firstChild.appendChild(e._childs[c]);this.rowsCol.push(e._childs[c])}delete e._childs}this._temp_par.appendChild(this.obj)};dhtmlXGridObject.prototype._groupExisting=function(c){if(!this.getRowsNum()){return}var c=[];this._temp_par=this.obj.parentNode;this._temp_par.removeChild(this.obj);var e=[];var g=this.rowsCol.length;for(var h=0;h<g;h++){var m=this.cells4(this.rowsCol[h].childNodes[this._gIndex]).getValue();this.rowsCol[h].style.display="";if(!m){m=" "}if(!this._groups[m]){this._groups[m]={text:m,row:this._addPseudoRow(true),count:0,state:"minus"};var l=this._groups[m];l.row._cntr=l;this._groups[m]._childs=[];c.push(l.row)}this._groups[m].count++;this._groups[m]._childs.push(this.rowsCol[h]);this.rowsCol[h].parentNode.removeChild(this.rowsCol[h])}for(var h=0;h<c.length;h++){this._updateGroupView(c[h]._cntr)}this._groups_put(c);if(this._fake&&!this._realfake){this._mirror_rowsCol();this._fake._groups=[];this._fake._reset_view()}this.callEvent("onGridReconstructed",[]);this.updateGroups()};dhtmlXGridObject.prototype._switchGroupState=function(g){var e=g._cntr;if(this._fake&&!this._realfake){e.state=this._fake._groups[g._cntr.text].row._cntr.state;this._fake._switchGroupState(this._fake._groups[g._cntr.text].row)}var c=this.rowsCol._dhx_find(e.row)+1;e.state=e.state=="minus"?"plus":"minus";var a=e.state=="plus"?"none":"";while(this.rowsCol[c]&&!this.rowsCol[c]._cntr){this.rowsCol[c].style.display=a;c++}this._updateGroupView(e);this.callEvent("onGroupStateChanged",[e.text,(e.state=="minus")]);this.setSizes()};dhtmlXGridObject.prototype.expandGroup=function(a){if(this._groups[a].state=="plus"){this._switchGroupState(this._groups[a].row)}};dhtmlXGridObject.prototype.collapseGroup=function(a){if(this._groups[a].state=="minus"){this._switchGroupState(this._groups[a].row)}};dhtmlXGridObject.prototype.expandAllGroups=function(){for(var a in this._groups){if(this._groups[a]&&this._groups[a].state=="plus"){this._switchGroupState(this._groups[a].row)}}};dhtmlXGridObject.prototype.collapseAllGroups=function(){for(var a in this._groups){if(this._groups[a]&&this._groups[a].state=="minus"){this._switchGroupState(this._groups[a].row)}}};dhtmlXGridObject.prototype.hideGroupColumn=function(l,h){if(this._fake){return}var g=-1;var m=this._gmask.childNodes;for(var e=0;e<m.length;e++){if(m[e]._cellIndex==l){g=e;break}}if(g==-1){return}for(var c in this._groups){this._groups[c].row.childNodes[g].style.display=h?"none":""}};dhtmlXGridObject.prototype.groupStat=function(c,g,e){e=this["_g_"+(e||"stat_total")];var h=0;var a=0;this.forEachRowInGroup(c,function(l){h=e(h,this.cells(l,g).getValue()*1,a);a++});return h};dhtmlXGridObject.prototype.forEachRowInGroup=function(a,g){var h=this._groups[a].row.nextSibling;if(h){while(h&&!h._cntr){g.call(this,h.idd);h=h.nextSibling}}else{var e=this._groups[a]._childs;if(e){for(var c=0;c<e.length;c++){g.call(this,e[c].idd)}}}};dhtmlXGridObject.prototype.updateGroups=function(){if(!this._gmask||!this._gmask._math||this._parsing){return}var c=this._gmask.childNodes;for(var a=0;a<c.length;a++){if(c[a]._counter){this._b_processing.apply(this,c[a]._counter)}}};dhtmlXGridObject.prototype._b_processing=function(e,m,l){var n=0,g=0;if(!this._ecache[this.cellType[m]]){this.cells5({parentNode:{grid:this}},this.cellType[m])}for(var h=this.rowsCol.length-1;h>=0;h--){if(!this.rowsCol[h]._cntr){n=e(n,this.cells3(this.rowsCol[h],m).getValue()*1,g);g++}else{this.cells5(this.rowsCol[h].childNodes[l],this.cellType[m]).setValue(n);g=n=0}}};dhtmlXGridObject.prototype._g_stat_total=function(g,e,a){return g+e};dhtmlXGridObject.prototype._g_stat_min=function(g,e,a){if(!a){g=Infinity}return Math.min(g,e)};dhtmlXGridObject.prototype._g_stat_max=function(g,e,a){if(!a){g=-Infinity}return Math.max(g,e)};dhtmlXGridObject.prototype._g_stat_average=function(g,e,a){return(g*a+e)/(a+1)};dhtmlXGridObject.prototype._g_stat_count=function(g,e,a){return g++};dhtmlXGridObject.prototype._in_header_collapse=function(h,g,n){var a=h.tagName=="TD"?h:h.parentNode;g=a._cellIndexS;if(!this._column_groups){this._column_groups=[]}var m=n[1].split(":");var m=n[1].split(":");m=[m.shift(),m.join(":")];var l=parseInt(m[0]);h.innerHTML=n[0]+"<img src='"+this.imgURL+"minus.gif' style='padding-right:10px;height:16px'/><span style='position:relative; top:-6px;'>"+(m[1]||"")+"<span>";h.style.paddingBottom="0px";var e=this;this._column_groups[g]=h.getElementsByTagName("IMG")[0];this._column_groups[g].onclick=function(o){(o||event).cancelBubble=true;this._cstate=!this._cstate;for(var c=g+1;c<(g+l);c++){e.setColumnHidden(c,this._cstate)}if(this._cstate){if(a.colSpan&&a.colSpan>0){a._exp_colspan=a.colSpan;var s=Math.max(1,a.colSpan-l);if(!_isFF){for(var q=0;q<a.colSpan-s;q++){var r=document.createElement("TD");if(a.nextSibling){a.parentNode.insertBefore(r,a.nextSibling)}else{a.parentNode.appendChild(r)}}}a.colSpan=s}e.callEvent("onColumnCollapse",[g,this._cstate])}else{if(a._exp_colspan){a.colSpan=a._exp_colspan;if(!_isFF){for(var q=1;q<a._exp_colspan;q++){a.parentNode.removeChild(a.nextSibling)}}e.callEvent("onColumnCollapse",[g,this._cstate])}}this.src=e.imgURL+(this._cstate?"plus.gif":"minus.gif");if(e.sortImg.style.display!="none"){e.setSortImgPos()}}};dhtmlXGridObject.prototype.collapseColumns=function(a){if(!this._column_groups[a]||this._column_groups[a]._cstate){return}this._column_groups[a].onclick({})};dhtmlXGridObject.prototype.expandColumns=function(a){if(!this._column_groups[a]||!this._column_groups[a]._cstate){return}this._column_groups[a].onclick({})};dhtmlXGridObject.prototype.enableHeaderMenu=function(a){if(!window.dhtmlXMenuObject){return dhtmlx.message("You need to include DHTMLX Menu")}if(!this._header_menu){var e=this._header_menu=new dhtmlXMenuObject();e.renderAsContextMenu();var c=this;e.attachEvent("onBeforeContextMenu",function(){c._showHContext(a);return true});e.attachEvent("onClick",function(q){var m=this.getCheckboxState(q);var n=c.hdr.rows[1];for(var h=0;h<n.cells.length;h++){var o=n.cells[h];if(o._cellIndexS==q){var g=o.colSpan||1;for(var l=0;l<g;l++){c.setColumnHidden(q*1+l,!m)}}}});this.attachEvent("onInit",function(){e.addContextZone(this.hdr)});if(this.hdr.rows.length){this.callEvent("onInit",[])}}};dhtmlXGridObject.prototype.getHeaderMenu=function(a){return this._header_menu};dhtmlXGridObject.prototype._hideHContext=function(){if(this._header_menu){this._header_menu.hide()}};dhtmlXGridObject.prototype._showHContext=function(g){if(typeof g=="string"){g=g.split(this.delim)}var h=0;var a=0;this._header_menu.clearAll();for(var e=0;e<this.hdr.rows[1].cells.length;e++){var n=this.hdr.rows[1].cells[e];if(!g||(g[h]&&g[h]!="false")){if(n.firstChild&&n.firstChild.tagName=="DIV"){var m=n.firstChild.innerHTML}else{var m=n.innerHTML}m=m.replace(/<[^>]*>/gi,"");var l=!(this.isColumnHidden(h)||(this.getColWidth(h)==0));this._header_menu.addCheckbox("child",this._header_menu.topId,a,h,m,l);a++}h+=(n.colSpan||1)}};dhtmlXGridObject.prototype._process_json_row=function(h,l){h._attrs=l;for(var e=0;e<h.childNodes.length;e++){h.childNodes[e]._attrs={}}if(l.userdata){for(var c in l.userdata){this.setUserData(h.idd,c,l.userdata[c])}}l=this._c_order?this._swapColumns(l.data):l.data;for(var g=0;g<l.length;g++){if(typeof l[g]=="object"&&l[g]!=null){h.childNodes[g]._attrs=l[g];if(l[g].type){h.childNodes[g]._cellType=l[g].type}l[g]=l[g].value}}this._fillRow(h,l);return h};dhtmlXGridObject.prototype._process_js_row=function(l,m){l._attrs=m;for(var g=0;g<l.childNodes.length;g++){l.childNodes[g]._attrs={}}if(m.userdata){for(var e in m.userdata){this.setUserData(l.idd,e,m.userdata[e])}}var c=[];for(var h=0;h<this.columnIds.length;h++){c[h]=m[this.columnIds[h]];if(typeof c[h]=="object"&&c[h]!=null){l.childNodes[h]._attrs=c[h];if(c[h].type){l.childNodes[h]._cellType=c[h].type}c[h]=c[h].value}if(!c[h]&&c[h]!==0){c[h]=""}}this._fillRow(l,c);return l};dhtmlXGridObject.prototype.updateFromJSON=function(a,g,c,e){if(typeof g=="undefined"){g=true}this._refresh_mode=[true,g,c];this.load(a,e,"json")},dhtmlXGridObject.prototype._refreshFromJSON=function(e){if(this._f_rowsBuffer){this.filterBy(0,"")}reset=false;if(window.eXcell_tree){eXcell_tree.prototype.setValueX=eXcell_tree.prototype.setValue;eXcell_tree.prototype.setValue=function(u){var s=this.grid._h2.get[this.cell.parentNode.idd];if(s&&this.cell.parentNode.valTag){this.setLabel(u)}else{this.setValueX(u)}}}var q=this.cellType._dhx_find("tree");var h=e.parent||0;var m={};if(this._refresh_mode[2]){if(q!=-1){this._h2.forEachChild(h,function(r){m[r.id]=true},this)}else{this.forEachRow(function(r){m[r]=true})}}var o=e.rows;for(var g=0;g<o.length;g++){var n=o[g];var a=n.id;m[a]=false;if(this.rowsAr[a]&&this.rowsAr[a].tagName!="TR"){if(this._h2){this._h2.get[a].buff.data=n}else{this.rowsBuffer[this.getRowIndex(a)].data=n}this.rowsAr[a]=n}else{if(this.rowsAr[a]){this._process_json_row(this.rowsAr[a],n,-1);this._postRowProcessing(this.rowsAr[a],true)}else{if(this._refresh_mode[1]){var l={idd:a,data:n,_parser:this._process_json_row,_locator:this._get_json_data};var c=this.rowsBuffer.length;if(this._refresh_mode[1]=="top"){this.rowsBuffer.unshift(l);c=0}else{this.rowsBuffer.push(l)}if(this._h2){reset=true;(this._h2.add(a,h)).buff=this.rowsBuffer[this.rowsBuffer.length-1]}this.rowsAr[a]=n;n=this.render_row(c);this._insertRowAt(n,c?-1:0)}}}}if(this._refresh_mode[2]){for(a in m){if(m[a]&&this.rowsAr[a]){this.deleteRow(a)}}}this._refresh_mode=null;if(window.eXcell_tree){eXcell_tree.prototype.setValue=eXcell_tree.prototype.setValueX}if(reset){this._renderSort()}if(this._f_rowsBuffer){this._f_rowsBuffer=null;this.filterByAll()}},dhtmlXGridObject.prototype._process_js=function(a){return this._process_json(a,"js")},dhtmlXGridObject.prototype._parseHeadJson=function(r){if(!r.head||!r.head.length){return}var a=r.head;var g=r.settings;var m="setInitWidths";var o=false;if(g&&g.colwidth=="%"){m="setInitWidthsP"}if(g&&g.splitat=="%"){o=g.splitat}if(this.hdr.rows.length>0){this.clearAll(true)}var n=[[],[],[],[],[],[],[]];var q=["value","width","type","align","sort","hidden","id"];var u=["",m,"setColTypes","setColAlign","setColSorting","","setColumnIds"];for(var l=0;l<a.length;l++){for(var h=0;h<q.length;h++){n[h].push(a[l][q[h]])}}this.setHeader(n[0]);for(var l=0;l<u.length;l++){if(u[l]){this[u[l]](n[l].join(this.delim))}}for(var l=0;l<a.length;l++){var s=a[l].options;if(a[l].options){if(this.cellType[l]=="clist"){this.registerCList(l,s)}else{var c=this.getCombo(l);for(var h=0;h<s.length;h++){c.put(s[h].id,s[h].value)}}}}this.init();var e=n[5].join(this.delim);if(this.setColHidden&&e.replace(/,/g,"")!=""){this.setColHidden(e)}if((o)&&(this.splitAt)){this.splitAt(o)}};dhtmlXGridObject.prototype._process_json=function(data,mode){this._parsing=true;try{var data=data.responseText||data;if(typeof data=="string"){eval("dhtmlx.temp="+data+";");data=dhtmlx.temp}}catch(e){dhx4.callEvent("onLoadXMLError",["Incorrect JSON",(data.xmlDoc||data),this]);data={rows:[]}}if(this._refresh_mode){return this._refreshFromJSON(data)}if(data.head){this._parseHeadJson(data)}var cr=parseInt(data.pos||0);var total=parseInt(data.total_count||0);var reset=false;if(total){if(!this.rowsBuffer[total-1]){if(this.rowsBuffer.length){reset=true}this.rowsBuffer[total-1]=null}if(total<this.rowsBuffer.length){this.rowsBuffer.splice(total,this.rowsBuffer.length-total);reset=true}}var userdata=mode==="js"?data.userdata:data;for(var key in userdata){if(mode==="js"||key!="rows"){this.setUserData("",key,userdata[key])}}if(mode=="js"&&data.collections){for(var colkey in data.collections){var index=this.getColIndexById(colkey);var colrecs=data.collections[colkey];if(index!==window.undefined){if(this.cellType[index]=="clist"){colplaindata=[];for(var j=0;j<colrecs.length;j++){colplaindata.push(colrecs[j].label)}this.registerCList(index,colplaindata)}else{var combo=this.getCombo(index);for(var j=0;j<colrecs.length;j++){combo.put(colrecs[j].value,colrecs[j].label)}}}}}if(this.isTreeGrid()){return this._process_tree_json(data,null,null,mode)}if(mode=="js"){if(data.data){data=data.data}for(var i=0;i<data.length;i++){if(this.rowsBuffer[i+cr]){continue}var row=data[i];var id=row.id||(i+1);this.rowsBuffer[i+cr]={idd:id,data:row,_parser:this._process_js_row,_locator:this._get_js_data};this.rowsAr[id]=data[i]}}else{for(var i=0;i<data.rows.length;i++){if(this.rowsBuffer[i+cr]){continue}var id=data.rows[i].id;this.rowsBuffer[i+cr]={idd:id,data:data.rows[i],_parser:this._process_json_row,_locator:this._get_json_data};this.rowsAr[id]=data.rows[i]}}this.callEvent("onDataReady",[]);if(reset&&this._srnd){var h=this.objBox.scrollTop;this._reset_view();this.objBox.scrollTop=h}else{this.render_dataset()}this._parsing=false};dhtmlXGridObject.prototype._get_json_data=function(c,a){if(typeof c.data[a]=="object"){return c.data[a].value}else{return c.data[a]}};dhtmlXGridObject.prototype._process_tree_json=function(g,h,c,m){this._parsing=true;var a=false;if(!h){this.render_row=this.render_row_tree;a=true;h=g;c=h.parent||0;if(c=="0"){c=0}if(!this._h2){this._h2=this._createHierarchy()}if(this._fake){this._fake._h2=this._h2}}if(m=="js"){if(h.data&&!c){g=h.data}if(h.rows){h=h.rows}for(var e=0;e<h.length;e++){var n=h[e].id;var l=this._h2.add(n,c);l.buff={idd:n,data:h[e],_parser:this._process_js_row,_locator:this._get_js_data};if(h[e].open){l.state="minus"}this.rowsAr[n]=l.buff;this._process_tree_json(h[e],h[e],n,m)}}else{if(h.rows){for(var e=0;e<h.rows.length;e++){var n=h.rows[e].id;var l=this._h2.add(n,c);l.buff={idd:n,data:h.rows[e],_parser:this._process_json_row,_locator:this._get_json_data};if(h.rows[e].open){l.state="minus"}this.rowsAr[n]=l.buff;this._process_tree_json(h.rows[e],h.rows[e],n,m)}}}if(a){if(c!=0){this._h2.change(c,"state","minus")}this._updateTGRState(this._h2.get[c]);this._h2_to_buff();this.callEvent("onDataReady",[]);if(c!=0&&(this._srnd||this.pagingOn)){this._renderSort()}else{this.render_dataset()}if(this._slowParse===false){this.forEachRow(function(o){this.render_row_tree(0,o)})}this._parsing=false;if(c!=0&&!this._srnd){this.callEvent("onOpenEnd",[c,1])}}};dhtmlXGridObject.prototype.enableMarkedCells=function(a){this.markedRowsArr=new dhtmlxArray(0);this.markedCellsArr=new Array(0);this.lastMarkedRow=null;this.lastMarkedColumn=null;this.markedCells=true;this.lastMarkMethod=0;if(arguments.length>0){if(!dhx4.s2b(a)){this.markedCells=false}}};dhtmlXGridObject.prototype.doMark=function(e,m){var l=e.parentNode.idd;this.setActive(true);if(!l){return}this.editStop();this.cell=e;this.row=e.parentNode;var o=e._cellIndex;if(!m){m=0}if(m==0){this.unmarkAll()}else{if(m==1){if(this.lastMarkedRow){var c=Math.min(this.getRowIndex(l),this.getRowIndex(this.lastMarkedRow));var n=Math.max(this.getRowIndex(l),this.getRowIndex(this.lastMarkedRow));var a=Math.min(o,this.lastMarkedColumn);var q=Math.max(o,this.lastMarkedColumn);for(var h=c;h<n+1;h++){for(var g=a;g<q+1;g++){this.mark(this.getRowId(h),g,true)}}}}else{if(m==2){if(this.markedRowsArr._dhx_find(l)!=-1){for(var r=0;r<this.markedCellsArr[l].length;r++){if(this.markedCellsArr[l][r]==o){this.mark(l,o,false);return true}}}}}}if(!this.markedCellsArr[l]){this.markedCellsArr[l]=new dhtmlxArray(0)}if(m!=1){this.mark(l,o)}this.moveToVisible(this.cells(l,o).cell);this.lastMarkedRow=l;this.lastMarkedColumn=o;this.lastMarkMethod=m};dhtmlXGridObject.prototype.mark=function(e,c,g){if(arguments.length>2){if(!dhx4.s2b(g)){this.cells(e,c).cell.className=this.cells(e,c).cell.className.replace(/cellselected/g,"");if(this.markedRowsArr._dhx_find(e)!=-1){var a=this.markedCellsArr[e]._dhx_find(c);if(a!=-1){this.markedCellsArr[e]._dhx_removeAt(a);if(this.markedCellsArr[e].length==0){this.markedRowsArr._dhx_removeAt(this.markedRowsArr._dhx_find(e))}this.callEvent("onCellUnMarked",[e,c])}}return true}}this.cells(e,c).cell.className+=" cellselected";if(this.markedRowsArr._dhx_find(e)==-1){this.markedRowsArr[this.markedRowsArr.length]=e}if(!this.markedCellsArr[e]){this.markedCellsArr[e]=new dhtmlxArray(0)}if(this.markedCellsArr[e]._dhx_find(c)==-1){this.markedCellsArr[e][this.markedCellsArr[e].length]=c;this.callEvent("onCellMarked",[e,c])}};dhtmlXGridObject.prototype.unmarkAll=function(){if(this.markedRowsArr){for(var a=0;a<this.markedRowsArr.length;a++){var e=this.markedRowsArr[a];if(this.rowsAr[e]){for(var c=0;c<this.markedCellsArr[e].length;c++){this.callEvent("onCellUnMarked",[e,this.markedCellsArr[e][c]]);this.cells(e,this.markedCellsArr[e][c]).cell.className=this.cells(e,this.markedCellsArr[e][c]).cell.className.replace(/cellselected/g,"")}}}this.markedRowsArr=new dhtmlxArray(0);this.markedCellsArr=new Array(0)}return true};dhtmlXGridObject.prototype.getMarked=function(){var e=new Array();if(this.markedRowsArr){for(var a=0;a<this.markedRowsArr.length;a++){var g=this.markedRowsArr[a];for(var c=0;c<this.markedCellsArr[g].length;c++){e[e.length]=[g,this.markedCellsArr[g][c]]}}}return e};function eXcell_math(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){this.grid.editor=new eXcell_ed(this.cell);this.grid.editor.fix_self=true;this.grid.editor.getValue=this.cell.original?(function(){return this.cell.original}):this.getValue;this.grid.editor.setValue=this.setValue;this.grid.editor.edit()};this.isDisabled=function(){return !this.grid._mathEdit};this.setValue=function(c){c=this.grid._compileSCL(c,this.cell,this.fix_self);if(this.grid._strangeParams[this.cell._cellIndex]){this.grid.cells5(this.cell,this.grid._strangeParams[this.cell._cellIndex]).setValue(c)}else{this.setCValue(c);this.cell._clearCell=false}};this.getValue=function(){if(this.grid._strangeParams[this.cell._cellIndex]){return this.grid.cells5(this.cell,this.grid._strangeParams[this.cell._cellIndex]).getValue()}return this.cell.innerHTML}}eXcell_math.prototype=new eXcell;dhx4.attachEvent("onGridCreated",function(a){a._mat_links={};a._aggregators=[];a.attachEvent("onClearAll",function(){this._mat_links={};this._aggregators=[]});a.attachEvent("onCellChanged",function(m,l){if(this._mat_links[m]){var c=this._mat_links[m][l];if(c){for(var h=0;h<c.length;h++){if(c[h].parentNode){this.cells5(c[h]).setValue(this._calcSCL(c[h]))}}}}if(!this._parsing&&this._aggregators[l]){var g=this._h2.get[m].parent.id;if(g!=0){var e=this.cells(g,l);e.setValue(this._calcSCL(e.cell))}}});a.attachEvent("onAfterRowDeleted",function(h,e){if(e!=0){if(!this._parsing&&this._aggregators.length){for(var g=0;g<this._aggregators.length;g++){if(this._aggregators[g]){var c=this.cells(e,g);c.setValue(this._calcSCL(c.cell))}}}}return true});a.attachEvent("onXLE",function(){for(var c=0;c<this._aggregators.length;c++){if(this._aggregators[c]){this._h2.forEachChild(0,function(g){if(g.childs.length!=0){var e=this.cells(g.id,c);e.setValue(this._calcSCL(e.cell))}},this)}}})});dhtmlXGridObject.prototype.enableMathSerialization=function(a){this._mathSerialization=dhx4.s2b(a)};dhtmlXGridObject.prototype.setMathRound=function(a){this._roundDl=a;this._roundD=Math.pow(10,a)};dhtmlXGridObject.prototype.enableMathEditing=function(a){this._mathEdit=dhx4.s2b(a)};dhtmlXGridObject.prototype._calcSCL=function(cell){if(!cell._code){return this.cells5(cell).getValue()}try{dhtmlx.agrid=this;var z=eval(cell._code)}catch(e){return("#SCL")}if(this._roundD){var pre=Math.abs(z)<1?"0":"";if(z<0){pre="-"+pre}z=Math.round(Math.abs(z)*this._roundD).toString();if(z==0){return 0}if(this._roundDl>0){var n=z.length-this._roundDl;if(n<0){z=("000000000"+z).substring(9+n);n=0}return(pre+z.substring(0,n)+"."+z.substring(n,z.length))}return pre+z}return z};dhtmlXGridObject.prototype._countTotal=function(l,c){var a=0;var h=this._h2.get[l];for(var e=0;e<h.childs.length;e++){if(!h.childs[e].buff){return a}if(h.childs[e].buff._parser){this._h2.forEachChild(l,function(m){if(m.childs.length==0){var n=parseFloat(this._get_cell_value(m.buff,c),10);if(n){a+=n}}},this);return a}var g=parseFloat(this._get_cell_value(h.childs[e].buff,c),10);if(g){a+=g}}return a};dhtmlXGridObject.prototype._compileSCL=function(e,c,a){if(e===null||e===window.undefined){return e}e=e.toString();if(e.indexOf("=")!=0||!c.parentNode){this._reLink([],c);if(a){c._code=c.original=null}return e}c.original=e;var l=null;e=e.replace("=","");if(e.indexOf("sum")!=-1){e=e.replace("sum","(dhtmlx.agrid._countTotal('"+c.parentNode.idd+"',"+c._cellIndex+"))");if(!this._aggregators){this._aggregators=[]}this._aggregators[c._cellIndex]="sum";c._code=e;return this._parsing?"":this._calcSCL(c)}if(e.indexOf("[[")!=-1){var h=/(\[\[([^\,]*)\,([^\]]*)]\])/g;dhtmlx.agrid=this;l=l||(new Array());e=e.replace(h,function(n,m,q,o){if(q=="-"){q=c.parentNode.idd}if(q.indexOf("#")==0){q=dhtmlx.agrid.getRowId(q.replace("#",""))}l[l.length]=[q,o];return'(parseFloat(dhtmlx.agrid.cells("'+q+'",'+o+").getValue(),10))"})}if(e.indexOf(":")!=-1){var h=/:(\w+)/g;dhtmlx.agrid=this;var g=c.parentNode.idd;l=l||(new Array());e=e.replace(h,function(n,m,q,o){l[l.length]=[g,dhtmlx.agrid.getColIndexById(m)];return'(parseFloat(dhtmlx.agrid.cells("'+g+'",dhtmlx.agrid.getColIndexById("'+m+'")).getValue(),10))'})}else{var h=/c([0-9]+)/g;dhtmlx.agrid=this;var g=c.parentNode.idd;l=l||(new Array());e=e.replace(h,function(n,m,q,o){l[l.length]=[g,m];return'(parseFloat(dhtmlx.agrid.cells("'+g+'",'+m+").getValue(),10))"})}this._reLink(l,c);c._code=e;return this._calcSCL(c)};dhtmlXGridObject.prototype._reLink=function(c,a){if(!c.length){return}for(var g=0;g<c.length;g++){if(!this._mat_links[c[g][0]]){this._mat_links[c[g][0]]={}}var e=this._mat_links[c[g][0]];if(!e[c[g][1]]){e[c[g][1]]=[]}e[c[g][1]].push(a)}};if(_isKHTML){(function(){var a=String.prototype.replace;String.prototype.replace=function(q,e){if(typeof e!="function"){return a.apply(this,arguments)}var h=""+this;var n=e;if(!(q instanceof RegExp)){var m=h.indexOf(q);return(m==-1?h:a.apply(h,[q,n(q,m,h)]))}var c=q;var r=[];var l=c.lastIndex;var o;while((o=c.exec(h))!=null){var m=o.index;var g=o.concat(m,h);r.push(h.slice(l,m),n.apply(null,g).toString());if(!c.global){l+=RegExp.lastMatch.length;break}else{l=c.lastIndex}}r.push(h.slice(l));return r.join("")}})()}dhtmlXGridObject.prototype.insertColumn=function(e,n,q,a,m,o,s,c,h){e=parseInt(e);if(e>this._cCount){e=this._cCount}if(!this._cMod){this._cMod=this._cCount}this._processAllArrays(this._cCount,e-1,[(n||"&nbsp;"),(a||100),(q||"ed"),(o||"left"),(s||""),(m||"na"),(h||""),"",this._cMod,(a||100)]);this._processAllRows("_addColInRow",e);if(typeof(n)=="object"){for(var l=1;l<this.hdr.rows.length;l++){if(n[l-1]=="#rspan"){var v=l-1;var u=false;var r=null;while(!u){var r=this.hdr.rows[v];for(var g=0;g<r.cells.length;g++){if(r.cells[g]._cellIndex==e){u=g;break}}v--}this.hdr.rows[v+1].cells[g].rowSpan=(this.hdr.rows[v].cells[g].rowSpan||1)+1}else{this.setHeaderCol(e,(n[l-1]||"&nbsp;"),l)}}}else{this.setHeaderCol(e,(n||"&nbsp;"))}this.hdr.rows[0].cells[e];this._cCount++;this._cMod++;this._master_row=null;this.setSizes()};dhtmlXGridObject.prototype.deleteColumn=function(a){a=parseInt(a);if(this._cCount==0){return}if(!this._cMod){this._cMod=this._cCount}if(a>=this._cCount){return}this._processAllArrays(a,this._cCount-1,[null,null,null,null,null,null,null,null,null,null,null]);this._processAllRows("_deleteColInRow",a);this._cCount--;this._master_row=null;this.setSizes()};dhtmlXGridObject.prototype._processAllRows=function(h,a,c){this[h](this.obj.rows[0],a,c,0);var g=this.hdr.rows.length;for(var e=0;e<g;e++){this[h](this.hdr.rows[e],a,c,e)}if(this.ftr){var g=this.ftr.firstChild.rows.length;for(var e=0;e<g;e++){this[h](this.ftr.firstChild.rows[e],a,c,e)}}this.forEachRow(function(l){if(this.rowsAr[l]&&this.rowsAr[l].tagName=="TR"){this[h](this.rowsAr[l],a,c,-1)}})};dhtmlXGridObject.prototype._processAllArrays=function(q,a,o){var h=["hdrLabels","initCellWidth","cellType","cellAlign","cellVAlign","fldSort","columnColor","_hrrar","_c_order"];if(this.cellWidthPX.length){h.push("cellWidthPX")}if(this.cellWidthPC.length){h.push("cellWidthPC")}if(this._col_combos){h.push("_col_combos")}if(this._mCols){h[h.length]="_mCols"}if(this.columnIds){h[h.length]="columnIds"}if(this._maskArr){h.push("_maskArr")}if(this._drsclmW){h.push("_drsclmW")}if(this._RaSeCol){h.push("_RaSeCol")}if(this._hm_config){h.push("_hm_config")}if(this._drsclmn){h.push("_drsclmn")}if(this.clists){h.push("clists")}if(this._validators&&this._validators.data){h.push(this._validators.data)}h.push("combos");if(this._customSorts){h.push("_customSorts")}if(this._aggregators){h.push("_aggregators")}var n=(q<=a);if(!this._c_order){this._c_order=new Array();var e=this._cCount;for(var m=0;m<e;m++){this._c_order[m]=m}}for(var m=0;m<h.length;m++){var r=this[h[m]]||h[m];if(r){if(n){var c=r[q];for(var g=q;g<a;g++){r[g]=r[g+1]}r[a]=c}else{var c=r[q];for(var g=q;g>(a+1);g--){r[g]=r[g-1]}r[a+1]=c}if(o){r[a+(n?0:1)]=o[m]}}}};dhtmlXGridObject.prototype.moveColumn=function(a,c){c--;a=parseInt(a);c=parseInt(c);if(c<a){var e=c+1}else{var e=c}if(!this.callEvent("onBeforeCMove",[a,e])){return false}if(a==e){return}this.editStop();this._processAllRows("_moveColInRow",a,c);this._processAllArrays(a,c);if(this.fldSorted){this.setSortImgPos(this.fldSorted._cellIndex)}this.callEvent("onAfterCMove",[a,e])};dhtmlXGridObject.prototype._swapColumns=function(c){var e=new Array();for(var a=0;a<this._cCount;a++){var g=c[this._c_order[a]];if(typeof(g)=="undefined"){g=""}e[a]=g}return e};dhtmlXGridObject.prototype._moveColInRow=function(l,a,e){var m=l.childNodes[a];var h=l.childNodes[e+1];if(!m){return}if(h){l.insertBefore(m,h)}else{l.appendChild(m)}for(var g=0;g<l.childNodes.length;g++){l.childNodes[g]._cellIndex=l.childNodes[g]._cellIndexS=g}};dhtmlXGridObject.prototype._addColInRow=function(n,l,a,g){var h=l;if(n._childIndexes){if(n._childIndexes[l-1]==n._childIndexes[l]||!n.childNodes[n._childIndexes[l-1]]){for(var e=n._childIndexes.length;e>=l;e--){n._childIndexes[e]=e?(n._childIndexes[e-1]+1):0}n._childIndexes[l]--}else{for(var e=n._childIndexes.length;e>=l;e--){n._childIndexes[e]=e?(n._childIndexes[e-1]+1):0}}var h=n._childIndexes[l]}var o=n.childNodes[h];var m=document.createElement((g)?"TD":"TH");if(g){m._attrs={}}else{m.style.width=(parseInt(this.cellWidthPX[l])||"100")+"px"}if(o){n.insertBefore(m,o)}else{n.appendChild(m)}if(this.dragAndDropOff&&n.idd){this.dragger.addDraggableItem(n.childNodes[h],this)}for(var e=h+1;e<n.childNodes.length;e++){n.childNodes[e]._cellIndex=n.childNodes[e]._cellIndexS=n.childNodes[e]._cellIndex+1}if(n.childNodes[h]){n.childNodes[h]._cellIndex=n.childNodes[h]._cellIndexS=l}if(n.idd||typeof(n.idd)!="undefined"){this.cells3(n,l).setValue("");m.align=this.cellAlign[l];m.style.verticalAlign=this.cellVAlign[l];m.bgColor=this.columnColor[l]}else{if(m.tagName=="TD"){if(!n.idd&&this.forceDivInHeader){m.innerHTML="<div class='hdrcell'>&nbsp;</div>"}else{m.innerHTML="&nbsp;"}}}};dhtmlXGridObject.prototype._deleteColInRow=function(n,m){var e=m;if(n._childIndexes){m=n._childIndexes[m]}var o=n.childNodes[m];if(!o){return}if(o.colSpan&&o.colSpan>1&&o.parentNode.idd){var h=o.colSpan-1;var a=this.cells4(o).getValue();this.setColspan(o.parentNode.idd,o._cellIndex,1);if(h>1){var l=o._cellIndex*1;this.setColspan(o.parentNode.idd,l+1,h);this.cells(o.parentNode.idd,o._cellIndex*1+1).setValue(a);n._childIndexes.splice(l,1);for(var g=l;g<n._childIndexes.length;g++){n._childIndexes[g]-=1}}}else{if(n._childIndexes){n._childIndexes.splice(e,1);for(var g=e;g<n._childIndexes.length;g++){n._childIndexes[g]--}}}if(o){n.removeChild(o)}for(var g=m;g<n.childNodes.length;g++){n.childNodes[g]._cellIndex=n.childNodes[g]._cellIndexS=n.childNodes[g]._cellIndex-1}};dhtmlXGridObject.prototype.enableColumnMove=function(c,a){this._mCol=dhx4.s2b(c);if(typeof(a)!="undefined"){this._mCols=a.split(",")}if(!this._mmevTrue){dhtmlxEvent(this.hdr,"mousedown",this._startColumnMove);dhtmlxEvent(document.body,"mousemove",this._onColumnMove);dhtmlxEvent(document.body,"mouseup",this._stopColumnMove);this._mmevTrue=true}};dhtmlXGridObject.prototype._startColumnMove=function(h){h=h||event;var g=h.target||h.srcElement;var a=g;while(a.tagName!="TABLE"){a=a.parentNode}var c=a.grid;if(!c){return}c.setActive();if(!c._mCol||h.button==2){return}g=c.getFirstParentOfType(g,"TD");if(g.style.cursor!="default"){return true}if((c)&&(!c._colInMove)){c.resized=null;if((!c._mCols)||(c._mCols[g._cellIndex]=="true")){c._colInMove=g._cellIndex+1}}c._colInMovePos={x:h.clientX,y:h.clientY};return true};dhtmlXGridObject.prototype._onColumnMove=function(m){m=m||event;var a=window.globalActiveDHTMLGridObject;if((a)&&(a._colInMove)){var l=Math.max(Math.abs(m.clientX-a._colInMovePos.x),Math.abs(m.clientY-a._colInMovePos.y));if(l<20){return}if(a._hideHContext){a._hideHContext()}if(typeof(a._colInMove)!="object"){var n=document.createElement("DIV");n._aIndex=(a._colInMove-1);n._bIndex=null;n.innerHTML=a.getHeaderCol(n._aIndex);n.className="dhx_dragColDiv";n.style.position="absolute";document.body.appendChild(n);a._colInMove=n}var h=[];h[0]=(document.body.scrollLeft||document.documentElement.scrollLeft);h[1]=(document.body.scrollTop||document.documentElement.scrollTop);a._colInMove.style.left=m.clientX+h[0]+8+"px";a._colInMove.style.top=m.clientY+h[1]+8+"px";var c=m.target||m.srcElement;while((c)&&(typeof(c._cellIndexS)=="undefined")){c=c.parentNode}if(a._colInMove._oldHe){a._colInMove._oldHe.className=a._colInMove._oldHe.className.replace(/columnTarget(L|R)/g,"");a._colInMove._oldHe=null;a._colInMove._bIndex=null}if(c){if(a.hdr.rows[1]._childIndexes){var g=a.hdr.rows[1].cells[a.hdr.rows[1]._childIndexes[c._cellIndexS]]}else{var g=a.hdr.rows[1].cells[c._cellIndexS]}var n=m.clientX-(dhx4.absLeft(g)-a.hdrBox.scrollLeft);if(n/g.offsetWidth>0.5){g.className+=" columnTargetR";a._colInMove._bIndex=c._cellIndexS}else{g.className+=" columnTargetL";a._colInMove._bIndex=c._cellIndexS-1}if(g.offsetLeft<(a.objBox.scrollLeft+20)){a.objBox.scrollLeft=Math.max(0,g.offsetLeft-20)}if((g.offsetLeft+g.offsetWidth-a.objBox.scrollLeft)>(a.objBox.offsetWidth-20)){a.objBox.scrollLeft=Math.min(a.objBox.scrollLeft+g.offsetWidth+20,a.objBox.scrollWidth-a.objBox.offsetWidth)}a._colInMove._oldHe=g}m.cancelBubble=true;return false}return true};dhtmlXGridObject.prototype._stopColumnMove=function(c){c=c||event;var a=window.globalActiveDHTMLGridObject;if((a)&&(a._colInMove)){if(typeof(a._colInMove)=="object"){a._colInMove.parentNode.removeChild(a._colInMove);if(a._colInMove._bIndex!=null){a.moveColumn(a._colInMove._aIndex,a._colInMove._bIndex+1)}if(a._colInMove._oldHe){a._colInMove._oldHe.className=a._colInMove._oldHe.className.replace(/columnTarget(L|R)/g,"")}a._colInMove._oldHe=null;a._colInMove.grid=null;a.resized=true}a._colInMove=0}return true};dhtmlXGridObject.prototype.mouseOverHeader=function(c){var a=this;dhtmlxEvent(this.hdr,"mousemove",function(h){h=h||window.event;var g=h.target||h.srcElement;if(g.tagName!="TD"){g=a.getFirstParentOfType(g,"TD")}if(g&&(typeof(g._cellIndex)!="undefined")){c(g.parentNode.rowIndex,g._cellIndex)}})};dhtmlXGridObject.prototype.mouseOver=function(c){var a=this;dhtmlxEvent(this.obj,"mousemove",function(h){h=h||window.event;var g=h.target||h.srcElement;if(g.tagName!="TD"){g=a.getFirstParentOfType(g,"TD")}if(g&&(typeof(g._cellIndex)!="undefined")){c(g.parentNode.rowIndex,g._cellIndex)}})};dhtmlXGridObject.prototype.enablePaging=function(l,g,c,h,a,e){this._pgn_parentObj=typeof(h)=="string"?document.getElementById(h):h;this._pgn_recInfoParentObj=typeof(e)=="string"?document.getElementById(e):e;this.pagingOn=l;this.showRecInfo=a;this.rowsBufferOutSize=parseInt(g);this.currentPage=1;this.pagesInGroup=parseInt(c);this._init_pgn_events();this.setPagingSkin("default")};dhtmlXGridObject.prototype.setXMLAutoLoading=function(a,c){this.xmlFileUrl=a;this._dpref=c};dhtmlXGridObject.prototype.changePageRelative=function(a){this.changePage(this.currentPage+a)};dhtmlXGridObject.prototype.changePage=function(a){if(arguments.length==0){a=this.currentPage||0}a=parseInt(a);a=Math.max(1,Math.min(a,Math.ceil(this.rowsBuffer.length/this.rowsBufferOutSize)));if(!this.callEvent("onBeforePageChanged",[this.currentPage,a])){return}this.currentPage=parseInt(a);this._reset_view();this._fixAlterCss();this.callEvent("onPageChanged",this.getStateOfView())};dhtmlXGridObject.prototype.setPagingSkin=function(a){this._pgn_skin=this["_pgn_"+a];if(a=="toolbar"){this._pgn_skin_tlb=arguments[1]}};dhtmlXGridObject.prototype.setPagingTemplates=function(e,c){this._pgn_templateA=this._pgn_template_compile(e);this._pgn_templateB=this._pgn_template_compile(c);this._page_skin_update()};dhtmlXGridObject.prototype._page_skin_update=function(a){if(!this.pagesInGroup){this.pagesInGroup=Math.ceil(Math.min(5,this.rowsBuffer.length/this.rowsBufferOutSize))}var c=Math.ceil(this.rowsBuffer.length/this.rowsBufferOutSize);if(c&&c<this.currentPage){return this.changePage(c)}if(this.pagingOn&&this._pgn_skin){this._pgn_skin.apply(this,this.getStateOfView())}};dhtmlXGridObject.prototype._init_pgn_events=function(a){this.attachEvent("onXLE",this._page_skin_update);this.attachEvent("onClearAll",this._page_skin_update);this.attachEvent("onPageChanged",this._page_skin_update);this.attachEvent("onGridReconstructed",this._page_skin_update);this._init_pgn_events=function(){}};dhtmlXGridObject.prototype._pgn_default=function(e,g,a){if(!this.pagingBlock){this.pagingBlock=document.createElement("DIV");this.pagingBlock.className="pagingBlock";this.recordInfoBlock=document.createElement("SPAN");this.recordInfoBlock.className="recordsInfoBlock";if(!this._pgn_parentObj){return}this._pgn_parentObj.appendChild(this.pagingBlock);if(this._pgn_recInfoParentObj&&this.showRecInfo){this._pgn_recInfoParentObj.appendChild(this.recordInfoBlock)}if(!this._pgn_templateA){this._pgn_templateA=this._pgn_template_compile("[prevpages:&lt;:&nbsp;] [currentpages:,&nbsp;] [nextpages:&gt;:&nbsp;]");this._pgn_templateB=this._pgn_template_compile("Results <b>[from]-[to]</b> of <b>[total]</b>")}}var c=this.getStateOfView();this.pagingBlock.innerHTML=this._pgn_templateA.apply(this,c);this.recordInfoBlock.innerHTML=this._pgn_templateB.apply(this,c);this._pgn_template_active(this.pagingBlock);this._pgn_template_active(this.recordInfoBlock);this.callEvent("onPaging",[])};dhtmlXGridObject.prototype._pgn_block=function(c){var h=Math.floor((this.currentPage-1)/this.pagesInGroup)*this.pagesInGroup;var a=Math.min(Math.ceil(this.rowsBuffer.length/this.rowsBufferOutSize),h+this.pagesInGroup);var g=[];for(var e=h+1;e<=a;e++){if(e==this.currentPage){g.push("<a class='dhx_not_active'><b>"+e+"</b></a>")}else{g.push("<a onclick='this.grid.changePage("+e+"); return false;'>"+e+"</a>")}}return g.join(c)};dhtmlXGridObject.prototype._pgn_link=function(g,c,e){if(g=="prevpages"||g=="prev"){if(this.currentPage==1){return e}return"<a onclick='this.grid.changePageRelative(-1*"+(g=="prev"?"1":"this.grid.pagesInGroup")+"); return false;'>"+c+"</a>"}if(g=="nextpages"||g=="next"){if(this.rowsBuffer.length/this.rowsBufferOutSize<=this.currentPage){return e}if(this.rowsBuffer.length/(this.rowsBufferOutSize*(g=="next"?"1":this.pagesInGroup))<=1){return e}return"<a onclick='this.grid.changePageRelative("+(g=="next"?"1":"this.grid.pagesInGroup")+"); return false;'>"+c+"</a>"}if(g=="current"){var a=this.currentPage+(c?parseInt(c):0);if(a<1||Math.ceil(this.rowsBuffer.length/this.rowsBufferOutSize)<a){return e}return"<a "+(a==this.currentPage?"class='dhx_active_page_link' ":"")+"onclick='this.grid.changePage("+a+"); return false;'>"+a+"</a>"}return c};dhtmlXGridObject.prototype._pgn_template_active=function(e){var a=e.getElementsByTagName("A");if(a){for(var c=0;c<a.length;c++){a[c].grid=this}}};dhtmlXGridObject.prototype._pgn_template_compile=function(a){a=a.replace(/\[([^\]]*)\]/g,function(e,c){c=c.split(":");switch(c[0]){case"from":return'"+(arguments[1]*1+(arguments[2]*1?1:0))+"';case"total":return'"+arguments[3]+"';case"to":return'"+arguments[2]+"';case"current":case"prev":case"next":case"prevpages":case"nextpages":return"\"+this._pgn_link('"+c[0]+"','"+c[1]+"','"+c[2]+"')+\"";case"currentpages":return"\"+this._pgn_block('"+c[1]+"')+\""}});return new Function('return "'+a+'";')};dhtmlXGridObject.prototype.i18n.paging={results:"Results",records:"数据集 ",to:" - ",page:"页面 ",perpage:"条/页",first:"第一页",previous:"上一页",found:"找到数据",next:"下一页",last:"最后一页",of:" of ",notfound:"暂时没有数据"};dhtmlXGridObject.prototype.setPagingWTMode=function(a,c,e,g){this._WTDef=[a,c,e,g]};dhtmlXGridObject.prototype._pgn_bricks=function(n,a,e){var h=(this.skin_name||"").split("_")[1];var c="";if(h=="light"||h=="modern"||h=="skyblue"){c="_"+h}this.pagerElAr=new Array();this.pagerElAr.pagerCont=document.createElement("DIV");this.pagerElAr.pagerBord=document.createElement("DIV");this.pagerElAr.pagerLine=document.createElement("DIV");this.pagerElAr.pagerBox=document.createElement("DIV");this.pagerElAr.pagerInfo=document.createElement("DIV");this.pagerElAr.pagerInfoBox=document.createElement("DIV");var m=(this.globalBox||this.objBox);this.pagerElAr.pagerCont.style.width=m.clientWidth+"px";this.pagerElAr.pagerCont.style.overflow="hidden";this.pagerElAr.pagerCont.style.clear="both";this.pagerElAr.pagerBord.className="dhx_pbox"+c;this.pagerElAr.pagerLine.className="dhx_pline"+c;this.pagerElAr.pagerBox.style.clear="both";this.pagerElAr.pagerInfo.className="dhx_pager_info"+c;this.pagerElAr.pagerCont.appendChild(this.pagerElAr.pagerBord);this.pagerElAr.pagerCont.appendChild(this.pagerElAr.pagerLine);this.pagerElAr.pagerCont.appendChild(this.pagerElAr.pagerInfo);this.pagerElAr.pagerLine.appendChild(this.pagerElAr.pagerBox);this.pagerElAr.pagerInfo.appendChild(this.pagerElAr.pagerInfoBox);this._pgn_parentObj.innerHTML="";this._pgn_parentObj.appendChild(this.pagerElAr.pagerCont);if(this.rowsBuffer.length>0){var l=20;var s=22;if(n>this.pagesInGroup){var q=document.createElement("DIV");var o=document.createElement("DIV");q.className="dhx_page"+c;o.innerHTML="&larr;";q.appendChild(o);this.pagerElAr.pagerBox.appendChild(q);var r=this;q.pgnum=(Math.ceil(n/this.pagesInGroup)-1)*this.pagesInGroup;q.onclick=function(){r.changePage(this.pgnum)};l+=s}for(var g=1;g<=this.pagesInGroup;g++){var q=document.createElement("DIV");var o=document.createElement("DIV");q.className="dhx_page"+c;pageNumber=((Math.ceil(n/this.pagesInGroup)-1)*this.pagesInGroup)+g;if(pageNumber>Math.ceil(this.rowsBuffer.length/this.rowsBufferOutSize)){break}o.innerHTML=pageNumber;q.appendChild(o);if(n==pageNumber){q.className+=" dhx_page_active"+c;o.className="dhx_page_active"+c}else{var r=this;q.pgnum=pageNumber;q.onclick=function(){r.changePage(this.pgnum)}}l+=(parseInt(s/3)*pageNumber.toString().length)+15;o.style.width=(parseInt(s/3)*pageNumber.toString().length)+8+"px";this.pagerElAr.pagerBox.appendChild(q)}if(Math.ceil(n/this.pagesInGroup)*this.pagesInGroup<Math.ceil(this.rowsBuffer.length/this.rowsBufferOutSize)){var q=document.createElement("DIV");var o=document.createElement("DIV");q.className="dhx_page"+c;o.innerHTML="&rarr;";q.appendChild(o);this.pagerElAr.pagerBox.appendChild(q);var r=this;q.pgnum=(Math.ceil(n/this.pagesInGroup)*this.pagesInGroup)+1;q.onclick=function(){r.changePage(this.pgnum)};l+=s}this.pagerElAr.pagerLine.style.width=l+"px"}if(this.rowsBuffer.length>0&&this.showRecInfo){this.pagerElAr.pagerInfoBox.innerHTML=this.i18n.paging.records+(a+1)+this.i18n.paging.to+e+this.i18n.paging.of+this.rowsBuffer.length}else{if(this.rowsBuffer.length==0){this.pagerElAr.pagerLine.parentNode.removeChild(this.pagerElAr.pagerLine);this.pagerElAr.pagerInfoBox.innerHTML=this.i18n.paging.notfound}}this.pagerElAr.pagerBox.appendChild(document.createElement("SPAN")).innerHTML="&nbsp;";this.pagerElAr.pagerBord.appendChild(document.createElement("SPAN")).innerHTML="&nbsp;";this.pagerElAr.pagerCont.appendChild(document.createElement("SPAN")).innerHTML="&nbsp;";this.callEvent("onPaging",[])};dhtmlXGridObject.prototype._pgn_toolbar=function(l,m,c){if(!this.aToolBar){this.aToolBar=this._pgn_createToolBar()}var h=Math.ceil(this.rowsBuffer.length/this.rowsBufferOutSize);if(this._WTDef[0]){this.aToolBar.enableItem("right");this.aToolBar.enableItem("rightabs");this.aToolBar.enableItem("left");this.aToolBar.enableItem("leftabs");if(this.currentPage>=h){this.aToolBar.disableItem("right");this.aToolBar.disableItem("rightabs")}if(this.currentPage==1){this.aToolBar.disableItem("left");this.aToolBar.disableItem("leftabs")}}if(this._WTDef[2]){var g=this;this.aToolBar.forEachListOption("pages",function(n){g.aToolBar.removeListOption("pages",n)});var a={dhx_skyblue:4,dhx_web:0,dhx_terrace:14}[this.aToolBar.conf.skin];for(var e=0;e<h;e++){this.aToolBar.addListOption("pages","pages_"+(e+1),NaN,"button","<span style='padding: 0px "+a+"px 0px 0px;'>"+this.i18n.paging.page+(e+1)+"</span>","paging_page.gif")}this.aToolBar.setItemText("pages",this.i18n.paging.page+l)}if(this._WTDef[1]){if(!this.getRowsNum()){this.aToolBar.setItemText("results",this.i18n.paging.notfound)}else{this.aToolBar.setItemText("results","<div style='width:100%; text-align:center'>"+this.i18n.paging.records+(m+1)+this.i18n.paging.to+c+"</div>")}}if(this._WTDef[3]){this.aToolBar.setItemText("perpagenum",this.rowsBufferOutSize.toString()+" "+this.i18n.paging.perpage)}this.callEvent("onPaging",[])};dhtmlXGridObject.prototype._pgn_createToolBar=function(){this.aToolBar=new dhtmlXToolbarObject({parent:this._pgn_parentObj,skin:(this._pgn_skin_tlb||this.skin_name),icons_path:this.imgURL});if(!this._WTDef){this.setPagingWTMode(true,true,true,true)}var g=this;this.aToolBar.attachEvent("onClick",function(h){h=h.split("_");switch(h[0]){case"leftabs":g.changePage(1);break;case"left":g.changePage(g.currentPage-1);break;case"rightabs":g.changePage(99999);break;case"right":g.changePage(g.currentPage+1);break;case"perpagenum":if(h[1]===this.undefined){return}g.rowsBufferOutSize=parseInt(h[1]);g.changePage();g.aToolBar.setItemText("perpagenum",h[1]+" "+g.i18n.paging.perpage);break;case"pages":if(h[1]===this.undefined){return}g.changePage(h[1]);g.aToolBar.setItemText("pages",g.i18n.paging.page+h[1]);break}});if(this._WTDef[0]){this.aToolBar.addButton("leftabs",NaN,null,"ar_left_abs.gif","ar_left_abs_dis.gif");this.aToolBar.addButton("left",NaN,null,"ar_left.gif","ar_left_dis.gif")}if(this._WTDef[1]){this.aToolBar.addText("results",NaN,this.i18n.paging.results);this.aToolBar.setWidth("results","150");this.aToolBar.disableItem("results")}if(this._WTDef[0]){this.aToolBar.addButton("right",NaN,null,"ar_right.gif","ar_right_dis.gif");this.aToolBar.addButton("rightabs",NaN,null,"ar_right_abs.gif","ar_right_abs_dis.gif")}if(this._WTDef[2]){if(this.aToolBar.conf.skin=="dhx_terrace"){this.aToolBar.addSeparator()}this.aToolBar.addButtonSelect("pages",NaN,"select page",[],"paging_pages.gif",null,false,true)}var a;if(a=this._WTDef[3]){if(this.aToolBar.conf.skin=="dhx_terrace"){this.aToolBar.addSeparator()}this.aToolBar.addButtonSelect("perpagenum",NaN,"select size",[],"paging_rows.gif",null,false,true);if(typeof a!="object"){a=[100,200,300,400,500,1000]}var c={dhx_skyblue:4,dhx_web:0,dhx_terrace:18}[this.aToolBar.conf.skin];for(var e=0;e<a.length;e++){this.aToolBar.addListOption("perpagenum","perpagenum_"+a[e],NaN,"button","<span style='padding: 0px "+c+"px 0px 0px;'>"+a[e]+" "+this.i18n.paging.perpage+"</span>","paging_page.gif")}}return this.aToolBar};dhtmlXGridObject.prototype.post=function(a,c,g,e){this.callEvent("onXLS",[this]);if(arguments.length==2&&typeof g!="function"){e=g;g=null}e=e||"xml";if(!this.xmlFileUrl){this.xmlFileUrl=a}this._data_type=e;this.xmlLoader=this.doLoadDetails;var h=this;this.xmlLoader=function(l){if(!h.callEvent){return}h["_process_"+e](l.xmlDoc);if(!h._contextCallTimer){h.callEvent("onXLE",[h,0,0,l.xmlDoc])}if(g){g();g=null}};dhx4.ajax.post(a,(c||""),this.xmlLoader)};dhtmlXGridObject.prototype.setRowspan=function(q,u,h){var s=this[this._bfs_cells?"_bfs_cells":"cells"](q,u).cell;var a=this.rowsAr[q];if(s.rowSpan&&s.rowSpan!=1){var l=a.nextSibling;for(var n=1;n<s.rowSpan;n++){var m=l.childNodes[l._childIndexes[s._cellIndex+1]];var e=document.createElement("TD");e.innerHTML="&nbsp;";e._cellIndex=s._cellIndex;e._clearCell=true;if(m){m.parentNode.insertBefore(e,m)}else{l.parentNode.appendChild(e)}this._shiftIndexes(l,s._cellIndex,-1);l=l.nextSibling}}s.rowSpan=h;if(!this._h2){a=a.nextSibling||this.rowsCol[this.rowsCol._dhx_find(a)+1]}else{a=this.rowsAr[this._h2.get[a.idd].parent.childs[this._h2.get[a.idd].index+1].id]}var g=[];for(var n=1;n<h;n++){var o=null;if(this._fake&&!this._realfake){o=this._bfs_cells3(a,u).cell}else{o=this.cells3(a,u).cell}this._shiftIndexes(a,s._cellIndex,1);if(o){o.parentNode.removeChild(o)}g.push(a);if(!this._h2){a=a.nextSibling||this.rowsCol[this.rowsCol._dhx_find(a)+1]}else{var a=this._h2.get[a.idd].parent.childs[this._h2.get[a.idd].index+1];if(a){a=this.rowsAr[a.id]}}}this.rowsAr[q]._rowSpan=this.rowsAr[q]._rowSpan||{};this.rowsAr[q]._rowSpan[u]=g;if(this._fake&&!this._realfake&&u<this._fake._cCount){this._fake.setRowspan(q,u,h)}};dhtmlXGridObject.prototype._shiftIndexes=function(a,g,c){if(!a._childIndexes){a._childIndexes=new Array();for(var e=0;e<a.childNodes.length;e++){a._childIndexes[e]=e}}for(var e=0;e<a._childIndexes.length;e++){if(e>g){a._childIndexes[e]=a._childIndexes[e]-c}}};dhtmlXGridObject.prototype.enableRowspan=function(){this._erspan=true;this.enableRowspan=function(){};this.attachEvent("onAfterSorting",function(){if(this._dload){return}for(var h=1;h<this.obj.rows.length;h++){if(this.obj.rows[h]._rowSpan){var a=this.obj.rows[h];for(var l in a._rowSpan){var o=a;var c=o._rowSpan[l];for(var e=0;e<c.length;e++){if(o.nextSibling){o.parentNode.insertBefore(c[e],o.nextSibling)}else{o.parentNode.appendChild(c[e])}if(this._fake){var g=this._fake.rowsAr[o.idd];var m=this._fake.rowsAr[c[e].idd];if(g.nextSibling){g.parentNode.insertBefore(m,g.nextSibling)}else{g.parentNode.appendChild(m)}this._correctRowHeight(o.idd)}o=o.nextSibling}}}}var n=this.rowsCol.stablesort;this.rowsCol=new dhtmlxArray();this.rowsCol.stablesort=n;for(var h=1;h<this.obj.rows.length;h++){this.rowsCol.push(this.obj.rows[h])}});this.attachEvent("onXLE",function(g,e,q,l){for(var m=0;m<this.rowsBuffer.length;m++){var o=this.render_row(m);var n=o.childNodes;for(var h=0;h<n.length;h++){if(n[h]._attrs.rowspan){this.setRowspan(o.idd,n[h]._cellIndex,n[h]._attrs.rowspan)}}}})};dhx4.attachEvent("onGridCreated",function(a){if(a._split_later){a.splitAt(a._split_later)}});dhtmlXGridObject.prototype.splitAt=function(m){if(!this.obj.rows[0]){return this._split_later=m}m=parseInt(m);var w=document.createElement("DIV");this.entBox.appendChild(w);var x=document.createElement("DIV");this.entBox.appendChild(x);for(var u=this.entBox.childNodes.length-3;u>=0;u--){x.insertBefore(this.entBox.childNodes[u],x.firstChild)}this.entBox.style.position="relative";this.globalBox=this.entBox;this.entBox=x;x.grid=this;w.style.cssText+="border:0px solid red !important;";x.style.cssText+="border:0px solid red !important;";x.style.top="0px";x.style.position="absolute";w.style.position="absolute";w.style.top="0px";w.style.left="0px";w.style.zIndex=11;x.style.height=w.style.height=this.globalBox.clientHeight;this._fake=new dhtmlXGridObject(w);this.globalBox=this._fake.globalBox=this.globalBox;this._fake._fake=this;this._fake._realfake=true;this._treeC=this.cellType._dhx_find("tree");this._fake.delim=this.delim;this._fake.customGroupFormat=this.customGroupFormat;this._fake.setImagesPath(this._imgURL);this._fake.iconURL=this.iconURL;this._fake._customSorts=this._customSorts;this._fake.noHeader=this.noHeader;this._fake._enbTts=this._enbTts;this._fake._drsclmW=this._drsclmW;this._fake._htkebl=this._htkebl;this._fake.clists=this.clists;this._fake.fldSort=new Array();this._fake.selMultiRows=this.selMultiRows;this._fake.multiLine=this.multiLine;this._fake.smartTabOrder=this.smartTabOrder;if(this.multiLine||this._erspan){this.attachEvent("onCellChanged",this._correctRowHeight);this.attachEvent("onRowAdded",this._correctRowHeight);var c=function(){this.forEachRow(function(C){this._correctRowHeight(C)})};this.attachEvent("onPageChanged",c);this.attachEvent("onXLE",c);this.attachEvent("onResizeEnd",c);if(!this._ads_count){this.attachEvent("onAfterSorting",c)}if(this._srnd){this.attachEvent("onFilterEnd",c)}this.attachEvent("onDistributedEnd",c)}this.attachEvent("onGridReconstructed",function(){this._fake.objBox.scrollTop=this.objBox.scrollTop});this._fake.loadedKidsHash=this.loadedKidsHash;if(this._h2){this._fake._h2=this._h2}this._fake._dInc=this._dInc;var n=[[],[],[],[],[],[],[]];var r=["hdrLabels","initCellWidth","cellType","cellAlign","cellVAlign","fldSort","columnColor"];var h=["setHeader","setInitWidths","setColTypes","setColAlign","setColVAlign","setColSorting","setColumnColor"];this._fake.callEvent=function(){var C=true;this._fake._split_event=true;var D=(arguments[0]=="onScroll");if(arguments[0]=="onGridReconstructed"||D){this._fake.callEvent.apply(this,arguments)}if(!D){C=this._fake.callEvent.apply(this._fake,arguments)}this._fake._split_event=false;return C};if(this._elmn){this._fake.enableLightMouseNavigation(true)}if(this.__cssEven||this._cssUnEven){this._fake.attachEvent("onGridReconstructed",function(){this._fixAlterCss()})}this._fake._cssEven=this._cssEven;this._fake._cssUnEven=this._cssUnEven;this._fake._cssSP=this._cssSP;this._fake.isEditable=this.isEditable;this._fake._edtc=this._edtc;if(this._sst){this._fake.enableStableSorting(true)}this._fake._sclE=this._sclE;this._fake._dclE=this._dclE;this._fake._f2kE=this._f2kE;this._fake._maskArr=this._maskArr;this._fake._dtmask=this._dtmask;this._fake.combos=this.combos;var o=0;var a=this.globalBox.offsetWidth;for(var u=0;u<m;u++){for(var s=0;s<r.length;s++){if(this[r[s]]){n[s][u]=this[r[s]][u]}if(typeof n[s][u]=="string"){n[s][u]=n[s][u].replace(new RegExp("\\"+this.delim,"g"),"\\"+this.delim)}}if(_isFF){n[1][u]=n[1][u]*1}if(this.cellWidthType=="%"){n[1][u]=Math.round(parseInt(this[r[1]][u])*a/100);o+=n[1][u]}else{o+=parseInt(this[r[1]][u])}this.setColumnHidden(u,true)}for(var s=0;s<r.length;s++){var q=n[s].join(this.delim);if(h[s]!="setHeader"){if(q!=""){this._fake[h[s]](q)}}else{this._fake[h[s]](q,null,this._hstyles)}}this._fake._strangeParams=this._strangeParams;this._fake._drsclmn=this._drsclmn;o=Math.min(this.globalBox.offsetWidth,o);x.style.left=o+"px";w.style.width=o+"px";x.style.width=Math.max(this.globalBox.offsetWidth-o,0);if(this._ecspn){this._fake._ecspn=true}this._fake.init();if(this.dragAndDropOff){this.dragger.addDragLanding(this._fake.entBox,this)}this._fake.objBox.style.overflow="hidden";if(!dhtmlx.$customScroll){this._fake.objBox.style.overflowX="scroll"}else{this._fake.objBox._custom_scroll_mode=""}this._fake._srdh=this._srdh||20;this._fake._srnd=this._srnd;var y=this;function A(E){var D=E.wheelDelta/-40;if(E.wheelDelta===window.undefined){D=E.detail}var C=y.objBox;C.scrollTop+=D*40;if(E.preventDefault){E.preventDefault()}}dhtmlxEvent(this._fake.objBox,"mousewheel",A);dhtmlxEvent(this._fake.objBox,"DOMMouseScroll",A);function g(D,C){C.style.whiteSpace="";var H=C.nextSibling;var E=C.parentNode;D.parentNode.insertBefore(C,D);if(!H){E.appendChild(D)}else{E.insertBefore(D,H)}var F=D.style.display;D.style.display=C.style.display;C.style.display=F}function v(K,S,L,D){var E=(new Array(m)).join(this.delim);var M=[];if(K==2){for(var I=0;I<m;I++){var C=S[K-1].cells[S[K-1]._childIndexes?S[K-1]._childIndexes[I]:I];if(C.rowSpan&&C.rowSpan>1){M[C._cellIndex]=C.rowSpan-1;D[K-1].cells[D[K-1]._childIndexes?D[K-1]._childIndexes[I]:I].rowSpan=C.rowSpan;C.rowSpan=1}}}for(K;K<S.length;K++){this._fake.attachHeader(E,null,L);D=D||this._fake.ftr.childNodes[0].rows;var P=m;var F=0;for(var J=0;J<P;J++){if(M[J]){M[J]=M[J]-1;if(_isIE||_isOpera){var H=document.createElement("TD");if(_isFF){H.style.display="none"}S[K].insertBefore(H,S[K].cells[0])}F++;continue}var O=D[K].cells[J-F];var N=S[K].cells[J-(_isIE?0:F)];var Q=N.rowSpan;g(O,N);if(Q>1){M[J]=Q-1;N.rowSpan=Q}if(D[K].cells[J].colSpan>1){S[K].cells[J].colSpan=D[K].cells[J].colSpan;P-=D[K].cells[J].colSpan-1;for(var I=1;I<D[K].cells[J].colSpan;I++){D[K].removeChild(D[K].cells[J+1])}}}}}if(this.hdr.rows.length>2){v.call(this,2,this.hdr.rows,"_aHead",this._fake.hdr.rows)}if(this.ftr){v.call(this,1,this.ftr.childNodes[0].rows,"_aFoot");this._fake.ftr.parentNode.style.bottom=(_isFF?2:1)+"px"}if(this.saveSizeToCookie){this.saveSizeToCookie=function(D,C){if(this._realfake){return this._fake.saveSizeToCookie.apply(this._fake,arguments)}if(!D){D=this.entBox.id}var F=new Array();var H="cellWidthPX";for(var E=0;E<this[H].length;E++){if(E<m){F[E]=this._fake[H][E]}else{F[E]=this[H][E]}}F=F.join(",");this.setCookie(D,C,0,F);var F=(this.initCellWidth||(new Array)).join(",");this.setCookie(D,C,1,F);return true};this.loadSizeFromCookie=function(C){if(!C){C=this.entBox.id}var H=this._getCookie(C,1);if(!H){return}this.initCellWidth=H.split(",");var H=this._getCookie(C,0);var I="cellWidthPX";this.cellWidthType="px";var E=0;if((H)&&(H.length)){H=H.split(",");for(var D=0;D<H.length;D++){if(D<m){this._fake[I][D]=H[D];E+=H[D]*1}else{this[I][D]=H[D]}}}this._fake.entBox.style.width=E+"px";this._fake.objBox.style.width=E+"px";var F=this.globalBox.childNodes[1];F.style.left=E-(_isFF?0:0)+"px";if(this.ftr){this.ftr.style.left=E-(_isFF?0:0)+"px"}F.style.width=this.globalBox.offsetWidth-E+"px";this.setSizes();return true};this._fake.onRSE=this.onRSE}this.setCellTextStyleA=this.setCellTextStyle;this.setCellTextStyle=function(D,E,C){if(E<m){this._fake.setCellTextStyle(D,E,C)}this.setCellTextStyleA(D,E,C)};this.setRowTextBoldA=this.setRowTextBold;this.setRowTextBold=function(C){this.setRowTextBoldA(C);this._fake.setRowTextBold(C)};this.setRowColorA=this.setRowColor;this.setRowColor=function(D,C){this.setRowColorA(D,C);this._fake.setRowColor(D,C)};this.setRowHiddenA=this.setRowHidden;this.setRowHidden=function(D,C){this.setRowHiddenA(D,C);this._fake.setRowHidden(D,C)};this.setRowTextNormalA=this.setRowTextNormal;this.setRowTextNormal=function(C){this.setRowTextNormalA(C);this._fake.setRowTextNormal(C)};this.getChangedRows=function(E){var C=new Array();function D(H){for(var F=0;F<H.childNodes.length;F++){if(H.childNodes[F].wasChanged){return C[C.length]=H.idd}}}this.forEachRow(function(I){var H=this.rowsAr[I];var F=this._fake.rowsAr[I];if(H.tagName!="TR"||!F||F.tagName!="TR"){return}if(E&&H._added){C[C.length]=H.idd}else{if(!D(H)){D(F)}}});return C.join(this.delim)};this.setRowTextStyleA=this.setRowTextStyle;this.setRowTextStyle=function(D,C){this.setRowTextStyleA(D,C);if(this._fake.rowsAr[D]){this._fake.setRowTextStyle(D,C)}};this.lockRowA=this.lockRow;this.lockRow=function(D,C){this.lockRowA(D,C);this._fake.lockRow(D,C)};this.getColWidth=function(C){if(C<m){return parseInt(this._fake.cellWidthPX[C])}else{return parseInt(this.cellWidthPX[C])}};this.getColumnLabel=function(C){return this._fake.getColumnLabel.apply(((C<m)?this._fake:this),arguments)};this.setColWidthA=this._fake.setColWidthA=this.setColWidth;this.setColWidth=function(C,D){C=C*1;if(C<m){this._fake.setColWidthA(C,D)}else{this.setColWidthA(C,D)}if((C+1)<=m){this._fake._correctSplit(Math.min(this._fake.objBox.offsetWidth,this._fake.obj.offsetWidth))}};this.adjustColumnSizeA=this.adjustColumnSize;this.setColumnLabelA=this.setColumnLabel;this.setColumnLabel=function(D,C,H,F){var E=this;if(D<m){E=this._fake}return this.setColumnLabelA.apply(E,[D,C,H,F])};this.adjustColumnSize=function(C,D){if(C<m){if(_isIE){this._fake.obj.style.tableLayout=""}this._fake.adjustColumnSize(C,D);if(_isIE){this._fake.obj.style.tableLayout="fixed"}this._fake._correctSplit()}else{return this.adjustColumnSizeA(C,D)}};var e="cells";this._bfs_cells=this[e];this[e]=function(){if(arguments[1]<m){return this._fake.cells.apply(this._fake,arguments)}else{return this._bfs_cells.apply(this,arguments)}};this._bfs_isColumnHidden=this.isColumnHidden;this.isColumnHidden=function(){if(parseInt(arguments[0])<m){return this._fake.isColumnHidden.apply(this._fake,arguments)}else{return this._bfs_isColumnHidden.apply(this,arguments)}};this._bfs_setColumnHidden=this.setColumnHidden;this.setColumnHidden=function(){if(parseInt(arguments[0])<m){this._fake.setColumnHidden.apply(this._fake,arguments);return this._fake._correctSplit()}else{return this._bfs_setColumnHidden.apply(this,arguments)}};var e="cells2";this._bfs_cells2=this[e];this[e]=function(){if(arguments[1]<m){return this._fake.cells2.apply(this._fake,arguments)}else{return this._bfs_cells2.apply(this,arguments)}};var e="cells3";this._bfs_cells3=this[e];this[e]=function(D,C){if(arguments[1]<m&&this._fake.rowsAr[arguments[0].idd]){if(this._fake.rowsAr[D.idd]&&this._fake.rowsAr[D.idd].childNodes.length==0){return this._bfs_cells3.apply(this,arguments)}arguments[0]=arguments[0].idd;return this._fake.cells.apply(this._fake,arguments)}else{return this._bfs_cells3.apply(this,arguments)}};var e="changeRowId";this._bfs_changeRowId=this[e];this[e]=function(){this._bfs_changeRowId.apply(this,arguments);if(this._fake.rowsAr[arguments[0]]){this._fake.changeRowId.apply(this._fake,arguments)}};this._fake.getRowById=function(E){var D=this.rowsAr[E];if(!D&&this._fake.rowsAr[E]){D=this._fake.getRowById(E)}if(D){if(D.tagName!="TR"){for(var C=0;C<this.rowsBuffer.length;C++){if(this.rowsBuffer[C]&&this.rowsBuffer[C].idd==E){return this.render_row(C)}}if(this._h2){return this.render_row(null,D.idd)}}return D}return null};if(this.collapseKids){this._fake._bfs_collapseKids=this.collapseKids;this._fake.collapseKids=function(){return this._fake.collapseKids.apply(this._fake,[this._fake.rowsAr[arguments[0].idd]])};this["_bfs_collapseKids"]=this.collapseKids;this["collapseKids"]=function(){var C=this["_bfs_collapseKids"].apply(this,arguments);this._fake._h2syncModel();if(!this._cssSP){this._fake._fixAlterCss()}};this._fake._bfs_expandKids=this.expandKids;this._fake.expandKids=function(){this._fake.expandKids.apply(this._fake,[this._fake.rowsAr[arguments[0].idd]]);if(!this._cssSP){this._fake._fixAlterCss()}};this["_bfs_expandAll"]=this.expandAll;this["expandAll"]=function(){this._bfs_expandAll();this._fake._h2syncModel();if(!this._cssSP){this._fake._fixAlterCss()}};this["_bfs_collapseAll"]=this.collapseAll;this["collapseAll"]=function(){this._bfs_collapseAll();this._fake._h2syncModel();if(!this._cssSP){this._fake._fixAlterCss()}};this["_bfs_expandKids"]=this.expandKids;this["expandKids"]=function(){var C=this["_bfs_expandKids"].apply(this,arguments);this._fake._h2syncModel();if(!this._cssSP){this._fake._fixAlterCss()}};this._fake._h2syncModel=function(){if(this._fake.pagingOn){this._fake._renderSort()}else{this._renderSort()}};this._updateTGRState=function(C){return this._fake._updateTGRState(C)}}if(this._elmnh){this._setRowHoverA=this._fake._setRowHoverA=this._setRowHover;this._unsetRowHoverA=this._fake._unsetRowHoverA=this._unsetRowHover;this._setRowHover=this._fake._setRowHover=function(){var C=this.grid;C._setRowHoverA.apply(this,arguments);var D=(_isIE?event.srcElement:arguments[0].target);D=C._fake.rowsAr[C.getFirstParentOfType(D,"TD").parentNode.idd];if(D){C._fake._setRowHoverA.apply(C._fake.obj,[{target:D.childNodes[0]},arguments[1]])}};this._unsetRowHover=this._fake._unsetRowHover=function(){if(arguments[1]){var C=this}else{var C=this.grid}C._unsetRowHoverA.apply(this,arguments);C._fake._unsetRowHoverA.apply(C._fake.obj,arguments)};this._fake.enableRowsHover(true,this._hvrCss);this.enableRowsHover(false);this.enableRowsHover(true,this._fake._hvrCss)}this._updateTGRState=function(C){if(!C.update||C.id==0){return}if(this.rowsAr[C.id].imgTag){this.rowsAr[C.id].imgTag.src=this.iconTree+C.state+".gif"}if(this._fake.rowsAr[C.id]&&this._fake.rowsAr[C.id].imgTag){this._fake.rowsAr[C.id].imgTag.src=this.iconTree+C.state+".gif"}C.update=false};this.copy_row=function(H){var C=H.cloneNode(true);C._skipInsert=H._skipInsert;var I=m;C._attrs={};C._css=H._css;if(this._ecspn){I=0;for(var F=0;(I<C.childNodes.length&&F<m);F+=(C.childNodes[I].colSpan||1)){I++}}while(C.childNodes.length>I){C.removeChild(C.childNodes[C.childNodes.length-1])}var E=I;for(var F=0;F<E;F++){if(this.dragAndDropOff){this.dragger.addDraggableItem(C.childNodes[F],this)}C.childNodes[F].style.display=(this._fake._hrrar?(this._fake._hrrar[F]?"none":""):"");C.childNodes[F]._cellIndex=F;C.childNodes[F].combo_value=arguments[0].childNodes[F].combo_value;C.childNodes[F]._clearCell=arguments[0].childNodes[F]._clearCell;C.childNodes[F]._cellType=arguments[0].childNodes[F]._cellType;C.childNodes[F]._brval=arguments[0].childNodes[F]._brval;C.childNodes[F].val=arguments[0].childNodes[F].val;C.childNodes[F]._combo=arguments[0].childNodes[F]._combo;C.childNodes[F]._attrs=arguments[0].childNodes[F]._attrs;C.childNodes[F].chstate=arguments[0].childNodes[F].chstate;if(H._attrs.style){C.childNodes[F].style.cssText+=";"+H._attrs.style}if(C.childNodes[F].colSpan>1){this._childIndexes=this._fake._childIndexes}}if(this._h2&&this._treeC<m){var D=this._h2.get[arguments[0].idd];C.imgTag=C.childNodes[this._treeC].childNodes[0].childNodes[D.level];C.valTag=C.childNodes[this._treeC].childNodes[0].childNodes[D.level+2]}C.idd=H.idd;C.grid=this._fake;return C};var e="_insertRowAt";this._bfs_insertRowAt=this[e];this[e]=function(){var D=this["_bfs_insertRowAt"].apply(this,arguments);arguments[0]=this.copy_row(arguments[0]);var C=this._fake._insertRowAt.apply(this._fake,arguments);if(D._fhd){C.parentNode.removeChild(C);this._fake.rowsCol._dhx_removeAt(this._fake.rowsCol._dhx_find(C));D._fhd=false}return D};this._bfs_setSizes=this.setSizes;this.setSizes=function(){if(this._notresize){return}this._bfs_setSizes(this,arguments);this.sync_headers();if(this.sync_scroll()&&this._ahgr){this.setSizes()}var C=this.dontSetSizes?(this.entBox.offsetHeight+"px"):this.entBox.style.height;this._fake.entBox.style.height=C;this._fake.objBox.style.height=this.objBox.style.height;this._fake.hdrBox.style.height=this.hdrBox.style.height;this._fake.objBox.scrollTop=this.objBox.scrollTop;this._fake.setColumnSizes(this._fake.entBox.clientWidth);this.globalBox.style.width=parseInt(this.entBox.style.width)+parseInt(this._fake.entBox.style.width);if(!this.dontSetSizes){this.globalBox.style.height=C}};this.sync_scroll=this._fake.sync_scroll=function(D){var C=this.objBox.style.overflowX;if(this.obj.offsetWidth<=this.objBox.offsetWidth){if(!D){return this._fake.sync_scroll(true)}this.objBox.style.overflowX="hidden";this._fake.objBox.style.overflowX="hidden"}else{if(!dhtmlx.$customScroll){this.objBox.style.overflowX="scroll";this._fake.objBox.style.overflowX="scroll"}}return C!=this.objBox.style.overflowX};this.sync_headers=this._fake.sync_headers=function(){if(this.noHeader||(this._fake.hdr.scrollHeight==this.hdr.offsetHeight)||this.noHeaderResize){return}for(var D=1;D<this.hdr.rows.length;D++){var H=m;while(!this.hdr.rows[D].childNodes[H]){H--}var C=Math.min(this.hdr.rows[D].childNodes[H].scrollHeight+2,this.hdr.rows[D].scrollHeight);var F=this._fake.hdr.rows[D].scrollHeight;if(C!=F){this._fake.hdr.rows[D].style.height=this.hdr.rows[D].style.height=Math.max(C,F)+"px"}if(window._KHTMLrv){var E=0;while(this._fake._hrrar[E]){E++}this._fake.hdr.rows[D].childNodes[E].style.height=this.hdr.rows[D].childNodes[H].style.height=Math.max(C,F)+"px"}}this._fake.sync_headers};this._fake._bfs_setSizes=this._fake.setSizes;this._fake.setSizes=function(){if(this._fake._notresize){return}this._fake.setSizes()};var e="_doOnScroll";this._bfs__doOnScroll=this[e];this[e]=function(){this._bfs__doOnScroll.apply(this,arguments);this._fake.objBox.scrollTop=this.objBox.scrollTop;this._fake._doOnScroll.apply(this._fake,arguments)};var e="selectAll";this._bfs__selectAll=this[e];this[e]=function(){this._bfs__selectAll.apply(this,arguments);this._bfs__selectAll.apply(this._fake,arguments)};var e="doClick";this._bfs_doClick=this[e];this[e]=function(){this["_bfs_doClick"].apply(this,arguments);if(arguments[0].tagName=="TD"){var C=(arguments[0]._cellIndex>=m);if(!arguments[0].parentNode.idd){return}if(!C){arguments[0].className=arguments[0].className.replace(/cellselected/g,"")}if(!this._fake.rowsAr[arguments[0].parentNode.idd]){this._fake.render_row(this.getRowIndex(arguments[0].parentNode.idd))}arguments[0]=this._fake.cells(arguments[0].parentNode.idd,(C?0:arguments[0]._cellIndex)).cell;if(C){this._fake.cell=null}this._fake._bfs_doClick.apply(this._fake,arguments);if(C){this._fake.cell=this.cell}else{this.cell=this._fake.cell}if(this._fake.onRowSelectTime){clearTimeout(this._fake.onRowSelectTime)}if(C){arguments[0].className=arguments[0].className.replace(/cellselected/g,"");globalActiveDHTMLGridObject=this;this._fake.cell=this.cell}else{this.objBox.scrollTop=this._fake.objBox.scrollTop}}};this._fake._bfs_doClick=this._fake[e];this._fake[e]=function(){this["_bfs_doClick"].apply(this,arguments);if(arguments[0].tagName=="TD"){var C=(arguments[0]._cellIndex<m);if(!arguments[0].parentNode.idd){return}arguments[0]=this._fake._bfs_cells(arguments[0].parentNode.idd,(C?m:arguments[0]._cellIndex)).cell;this._fake.cell=null;this._fake._bfs_doClick.apply(this._fake,arguments);this._fake.cell=this.cell;if(this._fake.onRowSelectTime){clearTimeout(this._fake.onRowSelectTime)}if(C){arguments[0].className=arguments[0].className.replace(/cellselected/g,"");globalActiveDHTMLGridObject=this;this._fake.cell=this.cell;this._fake.objBox.scrollTop=this.objBox.scrollTop}}};this.clearSelectionA=this.clearSelection;this.clearSelection=function(C){if(C){this._fake.clearSelection()}this.clearSelectionA()};this.moveRowUpA=this.moveRowUp;this.moveRowUp=function(C){if(!this._h2){this._fake.moveRowUp(C)}this.moveRowUpA(C);if(this._h2){this._fake._h2syncModel()}};this.moveRowDownA=this.moveRowDown;this.moveRowDown=function(C){if(!this._h2){this._fake.moveRowDown(C)}this.moveRowDownA(C);if(this._h2){this._fake._h2syncModel()}};this._fake.getUserData=function(){return this._fake.getUserData.apply(this._fake,arguments)};this._fake.setUserData=function(){return this._fake.setUserData.apply(this._fake,arguments)};this.getSortingStateA=this.getSortingState;this.getSortingState=function(){var C=this.getSortingStateA();if(C.length!=0){return C}return this._fake.getSortingState()};this.setSortImgStateA=this._fake.setSortImgStateA=this.setSortImgState;this.setSortImgState=function(D,C,F,E){this.setSortImgStateA(D,C,F,E);if(C*1<m){this._fake.setSortImgStateA(D,C,F,E);this.setSortImgStateA(false)}else{this._fake.setSortImgStateA(false)}};this._fake.doColResizeA=this._fake.doColResize;this._fake.doColResize=function(H,F,E,C,J){var D=-1;var I=0;if(arguments[1]._cellIndex==(m-1)){D=this._initalSplR+(H.clientX-C);if(!this._initalSplF){this._initalSplF=arguments[3]+this.objBox.scrollWidth-this.objBox.offsetWidth}if(this.objBox.scrollWidth==this.objBox.offsetWidth&&(this._fake.alter_split_resize||(H.clientX-C)>0)){arguments[3]=(this._initalSplF||arguments[3]);I=this.doColResizeA.apply(this,arguments)}else{I=this.doColResizeA.apply(this,arguments)}}else{if(this.obj.offsetWidth<this.entBox.offsetWidth){D=this.obj.offsetWidth}I=this.doColResizeA.apply(this,arguments)}if(I!==false){this._correctSplit(D);this.resized=this._fake.resized=1}return I};this._fake.changeCursorState=function(E){var D=E.target||E.srcElement;if(D.tagName!="TD"){D=this.getFirstParentOfType(D,"TD")}if((D.tagName=="TD")&&(this._drsclmn)&&(!this._drsclmn[D._cellIndex])){return}var C=(E.layerX||0)+(((!_isIE)&&(E.target.tagName=="DIV"))?D.offsetLeft:0);var F=parseInt(this.getPosition(D,this.hdrBox));if(((D.offsetWidth-(E.offsetX||(F-C)*-1))<(_isOpera?20:10))||((this.entBox.offsetWidth-(E.offsetX?(E.offsetX+D.offsetLeft):C)+this.objBox.scrollLeft-0)<(_isOpera?20:10))){D.style.cursor="E-resize"}else{D.style.cursor="default"}if(_isOpera){this.hdrBox.scrollLeft=this.objBox.scrollLeft}};this._fake.startColResizeA=this._fake.startColResize;this._fake.startColResize=function(D){var E=this.startColResizeA(D);this._initalSplR=this.entBox.offsetWidth;this._initalSplF=null;if(this.entBox.onmousemove){var C=this.entBox.parentNode;if(C._aggrid){return E}C._aggrid=C.grid;C.grid=this;this.entBox.parentNode.onmousemove=this.entBox.onmousemove;this.entBox.onmousemove=null}return E};this._fake.stopColResizeA=this._fake.stopColResize;this._fake.stopColResize=function(D){if(this.entBox.parentNode.onmousemove){var C=this.entBox.parentNode;C.grid=C._aggrid;C._aggrid=null;this.entBox.onmousemove=this.entBox.parentNode.onmousemove;this.entBox.parentNode.onmousemove=null;if(this.obj.offsetWidth<this.entBox.offsetWidth){this._correctSplit(this.obj.offsetWidth)}}return this.stopColResizeA(D)};this.doKeyA=this.doKey;this._fake.doKeyA=this._fake.doKey;function l(F,D,K,J){var E=J.shiftKey?-1:1;var C=J.shiftKey?-1:K._cCount;var I=false;for(var H=F+E;H!=C;H+=E){if(K.smartTabOrder){I=K.cells2(D,H).isDisabled()?false:H}else{I=H}if(I!==false){K.selectCell(D,I,false,false,true,true);J.cancelBubble=true;if(J.preventDefault){J.preventDefault()}return true}}}this._fake.doKey=this.doKey=function(H){if(!H){return true}if(this._htkebl){return true}if((H.target||H.srcElement).value!==window.undefined){var D=(H.target||H.srcElement);if((!D.parentNode)||(D.parentNode.className.indexOf("editable")==-1)){return true}}switch(H.keyCode){case 9:var F=this._realfake?this._fake:this;if(!F.callEvent("onTab",[true])){return true}if(this.cell){var E=this.cell._cellIndex;var C=F.getRowIndex(this.cell.parentNode.idd);while(!l(E,C,F,H)){C+=(H.shiftKey?-1:1);if(C<0||C>=F.rowsBuffer.length){return}E=H.shiftKey?F._cCount:-1}return}break}return this.doKeyA(H)};this.editCellA=this.editCell;this.editCell=function(){if(this.cell&&this.cell.parentNode.grid!=this){return this._fake.editCell()}return this.editCellA()};this.deleteRowA=this.deleteRow;this.deleteRow=function(C,D){if(this.deleteRowA(C,D)===false){return false}if(this._fake.rowsAr[C]){this._fake.deleteRow(C)}};this.clearAllA=this.clearAll;this.clearAll=function(){this.clearAllA();this._fake.clearAll()};this.editStopA=this.editStop;this.editStop=function(C){if(this._fake.editor){this._fake.editStop(C)}else{this.editStopA(C)}};this.attachEvent("onAfterSorting",function(D,C,E){if(D>=m){this._fake.setSortImgState(false)}});this._fake.sortField=function(D,C,F){this._fake.sortField.call(this._fake,D,C,this._fake.hdr.rows[0].cells[D]);if(this.fldSort[D]!="na"&&this._fake.fldSorted){var E=this._fake.getSortingState()[1];this._fake.setSortImgState(false);this.setSortImgState(true,arguments[0],E)}};this.sortTreeRowsA=this.sortTreeRows;this._fake.sortTreeRowsA=this._fake.sortTreeRows;this.sortTreeRows=this._fake.sortTreeRows=function(E,F,C,D){if(this._realfake){return this._fake.sortTreeRows(E,F,C,D)}this.sortTreeRowsA(E,F,C,D);this._fake._h2syncModel();this._fake.setSortImgStateA(false);this._fake.fldSorted=null};this._fake._fillers=[];this._fake.rowsBuffer=this.rowsBuffer;this.attachEvent("onClearAll",function(){this._fake.rowsBuffer=this.rowsBuffer});this._add_filler_s=this._add_filler;this._add_filler=function(D,C,H,E){if(!this._fake._fillers){this._fake._fillers=[]}if(this._realfake||!E){var F;if(H&&H.idd){F=this._fake.rowsAr[H.idd]}else{if(H&&H.nextSibling){F={};F.nextSibling=this._fake.rowsAr[H.nextSibling.idd];F.parentNode=F.nextSibling.parentNode}else{if(this._fake._fillers.length){F=this._fake._fillers[this._fake._fillers.length-1][2]}}}this._fake._fillers.push(this._fake._add_filler(D,C,F))}return this._add_filler_s.apply(this,arguments)};this._add_from_buffer_s=this._add_from_buffer;this._add_from_buffer=function(){var C=this._add_from_buffer_s.apply(this,arguments);if(C!=-1){this._fake._add_from_buffer.apply(this._fake,arguments);if(this.multiLine){this._correctRowHeight(this.rowsBuffer[arguments[0]].idd)}}return C};this._fake.render_row=function(C){var D=this._fake.render_row(C);if(D==-1){return -1}if(D){return this.rowsAr[D.idd]=this.rowsAr[D.idd]||this._fake.copy_row(D)}return null};this._reset_view_s=this._reset_view;this._reset_view=function(){this._fake._reset_view(true);this._fake._fillers=[];this._reset_view_s()};this.moveColumn_s=this.moveColumn;this.moveColumn=function(D,C){if(C>=m){return this.moveColumn_s(D,C)}};this.attachEvent("onCellChanged",function(H,E,F){if(this._split_event&&E<m&&this.rowsAr[H]){var C=this._fake.rowsAr[H];if(!C){return}if(C._childIndexes){C=C.childNodes[C._childIndexes[E]]}else{C=C.childNodes[E]}var D=this.rowsAr[H].childNodes[E];if(D._treeCell&&D.firstChild.lastChild){D.firstChild.lastChild.innerHTML=F}else{D.innerHTML=C.innerHTML}D._clearCell=false;D.combo_value=C.combo_value;D.chstate=C.chstate}});this._fake.combos=this.combos;this.setSizes();if(this.rowsBuffer[0]){this._reset_view()}this.attachEvent("onXLE",function(){this._fake._correctSplit()});this._fake._correctSplit()};dhtmlXGridObject.prototype._correctSplit=function(c){c=c||(this.obj.scrollWidth-this.objBox.scrollLeft);c=Math.min(this.globalBox.offsetWidth,c);if(c>-1){this.entBox.style.width=c+"px";this.objBox.style.width=c+"px";var g=(this.globalBox.offsetWidth-this.globalBox.clientWidth)/2;this._fake.entBox.style.left=c+"px";this._fake.entBox.style.width=Math.max(0,this.globalBox.offsetWidth-c-(this.quirks?0:2)*g)+"px";if(this._fake.ftr){this._fake.ftr.parentNode.style.width=this._fake.entBox.style.width}if(_isIE){var e=_isIE&&!window.xmlHttpRequest;var g=(this.globalBox.offsetWidth-this.globalBox.clientWidth);this._fake.hdrBox.style.width=this._fake.objBox.style.width=Math.max(0,this.globalBox.offsetWidth-(e?g:0)-c)+"px"}}};dhtmlXGridObject.prototype._correctRowHeight=function(o,m){if(!this.rowsAr[o]||!this._fake.rowsAr[o]){return}var l=this.rowsAr[o].offsetHeight;var e=this._fake.rowsAr[o].offsetHeight;var a=Math.max(l,e)-(this.rowsAr[o].delta_fix||0);if(!a){return}this.rowsAr[o].style.height=this._fake.rowsAr[o].style.height=Math.round(a+1)+"px";this.rowsAr[o].delta_fix=1;if(window._KHTMLrv){var c=this._fake._cCount;var n;while(!n&&c>=0){n=this.rowsAr[o].childNodes[c];c-=1}var g=this._fake.rowsAr[o].firstChild;if(n&&g){n.style.height=g.style.height=a+"px";n.style.boxSizing=g.style.boxSizing="border-box"}}};dhtmlXGridObject.prototype.enableAutoSizeSaving=function(c,a){this.attachEvent("onResizeEnd",function(){this.saveSizeToCookie(c,a)})};dhtmlXGridObject.prototype.saveOpenStates=function(c,a){if(!c){c=this.entBox.id}var e=[];this._h2.forEachChild(0,function(h){if(h.state=="minus"){e.push(h.id)}});var g="gridOpen"+(c||"")+"="+e.join("|")+(a?("; "+a):"");document.cookie=g};dhtmlXGridObject.prototype.loadOpenStates=function(e,a){var h=this.getCookie(e,"gridOpen");if(!h){return}h=h.split("|");for(var g=0;g<h.length;g++){var c=this.getParentId(h[g]);if(!this.getOpenState(c)){continue}this.openItem(h[g])}};dhtmlXGridObject.prototype.enableAutoHiddenColumnsSaving=function(c,a){this.attachEvent("onColumnHidden",function(){this.saveHiddenColumnsToCookie(c,a)})};dhtmlXGridObject.prototype.enableSortingSaving=function(c,a){this.attachEvent("onBeforeSorting",function(){var e=this;window.setTimeout(function(){e.saveSortingToCookie(c,a)},1);return true})};dhtmlXGridObject.prototype.enableOrderSaving=function(c,a){this.attachEvent("onAfterCMove",function(){this.saveOrderToCookie(c,a);this.saveSizeToCookie(c,a)})};dhtmlXGridObject.prototype.enableAutoSaving=function(c,a){this.enableOrderSaving(c,a);this.enableAutoSizeSaving(c,a);this.enableSortingSaving(c,a)};dhtmlXGridObject.prototype.saveSizeToCookie=function(c,a){if(this.cellWidthType=="px"){var h=this.cellWidthPX}else{var h=this.cellWidthPC}var g=(this.initCellWidth||[]).join(",");if(this._hrrar){for(var e=0;e<this._hrrar.length;e++){if(this._hrrar[e]){h[e]=""}}}this.setCookie(c,a,0,h.join(","));this.setCookie(c,a,1,g)};dhtmlXGridObject.prototype.saveHiddenColumnsToCookie=function(c,a){var g=[].concat(this._hrrar||[]);if(this._fake&&this._fake._hrrar){for(var e=0;e<this._fake._cCount;e++){g[e]=this._fake._hrrar[e]?"1":""}}this.setCookie(c,a,4,g.join(",").replace(/display:none;/g,"1"))};dhtmlXGridObject.prototype.loadHiddenColumnsFromCookie=function(c){var g=this._getCookie(c,4);var a=(g||"").split(",");for(var e=0;e<this._cCount;e++){this.setColumnHidden(e,(a[e]?true:false))}};dhtmlXGridObject.prototype.saveSortingToCookie=function(c,a){this.setCookie(c,a,2,(this.getSortingState()||[]).join(","))};dhtmlXGridObject.prototype.loadSortingFromCookie=function(a){var c=this._getCookie(a,2);c=(c||"").split(",");if(c.length>1&&c[0]<this._cCount){this.sortRows(c[0],null,c[1]);this.setSortImgState(true,c[0],c[1])}};dhtmlXGridObject.prototype.saveOrderToCookie=function(e,a){if(!this._c_order){this._c_order=[];var c=this._cCount;for(var g=0;g<c;g++){this._c_order[g]=g}}this.setCookie(e,a,3,((this._c_order||[]).slice(0,this._cCount)).join(","));this.saveSortingToCookie()};dhtmlXGridObject.prototype.loadOrderFromCookie=function(c){var h=this._getCookie(c,3);h=(h||"").split(",");if(h.length>1&&h.length<=this._cCount){for(var g=0;g<h.length;g++){if((!this._c_order&&h[g]!=g)||(this._c_order&&h[g]!=this._c_order[g])){var e=h[g];if(this._c_order){for(var a=0;a<this._c_order.length;a++){if(this._c_order[a]==h[g]){e=a;break}}}this.moveColumn(e*1,g)}}}};dhtmlXGridObject.prototype.loadSizeFromCookie=function(a){var e=this._getCookie(a,1);if(e){this.initCellWidth=e.split(",")}var e=this._getCookie(a,0);if((e)&&(e.length)){if(!this._fake&&this._hrrar){for(var c=0;c<e.length;c++){if(this._hrrar[c]){e[c]=0}}}e=e.split(",");if(this.cellWidthType=="px"){this.cellWidthPX=e}else{this.cellWidthPC=e}}for(var c=0;c<e.length;c++){if(e[c]===""){e[c]=this.initCellWidth[c];this.setColumnHidden(c,true)}}this.setSizes();return true};dhtmlXGridObject.prototype.clearConfigCookie=function(a){if(!a){a=this.entBox.id}var c="gridSettings"+a+"=||||";document.cookie=c};dhtmlXGridObject.prototype.clearSizeCookie=dhtmlXGridObject.prototype.clearConfigCookie;dhtmlXGridObject.prototype.setCookie=function(c,a,l,g){if(!c){c=this.entBox.id}var e=this.getCookie(c);e=(e||"||||").split("|");e[l]=g;var h="gridSettings"+c+"="+e.join("|").replace(/,/g,"-")+(a?("; "+a):"");document.cookie=h};dhtmlXGridObject.prototype.getCookie=function(c,g){if(!c){c=this.entBox.id}c=(g||"gridSettings")+c;var e=c+"=";if(document.cookie.length>0){var h=document.cookie.indexOf(e);if(h!=-1){h+=e.length;var a=document.cookie.indexOf(";",h);if(a==-1){a=document.cookie.length}return document.cookie.substring(h,a)}}};dhtmlXGridObject.prototype._getCookie=function(a,c){return((this.getCookie(a)||"||||").replace(/-/g,",").split("|"))[c]};dhtmlXGridObject.prototype.enableUndoRedo=function(){var c=this;var e=function(){return c._onEditUndoRedo.apply(c,arguments)};this.attachEvent("onEditCell",e);var a=function(h,g,l){return c._onEditUndoRedo.apply(c,[2,h,g,(l?1:0),(l?0:1)])};this.attachEvent("onCheckbox",a);this._IsUndoRedoEnabled=true;this._UndoRedoData=[];this._UndoRedoPos=-1};dhtmlXGridObject.prototype.disableUndoRedo=function(){this._IsUndoRedoEnabled=false;this._UndoRedoData=[];this._UndoRedoPos=-1};dhtmlXGridObject.prototype._onEditUndoRedo=function(e,c,l,g,a){if(this._IsUndoRedoEnabled&&e==2&&a!=g){if(this._UndoRedoPos!==-1&&this._UndoRedoPos!=(this._UndoRedoData.length-1)){this._UndoRedoData=this._UndoRedoData.slice(0,this._UndoRedoPos+1)}else{if(this._UndoRedoPos===-1&&this._UndoRedoData.length>0){this._UndoRedoData=[]}}var h={old_value:a,new_value:g,row_id:c,cell_index:l};this._UndoRedoData.push(h);this._UndoRedoPos++}return true};dhtmlXGridObject.prototype.doUndo=function(){if(this._UndoRedoPos===-1){return false}var a=this._UndoRedoData[this._UndoRedoPos--];var e=this.cells(a.row_id,a.cell_index);if(this.getColType(a.cell_index)=="tree"){e.setLabel(a.old_value)}else{e.setValue(a.old_value)}this.callEvent("onUndo",[a.row_id])};dhtmlXGridObject.prototype.doRedo=function(){if(this._UndoRedoPos==this._UndoRedoData.length-1){return false}var a=this._UndoRedoData[++this._UndoRedoPos];this.cells(a.row_id,a.cell_index).setValue(a.new_value);this.callEvent("onUndo",[a.row_id])};dhtmlXGridObject.prototype.getRedo=function(){if(this._UndoRedoPos==this._UndoRedoData.length-1){return[]}return this._UndoRedoData.slice(this._UndoRedoPos+1)};dhtmlXGridObject.prototype.getUndo=function(){if(this._UndoRedoPos==-1){return[]}return this._UndoRedoData.slice(0,this._UndoRedoPos+1)};dhtmlXGridObject.prototype.enableAccessKeyMap=function(){this._select_ifpossible=function(){if(this.editor&&this.editor.obj&&this.editor.obj.select){this.editor.obj.select()}};this._key_events={k13_1_0:function(){this.editStop()},k13_0_1:function(){this._key_events.k9_0_1.call(this)},k13_0_0:function(){this._key_events.k9_0_0.call(this)},k9_0_0:function(){this.editStop();if(!this.callEvent("onTab",[true])){return true}var a=this._getNextCell(null,1);if(a){if(this.pagingOn){this.showRow(a.parentNode.idd)}this.selectCell(a.parentNode,a._cellIndex,(this.row!=a.parentNode),false,true);this._still_active=true}this._select_ifpossible()},k9_0_1:function(){this.editStop();if(!this.callEvent("onTab",[false])){return true}var a=this._getNextCell(null,-1);if(a){this.selectCell(a.parentNode,a._cellIndex,(this.row!=a.parentNode),false,true);this._still_active=true}this._select_ifpossible()},k113_0_0:function(){if(this._f2kE){this.editCell()}},k32_0_0:function(){var a=this.cells4(this.cell);if(!a.changeState||(a.changeState()===false)){return false}},k27_0_0:function(){this.editStop(true)},k33_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage-1)}else{this.scrollPage(-1)}},k34_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage+1)}else{this.scrollPage(1)}},k37_0_0:function(){if(this.editor){return false}if(this.isTreeGrid()){this.collapseKids(this.row)}else{this._key_events.k9_0_1.call(this)}},k39_0_0:function(){if(this.editor){return false}if(!this.editor&&this.isTreeGrid()){this.expandKids(this.row)}else{this._key_events.k9_0_0.call(this)}},k37_1_0:function(){if(this.editor){return false}this.selectCell(this.row,0,false,false,true);this._select_ifpossible()},k39_1_0:function(){if(this.editor){return false}this.selectCell(this.row,this._cCount-1,false,false,true);this._select_ifpossible()},k38_1_0:function(){this.selectCell(this.rowsCol[0],this.cell._cellIndex,true,false,true);this._select_ifpossible()},k40_1_0:function(){this.selectCell(this.rowsCol[this.rowsCol.length-1],this.cell._cellIndex,true,false,true);this._select_ifpossible()},k38_0_1:function(){var a=this.getRowIndex(this.row.idd);var c=this._nextRow(a,-1);if(!c||c._sRow||c._rLoad){return false}this.selectCell(c,this.cell._cellIndex,true,false,true);this._select_ifpossible()},k40_0_1:function(){var a=this.getRowIndex(this.row.idd);var c=this._nextRow(a,1);if(!c||c._sRow||c._rLoad){return false}this.selectCell(c,this.cell._cellIndex,true,false,true);this._select_ifpossible()},k38_1_1:function(){var a=this.getRowIndex(this.row.idd);for(var c=a;c>=0;c--){this.selectCell(this.rowsCol[c],this.cell._cellIndex,true,false,true)}},k40_1_1:function(){var a=this.getRowIndex(this.row.idd);for(var c=a+1;c<this.rowsCol.length;c++){this.selectCell(this.rowsCol[c],this.cell._cellIndex,true,false,true)}},k40_0_0:function(){if(this.editor&&this.editor.combo){this.editor.shiftNext()}else{if(!this.row.idd){return}var a=a=this.getRowIndex(this.row.idd)+1;if(this.rowsBuffer[a]){var c=this._nextRow(a-1,1);if(this.pagingOn&&c){this.showRow(c.idd)}this._Opera_stop=0;this.selectCell(c,this.cell._cellIndex,true,false,true)}else{if(!this.callEvent("onLastRow",[])){return false}this._key_events.k34_0_0.apply(this,[])}}this._still_active=true},k36_0_0:function(){return this._key_events.k37_1_0.call(this)},k35_0_0:function(){return this._key_events.k39_1_0.call(this)},k36_1_0:function(){if(this.editor||!this.rowsCol.length){return false}this.selectCell(this.rowsCol[0],0,true,false,true);this._select_ifpossible()},k35_1_0:function(){if(this.editor||!this.rowsCol.length){return false}this.selectCell(this.rowsCol[this.rowsCol.length-1],this._cCount-1,true,false,true);this._select_ifpossible()},k33_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage-1)}else{this.scrollPage(-1)}},k34_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage+1)}else{this.scrollPage(1)}},k38_0_0:function(){if(this.editor&&this.editor.combo){this.editor.shiftPrev()}else{if(!this.row.idd){return}var a=a=this.getRowIndex(this.row.idd)+1;if(a!=-1){var c=this._nextRow(a-1,-1);this._Opera_stop=0;if(this.pagingOn&&c){this.showRow(c.idd)}this.selectCell(c,this.cell._cellIndex,true,false,true)}else{this._key_events.k33_0_0.apply(this,[])}}this._still_active=true}}};dhtmlXGridObject.prototype.enableExcelKeyMap=function(){this._key_events={k13_1_0:function(){this.editStop()},k13_0_1:function(){this.editStop();this._key_events.k38_0_0.call(this)},k13_0_0:function(){this.editStop();this.callEvent("onEnter",[(this.row?this.row.idd:null),(this.cell?this.cell._cellIndex:null)]);this._still_active=true;this._key_events.k40_0_0.call(this)},k9_0_0:function(){this.editStop();if(!this.callEvent("onTab",[true])){return true}if(this.cell&&(this.cell._cellIndex+1)>=this._cCount){return}var a=this._getNextCell(null,1);if(a&&this.row==a.parentNode){this.selectCell(a.parentNode,a._cellIndex,true);this._still_active=true}},k9_0_1:function(){this.editStop();if(!this.callEvent("onTab",[false])){return true}if(this.cell&&(this.cell._cellIndex==0)){return}var a=this._getNextCell(null,-1);if(a&&this.row==a.parentNode){this.selectCell(a.parentNode,a._cellIndex,true);this._still_active=true}},k113_0_0:function(){if(this._f2kE){this.editCell()}},k32_0_0:function(){var a=this.cells4(this.cell);if(!a.changeState||(a.changeState()===false)){return false}},k27_0_0:function(){this.editStop(true);this._still_active=true},k33_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage-1)}else{this.scrollPage(-1)}},k34_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage+1)}else{this.scrollPage(1)}},k37_0_0:function(){if(this.editor){return false}if(this.isTreeGrid()){this.collapseKids(this.row)}else{this._key_events.k9_0_1.call(this)}},k39_0_0:function(){if(this.editor){return false}if(!this.editor&&this.isTreeGrid()){this.expandKids(this.row)}else{this._key_events.k9_0_0.call(this)}},k37_1_0:function(){if(this.editor){return false}this.selectCell(this.row,0,true)},k39_1_0:function(){if(this.editor){return false}this.selectCell(this.row,this._cCount-1,true)},k38_1_0:function(){if(this.editor||!this.rowsCol.length){return false}this.selectCell(this.rowsCol[0],this.cell._cellIndex,true)},k40_1_0:function(){if(this.editor||!this.rowsCol.length){return false}this.selectCell(this.rowsCol[this.rowsCol.length-1],this.cell._cellIndex,true)},k38_0_1:function(){if(this.editor||!this.rowsCol.length){return false}var a=this.row.rowIndex;var c=this._nextRow(a-1,-1);if(!c||c._sRow||c._rLoad){return false}this.selectCell(c,this.cell._cellIndex,true,true)},k40_0_1:function(){if(this.editor||!this.rowsCol.length){return false}var a=this.row.rowIndex;var c=this._nextRow(a-1,1);if(!c||c._sRow||c._rLoad){return false}this.selectCell(c,this.cell._cellIndex,true,true)},k38_1_1:function(){if(this.editor||!this.rowsCol.length){return false}var a=this.row.rowIndex;for(var c=a-1;c>=0;c--){this.selectCell(this.rowsCol[c],this.cell._cellIndex,true,true)}},k40_1_1:function(){if(this.editor||!this.rowsCol.length){return false}var a=this.row.rowIndex;for(var c=a;c<this.rowsCol.length;c++){this.selectCell(this.rowsCol[c],this.cell._cellIndex,true,true)}},k40_0_0:function(){var c=this._realfake?this._fake:this;if(this.editor&&this.editor.combo){this.editor.shiftNext()}else{if(this.editor){return false}var a=Math.max((c._r_select||0),this.getRowIndex(this.row.idd));var e=this._nextRow(a,1);if(e){c._r_select=null;this.selectCell(e,this.cell._cellIndex,true);if(c.pagingOn){c.showRow(e.idd)}}else{if(!this.callEvent("onLastRow",[])){return false}this._key_events.k34_0_0.apply(this,[])}}},k36_0_0:function(){return this._key_events.k37_1_0.call(this)},k35_0_0:function(){return this._key_events.k39_1_0.call(this)},k36_1_0:function(){if(this.editor||!this.rowsCol.length){return false}this.selectCell(this.rowsCol[0],0,true)},k35_1_0:function(){if(this.editor||!this.rowsCol.length){return false}this.selectCell(this.rowsCol[this.rowsCol.length-1],this._cCount-1,true)},k33_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage-1)}else{this.scrollPage(-1)}},k34_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage+1)}else{this.scrollPage(1)}},k38_0_0:function(){var c=this._realfake?this._fake:this;if(this.editor&&this.editor.combo){this.editor.shiftPrev()}else{if(this.editor){return false}if(!this.row.idd){return}var a=this.getRowIndex(this.row.idd)+1;if(a!=-1&&(!this.pagingOn||(a!=1))){var e=this._nextRow(a-1,-1);this.selectCell(e,this.cell._cellIndex,true);if(c.pagingOn&&e){c.showRow(e.idd)}}else{this._key_events.k33_0_0.apply(this,[])}}},k_other:function(e){if(this.editor){return false}if(!e.ctrlKey&&e.keyCode>=40&&(e.keyCode<91||(e.keyCode>95&&e.keyCode<111)||e.keyCode>187)){if(this.cell){var g=this.cells4(this.cell);if(g.isDisabled()){return false}var a=g.getValue();if(g.editable!==false){g.setValue("")}this.editCell();if(this.editor){this.editor.val=a;if(this.editor.obj&&this.editor.obj.select){this.editor.obj.select()}}else{g.setValue(a)}}}}}};function eXcell_time(a){this.base=eXcell_ed;this.base(a);this.getValue=function(){return this.cell.innerHTML.toString()};this.setValue=function(l){var h=new RegExp(" ","i");l=l.replace(h,":");if((l=="")){l="00:00"}else{var h=new RegExp("[a-zA-Z]","i");var g=l.match(h);if(g){l="00:00"}else{var h=new RegExp("[0-9]+[\\.\\/;\\-,_\\]\\[\\?\\: ][0-9]+","i");var g=l.search(h);if(g!=-1){var h=new RegExp("[\\./\\;\\-\\,\\_\\]\\[ \\?]","i");l=l.replace(h,":")}else{var h=new RegExp("[^0-9]","i");res1=l.search(h);if(g=l.match(h)){l="00:00"}else{if(l.length==1){l="00:0"+l}else{if(parseInt(l)<60){l="00:"+l}else{if(l.length<5){var e=parseInt(l);var c=Math.floor(e/60);e=e-60*c;var c=c.toString();var e=e.toString();while(c.length<2){c="0"+c}while(e.length<2){e="0"+e}l=c+":"+e}}}}}}}this.cell.innerHTML=l}}eXcell_time.prototype=new eXcell_ed;function eXcell_sub_row(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.getValue=function(){return this.grid.getUserData(this.cell.parentNode.idd,"__sub_row")};this._setState=function(c,e){(e||this.cell).innerHTML="<img src='"+this.grid.imgURL+c+"' width='18' height='18' />";(e||this.cell).firstChild.onclick=this.grid._expandMonolite};this.open=function(){this.cell.firstChild.onclick(null,true)};this.close=function(){this.cell.firstChild.onclick(null,false,true)};this.isOpen=function(){return !!this.cell.parentNode._expanded};this.setValue=function(c){if(c){this.grid.setUserData(this.cell.parentNode.idd,"__sub_row",c)}this._setState(c?"plus.gif":"blank.gif")};this.setContent=function(c){if(this.cell.parentNode._expanded){this.cell.parentNode._expanded.innerHTML=c;this.resize()}else{this.cell._previous_content=null;this.setValue(c);this.cell._sub_row_type=null}};this.resize=function(){this.grid._detectHeight(this.cell.parentNode._expanded,this.cell,this.cell.parentNode._expanded.scrollHeight)},this.isDisabled=function(){return true};this.getTitle=function(){return this.grid.getUserData(this.cell.parentNode.idd,"__sub_row")?"click to expand|collapse":""}}eXcell_sub_row.prototype=new eXcell;function eXcell_sub_row_ajax(a){this.base=eXcell_sub_row;this.base(a);this.setValue=function(c){if(c){this.grid.setUserData(this.cell.parentNode.idd,"__sub_row",c)}this.cell._sub_row_type="ajax";this.cell._previous_content=null;this._setState(c?"plus.gif":"blank.gif")}}eXcell_sub_row_ajax.prototype=new eXcell_sub_row;function eXcell_sub_row_grid(a){this.base=eXcell_sub_row;this.base(a);this.setValue=function(c){if(c){this.grid.setUserData(this.cell.parentNode.idd,"__sub_row",c)}this.cell._sub_row_type="grid";this._setState(c?"plus.gif":"blank.gif")};this.getSubGrid=function(){if(!a._sub_grid){return null}return a._sub_grid}}eXcell_sub_row_grid.prototype=new eXcell_sub_row;dhtmlXGridObject.prototype._expandMonolite=function(a,s,l){var e=this.parentNode;var u=e.parentNode;var o=u.grid;if(a||window.event){if(!l&&!u._expanded){o.editStop()}(a||event).cancelBubble=true}var r=o.getUserData(u.idd,"__sub_row");if(!o._sub_row_editor){o._sub_row_editor=new eXcell_sub_row(e)}if(!r){return}if(u._expanded&&!s){o._sub_row_editor._setState("plus.gif",e);e._previous_content=u._expanded;o.objBox.removeChild(u._expanded);u._expanded=false;u.style.height=(u.oldHeight||20)+"px";e.style.height=(u.oldHeight||20)+"px";if(o._fake){o._fake.rowsAr[u.idd].style.height=(u.oldHeight||20)+"px";o._fake.rowsAr[u.idd].firstChild.style.height=(u.oldHeight||20)+"px"}for(var h=0;h<u.cells.length;h++){u.cells[h].style.verticalAlign="middle"}delete o._flow[u.idd];o._correctMonolite();u._expanded.ctrl=null}else{if(!u._expanded&&!l){o._sub_row_editor._setState("minus.gif",e);u.oldHeight=e.offsetHeight-4;if(e._previous_content){var q=e._previous_content;q.ctrl=e;o.objBox.appendChild(q);o._detectHeight(q,e,parseInt(q.style.height))}else{var q=document.createElement("DIV");q.ctrl=e;if(e._sub_row_type){o._sub_row_render[e._sub_row_type](o,q,e,r)}else{q.innerHTML=r}q.style.cssText="position:absolute; left:0px; top:0px; overflow:auto; font-family:Tahoma; font-size:8pt; margin-top:2px; margin-left:4px;";q.className="dhx_sub_row";o.objBox.appendChild(q);o._detectHeight(q,e)}if(!o._flow){o.attachEvent("onGridReconstructed",function(){if((this.pagingOn&&!this.parentGrid)||this._srnd){this._collapsMonolite()}else{this._correctMonolite()}});o.attachEvent("onResizeEnd",function(){this._correctMonolite(true)});o.attachEvent("onAfterCMove",function(){this._correctMonolite(true)});o.attachEvent("onDrop",function(){this._correctMonolite(true)});o.attachEvent("onBeforePageChanged",function(){this._collapsMonolite();return true});o.attachEvent("onGroupStateChanged",function(){this._correctMonolite();return true});o.attachEvent("onFilterEnd",function(){this._collapsMonolite()});o.attachEvent("onUnGroup",function(){this._collapsMonolite()});o.attachEvent("onPageChanged",function(){this._collapsMonolite()});o.attachEvent("onXLE",function(){this._collapsMonolite()});o.attachEvent("onClearAll",function(){for(var c in this._flow){if(this._flow[c]&&this._flow[c].parentNode){this._flow[c].parentNode.removeChild(this._flow[c])}}this._flow=[]});o.attachEvent("onEditCell",function(v,n,w){if((v!==2)&&this._flow[n]&&this.cellType[w]!="ch"&&this.cellType[w]!="ra"){this._expandMonolite.apply(this._flow[n].ctrl.firstChild,[0,false,true])}return true});o.attachEvent("onCellChanged",function(w,n){if(!this._flow[w]){return}var v=this.cells(w,n).cell;v.style.verticalAlign="top"});o._flow=[]}o._flow[u.idd]=q;o._correctMonolite();var m=o._srdh>30?11:3;if(o.multiLine){m=0}for(var h=0;h<u.cells.length;h++){u.cells[h].style.verticalAlign="top"}if(o._fake){var g=o._fake.rowsAr[u.idd];for(var h=0;h<g.cells.length;h++){g.cells[h].style.verticalAlign="top"}}u._expanded=q}}if(o._ahgr){o.setSizes()}if(o.parentGrid){o.callEvent("onGridReconstructed",[])}o.callEvent("onSubRowOpen",[u.idd,(!!u._expanded)])};dhtmlXGridObject.prototype._sub_row_render={ajax:function(that,d,td,c){d.innerHTML="Loading...";dhx4.ajax.get(c,function(xml){d.innerHTML=xml.xmlDoc.responseText;var z=xml.xmlDoc.responseText.match(/<script[^>]*>([^\f]+?)<\/script>/g);if(z){for(var i=0;i<z.length;i++){eval(z[i].replace(/<([\/]{0,1})s[^>]*>/g,""))}}that._detectHeight(d,td);that._correctMonolite();that.setUserData(td.parentNode.idd,"__sub_row",xml.xmlDoc.responseText);td._sub_row_type=null;if(that._ahgr){that.setSizes()}that.callEvent("onSubAjaxLoad",[td.parentNode.idd,xml.xmlDoc.responseText])})},grid:function(a,e,h,g){h._sub_grid=new dhtmlXGridObject(e);if(a.skin_name){h._sub_grid.setSkin(a.skin_name)}h._sub_grid.parentGrid=a;h._sub_grid.imgURL=a.imgURL;h._sub_grid.iconURL=a.iconURL;h._sub_grid.enableAutoHeight(true);h._sub_grid._delta_x=h._sub_grid._delta_y=null;h._sub_grid.attachEvent("onGridReconstructed",function(){a._detectHeight(e,h,h._sub_grid.objBox.scrollHeight+h._sub_grid.hdr.offsetHeight+(this.ftr?this.ftr.offsetHeight:0));a._correctMonolite();this.setSizes();if(a.parentGrid){a.callEvent("onGridReconstructed",[])}});if(!a.callEvent("onSubGridCreated",[h._sub_grid,h.parentNode.idd,h._cellIndex,g])){h._sub_grid.objBox.style.overflow="hidden";h._sub_row_type=null}else{h._sub_grid.loadXML(g,function(){a._detectHeight(e,h,h._sub_grid.objBox.scrollHeight+h._sub_grid.hdr.offsetHeight+(h._sub_grid.ftr?h._sub_grid.ftr.offsetHeight:0));h._sub_grid.objBox.style.overflow="hidden";a._correctMonolite();h._sub_row_type=null;if(!a.callEvent("onSubGridLoaded",[h._sub_grid,h.parentNode.idd,h._cellIndex,g])){return}if(a._ahgr){a.setSizes()}})}}};dhtmlXGridObject.prototype._detectHeight=function(m,n,c){var a=n.offsetLeft+n.offsetWidth;m.style.left=a+"px";m.style.width=Math.max(0,n.parentNode.offsetWidth-a-4)+"px";var c=c||m.scrollHeight;m.style.overflow="hidden";m.style.height=c+"px";var g=n.parentNode;n.parentNode.style.height=(g.oldHeight||20)+c*1+"px";n.style.height=(g.oldHeight||20)+c*1+"px";if(this._fake){var e=this._fake.rowsAr[n.parentNode.idd];e.style.height=(g.oldHeight||20)+c*1+"px";e.firstChild.style.height=(g.oldHeight||20)+c*1+"px"}};dhtmlXGridObject.prototype._correctMonolite=function(g){if(this._in_correction){return}this._in_correction=true;for(var e in this._flow){if(this._flow[e]&&this._flow[e].tagName=="DIV"){if(this.rowsAr[e]){if(this.rowsAr[e].style.display=="none"){this.cells4(this._flow[e].ctrl).close();continue}this._flow[e].style.top=this.rowsAr[e].offsetTop+(this.rowsAr[e].oldHeight||20)+"px";if(g){var c=this._flow[e].ctrl.offsetLeft+this._flow[e].ctrl.offsetWidth;this._flow[e].style.left=c+"px";this._flow[e].style.width=this.rowsAr[e].offsetWidth-c-4+"px"}}else{this._flow[e].ctrl=null;this.objBox.removeChild(this._flow[e]);delete this._flow[e]}}}this._in_correction=false};dhtmlXGridObject.prototype._collapsMonolite=function(){for(var c in this._flow){if(this._flow[c]&&this._flow[c].tagName=="DIV"){if(this.rowsAr[c]){this.cells4(this._flow[c].ctrl).close()}}}};function eXcell_ra_str(a){if(a){this.base=eXcell_ra;this.base(a);this.grid=a.parentNode.grid}}eXcell_ra_str.prototype=new eXcell_ch;eXcell_ra_str.prototype.setValue=function(e){this.cell.style.verticalAlign="middle";if(e){e=e.toString()._dhx_trim();if((e=="false")||(e=="0")){e=""}}if(e){if(this.grid.rowsAr[this.cell.parentNode.idd]){for(var c=0;c<this.grid._cCount;c++){if(c!==this.cell._cellIndex){var a=this.grid.cells(this.cell.parentNode.idd,c);if((a.cell._cellType||this.grid.cellType[a.cell._cellIndex])!="ra_str"){continue}if(a.getValue()){a.setValue("0")}}}}e="1";this.cell.chstate="1"}else{e="0";this.cell.chstate="0"}this.setCValue("<img src='"+this.grid.imgURL+"radio_chk"+e+".gif' onclick='new eXcell_ra_str(this.parentNode).changeState()'>",this.cell.chstate)};dhx4.attachEvent("onGridCreated",function(c){if(!window.dhx_globalImgPath){window.dhx_globalImgPath=c.imgURL}c._col_combos=[];for(var a=0;a<c._cCount;a++){if(c.cellType[a].indexOf("combo")==0){c._col_combos[a]=eXcell_combo.prototype.initCombo.call({grid:c},a)}}if(!c._loading_handler_set){c._loading_handler_set=c.attachEvent("onXLE",function(g,e,l,h){eXcell_combo.prototype.fillColumnCombos(this,h);this.detachEvent(this._loading_handler_set);this._loading_handler_set=null})}});function eXcell_combo(a){if(!a){return}this.cell=a;this.grid=a.parentNode.grid;this._combo_pre="";this.edit=function(){if(!window.dhx_globalImgPath){window.dhx_globalImgPath=this.grid.imgURL}this.val=this.getValue();var c=this.getText();if(this.cell._clearCell){c=""}this.cell.innerHTML="";if(!this.cell._brval){this.combo=(this.grid._realfake?this.grid._fake:this.grid)._col_combos[this.cell._cellIndex]}else{this.combo=this.cell._brval}this.cell.appendChild(this.combo.DOMParent);this.combo.DOMParent.style.margin="0";this.combo.DOMelem_input.focus();this.combo.setSize(this.cell.offsetWidth-2);if(!this.combo._xml){if(this.combo.getIndexByValue(this.cell.combo_value)!=-1){this.combo.selectOption(this.combo.getIndexByValue(this.cell.combo_value))}else{if(this.combo.getOptionByLabel(c)){this.combo.selectOption(this.combo.getIndexByValue(this.combo.getOptionByLabel(c).value))}else{this.combo.setComboText(c)}}}else{this.combo.setComboText(c)}this.combo.openSelect()};this.selectComboOption=function(e,c){c.selectOption(c.getIndexByValue(c.getOptionByLabel(e).value))};this.getValue=function(c){return this.cell.combo_value||""};this.getText=function(e){var g=this.cell;if(this._combo_pre==""&&g.childNodes[1]){g=g.childNodes[1]}else{g.childNodes[0].childNodes[1]}return(_isIE?g.innerText:g.textContent)};this.setValue=function(h){if(typeof(h)=="object"){this.cell._brval=this.initCombo();var e=this.cell._cellIndex;var g=this.cell.parentNode.idd;if(!h.firstChild){this.cell.combo_value="&nbsp;";this.cell._clearCell=true}else{this.cell.combo_value=h.firstChild.data}this.setComboOptions(this.cell._brval,h,this.grid,e,g)}else{this.cell.combo_value=h;var c=null;if((c=this.cell._brval)&&(typeof(this.cell._brval)=="object")){h=(c.getOption(h)||{}).text||h}else{if(c=this.grid._col_combos[this.cell._cellIndex]||((this.grid._fake)&&(c=this.grid._fake._col_combos[this.cell._cellIndex]))){h=(c.getOption(h)||{}).text||h}}if((h||"").toString()._dhx_trim()==""){h=null}if(h!==null){this.setComboCValue(h)}else{this.setComboCValue("&nbsp;","");this.cell._clearCell=true}}};this.detach=function(){var c=this.combo.getParent();if(c.parentNode==this.cell){this.cell.removeChild(c)}else{return false}var e=this.cell.combo_value;if(!this.combo.getComboText()||this.combo.getComboText().toString()._dhx_trim()==""){this.setComboCValue("&nbsp;");this.cell._clearCell=true}else{this.setComboCValue(this.combo.getComboText().replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),this.combo.getActualValue());this.cell._clearCell=false}this.combo._confirmSelect();this.cell.combo_value=this.combo.getActualValue();this.combo.closeAll();this.grid._still_active=true;this.grid.setActive(1);return e!=this.cell.combo_value}}eXcell_combo.prototype=new eXcell;eXcell_combo_v=function(a){var c=new eXcell_combo(a);c._combo_pre="<img src='"+(window.dhx_globalImgPath?window.dhx_globalImgPath:this.grid.imgURL)+"combo_select"+(dhtmlx.skin?"_"+dhtmlx.skin:"")+".gif' class='dhxgrid_combo_icon'/>";return c};eXcell_combo.prototype.initCombo=function(c){var a=document.createElement("DIV");a.className="dhxcombo_in_grid_parent";var g=this.grid.defVal[arguments.length?c:this.cell._cellIndex];var h=new dhtmlXCombo(a,"combo",0,g);this.grid.defVal[arguments.length?c:this.cell._cellIndex]="";var e=this.grid;h.DOMelem.onmousedown=h.DOMelem.onclick=function(l){l=l||event;l.cancelBubble=true};h.DOMelem.onselectstart=function(l){l=l||event;l.cancelBubble=true;return true};h.attachEvent("onKeyPressed",function(l){if(l==13||l==27){e.editStop();if(e._fake){e._fake.editStop()}}});return h};eXcell_combo.prototype.fillColumnCombos=function(e,a){if(!a){return}var g=dhx4.ajax.xmltop("rows",a,-1);if(g&&g.tagName!=="DIV"){e.combo_columns=e.combo_columns||[];columns=dhx4.ajax.xpath("//column",g);for(var c=0;c<columns.length;c++){if((columns[c].getAttribute("type")||"").indexOf("combo")==0){e.combo_columns[e.combo_columns.length]=c;this.setComboOptions(e._col_combos[c],columns[c],e,c)}}}};eXcell_combo.prototype.setComboCValue=function(e,c){if(this._combo_pre!=""){var a=(this.cell.offsetHeight?this.cell.offsetHeight+"px":0);e="<div style='width:100%;position:relative;height:100%;overflow:hidden;'>"+this._combo_pre+"<span>"+e+"</span></div>"}if(arguments.length>1){this.setCValue(e,c)}else{this.setCValue(e)}};eXcell_combo.prototype.setComboOptions=function(l,m,e,q,s){if(window.dhx4.s2b(m.getAttribute("xmlcontent"))){if(!m.getAttribute("source")){options=m.childNodes;var a=[];for(var n=0;n<options.length;n++){if(options[n].tagName=="option"){var g=options[n].firstChild?options[n].firstChild.data:"";a[a.length]=[options[n].getAttribute("value"),g]}}l.addOption(a);if(arguments.length==4){e.forEachRowA(function(v){var u=e.cells(v,q);if(!u.cell._brval&&!u.cell._cellType&&(u.cell._cellIndex==q)){if(u.cell.combo_value==""){u.setComboCValue("&nbsp;","")}else{if(!l.getOption(u.cell.combo_value)){u.setComboCValue(u.cell.combo_value)}else{u.setComboCValue(l.getOption(u.cell.combo_value).text,u.cell.combo_value)}}}})}else{var r=(this.cell)?this:e.cells(s,q);if(m.getAttribute("text")){if(m.getAttribute("text")._dhx_trim()==""){r.setComboCValue("&nbsp;","")}else{r.setComboCValue(m.getAttribute("text"))}}else{if((!r.cell.combo_value)||(r.cell.combo_value._dhx_trim()=="")){r.setComboCValue("&nbsp;","")}else{if(!l.getOption(r.cell.combo_value)){r.setComboCValue(r.cell.combo_value)}else{r.setComboCValue(l.getOption(r.cell.combo_value).text,r.cell.combo_value)}}}}}}if(m.getAttribute("source")){if(m.getAttribute("auto")&&window.dhx4.s2b(m.getAttribute("auto"))){if(m.getAttribute("xmlcontent")){var r=(this.cell)?this:e.cells(s,q);if(m.getAttribute("text")){r.setComboCValue(m.getAttribute("text"))}}else{e.forEachRowA(function(x){var w=e.cells(x,q);if(!w.cell._brval&&!w.cell._cellType){var v=w.cell.combo_value.toString();if(v.indexOf("^")!=-1){var u=v.split("^");w.cell.combo_value=u[0];w.setComboCValue(u[1])}}})}l.enableFilteringMode(true,m.getAttribute("source"),window.dhx4.s2b(m.getAttribute("cache")||true),window.dhx4.s2b(m.getAttribute("sub")||false))}else{var o=this;var h=arguments.length;l.load(m.getAttribute("source"),function(){if(h==4){e.forEachRow(function(w){var v=e.cells(w,q);if(!v.cell._brval&&!v.cell._cellType){if(l.getOption(v.cell.combo_value)){v.setComboCValue(l.getOption(v.cell.combo_value).text,v.cell.combo_value)}else{if((v.cell.combo_value||"").toString()._dhx_trim()==""){v.setComboCValue("&nbsp;","");v.cell._clearCell=true}else{v.setComboCValue(v.cell.combo_value)}}}})}else{var u=e.cells(s,q);if(l.getOption(u.cell.combo_value)){u.setComboCValue(l.getOption(u.cell.combo_value).text,u.cell.combo_value)}else{u.setComboCValue(u.cell.combo_value)}}})}}if(!m.getAttribute("auto")||!window.dhx4.s2b(m.getAttribute("auto"))){if(m.getAttribute("editable")&&!window.dhx4.s2b(m.getAttribute("editable"))){l.readonly(true)}if(m.getAttribute("filter")&&window.dhx4.s2b(m.getAttribute("filter"))){l.enableFilteringMode(true)}}};eXcell_combo.prototype.getCellCombo=function(){if(this.cell._brval){return this.cell._brval}this.cell._brval=this.initCombo();return this.cell._brval};eXcell_combo.prototype.refreshCell=function(){this.setValue(this.getValue())};dhtmlXGridObject.prototype.getColumnCombo=function(a){if(this._col_combos&&this._col_combos[a]){return this._col_combos[a]}if(!this._col_combos){this._col_combos=[]}this._col_combos[a]=eXcell_combo.prototype.initCombo.call({grid:this},a);return this._col_combos[a]};dhtmlXGridObject.prototype.refreshComboColumn=function(a){this.forEachRow(function(c){if(this.cells(c,a).refreshCell){this.cells(c,a).refreshCell()}})};function eXcell_clist(a){try{this.cell=a;this.grid=this.cell.parentNode.grid}catch(c){}this.edit=function(){this.val=this.getValue();var g=(this.cell._combo||this.grid.clists[this.cell._cellIndex]);if(!g){return}this.obj=document.createElement("DIV");var e=this.val.split(",");var o="";for(var m=0;m<g.length;m++){var n=false;for(var h=0;h<e.length;h++){if(g[m]==e[h]){n=true}}if(n){o+="<div><input type='checkbox' id='dhx_clist_"+m+"' checked='true' /><label for='dhx_clist_"+m+"'>"+g[m]+"</label></div>"}else{o+="<div><input type='checkbox' id='dhx_clist_"+m+"'/><label for='dhx_clist_"+m+"'>"+g[m]+"</label></div>"}}o+="<div><input type='button' value='"+(this.grid.applyButtonText||"Apply")+"' style='width:100px; font-size:8pt;' onclick='this.parentNode.parentNode.editor.grid.editStop();'/></div>";this.obj.editor=this;this.obj.innerHTML=o;document.body.appendChild(this.obj);this.obj.style.position="absolute";this.obj.className="dhx_clist";this.obj.onclick=function(q){(q||event).cancelBubble=true;return true};var l=this.grid.getPosition(this.cell);this.obj.style.left=l[0]+"px";this.obj.style.top=l[1]+this.cell.offsetHeight+"px";this.obj.getValue=function(){var r="";for(var q=0;q<this.childNodes.length-1;q++){if(this.childNodes[q].childNodes[0].checked){if(r){r+=", "}r+=this.childNodes[q].childNodes[1].innerHTML}}return r.replace(/&amp;/g,"&")}};this.getValue=function(){if(this.cell._clearCell){return""}return this.cell.innerHTML.toString()._dhx_trim().replace(/&amp;/g,"&").replace(/, /g,",")};this.detach=function(e){if(this.obj){this.setValue(this.obj.getValue());this.obj.editor=null;this.obj.parentNode.removeChild(this.obj);this.obj=null}return this.val!=this.getValue()}}eXcell_clist.prototype=new eXcell;eXcell_clist.prototype.setValue=function(e){if(typeof(e)=="object"){var c=dhx4.ajax.xpath("./option",e);if(c.length){this.cell._combo=[]}for(var a=0;a<c.length;a++){this.cell._combo.push(c[a].firstChild?c[a].firstChild.data:"")}e=e.firstChild.data}if(e===""||e===this.undefined){this.setCTxtValue(" ",e);this.cell._clearCell=true}else{e=e.replace(/,[ ]*/g,", ");this.setCTxtValue(e);this.cell._clearCell=false}};dhtmlXGridObject.prototype.registerCList=function(a,c){if(!this.clists){this.clists=new Array()}if(typeof(c)!="object"){c=c.split(",")}this.clists[a]=c};function eXcell_calck(a){try{this.cell=a;this.grid=this.cell.parentNode.grid}catch(c){}this.edit=function(){this.val=this.getValue();var e=this.grid.getPosition(this.cell);this.obj=new calcX(e[0],e[1]+this.cell.offsetHeight,this,this.val)};this.getValue=function(){return this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex)};this.detach=function(){if(this.obj){this.setValue(this.obj.inputZone.value);this.obj.removeSelf()}this.obj=null;return this.val!=this.getValue()}}eXcell_calck.prototype=new eXcell;eXcell_calck.prototype.setValue=function(a){if(!a||a.toString()._dhx_trim()==""){a="0"}this.setCValue(this.grid._aplNF(a,this.cell._cellIndex),a)};function calcX(left,top,onReturnSub,val){this.top=top||0;this.left=left||0;this.onReturnSub=onReturnSub||null;this.operandA=0;this.operandB=0;this.operatorA="";this.state=0;this.dotState=0;this.calckGo=function(){return(eval(this.operandA+"*1"+this.operatorA+this.operandB+"*1"))};this.isNumeric=function(str){return((str.search(/[^1234567890]/gi)==-1)?(true):(false))};this.isOperation=function(str){return((str.search(/[^\+\*\-\/]/gi)==-1)?(true):(false))};this.onCalcKey=function(e){that=this.calk;var z=this.innerHTML;var rZone=that.inputZone;if(((that.state==0)||(that.state==2))&&(that.isNumeric(z))){if(rZone.value!="0"){rZone.value+=z}else{rZone.value=z}}if((((that.state==0)||(that.state==2))&&(z=="."))&&(that.dotState==0)){that.dotState=1;rZone.value+=z}if((z=="C")){rZone.value=0;that.dotState=0;that.state=0}if((that.state==0)&&(that.isOperation(z))){that.operatorA=z;that.operandA=rZone.value;that.state=1}if((that.state==2)&&(that.isOperation(z))){that.operandB=rZone.value;rZone.value=that.calckGo();that.operatorA=z;that.operandA=rZone.value;that.state=1}if((that.state==2)&&(z=="=")){that.operandB=rZone.value;rZone.value=that.calckGo();that.operatorA=z;that.operandA=rZone.value;that.state=3}if((that.state==1)&&(that.isNumeric(z))){rZone.value=z;that.state=2;that.dotState=0}if((that.state==3)&&(that.isNumeric(z))){rZone.value=z;that.state=0}if((that.state==3)&&(that.isOperation(z))){that.operatorA=z;that.operandA=rZone.value;that.state=1}if(z=="e"){rZone.value=Math.E;if(that.state==1){that.state=2}that.dotState=0}if(z=="p"){rZone.value=Math.PI;if(that.state==1){that.state=2}that.dotState=0}if(z=="Off"){that.topNod.parentNode.removeChild(that.topNod)}if(e||event){(e||event).cancelBubble=true}};this.sendResult=function(){that=this.calk;if(that.state==2){var rZone=that.inputZone;that.operandB=rZone.value;rZone.value=that.calckGo();that.operatorA=z;that.operandA=rZone.value;that.state=3}var z=that.inputZone.value;that.topNod.parentNode.removeChild(that.topNod);that.onReturnSub.grid.editStop(false)};this.removeSelf=function(){if(this.topNod.parentNode){this.topNod.parentNode.removeChild(this.topNod)}};this.keyDown=function(){this.className="calcPressed"};this.keyUp=function(){this.className="calcButton"};this.init_table=function(){var table=this.topNod.childNodes[0];if((!table)||(table.tagName!="TABLE")){return}for(i=1;i<table.childNodes[0].childNodes.length;i++){for(j=0;j<table.childNodes[0].childNodes[i].childNodes.length;j++){table.childNodes[0].childNodes[i].childNodes[j].onclick=this.onCalcKey;table.childNodes[0].childNodes[i].childNodes[j].onmousedown=this.keyDown;table.childNodes[0].childNodes[i].childNodes[j].onmouseout=this.keyUp;table.childNodes[0].childNodes[i].childNodes[j].onmouseup=this.keyUp;table.childNodes[0].childNodes[i].childNodes[j].calk=this}}this.inputZone=this.topNod.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0];if(this.onReturnSub){this.topNod.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1].onclick=this.sendResult;this.topNod.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1].calk=this}else{this.topNod.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1].innerHTML=""}};this.drawSelf=function(){var div=document.createElement("div");div.className="calcTable";div.style.position="absolute";div.style.top=this.top+"px";div.style.left=this.left+"px";div.innerHTML="<table cellspacing='0' id='calc_01' class='calcTable'><tr><td colspan='4'><table cellpadding='1' cellspacing='0' width='100%'><tr><td width='100%' style='overflow:hidden;'><input style='width:100%' class='calcInput' value='0' align='right' readonly='true' style='text-align:right'></td><td class='calkSubmit'>=</td></tr></table></td></tr><tr><td class='calcButton' width='25%'>Off</td><td class='calcButton' width='25%'>p</td><td class='calcButton' width='25%'>e</td><td class='calcButton' width='25%'>/</td></tr><tr><td class='calcButton'>7</td><td class='calcButton'>8</td><td class='calcButton'>9</td><td class='calcButton'>*</td></tr><tr><td class='calcButton'>4</td><td class='calcButton'>5</td><td class='calcButton'>6</td><td class='calcButton'>+</td></tr><tr><td class='calcButton'>1</td><td class='calcButton'>2</td><td class='calcButton'>3</td><td class='calcButton'>-</td></tr><tr><td class='calcButton'>0</td><td class='calcButton'>.</td><td class='calcButton'>C</td><td class='calcButton'>=</td></tr></table>";div.onclick=function(e){(e||event).cancelBubble=true};document.body.appendChild(div);this.topNod=div};this.drawSelf();this.init_table();if(val){var rZone=this.inputZone;rZone.value=val*1;this.operandA=val*1;this.state=3}return this}dhtmlXGridObject.prototype._updateTGRState=function(a){if(!a.update||a.id==0){return}if(this.rowsAr[a.id].imgTag){this.rowsAr[a.id].imgTag.src=this.iconTree+a.state+".gif"}a.update=false};dhtmlXGridObject.prototype.doExpand=function(c){this.editStop();var e=c.parentNode.parentNode.parentNode;var a=this._h2.get[e.idd];if(!this.callEvent("onOpen",[e.idd,(a.state=="plus"?-1:1)])){return}if(a.state=="plus"){this.expandKids(e)}else{if((a.state=="minus")&&(!a._closeable)){this.collapseKids(e)}}};dhtmlXGridObject.prototype._createHierarchy=function(){if(!this._emptyLineImg){this._emptyLineImg="blank"}return new dhtmlxHierarchy({_emptyLineImg:this._emptyLineImg})};function dhtmlxHierarchy(a){var c={id:0,childs:[],level:-1,parent:null,index:0,state:a._emptyLineImg};this.order=[c];this.get={"0":c};this.swap=function(g,e){var h=g.parent;var l=g.index;h.childs[l]=e;h.childs[e.index]=g;g.index=e.index;e.index=l};this.forEachChildF=function(n,e,l,g){var m=this.get[n];for(var h=0;h<m.childs.length;h++){if(!e.apply((l||this),[m.childs[h]])){continue}if(m.childs[h].childs.length){this.forEachChildF(m.childs[h].id,e,l,g)}if(g){g.call((l||this),m.childs[h])}}};this.forEachChild=function(m,e,h){var l=this.get[m];for(var g=0;g<l.childs.length;g++){e.apply((h||this),[l.childs[g]]);if(l.childs[g].childs.length){this.forEachChild(l.childs[g].id,e,h)}}};this.change=function(l,e,h){var g=this.get[l];if(g[e]==h){return}g[e]=h;g.update=true};this.add=function(g,e){return this.addAfter(g,e)};this.addAfter=function(q,o,h,g){var n=this.get[o||0];if(h){var m=this.get[h].index+(g?0:1)}else{var m=n.childs.length}var e={id:q,childs:[],level:n.level+1,parent:n,index:m,state:a._emptyLineImg};if(n.state==a._emptyLineImg){this.change(o,"state",(o==0?"minus":"plus"))}if(h){for(var l=m;l<n.childs.length;l++){n.childs[l].index++}n.childs=n.childs.slice(0,m).concat([e]).concat(n.childs.slice(m,n.childs.length))}else{n.childs.push(e)}this.get[q]=e;return e};this.addBefore=function(h,g,e){return this.addAfter(h,g,e,true)};this.remove=function(h){var g=this.get[h||0];for(var e=0;e<g.childs.length;e++){this.deleteAll(g.childs[e].id)}g.childs=[];g.parent.childs=g.parent.childs.slice(0,g.index).concat(g.parent.childs.slice(g.index+1));for(var e=g.index;e<g.parent.childs.length;e++){g.parent.childs[e].index--}delete this.get[h]};this.deleteAll=function(h){var g=this.get[h||0];for(var e=0;e<g.childs.length;e++){this.deleteAll(g.childs[e].id)}g.childs=[];delete this.get[h]};return this}dhtmlXGridObject.prototype._getOpenLenght=function(g,e){var c=this._h2.get[g].childs;e+=c.length;for(var a=0;a<c.length;a++){if(c[a].childs.length&&c[a].state=="minus"){e+=this._getOpenLenght(c[a].id,0)}}return e};dhtmlXGridObject.prototype.collapseKids=function(e){var g=this._h2.get[e.idd];if(g.state!="minus"){return}if(!this.callEvent("onOpenStart",[e.idd,1])){return}var h=e.rowIndex;if(h<0){h=this.rowsCol._dhx_find(e)+1}this._h2.change(g.id,"state","plus");this._updateTGRState(g);if(this._srnd||this.pagingOn){this._h2_to_buff();this._renderSort()}else{var a=this._getOpenLenght(this.rowsCol[h-1].idd,0);for(var c=0;c<a;c++){this.rowsCol[h+c].parentNode.removeChild(this.rowsCol[h+c])}this.rowsCol.splice(h,a)}this.callEvent("onGridReconstructed",[]);this.setSizes();this._h2_to_buff();this.callEvent("onOpenEnd",[e.idd,-1])};dhtmlXGridObject.prototype._massInsert=function(a,e,g,o){var h=[];var n=(_isKHTML?this.obj:this.obj.rows[0].parentNode);this._h2_to_buff();if(this._srnd||this.pagingOn){return this._renderSort()}var m=this._getOpenLenght(a.id,0);for(var l=0;l<m;l++){var c=this.render_row(g+l);if(e){e.parentNode.insertBefore(c,e)}else{n.appendChild(c)}h.push(c)}this.rowsCol=dhtmlxArray(this.rowsCol.slice(0,g).concat(h).concat(this.rowsCol.slice(g)));return a.childs.length+h.length};dhtmlXGridObject.prototype.expandKids=function(c,h){var e=this._h2.get[c.idd];if((!e.childs.length)&&(!e._xml_await)){return}if(e.state!="plus"){return}if(!e._loading&&!h){if(!this.callEvent("onOpenStart",[e.id,-1])){return}}var g=this.getRowIndex(e.id)+1;if(e.childs.length){e._loading=false;this._h2.change(e.id,"state","minus");this._updateTGRState(e);var a=this._massInsert(e,this.rowsCol[g],g);this.callEvent("onGridReconstructed",[])}else{if(e._xml_await){e._loading=true;if(this.callEvent("onDynXLS",[e.id])){this.load(this.kidsXmlFile+""+(this.kidsXmlFile.indexOf("?")!=-1?"&":"?")+"id="+encodeURIComponent(e.id),this._data_type)}}}this.setSizes();if(!e._loading){this.callEvent("onOpenEnd",[e.id,1])}this._fixAlterCss()};dhtmlXGridObject.prototype.kidsXmlFile="";dhtmlXGridObject.prototype.sortTreeRows=function(g,h,a){var l="getValue";if(this.cells5({parentNode:{grid:this}},this.getColType(g)).getDate){l="getDate";h="str"}this.forEachRow(function(r){var q=this._h2.get[r];if(!q){return}var o=this._get_cell_value(q.buff,g,l);if(h=="int"){q._sort=parseFloat(o);q._sort=isNaN(q._sort)?-99999999999999:q._sort}else{q._sort=o}});var e=this;var n=1;var m=-1;if(a=="des"){n=-1;m=1}var c=null;if(typeof h=="function"){c=function(q,o){return h(q._sort,o._sort,a,q.id,o.id)}}else{if(h=="cus"){c=function(q,o){return e._customSorts[g](q._sort,o._sort,a,q.id,o.id)}}if(h=="str"){c=function(q,o){return(q._sort<o._sort?m:(q._sort==o._sort?0:n))}}if(h=="int"){c=function(q,o){return(q._sort<o._sort?m:(q._sort==o._sort?0:n))}}if(h=="date"){c=function(q,o){return(Date.parse(new Date(q._sort||"01/01/1900"))-Date.parse(new Date(o._sort||"01/01/1900")))*n}}}this._sortTreeRows(c,0);this._renderSort(0,true);this.callEvent("onGridReconstructed",[])};dhtmlXGridObject.prototype._sortTreeRows=function(a,g){var c=this._h2.get[g].childs;if(this.rowsCol.stablesort){this.rowsCol.stablesort.call(c,a)}else{c.sort(a)}for(var e=0;e<c.length;e++){if(c[e].childs.length){this._sortTreeRows(a,c[e].id)}c[e].index=e}};dhtmlXGridObject.prototype._renderSort=function(e,c){this._h2_to_buff();var a=this.objBox.scrollTop;this._reset_view();this.objBox.scrollTop=a};dhtmlXGridObject.prototype._fixAlterCssTGR=function(){if(!this._realfake){this._h2.forEachChild(0,function(a){if(a.buff.tagName=="TR"){var c=(this._cssSP?(a.level%2):(a.index%2))?this._cssUnEven:this._cssEven;this.rowsAr[a.id].className=(c+(this._cssSU?(" "+c+"_"+a.level):""))+" "+(this.rowsAr[a.id]._css||"")+((this.rowsAr[a.id].className.indexOf("rowselected")!=-1)?" rowselected":"")}},this)}};dhtmlXGridObject.prototype.moveRowUDTG=function(c,h){var n=this._h2.get[c];var e=n.parent.childs[n.index+h];if((!e)||(e.parent!=n.parent)){return}var a=[n.state,e.state];this.collapseKids(this.rowsAr[n.id]);this.collapseKids(this.rowsAr[e.id]);var g=this.rowsCol._dhx_find(this.rowsAr[c]);var m=this.rowsBuffer._dhx_find(this.rowsAr[c]);var o=this.obj.rows[0].parentNode.removeChild(this.rowsCol[g]);var l=this.rowsCol[g+((h==1)?2:h)];if(l){l.parentNode.insertBefore(o,l)}else{this.obj.rows[0].parentNode.appendChild(o)}this.rowsCol._dhx_swapItems(g,g+h);this.rowsBuffer._dhx_swapItems(m,m+h);this._h2.swap(e,n);if(a[0]=="minus"){this.expandKids(this.rowsAr[n.id])}if(a[1]=="minus"){this.expandKids(this.rowsAr[e.id])}this._fixAlterCss(Math.min(g,g+h))};function eXcell_tree(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.isDisabled=function(){return this.cell._disabled||this.grid._edtc};this.edit=function(){if((this.er)||(this.grid._edtc)){return}this.er=this.cell.parentNode.valTag;this.val=this.getLabel();this.cell.atag=((!this.grid.multiLine)&&(_isKHTML||_isMacOS||_isFF))?"INPUT":"TEXTAREA";this.er.innerHTML="<"+this.cell.atag+" class='dhx_combo_edit' type='text' style='height:"+(this.cell.offsetHeight-4)+"px;line-height:"+(this.cell.offsetHeight-6)+"px; width:100%; border:0px; margin:0px; padding:0px; overflow:hidden;'></"+this.cell.atag+">";this.er.childNodes[0].onmousedown=function(c){(c||event).cancelBubble=true};this.er.childNodes[0].onselectstart=function(c){if(!c){c=event}c.cancelBubble=true;return true};this.er.className+=" editable";this.er.firstChild.onclick=function(c){(c||event).cancelBubble=true};this.er.firstChild.value=this.val;this.obj=this.er.firstChild;this.er.firstChild.style.width=Math.max(0,this.cell.offsetWidth-this.er.offsetLeft-2)+"px";this.er.firstChild.focus();if(_isIE){this.er.firstChild.focus()}};this.detach=function(){if(!this.er){return}this.setLabel(this.er.firstChild.value);this.er.className=this.er.className.replace("editable","");var c=(this.val!=this.er.innerHTML);this.obj=this.er=null;return(c)};this.getValue=function(){return this.getLabel()};this.setImage=function(c){this.cell.parentNode.imgTag.nextSibling.src=this.grid.iconURL+c;this.grid._h2.get[this.cell.parentNode.idd].image=c};this.getImage=function(){return this.grid._h2.get[this.cell.parentNode.idd].image};this.setLabel=function(c){this.setValueA(c)};this.getLabel=function(c){return this.cell.parentNode.valTag.innerHTML}}eXcell_tree.prototype=new eXcell;eXcell_tree.prototype.setValueA=function(a){this.cell.parentNode.valTag.innerHTML=a;this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,a])};eXcell_tree.prototype.setValue=function(a){if(this.cell.parentNode.imgTag){return this.setLabel(a)}

    // if((this.grid._tgc.iconTree==null)||(this.grid._tgc.iconTree!=this.grid.iconTree)){var h={};h.spacer="<img src='"+this.grid.iconTree+"blank.gif'  align='top' class='space'>";h.imst="<img style='margin-top:-2px;' src='"+this.grid.iconTree;h.imsti="<img style='padding-top:2px;'  src='"+(this.grid.iconURL||this.grid.iconTree);h.imact="' align='top' onclick='this."+(_isKHTML?"":"parentNode.")+"parentNode.parentNode.parentNode.parentNode.grid.doExpand(this);event.cancelBubble=true;'>";h.plus=h.imst+"plus.gif"+h.imact;h.minus=h.imst+"minus.gif"+h.imact;h.blank=h.imst+"blank.gif"+h.imact;h.start="<div class='treegrid_cell' style='overflow:hidden; white-space : nowrap; line-height:23px; height:"+(_isIE?21:23)+"px;'>";h.itemim="' align='top' "+(this.grid._img_height?(' height="'+this.grid._img_height+'"'):"")+(this.grid._img_width?(' width="'+this.grid._img_width+'"'):"")+" ><span id='nodeval'>";h.close="</span></div>";this.grid._tgc=h}
    // 修改为不显示TreeGird的图标(可自定义使用font-awesome)
    if((this.grid._tgc.iconTree==null)||(this.grid._tgc.iconTree!=this.grid.iconTree)){var h={};h.spacer="<img src='"+this.grid.iconTree+"blank.gif'  align='top' class='space'>";h.imst="<img style='margin-top:-2px;' src='"+this.grid.iconTree;h.imsti="<img style='display:none;' hit='";h.imact="' align='top' onclick='this."+(_isKHTML?"":"parentNode.")+"parentNode.parentNode.parentNode.parentNode.grid.doExpand(this);event.cancelBubble=true;'>";h.plus=h.imst+"plus.gif"+h.imact;h.minus=h.imst+"minus.gif"+h.imact;h.blank=h.imst+"blank.gif"+h.imact;h.start="<div class='treegrid_cell' style='overflow:hidden; white-space : nowrap; line-height:23px; height:"+(_isIE?21:23)+"px;'>";h.itemim="' align='top' "+(this.grid._img_height?(' height="'+this.grid._img_height+'"'):"")+(this.grid._img_width?(' width="'+this.grid._img_width+'"'):"")+" ><span id='nodeval'>";h.close="</span></div>";this.grid._tgc=h}

    var l=this.grid._h2;var h=this.grid._tgc;var g=this.cell.parentNode.idd;var m=this.grid._h2.get[g];if(this.grid.kidsXmlFile||this.grid._slowParse){m.has_kids=(m.has_kids||(this.cell.parentNode._attrs.xmlkids&&(m.state!="minus")));m._xml_await=!!m.has_kids}m.image=m.image||(this.cell._attrs.image||"leaf.gif");m.label=a;var e=[h.start];for(var c=0;c<m.level;c++){e.push(h.spacer)}if(m.has_kids){e.push(h.plus);m.state="plus"}else{e.push(h.imst+m.state+".gif"+h.imact)}e.push(h.imsti);e.push(m.image);e.push(h.itemim);e.push(m.label);e.push(h.close);this.cell.innerHTML=e.join("");this.cell._treeCell=true;this.cell.parentNode.imgTag=this.cell.childNodes[0].childNodes[m.level];this.cell.parentNode.valTag=this.cell.childNodes[0].childNodes[m.level+2];if(_isKHTML){this.cell.vAlign="top"}if(m.parent.id!=0&&m.parent.state=="plus"){this.grid._updateTGRState(m.parent,false);this.cell.parentNode._skipInsert=true}this.grid.callEvent("onCellChanged",[g,this.cell._cellIndex,a])};dhtmlXGridObject.prototype._process_tree_xml=function(l,c){this._parsing=true;var a=false;if(!c){this.render_row=this.render_row_tree;a=true;c=l.getAttribute("parent")||0;if(c=="0"){c=0}if(!this._h2){this._h2=this._createHierarchy()}if(this._fake){this._fake._h2=this._h2}}var h=dhx4.ajax.xpath(this.xml.row,l);this._open=this._open||[];for(var e=0;e<h.length;e++){var n=h[e].getAttribute("id");if(!n){n=this.uid();h[e].setAttribute("id",n)}var m=this._h2.add(n,c);m.buff={idd:n,data:h[e],_parser:this._process_xml_row,_locator:this._get_xml_data};if(h[e].getAttribute("open")){m.state="minus";this._open.push(n)}this.rowsAr[n]=m.buff;this._process_tree_xml(h[e],n)}if(a){if(!h.length){this._h2.change(c,"state",this._emptyLineImg)}else{if(c!=0&&!this._srnd){this._h2.change(c,"state","minus")}}for(var e=0;e<this._open.length;e++){var g=this._h2.get[this._open[e]];if(!g.childs.length){g.state=this._emptyLineImg}}this._updateTGRState(this._h2.get[c]);this._h2_to_buff();if(c!=0&&this._srnd){this.openItem(c)}else{if(this.pagingOn){this._renderSort()}else{this.render_dataset()}}if(this.kidsXmlFile){for(var e=0;e<this._open.length;e++){var g=this._h2.get[this._open[e]];if(g._xml_await){this.expandKids({idd:g.id})}}}this._open=[];if(this._slowParse===false){this.forEachRow(function(o){this.render_row_tree(0,o)})}this._parsing=false;if(c!=0&&!this._srnd){this.callEvent("onOpenEnd",[c,1])}}};dhtmlXGridObject.prototype._h2_to_buff=function(c){if(!c){c=this._h2.get[0];this.rowsBuffer=new dhtmlxArray();if(this._fake&&!this._realfake){this._fake.rowsBuffer=this.rowsBuffer}}for(var a=0;a<c.childs.length;a++){this.rowsBuffer.push(c.childs[a].buff);if(c.childs[a].state=="minus"){this._h2_to_buff(c.childs[a])}}};dhtmlXGridObject.prototype.render_row_tree=function(c,g){if(g){var a=this._h2.get[g];a=a?a.buff:a}else{var a=this.rowsBuffer[c]}if(!a){return -1}if(a._parser){if(this.rowsAr[a.idd]&&this.rowsAr[a.idd].tagName=="TR"){return this._h2.get[a.idd].buff=this.rowsBuffer[c]=this.rowsAr[a.idd]}var e=this._prepareRow(a.idd);this.rowsAr[a.idd]=e;if(!g){this.rowsBuffer[c]=e}this._h2.get[a.idd].buff=e;a._parser.call(this,e,a.data);this._postRowProcessing(e);return e}return a};dhtmlXGridObject.prototype._removeTrGrRow=function(g,c){if(c){this._h2.forEachChild(c.id,function(l){this._removeTrGrRow(null,l);delete this.rowsAr[l.id]},this);return}var h=this.getRowIndex(g.idd);var c=this._h2.get[g.idd];if(h!=-1&&h!==this.undefined){var a=1;if(c&&c.state=="minus"){a+=this._getOpenLenght(c.id,0)}for(var e=0;e<a;e++){if(this.rowsCol[e+h]){this.rowsCol[e+h].parentNode.removeChild(this.rowsCol[e+h])}}if(this._fake){for(var e=0;e<a;e++){if(this._fake.rowsCol[e+h]){this._fake.rowsCol[e+h].parentNode.removeChild(this._fake.rowsCol[e+h])}}if(a>1){this._fake.rowsCol.splice(h+1,a-1)}}this.rowsCol.splice(h,a);this.rowsBuffer.splice(h,a)}if(!c){return}this._removeTrGrRow(null,c);delete this.rowsAr[c.id];if(c.parent.childs.length==1){this._h2.change(c.parent.id,"state",this._emptyLineImg);this._updateTGRState(c.parent)}this._h2.remove(c.id)};dhtmlXGridObject.prototype.openItem=function(c){var e=this._h2.get[c||0];var a=this.getRowById(c||0);if(!a){return}if(e.parent&&e.parent.id!=0){this.openItem(e.parent.id)}this.expandKids(a)};dhtmlXGridObject.prototype._addRowClassic=dhtmlXGridObject.prototype.addRow;dhtmlXGridObject.prototype.addRow=function(c,m,h,g,a,n){if(!this._h2){return this._addRowClassic(c,m,h)}g=g||0;var e=this.cellType._dhx_find("tree");if(typeof(m)=="string"){m=m.split(this.delim)}var l=this._h2.get[c];if(!l){if(g==0){h=this.rowsBuffer.length}else{h=this.getRowIndex(g)+1;if(this._h2.get[g].state=="minus"){h+=this._getOpenLenght(g,0)}else{this._skipInsert=true}}}l=l||this._h2.add(c,g);l.image=a;l.has_kids=n;return l.buff=this._addRowClassic(c,m,h)};dhtmlXGridObject.prototype.addRowBefore=function(e,l,g,c,n){var m=this.rowsAr[g];if(!m){return}if(!this._h2){return this.addRow(e,l,this.getRowIndex(g))}var a=this._h2.get[g].parent.id;var h=this.getRowIndex(g);if(h==-1){this._skipInsert=true}this._h2.addBefore(e,a,g);return this.addRow(e,l,h,this._h2.get[g].parent.id,c,n)};dhtmlXGridObject.prototype.addRowAfter=function(e,l,g,c,n){var m=this.rowsAr[g];if(!m){return}if(!this._h2){return this.addRow(e,l,this.getRowIndex(g)+1)}var a=this._h2.get[g].parent.id;var h=this.getRowIndex(g);if(h==-1){this._skipInsert=true}if(this._h2.get[g].state=="minus"){h+=this._getOpenLenght(g,0)+1}else{h++}this._h2.addAfter(e,a,g);return this.addRow(e,l,h,a,c,n)};dhtmlXGridObject.prototype.enableSmartXMLParsing=function(a){this._slowParse=dhx4.s2b(a)};dhtmlXGridObject.prototype._copyTreeGridRowContent=function(a,c,e){var g=this.cellType._dhx_find("tree");for(i=0;i<a.cells.length;i++){if(i!=g){this.cells(e,i).setValue(this.cells(c,i).getValue())}else{this.cells(e,i).setValueA(this.cells(c,i).getValue())}}};dhtmlXGridObject.prototype.closeItem=function(c){var a=this.getRowById(c);if(!a){return}this.collapseKids(a)};dhtmlXGridObject.prototype.deleteChildItems=function(a){var c=this._h2.get[a];if(!c){return}while(c.childs.length){this.deleteRow(c.childs[0].id)}};dhtmlXGridObject.prototype.getAllSubItems=function(c){var g=[];var e=this._h2.get[c||0];if(e){for(var a=0;a<e.childs.length;a++){g.push(e.childs[a].id);if(e.childs[a].childs.length){g=g.concat(this.getAllSubItems(e.childs[a].id).split(this.delim))}}}return g.join(this.delim)};dhtmlXGridObject.prototype.getChildItemIdByIndex=function(c,a){var e=this._h2.get[c||0];if(!e){return null}return(e.childs[a]?e.childs[a].id:null)};dhtmlXGridObject.prototype.getItemText=function(a){return this.cells(a,this.cellType._dhx_find("tree")).getLabel()};dhtmlXGridObject.prototype.getOpenState=function(a){var c=this._h2.get[a||0];if(!c){return}if(c.state=="minus"){return true}return false};dhtmlXGridObject.prototype.getParentId=function(a){var c=this._h2.get[a||0];if((!c)||(!c.parent)){return null}return c.parent.id};dhtmlXGridObject.prototype.getSubItems=function(c){var g=[];var e=this._h2.get[c||0];if(e){for(var a=0;a<e.childs.length;a++){g.push(e.childs[a].id)}}return g.join(this.delim)};dhtmlXGridObject.prototype.expandAll=function(a){this._renderAllExpand(a||0);this._h2_to_buff();this._reset_view();this.setSizes();this.callEvent("onGridReconstructed",[]);if(this._redrawLines){this._redrawLines()}};dhtmlXGridObject.prototype._renderAllExpand=function(e){var a=this._h2.get[e].childs;for(var c=0;c<a.length;c++){if(a[c].childs.length){this._h2.change(a[c].id,"state","minus");this._updateTGRState(a[c]);this._renderAllExpand(a[c].id)}}};dhtmlXGridObject.prototype.collapseAll=function(a){this._h2.forEachChild((a||0),function(c){if(c&&c.state=="minus"){c.state="plus";c.update=true;this._updateTGRState(c)}},this);this._h2_to_buff();this._reset_view();this.setSizes();this.callEvent("onGridReconstructed",[]);if(this._redrawLines){this._redrawLines()}};dhtmlXGridObject.prototype.hasChildren=function(c){var a=this._h2.get[c];if(a&&a.childs.length){return a.childs.length}if(a._xml_await){return -1}return 0};dhtmlXGridObject.prototype.setItemCloseable=function(e,c){var a=this._h2.get[e];if(!a){return}a._closeable=(!dhx4.s2b(c))};dhtmlXGridObject.prototype.setItemText=function(a,c){return this.cells(a,this.cellType._dhx_find("tree")).setLabel(c)};dhtmlXGridObject.prototype.setItemImage=function(c,a){this._h2.get[c].image=a;this.rowsAr[c].imgTag.nextSibling.src=(this.iconURL||"")+a};dhtmlXGridObject.prototype.getItemImage=function(a){this.getRowById(a);return this._h2.get[a].image};dhtmlXGridObject.prototype.setImageSize=function(c,a){this._img_width=c;this._img_height=a};dhtmlXGridObject.prototype._getRowImage=function(a){return this._h2.get[a.idd].image};dhtmlXGridObject.prototype.setOnOpenStartHandler=function(a){this.attachEvent("onOpenStart",a)};dhtmlXGridObject.prototype.setOnOpenEndHandler=function(a){this.attachEvent("onOpenEnd",a)};dhtmlXGridObject.prototype.enableTreeCellEdit=function(a){this._edtc=!dhx4.s2b(a)};dhtmlXGridObject.prototype.getLevel=function(a){var c=this._h2.get[a||0];if(!c){return -1}return c.level};dhtmlXGridObject.prototype._fixHiddenRowsAllTG=function(c,a){for(i in this.rowsAr){if((this.rowsAr[i])&&(this.rowsAr[i].childNodes)){this.rowsAr[i].childNodes[c].style.display=a}}};dhtmlXGridObject.prototype._updateLine=function(e,c){c=c||this.rowsAr[e.id];if(!c){return}var a=c.imgTag;if(!a){return}if(e.state=="blank"){return a.src=this.iconTree+"blank.gif"}var g=1;if(e.index==0){if(e.level==0){if((e.parent.childs.length-1)>e.index){g=3}else{g=1}}else{if((e.parent.childs.length-1)>e.index){g=3}else{g=2}}}else{if((e.parent.childs.length-1)>e.index){g=3}else{g=2}}a.src=this.iconTree+e.state+g+".gif"};dhtmlXGridObject.prototype._updateParentLine=function(g,e){e=e||this.rowsAr[g.id];if(!e){return}var a=e.imgTag;if(!a){return}for(var c=g.level;c>0;c--){if(g.id==0){break}a=a.previousSibling;g=g.parent;if((g.parent.childs.length-1)>g.index){a.src=this.iconTree+"line1.gif"}else{a.src=this.iconTree+"blank.gif"}}};dhtmlXGridObject.prototype._renderSortA=dhtmlXGridObject.prototype._renderSort;dhtmlXGridObject.prototype._renderSort=function(){this._renderSortA.apply(this,arguments);this._redrawLines(0)};dhtmlXGridObject.prototype._redrawLines=function(a){if(this._tgle){this._h2.forEachChild((a||0),function(c){this._updateLine(c);this._updateParentLine(c)},this)}};dhtmlXGridObject.prototype.enableTreeGridLines=function(){this._emptyLineImg="line";this._updateTGRState=function(c,a){if(a||!c.update||c.id==0){return}if(this._tgle){this._updateLine(c,this.rowsAr[c.id])}c.update=false};this._tgle=true;this.attachEvent("onXLE",function(e,c,g){this._redrawLines(g)});this.attachEvent("onOpenEnd",function(a){this._redrawLines(a)});this.attachEvent("onRowAdded",function(c){var a=this._h2.get[c];this._updateLine(a);this._updateParentLine(a);if(a.index<(a.parent.childs.length-1)){a=a.parent.childs[a.index+1];this._updateLine(a);this._updateParentLine(a)}else{if(a.index!=0){a=a.parent.childs[a.index-1];this._updateLine(a);this._updateParentLine(a);if(a.childs.length){this._h2.forEachChild(a.id,function(e){this._updateParentLine(e)},this)}}}});this.attachEvent("onOpen",function(g,c){if(c){var e=this._h2.get[g];for(var a=0;a<e.childs.length;a++){this._updateParentLine(e.childs[a])}}return true});this.attachEvent("onBeforeRowDeleted",function(g){var c=this;var e=this._h2.get[g];var a=null;if(e.index!=0){a=e.parent.childs[e.index-1]}e=e.parent;window.setTimeout(function(){e=c._h2.get[e.id];if(!e){return}c._updateLine(e);c._updateParentLine(e);if(a){c._updateLine(a);if(a.state=="minus"){c._h2.forEachChild(a.id,function(h){c._updateParentLine(h)},c)}}},1);return true})};dhtmlXGridObject.prototype.setFiltrationLevel=function(e,a,c){this._tr_strfltr=e;this._tr_fltr_c=a;this._tr_fltr_d=c;this.refreshFilters()};dhtmlXGridObject.prototype.filterTreeBy=function(g,h,e){var a=this._h2;if(typeof this._tr_strfltr=="undefined"){this._tr_strfltr=-1}if(this._f_rowsBuffer){if(!e){this._h2=this._f_rowsBuffer;if(this._fake){this._fake._h2=this._h2}}}else{this._f_rowsBuffer=this._h2}var l=true;this.dma(true);this._fbf={};if(typeof(g)=="object"){for(var c=0;c<h.length;c++){this._filterTreeA(g[c],h[c])}}else{this._filterTreeA(g,h)}this._fbf=null;this.dma(false);this._fix_filtered_images(this._h2,a);this._renderSort();this.callEvent("onGridReconstructed",[])};dhtmlXGridObject.prototype._filterTreeA=function(e,o){if(o==""){return}var m=true;if(typeof(o)=="function"){m=false}else{o=(o||"").toString().toLowerCase()}var c=function(v,u,r){var w=r.get[v.parent.id];if(!w){w=c(v.parent,u,r)}var r=q.get[v.id];if(!r){r={id:v.id,childs:[],level:v.level,parent:w,index:w.childs.length,image:v.image,state:v.state,buff:v.buff,has_kids:v.has_kids,_xml_await:v._xml_await};w.childs.push(r);q.get[r.id]=r}return r};var n=this._fbf;var q=this._createHierarchy();var a;var h=this._tr_strfltr;var l=this;var g=function(s){for(var r=0;r<s.childs.length;r++){l.temp(s.childs[r])}};switch(h.toString()){case"-2":a=function(r){if(n[r.id]){return false}g(r);return true};break;case"-1":a=function(r){return !r.childs.length};break;default:a=function(r){return h==r.level};break}this.temp=function(r){if(r.id!=0&&a(r)){if(m?(this._get_cell_value(r.buff,e).toString().toLowerCase().indexOf(o)==-1):(!o(this._get_cell_value(r.buff,e),r.id))){n[r.id]=true;if(this._tr_fltr_c){c(r.parent,this._h2,q)}return false}else{c(r,this._h2,q);if(r.childs&&h!=-2){this._h2.forEachChild(r.id,function(s){c(s,this._h2,q)},this)}return true}}else{if(this._tr_fltr_d&&this._tr_strfltr>r.level&&r.id!=0){c(r,this._h2,q)}g(r)}};this.temp(this._h2.get[0]);this._h2=q;if(this._fake){this._fake._h2=this._h2}};dhtmlXGridObject.prototype._fix_filtered_images=function(c,a){c.forEachChild(0,function(e){if(!e.childs.length&&!e.has_kids){if(e.state!=this._emptyLineImg){e.state=this._emptyLineImg;e.update=true;this._updateTGRState(e)}}else{if(e.buff.tagName=="TR"){var g=a.get[e.id];if(g&&g.state!=this._emptyLineImg){e.state=g.state}e.update=true;this._updateTGRState(e)}}},this)};dhtmlXGridObject.prototype.collectTreeValues=function(e){if(typeof this._tr_strfltr=="undefined"){this._tr_strfltr=-1}this.dma(true);this._build_m_order();e=this._m_order?this._m_order[e]:e;var m={};var h=[];var a=this._f_rowsBuffer||this._h2;a.forEachChild(0,function(c){if(this._tr_strfltr==-2||(this._tr_strfltr==-1&&!c.childs.length)||(this._tr_strfltr==c.level)){var n=this._get_cell_value(c.buff,e);if(n){m[n]=true}}},this);this.dma(false);var g=this.combos[e];for(var l in m){if(m[l]===true){h.push(g?(g.get(l)||l):l)}}return h.sort()};dhtmlXGridObject.prototype._in_header_stat_tree_total=function(e,a,h){var g=function(){var l=0;this._build_m_order();var c=this._m_order?this._m_order[a]:a;this._h2.forEachChild(0,function(n){var m=parseFloat(this._get_cell_value((n.buff||this.rowsAr[n.id]),c));l+=isNaN(m)?0:m},this);return this._maskArr[a]?this._aplNF(l,a):(Math.round(l*100)/100)};this._stat_in_header(e,g,a,h,h)};dhtmlXGridObject.prototype._in_header_stat_tree_total_leaf=function(e,a,h){var g=function(){var l=0;this._build_m_order();var c=this._m_order?this._m_order[a]:a;this._h2.forEachChild(0,function(n){if(n.childs.length){return}var m=parseFloat(this._get_cell_value((n.buff||this.rowsAr[n.id]),c));l+=isNaN(m)?0:m},this);return this._maskArr[a]?this._aplNF(l,a):(Math.round(l*100)/100)};this._stat_in_header(e,g,a,h,h)};dhtmlXGridObject.prototype._in_header_stat_tree_multi_total=function(e,a,l){var h=l[1].split(":");l[1]="";var g=function(){var c=0;this._h2.forEachChild(0,function(n){var m=parseFloat(this._get_cell_value((n.buff||this.rowsAr[n.id]),h[0]))*parseFloat(this._get_cell_value((n.buff||this.rowsAr[n.id]),h[1]));c+=isNaN(m)?0:m},this);return this._maskArr[a]?this._aplNF(c,a):(Math.round(c*100)/100)};this._stat_in_header(e,g,a,l,l)};dhtmlXGridObject.prototype._in_header_stat_tree_multi_total_leaf=function(e,a,l){var h=l[1].split(":");l[1]="";var g=function(){var c=0;this._h2.forEachChild(0,function(n){if(n.childs.length){return}var m=parseFloat(this._get_cell_value((n.buff||this.rowsAr[n.id]),h[0]))*parseFloat(this._get_cell_value((n.buff||this.rowsAr[n.id]),h[1]));c+=isNaN(m)?0:m},this);return this._maskArr[a]?this._aplNF(c,a):(Math.round(c*100)/100)};this._stat_in_header(e,g,a,l,l)};dhtmlXGridObject.prototype._in_header_stat_tree_max=function(e,a,h){var g=function(){var l=-999999999;this._build_m_order();var c=this._m_order?this._m_order[a]:a;if(this.getRowsNum()==0){return""}this._h2.forEachChild(0,function(m){var n=parseFloat(this._get_cell_value((m.buff||this.rowsAr[m.id]),c));if(!isNaN(n)){l=Math.max(l,n)}},this);return this._maskArr[a]?this._aplNF(l,a):l};this._stat_in_header(e,g,a,h)};dhtmlXGridObject.prototype._in_header_stat_tree_min=function(e,a,h){var g=function(){var l=999999999;this._build_m_order();var c=this._m_order?this._m_order[a]:a;if(this.getRowsNum()==0){return""}this._h2.forEachChild(0,function(m){var n=parseFloat(this._get_cell_value((m.buff||this.rowsAr[m.id]),c));if(!isNaN(n)){l=Math.min(l,n)}},this);return this._maskArr[a]?this._aplNF(l,a):l};this._stat_in_header(e,g,a,h)};dhtmlXGridObject.prototype._in_header_stat_tree_average=function(e,a,h){var g=function(){var m=0;var l=0;this._build_m_order();var c=this._m_order?this._m_order[a]:a;this._h2.forEachChild(0,function(o){var n=parseFloat(this._get_cell_value((o.buff||this.rowsAr[o.id]),c));m+=isNaN(n)?0:n;l++},this);return this._maskArr[a]?this._aplNF(m,a):(Math.round(m/l*100)/100)};this._stat_in_header(e,g,a,h)};dhtmlXGridObject.prototype._in_header_stat_tree_max_leaf=function(e,a,h){var g=function(){var l=-999999999;this._build_m_order();var c=this._m_order?this._m_order[a]:a;if(this.getRowsNum()==0){return""}this._h2.forEachChild(0,function(m){if(m.childs.length){return}var n=parseFloat(this._get_cell_value((m.buff||this.rowsAr[m.id]),c));if(!isNaN(n)){l=Math.max(l,n)}},this);return this._maskArr[a]?this._aplNF(l,a):l};this._stat_in_header(e,g,a,h)};dhtmlXGridObject.prototype._in_header_stat_tree_min_leaf=function(e,a,h){var g=function(){var l=999999999;this._build_m_order();var c=this._m_order?this._m_order[a]:a;if(this.getRowsNum()==0){return""}this._h2.forEachChild(0,function(m){if(m.childs.length){return}var n=parseFloat(this._get_cell_value((m.buff||this.rowsAr[m.id]),c));if(!isNaN(n)){l=Math.min(l,n)}},this);return this._maskArr[a]?this._aplNF(l,a):l};this._stat_in_header(e,g,a,h)};dhtmlXGridObject.prototype._in_header_stat_tree_average_leaf=function(e,a,h){var g=function(){var m=0;var l=0;this._build_m_order();var c=this._m_order?this._m_order[a]:a;this._h2.forEachChild(0,function(o){if(o.childs.length){return}var n=parseFloat(this._get_cell_value((o.buff||this.rowsAr[o.id]),c));m+=isNaN(n)?0:n;l++},this);return this._maskArr[a]?this._aplNF(m,a):(Math.round(m/l*100)/100)};this._stat_in_header(e,g,a,h)};dhtmlXGridObject.prototype._in_header_stat_tree_count=function(e,a,h){var g=function(){var c=0;this._h2.forEachChild(0,function(l){c++},this);return c};this._stat_in_header(e,g,a,h)};dhtmlXGridObject.prototype._in_header_stat_tree_count_leaf=function(e,a,h){var g=function(){var c=0;this._h2.forEachChild(0,function(l){if(!l.childs.length){c++}},this);return c};this._stat_in_header(e,g,a,h)};dhtmlXGridObject.prototype._stat_in_header=function(e,g,a,m){var h=this;var l=function(){this.dma(true);e.innerHTML=(m[0]?m[0]:"")+g.call(this)+(m[1]?m[1]:"");this.dma(false);this.callEvent("onStatReady",[])};if(!this._stat_events){this._stat_events=[];this.attachEvent("onClearAll",function(){if(!this.hdr.rows[1]){for(var n=0;n<this._stat_events.length;n++){for(var c=0;c<4;c++){this.detachEvent(this._stat_events[n][c])}}this._stat_events=[]}})}this._stat_events.push([this.attachEvent("onGridReconstructed",l),this.attachEvent("onXLE",l),this.attachEvent("onFilterEnd",l),this.attachEvent("onEditCell",function(c,o,n){if(c==2&&n==a){l.call(this)}return true})]);e.innerHTML=""};dhtmlXGridObject.prototype._build_m_order=function(){if(this._c_order){this._m_order=[];for(var a=0;a<this._c_order.length;a++){this._m_order[this._c_order[a]]=a}}};function dhtmlXForm(h,g,l){this.idef={position:"label-left",labelWidth:"auto",labelHeight:"auto",inputWidth:"auto",inputHeight:"auto",labelAlign:"left",noteWidth:"auto",offsetTop:0,offsetLeft:0,blockOffset:20};this.idef_const={offsetNested:20};this.apos_css={"label-left":"dhxform_item_label_left","label-right":"dhxform_item_label_right","label-top":"dhxform_item_label_top","label-bottom":"dhxform_item_label_bottom",absolute:"dhxform_item_absolute"};this.align_css={left:"dhxform_label_align_left",center:"dhxform_label_align_center",right:"dhxform_label_align_right"};var e=this;this.setSkin=function(a){this.skin=a;this.cont.className="dhxform_obj_"+this.skin;this.cont.style.fontSize=(a=="dhx_terrace"?"13px":"12px");this._updateBlocks();this.forEachItem(function(n){var m=e.getItemType(n);if(typeof(e.items[m])!="undefined"&&typeof(e.items[m].setSkin)=="function"){e.doWithItem(n,"setSkin",a)}})};this.skin=(l||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhx_form")||"dhx_skyblue");this.separator=",";this.live_validate=false;this._type="checkbox";this._rGroup="default";this._idIndex={};this._indexId=[];this.cont=(typeof(h)=="object"?h:document.getElementById(h));if(!h._isNestedForm){this._parentForm=true;this.cont.style.fontSize=(this.skin=="dhx_terrace"?"13px":"12px");this.cont.className="dhxform_obj_"+this.skin;this.setFontSize=function(a){this.cont.style.fontSize=a;this._updateBlocks()};this.getForm=function(){return this};this.cont.onkeypress=function(m){m=(m||event);if(m.keyCode==13){var a=(m.target||m.srcElement);if(typeof(a.tagName)!="undefined"&&String(a.tagName).toLowerCase()=="textarea"&&!m.ctrlKey){return}e.callEvent("onEnter",[])}}}this.b_index=null;this.base=[];this._prepare=function(u,v){if(this.b_index==null){this.b_index=0}else{this.b_index++}var n=null;var m=null;if(v!=null){if(v<0){v=0}var r=0;for(var a=0;a<this.cont.childNodes.length;a++){for(var s=0;s<this.cont.childNodes[a].childNodes.length;s++){if(m==null&&this.cont.childNodes[a].childNodes[s]._isNestedForm!=true){if(r==v){n=this.cont.childNodes[a].nextSibling;m=this.cont.childNodes[a].childNodes[s]}r++}}}}this.base[this.b_index]=document.createElement("DIV");this.base[this.b_index].className="dhxform_base";if(typeof(u)!="undefined"){this.base[this.b_index].style.cssText+=" margin-left:"+u+"px!important;"}if(n!=null){this.cont.insertBefore(this.base[this.b_index],n);n=null}else{this.cont.appendChild(this.base[this.b_index])}if(m!=null){while(m!=null){var o=m;m=m.nextSibling;this.base[this.b_index].appendChild(o);o=null}}};this.setSizes=function(){};this._mergeSettings=function(s){var n=-1;var o={type:"settings"};for(var m in this.idef){o[m]=this.idef[m]}for(var r=0;r<s.length;r++){if(typeof(s[r])!="undefined"&&s[r].type=="settings"){for(var m in s[r]){o[m]=s[r][m]}n=r}}s[n>=0?n:s.length]=o;return s};this._genStr=function(a){var m="dhxId_";var o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var n=0;n<a;n++){m+=o.charAt(Math.floor(Math.random()*o.length))}return m};this.idPrefix="dhxForm_"+this._genStr(12)+"_";this._rId=(this._parentForm?this._genStr(12)+"_":h._rId);this.objPull={};this.itemPull={};this._ic=0;this._addItem=function(E,r,x,u,C,F,A){if(this.items[E]._index){this.getForm()._indexId.push(r);this.getForm()._idIndex[r]={ind:this.getForm()._indexId.length-1}}if(!E){E=this._type}if(E=="list"&&C!=null&&this.itemPull[this.idPrefix+C]!=null&&typeof(this.itemPull[this.idPrefix+C]._addSubListNode)=="function"){var D=this.itemPull[this.idPrefix+C]._addSubListNode()}else{if(E=="newcolumn"){var D={}}else{var s=this.base[this.b_index];var m=null;if(typeof(F)!="undefined"&&!isNaN(F)&&E!="list"){F=Math.max(parseInt(F),0)+1;for(var I=0;I<this.cont.childNodes.length;I++){for(var n=0;n<this.cont.childNodes[I].childNodes.length;n++){if(m==null&&this.cont.childNodes[I].childNodes[n]._isNestedForm!=true){F--;if(F==0){m=this.cont.childNodes[I].childNodes[n];s=this.cont.childNodes[I]}}}}}else{if(E=="list"){for(var H in this.itemPull){if(H==this.idPrefix+r){m=this.itemPull[H].nextSibling;if(this.itemPull[H]._listBase!=null&&this.itemPull[H]._listBase.length>0){m=this.itemPull[H]._listBase[this.itemPull[H]._listBase.length-1]}}}}}var D=document.createElement("DIV");if(A==true&&m!=null){m=m.nextSibling}if(m!=null){s.insertBefore(D,m)}else{s.appendChild(D)}}}D._idd=r;D._rId=this._rId;if(typeof(D.style)!="undefined"){if(typeof(x.offsetLeft)=="undefined"&&this.idef.offsetLeft>0){x.offsetLeft=this.idef.offsetLeft}if(typeof(x.offsetTop)=="undefined"&&this.idef.offsetTop>0){x.offsetTop=this.idef.offsetTop}var v="";if(typeof(x.offsetLeft)!="undefined"){v+=" padding-left:"+x.offsetLeft+"px!important;"}if(typeof(x.offsetTop)!="undefined"){v+=" padding-top:"+x.offsetTop+"px!important;"}D.style.cssText+=v}if(E=="block"){if(isNaN(x.blockOffset)){x.blockOffset=this.idef.blockOffset}}if(E=="list"){if(typeof(D._ofsNested)=="undefined"){D._ofsNested=this.idef_const.offsetNested}if(u!=null){D._sId=u}var y=this.items[E].render(D,this.skin);if(!this.itemPull[this.idPrefix+r]._listObj){this.itemPull[this.idPrefix+r]._listObj=[]}if(!this.itemPull[this.idPrefix+r]._list){this.itemPull[this.idPrefix+r]._list=[]}if(!this.itemPull[this.idPrefix+r]._listBase){this.itemPull[this.idPrefix+r]._listBase=[]}(this.itemPull[this.idPrefix+r]._listObj).push(y[0]);(this.itemPull[this.idPrefix+r]._list).push(y[1]);(this.itemPull[this.idPrefix+r]._listBase).push(D);y[1].checkEvent=function(a){return e.checkEvent(a)};y[1].callEvent=function(a,q){return e.callEvent(a,q)};y[1].getForm=function(){return e.getForm()};y[1]._initObj(this._mergeSettings(x));if(D._inBlcok){D.className+=" in_block"}return y[1]}if(E=="newcolumn"){this._prepare(x.offset,F);return}if(E=="label"&&this._ic++==0){x._isTopmost=true}x.position=this.apos_css[(!x.position||!this.apos_css[x.position]?this.idef.position:x.position)];D.className=x.position+(typeof(x.className)=="string"?" "+x.className:"");if(!x.labelWidth){x.labelWidth=this.idef.labelWidth}if(!x.labelHeight){x.labelHeight=this.idef.labelHeight}if(typeof(x.wrap)!="undefined"){x.wrap=window.dhx4.s2b(x.wrap)}x.labelAlign=(this.align_css[x.labelAlign]?this.align_css[x.labelAlign]:this.align_css[this.idef.labelAlign]);x.inputWidth=(x.width?x.width:(x.inputWidth?x.inputWidth:this.idef.inputWidth));if(!x.inputHeight){x.inputHeight=this.idef.inputHeight}if(typeof(x.note)!="undefined"){if(x.note.length!=null&&x.note[0]!=null){x.note=x.note[0]}if(typeof(x.note.width)=="undefined"){x.note.width=this.idef.noteWidth}if(x.note.width=="auto"){x.note.width=x.inputWidth}}D.checkEvent=function(a){return e.checkEvent(a)};D.callEvent=function(a,q){return e.callEvent(a,q)};D.getForm=function(){return e.getForm()};D._autoCheck=function(a){e._autoCheck(a)};if(typeof(x.readonly)=="string"){x.readonly=window.dhx4.s2b(x.readonly)}if(typeof(x.autoStart)=="string"){x.autoStart=window.dhx4.s2b(x.autoStart)}if(typeof(x.autoRemove)=="string"){x.autoRemove=window.dhx4.s2b(x.autoRemove)}if(typeof(x.titleScreen)=="string"){x.titleScreen=window.dhx4.s2b(x.titleScreen)}if(typeof(x.info)=="string"){x.info=window.dhx4.s2b(x.info)}if(typeof(x.hidden)=="string"){x.hidden=window.dhx4.s2b(x.hidden)}if(typeof(x.checked)=="string"){x.checked=window.dhx4.s2b(x.checked)}if(typeof(x.userdata)!="undefined"){for(var H in x.userdata){this.getForm().setUserData(r,H,x.userdata[H])}}if(x.validate){if(typeof(x.validate!="undefined")&&(typeof(x.validate)=="function"||typeof(window[x.validate])=="function")){D._validate=[x.validate]}else{D._validate=String(x.validate).split(this.separator)}}if(typeof(x.required)!="undefined"){if(typeof(x.required)=="string"){x.required=window.dhx4.s2b(x.required)}D._required=(x.required==true)}if(D._required){if(!D._validate){D._validate=[]}var o=false;for(n=0;n<D._validate.length;n++){o=(o||(D._validate[n]=="NotEmpty"))}if(!o){D._validate.push("NotEmpty")}}D._ll=(x.position==this.apos_css["label-left"]||x.position==this.apos_css["label-top"]);this.objPull[this.idPrefix+r]=this.items[E].render(D,x);this.itemPull[this.idPrefix+r]=D};this._initObj=function(r,n){if(typeof(r.data)!="undefined"){var s=null;if(typeof(n)!="undefined"){s=n.match(/(\?|\&)id\=([a-z0-9_\-]*)/i);if(s!=null&&s[0]!=null){s=s[0].split("=")[1]}}if(this.callEvent("onBeforeDataLoad",[s,window.dhx4._copyObj(r.data)])===true){this.formId=s;this._last_load_data=r;this.setFormData(r.data);this.resetDataProcessor("updated")}return}this._prepare();for(var o=0;o<r.length;o++){if(typeof(r[o])!="undefined"&&r[o].type=="settings"){for(var m in r[o]){this.idef[m]=r[o][m]}}}for(var o=0;o<r.length;o++){this._prepareItem(r[o])}this._autoCheck()};this._prepareItem=function(q,u,o){var n=(q!=null&&q.type!=null?q.type:"");if(this.items[n]){if(!q.name){q.name=this._genStr(12)}var s=q.name;if(this.objPull[this.idPrefix+s]!=null||n=="radio"){s=this._genStr(12)}var r=q;r.label=r.label||"";r.value=r.value;r.checked=window.dhx4.s2b(r.checked);r.disabled=window.dhx4.s2b(r.disabled);r.name=r.name||this._genStr(12);r.options=r.options||[];r.rows=r.rows||"none";r.uid=this._genStr(12);this._addItem(n,s,r,null,null,u,o);u=null;if(this._parentEnabled===false){this._disableItem(s)}for(var m=0;m<r.options.length;m++){if(r.options[m].list!=null){if(!r.options[m].value){r.options[m].value=this._genStr()}var a=this._addItem("list",s,r.options[m].list,r.options[m].value,null);a._subSelect=true;a._subSelectId=r.options[m].value}}if(q.list!=null){if(!q.listParent){q.listParent=r.name}var a=this._addItem("list",s,q.list,null,q.listParent)}}};this._xmlSubItems={item:"list",option:"options",note:"note",userdata:"_userdata"};this._xmlToObject=function(C,m){if(typeof(m)=="undefined"){m=true}if(m){var E=C.getElementsByTagName("items");E=(E!=null&&E[0]!=null?E[0]:null);var n=C.getElementsByTagName("data");n=(n!=null&&n[0]!=null?n[0]:null)}else{E=C}var y=(m?[]:{});if(E!=null){for(var r=0;r<E.childNodes.length;r++){if(typeof(E.childNodes[r].tagName)!="undefined"){var s=E.childNodes[r].tagName;if(this._xmlSubItems[s]!=null){var u=this._xmlSubItems[s];if(typeof(y[u])=="undefined"){y[u]=[]}var A=E.childNodes[r];var x={};for(var J=0;J<A.attributes.length;J++){var F=A.attributes[J].name;var D=A.attributes[J].value;x[F]=D}if(u=="note"){x.text=A.firstChild.nodeValue}if(u=="_userdata"){x.value=(A.firstChild!=null&&A.firstChild.nodeValue!=null?A.firstChild.nodeValue:"")}var v=this._xmlToObject(A,false);for(var H in v){if(H=="_userdata"){if(!x.userdata){x.userdata={}}for(var J=0;J<v[H].length;J++){x.userdata[v[H][J].name]=v[H][J].value}}else{x[H]=v[H]}}A=null;if(m){y.push(x)}else{y[u].push(x)}}}}}if(n!=null){y={data:{}};for(var r=0;r<n.childNodes.length;r++){if(typeof(n.childNodes[r].tagName)!="undefined"){var o=n.childNodes[r].tagName;var I=(n.childNodes[r].firstChild!=null?n.childNodes[r].firstChild.nodeValue:"");y.data[o]=I}}}return y};this._autoCheck=function(s){if(this._locked===true){s=false}else{if(typeof(s)=="undefined"){s=true}}for(var o in this.itemPull){var u=(s&&(this.itemPull[o]._udis!==true));this[u?"_enableItem":"_disableItem"](this.itemPull[o]._idd);if(this.getForm()._idIndex[this.itemPull[o]._idd]!=null){this.getForm()._idIndex[this.itemPull[o]._idd].enabled=u}var n=(u&&(typeof(this.itemPull[o]._checked)=="boolean"?this.itemPull[o]._checked:true));if(this.itemPull[o]._list){for(var y=0;y<this.itemPull[o]._list.length;y++){var x=true;if(this.itemPull[o]._list[y]._subSelect==true){x=false;var r=this.getItemValue(this.itemPull[o]._idd);if(!(typeof(r)=="object"&&typeof(r.length)=="number")){r=[r]}for(var m=0;m<r.length;m++){x=(r[m]==this.itemPull[o]._list[y]._subSelectId)||x}this.itemPull[o]._listObj[y][x?"show":"hide"](this.itemPull[o]._listBase[y])}this.itemPull[o]._list[y]._autoCheck(n&&x)}}}};this.doWithItem=function(o,m,x,w,v,u){if(typeof(o)=="object"){var A=o[0];var y=o[1];var C=null;var s=null;for(var r in this.itemPull){if((this.itemPull[r]._value==y||y===null)&&this.itemPull[r]._group==A){return this.objPull[r][m](this.itemPull[r],x,w,v,u)}if(this.itemPull[r]._list!=null&&!s){for(var n=0;n<this.itemPull[r]._list.length;n++){s=this.itemPull[r]._list[n].doWithItem(o,m,x,w,v)}}}if(s!=null){return s}else{if(m=="getType"){return this.doWithItem(o[0],"getType")}}}else{if(!this.itemPull[this.idPrefix+o]){var s=null;for(var r in this.itemPull){if(this.itemPull[r]._list&&!s){for(var n=0;n<this.itemPull[r]._list.length;n++){if(s==null){s=this.itemPull[r]._list[n].doWithItem(o,m,x,w,v,u)}}}}return s}else{return this.objPull[this.idPrefix+o][m](this.itemPull[this.idPrefix+o],x,w,v,u)}}};this._removeItem=function(m,a){if(a!=null){m=this.doWithItem([m,a],"destruct")}else{this.doWithItem(m,"destruct")}this._clearItemData(m)};this._clearItemData=function(o){if(this.itemPull[this.idPrefix+o]){o=this.idPrefix+o;try{this.objPull[o]=null;this.itemPull[o]=null;delete this.objPull[o];delete this.itemPull[o]}catch(n){}}else{for(var a in this.itemPull){if(this.itemPull[a]._list){for(var m=0;m<this.itemPull[a]._list.length;m++){this.itemPull[a]._list[m]._clearItemData(o)}}}}};this.isItem=function(m,a){if(a!=null){m=[m,a]}return this.doWithItem(m,"isExist")};this.getItemType=function(m,a){m=[m,(a||null)];return this.doWithItem(m,"getType")};this.forEachItem=function(n){for(var m in this.objPull){if(this.objPull[m].t=="radio"){n(this.itemPull[m]._group,this.itemPull[m]._value)}else{n(String(m).replace(this.idPrefix,""))}if(this.itemPull[m]._list){for(var o=0;o<this.itemPull[m]._list.length;o++){this.itemPull[m]._list[o].forEachItem(n)}}}};this.setItemLabel=function(n,a,m){if(m!=null){n=[n,a]}else{m=a}this.doWithItem(n,"setText",m)};this.getItemLabel=function(m,a){if(a!=null){m=[m,a]}return this.doWithItem(m,"getText")};this._enableItem=function(a){this.doWithItem(a,"enable")};this._disableItem=function(a){this.doWithItem(a,"disable")};this._isItemEnabled=function(a){return this.doWithItem(a,"isEnabled")};this.checkItem=function(m,a){if(a!=null){m=[m,a]}this.doWithItem(m,"check");this._autoCheck()};this.uncheckItem=function(m,a){if(a!=null){m=[m,a]}this.doWithItem(m,"unCheck");this._autoCheck()};this.isItemChecked=function(m,a){if(a!=null){m=[m,a]}return this.doWithItem(m,"isChecked")};this.getCheckedValue=function(a){return this.doWithItem([a,null],"getChecked")};this._getRGroup=function(u,s){for(var m in this.itemPull){if(this.itemPull[m]._group==u&&(s==null||this.itemPull[m]._value==s)){return this.itemPull[m]._idd}if(this.itemPull[m]._list!=null){for(var o=0;o<this.itemPull[m]._list.length;o++){var n=this.itemPull[m]._list[o]._getRGroup(u,s);if(n!=null){return n}}}}return null};this.setItemValue=function(m,a){this.resetValidateCss(m,a);if(this.getItemType(m)=="radio"){if(this._getRGroup(m,a)!=null){this.checkItem(m,a)}else{this.uncheckItem(m,this.getCheckedValue(m))}return null}return this.doWithItem(m,"setValue",a)};this.getItemValue=function(m,a){if(this.getItemType(m)=="radio"){return this.getCheckedValue(m)}return this.doWithItem(m,"getValue",a)};this.updateValues=function(){this._updateValues()};this.showItem=function(m,a){if(a!=null){m=[m,a]}this.doWithItem(m,"show")};this.hideItem=function(m,a){if(a!=null){m=[m,a]}this.doWithItem(m,"hide")};this.isItemHidden=function(m,a){if(a!=null){m=[m,a]}return this.doWithItem(m,"isHidden")};this.getOptions=function(a){return this.doWithItem(a,"getOptions")};this.setItemWidth=function(m,a){this.doWithItem(m,"setWidth",a)};this.getItemWidth=function(a){return this.doWithItem(a,"getWidth")};this.setItemHeight=function(m,a){this.doWithItem(m,"setHeight",a)};this.setItemFocus=function(m,a){if(a!=null){m=[m,a]}this.doWithItem(m,"setFocus")};this._updateValues=function(){for(var m in this.itemPull){if(this.objPull[m]&&typeof(this.objPull[m].updateValue)=="function"){this.objPull[m].updateValue(this.itemPull[m])}if(this.itemPull[m]._list){for(var n=0;n<this.itemPull[m]._list.length;n++){this.itemPull[m]._list[n]._updateValues()}}}};this._getItemByName=function(s){for(var m in this.itemPull){if(this.itemPull[m]._idd==s){return this.itemPull[m]}if(this.itemPull[m]._list!=null){for(var o=0;o<this.itemPull[m]._list.length;o++){var n=this.itemPull[m]._list[o]._getItemByName(s);if(n!=null){return n}}}}return null};this._resetValidateCss=function(a){a.className=(a.className).replace(a._vcss,"");a._vcss=null};this.setValidateCss=function(a,o,n){var m=this[this.getItemType(a)=="radio"?"_getRGroup":"_getItemByName"](a);if(!m){return}if(m._vcss!=null){this._resetValidateCss(m)}m._vcss=(typeof(n)=="string"?n:"validate_"+(o===true?"ok":"error"));m.className+=" "+m._vcss};this.resetValidateCss=function(n){for(var m in this.itemPull){if(this.itemPull[m]._vcss!=null){this._resetValidateCss(this.itemPull[m])}if(this.itemPull[m]._list!=null){for(var o=0;o<this.itemPull[m]._list.length;o++){this.itemPull[m]._list[o].resetValidateCss()}}}};this.validate=function(m){if(this.callEvent("onBeforeValidate",[])==false){return}var a=true;this.forEachItem(function(o,q){if(typeof(q)!="undefined"){o=[o,q]}var n=e.doWithItem(o,"_validate");if(typeof(n)!="boolean"){n=true}a=n&&a});this.callEvent("onAfterValidate",[a]);return a};this.validateItem=function(a,m){if(typeof(m)!="undefined"){a=[a,m]}return this.doWithItem(a,"_validate")};this.enableLiveValidation=function(a){this.live_validate=(a==true)};this.setReadonly=function(m,a){this.doWithItem(m,"setReadonly",a)};this.isReadonly=function(a){return this.doWithItem(a,"isReadonly")};this.getFirstActive=function(m){for(var o=0;o<this._indexId.length;o++){var a=true;if(m==true){var n=this.getItemType(this._indexId[o]);if(!dhtmlXForm.prototype.items[n].setFocus){a=false}}if(a&&this._idIndex[this._indexId[o]].enabled){return this._indexId[o]}}return null};this.setFocusOnFirstActive=function(){var a=this.getFirstActive(true);if(a!=null){this.setItemFocus(a)}};this.enableItem=function(m,a){if(a!=null){m=[m,a]}this.doWithItem(m,"userEnable");this._autoCheck()};this.disableItem=function(m,a){if(a!=null){m=[m,a]}this.doWithItem(m,"userDisable");this._autoCheck()};this.isItemEnabled=function(m,a){if(a!=null){m=[m,a]}return this.doWithItem(m,"isUserEnabled")};this.clear=function(){var m={};this.formId=(new Date()).valueOf();this.resetDataProcessor("inserted");for(var n in this.itemPull){var o=this.itemPull[n]._idd;if(this.itemPull[n]._type=="ch"){this.uncheckItem(o)}if(this.itemPull[n]._type in {ta:1,editor:1,calendar:1,pw:1,hd:1}){this.setItemValue(o,"")}if(this.itemPull[n]._type=="combo"){this.itemPull[n]._apiChange=true;var v=this.getCombo(o);v.selectOption(0);v=null;this.itemPull[n]._apiChange=false}if(this.itemPull[n]._type=="se"){var s=this.getOptions(o);if(s.length>0){s[0].selected=true}}if(this.itemPull[n]._type=="ra"){var r=this.itemPull[n]._group;if(!m[r]){this.checkItem(r,this.doWithItem(o,"_getFirstValue"));m[r]=true}}if(this.itemPull[n]._list){for(var u=0;u<this.itemPull[n]._list.length;u++){this.itemPull[n]._list[u].clear()}}if(this["setFormData_"+this.itemPull[n]._type]){this["setFormData_"+this.itemPull[n]._type](o,"")}}m=null;if(this._parentForm){this._autoCheck()}this.resetValidateCss()};this.unload=function(){window.dhx4._enableDataLoading(this,null,null,null,"clear");window.dhx4._eventable(this,"clear");for(var m in this.objPull){this._removeItem(String(m).replace(this.idPrefix,""))}if(this._ccTm){window.clearTimeout(this._ccTm)}this._formLS=null;for(var n=0;n<this.base.length;n++){while(this.base[n].childNodes.length>0){this.base[n].removeChild(this.base[n].childNodes[0])}if(this.base[n].parentNode){this.base[n].parentNode.removeChild(this.base[n])}this.base[n]=null}this.base=null;this.cont.onkeypress=null;this.cont.className="";this.cont=null;for(var m in this){this[m]=null}e=null};for(var c in this.items){this.items[c].t=c;if(typeof(this.items[c]._index)=="undefined"){this.items[c]._index=true}if(!this.items[c].show){this.items[c].show=function(a){a.style.display="";if(a._listObj){for(var m=0;m<a._listObj.length;m++){a._listObj[m].show(a._listBase[m])}}}}if(!this.items[c].hide){this.items[c].hide=function(a){a.style.display="none";if(a._listObj){for(var m=0;m<a._listObj.length;m++){a._listObj[m].hide(a._listBase[m])}}}}if(!this.items[c].isHidden){this.items[c].isHidden=function(a){return(a.style.display=="none")}}if(!this.items[c].userEnable){this.items[c].userEnable=function(a){a._udis=false}}if(!this.items[c].userDisable){this.items[c].userDisable=function(a){a._udis=true}}if(!this.items[c].isUserEnabled){this.items[c].isUserEnabled=function(a){return(a._udis!==true)}}if(!this.items[c].getType){this.items[c].getType=function(){return this.t}}if(!this.items[c].isExist){this.items[c].isExist=function(){return true}}if(!this.items[c]._validate){this.items[c]._validate=function(n){if(!n._validate||!n._enabled){return true}if(n._type=="ch"){var u=(this.isChecked(n)?this.getValue(n):0)}else{var u=this.getValue(n)}var m=true;for(var s=0;s<n._validate.length;s++){var a="is"+n._validate[s];if((u==null||u.length==0)&&a!="isNotEmpty"&&n._type!="container"){}else{var o=dhtmlxValidation[a];if(n._type=="container"&&typeof(o)=="function"){o=function(){return true}}if(typeof(o)!="function"&&typeof(n._validate[s])=="function"){o=n._validate[s]}if(typeof(o)!="function"&&typeof(window[n._validate[s]])=="function"){o=window[n._validate[s]]}m=((typeof(o)=="function"?o(u,n._idd):new RegExp(n._validate[s]).test(u))&&m);o=null}}if(!(n.callEvent("onValidate"+(m?"Success":"Error"),[n._idd,u,m])===false)){n.getForm().setValidateCss(n._idd,m)}return m}}}this._locked=false;this._doLock=function(m){var a=(m===true?true:false);if(this._locked==a){return}else{this._locked=a}this._autoCheck(!this._locked)};this.lock=function(){this._doLock(true)};this.unlock=function(){this._doLock(false)};this.isLocked=function(){return this._locked};this.setNumberFormat=function(o,m,a,n){return this.doWithItem(o,"setNumberFormat",m,a,n)};window.dhx4._enableDataLoading(this,"_initObj","_xmlToObject","items",{struct:true,data:true});window.dhx4._eventable(this);this.attachEvent("_onButtonClick",function(a,m){this.callEvent("onButtonClick",[a,m])});this._updateBlocks=function(){this.forEachItem(function(a){if(e.getItemType(a)=="block"||e.getItemType(a)=="combo"){e.doWithItem(a,"_setCss",e.skin,e.cont.style.fontSize)}})};this._isObj=function(a){return(a!=null&&typeof(a)=="object"&&typeof(a.length)=="undefined")};this._copyObj=function(o){if(this._isObj(o)){var n={};for(var m in o){if(typeof(o[m])=="object"&&o[m]!=null){n[m]=this._copyObj(o[m])}else{n[m]=o[m]}}}else{var n=[];for(var m=0;m<o.length;m++){if(typeof(o[m])=="object"&&o[m]!=null){n[m]=this._copyObj(o[m])}else{n[m]=o[m]}}}return n};if(g!=null&&typeof(g)=="object"){this._initObj(this._copyObj(g))}if(this._parentForm){this._updateBlocks()}this._ccActive=false;this._ccTm=null;return this}dhtmlXForm.prototype.getInput=function(a){return this.doWithItem(a,"getInput")};dhtmlXForm.prototype.getSelect=function(a){return this.doWithItem(a,"getSelect")};dhtmlXForm.prototype.items={};dhtmlXForm.prototype.items.checkbox={render:function(a,c){a._type="ch";a._enabled=true;a._checked=false;a._value=(typeof(c.value)=="undefined"?null:String(c.value));a._ro=(c.readonly==true);if(c._autoInputWidth!==false){c.inputWidth=14}this.doAddLabel(a,c);this.doAddInput(a,c,"INPUT","TEXT",true,true,"dhxform_textarea");a.childNodes[a._ll?1:0].className+=" dhxform_img_node";var e=document.createElement("DIV");e.className="dhxform_img chbx0";a.appendChild(e);if(!isNaN(c.inputLeft)){a.childNodes[a._ll?1:0].style.left=parseInt(c.inputLeft)+"px"}if(!isNaN(c.inputTop)){a.childNodes[a._ll?1:0].style.top=parseInt(c.inputTop)+"px"}a.childNodes[a._ll?1:0].appendChild(e);a.childNodes[a._ll?1:0].firstChild.value=String(c.value);a._updateImgNode=function(h,l){var g=h.childNodes[h._ll?1:0].lastChild;g.className=(l?"dhxform_actv_c":"dhxform_img")+" "+(h._checked?"chbx1":"chbx0");h=g=null};a._doOnFocus=function(g){g.getForm().callEvent("onFocus",[g._idd])};a._doOnBlur=function(g){g.getForm().callEvent("onBlur",[g._idd])};a._doOnKeyUpDown=function(h,g){this.callEvent(h,[this.childNodes[this._ll?0:1].childNodes[0],g,this._idd])};if(c.checked==true){this.check(a)}if(c.hidden==true){this.hide(a)}if(c.disabled==true){this.userDisable(a)}this.doAttachEvents(a);return this},destruct:function(a){a._doOnFocus=a._doOnBlur=a._updateImgNode=null;this.doUnloadNestedLists(a);this.doDestruct(a)},doAddLabel:function(c,e){var a=document.createElement("DIV");a.className="dhxform_label "+e.labelAlign;if(e.wrap==true){a.style.whiteSpace="normal"}if(c._ll){c.insertBefore(a,c.firstChild)}else{c.appendChild(a)}if(typeof(e.tooltip)!="undefined"){a.title=e.tooltip}a.innerHTML="<div class='dhxform_label_nav_link' onfocus='if(this.parentNode.parentNode._updateImgNode)this.parentNode.parentNode._updateImgNode(this.parentNode.parentNode,true);this.parentNode.parentNode._doOnFocus(this.parentNode.parentNode);' onblur='if(this.parentNode.parentNode._updateImgNode)this.parentNode.parentNode._updateImgNode(this.parentNode.parentNode,false);this.parentNode.parentNode._doOnBlur(this.parentNode.parentNode);' onkeypress='var e=event||window.arguments[0];if(e.keyCode==32||e.charCode==32){e.cancelBubble=true;if(e.preventDefault)e.preventDefault();else e.returnValue=false;_dhxForm_doClick(this,\"mousedown\");return false;}' onkeyup='var e=event||window.arguments[0];this.parentNode.parentNode._doOnKeyUpDown(\"onKeyUp\",e);' onkeydown='var e=event||window.arguments[0];this.parentNode.parentNode._doOnKeyUpDown(\"onKeyDown\",e);' "+(window.dhx4.isIPad?"ontouchstart='var e=event;e.preventDefault();_dhxForm_doClick(this,\"mousedown\");' ":"")+"role='link' tabindex='0'>"+e.label+(e.info?"<span class='dhxform_info'>[?]</span>":"")+(c._required?"<span class='dhxform_item_required'>*</span>":"")+"</div>";if(!isNaN(e.labelWidth)){a.firstChild.style.width=parseInt(e.labelWidth)+"px"}if(!isNaN(e.labelHeight)){a.firstChild.style.height=parseInt(e.labelHeight)+"px"}if(!isNaN(e.labelLeft)){a.style.left=parseInt(e.labelLeft)+"px"}if(!isNaN(e.labelTop)){a.style.top=parseInt(e.labelTop)+"px"}},doAddInput:function(v,g,c,o,q,h,l){var a=document.createElement("DIV");a.className="dhxform_control";if(v._ll){v.appendChild(a)}else{v.insertBefore(a,v.firstChild)}var s=document.createElement(c);s.className=l;s.name=v._idd;s._idd=v._idd;s.id=g.uid;if(typeof(o)=="string"){s.type=o}if(c=="INPUT"||c=="TEXTAREA"){s.onkeyup=function(u){u=u||event;v.callEvent("onKeyUp",[this,u,this._idd])};s.onkeydown=function(u){u=u||event;v.callEvent("onKeyDown",[this,u,this._idd])}}a.appendChild(s);if(g.readonly){this.setReadonly(v,true)}if(g.hidden==true){this.hide(v)}if(g.disabled==true){this.userDisable(v)}if(q){if(!isNaN(g.inputLeft)){a.style.left=parseInt(g.inputLeft)+"px"}if(!isNaN(g.inputTop)){a.style.top=parseInt(g.inputTop)+"px"}}var r="";var m=false;if(h){if(!isNaN(g.inputWidth)){r+="width:"+parseInt(g.inputWidth)+"px;";m=true}if(!isNaN(g.inputHeight)){r+="height:"+parseInt(g.inputHeight)+"px;"}}if(typeof(g.style)=="string"){r+=g.style}s.style.cssText=r;if(g.maxLength){s.setAttribute("maxLength",g.maxLength)}if(g.connector){s.setAttribute("connector",g.connector)}var e=(dhtmlXForm.prototype.items[this.t]!=null?dhtmlXForm.prototype.items[this.t]._dimFix==true:false);if(m&&({input:1,password:1,select:1,multiselect:1,calendar:1,colorpicker:1}[this.t]==1||e)){if(dhtmlXForm.prototype.items[this.t]._dim==null){dhtmlXForm.prototype.items[this.t]._dim=v.getForm()._checkDim(a,s)}s.style.width=parseInt(s.style.width)-dhtmlXForm.prototype.items[this.t]._dim+"px"}if(typeof(g.note)=="object"){var n=document.createElement("DIV");n.className="dhxform_note";n.style.width=(isNaN(g.note.width)?s.offsetWidth:parseInt(g.note.width))+"px";n._w=g.note.width;n.innerHTML=g.note.text;a.appendChild(n);n=null}},doUnloadNestedLists:function(a){if(!a._list){return}for(var c=0;c<a._list.length;c++){a._list[c].unload();a._list[c]=null;a._listObj[c]=null;a._listBase[c].parentNode.removeChild(a._listBase[c]);a._listBase[c]=null}a._list=null;a._listObj=null;a._listBase=null},doDestruct:function(a){a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._checked=null;a._enabled=null;a._idd=null;a._type=null;a._value=null;a._group=null;a.onselectstart=null;a.childNodes[a._ll?1:0].onmousedown=null;a.childNodes[a._ll?1:0].ontouchstart=null;a.childNodes[a._ll?0:1].onmousedown=null;a.childNodes[a._ll?0:1].ontouchstart=null;a.childNodes[a._ll?0:1].childNodes[0].onfocus=null;a.childNodes[a._ll?0:1].childNodes[0].onblur=null;a.childNodes[a._ll?0:1].childNodes[0].onkeypress=null;a.childNodes[a._ll?0:1].childNodes[0].onkeyup=null;a.childNodes[a._ll?0:1].childNodes[0].onkeydown=null;a.childNodes[a._ll?0:1].childNodes[0].onmousedown=null;a.childNodes[a._ll?0:1].childNodes[0].ontouchstart=null;a.childNodes[a._ll?0:1].removeChild(a.childNodes[a._ll?0:1].childNodes[0]);while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},doAttachEvents:function(c){var a=this;c.childNodes[c._ll?1:0][window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(h){h=h||event;if(h.preventDefault){h.preventDefault()}var g=(h.target||h.srcElement);if(!this.parentNode._enabled||this.parentNode._ro||(typeof(g.className)!="undefined"&&g.className=="dhxform_note")){h.cancelBubble=true;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}return false}a.doClick(this.parentNode)};c.childNodes[c._ll?0:1].childNodes[0][window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(h){h=h||event;if(h.preventDefault){h.preventDefault()}if(!this.parentNode.parentNode._enabled){h.cancelBubble=true;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}return false}var g=h.target||h.srcElement;if(typeof(g.className)!="undefined"&&g.className=="dhxform_info"){this.parentNode.parentNode.callEvent("onInfo",[this.parentNode.parentNode._idd,h]);h.cancelBubble=true;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}return false}a.doClick(this.parentNode.parentNode)}},doClick:function(a){a.childNodes[a._ll?0:1].childNodes[0].focus();if(!a._enabled||a._ro){return}if(a.checkEvent("onBeforeChange")){if(a.callEvent("onBeforeChange",[a._idd,a._value,a._checked])!==true){return}}this.setChecked(a,!a._checked);a._autoCheck();a.callEvent("onChange",[a._idd,a._value,a._checked])},doCheckValue:function(a){if(a._checked&&a._enabled){a.childNodes[a._ll?1:0].firstChild.name=String(a._idd);a.childNodes[a._ll?1:0].firstChild.value=this.getValue(a)}else{a.childNodes[a._ll?1:0].firstChild.name="";a.childNodes[a._ll?1:0].firstChild.value=""}},setChecked:function(a,c){a._checked=(c===true?true:false);a.childNodes[a._ll?1:0].lastChild.className=a.childNodes[a._ll?1:0].lastChild.className.replace(/chbx[0-1]{1}/gi,"")+(a._checked?" chbx1":" chbx0");this.doCheckValue(a)},check:function(a){this.setChecked(a,true)},unCheck:function(a){this.setChecked(a,false)},isChecked:function(a){return a._checked},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a.childNodes[a._ll?0:1].childNodes[0].tabIndex=0;a.childNodes[a._ll?0:1].childNodes[0].removeAttribute("disabled");this.doCheckValue(a)},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;if(a._updateImgNode!=null){a._updateImgNode(a,false)}a.childNodes[a._ll?0:1].childNodes[0].tabIndex=-1;a.childNodes[a._ll?0:1].childNodes[0].setAttribute("disabled","true");this.doCheckValue(a)},isEnabled:function(a){return a._enabled},setText:function(a,c){a.childNodes[a._ll?0:1].childNodes[0].innerHTML=c+(a._required?"<span class='dhxform_item_required'>*</span>":"")},getText:function(a){return a.childNodes[a._ll?0:1].childNodes[0].innerHTML.replace(/<span class=\"dhxform_item_required\">[^<]*<\/span>/g,"")},setValue:function(a,c){this.setChecked(a,(c===true||parseInt(c)==1||c=="true"||a._value===c))},getValue:function(a,c){if(c=="realvalue"){return a._value}return((typeof(a._value)=="undefined"||a._value==null)?(a._checked?1:0):a._value)},setReadonly:function(a,c){a._ro=(c===true)},isReadonly:function(a){return a._ro},setFocus:function(a){a.childNodes[a._ll?0:1].childNodes[0].focus()}};dhtmlXForm.prototype.items.radio={input:{},r:{},firstValue:{},render:function(e,g,c){e._type="ra";e._enabled=true;e._checked=false;e._group=g.name;e._value=g.value;e._uid=c;e._ro=(g.readonly==true);e._rName=e._rId+e._group;this.r[e._idd]=e;g.inputWidth=14;this.doAddLabel(e,g);this.doAddInput(e,g,"INPUT","TEXT",true,true,"dhxform_textarea");e.childNodes[e._ll?1:0].className+=" dhxform_img_node";var h=document.createElement("DIV");h.className="dhxform_img rdbt0";e.appendChild(h);if(!isNaN(g.inputLeft)){e.childNodes[e._ll?1:0].style.left=parseInt(g.inputLeft)+"px"}if(!isNaN(g.inputTop)){e.childNodes[e._ll?1:0].style.top=parseInt(g.inputTop)+"px"}e.childNodes[e._ll?1:0].appendChild(h);e.childNodes[e._ll?1:0].firstChild.name="";e.childNodes[e._ll?1:0].firstChild.value="";e._updateImgNode=function(m,n){var l=m.childNodes[m._ll?1:0].lastChild;l.className=(n?"dhxform_actv_r":"dhxform_img")+" "+(m._checked?"rdbt1":"rdbt0");m=l=null};e._doOnFocus=function(l){l.getForm().callEvent("onFocus",[l._group,l._value])};e._doOnBlur=function(l){l.getForm().callEvent("onBlur",[l._group,l._value])};e._doOnKeyUpDown=function(m,l){this.callEvent(m,[this.childNodes[this._ll?0:1].childNodes[0],l,this._group,this._value])};if(this.input[e._rName]==null){var a=document.createElement("INPUT");a.type="HIDDEN";a.name=g.name;a.firstValue=e._value;e.appendChild(a);this.input[e._rName]=a}if(!this.firstValue[e._rName]){this.firstValue[e._rName]=g.value}if(g.checked==true){this.check(e)}if(g.hidden==true){this.hide(e)}if(g.disabled==true){this.userDisable(e)}this.doAttachEvents(e);return this},destruct:function(g,h){if(g.lastChild==this.input[g._rName]){var e=false;for(var c in this.r){if(!e&&this.r[c]._group==g._group&&this.r[c]._idd!=g._idd){this.r[c].appendChild(this.input[g._rName]);e=true}}if(!e){this.input[g._rName].parentNode.removeChild(this.input[g._rName]);this.input[g._rName]=null;this.firstValue[g._rName]=null}}var l=g._idd;g._doOnFocus=g._doOnBlur=g._updateImgNode=null;this.doUnloadNestedLists(g);this.doDestruct(g);return l},doClick:function(c){c.childNodes[c._ll?0:1].childNodes[0].focus();if(!(c._enabled&&!c._checked)){return}if(c._ro){return}var a=[c._group,c._value,true];if(c.checkEvent("onBeforeChange")){if(c.callEvent("onBeforeChange",a)!==true){return}}this.setChecked(c,true);c.getForm()._autoCheck();c.callEvent("onChange",a)},doCheckValue:function(e){var g=null;for(var c in this.r){if(this.r[c]._checked&&this.r[c]._group==e._group&&this.r[c]._rId==e._rId){g=this.r[c]._value}}if(g!=null&&this.r[c]._enabled){this.input[e._rName].name=String(e._group);this.input[e._rName].value=g}else{this.input[e._rName].name="";this.input[e._rName].value=""}this.input[e._rName]._value=g},setChecked:function(h,l){l=(l===true);for(var c in this.r){if(this.r[c]._group==h._group&&this.r[c]._rId==h._rId){var g=false;if(this.r[c]._idd==h._idd){if(this.r[c]._checked!=l){this.r[c]._checked=l;g=true}}else{if(this.r[c]._checked){this.r[c]._checked=false;g=true}}if(g){var e=this.r[c].childNodes[this.r[c]._ll?1:0].childNodes[1];e.className=e.className.replace(/rdbt[0-1]{1}/gi,"")+(this.r[c]._checked?" rdbt1":" rdbt0");e=null}}}this.doCheckValue(h)},getChecked:function(a){return this.input[a._rName]._value},_getFirstValue:function(a){return this.firstValue[a._rName]},_getId:function(a){return a._idd},setValue:function(a,c){}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doDestruct:1,doUnloadNestedLists:1,doAttachEvents:1,check:1,unCheck:1,isChecked:1,enable:1,disable:1,isEnabled:1,setText:1,getText:1,getValue:1,setReadonly:1,isReadonly:1,setFocus:1}){dhtmlXForm.prototype.items.radio[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.select={render:function(a,c){a._type="se";a._enabled=true;a._value=null;a._newValue=null;this.doAddLabel(a,c);this.doAddInput(a,c,"SELECT",null,true,true,"dhxform_select");this.doAttachEvents(a);this.doLoadOpts(a,c);if(c.connector!=null){this.doLoadOptsConnector(a,c.connector)}if(typeof(c.value)!="undefined"&&c.value!=null){this.setValue(a,c.value)}return this},destruct:function(a){this.doUnloadNestedLists(a);a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._enabled=null;a._idd=null;a._type=null;a._value=null;a._newValue=null;a.onselectstart=null;a.childNodes[a._ll?1:0].childNodes[0].onclick=null;a.childNodes[a._ll?1:0].childNodes[0].onkeydown=null;a.childNodes[a._ll?1:0].childNodes[0].onchange=null;a.childNodes[a._ll?1:0].childNodes[0].onfocus=null;a.childNodes[a._ll?1:0].childNodes[0].onblur=null;a.childNodes[a._ll?1:0].childNodes[0].onkeyup=null;a.childNodes[a._ll?1:0].removeChild(a.childNodes[a._ll?1:0].childNodes[0]);while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},doAddLabel:function(c,e){var a=document.createElement("DIV");a.className="dhxform_label "+e.labelAlign;a.innerHTML="<label for='"+e.uid+"'>"+e.label+(e.info?"<span class='dhxform_info'>[?]</span>":"")+(c._required?"<span class='dhxform_item_required'>*</span>":"")+"</label>";if(e.wrap==true){a.style.whiteSpace="normal"}if(typeof(e.tooltip)!="undefined"){a.title=e.tooltip}c.appendChild(a);if(typeof(e.label)=="undefined"||e.label==null||e.label.length==0){a.style.display="none"}if(!isNaN(e.labelWidth)){a.style.width=parseInt(e.labelWidth)+"px"}if(!isNaN(e.labelHeight)){a.style.height=parseInt(e.labelHeight)+"px"}if(!isNaN(e.labelLeft)){a.style.left=parseInt(e.labelLeft)+"px"}if(!isNaN(e.labelTop)){a.style.top=parseInt(e.labelTop)+"px"}if(e.info){a.onclick=function(h){h=h||event;var g=h.target||h.srcElement;if(typeof(g.className)!="undefined"&&g.className=="dhxform_info"){this.parentNode.callEvent("onInfo",[this.parentNode._idd,h]);h.cancelBubble=true;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}return false}}}},doAttachEvents:function(e){var a=e.childNodes[e._ll?1:0].childNodes[0];var c=this;a.onclick=function(){c.doOnChange(this)};a.onkeydown=function(g){g=g||event;c.doOnChange(this);this.parentNode.parentNode.callEvent("onKeyDown",[this,g,this.parentNode.parentNode._idd])};a.onchange=function(){c.doOnChange(this)};a.onkeyup=function(g){g=g||event;this.parentNode.parentNode.callEvent("onKeyUp",[this,g,this.parentNode.parentNode._idd])};a=null;this.doAttachChangeLS(e)},doAttachChangeLS:function(c){var a=c.childNodes[c._ll?1:0].childNodes[0];a.onfocus=function(){var e=this.parentNode.parentNode;e.getForm()._ccActivate(e._idd,this,e.getForm().getItemValue(e._idd,true));e.getForm().callEvent("onFocus",[e._idd]);e=null};a.onblur=function(){var e=this.parentNode.parentNode;e.getForm()._ccDeactivate(e._idd);e.getForm().callEvent("onBlur",[e._idd]);e=null};a=null},doValidate:function(a){if(a.getForm().live_validate){this._validate(a)}},doLoadOpts:function(m,h,o){var n=m.childNodes[m._ll?1:0].childNodes[0];var a=h.options;var g=false;for(var c=0;c<a.length;c++){var l=a[c].text||a[c].label;if(!l||typeof(l)=="undefined"){l=""}var e=new Option(l,a[c].value);if(typeof(a[c].img_src)=="string"){e.setAttribute("img_src",a[c].img_src)}n.options.add(e);if(typeof(a[c].selected)!="undefined"&&window.dhx4.s2b(a[c].selected)==true){e.selected=true;m._value=a[c].value;g=true}if(typeof(a[c].checked)!="undefined"&&window.dhx4.s2b(a[c].checked)==true){e.setAttribute("checked","1")}if(typeof(a[c].img)!="undefined"){e.setAttribute("img",a[c].img)}if(typeof(a[c].img_dis)!="undefined"){e.setAttribute("img_dis",a[c].img_dis)}if(typeof(a[c].css)!="undefined"){e.setAttribute("css",a[c].css)}}if(!g&&n.selectedIndex>=0){m._value=n.options[n.selectedIndex].value}if(o===true){m.callEvent("onOptionsLoaded",[m._idd])}this._checkNoteWidth(m)},doLoadOptsConnector:function(e,a){var c=this;e._connector_working=true;window.dhx4.ajax.get(a,function(m){m=m.xmlDoc.responseXML;if(m==null){return}var g=m.getElementsByTagName("data");if(g==null||g[0]==null){return}g=g[0];var l=[];for(var n=0;n<g.childNodes.length;n++){if(typeof(g.childNodes[n].tagName)!="undefined"&&String(g.childNodes[n].tagName).toLowerCase()=="item"){var h=g.childNodes[n];l.push({label:h.getAttribute("label"),value:h.getAttribute("value"),selected:(h.getAttribute("selected")!=null)});h=null}}c.doLoadOpts(e,{options:l},true);e._connector_working=false;if(e._connector_value!=null){c.setValue(e,e._connector_value);e._connector_value=null}c=e=null})},doOnChange:function(e){var a=e.parentNode.parentNode;a._newValue=(e.selectedIndex>=0?e.options[e.selectedIndex].value:null);if(a._newValue!=a._value){if(a.checkEvent("onBeforeChange")){if(a.callEvent("onBeforeChange",[a._idd,a._value,a._newValue])!==true){for(var c=0;c<e.options.length;c++){if(e.options[c].value==a._value){e.options[c].selected=true}}return}}a._value=a._newValue;a.callEvent("onChange",[a._idd,a._value]);if(a._type=="se"&&a.getForm().live_validate){this._validate(a)}}a._autoCheck()},setText:function(a,c){if(!c){c=""}a.childNodes[a._ll?0:1].childNodes[0].innerHTML=c+(a._required?"<span class='dhxform_item_required'>*</span>":"");a.childNodes[a._ll?0:1].style.display=(c.length==0||c==null?"none":"")},getText:function(a){return a.childNodes[a._ll?0:1].childNodes[0].innerHTML.replace(/<span class=\"dhxform_item_required\">[^<]*<\/span>/g,"")},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a.childNodes[a._ll?1:0].childNodes[0].removeAttribute("disabled")},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a.childNodes[a._ll?1:0].childNodes[0].setAttribute("disabled",true)},getOptions:function(a){return a.childNodes[a._ll?1:0].childNodes[0].options},setValue:function(c,g){if(c._connector_working){c._connector_value=g;return}var a=this.getOptions(c);for(var e=0;e<a.length;e++){if(a[e].value==g){a[e].selected=true;c._value=a[e].value}}if(c._list!=null&&c._list.length>0){c.getForm()._autoCheck()}c.getForm()._ccReload(c._idd,c._value)},getValue:function(e){var a=-1;var c=this.getOptions(e);for(var g=0;g<c.length;g++){if(c[g].selected){a=c[g].value}}return a},setWidth:function(c,a){c.childNodes[c._ll?1:0].childNodes[0].style.width=a+"px"},getSelect:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},setFocus:function(a){a.childNodes[a._ll?1:0].childNodes[0].focus()},_checkNoteWidth:function(c){var a;if(c.childNodes[c._ll?1:0].childNodes[1]!=null){a=c.childNodes[c._ll?1:0].childNodes[1];if(a.className!=null&&a.className.search(/dhxform_note/gi)>=0&&a._w=="auto"){a.style.width=c.childNodes[c._ll?1:0].childNodes[0].offsetWidth+"px"}}a=null}};(function(){for(var c in {doAddInput:1,doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.select[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.multiselect={doLoadOpts:function(g,l,m){var c=g.childNodes[g._ll?1:0].childNodes[0];c.multiple=true;if(!isNaN(l.size)){c.size=Number(l.size)}g._value=[];g._newValue=[];var e=l.options;for(var h=0;h<e.length;h++){var a=new Option(e[h].text||e[h].label,e[h].value);c.options.add(a);if(e[h].selected==true||e[h].selected=="true"){a.selected=true;g._value.push(e[h].value)}}if(m===true){g.callEvent("onOptionsLoaded",[g._idd])}this._checkNoteWidth(g)},doAttachEvents:function(e){var a=e.childNodes[e._ll?1:0].childNodes[0];var c=this;a.onfocus=function(){c.doOnChange(this);var g=this.parentNode.parentNode;g.getForm().callEvent("onFocus",[g._idd]);g=null};a.onblur=function(){c.doOnChange(this);var g=this.parentNode.parentNode;g.getForm().callEvent("onBlur",[g._idd]);g=null};a.onclick=function(){c.doOnChange(this);var g=this.parentNode.parentNode;g._autoCheck();g=null}},doOnChange:function(g){var c=g.parentNode.parentNode;c._newValue=[];for(var e=0;e<g.options.length;e++){if(g.options[e].selected){c._newValue.push(g.options[e].value)}}if((c._value).sort().toString()!=(c._newValue).sort().toString()){if(c.checkEvent("onBeforeChange")){if(c.callEvent("onBeforeChange",[c._idd,c._value,c._newValue])!==true){var a={};for(var e=0;e<c._value.length;e++){a[c._value[e]]=true}for(var e=0;e<g.options.length;e++){g.options[e].selected=(a[g.options[e].value]==true)}a=null;return}}c._value=[];for(var e=0;e<c._newValue.length;e++){c._value.push(c._newValue[e])}c.callEvent("onChange",[c._idd,c._value])}c._autoCheck()},setValue:function(e,h){var a={};if(typeof(h)=="string"){h=h.split(",")}if(typeof(h)!="object"){h=[h]}for(var g=0;g<h.length;g++){a[h[g]]=true}var c=this.getOptions(e);for(var g=0;g<c.length;g++){c[g].selected=(a[c[g].value]==true)}e._autoCheck()},getValue:function(e){var a=[];var c=this.getOptions(e);for(var g=0;g<c.length;g++){if(c[g].selected){a.push(c[g].value)}}return a}};(function(){for(var c in dhtmlXForm.prototype.items.select){if(!dhtmlXForm.prototype.items.multiselect[c]){dhtmlXForm.prototype.items.multiselect[c]=dhtmlXForm.prototype.items.select[c]}}})();dhtmlXForm.prototype.items.input={render:function(l,m){var h=(!isNaN(m.rows));l._type="ta";l._enabled=true;this.doAddLabel(l,m);this.doAddInput(l,m,(h?"TEXTAREA":"INPUT"),(h?null:"TEXT"),true,true,"dhxform_textarea");this.doAttachEvents(l);if(h){l.childNodes[l._ll?1:0].childNodes[0].rows=Number(m.rows)+(window.dhx4.isIE6?1:0)}if(typeof(m.numberFormat)!="undefined"){var g,e=null,n=null;if(typeof(m.numberFormat)!="string"){g=m.numberFormat[0];e=m.numberFormat[1]||null;n=m.numberFormat[2]||null}else{g=m.numberFormat;if(typeof(m.groupSep)=="string"){e=m.groupSep}if(typeof(m.decSep)=="string"){n=m.decSep}}this.setNumberFormat(l,g,e,n,false)}this.setValue(l,m.value);return this},doAttachEvents:function(c){var a=this;if(c._type=="ta"||c._type=="se"||c._type=="pw"){c.childNodes[c._ll?1:0].childNodes[0].onfocus=function(){var e=this.parentNode.parentNode;if(e._df!=null){this.value=e._value||""}e.getForm()._ccActivate(e._idd,this,this.value);e.getForm().callEvent("onFocus",[e._idd]);e=null}}c.childNodes[c._ll?1:0].childNodes[0].onblur=function(){var e=this.parentNode.parentNode;e.getForm()._ccDeactivate(e._idd);a.updateValue(e,true);if(e.getForm().live_validate){a._validate(e)}e.getForm().callEvent("onBlur",[e._idd]);e=null}},updateValue:function(h,a){var l=h.childNodes[h._ll?1:0].childNodes[0].value;var g=h.getForm();var c=(g._ccActive==true&&g._formLS!=null&&g._formLS[h._idd]!=null);g=null;if(!c&&h._df!=null&&l==window.dhx4.template._getFmtValue(h._value,h._df)){return}if(!a&&h._df!=null&&h._value==l&&l==window.dhx4.template._getFmtValue(l,h._df)){return}var e=this;if(h._value!=l){if(h.checkEvent("onBeforeChange")){if(h.callEvent("onBeforeChange",[h._idd,h._value,l])!==true){if(h._df!=null){e.setValue(h,h._value)}else{h.childNodes[h._ll?1:0].childNodes[0].value=h._value}return}}if(h._df!=null&&a){e.setValue(h,l)}else{h._value=l}h.callEvent("onChange",[h._idd,l]);return}if(h._df!=null&&a){this.setValue(h,h._value)}},setValue:function(e,g){e._value=(typeof(g)!="undefined"&&g!=null?g:"");var c=(String(e._value)||"");var a=e.childNodes[e._ll?1:0].childNodes[0];if(e._df!=null){c=window.dhx4.template._getFmtValue(c,e._df)}if(a.value!=c){a.value=c;e.getForm()._ccReload(e._idd,c)}a=null},getValue:function(a){var c=a.getForm();if(c._formLS&&c._formLS[a._idd]!=null){this.updateValue(a)}c=null;return(typeof(a._value)!="undefined"&&a._value!=null?a._value:"")},setReadonly:function(a,c){a._ro=(c===true);if(a._ro){a.childNodes[a._ll?1:0].childNodes[0].setAttribute("readOnly","true")}else{a.childNodes[a._ll?1:0].childNodes[0].removeAttribute("readOnly")}},isReadonly:function(a){if(!a._ro){a._ro=false}return a._ro},getInput:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},setNumberFormat:function(g,h,e,l,c){if(typeof(c)!="boolean"){c=true}if(h==""){g._df=null;if(c){this.setValue(g,g._value)}return true}if(typeof(h)!="string"){return}var a=window.dhx4.template._parseFmt(h,e,l);if(a==false){return false}else{g._df=a}if(c){this.setValue(g,g._value)}return true}};(function(){for(var c in {doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setFocus:1}){dhtmlXForm.prototype.items.input[c]=dhtmlXForm.prototype.items.select[c]}})();dhtmlXForm.prototype.items.password={render:function(a,c){a._type="pw";a._enabled=true;this.doAddLabel(a,c);this.doAddInput(a,c,"INPUT","PASSWORD",true,true,"dhxform_textarea");this.doAttachEvents(a);this.setValue(a,c.value);return this}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doAttachEvents:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,setValue:1,getValue:1,updateValue:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setFocus:1,getInput:1}){dhtmlXForm.prototype.items.password[c]=dhtmlXForm.prototype.items.input[c]}})();dhtmlXForm.prototype.items.file={render:function(e,g){e._type="fl";e._enabled=true;this.doAddLabel(e,g);this.doAddInput(e,g,"INPUT","FILE",true,false,"dhxform_textarea");var a=e.childNodes[e._ll?1:0].childNodes[0];var c=this;a.onfocus=function(){var h=this.parentNode.parentNode;h.getForm().callEvent("onFocus",[h._idd]);h=null};a.onblur=function(){var h=this.parentNode.parentNode;if(h.getForm().live_validate){c._validate(h)}h.getForm().callEvent("onBlur",[h._idd]);h=null};a=null;e.childNodes[e._ll?1:0].childNodes[0].onchange=function(){e.callEvent("onChange",[e._idd,this.value])};return this},setValue:function(){},getValue:function(a){return a.childNodes[a._ll?1:0].childNodes[0].value}};(function(){for(var c in {doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,getInput:1,enable:1,disable:1,isEnabled:1,setWidth:1}){dhtmlXForm.prototype.items.file[c]=dhtmlXForm.prototype.items.input[c]}})();dhtmlXForm.prototype.items.label={_index:false,render:function(c,e){c._type="lb";c._enabled=true;c._checked=true;var a=document.createElement("DIV");a.className="dhxform_txt_label2"+(e._isTopmost?" topmost":"");a.innerHTML=e.label;c.appendChild(a);if(e.hidden==true){this.hide(c)}if(e.disabled==true){this.userDisable(c)}if(!isNaN(e.labelWidth)){a.style.width=parseInt(e.labelWidth)+"px"}if(!isNaN(e.labelHeight)){a.style.height=parseInt(e.labelHeight)+"px"}if(!isNaN(e.labelLeft)){a.style.left=parseInt(e.labelLeft)+"px"}if(!isNaN(e.labelTop)){a.style.top=parseInt(e.labelTop)+"px"}return this},destruct:function(a){this.doUnloadNestedLists(a);a._autoCheck=null;a._enabled=null;a._type=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;a.onselectstart=null;a.parentNode.removeChild(a);a=null},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false},setText:function(a,c){a.firstChild.innerHTML=c},getText:function(a){return a.firstChild.innerHTML}};(function(){for(var c in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.label[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.button={render:function(c,e){c._type="bt";c._enabled=true;c._name=e.name;c.className=String(c.className).replace("item_label_top","item_label_left").replace("item_label_right","item_label_left");c._doOnKeyUpDown=function(h,g){this.callEvent(h,[this.childNodes[0].childNodes[0],g,this._idd])};c.innerHTML='<div class="dhxform_btn" role="link" tabindex="0" dir="ltr"><div class="dhxform_btn_txt">'+e.value+'</div><div class="dhxform_btn_filler" disabled="true"></div></div>';if(!isNaN(e.width)){var a=Math.max(e.width,10);if(dhtmlXForm.prototype.items[this.t]._dim==null){c.firstChild.style.width=a+"px";dhtmlXForm.prototype.items[this.t]._dim=c.getForm()._checkDim(c,c.firstChild)}c.firstChild.style.width=a-dhtmlXForm.prototype.items[this.t]._dim+"px";c.firstChild.firstChild.className+=" dhxform_btn_txt_autowidth"}if(!isNaN(e.inputLeft)){c.childNodes[0].style.left=parseInt(e.inputLeft)+"px"}if(!isNaN(e.inputTop)){c.childNodes[0].style.top=parseInt(e.inputTop)+"px"}if(e.hidden==true){this.hide(c)}if(e.disabled==true){this.userDisable(c)}if(typeof(e.tooltip)!="undefined"){c.firstChild.title=e.tooltip}c.onselectstart=function(g){g=g||event;g.cancelBubble=true;if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false};c.firstChild.onselectstart=function(g){g=g||event;g.cancelBubble=true;if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false};c.firstChild.onkeypress=function(g){g=g||event;if((g.keyCode==32||g.charCode==32||g.keyCode==13||g.charCode==13)&&!this.parentNode._busy){this.parentNode._busy=true;g.cancelBubble=true;if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}_dhxForm_doClick(this.childNodes[0],["mousedown","mouseup"]);return false}};c.firstChild.onfocus=function(){this.parentNode._doOnFocus(this.parentNode)};c.firstChild.onblur=function(){_dhxForm_doClick(this.childNodes[0],"mouseout");this.parentNode._doOnBlur(this.parentNode)};c.firstChild.onkeyup=function(g){this.parentNode._doOnKeyUpDown("onKeyUp",g||event)};c.firstChild.onkeydown=function(g){this.parentNode._doOnKeyUpDown("onKeyDown",g||event)};c.firstChild.onmouseover=function(){var g=this.parentNode;if(!g._enabled){return}this._isOver=true;this.className="dhxform_btn dhxform_btn_over";g=null};c.firstChild.onmouseout=function(){var g=this.parentNode;if(!g._enabled){return}this.className="dhxform_btn";this._allowClick=false;this._pressed=false;this._isOver=false;g=null};c.firstChild.ontouchstart=c.firstChild.onmousedown=function(h){h=h||event;if(h.type=="touchstart"&&h.preventDefault){h.preventDefault()}if(h.button>=2){return}if(this._pressed){return}var g=this.parentNode;if(!g._enabled){return}this.className="dhxform_btn dhxform_btn_pressed";this._allowClick=true;this._pressed=true;g=null};c.firstChild.ontouchend=c.firstChild.onmouseup=function(h){h=h||event;if(h.button>=2){return}if(!this._pressed){return}var g=this.parentNode;if(!g._enabled){return}g._busy=false;this.className="dhxform_btn"+(this._isOver?" dhxform_btn_over":"");if(this._pressed&&this._allowClick){g.callEvent("_onButtonClick",[g._name,g._cmd])}this._allowClick=false;this._pressed=false;g=null};c._doOnFocus=function(g){g.getForm().callEvent("onFocus",[g._idd])};c._doOnBlur=function(g){g.getForm().callEvent("onBlur",[g._idd])};return this},destruct:function(a){this.doUnloadNestedLists(a);a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._type=null;a._enabled=null;a._cmd=null;a._name=null;a._doOnFocus=null;a._doOnBlur=null;a._doOnKeyUpDown=null;a.onselectstart=null;a.firstChild.onselectstart=null;a.firstChild.onkeypress=null;a.firstChild.ontouchstart=null;a.firstChild.ontouchend=null;a.firstChild.onfocus=null;a.firstChild.onblur=null;a.firstChild.onkeyup=null;a.firstChild.onkeydown=null;a.firstChild.onmouseover=null;a.firstChild.onmouseout=null;a.firstChild.onmousedown=null;a.firstChild.onmouseup=null;while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a.childNodes[0].removeAttribute("disabled");a.childNodes[0].setAttribute("role","link");a.childNodes[0].setAttribute("tabIndex","0")},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a.childNodes[0].setAttribute("disabled","true");a.childNodes[0].removeAttribute("role");a.childNodes[0].removeAttribute("tabIndex")},setText:function(a,c){a.childNodes[0].childNodes[0].innerHTML=c},getText:function(a){return a.childNodes[0].childNodes[0].innerHTML},setFocus:function(a){a.childNodes[0].focus()}};(function(){for(var c in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.button[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.hidden={_index:false,render:function(c,e){c.style.display="none";c._name=e.name;c._type="hd";c._enabled=true;var a=document.createElement("INPUT");a.type="HIDDEN";a.name=e.name;a.value=(e.value||"");c.appendChild(a);return this},destruct:function(a){this.doUnloadNestedLists(a);while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a._autoCheck=null;a._name=null;a._type=null;a._enabled=null;a.onselectstart=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;a.parentNode.removeChild(a);a=null},enable:function(a){a._enabled=true;a.childNodes[0].setAttribute("name",a._name)},disable:function(a){a._enabled=false;a.childNodes[0].removeAttribute("name")},show:function(){},hide:function(){},isHidden:function(){return true},setValue:function(a,c){a.childNodes[0].value=c},getValue:function(a){return a.childNodes[0].value},getInput:function(a){return a.childNodes[0]}};(function(){for(var c in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.hidden[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.list={_index:false,render:function(a,c){a._type="list";a._enabled=true;a._isNestedForm=true;a.style.paddingLeft=a._ofsNested+"px";a.className="dhxform_base_nested"+(a._custom_css||"");return[this,new dhtmlXForm(a,null,c)]},destruct:function(a){}};dhtmlXForm.prototype.items.fieldset={_index:false,render:function(c,g){c._type="fs";if(typeof(parseInt(g.inputWidth))=="number"){}c._width=g.width;c._enabled=true;c._checked=true;c.className="fs_"+g.position+(typeof(g.className)=="string"?" "+g.className:"");var e=document.createElement("FIELDSET");e.className="dhxform_fs";var h=String(g.labelAlign).replace("align_","");e.innerHTML="<legend class='fs_legend' align='"+h+"' style='text-align:"+h+"'>"+g.label+"</legend>";c.appendChild(e);if(!isNaN(g.inputLeft)){e.style.left=parseInt(g.inputLeft)+"px"}if(!isNaN(g.inputTop)){e.style.top=parseInt(g.inputTop)+"px"}if(g.inputWidth!="auto"){if(!isNaN(g.inputWidth)){e.style.width=parseInt(g.inputWidth)+"px";var a=parseInt(e.style.width);if(e.offsetWidth>a){e.style.width=a+(a-e.offsetWidth)+"px"}}}c._addSubListNode=function(){var l=document.createElement("DIV");l._custom_css=" dhxform_fs_nested";this.childNodes[0].appendChild(l);return l};if(g.hidden==true){this.hide(c)}if(g.disabled==true){this.userDisable(c)}return this},destruct:function(a){this.doUnloadNestedLists(a);a._checked=null;a._enabled=null;a._idd=null;a._type=null;a._width=null;a.onselectstart=null;a._addSubListNode=null;a._autoCheck=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},setText:function(a,c){a.childNodes[0].childNodes[0].innerHTML=c},getText:function(a){return a.childNodes[0].childNodes[0].innerHTML},enable:function(a){a._enabled=true;if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}},disable:function(a){a._enabled=false;if(String(a.className).search("disabled")<0){a.className+=" disabled"}},setWidth:function(c,a){c.childNodes[0].style.width=a+"px";c._width=a},getWidth:function(a){return a._width}};(function(){for(var c in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.fieldset[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.items.block={_index:false,render:function(c,e){c._type="bl";c._width=e.width;c._enabled=true;c._checked=true;c.className="block_"+e.position+(typeof(e.className)=="string"?" "+e.className:"");var a=document.createElement("DIV");a.className="dhxform_obj_"+c.getForm().skin+" dhxform_block";a.style.fontSize=c.getForm().cont.style.fontSize;if(e.style){a.style.cssText=e.style}if(typeof(e.id)!="undefined"){a.id=e.id}c.appendChild(a);if(!isNaN(e.inputLeft)){a.style.left=parseInt(e.inputLeft)+"px"}if(!isNaN(e.inputTop)){a.style.top=parseInt(e.inputTop)+"px"}if(e.inputWidth!="auto"){if(!isNaN(e.inputWidth)){a.style.width=parseInt(e.inputWidth)+"px"}}if(!isNaN(e.blockOffset)){c._ofsNested=e.blockOffset}c._addSubListNode=function(){var g=document.createElement("DIV");g._inBlcok=true;if(typeof(this._ofsNested)!="undefined"){g._ofsNested=this._ofsNested}this.childNodes[0].appendChild(g);return g};if(e.hidden==true){this.hide(c)}if(e.disabled==true){this.userDisable(c)}return this},_setCss:function(a,e,c){a.firstChild.className="dhxform_obj_"+e+" dhxform_block";a.firstChild.style.fontSize=c}};(function(){for(var c in {enable:1,disable:1,isEnabled:1,setWidth:1,getWidth:1,doUnloadNestedLists:1,destruct:1}){dhtmlXForm.prototype.items.block[c]=dhtmlXForm.prototype.items.fieldset[c]}})();dhtmlXForm.prototype.items.newcolumn={_index:false};dhtmlXForm.prototype.items.template={render:function(c,e){var a=(!isNaN(e.rows));c._type="tp";c._enabled=true;if(e.format!=null){if(typeof(e.format)=="function"){c.format=e.format}else{if(typeof(e.format)=="string"&&typeof(window[e.format])=="function"){c.format=window[e.format]}}}if(c.format==null){c.format=function(g,h){return h}}this.doAddLabel(c,e);this.doAddInput(c,e,"DIV",null,true,true,"dhxform_item_template");this.setValue(c,e.value||"");return this},destruct:function(a){a.format=null;this.d2(a);a=null},setValue:function(a,c){a._value=c;a.childNodes[a._ll?1:0].childNodes[0].innerHTML=a.format(a._idd,a._value)},getValue:function(a){return a._value},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false}};(function(){dhtmlXForm.prototype.items.template.d2=dhtmlXForm.prototype.items.input.destruct;for(var c in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,isEnabled:1,setWidth:1}){dhtmlXForm.prototype.items.template[c]=dhtmlXForm.prototype.items.select[c]}})();dhtmlXForm.prototype._ulToObject=function(l,r){var m=[];for(var c=0;c<l.childNodes.length;c++){if(String(l.childNodes[c].tagName||"").toLowerCase()=="li"){var g={};var u=l.childNodes[c];for(var s=0;s<r.length;s++){if(u.getAttribute(r[s])!=null){g[String(r[s]).replace("ftype","type")]=u.getAttribute(r[s])}}if(!g.label){try{g.label=u.firstChild.nodeValue}catch(o){}}var h=u.getElementsByTagName("UL");if(h[0]!=null){g[(g.type=="select"?"options":"list")]=dhtmlXForm.prototype._ulToObject(h[0],r)}for(var s=0;s<u.childNodes.length;s++){if(String(u.childNodes[s].tagName||"").toLowerCase()=="userdata"){if(!g.userdata){g.userdata={}}g.userdata[u.childNodes[s].getAttribute("name")]=u.childNodes[s].firstChild.nodeValue}}m[m.length]=g}if(String(l.childNodes[c].tagName||"").toLowerCase()=="div"){var g={};g.type="label";try{g.label=l.childNodes[c].firstChild.nodeValue}catch(o){}m[m.length]=g}}return m};dhtmlXForm.prototype.setUserData=function(h,e,g,a){if(typeof(a)!="undefined"){var c=this.doWithItem([h,e],"_getId");if(c!=null){h=c;e=g;g=a}}if(!this._userdata){this._userdata={}}this._userdata[h]=(this._userdata[h]||{});this._userdata[h][e]=g};dhtmlXForm.prototype.getUserData=function(g,e,a){if(typeof(a)!="undefined"){var c=this.doWithItem([g,e],"_getId");if(c!=null){g=c;e=a}}if(this._userdata!=null&&typeof(this._userdata[g])!="undefined"&&typeof(this._userdata[g][e])!="undefined"){return this._userdata[g][e]}return""};dhtmlXForm.prototype.setRTL=function(a){this._rtl=(a===true?true:false);if(this._rtl){if(String(this.cont).search(/dhxform_rtl/gi)<0){this.cont.className+=" dhxform_rtl"}}else{if(String(this.cont).search(/dhxform_rtl/gi)>=0){this.cont.className=String(this.cont.className).replace(/dhxform_rtl/gi,"")}}};_dhxForm_doClick=function(h,c){if(typeof(c)=="object"){var a=c[1];c=c[0]}if(document.createEvent){var g=document.createEvent("MouseEvents");g.initEvent(c,true,false);h.dispatchEvent(g)}else{if(document.createEventObject){var g=document.createEventObject();g.button=1;h.fireEvent("on"+c,g)}}if(a){window.setTimeout(function(){_dhxForm_doClick(h,a)},100)}};dhtmlXForm.prototype.setFormData=function(e){for(var c in e){var g=this.getItemType(c);switch(g){case"checkbox":this[e[c]==true||parseInt(e[c])==1||e[c]=="true"||e[c]==this.getItemValue(c,"realvalue")?"checkItem":"uncheckItem"](c);break;case"radio":this.checkItem(c,e[c]);break;case"input":case"textarea":case"password":case"select":case"multiselect":case"hidden":case"template":case"combo":case"calendar":case"colorpicker":case"editor":this.setItemValue(c,e[c]);break;default:if(this["setFormData_"+g]){this["setFormData_"+g](c,e[c])}else{if(!this.hId){this.hId=this._genStr(12)}this.setUserData(this.hId,c,e[c])}break}}};dhtmlXForm.prototype.getFormData=function(v,l){var c={};var o=this;for(var u in this.itemPull){var n=this.itemPull[u]._idd;var w=this.itemPull[u]._type;if(w=="ch"){c[n]=(this.isItemChecked(n)?this.getItemValue(n):0)}if(w=="ra"&&!c[this.itemPull[u]._group]){c[this.itemPull[u]._group]=this.getCheckedValue(this.itemPull[u]._group)}if(w in {se:1,ta:1,pw:1,hd:1,tp:1,fl:1,calendar:1,combo:1,editor:1,colorpicker:1}){c[n]=this.getItemValue(n,v)}if(this["getFormData_"+w]){c[n]=this["getFormData_"+w](n)}if(w=="up"){var h=this.getItemValue(n);for(var g in h){c[g]=h[g]}}if(this.itemPull[u]._list){for(var e=0;e<this.itemPull[u]._list.length;e++){var m=this.itemPull[u]._list[e].getFormData(v,l);for(var s in m){c[s]=m[s]}}}}if(!l&&this.hId&&this._userdata[this.hId]){for(var u in this._userdata[this.hId]){if(!c[u]){c[u]=this._userdata[this.hId][u]}}}return c};dhtmlXForm.prototype.adjustParentSize=function(){var l=0;var h=-1;for(var m=0;m<this.base.length;m++){l+=this.base[m].firstChild.offsetWidth;if(this.base[m].offsetHeight>h){h=this.base[m].offsetHeight}}var g=false;try{g=(this.cont.parentNode.parentNode.parentNode.parentNode._isCell==true);if(g){var a=this.cont.parentNode.parentNode.parentNode.parentNode}}catch(n){}if(g&&typeof(a)!="undefined"){if(l>0){a.setWidth(l+10)}if(h>0){a.setHeight(h+a.firstChild.firstChild.offsetHeight+5)}g=a=null;return}var c=false;try{c=(this.cont.parentNode.parentNode.parentNode._isWindow==true);if(c){var o=this.cont.parentNode.parentNode;if(typeof(o.callEvent)=="function"){this.cont.style.display="none";o.callEvent("_setCellSize",[l+15,h+15]);this.cont.style.display=""}}}catch(n){}};dhtmlXForm.prototype.reset=function(){if(this.callEvent("onBeforeReset",[this.formId,this.getFormData()])){if(this._last_load_data){this.setFormData(this._last_load_data)}this.callEvent("onAfterReset",[this.formId])}};dhtmlXForm.prototype.send=function(c,m,n,g){if(typeof m=="function"){n=m;m="post"}else{m=(m=="get"?"get":"post")}if(g!==true&&!this.validate()){return}var l=this.getFormData(true);var h=[];for(var e in l){h.push(e+"="+encodeURIComponent(l[e]))}var a=function(o){if(n){n.call(this,o,o.xmlDoc.responseText)}};if(m=="get"){window.dhx4.ajax.get(c+(c.indexOf("?")==-1?"?":"&")+h.join("&"),a)}else{window.dhx4.ajax.post(c,h.join("&"),a)}};dhtmlXForm.prototype.save=function(a,c){};dhtmlXForm.prototype.dummy=function(){};dhtmlXForm.prototype._changeFormId=function(c,a){this.formId=a};dhtmlXForm.prototype._dp_init=function(a){a._methods=["dummy","dummy","_changeFormId","dummy"];a._getRowData=function(g,c){var e=this.obj.getFormData(true);e[this.action_param]=this.obj.getUserData(g,this.action_param);return e};a._clearUpdateFlag=function(){};a.attachEvent("onAfterUpdate",function(e,g,h,c){if(g=="inserted"||g=="updated"){this.obj.resetDataProcessor("updated");this.obj._last_load_data=this.obj.getFormData(true)}this.obj.callEvent("onAfterSave",[this.obj.formId,c]);return true});a.autoUpdate=false;a.setTransactionMode("POST",true);this.dp=a;this.formId=(new Date()).valueOf();this.resetDataProcessor("inserted");this.save=function(){if(!this.callEvent("onBeforeSave",[this.formId,this.getFormData()])){return}if(!this.validate()){return}a.sendData()}};dhtmlXForm.prototype.resetDataProcessor=function(a){if(!this.dp){return}this.dp.updatedRows=[];this.dp._in_progress=[];this.dp.setUpdated(this.formId,true,a)};dhtmlXForm.prototype._ccActivate=function(e,a,c){if(!this._formLS){this._formLS={}}if(!this._formLS[e]){this._formLS[e]={input:a,value:c}}if(!this._ccActive){this._ccActive=true;this._ccDo()}a=null};dhtmlXForm.prototype._ccDeactivate=function(a){if(this._ccTm){window.clearTimeout(this._ccTm)}this._ccActive=false;if(this._formLS!=null&&this._formLS[a]!=null){this._formLS[a].input=null;this._formLS[a]=null;delete this._formLS[a]}};dhtmlXForm.prototype._ccDo=function(){if(this._ccTm){window.clearTimeout(this._ccTm)}for(var c in this._formLS){var h=this._formLS[c].input;if(String(h.tagName).toLowerCase()=="select"){var e="";if(h.selectedIndex>=0&&h.selectedIndex<h.options.length){e=h.options[h.selectedIndex].value}}else{var e=h.value}if(e!=this._formLS[c].value){this._formLS[c].value=e;this.callEvent("onInputChange",[h._idd,e,this])}h=null}if(this._ccActive){var g=this;this._ccTm=window.setTimeout(function(){g._ccDo();g=null},100)}};dhtmlXForm.prototype._ccReload=function(c,a){if(this._formLS&&this._formLS[c]){this._formLS[c].value=a}};dhtmlXForm.prototype._checkDim=function(m,l){var g=document.createElement("DIV");g.className="dhxform_obj_"+this.skin;g.style.cssText+=(dhx4.isIE6==true?"visibility:hidden;":"position:absolute;left:-2000px;top:-1000px;");document.body.appendChild(g);var h=m.parentNode;var c=m.nextSibling;g.appendChild(m);var e=parseInt(l.style.width);var a=(dhx4.isFF||dhx4.isIE||dhx4.isChrome||dhx4.isOpera?l.offsetWidth:l.clientWidth);var n=a-e;if(c!=null){h.insertBefore(m,c)}else{h.appendChild(m)}g.parentNode.removeChild(g);h=c=g=m=l=null;return n};dhtmlXForm.prototype._autoload=function(){var c=["ftype","name","value","label","check","checked","disabled","text","rows","select","selected","width","style","className","labelWidth","labelHeight","labelLeft","labelTop","inputWidth","inputHeight","inputLeft","inputTop","position","size"];var e=document.getElementsByTagName("UL");var g=[];for(var m=0;m<e.length;m++){if(e[m].className=="dhtmlxForm"){var l=document.createElement("DIV");g[g.length]={nodeUL:e[m],nodeForm:l,data:dhtmlXForm.prototype._ulToObject(e[m],c),name:(e[m].getAttribute("name")||null)}}}for(var m=0;m<g.length;m++){g[m].nodeUL.parentNode.insertBefore(g[m].nodeForm,g[m].nodeUL);var n=new dhtmlXForm(g[m].nodeForm,g[m].data);if(g[m].name!==null){window[g[m].name]=n}var h=(g[m].nodeUL.getAttribute("oninit")||null);g[m].nodeUL.parentNode.removeChild(g[m].nodeUL);g[m].nodeUL=null;g[m].nodeForm=null;g[m].data=null;g[m]=null;if(h){if(typeof(h)=="function"){h()}else{if(typeof(window[h])=="function"){window[h]()}}}}if(typeof(window.addEventListener)=="function"){window.removeEventListener("load",dhtmlXForm.prototype._autoload,false)}else{window.detachEvent("onload",dhtmlXForm.prototype._autoload)}};if(typeof(window.addEventListener)=="function"){window.addEventListener("load",dhtmlXForm.prototype._autoload,false)}else{window.attachEvent("onload",dhtmlXForm.prototype._autoload)}if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachForm=function(a){this.callEvent("_onBeforeContentAttach",["form"]);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}}dhtmlXForm.prototype.items.combo={render:function(c,e){c._type="combo";c._enabled=true;c._value=null;c._newValue=null;this.doAddLabel(c,e);this.doAddInput(c,e,"SELECT",null,true,true,"dhxform_select");this.doAttachEvents(c);this.doLoadOpts(c,e);c.onselectstart=function(g){return true};c.childNodes[c._ll?1:0].childNodes[0].setAttribute("mode",e.comboType||"");if(e.comboImagePath){c.childNodes[c._ll?1:0].childNodes[0].setAttribute("imagePath",e.comboImagePath)}if(e.comboDefaultImage){c.childNodes[c._ll?1:0].childNodes[0].setAttribute("defaultImage",e.comboDefaultImage)}if(e.comboDefaultImageDis){c.childNodes[c._ll?1:0].childNodes[0].setAttribute("defaultImageDis",e.comboDefaultImageDis)}c._combo=new dhtmlXComboFromSelect(c.childNodes[c._ll?1:0].childNodes[0]);c._combo.setSkin(c.getForm().skin);c._combo._currentComboValue=c._combo.getSelectedValue();c._combo.getInput().id=e.uid;var a=this;c._combo.attachEvent("onChange",function(){a.doOnChange(this)});if(e.connector){this.doLoadOptsConnector(c,e.connector)}if(e.filtering){c._combo.enableFilteringMode(true)}else{if(e.serverFiltering){c._combo.enableFilteringMode(true,e.serverFiltering,e.filterCache,e.filterSubLoad)}}if(e.readonly==true){this.setReadonly(c,true)}if(e.style){c._combo.DOMelem_input.style.cssText+=e.style}c._combo.attachEvent("onFocus",function(){var g=this.cont.parentNode.parentNode;var h=g.getForm();if(h.skin=="dhx_terrace"&&this.cont.className.search(/combo_in_focus/)<0){this.cont.className+=" combo_in_focus"}h.callEvent("onFocus",[g._idd]);h=g=null});c._combo.attachEvent("onBlur",function(){var g=this.cont.parentNode.parentNode;var h=g.getForm();if(h.skin=="dhx_terrace"&&this.cont.className.search(/combo_in_focus/)>=0){this.cont.className=this.cont.className.replace(/\s{0,}combo_in_focus/gi,"")}h.callEvent("onBlur",[g._idd]);h=g=null});return this},destruct:function(a){a.childNodes[a._ll?1:0].childNodes[0].onchange=null;a._combo._currentComboValue=null;a._combo.unload();a._combo=null;a._apiChange=null;this.d2(a);a=null},doAttachEvents:function(c){var a=this;c.childNodes[c._ll?1:0].childNodes[0].onchange=function(){a.doOnChange(this);a.doValidate(this.DOMParent.parentNode.parentNode)}},doValidate:function(a){if(a.getForm().hot_validate){this._validate(a)}},doOnChange:function(c){var a=c.base.parentNode.parentNode.parentNode;if(a._apiChange){return}c._newComboValue=c.getSelectedValue();if(c._newComboValue!=c._currentComboValue){if(a.checkEvent("onBeforeChange")){if(a.callEvent("onBeforeChange",[a._idd,c._currentComboValue,c._newComboValue])!==true){window.setTimeout(function(){c.setComboValue(c._currentComboValue)},1);return false}}c._currentComboValue=c._newComboValue;a.callEvent("onChange",[a._idd,c._currentComboValue])}a._autoCheck(a._enabled)},doLoadOptsConnector:function(g,a){var e=this;var c=g;g._connector_working=true;g._apiChange=true;g._combo.load(a,function(){c.callEvent("onOptionsLoaded",[c._idd]);c._connector_working=false;if(c._connector_value!=null){e.setValue(c,c._connector_value);c._connector_value=null}c._apiChange=false;e=c=null})},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a._combo.enable()},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a._combo.disable()},getCombo:function(a){return a._combo},setValue:function(a,c){if(a._connector_working){a._connector_value=c;return}a._apiChange=true;a._combo.setComboValue(c);a._combo._currentComboValue=a._combo.getActualValue();a._apiChange=false},getValue:function(a){return a._combo.getActualValue()},setWidth:function(c,a){c.childNodes[c._ll?1:0].childNodes[0].style.width=a+"px"},setReadonly:function(a,c){if(!a._combo){return}a._combo_ro=c;a._combo.readonly(a._combo_ro)},isReadonly:function(a,c){return a._combo_ro||false},setFocus:function(a){if(a._enabled){a._combo.setFocus()}},_setCss:function(a,e,c){a._combo.setFontSize(c,c)}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doLoadOpts:1,doUnloadNestedLists:1,setText:1,getText:1,isEnabled:1,_checkNoteWidth:1}){dhtmlXForm.prototype.items.combo[c]=dhtmlXForm.prototype.items.select[c]}})();dhtmlXForm.prototype.items.combo.d2=dhtmlXForm.prototype.items.select.destruct;dhtmlXForm.prototype.getCombo=function(a){return this.doWithItem(a,"getCombo")};dhtmlXForm.prototype.items.calendar={render:function(e,h){var c=this;e._type="calendar";e._enabled=true;var l=navigator.userAgent;var a=(l.indexOf("MSIE 6.0")>=0||l.indexOf("MSIE 7.0")>=0||l.indexOf("MSIE 8.0")>=0);this.doAddLabel(e,h);this.doAddInput(e,h,"INPUT","TEXT",true,true,"dhxform_textarea calendar");this.doAttachChangeLS(e);if(a){e.childNodes[e._ll?1:0].childNodes[0].onfocus2=e.childNodes[e._ll?1:0].childNodes[0].onfocus;e.childNodes[e._ll?1:0].childNodes[0].onfocus=function(){if(this._skipOnFocus==true){this._skipOnFocus=false;return}this.onfocus2.apply(this,arguments)}}e.childNodes[e._ll?1:0].childNodes[0]._idd=e._idd;e.childNodes[e._ll?1:0].childNodes[0].onblur=function(){var m=this.parentNode.parentNode;if(m._c.base._formMouseDown){m._c.base._formMouseDown=false;this._skipOnFocus=true;this.focus();this.value=this.value;m=null;return true}var n=m.getForm();n._ccDeactivate(m._idd);c.checkEnteredValue(this.parentNode.parentNode);if(n.live_validate){c._validate(m)}n.callEvent("onBlur",[m._idd]);n=m=null};e._f=(h.dateFormat||null);e._f0=(h.serverDateFormat||e._f);var g=e.getForm();e._c=new dhtmlXCalendarObject(e.childNodes[e._ll?1:0].childNodes[0],h.skin||g.skin||"dhx_skyblue");e._c._nullInInput=true;e._c.enableListener(e.childNodes[e._ll?1:0].childNodes[0]);if(e._f!=null){e._c.setDateFormat(e._f)}if(!window.dhx4.s2b(h.enableTime)){e._c.hideTime()}if(window.dhx4.s2b(h.showWeekNumbers)){e._c.showWeekNumbers()}if(!isNaN(h.weekStart)){e._c.setWeekStartDay(h.weekStart)}if(typeof(h.calendarPosition)!="undefined"){e._c.setPosition(h.calendarPosition)}if(h.minutesInterval!=null){e._c.setMinutesInterval(h.minutesInterval)}e._c._itemIdd=e._idd;e._c.attachEvent("onBeforeChange",function(m){if(e._value!=m){if(e.checkEvent("onBeforeChange")){if(e.callEvent("onBeforeChange",[e._idd,e._value,m])!==true){return false}}e._tempValue=e._value=m;c.setValue(e,m,false);e.callEvent("onChange",[this._itemIdd,e._value])}return true});e._c.attachEvent("onClick",function(){e._tempValue=null});if(a){e._c.base.onmousedown=function(){this._formMouseDown=true;return false}}this.setValue(e,h.value);g=null;return this},getCalendar:function(a){return a._c},setSkin:function(a,c){a._c.setSkin(c)},setValue:function(c,e,a){if(!e||e==null||typeof(e)=="undefined"||e==""){c._value=null;c.childNodes[c._ll?1:0].childNodes[0].value=""}else{c._value=(e instanceof Date?e:c._c._strToDate(e,c._f0||c._c._dateFormat));c.childNodes[c._ll?1:0].childNodes[0].value=c._c._dateToStr(c._value,c._f||c._c._dateFormat)}if(a!==false){c._c.setDate(c._value)}},getValue:function(c,a){var e=c._tempValue||c._c.getDate();if(a===true&&e==null){return""}return(a===true?c._c._dateToStr(e,c._f0||c._c._dateFormat):e)},setDateFormat:function(c,a,e){c._f=a;c._f0=(e||c._f);c._c.setDateFormat(c._f);this.setValue(c,this.getValue(c))},destruct:function(a){a._c.disableListener(a.childNodes[a._ll?1:0].childNodes[0]);a._c.unload();a._c=null;try{delete a._c}catch(c){}a._f=null;try{delete a._f}catch(c){}a._f0=null;try{delete a._f0}catch(c){}a.childNodes[a._ll?1:0].childNodes[0]._idd=null;a.childNodes[a._ll?1:0].childNodes[0].onblur=null;this.d2(a);a=null},checkEnteredValue:function(a){this.setValue(a,a._c.getDate())}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setFocus:1,getInput:1}){dhtmlXForm.prototype.items.calendar[c]=dhtmlXForm.prototype.items.input[c]}})();dhtmlXForm.prototype.items.calendar.doAttachChangeLS=dhtmlXForm.prototype.items.select.doAttachChangeLS;dhtmlXForm.prototype.items.calendar.d2=dhtmlXForm.prototype.items.input.destruct;dhtmlXForm.prototype.getCalendar=function(a){return this.doWithItem(a,"getCalendar")};dhtmlXForm.prototype.setCalendarDateFormat=function(c,a,e){this.doWithItem(c,"setDateFormat",a,e)};dhtmlXForm.prototype.items.btn2state={setChecked:function(a,c){a._checked=(c===true?true:false);a.childNodes[a._ll?1:0].lastChild.className="dhxform_img "+a._cssName+"_"+(a._checked?"1":"0");this.doCheckValue(a)}};(function(){for(var c in dhtmlXForm.prototype.items.checkbox){if(!dhtmlXForm.prototype.items.btn2state[c]){dhtmlXForm.prototype.items.btn2state[c]=dhtmlXForm.prototype.items.checkbox[c]}}})();dhtmlXForm.prototype.items.btn2state.render2=dhtmlXForm.prototype.items.btn2state.render;dhtmlXForm.prototype.items.btn2state.render=function(a,c){c._autoInputWidth=false;this.render2(a,c);a._type="btn2state";a._cssName=(typeof(c.cssName)=="undefined"?"btn2state":c.cssName);a._updateImgNode=function(){};a._doOnFocus=function(){a.getForm().callEvent("onFocus",[a._idd])};a._doOnBlur=function(){a.getForm().callEvent("onBlur",[a._idd])};a._doOnKeyUpDown=function(g,e,h){this.callEvent(g,[this.childNodes[this._ll?0:1].childNodes[0],e,this._idd])};this.setChecked(a,a._checked);return this};dhtmlXForm.prototype.setFormData_btn2state=function(a,c){this[c==true||parseInt(c)==1||c=="true"||c==this.getItemValue(a)?"checkItem":"uncheckItem"](a)};dhtmlXForm.prototype.getFormData_btn2state=function(a){return(this.isItemChecked(a)?this.getItemValue(a):0)};dhtmlXForm.prototype.items.colorpicker={colorpicker:{},render:function(e,g){var c=this;e._type="colorpicker";e._enabled=true;this.doAddLabel(e,g);this.doAddInput(e,g,"INPUT","TEXT",true,true,"dhxform_textarea");e._value=(g.value||"");e.childNodes[e._ll?1:0].childNodes[0].value=e._value;var a={input:e.childNodes[e._ll?1:0].childNodes[0],custom_colors:(window.dhx4.s2b(g.enableCustomColors)==true),skin:e.getForm().skin};this.colorpicker[e._idd]=new dhtmlXColorPicker(a);this.colorpicker[e._idd]._nodes[0].valueColor=null;this.colorpicker[e._idd].base.className+=" dhtmlxcp_in_form";if(typeof(g.customColors)!="undefined"){this.colorpicker[e._idd].setCustomColors(g.customColors)}if(typeof(g.cpPosition)=="string"){this.colorpicker[e._idd].setPosition(g.cpPosition)}this.colorpicker[e._idd].attachEvent("onSelect",function(h){if(e._value!=h){if(e.checkEvent("onBeforeChange")){if(e.callEvent("onBeforeChange",[e._idd,e._value,h])!==true){e.childNodes[e._ll?1:0].childNodes[0].value=e._value;return}}e._value=h;c.setValue(e,h);e.callEvent("onChange",[e._idd,e._value])}});this.colorpicker[e._idd].attachEvent("onHide",function(h){var l=e.childNodes[e._ll?1:0].childNodes[0];if(l.value!=e._value){l.value=e._value}l=null});e.childNodes[e._ll?1:0].childNodes[0]._idd=e._idd;return this},getColorPicker:function(a){return this.colorpicker[a._idd]},destruct:function(a){if(this.colorpicker[a._idd].unload){this.colorpicker[a._idd].unload()}this.colorpicker[a._idd]=null;try{delete this.colorpicker[a._idd]}catch(c){}a.childNodes[a._ll?1:0].childNodes[0]._idd=null;this.d2(a);a=null},setSkin:function(a,c){this.colorpicker[a._idd].setSkin(c)}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setValue:1,getValue:1,updateValue:1,setFocus:1,getInput:1}){dhtmlXForm.prototype.items.colorpicker[c]=dhtmlXForm.prototype.items.input[c]}})();dhtmlXForm.prototype.items.colorpicker.d2=dhtmlXForm.prototype.items.input.destruct;dhtmlXForm.prototype.getColorPicker=function(a){return this.doWithItem(a,"getColorPicker")};dhtmlXForm.prototype.items.container={render:function(a,c){a._type="container";a._enabled=true;this.doAddLabel(a,c);this.doAddInput(a,c,"DIV",null,true,true,"dhxform_container");return this},getContainer:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},enable:function(a){a._enabled=true;if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a.callEvent("onEnable",[a._idd])},disable:function(a){a._enabled=false;if(String(a.className).search("disabled")<0){a.className+=" disabled"}a.callEvent("onDisable",[a._idd])},doAttachEvents:function(){},setValue:function(){},getValue:function(){return null}};dhtmlXForm.prototype.getContainer=function(a){return this.doWithItem(a,"getContainer")};(function(){for(var c in dhtmlXForm.prototype.items.input){if(!dhtmlXForm.prototype.items.container[c]){dhtmlXForm.prototype.items.container[c]=dhtmlXForm.prototype.items.input[c]}}})();dhtmlXForm.prototype.items.editor={editor:{},render:function(e,g){var a=(!isNaN(g.rows));e._type="editor";e._enabled=true;e._editor_id=e.getForm().idPrefix+e._idd;this.doAddLabel(e,g);this.doAddInput(e,g,"DIV",null,true,true,"dhxform_item_template");e._value=(g.value||"");var c=this;this.editor[e._editor_id]=new dhtmlXEditor({parent:e.childNodes[e._ll?1:0].childNodes[0],content:e._value,iconsPath:g.iconsPath,toolbar:g.toolbar});this.editor[e._editor_id].attachEvent("onAccess",function(l,m){e.callEvent("_onBeforeEditorAccess",[]);_dhxForm_doClick(document.body,"click");if(l=="blur"){c.doOnBlur(e,this);e.callEvent("onBlur",[e._idd]);if(e.getForm().skin=="dhx_terrace"){var h=e.childNodes[e._ll?1:0].className;if(h.indexOf("dhxeditor_focus")>=0){e.childNodes[e._ll?1:0].className=(h).replace(/\s{0,}dhxeditor_focus/gi,"")}}}else{e.callEvent("onEditorAccess",[e._idd,l,m,this,e.getForm()]);e.callEvent("onFocus",[e._idd]);if(e.getForm().skin=="dhx_terrace"){var h=e.childNodes[e._ll?1:0].className;if(h.indexOf("dhxeditor_focus")==-1){e.childNodes[e._ll?1:0].className+=" dhxeditor_focus"}}}});this.editor[e._editor_id].attachEvent("onToolbarClick",function(h){e.callEvent("onEditorToolbarClick",[e._idd,h,this,e.getForm()])});if(g.readonly){this.setReadonly(e,true)}e.childNodes[e._ll?0:1].childNodes[0].removeAttribute("for");e.childNodes[e._ll?0:1].childNodes[0].onclick=function(){c.editor[e._editor_id]._focus()};return this},doOnBlur:function(e,c){var a=c.getContent();if(e._value!=a){if(e.checkEvent("onBeforeChange")){if(e.callEvent("onBeforeChange",[e._idd,e._value,a])!==true){c.setContent(e._value);return}}e._value=a;e.callEvent("onChange",[e._idd,a])}},setValue:function(a,c){if(a._value==c){return}a._value=c;this.editor[a._editor_id].setContent(a._value)},getValue:function(a){a._value=this.editor[a._editor_id].getContent();return a._value},enable:function(a){if(this.isEnabled(a)!=true){this.editor[a._editor_id].setReadonly(false);this.doEn(a)}},disable:function(a){if(this.isEnabled(a)==true){this.editor[a._editor_id].setReadonly(true);this.doDis(a)}},setReadonly:function(a,c){this.editor[a._editor_id].setReadonly(c)},getEditor:function(a){return(this.editor[a._editor_id]||null)},destruct:function(a){a.childNodes[a._ll?0:1].childNodes[0].onclick=null;this.editor[a._editor_id].unload();this.editor[a._editor_id]=null;this.d2(a);a=null},setFocus:function(a){this.editor[a._editor_id]._focus()}};(function(){for(var c in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,setWidth:1,isEnabled:1}){dhtmlXForm.prototype.items.editor[c]=dhtmlXForm.prototype.items.template[c]}})();dhtmlXForm.prototype.items.editor.d2=dhtmlXForm.prototype.items.select.destruct;dhtmlXForm.prototype.items.editor.doEn=dhtmlXForm.prototype.items.select.enable;dhtmlXForm.prototype.items.editor.doDis=dhtmlXForm.prototype.items.select.disable;dhtmlXForm.prototype.getEditor=function(a){return this.doWithItem(a,"getEditor")};dhtmlXForm.prototype.items.upload={render:function(c,e){c._type="up";c._enabled=true;c._checked=true;c.className=e.position+(typeof(e.className)=="string"?" "+e.className:"");var a=document.createElement("DIV");c.appendChild(a);if(!isNaN(e.inputLeft)){c.style.left=parseInt(e.inputLeft)+"px"}if(!isNaN(e.inputTop)){c.style.top=parseInt(e.inputTop)+"px"}if(e.inputWidth!="auto"){if(!isNaN(e.inputWidth)){a.style.width=parseInt(e.inputWidth)+"px"}}c._uploader=new dhtmlXFileUploader(a,e.swfPath||"",e.swfUrl||"",e.mode||null,e.swfLogs,e.slXap||"",e.slUrl||"",e.slLogs||"",e.multiple);c._uploader.setURL(e.url||"");c._uploader.callEvent=c.callEvent;if(typeof(e.autoStart)!="undefined"){c._uploader.setAutoStart(e.autoStart)}if(typeof(e.autoRemove)!="undefined"){c._uploader.setAutoRemove(e.autoRemove)}if(typeof(e.titleScreen)!="undefined"){c._uploader.enableTitleScreen(e.titleScreen)}if(typeof(e.titleText)!="undefined"){c._uploader.setTitleText(e.titleText)}if(e.hidden==true){this.hide(c)}if(e.disabled==true){this.userDisable(c)}if(!(e.inputHeight=="auto"||parseInt(e.inputHeight)==NaN)){c._uploader.p_files.style.height=parseInt(e.inputHeight)+"px"}return this},destruct:function(a){this.doUnloadNestedLists(a);a._uploader.callEvent=function(){return true};a._uploader.unload();a._uploader.callEvent=null;a._uploader=null;a._checked=null;a._enabled=null;a._idd=null;a._type=null;a.onselectstart=null;a._autoCheck=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},setText:function(a,c){},getText:function(a){},enable:function(a){a._enabled=true;if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._uploader.enable()},disable:function(a){a._enabled=false;if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._uploader.disable()},setWidth:function(c,a){c.childNodes[0].style.width=a+"px";c._width=a},getWidth:function(a){return a._width||parseInt(a.childNodes[0].style.width)},setValue:function(a){a._uploader.clear()},getValue:function(l){var g=l._uploader.getData();var h={};var e=0;for(var c in g){h[l._idd+"_r_"+e]=g[c].realName;h[l._idd+"_s_"+e]=g[c].serverName;e++}h[l._idd+"_count"]=e;return h},getUploader:function(a){return a._uploader},getStatus:function(a){return a._uploader.getStatus()}};(function(){for(var c in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.upload[c]=dhtmlXForm.prototype.items.checkbox[c]}})();dhtmlXForm.prototype.setFormData_upload=function(a){this.doWithItem(a,"setValue")};dhtmlXForm.prototype.getUploader=function(a){return this.doWithItem(a,"getUploader")};dhtmlXForm.prototype.getUploaderStatus=function(a){return this.doWithItem(a,"getStatus")};function dhtmlXFileUploader(c,n,m,o,s,l,v,h,w){var q=this;if(typeof(o)=="string"&&typeof(this[o])=="function"){this.engine=o}else{this.engine="html4";var g=null;if(typeof(window.FormData)!="undefined"&&typeof(window.XMLHttpRequest)!="undefined"){g=new XMLHttpRequest();if(typeof(g.upload)=="undefined"){g=null}}if(g!=null){this.engine="html5"}else{if(typeof(window.swfobject)!="undefined"||g===false){var g=swfobject.getFlashPlayerVersion();if(g.major>=10){this.engine="flash"}}else{this._sl_v=this.getSLVersion();if(this._sl_v){this.engine="sl"}}}g=null}if(typeof(c)=="string"){c=document.getElementById(c)}this._upload_mp=(typeof(w)!="undefined"?w==true:true);this._upload_dnd=true;this._swf_file_url=n||"";this._swf_upolad_url=m||"";this._swf_logs=s;this._sl_xap=l;this._sl_upload_url=v;this._sl_logs=h;this.p=document.createElement("DIV");this.p.className+=" dhx_file_uploader";c.appendChild(this.p);this.p_files=document.createElement("DIV");this.p_files.className="dhx_upload_files";this.p.appendChild(this.p_files);this.p_controls=document.createElement("DIV");this.p_controls.className="dhx_upload_controls";this.p.appendChild(this.p_controls);this._files={};this._items={};this._data={};this._autoStart=false;this._autoRemove=false;this._titleScreen=true;this._enabled=true;this._uploaded_count=0;this._initToolbar=function(){this.b_opts={info:{onclick:null},browse:{onclick:null,tooltip:"Browse"},upload:{onclick:function(){if(!q._enabled){return}if(!q._uploading){q._uploadStart()}},tooltip:"Upload"},cancel:{onclick:function(){if(!q._enabled){return}q._uploadStop();q._switchButton(false)},tooltip:"Stop"},clear:{onclick:function(){if(!q._enabled){return}q.clear()},tooltip:"Clear list"}};this.buttons={};for(var e in this.b_opts){var x=document.createElement("DIV");x.innerHTML="&nbsp;";x.className="dhx_file_uploader_button button_"+e;x.onclick=this.b_opts[e].onclick;if(this.b_opts[e].tooltip){x.title=this.b_opts[e].tooltip}this.p_controls.appendChild(x);this.buttons[e]=x;x=null}this.buttons.cancel.style.display="none"};this._readableSize=function(x){var e=false;var a=["b","Kb","Mb","Gb","Tb","Pb","Eb"];for(var y=0;y<a.length;y++){if(x>1024){x=x/1024}else{if(e===false){e=y}}}if(e===false){e=a.length-1}return Math.round(x*100)/100+" "+a[e]};this._beforeAddFileToList=function(a,e){return(this.callEvent("onBeforeFileAdd",[a,e])===true)};this._addFileToList=function(C,e,y,A,a){this._checkTitleScreen();var x=document.createElement("DIV");x._idd=C;x.className="dhx_file dhx_file_"+A;x.innerHTML="<div class='dhx_file_param dhx_file_name'>&nbsp;</div><div class='dhx_file_param dhx_file_progress'>"+a+"%</div><div class='dhx_file_param dhx_file_delete' title='Remove from list'>&nbsp;</div>";this.p_files.appendChild(x);x.childNodes[0].style.width=x.offsetWidth-127+"px";this._items[C]=x;this._updateFileNameSize(C);x.childNodes[2].onclick=function(){if(!q._enabled){return}var D=this.parentNode._idd;q._removeFileFromQueue(D)};this.callEvent("onFileAdd",[e])};this._removeFileFromList=function(a){if(!this._items[a]){return}this._items[a].childNodes[2].onclick=null;this._items[a].parentNode.removeChild(this._items[a]);this._items[a]=null;delete this._items[a];if(this._data[a]){this._data[a]=null;delete this._data[a]}this._checkTitleScreen()};this._updateFileNameSize=function(a){this._items[a].childNodes[0].innerHTML=this._files[a].name+(!isNaN(this._files[a].size)?" ("+this._readableSize(this._files[a].size)+")":"&nbsp;");this._items[a].childNodes[0].title=this._files[a].name+(!isNaN(this._files[a].size)?" ("+this._readableSize(this._files[a].size)+")":"")};this._updateFileInList=function(x,e,a){if(!this._items[x]){return}this._items[x].className="dhx_file dhx_file_"+e;this._updateProgress(x,e,a);this._updateFileNameSize(x)};this._updateProgress=function(x,e,a){if(e=="uploading"&&a<100&&this._progress_type=="loader"){this._items[x].childNodes[1].className="dhx_file_param dhx_file_uploading";this._items[x].childNodes[1].innerHTML="&nbsp;"}else{this._items[x].childNodes[1].className="dhx_file_param dhx_file_progress";this._items[x].childNodes[1].innerHTML=a+"%"}this._updateFileNameSize(x)};this._removeFilesByState=function(x){for(var e in this._files){if(x===true||this._files[e].state==x){this._removeFileFromQueue(e)}}};this._switchButton=function(e){if(e==true){this.buttons.upload.style.display="none";this.buttons.cancel.style.display=""}else{var a=this._uploaded_count;this.buttons.upload.style.display="";this.buttons.cancel.style.display="none";this._uploaded_count=0;if(a>0){this.callEvent("onUploadComplete",[a])}}};this._uploadStart=function(){this._switchButton(true);if(!this._uploading){for(var e in this._files){if(this._files[e].state=="fail"){this._files[e].state="added";this._updateFileInList(e,"added",0)}}}this._uploading=true;var x=false;for(var e in this._files){if(!x&&[this._files[e].state]=="added"){x=true;this._files[e].state="uploading";this._updateFileInList(e,"uploading",0);this._doUploadFile(e)}}if(!x){this._uploading=false;this._switchButton(false)}};this._onUploadSuccess=function(A,y,x,a){if(typeof(x)!="undefined"&&this.engine=="flash"){var e=dhx4.s2j(x.data);if(e!=null&&e.state==true&&e.name!=null){y=e.name;if(e.extra!=null){a=e.extra}}else{this._onUploadFail(A,(e!=null&&e.extra!=null?e.extra:null));return}}this._uploaded_count++;this._data[A]={realName:this._files[A].name,serverName:y};this._files[A].state="uploaded";this._updateFileInList(A,"uploaded",100);this.callEvent("onUploadFile",[this._files[A].name,y,a]);if(this._autoRemove){this._removeFileFromQueue(A)}if(this._uploading){this._uploadStart()}};this._onUploadFail=function(e,a){this._files[e].state="fail";this._updateFileInList(e,"fail",0);this.callEvent("onUploadFail",[this._files[e].name,a]);if(this._uploading){this._uploadStart()}};this._onUploadAbort=function(a){this._uploading=false;this._files[a].state="added";this._updateFileInList(a,"added",0);this.callEvent("onUploadCancel",[this._files[a].name])};this._checkTitleScreen=function(){var x=0;for(var e in this._files){x++}if(x==0&&this.p.className.search("dhx_file_uploader_title")<0&&this._titleScreen){this.p.className+=" dhx_file_uploader_title";this.buttons.info.innerHTML=this._titleText;this.buttons.info.style.width=Math.max(this.p_controls.offsetWidth-134,0)+"px"}if((x>0||!this._titleScreen)&&this.p.className.search("dhx_file_uploader_title")>=0){this.p.className=this.p.className.replace(/dhx_file_uploader_title/g,"");this.buttons.info.innerHTML=""}};this.callEvent=function(){};this.upload=function(){if(!this._uploading){this._uploadStart()}};this.setAutoStart=function(a){this._autoStart=(a==true)};this.setAutoRemove=function(a){this._autoRemove=(a==true)};this.enableTitleScreen=function(a){this._titleScreen=(a==true);this._checkTitleScreen()};this.setTitleText=function(a){this._titleText=a;if(this.p.className.search("dhx_file_uploader_title")>=0){this.buttons.info.innerHTML=this._titleText}};this.setURL=function(a){this._url=a};this.setSWFURL=function(a){this._swf_upolad_url=a};this.enable=function(){this._enabled=true;this.p_files.className="dhx_upload_files";this.p_controls.className="dhx_upload_controls"};this.disable=function(){this._enabled=false;this.p_files.className="dhx_upload_files dhx_uploader_dis";this.p_controls.className="dhx_upload_controls dhx_uploader_dis"};this.getStatus=function(){var x=0;for(var e in this._files){if(this._files[e].state!="uploaded"){return -1}x=1}return x};this.getData=function(){return this._data};this.clear=function(){if(this.callEvent("onBeforeClear",[])!==true){return}if(this._uploading){q._uploadStop()}q._switchButton(false);q._removeFilesByState(true);this.callEvent("onClear",[])};this.unload=function(){this._removeFilesByState(true);this._data=null;this._files=null;this._items=null;this._unloadEngine();for(var e in this.buttons){this.buttons[e].onclick=null;this.buttons[e].parentNode.removeChild(this.buttons[e]);this.buttons[e]=null;delete this.buttons[e]}this.buttons=null;for(var e in this.b_opts){this.b_opts[e].onclick=null;this.b_opts[e]=null;delete this.b_opts[e]}this.b_opts=null;this.p_controls.parentNode.removeChild(this.p_controls);this.p_files.parentNode.removeChild(this.p_files);this.p.className=this.p.className.replace(/dhx_file_uploader_title/gi,"").replace(/dhx_file_uploader/gi,"");for(var e in this){this[e]=null}q=e=null};var r=new this[this.engine]();for(var u in r){this[u]=r[u];r[u]=null}u=r=c=null;this._initToolbar();this._initEngine();this._checkTitleScreen();return this}dhtmlXFileUploader.prototype.html5=function(){};dhtmlXFileUploader.prototype.html5.prototype={_initEngine:function(){var c=this;this.buttons.browse.onclick=function(){if(c._enabled){c.f.click()}};this._progress_type="percentage";var a=window.navigator.userAgent;if(a.match(/Windows/gi)!=null&&a.match(/AppleWebKit/gi)!=null&&a.match(/Safari/gi)!=null){if(a.match(/Version\/5\.1\.5/gi)){this._upload_mp=false}if(a.match(/Version\/5\.1[^\.\d{1,}]/gi)){this._upload_dnd=false}if(a.match(/Version\/5\.1\.1/gi)){this._upload_mp=false;this._upload_dnd=false}if(a.match(/Version\/5\.1\.2/gi)){this._upload_dnd=false}if(a.match(/Version\/5\.1\.7/gi)){this._upload_mp=false}}this._addFileInput();if(this._upload_dnd){this.p.ondragenter=function(g){if(!g.dataTransfer){return}g.stopPropagation();g.preventDefault()};this.p.ondragover=function(g){if(!g.dataTransfer){return}g.stopPropagation();g.preventDefault()};this.p.ondrop=function(g){if(!g.dataTransfer){return}g.stopPropagation();g.preventDefault();if(c._enabled){c._parseFilesInInput(g.dataTransfer.files)}};this._titleText="Drag-n-Drop files here or<br>click to select files for upload."}else{this._titleText="Click to select files for upload."}},_addFileInput:function(){if(this.f!=null){this.f.onchange=null;this.f.parentNode.removeChild(this.f);this.f=null}var a=this;this.f=document.createElement("INPUT");this.f.type="file";if(this._upload_mp){this.f.multiple="1"}this.f.className="dhx_uploader_input";this.p_controls.appendChild(this.f);this.f.onchange=function(){a._parseFilesInInput(this.files);if(window.dhx4.isOpera){a._addFileInput()}else{this.value=""}}},_doUploadFile:function(e){var c=this;if(!this._loader){this._loader=new XMLHttpRequest();this._loader.upload.onprogress=function(g){if(c._files[this._idd].state=="uploading"){c._updateFileInList(this._idd,"uploading",Math.round(g.loaded*100/g.total))}};this._loader.onload=function(h){var g=dhx4.s2j(this.responseText);if(typeof(g)=="object"&&g!=null&&typeof(g.state)!="undefined"&&g.state==true){c._onUploadSuccess(this.upload._idd,g.name,null,g.extra);g=null}else{c._onUploadFail(this.upload._idd,(g!=null&&g.extra!=null?g.extra:null))}};this._loader.onerror=function(g){c._onUploadFail(this.upload._idd)};this._loader.onabort=function(g){c._onUploadAbort(this.upload._idd)}}this._loader.upload._idd=e;var a=new FormData();a.append("file",this._files[e].file);this._loader.open("POST",this._url+(String(this._url).indexOf("?")<0?"?":"&")+"mode=html5&dhxr"+new Date().getTime(),true);this._loader.setRequestHeader("X-Requested-With","XMLHttpRequest");this._loader.send(a)},_uploadStop:function(){if(!this._uploading||!this._loader){return}this._loader.abort()},_parseFilesInInput:function(c){for(var a=0;a<c.length;a++){this._addFileToQueue(c[a])}},_addFileToQueue:function(a){if(!this._beforeAddFileToList(a.name,a.size)){return}var c=(a._idd||window.dhx4.newId());this._files[c]={file:a,name:a.name,size:a.size,state:"added"};this._addFileToList(c,a.name,a.size,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(g){if(!this._files[g]){return}var c=this._files[g].name;var e=(this._data!=null&&this._data[g]!=null?this._data[g].serverName:null);if(this.callEvent("onBeforeFileRemove",[c,e])!==true){return}var a=false;if(this._uploading&&g==this._loader.upload._idd&&this._files[g].state=="uploading"){this._uploadStop();a=true}this._files[g].file=null;this._files[g].name=null;this._files[g].size=null;this._files[g].state=null;this._files[g]=null;delete this._files[g];this._removeFileFromList(g);this.callEvent("onFileRemove",[c,e]);if(a){this._uploadStart()}},_unloadEngine:function(){this.buttons.browse.onclick=null;this.f.onchange=null;this.f.parentNode.removeChild(this.f);this.f=null;this.p.ondragenter=null;this.p.ondragover=null;this.p.ondrop=null;if(this._loader){this._loader.upload.onprogress=null;this._loader.onload=null;this._loader.onerror=null;this._loader.onabort=null;this._loader.upload._idd=null;this._loader=null}this._initEngine=null;this._doUploadFile=null;this._uploadStop=null;this._parseFilesInInput=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.html4=function(){};dhtmlXFileUploader.prototype.html4.prototype={_initEngine:function(){this._addForm();this._progress_type="loader";this._titleText="Click button<br>to select files for upload."},_addForm:function(){var a=this;var e=window.dhx4.newId();if(!this.k){this.k=document.createElement("DIV");this.k.className="dhx_file_form_cont";this.buttons.browse.appendChild(this.k);this.fr_name="dhx_file_"+window.dhx4.newId();this.k.innerHTML='<iframe name="'+this.fr_name+'" style="height:0px;width:0px;" frameBorder="0"></iframe>';this.fr=this.k.firstChild;if(window.navigator.userAgent.indexOf("MSIE")>=0){this.fr.onreadystatechange=function(){if(this.readyState=="complete"){a._onLoad()}}}else{this.fr.onload=function(){a._onLoad()}}}var c=document.createElement("DIV");c.innerHTML="<form method='POST' enctype='multipart/form-data' target='"+this.fr_name+"' class='dhx_file_form' name='dhx_file_form_"+window.dhx4.newId()+"'><input type='hidden' name='mode' value='html4'><input type='hidden' name='uid' value='"+e+"'><input type='file' name='file' class='dhx_file_input'></form>";this.k.appendChild(c);c.firstChild.lastChild._idd=e;c.firstChild.lastChild.onchange=function(){if(!a._beforeAddFileToList(this.value,null)){return}a._addFileToQueue(this);this.onchange=null;this.parentNode.parentNode.style.display="none";a._addForm()};c=null},_onLoad:function(){if(this._uploading){var a=dhx4.s2j(this.fr.contentWindow.document.body.innerHTML);if(typeof(a)=="object"&&a!=null){if(typeof(a.state)!="undefined"){if(a.state=="cancelled"){this._onUploadAbort(this.fr._idd);a=null;return}else{if(a.state==true){if(typeof(a.size)!="undefined"&&!isNaN(a.size)){this._files[this.fr._idd].size=a.size}this._onUploadSuccess(this.fr._idd,a.name,null,a.extra);a=null;return}}}}this._onUploadFail(this.fr._idd,(a!=null&&a.extra!=null?a.extra:null))}},_addFileToQueue:function(c){var a=c.value.match(/[^\\\/]*$/g);if(a[0]!=null){a=a[0]}else{a=c.value}this._files[c._idd]={name:a,form:c.parentNode,node:c.parentNode.parentNode,input:c,state:"added"};this._addFileToList(c._idd,c.value,false,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(e){var a=this._files[e].name;var c=(this._data!=null&&this._data[e]!=null?this._data[e].serverName:null);if(this.callEvent("onBeforeFileRemove",[a,c])!==true){return}this._files[e].input.onchange=null;this._files[e].form.removeChild(this._files[e].input);this._files[e].node.removeChild(this._files[e].form);this._files[e].node.parentNode.removeChild(this._files[e].node);this._files[e].input=null;this._files[e].name=null;this._files[e].form=null;this._files[e].node=null;this._files[e].size=null;this._files[e].state=null;this._files[e]=null;delete this._files[e];this._removeFileFromList(e);this.callEvent("onFileRemove",[a,c])},_doUploadFile:function(a){this.fr._idd=a;this._files[a].form.action=this._url;this._files[a].form.submit()},_uploadStop:function(){if(!this._uploading){return}this.fr.contentWindow.location.href=(this._url)+(this._url.indexOf("?")<0?"?":"&")+"mode=html4&action=cancel&dhxr"+new Date().getTime()},_unloadEngine:function(){if(this.k){this.fr_name=null;this.fr.onreadystatechange=null;this.fr.onload=null;this.fr.parentNode.removeChild(this.fr);this.fr=null;this.k.firstChild.firstChild.lastChild.onchange=null;this.k.parentNode.removeChild(this.k);this.k=null}this._initEngine=null;this._addForm=null;this._onLoad=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.flash=function(){};dhtmlXFileUploader.prototype.flash.prototype={_initEngine:function(){if(!window.dhtmlXFileUploaderSWFObjects){window.dhtmlXFileUploaderSWFObjects={items:{},callEvent:function(h,e,g){return window.dhtmlXFileUploaderSWFObjects.items[h].uploader[e].apply(window.dhtmlXFileUploaderSWFObjects.items[h].uploader,g)}}}var c=this;this._swf_obj_id="dhtmlXFileUploaderSWFObject_"+window.dhx4.newId();this._swf_file_url=this._swf_file_url+(this._swf_file_url.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime();this.buttons.browse.innerHTML="<div id='"+this._swf_obj_id+"' style='width:100%;height:100%;'></div>";swfobject.embedSWF(this._swf_file_url,this._swf_obj_id,"100%","100%","9",null,{ID:this._swf_obj_id,enableLogs:this._swf_logs},{wmode:"transparent"});var a=swfobject.getFlashPlayerVersion();this._titleText="Engine successfuly inited<br>Flash Player: "+a.major+"."+a.minor+"."+a.release;this._progress_type="percentage";window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]={id:this._swf_obj_id,uploader:this}},_beforeAddFileToQueue:function(a,c){return(this.callEvent("onBeforeFileAdd",[a,c])===true)},_addFileToQueue:function(g,c,e){if(window.dhx4.isIE){var a=document.createElement("INPUT");a.type="TEXT";a.style.position="absolute";a.style.left="0px";a.style.top=window.dhx4.absTop(this.buttons.browse)+"px";a.style.width="10px";document.body.appendChild(a);a.focus();document.body.removeChild(a);a=null}this._files[g]={name:c,size:e,state:"added"};this._addFileToList(g,c,e,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(g){if(!this._files[g]){return}var c=this._files[g].name;var e=(this._data!=null&&this._data[g]!=null?this._data[g].serverName:null);if(this.callEvent("onBeforeFileRemove",[c,e])!==true){return}var a=false;if(this._uploading&&this._files[g].state=="uploading"){this._uploadStop();a=true}swfobject.getObjectById(this._swf_obj_id).removeFileById(g);this._files[g].name=null;this._files[g].size=null;this._files[g].state=null;this._files[g]=null;delete this._files[g];this._removeFileFromList(g);this.callEvent("onFileRemove",[c,e]);if(a){this._uploadStart()}},_doUploadFile:function(a){swfobject.getObjectById(this._swf_obj_id).upload(a,this._swf_upolad_url)},_uploadStop:function(e){for(var c in this._files){if(this._files[c].state=="uploading"){swfobject.getObjectById(this._swf_obj_id).uploadStop(c)}}},_unloadEngine:function(){if(window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]){window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id].id=null;window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id].uploader=null;window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]=null;delete window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]}this._swf_obj_id=null;this._initEngine=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.sl=function(){};dhtmlXFileUploader.prototype.sl.prototype={_initEngine:function(){if(typeof(this._sl_v)=="undefined"){this._sl_v=this.getSLVersion()}if(!window.dhtmlXFileUploaderSLObjects){window.dhtmlXFileUploaderSLObjects={items:{},callEvent:function(e,a,c){window.dhtmlXFileUploaderSLObjects.items[e].uploader[a].apply(window.dhtmlXFileUploaderSLObjects.items[e].uploader,c)}}}this._sl_obj_id="dhtmlXFileUploaderSLObject_"+window.dhx4.newId();if(this._sl_v!=false){this._titleText="Engine successfuly inited<br>Silverlight version: "+this._sl_v[0]+"."+this._sl_v[1];this.buttons.browse.innerHTML='<div style="width:100%;height:100%;"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%" id="'+this._sl_obj_id+'"><param name="source" value="'+this._sl_xap+'"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="initParams" value="SLID='+this._sl_obj_id+",LOGS="+this._sl_logs+'"/><param name="minRuntimeVersion" value="5.0"/></object></div>'}else{this._titleText="Silverlight plugin not found<br>or version less than 4.0";this.buttons.browse.style.cursor="wait";this.buttons.browse.title=""}this._progress_type="percentage";window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]={id:this._sl_obj_id,uploader:this}},_addFileToQueue:function(e,a,c){this._files[e]={name:a,size:c,state:"added"};this._addFileToList(e,a,c,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(c){if(!this._files[c]){return}var a=false;if(this._uploading&&this._files[c].state=="uploading"){this._uploadStop();a=true}document.getElementById([this._sl_obj_id]).Content.a.removeFileById(c);this._files[c].name=null;this._files[c].size=null;this._files[c].state=null;this._files[c]=null;delete this._files[c];this._removeFileFromList(c);if(a){this._uploadStart()}},_doUploadFile:function(c){var a=this._sl_upload_url.split("?");a=(a[1]!=null?"&"+a[1]:"");document.getElementById(this._sl_obj_id).Content.a.upload(c,this._sl_upload_url,a+"&mode=sl&dhxr"+new Date().getTime())},_uploadStop:function(e){this._uploading=false;for(var c in this._files){if(this._files[c].state=="uploading"){document.getElementById(this._sl_obj_id).Content.a.uploadStop(c)}}},_unloadEngine:function(){if(window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]){window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id].id=null;window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id].uploader=null;window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]=null;delete window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]}this._sl_obj_id=null;this._initEngine=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.setSLURL=function(a){this._sl_upload_url=a};dhtmlXFileUploader.prototype.getSLVersion=function(){var a=false;if(window.dhx4.isIE){try{var c=new ActiveXObject("AgControl.AgControl");if(c!=null){var l=4,h=0;while(c.isVersionSupported([l,h].join("."))){a=[l,h];if(++h>9){l++;h=0}}}c=null}catch(g){}}else{if(navigator.plugins["Silverlight Plug-In"]!=null){a=navigator.plugins["Silverlight Plug-In"].description.split(".")}}return a};dhtmlXForm.prototype.saveBackup=function(){if(!this._backup){this._backup={};this._backupId=new Date().getTime()}this._backup[++this._backupId]=this.getFormData();return this._backupId};dhtmlXForm.prototype.restoreBackup=function(a){if(this._backup!=null&&this._backup[a]!=null){this.setFormData(this._backup[a])}};dhtmlXForm.prototype.clearBackup=function(a){if(this._backup!=null&&this._backup[a]!=null){this._backup[a]=null;delete this._backup[a]}};dhtmlXForm.prototype.addItem=function(e,a,l,g){var c=null;if(e instanceof Array){c=e[1];e=e[0]}var h=null;if(e!=null){var h=this._getParentForm(e,c);if(h!=null){if(h.item._list==null){if(!a.listParent){a.listParent=h.item._idd}h.form._addItem("list",h.item._idd,[a],null,h.item._idd,l,g)}else{h.item._list[0].addItem(null,a,l,g)}h.form=h.item=null;h=null;this._autoCheck();return}}this._prepareItem(a,l,g);this._autoCheck()};dhtmlXForm.prototype.removeItem=function(c,a){this._removeItem(c,a)};dhtmlXForm.prototype.removeColumn=function(m,l,g,e){var o=null;if(m instanceof Array){o=m[1];m=m[0]}if(m!=null){var h=this._getParentForm(m,o);if(h!=null){if(h.item._list!=null&&h.item._list[0]!=null){h.item._list[0].removeColumn(null,l,g,e)}h.form=h.item=null;h=null}return}l=Math.min(Math.max(l,0),this.cont.childNodes.length-1);if(this.cont.childNodes.length==1){if(g==true){this._removeItemsInColumn(this.cont.childNodes[l])}}else{if(g==true){this._removeItemsInColumn(this.cont.childNodes[l])}else{if(!e){var a=l-1;if(a<0){a=l+1}}else{var a=l+1;if(a>this.cont.childNodes.length-1){a=l-1}}while(this.cont.childNodes[l].childNodes.length>0){this.cont.childNodes[a].appendChild(this.cont.childNodes[l].childNodes[0])}}var n=[];for(var c=0;c<this.base.length;c++){if(this.cont.childNodes[l]!=this.base[c]){n.push(this.base[c])}}this.base=n;this.cont.removeChild(this.cont.childNodes[l]);this.b_index--;n=null}};dhtmlXForm.prototype.getColumnNode=function(e,c){var g=null;var a=null;if(e instanceof Array){a=e[1];e=e[0]}if(e!=null){var h=this._getParentForm(e,a);if(h!=null){if(h.item._list!=null&&h.item._list[0]!=null&&g==null){g=h.item._list[0].getColumnNode(null,c)}h.form=h.item=null;h=null}return g}if(c<0||c>this.cont.childNodes.length-1){return null}return this.cont.childNodes[c]};dhtmlXForm.prototype._removeItemsInColumn=function(g){var a=[];for(var e=0;e<g.childNodes.length;e++){var c=g.childNodes[e];if(c._idd!=null&&c._type!=null){a.push([c._idd,(c._type=="ra"?c._value:null)])}c=null}for(var e=0;e<a.length;e++){this.removeItem(a[e][0],a[e][1])}};dhtmlXForm.prototype._getParentForm=function(l,h){if(this.itemPull[this.idPrefix+l]!=null){return{form:this,item:this.itemPull[this.idPrefix+l]}}for(var c in this.itemPull){if(this.itemPull[c]._type=="ra"&&this.itemPull[c]._group==l&&this.itemPull[c]._value==h){return{form:this,item:this.itemPull[c]}}}var g=null;for(var c in this.itemPull){if(!g&&this.itemPull[c]._list!=null){for(var e=0;e<this.itemPull[c]._list.length;e++){if(!g){g=this.itemPull[c]._list[e]._getParentForm(l,h)}}}}return g};(function(){for(var c in dhtmlXForm.prototype.items){if(!dhtmlXForm.prototype.items[c]._getItemNode){dhtmlXForm.prototype.items[c]._getItemNode=function(a){return a}}}})();dhtmlXForm.prototype._getItemNode=function(c,a){if(a!=null){c=[c,a]}return this.doWithItem(c,"_getItemNode")};dhtmlXForm.prototype.setRequired=function(n,l,h){if(typeof(h)=="undefined"){h=l}else{n=[n,l]}var e=this._getItemNode(n);if(!e){return}h=window.dhx4.s2b(h);e._required=(h==true);if(e._required){if(!e._validate){e._validate=[]}var c=false;for(var g=0;g<e._validate.length;g++){c=(e._validate[g]=="NotEmpty"||c)}if(!c){e._validate.push("NotEmpty")}var m=e.childNodes[e._ll?0:1].childNodes[0];if(!(m.lastChild&&m.lastChild.className&&m.lastChild.className.search(/required/)>=0)){var a=document.createElement("SPAN");a.className="dhxform_item_required";a.innerHTML="*";m.appendChild(a);a=m=null}}else{if(e._validate!=null){var c=e._validate;e._validate=[];for(var g=0;g<c.length;g++){if(c[g]!="NotEmpty"){e._validate.push(c[g])}}if(e._validate.length==0){e._validate=null}}var m=e.childNodes[e._ll?0:1].childNodes[0];if(m.lastChild&&m.lastChild.className&&m.lastChild.className.search(/required/)>=0){m.removeChild(m.lastChild);m=null}}this._resetValidateCss(e);e=null};dhtmlXForm.prototype.setNote=function(h,e,a){if(typeof(a)=="undefined"){a=e}else{h=[h,e]}var c=this._getItemNode(h);if(!c){return}var g=this._getNoteNode(c);if(!g){if(!a.width){a.width=c.childNodes[c._ll?1:0].childNodes[0].offsetWidth}g=document.createElement("DIV");g.className="dhxform_note";if({ch:1,ra:1}[c._type]){c.childNodes[c._ll?1:0].insertBefore(g,c.childNodes[c._ll?1:0].lastChild)}else{c.childNodes[c._ll?1:0].appendChild(g)}}g.innerHTML=a.text;if(a.width!=null){g.style.width=a.width+"px";g._w=a.width}g=null};dhtmlXForm.prototype.clearNote=function(g,c){if(typeof(c)!="undefined"){g=[g,c]}var a=this._getItemNode(g);if(!a){return}var e=this._getNoteNode(a);if(e!=null){e.parentNode.removeChild(e);e=null}};dhtmlXForm.prototype._getNoteNode=function(a){var e=null;for(var c=0;c<a.childNodes[a._ll?1:0].childNodes.length;c++){if(String(a.childNodes[a._ll?1:0].childNodes[c].className).search(/dhxform_note/)>=0){e=a.childNodes[a._ll?1:0].childNodes[c]}}a=null;return e};dhtmlXForm.prototype.setValidation=function(l,g,h){if(typeof(note)=="undefined"){h=g}else{l=[l,g]}var c=this._getItemNode(l);if(!c){return}if(c._validate!=null){for(var e=0;e<c._validate.length;e++){c._validate[e]=null}}c._validate=[];if(typeof(h)=="function"||typeof(window[h])=="function"){c._validate=[h]}else{c._validate=String(h).split(this.separator)}if(c._required){var a=false;for(var e=0;e<c._validate.length;e++){a=(c._validate[e]=="NotEmpty"||a)}if(!a){c._validate.push("NotEmpty")}}c=null};dhtmlXForm.prototype.clearValidation=function(g,e){if(typeof(e)!="undefined"){g=[g,e]}var a=this._getItemNode(g);if(!a){return}if(a._validate!=null){for(var c=0;c<a._validate.length;c++){a._validate[c]=null}}a._validate=a._required?["NotEmpty"]:null;a=null};dhtmlXForm.prototype.reloadOptions=function(a,l){var c=this.getItemType(a);if(!{select:1,multiselect:1,combo:1}[c]){return}if(c=="select"||c=="multiselect"){var g=this.getOptions(a);while(g.length>0){g.remove(0)}g.length=0;g=null;if(typeof(l)=="string"){this.doWithItem(a,"doLoadOptsConnector",l)}else{if(l instanceof Array){this.doWithItem(a,"doLoadOpts",{options:l})}}}if(c=="combo"){var m=this.getCombo(a);m.clearAll();m.setComboValue("");if(typeof(l)=="string"){this.doWithItem(a,"doLoadOptsConnector",l)}else{if(l instanceof Array){var e=null;for(var h=0;h<l.length;h++){if(window.dhx4.s2b(l[h].selected)){e=l[h].value}}m.addOption(l);if(e!=null){this.setItemValue(a,e)}m=null}}}};dhtmlXForm.prototype.setTooltip=function(l,h,g){if(typeof(g)=="undefined"){g=h}else{l=[l,h]}var c=this._getItemNode(l);if(!c){return}var a=null;if(c.childNodes.length==1){a=c.childNodes[0]}else{for(var e=0;e<c.childNodes.length;e++){if(c.childNodes[e].className!=null&&c.childNodes[e].className.search("dhxform_label")>=0){a=c.childNodes[e]}}}if(a!=null){if(g==null||g.length==0){a.removeAttribute("title")}else{a.title=g}}a=null};function dhtmlXAccordion(h,m){var g=this;var e=window.dhx4.transDetect();this.conf={skin:(m||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxacc")||"dhx_skyblue"),css:"dhxacc",icons_path:"",multi_mode:false,last_opened:null,on_active_id:null,on_active_click:false,size_changed:true,def_height:90,total_count:0,hiden_count:0,cont_w:null};this.conf.tr={prop:e.transProp,ev:e.transEv,height_open:"height 0.2s cubic-bezier(0.25,0.1,0.25,1)",height_close:"height 0.18s cubic-bezier(0.25,0.1,0.25,1)",op_open:"opacity 0.16s ease-in",op_close:"opacity 0.2s ease-out",op_v_open:"1",op_v_close:"0.4",dnd_top:"top 0.16s"};this.ofs={m:{},s:{},def:{m:{left:0,right:0,first:0,between:8},s:{left:0,right:0,first:0,between:-1,last:0}},base:{s:{},m:{}},skin:{dhx_web:{s:{between:3},m:{between:3}},dhx_terrace:{m:{between:12,left:0,right:0}}}};if(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>=0){this.conf.tr.height_open=this.conf.tr.height_close}else{this.conf.tr.height_open=this.conf.tr.height_close}var l=null;if(typeof(h)=="object"&&!h.tagName){l={};for(var c in h){l[c]=h[c];h[c]=null}h=l.parent;l.parent=null}window.dhtmlXCellTop.apply(this,[h,h._ofs]);this._adjustCont();if(this.base._ofs!=null){for(var n in this.ofs.base){if(this.base._ofs[n]!=null){for(var c in this.base._ofs[n]){this.ofs.base[n][c]=this.base._ofs[n][c]}}}}this._applyOffsets=function(){for(var u in this.ofs.def){var r=this.ofs.def[u];var s=(this.ofs.skin[this.conf.skin]!=null&&this.ofs.skin[this.conf.skin][u]!=null?this.ofs.skin[this.conf.skin][u]:null);var q=(this.base._ofs!=null?this.base._ofs[u]:null);for(var o in r){if(s!=null&&s[o]!=null){this.ofs[u][o]=s[o]}else{if(q!=null&&q[o]!=null){this.ofs[u][o]=q[o]}else{this.ofs[u][o]=r[o]}}}}};this._applyOffsets();this.t={};this.addItem=function(w,v,q,o,u){if(w==null){w="a"+window.dhx4.newId()}while(this.t[w]!=null){w="a"+window.dhx4.newId()}var a=new dhtmlXAccordionCell(w,this);a.conf.skin=this.conf.skin;a.setText(v);if(u!=null){a.setIcon(u)}a.cell._accId=w;a.cell.childNodes[a.conf.idx.hdr].onselectstart=function(x){x=x||event;if(x.preventDefault){x.preventDefault()}else{x.returnValue=false}return false};a.cell.childNodes[a.conf.idx.hdr].onclick=function(y){y=y||event;if(y.preventDefault){y.preventDefault()}else{y.returnValue=false}if(g._dnd!=null&&g._dnd.ofs==true){return}var x=(y.target||y.srcElement);var A=null;while(x._accId!=this&&A==null){if(x._accId!=null){A=x._accId}else{x=x.parentNode}}if(A!=null){g._hdrClick(A)}};this.t[w]={cell:a};this.conf.total_count++;if(this.conf.multi_mode){if(typeof(q)=="undefined"){q=true}this.cont.appendChild(a.cell);a.conf.opened=(q==true);if(typeof(o)=="undefined"||o==null||o=="*"){if(o=="*"){a.conf.h_auto=true}o=this.conf.def_height}else{o=Math.max(parseInt(o),30)}a._setSize(this.ofs.m.left,0,this.conf.cont_w||this._getAvailItemWidth(),a.conf.opened?o:a._getHdrHeight());a.cell.style.marginTop=(a.cell==this.cont.firstChild?this.ofs.m.first:this.ofs.m.between)+"px";if(q!=true){a.conf.size.h=o;a._adjustCell();a.cell.className+=" dhx_cell_closed"}this._adjustOpened();if(this._dnd!=null){this._dndAttachEvent(w)}}else{q=(this.conf.last_opened==null?true:window.dhx4.s2b(q));var s=this._updateCellsHeight();if(this.conf.last_opened!=null){if(q){this._closeItem(this.conf.last_opened,false)}else{var r=this.t[this.conf.last_opened].cell;r._setSize(r.conf.size.x,r.conf.size.y,r.conf.size.w,s);r=null}}this.cont.appendChild(a.cell);a.conf.opened=q;a.cell.style.marginTop=String(a.cell==this.cont.firstChild?this.ofs.s.first:this.ofs.s.between)+"px";a._setSize(this.ofs.s.left,0,this.conf.cont_w||this._getAvailItemWidth(),q?s:a._getHdrHeight());if(q){this.conf.last_opened=w}else{a.conf.size.h=s;a._adjustCell();a.cell.className+=" dhx_cell_closed"}}a=null;return this.t[w].cell};this.removeItem=function(a){if(!this.t[a]){return}if(this.conf.last_opened==a){this.conf.last_opened=null}if(this.conf.on_active_id==a){this.conf.on_active_id=null}if(this._dnd!=null){this._dndClearCell(a)}this.conf.total_count--;if(!this.conf.multi_mode&&!this.t[a].cell.conf.visible){this.conf.hiden_count--}this.t[a].cell._unload();this.t[a].cell=null;this.t[a]=null;delete this.t[a];if(!this.conf.unloading){if(!this.conf.multi_mode){this._updateCellsMargin()}this.setSizes()}};this.cells=function(a){return this.t[a].cell};this.enableMultiMode=function(a,o){this.conf.multi_mode=true;if(!isNaN(o)){this.conf.def_height=o}if(a=="auto"||a=="scroll"){this.cont.style.overflowX="hidden";this.cont.style.overflowY=a}else{this.cont.style.overflow="visible"}};this.forEachItem=function(q){for(var o in this.t){if(typeof(q)=="function"){q.apply(this,[this.t[o].cell])}else{if(typeof(q)=="string"&&typeof(window[q])=="function"){window[q].apply(this,[this.t[o].cell])}}}};this._openItem=function(o,a){if(typeof(a)=="undefined"){a=true}if(this.t[o].cell.conf.opened==false){if(this.conf.multi_mode){this.t[o].cell._open(a)}else{if(this.conf.tr.prop==false){if(this.conf.last_opened!=null){this.t[this.conf.last_opened].cell._close(false)}this.t[o].cell._open(false);this.conf.last_opened=o}else{this.conf.on_active_id=o;this.t[o].cell._open(a);if(this.conf.last_opened!=null){this.t[this.conf.last_opened].cell._close(a)}this.conf.last_opened=o}}}};this._closeItem=function(o,a){if(typeof(a)=="undefined"){a=true}if(this.t[o].cell.conf.opened==true){this.t[o].cell._close(a);this.conf.last_opened=null}};this._adjustOpened=function(){if(this.conf.multi_mode==true){if(this._openCache==null){var s=this._getDynData();for(var q in s){this.t[q].cell.conf.size.h=s[q];this.t[q].cell.cell.style.height=s[q]+"px"}}else{var u=false;for(var q in this._openCache){u=(u||this._openCache[q])}if(u==true){return}this._openCache=this._openId=null}var o=this._getAvailItemWidth();for(var q in this.t){var r=true;if(o==this.t[q].cell.conf.size.w&&(this._openMode=="close"||this.t[q].cell.conf.opened==false)){r=false}if(r){this.t[q].cell._setWidth(o)}}this._openMode=null}else{if(this.conf.last_opened!=null){var v=this.conf.last_opened;this.t[v].cell._setSize(this.t[v].cell.conf.size.x,this.t[v].cell.conf.size.y,this.t[v].cell.conf.size.w,this.t[v].cell.conf.size.h)}}};this._getDynData=function(D,C){if(typeof(D)=="undefined"||D==null){D={}}if(typeof(C)=="undefined"||C==null){C={}}var w={};var A=0;var v=0;var s=0;for(var o=0;o<this.cont.childNodes.length;o++){var r=this.cont.childNodes[o]._accId;var F=this.t[r].cell;if(F.conf.visible==true){var x=this.ofs.m[s==0?"first":"between"];if(D[r]==true||C[r]==true||(F.conf.opened==true&&F.conf.h_auto==true)){if(C[r]==true){var y=F._getHdrHeight();w[r]=y;v+=y+x}else{if(F.conf.h_auto==true){w[r]=true;v+=x;A++}else{if(D[r]==true){w[r]=F.conf.size.h;v+=F.conf.size.h+x}}}}else{v+=F.cell.offsetHeight+x}s++}F=null}if(A>0){var u=this.cont.offsetHeight-v;var v=Math.floor(u/A);for(var E in w){if(w[E]==true){if(A>1){u-=v}else{v=u}w[E]=v;A--}}}return w};this.setSizes=function(){this._adjustCont();if(this.conf.multi_mode==true){this._adjustOpened()}else{this.conf.cont_w=null;var q=this._updateCellsHeight();for(var o in this.t){this.t[o].cell._setSize(this.ofs.s.left,0,this.conf.cont_w||this._getAvailItemWidth(),this.t[o].cell.conf.opened?q:this.t[o].cell._getHdrHeight());if(!this.t[o].cell.conf.opened){this.t[o].cell.conf.size.h=q;this.t[o].cell._adjustCell()}}this.conf.size_changed=true}this.callEvent("_onSetSizes",[])};this.setSkin=function(q){this._setBaseSkin(q);this.conf.skin=q;for(var o in this.t){this.t[o].cell.conf.cells_cont=null;this.t[o].cell.conf.skin=this.conf.skin}this._applyOffsets();this._updateCellsMargin();this.setSizes()};this.setIconsPath=function(a){this.conf.icons_path=a};this._getAvailItemWidth=function(){var o=this.ofs[(this.conf.multi_mode?"m":"s")];var a=Math.max(this.cont.clientWidth-o.left-o.right,10);this.conf.cont_w=a;o=null;return a};this._updateCellsHeight=function(){if(this.conf.multi_mode==true){return}var r=this.conf.total_count-this.conf.hiden_count;var s=this.cont.offsetHeight-this.ofs.s.last;if(r==0){return s}var v=false;for(var u=0;u<this.cont.childNodes.length;u++){if(v==false){var w=this.cont.childNodes[u]._accId;if(this.t[w].cell.conf.visible){s-=this.t[w].cell._getHdrHeight()*(r-1);v=true}}}s-=(r-1)*this.ofs.s.between+this.ofs.s.first;for(var o in this.t){if(this.t[o].cell.conf.size!=null){this.t[o].cell.conf.size.h=s;this.t[o].cell._adjustCell()}}return s};this._updateCellsMargin=function(){var a=0;for(var o=0;o<this.cont.childNodes.length;o++){var r=this.cont.childNodes[o]._accId;if(this.t[r].cell.conf.visible){this.t[r].cell.cell.style.marginTop=String(this.ofs[this.conf.multi_mode?"m":"s"][a++==0?"first":"between"])+"px"}}};this._hdrClick=function(o){if(!this.conf.multi_mode&&this.t[o].cell.conf.opened){return}var a=this.t[o].cell.conf.opened;if(this.callEvent("onBeforeActive",[o,(a?false:true)])!==true){return}this.conf.on_active_click=true;this[a?"_closeItem":"_openItem"](o);if(this.conf.multi_mode&&this.conf.tr.prop==false){this._adjustOpened()}};this.unload=function(){this.conf.unloading=true;for(var o in this.t){this.removeItem(o)}this.t=null;if(typeof(this._unloadDND)=="function"){this._unloadDND()}if(this.dhxWins){this.dhxWins.unload();this.dhxWins=null}this._unloadTop();window.dhx4._enableDataLoading(this,null,null,null,"clear");window.dhx4._eventable(this,"clear");this.ofs=this.conf=null;for(var o in this){this[o]=null}g=null};this.setOffset=function(a){this.ofs.s.between=a;this.ofs.m.between=a;this._updateCellsMargin();this.setSizes()};this._initObj=function(o){if(o.skin!=null){this.setSkin(o.skin)}if(window.dhx4.s2b(o.multi_mode)){this.enableMultiMode()}if(o.icons_path!=null){this.setIconsPath(o.icons_path)}if(o.icon_path!=null){this.setIconsPath(o.icon_path)}if(o.items!=null){for(var a=0;a<o.items.length;a++){this.addItem(o.items[a].id,o.items[a].text,o.items[a].open,o.items[a].height,o.items[a].icon||o.items[a].img)}}if(window.dhx4.s2b(o.dnd)==true&&typeof(this.enableDND)=="function"){this.enableDND()}};this._xmlToObj=function(u){var r={items:[]};var a=u.getElementsByTagName("accordion")[0];if(a.getAttribute("skin")!=null){r.skin=a.getAttribute("skin")}if(a.getAttribute("mode")=="multi"){r.multi_mode=true}if(a.getAttribute("multiMode")!=null){r.multi_mode=window.dhx4.s2b(a.getAttribute("multiMode"))}if(a.getAttribute("iconsPath")!=null){r.icons_path=a.getAttribute("iconsPath")}for(var s=0;s<a.childNodes.length;s++){var v=a.childNodes[s];if(typeof(v.tagName)!="undefined"&&String(v.tagName).toLowerCase()=="cell"){var o={};if(v.getAttribute("id")!=null){o.id=v.getAttribute("id")}if(v.getAttribute("icon")!=null){o.icon=v.getAttribute("icon")}if(v.getAttribute("height")!=null){o.height=v.getAttribute("height")}if(v.getAttribute("open")!=null){o.open=window.dhx4.s2b(v.getAttribute("open"))}o.text=v.firstChild.nodeValue;r.items.push(o)}v=null}return r};window.dhx4._enableDataLoading(this,"_initObj","_xmlToObj","accordion",{struct:true});window.dhx4._eventable(this);this._callMainEvent=function(o,a){return this.callEvent(o,a)};this.attachEvent("onActive",function(a){if(this.t[a].cell.dataObj!=null&&this.t[a].cell.dataType=="editor"){this.t[a].cell.dataObj._prepareContent(true)}if(this.t[a].cell.conf.opened==true){this.t[a].cell._adjustProgress()}});if(typeof(window.dhtmlXWindows)=="function"){this.dhxWins=new dhtmlXWindows();this.dhxWins.setSkin(this.conf.skin)}if(l!=null){this._initObj(l);l=null}return this}dhtmlXAccordion.prototype=new dhtmlXCellTop();function dhtmlXAccordionCell(g,e){dhtmlXCellObject.apply(this,[g,"_acc"]);this.acc=e;this.conf.visible=true;this.conf.docked=true;this.attachEvent("_onCellUnload",function(){this._trDetachEv();this._unloadDocking();this.acc=null;this.cell._accObj=null;this.cell.childNodes[this.conf.idx.hdr].onselectstart=null;this.cell.childNodes[this.conf.idx.hdr].onclick=null;this._initHeader=null;this._getHdrHeight=null;this._setWidth=null;this._adjustCell=null;this._open=null;this._close=null;this._isOpened=null;this._trInitEv=null;this._trAttachEv=null;this._trDetachEv=null;this._trOnEnd=null;this._onActiveCall=null;this.setText=null;this.getText=null;this.setIcon=null;this.clearIcon=null;this.show=null;this.hide=null;this.isVisible=null;this.setHeight=null;this.moveOnTop=null});this.acc.attachEvent("onBeforeDrag",function(l){if(this.t[l].cell.dataObj!=null&&this.t[l].cell.dataType=="editor"){if(this.conf.editor_data==null){this.conf.editor_data={}}this.conf.editor_data[l]=this.t[l].cell.dataObj.getContent()}for(var h in this.t){this.t[h].cell._showCellCover()}return true});this.acc.attachEvent("onDrop",function(l){if(this.t[l].cell.dataObj!=null&&this.t[l].cell.dataType=="editor"){this.t[l].cell.dataObj._prepareContent(true);if(this.conf.editor_data!=null&&this.conf.editor_data[l]!=null){this.t[l].cell.dataObj.setContent(this.conf.editor_data[l]);this.conf.editor_data[l]=null}}for(var h in this.t){this.t[h].cell._hideCellCover()}});this.attachEvent("_onContentLoaded",function(){this.acc._callMainEvent("onContentLoaded",arguments)});this.attachEvent("_onBeforeContentAttach",function(a){if(a=="sidebar"&&this.conf.skin!="dhx_skyblue"){this._hideBorders()}});this._initHeader();this.conf.tr={};for(var c in this.acc.conf.tr){this.conf.tr[c]=this.acc.conf.tr[c]}if(this.conf.tr.prop!=false){this.attachEvent("_onIdxUpdated",function(){this._cellSetOpacity((this.conf.opened?"open":"close"),false)})}this.open=function(){this.acc._openItem(this._idd)};this.close=function(){this.acc._closeItem(this._idd)};this._setWidth=function(a){if(a!=this.conf.size.w){this.conf.size.w=a;this.cell.style.width=a+"px"}this._adjustCell()};this._adjustCell=function(){this._adjustCont();if(this.dataObj!=null&&typeof(this.dataObj.setSizes)=="function"){this.dataObj.setSizes()}};this._initDocking();return this}dhtmlXAccordionCell.prototype=new dhtmlXCellObject();dhtmlXAccordionCell.prototype._initHeader=function(){var a=document.createElement("DIV");a.className="dhx_cell_hdr";a.innerHTML="<div class='dhx_cell_hdr_text'></div><div class='dhx_cell_hdr_arrow'></div>";this.cell.insertBefore(a,this.cell.childNodes[this.conf.idx.cont]);a=null;this.conf.ofs_nodes.t._getHdrHeight="func";this.conf.hdr={visible:true};this.conf.idx_data.hdr="dhx_cell_hdr";this._updateIdx()};dhtmlXAccordionCell.prototype._getHdrHeight=function(){return this.cell.childNodes[this.conf.idx.hdr].offsetHeight};dhtmlXAccordionCell.prototype.showHeader=function(){if(this.conf.hdr.visible==true){return}this.conf.hdr.visible=true;this.cell.childNodes[this.conf.idx.hdr].className="dhx_cell_hdr";this._adjustCont(this._idd)};dhtmlXAccordionCell.prototype.hideHeader=function(){if(this.conf.hdr.visible!=true){return}this.conf.hdr.visible=false;this.cell.childNodes[this.conf.idx.hdr].className="dhx_cell_hdr dhx_cell_hdr_hidden";this._adjustCont(this._idd)};dhtmlXAccordionCell.prototype.isHeaderVisible=function(){return(this.conf.hdr.visible==true)};dhtmlXAccordionCell.prototype.setText=function(a){this.conf.text=a;this.cell.childNodes[this.conf.idx.hdr].firstChild.innerHTML="<span>"+a+"</span>"};dhtmlXAccordionCell.prototype.getText=function(){return this.conf.text};dhtmlXAccordionCell.prototype.setIcon=function(e){var c=this.cell.childNodes[this.conf.idx.hdr];if(c.firstChild.className!="dhx_cell_hdr_icon"){c.firstChild.className+=" dhx_cell_hdr_icon";var a=document.createElement("IMG");a.className="dhx_cell_hdr_icon";c.insertBefore(a,c.firstChild);a=null}c.firstChild.src=this.acc.conf.icons_path+e;c=null};dhtmlXAccordionCell.prototype.clearIcon=function(){var a=this.cell.childNodes[this.conf.idx.hdr];if(a.firstChild.className=="dhx_cell_hdr_icon"){a.removeChild(a.firstChild);a.firstChild.className=String(a.firstChild.className).replace(/\s{1,}dhx_cell_hdr_icon/gi,"")}a=null};dhtmlXAccordionCell.prototype._open=function(c){var h={};if(this.acc.conf.multi_mode){var g={};g[this._idd]=true;h=this.acc._getDynData(g);this.acc._openId=this._idd;this.acc._openCache={};this.acc._openMode="open"}else{h[this._idd]=this.conf.size.h}for(var e in h){if(this.acc._openCache!=null){this.acc._openCache[e]=true}var l=this.acc.t[e].cell;l.cell.className=String(l.cell.className).replace(/\s{1,}dhx_cell_closed/gi,"");l.conf.opened=true;l._trInitEv("open",c);l.conf.size.h=h[e];l.cell.style.height=l.conf.size.h+"px";l=null}if(this.conf.tr.prop==false){this.acc._openId=this.acc._openCache=this.acc._openMode=null;this._onActiveCall(true)}};dhtmlXAccordionCell.prototype._close=function(c){var g={};if(this.acc.conf.multi_mode){var h={};h[this._idd]=true;g=this.acc._getDynData(null,h);this.acc._openId=this._idd;this.acc._openCache={};this.acc._openMode="close"}else{g[this._idd]=this._getHdrHeight()}for(var e in g){var l=this.acc.t[e].cell;if(this.acc._openCache!=null){this.acc._openCache[e]=true}if(e==this._idd){l.cell.className+=" dhx_cell_closed";l.conf.opened=false;l._trInitEv("close",c)}else{l.conf.size.h=g[e];l._adjustCell();l._trInitEv("open",c)}l.cell.style.height=g[e]+"px";l=null}if(this.conf.tr.prop==false){this.acc._openId=this.acc._openCache=this.acc._openMode=null;this._onActiveCall(false)}};dhtmlXAccordionCell.prototype.isOpened=function(){return(this.conf.opened==true)};dhtmlXAccordionCell.prototype._trInitEv=function(c,a){if(this.conf.tr.prop==false){return}this._trAttachEv();if(!this.cell._accObj){this.cell._accObj=this.acc}if(a){this.cell.style[this.conf.tr.prop]=this.conf.tr["height_"+c]}this._cellSetOpacity(c,a)};dhtmlXAccordionCell.prototype._trAttachEv=function(){if(!this.conf.tr.ev_attached){this.cell._trProp=this.conf.tr.prop;this.cell.addEventListener(this.conf.tr.ev,this._trOnEnd,false);this.conf.tr.ev_attached=true}};dhtmlXAccordionCell.prototype._trDetachEv=function(){if(this.conf.tr.ev_attached){this.cell.addEventListener(this.conf.tr.ev,this._trOnEnd,false);this.conf.tr.ev_attached=false}};dhtmlXAccordionCell.prototype._trOnEnd=function(a){if(a.stopPropagation){a.stopPropagation()}if(a.propertyName=="height"&&this._accObj!=null){this.style[this._trProp]="";if(this._accObj.conf.multi_mode){if(this._accObj._openCache!=null){this._accObj._openCache[this._accId]=false}this._accObj._adjustOpened()}if(this._accObj.conf.on_active_click==true){if(this._accObj.conf.multi_mode){this._accObj._callMainEvent("onActive",[this._accId,this._accObj.t[this._accId].cell.conf.opened]);this._accObj.conf.on_active_click=false}else{this._accObj._callMainEvent("onActive",[this._accObj.conf.on_active_id,true]);this._accObj.conf.on_active_id=null;this._accObj.conf.on_active_click=false}}this._accObj=null}};dhtmlXAccordionCell.prototype._cellSetOpacity=function(g,c){for(var e in this.conf.idx){if({hdr:true,pr1:true,pr2:true,cover:true}[e]!=true){if(c){this.cell.childNodes[this.conf.idx[e]].style[this.conf.tr.prop]=this.conf.tr["op_"+g]}this.cell.childNodes[this.conf.idx[e]].style.opacity=this.conf.tr["op_v_"+g]}}};dhtmlXAccordionCell.prototype._onActiveCall=function(a){if(this.acc.conf.on_active_click==false){return}if(this.acc.conf.multi_mode==true){this.acc._callMainEvent("onActive",[this._idd,this.conf.opened]);this.acc.conf.on_active_click=false}else{if(a==true){this.acc._callMainEvent("onActive",[this._idd,true]);this.acc.conf.on_active_click=false}}};dhtmlXAccordionCell.prototype.show=function(){if(this.conf.visible){return}if(this.conf.docked==false){this.dock();return}this.cell.style.display="";this.conf.visible=true;if(!this.acc.conf.multi_mode){this.acc.conf.hiden_count--;this.acc._updateCellsHeight();this.acc._updateCellsMargin()}if(this.acc.conf.size_changed){this.acc.setSizes();this.acc.conf.size_changed=false}else{this.acc._adjustOpened()}};dhtmlXAccordionCell.prototype.hide=function(){if(!this.conf.visible){return}if(!this.acc.conf.multi_mode&&this.conf.opened){this._close(false);this.acc.conf.last_opened=null}this.cell.style.display="none";this.conf.visible=false;if(!this.acc.conf.multi_mode){this.acc.conf.hiden_count++;this.acc._updateCellsHeight();this.acc._updateCellsMargin()}this.acc._adjustOpened()};dhtmlXAccordionCell.prototype.isVisible=function(){return(this.conf.visible==true)};dhtmlXAccordionCell.prototype.setHeight=function(a){if(!this.acc.conf.multi_mode){return}if(a=="*"){this.conf.h_auto=true}else{this.conf.h_auto=false;this.conf.size.h=a}if(this.conf.opened){if(a!="*"){this.cell.style.height=a+"px"}this.acc._adjustOpened()}};dhtmlXAccordionCell.prototype.moveOnTop=function(){if(this.cell.parentNode.firstChild==this.cell){return}this.cell.parentNode.insertBefore(this.cell,this.cell.parentNode.firstChild);this.acc._updateCellsMargin()};dhtmlXAccordionCell.prototype._initDocking=function(){var a=this;this.dock=function(){if(this.acc.dhxWins==null||this.conf.docked==true){return}var c=this.acc.dhxWins.window(this._idd);c.close();this._attachFromCell(c);this.conf.docked=true;this.show();if(this.conf.dock_opened){this.open()}c=null;this.acc._callMainEvent("onDock",[this._idd])};this.undock=function(c,m,g,l){if(this.acc.dhxWins==null||this.conf.docked==false){return}this.conf.dock_opened=this.conf.opened;if(this.acc.dhxWins.window(this._idd)!=null){var e=this.acc.dhxWins.window(this._idd);e.show()}else{if(c==null){c=20}if(m==null){m=20}if(g==null){g=320}if(l==null){l=200}var e=this.acc.dhxWins.createWindow(this._idd,c,m,g,l);e.button("close").hide();e.addUserButton("dock",99,"Dock");e.button("dock").show();e.button("dock").attachEvent("onClick",this._doOnDockClick);e.setText(this.getText());e.attachEvent("onClose",this._doOnDockWinClose)}this.conf.docked=false;this.hide();e._attachFromCell(this);e=null;this.acc._callMainEvent("onUnDock",[this._idd])};this._doOnDockClick=function(){a.dock()};this._doOnDockWinClose=function(c){c.hide();return false};this._unloadDocking=function(){a=null}};dhtmlXCellObject.prototype.attachAccordion=function(a){this.callEvent("_onBeforeContentAttach",["acc"]);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}}}if(typeof(window.dhtmlXTabBarCell)!="undefined"&&(this instanceof window.dhtmlXTabBarCell)){if(this.conf.skin=="dhx_skyblue"){c._ofs={t:-1,r:-1,b:-1,l:-1}}}if(typeof(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){if(this.conf.skin=="dhx_web"){c._ofs={l:2}}else{c._ofs={l:-1}}}if(typeof(window.dhtmlXCarouselCell)!="undefined"&&(this instanceof window.dhtmlXCarouselCell)){this._hideBorders()}this.dataType="acc";this.dataObj=new dhtmlXAccordion(a);a.parent=null;c=a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXAccordion.prototype.enableDND=function(){if(this.conf.multi_mode==false||this._dnd!=null){return}var e=this;this._dnd={tr_count:0,tr_items:{}};this._dndAttachEvent=function(g){var a=this.t[g].cell;if(a.conf.dnd_inited!=true){if(typeof(window.addEventListener)=="function"){a.cell.childNodes[a.conf.idx.hdr].addEventListener("mousedown",this._dndOnMouseDown,false)}else{a.cell.childNodes[a.conf.idx.hdr].attachEvent("onmousedown",this._dndOnMouseDown)}a.conf.dnd_inited=true}a=null};this._dndDetachEvent=function(g){var a=this.t[g].cell;if(a.conf.dnd_inited==true){if(typeof(window.addEventListener)=="function"){a.cell.childNodes[a.conf.idx.hdr].removeEventListener("mousedown",this._dndOnMouseDown,false)}else{a.cell.childNodes[a.conf.idx.hdr].detachEvent("onmousedown",this._dndOnMouseDown)}a.conf.dnd_inited=false}a=null};this._dndOnMouseDown=function(g){g=g||event;if(g.preventDefault){g.preventDefault()}var a=(g.target||g.srcElement);while(a!=null&&a.parentNode!=e.cont){a=a.parentNode}if(a!=null){e._dndDragStart(g,a)}a=null};this._dndDragStart=function(m,h){if(this._dnd.tr_waiting==true){return}var a=-1;for(var l=0;l<h.parentNode.childNodes.length;l++){if(h.parentNode.childNodes[l]==h){a=l}}if(this.callEvent("onBeforeDrag",[h._accId,a])!==true){return}if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousemove",this._dndOnMouseMove,false);document.body.addEventListener("mouseup",this._dndOnMouseUp,false)}else{document.body.attachEvent("onmousemove",this._dndOnMouseMove,false);document.body.attachEvent("onmouseup",this._dndOnMouseUp,false)}this._dnd.dragObj=h;this._dnd.dy=m.clientY;var g=0;for(var l=0;l<this._dnd.dragObj.parentNode.childNodes.length;l++){this._dnd.dragObj.parentNode.childNodes[l]._ind=l;if(this._dnd.dragObj.parentNode.childNodes[l]==this._dnd.dragObj){this._dnd.dragObj._k0=g;if(l>0){this._dnd.dragObj._k0+=this.ofs.m.between-this.ofs.m.first}g=0}else{g+=this._dnd.dragObj.parentNode.childNodes[l].offsetHeight+parseInt(this._dnd.dragObj.parentNode.childNodes[l].style.marginTop)}}this._dnd.dragObj._k1=g;this._dnd.h=this._dnd.dragObj.offsetHeight;this._dnd.ofs=false};this._dndDoDrag=function(u){if(!this._dnd.dragObj){return}if(this._dnd.tr_waiting==true){return}var m=u.clientY-this._dnd.dy;if(this._dnd.ofs==false&&Math.abs(m)>5){this._dnd.dragObj.className+=" acc_cell_dragged";this._dnd.ofs=true}if(m<0){if(m<-this._dnd.dragObj._k0){m=-this._dnd.dragObj._k0}}else{if(m>this._dnd.dragObj._k1){m=this._dnd.dragObj._k1}}this._dnd.dragObj.style.top=m+"px";var o=u.clientY-this._dnd.dy;var l=0;var g=0;for(var n=this._dnd.dragObj._ind+1;n<=this._dnd.dragObj.parentNode.lastChild._ind;n++){var a=this._dnd.dragObj.parentNode.childNodes[n].offsetHeight;if(o>l+a*2/3){g++}l+=a}var h=this._dnd.dragObj.nextSibling;var n=0;while(h!=null){if(++n<=g&&h!=null){if(!h._ontop){if(h._tm){window.clearTimeout(h._tm)}this._dndAnim(h,false,parseInt(h.style.top||0),-this._dnd.h-this.ofs.m.between);h._ontop=true}}else{if(h._ontop){if(h._tm){window.clearTimeout(h._tm)}this._dndAnim(h,true,parseInt(h.style.top||0),0);h._ontop=false}}h=h.nextSibling}var o=this._dnd.dy-u.clientY;var l=0;var g=0;for(var n=this._dnd.dragObj._ind-1;n>=this._dnd.dragObj.parentNode.firstChild._ind;n--){var a=this._dnd.dragObj.parentNode.childNodes[n].offsetHeight;if(o>l+a*2/3){g++}l+=a}var h=this._dnd.dragObj.previousSibling;var n=0;while(h!=null){if(++n<=g&&h!=null){if(!h._onbottom){if(h._tm){window.clearTimeout(h._tm)}this._dndAnim(h,true,parseInt(h.style.top||0),this._dnd.h+this.ofs.m.between);h._onbottom=true}}else{if(h._onbottom){if(h._tm){window.clearTimeout(h._tm)}this._dndAnim(h,false,parseInt(h.style.top),0);h._onbottom=false}}h=h.previousSibling}};this._dndDragStop=function(o,m){if(m){}else{if(this._dnd.tr_count>0){this._dnd.tr_waiting=true;return}}if(!this._dnd.dragObj){return}this._dnd.dragObj.className=String(this._dnd.dragObj.className).replace(/\s{0,}acc_cell_dragged/gi,"");this._dnd.dragObj.style.top="0px";var n=false;for(var l=0;l<this._dnd.dragObj.parentNode.childNodes.length;l++){var h=this._dnd.dragObj.parentNode.childNodes[l];if(h!=this._dnd.dragObj){if(h._tm){window.clearTimeout(h._tm)}h.style.top="0px";if(h._ontop&&((h.nextSibling!=null&&h.nextSibling._ontop!=true)||!h.nextSibling)){n=(h.nextSibling||null)}if(h._onbottom&&((h.previousSibling!=null&&h.previousSibling._onbottom!=true)||!h.previousSibling)){n=h}}h=null}for(var l=0;l<this._dnd.dragObj.parentNode.childNodes.length;l++){this._dnd.dragObj.parentNode.childNodes[l]._ontop=null;this._dnd.dragObj.parentNode.childNodes[l]._onbottom=null}if(n!==false){if(n==null){this._dnd.dragObj.parentNode.appendChild(this._dnd.dragObj)}else{this._dnd.dragObj.parentNode.insertBefore(this._dnd.dragObj,n)}}var r=this._dnd.dragObj._accId;var g=this._dnd.dragObj._ind;var a=g;for(var l=0;l<this._dnd.dragObj.parentNode.childNodes.length;l++){if(this._dnd.dragObj.parentNode.childNodes[l]==this._dnd.dragObj){a=l}}this._dnd.dragObj=null;this._dnd.tr_waiting=false;this._updateCellsMargin();if(g!=a){this.setSizes();this.callEvent("onDrop",[r,g,a])}if(typeof(window.addEventListener)=="function"){document.body.removeEventListener("mousemove",this._dndOnMouseMove,false);document.body.removeEventListener("mouseup",this._dndOnMouseUp,false)}else{document.body.detachEvent("onmousemove",this._dndOnMouseMove,false);document.body.detachEvent("onmouseup",this._dndOnMouseUp,false)}};this._dndAnim=function(m,a,l,h){if(this.conf.tr.prop!=false){if(!m._dnd_ev){m._dnd_ev=true;m._dnd_tr_prop=this.conf.tr.prop;m.addEventListener(this.conf.tr.ev,this._dndOnTrEnd,false)}if(this._dnd.tr_items[m._accId]!=true){this._dnd.tr_items[m._accId]=true;this._dnd.tr_count++}m.style[this.conf.tr.prop]=this.conf.tr.dnd_top;m.style.top=h+"px";return}var g=false;if(a){l+=5;if(l>=h){l=h;g=true}}else{l-=5;if(l<=h){l=h;g=true}}m.style.top=l+"px";if(m._tm){window.clearTimeout(m._tm)}if(!g){m._tm=window.setTimeout(function(){e._dndAnim(m,a,l,h)},5)}else{m._tm=null}};this._dndOnTrEnd=function(a){if(a.stopPropagation){a.stopPropagation()}if(a.propertyName=="top"){if(e._dnd.tr_items[this._accId]==true){e._dnd.tr_count--;e._dnd.tr_items[this._accId]=false}this.style[this._dnd_tr_prop]="";if(e._dnd.tr_count==0&&e._dnd.tr_waiting==true){e._dndDragStop(null,true)}}};this._dndOnMouseMove=function(a){e._dndDoDrag(a||event)};this._dndOnMouseUp=function(a){e._dndDragStop(a||event)};this._dndClearCell=function(a){if(this.t[a].cell.cell._dnd_ev){this.t[a].cell.cell.addEventListener(this.conf.tr.ev,this._dndOnTrEnd,false)}this._dndDetachEvent(a)};this._unloadDND=function(){for(var g in this){if(String(g).indexOf("_dnd")==0&&typeof(this[g])=="function"){this[g]=null}}this._dnd=null;e=null};for(var c in this.t){this._dndAttachEvent(c)}};function dhtmlXLayoutObject(e,o,w){var u=null;if(e!=null&&typeof(e)=="object"&&typeof(e.tagName)=="undefined"&&e._isCell!=true){u={};if(e.autosize!=null){u.autosize=e.autosize}if(e.cells!=null){u.cells=e.cells}if(e.pattern!=null){o=e.pattern}if(e.skin!=null){w=e.skin}if(e.offsets!=null){u.offsets=e.offsets}e=e.parent}this.cdata={};this.conf={skin:(w||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxlayout")||"dhx_skyblue"),css:"dhxlayout",hh:20,autosize:"b",nextCell:{a:"b",b:"a"},inited:false,b_size:{w:-1,h:-1}};if(typeof(e)=="object"&&e._isCell==true){var n=(typeof(u)!="undefined"&&u!=null?u:{});if(n.pattern==null&&o!=null){n.pattern=o}if(n.skin==null&&w!=null){n.skin=w}var l=e.attachLayout(n);return l}window.dhtmlXCellTop.apply(this,[e,(u==null?null:u.offsets)]);this.conf.sw=this._detectSW();var m=this;this._getLayout=function(){return this};this.mainInst=(e._layoutMainInst!=null?e._layoutMainInst:null);this._getMainInst=function(){if(this.mainInst!=null){return this.mainInst._getMainInst()}return this};this._init=function(A){var y=(typeof(A)=="string"?this.tplData[A]:A);this.conf.mode=y.mode;if(this.conf.mode=="c"){this.cdata.a=new dhtmlXLayoutCell("a",this)}else{this.cdata.a=new dhtmlXLayoutCell("a",this);this.cdata.b=new dhtmlXLayoutCell("b",this)}for(var x in this.cdata){this.cont.appendChild(this.cdata[x].cell);this.cdata[x].conf.init={w:0.5,h:0.5}}if(this.conf.mode!="c"){var q=this._getMainInst();if(q.conf.sep_idx==null){q.conf.sep_idx=1}else{q.conf.sep_idx++}this.sep=new dhtmlXLayoutSepObject(this.conf.mode,q.conf.sep_idx);this.cont.appendChild(this.sep.sep);this.sep._getLayout=function(){return m._getLayout()};q=null}if(y.cells!=null){for(var x in y.cells){if(y.cells[x].width!=null){this.cdata[x].conf.init.w=y.cells[x].width}if(y.cells[x].height!=null){this.cdata[x].conf.init.h=y.cells[x].height}if(y.cells[x].name!=null){this.cdata[x].conf.name=y.cells[x].name;this.cdata[x].setText(y.cells[x].name)}if(y.cells[x].fsize!=null){this.cdata[x].conf.fsize=y.cells[x].fsize}}}this.setSizes();for(var x in this.cdata){this.cdata[x].conf.init={}}if(y.cells!=null){for(var x in y.cells){if(y.cells[x].layout!=null){this.cdata[x].dataNested=true;this.cdata[x]._layoutMainInst=this;this.cdata[x].attachLayout({pattern:y.cells[x].layout});this.cdata[x]._layoutMainInst=null}}}};this.setSizes=function(E,M,I,x){var F=(this.conf.inited==true&&this._getMainInst()==this&&this.checkEvent("onResizeFinish")==true?{}:false);this._adjustCont();var L=this.cont.offsetWidth;var C=this.cont.offsetHeight;if(this.conf.mode=="c"){var a=0;var N=0;var q=L;var K=C;this.cdata.a._setSize(a,N,q,K,E,I,x);this.callEvent("_onSetSizes",[]);if(F&&(!(this.conf.b_size.w==L&&this.conf.b_size.h==C))){this._callMainEvent("onResizeFinish",[])}this.conf.b_size={w:L,h:C};return}if(typeof(M)=="undefined"){var y=(this.conf.mode=="v"?"w":"h");M=this.conf.autosize;if(this.cdata.a.conf.collapsed){M="b"}else{if(this.cdata.b.conf.collapsed){M="a"}else{if(E=="a"||E=="b"){M=this.conf.nextCell[E]}}}}else{}if(this.conf.mode=="v"){if(M=="a"){if(this.cdata.b.conf.init.w!=null){var J=Math.round(L*this.cdata.b.conf.init.w-this.conf.sw/2)}else{var J=this.cdata.b.conf.size.w}var H=L-J;var D=0;var A=C;var a=0;var N=D;var q=H-a-this.conf.sw;var K=A}else{var a=0;var N=0;if(this.cdata.a.conf.init.w!=null){var q=Math.round(L*this.cdata.a.conf.init.w-this.conf.sw/2)-a}else{var q=this.cdata.a.conf.size.w}var K=C-N;var H=a+q+this.conf.sw;var D=N;var J=L-H;var A=K}this.cdata.a._setSize(a,N,q,K,E,I,x);this.cdata.b._setSize(H,D,J,A,E,I,x);this.sep._setSize(a+q,N,this.conf.sw,K)}else{if(M=="a"){if(this.cdata.b.conf.init.h!=null){var A=Math.round(C*this.cdata.b.conf.init.h-this.conf.sw/2)}else{var A=this.cdata.b.conf.size.h}var H=0;var D=C-A;var J=L-H;var a=H;var N=0;var q=J;var K=D-N-this.conf.sw}else{var a=0;var N=0;var q=L-a;if(this.cdata.a.conf.init.h!=null){var K=Math.round(C*this.cdata.a.conf.init.h-this.conf.sw/2)}else{var K=this.cdata.a.conf.size.h}var H=a;var D=N+K+this.conf.sw;var J=q;var A=C-D}this.cdata.a._setSize(a,N,q,K,E,I,x);this.cdata.b._setSize(H,D,J,A,E,I,x);this.sep._setSize(a,N+K,q,this.conf.sw)}this.callEvent("_onSetSizes",[]);if(F&&(!(this.conf.b_size.w==L&&this.conf.b_size.h==C))){this._callMainEvent("onResizeFinish",[])}this.conf.b_size={w:L,h:C}};this._getAvailWidth=function(){var A=[];for(var E=0;E<this.conf.as_cells.h.length;E++){var x=this.cells(this.conf.as_cells.h[E]);var C=x.layout;var y=C.conf.autosize;if(x.conf.collapsed){x=C.cdata[C.conf.nextCell[x._idd]];y=C.conf.nextCell[y]}A.push(Math.max(0,x.getWidth()-x._getMinWidth(y)));C=x=null}var D=(A.length>0?Math.min.apply(window,A):0);return this.cont.offsetWidth-D};this._getAvailHeight=function(){var C=[];for(var E=0;E<this.conf.as_cells.v.length;E++){var x=this.cells(this.conf.as_cells.v[E]);var A=x.layout;var y=A.conf.autosize;if(x.conf.collapsed){x=A.cdata[A.conf.nextCell[x._idd]];y=A.conf.nextCell[y]}C.push(Math.max(0,x.getHeight()-x._getHdrHeight()-x._getMinHeight(y)));A=x=null}var D=Math.min.apply(window,C);return this.cont.offsetHeight-D};this.setSkin=function(a){this._setBaseSkin(a);this.conf.skin=a};this.unload=function(){this.conf.unloading=true;this.mainInst=null;this.parentLayout=null;if(this.items!=null){for(var y=0;y<this.items.length;y++){this.items[y]=null}this.items=null}if(this.dhxWins!=null){this.dhxWins.unload();this.dhxWins=null}if(this.sep!=null){this.sep._unload();this.sep=null}for(var x in this.cdata){this.cdata[x]._unload();this.cdata[x]=null}this._unloadTop();window.dhx4._eventable(this,"clear");for(var x in this){this[x]=null}m=null};this._getWindowMinDimension=function(y){var a=m._getAvailWidth()+7+7;var x=m._getAvailHeight()+7+31;var q={w:Math.max(a,200),h:Math.max(x,140)};y=null;return q};window.dhx4._eventable(this);this._callMainEvent=function(q,a){return this.callEvent(q,a)};this._init(o||"3E");var r=this._availAutoSize[o];if(r!=null){this.conf.pattern=o;this.setAutoSize(r.h[r.h.length-1],r.v[r.v.length-1])}if(typeof(window.dhtmlXWindows)=="function"&&this.mainInst==null){var g={vp_overflow:(this.conf.fs_mode==true?false:"auto")};this.dhxWins=new dhtmlXWindows(g);this.dhxWins.setSkin(this.conf.skin)}this.conf.inited=true;if(this==this._getMainInst()){var s=0;this.items=[];this.forEachItem(function(a){m.items.push(a);a.conf.index=s++})}if(this==this._getMainInst()&&u!=null){if(u.autosize!=null){this.setAutoSize.apply(this,u.autosize)}if(u.cells!=null){for(var c=0;c<u.cells.length;c++){var h=u.cells[c];var v=this.cells(h.id);if(h.width){v.setWidth(h.width)}if(h.height){v.setHeight(h.height)}if(h.text){v.setText(h.text)}if(h.collapsed_text){v.setCollapsedText(h.collapsed_text)}if(h.collapse){v.collapse()}if(h.fix_size){v.fixSize(h.fix_size[0],h.fix_size[1])}if(typeof(h.header)!="undefined"&&window.dhx4.s2b(h.header)==false){v.hideHeader()}}}}u=null;return this}dhtmlXLayoutObject.prototype=new dhtmlXCellTop();dhtmlXLayoutObject.prototype.cells=function(g){for(var c in this.cdata){if(this.cdata[c].conf.name==g){return this.cdata[c]}if(this.cdata[c].dataType=="layout"&&this.cdata[c].dataNested==true&&this.cdata[c].dataObj!=null){var e=this.cdata[c].dataObj.cells(g);if(e!=null){return e}}}return null};dhtmlXLayoutObject.prototype.forEachItem=function(g,e){if(typeof(g)!="function"){return}if(typeof(e)=="undefined"){e=this}for(var c in this.cdata){if(typeof(this.cdata[c].conf.name)!="undefined"){g.apply(e,[this.cdata[c]])}if(this.cdata[c].dataType=="layout"&&this.cdata[c].dataNested==true&&this.cdata[c].dataObj!=null){this.cdata[c].dataObj.forEachItem(g,e)}}e=null};dhtmlXLayoutObject.prototype._forEachSep=function(g,e){if(typeof(g)!="function"){return}if(typeof(e)=="undefined"){e=this}if(this.sep!=null){g.apply(e,[this.sep])}for(var c in this.cdata){if(this.cdata[c].dataType=="layout"&&this.cdata[c].dataNested==true&&this.cdata[c].dataObj!=null){this.cdata[c].dataObj._forEachSep(g,e)}}e=null};dhtmlXLayoutObject.prototype._detectSW=function(){if(this._confGlob.sw==null){this._confGlob.sw={}}if(this._confGlob.sw[this.conf.skin]==null){this._confGlob.sw[this.conf.skin]=window.dhx4.readFromCss("dhxlayout_sep_sw_"+this.conf.skin)}return this._confGlob.sw[this.conf.skin]};dhtmlXLayoutObject.prototype._confGlob={};dhtmlXLayoutObject.prototype.listPatterns=function(){var e=[];for(var c in this.tplData){e.push(c)}return e};dhtmlXLayoutObject.prototype.listAutoSizes=function(){var g=(this.conf.as_cells!=null?(this.conf.as_cells.h).join(";"):"");var e=(this.conf.as_cells!=null?(this.conf.as_cells.v).join(";"):"");var c=this._availAutoSize[this.conf.pattern].h;var a=this._availAutoSize[this.conf.pattern].v;return[g,e,c,a]};dhtmlXLayoutObject.prototype._getCellsNames=function(g){var h={};if(this.cdata[g].conf.name!=null){h[this.cdata[g].conf.name]=true}if(this.cdata[g].dataType=="layout"&&this.cdata[g].dataObj!=null&&this.cdata[g].dataObj.mainInst==this){var c=this.cdata[g].dataObj._getCellsNames("a");var l=this.cdata[g].dataObj._getCellsNames("b");for(var e in c){h[e]=c[e]}for(var e in l){h[e]=l[e]}}return h};dhtmlXLayoutObject.prototype.setAutoSize=function(c,o,r){if(r!==true){var v=this.listAutoSizes();if(v[0]==c&&v[1]==o){return}var n=false;var l=false;for(var e=0;e<v[2].length;e++){n=n||v[2][e]==c}for(var e=0;e<v[3].length;e++){l=l||v[3][e]==o}if(!n||!l){return}}this.conf.as_cells={h:c.split(";"),v:o.split(";")};var g=(this.conf.mode=="v"?"h":"v");for(var u in this.cdata){var h=this._getCellsNames(u);var w=false;for(var e=0;e<this.conf.as_cells[g].length;e++){w=w||h[this.conf.as_cells[g][e]]}if(w){this.conf.autosize=u}if(this.cdata[u].dataType=="layout"&&this.cdata[u].dataObj!=null){this.cdata[u].dataObj.setAutoSize(c,o,true)}}};dhtmlXLayoutObject.prototype.tplData={"1C":{mode:"c",cells:{a:{name:"a"}}},"2E":{mode:"h",cells:{a:{name:"a",fsize:{v:1}},b:{name:"b",fsize:{v:1}}}},"2U":{mode:"v",cells:{a:{name:"a",fsize:{h:1}},b:{name:"b",fsize:{h:1}}}},"3E":{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{v:[1,2]}},b:{name:"c",fsize:{v:2}}}}}}},"3W":{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:[1,2]}},b:{name:"c",fsize:{h:2}}}}}}},"3J":{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"a",fsize:{h:1,v:2}},b:{name:"c",fsize:{h:1,v:2}}}}},b:{name:"b",fsize:{h:1}}}},"3L":{mode:"v",cells:{a:{name:"a",fsize:{h:1}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{h:1,v:2}},b:{name:"c",fsize:{h:1,v:2}}}}}}},"3T":{mode:"h",cells:{a:{name:"a",fsize:{v:1}},b:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:2,v:1}},b:{name:"c",fsize:{h:2,v:1}}}}}}},"3U":{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"a",fsize:{h:2,v:1}},b:{name:"b",fsize:{h:2,v:1}}}}},b:{name:"c",fsize:{v:1}}}},"4H":{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"b",fsize:{h:[1,2],v:3}},b:{name:"c",fsize:{h:[1,2],v:3}}}}},b:{name:"d",fsize:{h:2}}}}}}},"4I":{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:3,v:[1,2]}},b:{name:"c",fsize:{h:3,v:[1,2]}}}}},b:{name:"d",fsize:{v:2}}}}}}},"4T":{mode:"h",cells:{a:{name:"a",fsize:{v:1}},b:{layout:{mode:"v",cells:{a:{name:"b",width:1/3,fsize:{h:2,v:1}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:[2,3],v:1}},b:{name:"d",fsize:{h:3,v:1}}}}}}}}}},"4U":{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:2,v:1}},b:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:[2,3],v:1}},b:{name:"c",fsize:{h:3,v:1}}}}}}}},b:{name:"d",fsize:{v:1}}}},"4E":{mode:"h",cells:{a:{name:"a",height:1/4,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/3,fsize:{v:[1,2]}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{v:[2,3]}},b:{name:"d",fsize:{v:3}}}}}}}}}},"4W":{mode:"v",cells:{a:{name:"a",width:1/4,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",width:1/3,fsize:{h:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:[2,3]}},b:{name:"d",fsize:{h:3}}}}}}}}}},"4A":{mode:"v",cells:{a:{width:1/3,layout:{mode:"h",cells:{a:{name:"a",fsize:{h:1,v:2}},b:{name:"b",fsize:{h:1,v:2}}}}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:[1,3]}},b:{name:"d",fsize:{h:3}}}}}}},"4L":{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:[1,2]}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{h:2,v:3}},b:{name:"d",fsize:{h:2,v:3}}}}}}}}}},"4J":{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:3,v:2}},b:{name:"d",fsize:{h:3,v:2}}}}}}}}}},"4F":{mode:"h",cells:{a:{height:1/3,layout:{mode:"v",cells:{a:{name:"a",fsize:{h:2,v:1}},b:{name:"b",fsize:{h:2,v:1}}}}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{v:[1,3]}},b:{name:"d",fsize:{v:3}}}}}}},"4G":{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{h:1,v:[2,3]}},b:{name:"c",fsize:{h:1,v:3}}}}}}}},b:{name:"d",fsize:{h:1}}}},"4C":{mode:"v",cells:{a:{name:"a",fsize:{h:1}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/3,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{h:1,v:[2,3]}},b:{name:"d",fsize:{h:1,v:3}}}}}}}}}},"5H":{mode:"v",cells:{a:{width:1/3,name:"a",fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"b",height:1/3,fsize:{h:[1,2],v:3}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{h:[1,2],v:[3,4]}},b:{name:"d",fsize:{h:[1,2],v:4}}}}}}}},b:{name:"e",fsize:{h:2}}}}}}},"5I":{mode:"h",cells:{a:{height:1/3,name:"a",fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"b",width:1/3,fsize:{h:3,v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:[3,4],v:[1,2]}},b:{name:"d",fsize:{h:4,v:[1,2]}}}}}}}},b:{name:"e",fsize:{v:2}}}}}}},"5U":{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"a",width:1/4,fsize:{h:2,v:1}},b:{layout:{mode:"v",cells:{a:{name:"b",width:1/3,fsize:{h:[2,3],v:1}},b:{layout:{mode:"v",cells:{a:{name:"c",fsize:{h:[3,4],v:1}},b:{name:"d",fsize:{h:4,v:1}}}}}}}}}}},b:{name:"e",fsize:{v:1}}}},"5E":{mode:"h",cells:{a:{name:"a",height:1/5,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/4,fsize:{v:[1,2]}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/3,fsize:{v:[2,3]}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{v:[3,4]}},b:{name:"e",fsize:{v:4}}}}}}}}}}}}},"5W":{mode:"v",cells:{a:{name:"a",width:1/5,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",width:1/4,fsize:{h:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",width:1/3,fsize:{h:[2,3]}},b:{layout:{mode:"v",cells:{a:{name:"d",fsize:{h:[3,4]}},b:{name:"e",fsize:{h:4}}}}}}}}}}}}},"5K":{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{h:1,v:[2,3]}},b:{name:"c",fsize:{h:1,v:3}}}}}}}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{h:1,v:4}},b:{name:"e",fsize:{h:1,v:4}}}}}}},"5S":{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"a",fsize:{h:1,v:2}},b:{name:"b",fsize:{h:1,v:2}}}}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/3,fsize:{h:1,v:3}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{h:1,v:[3,2]}},b:{name:"e",fsize:{h:1,v:4}}}}}}}}}},"5G":{mode:"v",cells:{a:{width:1/3,layout:{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"b",fsize:{h:1,v:[2,3]}},b:{name:"c",fsize:{h:1,v:3}}}}}}}},b:{layout:{mode:"v",cells:{a:{name:"d",fsize:{h:[1,4]}},b:{name:"e",fsize:{h:4}}}}}}},"5C":{mode:"v",cells:{a:{width:2/3,layout:{mode:"v",cells:{a:{name:"a",fsize:{h:2}},b:{name:"b",fsize:{h:[2,1]}}}}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/3,fsize:{h:1,v:3}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{h:1,v:[3,4]}},b:{name:"e",fsize:{h:1,v:4}}}}}}}}}},"6H":{mode:"v",cells:{a:{width:1/3,name:"a",fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"b",height:1/4,fsize:{h:[1,2],v:3}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/3,fsize:{h:[1,2],v:[3,4]}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{h:[1,2],v:[4,5]}},b:{name:"e",fsize:{h:[1,2],v:5}}}}}}}}}}},b:{name:"f",fsize:{h:2}}}}}}},"6I":{mode:"h",cells:{a:{height:1/3,name:"a",fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"b",width:1/4,fsize:{h:3,v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",width:1/3,fsize:{h:[3,4],v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"d",fsize:{h:[4,5],v:[1,2]}},b:{name:"e",fsize:{h:5,v:[1,2]}}}}}}}}}}},b:{name:"f",fsize:{v:2}}}}}}},"6A":{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"a",height:1/5,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/4,fsize:{h:1,v:[2,3]}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/3,fsize:{h:1,v:[3,4]}},b:{layout:{mode:"h",cells:{a:{name:"d",fsize:{h:1,v:[4,5]}},b:{name:"e",fsize:{h:1,v:5}}}}}}}}}}}}}},b:{name:"f",fsize:{h:1}}}},"6C":{mode:"v",cells:{a:{name:"a",fsize:{h:1}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/5,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/4,fsize:{h:1,v:[2,3]}},b:{layout:{mode:"h",cells:{a:{name:"d",height:1/3,fsize:{h:1,v:[3,4]}},b:{layout:{mode:"h",cells:{a:{name:"e",fsize:{h:1,v:[4,5]}},b:{name:"f",fsize:{h:1,v:5}}}}}}}}}}}}}}}},"6J":{mode:"v",cells:{a:{width:1/3,layout:{mode:"h",cells:{a:{name:"a",height:1/4,fsize:{h:1,v:2}},b:{layout:{mode:"h",cells:{a:{name:"b",height:1/3,fsize:{h:1,v:[2,3]}},b:{layout:{mode:"h",cells:{a:{name:"c",fsize:{h:1,v:[3,4]}},b:{name:"d",fsize:{h:1,v:4}}}}}}}}}}},b:{layout:{mode:"v",cells:{a:{name:"e",fsize:{h:[1,5]}},b:{name:"f",fsize:{h:5}}}}}}},"6E":{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",fsize:{h:[1,2]}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/4,fsize:{h:2,v:3}},b:{layout:{mode:"h",cells:{a:{name:"d",height:1/3,fsize:{h:2,v:[3,4]}},b:{layout:{mode:"h",cells:{a:{name:"e",fsize:{h:2,v:[4,5]}},b:{name:"f",fsize:{h:2,v:5}}}}}}}}}}}}}}}},"6W":{mode:"v",cells:{a:{name:"a",width:1/6,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{name:"b",width:1/5,fsize:{h:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",width:1/4,fsize:{h:[2,3]}},b:{layout:{mode:"v",cells:{a:{name:"d",width:1/3,fsize:{h:[3,4]}},b:{layout:{mode:"v",cells:{a:{name:"e",fsize:{h:[4,5]}},b:{name:"f",fsize:{h:5}}}}}}}}}}}}}}}},"7H":{mode:"v",cells:{a:{name:"a",width:1/3,fsize:{h:1}},b:{layout:{mode:"v",cells:{a:{layout:{mode:"h",cells:{a:{name:"b",height:1/5,fsize:{h:[1,2],v:3}},b:{layout:{mode:"h",cells:{a:{name:"c",height:1/4,fsize:{h:[1,2],v:[3,4]}},b:{layout:{mode:"h",cells:{a:{name:"d",height:1/3,fsize:{h:[1,2],v:[4,5]}},b:{layout:{mode:"h",cells:{a:{name:"e",fsize:{h:[1,2],v:[5,6]}},b:{name:"f",fsize:{h:[1,2],v:6}}}}}}}}}}}}}},b:{name:"g",fsize:{h:2}}}}}}},"7I":{mode:"h",cells:{a:{name:"a",height:1/3,fsize:{v:1}},b:{layout:{mode:"h",cells:{a:{layout:{mode:"v",cells:{a:{name:"b",width:1/5,fsize:{h:3,v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"c",width:1/4,fsize:{h:[3,4],v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"d",width:1/3,fsize:{h:[4,5],v:[1,2]}},b:{layout:{mode:"v",cells:{a:{name:"e",fsize:{h:[5,6],v:[1,2]}},b:{name:"f",fsize:{h:6,v:[1,2]}}}}}}}}}}}}}},b:{name:"g",fsize:{v:2}}}}}}}};dhtmlXLayoutObject.prototype._availAutoSize={"1C":{h:["a"],v:["a"]},"2E":{h:["a;b"],v:["a","b"]},"2U":{h:["a","b"],v:["a;b"]},"3E":{h:["a;b;c"],v:["a","b","c"]},"3W":{h:["a","b","c"],v:["a;b;c"]},"3J":{h:["a;c","b"],v:["a;b","b;c"]},"3L":{h:["a","b;c"],v:["a;b","a;c"]},"3T":{h:["a;b","a;c"],v:["a","b;c"]},"3U":{h:["a;c","b;c"],v:["a;b","c"]},"4H":{h:["a","b;c","d"],v:["a;b;d","a;c;d"]},"4I":{h:["a;b;d","a;c;d"],v:["a","b;c","d"]},"4T":{h:["a;b","a;c","a;d"],v:["a","b;c;d"]},"4U":{h:["a;d","b;d","c;d"],v:["a;b;c","d"]},"4E":{h:["a;b;c;d"],v:["a","b","c","d"]},"4W":{h:["a","b","c","d"],v:["a;b;c;d"]},"4A":{h:["a;b","c","d"],v:["a;c;d","b;c;d"]},"4L":{h:["a","b","c;d"],v:["a;b;c","a;b;d"]},"4J":{h:["a;b;c","a;b;d"],v:["a","b","c;d"]},"4F":{h:["a;c;d","b;c;d"],v:["a;b","c","d"]},"4G":{h:["a;b;c","d"],v:["a;d","b;d","c;d"]},"4C":{h:["a","b;c;d"],v:["a;b","a;c","a;d"]},"5H":{h:["a","b;c;d","e"],v:["a;b;e","a;c;e","a;d;e"]},"5I":{h:["a;b;e","a;c;e","a;d;e"],v:["a","b;c;d","e"]},"5U":{h:["a;e","b;e","c;e","d;e"],v:["a;b;c;d","e"]},"5E":{h:["a;b;c;d;e"],v:["a","b","c","d","e"]},"5W":{h:["a","b","c","d","e"],v:["a;b;c;d;e"]},"5K":{h:["a;b;c","d;e"],v:["a;d","b;d","c;d","a;e","b;e","c;e"]},"5S":{h:["a;b","c;d;e"],v:["a;c","a;d","a;e","b;c","b;d","b;e"]},"5G":{h:["a;b;c","d","e"],v:["a;d;e","b;d;e","c;d;e"]},"5C":{h:["a","b","c;d;e"],v:["a;b;c","a;b;d","a;b;e"]},"6H":{h:["a","b;c;d;e","f"],v:["a;b;f","a;c;f","a;d;f","a;e;f"]},"6I":{h:["a;b;f","a;c;f","a;d;f","a;e;f"],v:["a","b;c;d;e","f"]},"6A":{h:["a;b;c;d;e","f"],v:["a;f","b;f","c;f","d;f","e;f"]},"6C":{h:["a","b;c;d;e;f"],v:["a;b","a;c","a;d","a;e","a;f"]},"6J":{h:["a;b;c;d","e","f"],v:["a;e;f","b;e;f","c;e;f","d;e;f"]},"6E":{h:["a","b","c;d;e;f"],v:["a;b;c","a;b;d","a;b;e","a;b;f"]},"6W":{h:["a","b","c","d","e","f"],v:["a;b;c;d;e;f"]},"7H":{h:["a","b;c;d;e;f","g"],v:["a;b;g","a;c;g","a;d;g","a;e;g","a;f;g"]},"7I":{h:["a;b;g","a;c;g","a;d;g","a;e;g","a;f;g"],v:["a","b;c;d;e;f","g"]}};function dhtmlXLayoutSepObject(e,a){var c=this;this.conf={mode:e,idx:a,blocked:false,locked:false,btn_left:((window.dhx4.isIE6||window.dhx4.isIE7||window.dhx4.isIE8)&&typeof(window.addEventListener)=="undefined"?1:0)};if(window.dhx4.isIE&&navigator.userAgent.indexOf("MSIE 7.0")>=0&&navigator.userAgent.indexOf("Trident")>=0){this.conf.btn_left=1}this.sep=document.createElement("DIV");this.sep.className="dhxlayout_sep";if(window.dhx4.isIE==true){this.sep.onselectstart=function(){return false}}this.sep.className="dhxlayout_sep dhxlayout_sep_resize_"+this.conf.mode;this._setSize=function(g,n,l,m){this.sep.style.left=g+"px";this.sep.style.top=n+"px";this.sep.style.width=Math.max(l,0)+"px";this.sep.style.height=Math.max(m,0)+"px"};this._lockSep=function(g){this.conf.locked=(g==true);this._blockSep()};this._setWH=function(g){var h=this._getLayout();h.conf.sw=(g==null?h._detectSW():Math.max(parseInt(g)||-1,-1));h._getMainInst().setSizes();h=null};this._blockSep=function(){var g=this._getLayout();var h=g.cdata.a.conf.collapsed||g.cdata.b.conf.collapsed||this.conf.locked;g=null;if(this.conf.blocked==h){return}this.sep.className="dhxlayout_sep"+(h?"":" dhxlayout_sep_resize_"+this.conf.mode);this.conf.blocked=h};this._beforeResize=function(h){if(this.conf.blocked){return}if(this.conf.resize!=null&&this.conf.resize.active==true){return}if(h.type==window.dhx4.dnd.evs.start){this.sep.className+=" dhxlayout_sep_resize_actv";var m=(h.pageX||h.touches[0].pageX);var l=(h.pageY||h.touches[0].pageY)}else{if(h.button!==this.conf.btn_left){return}var m=h.clientX;var l=h.clientY}if(window.dhx4.dnd.p_en==true){window.dhx4.dnd._touchOff()}var g=this._getLayout();this.conf.resize={sx:m,sy:l,tx:h.layerX,ty:h.layerY,sep_x:parseInt(this.sep.style.left),sep_y:parseInt(this.sep.style.top),min_wa:g.cdata.a._getAvailWidth("a"),min_wb:g.cdata.b._getAvailWidth("b"),min_ha:g.cdata.a._getAvailHeight("a"),min_hb:g.cdata.b._getAvailHeight("b")};this.conf.resize.nx=this.conf.resize.sep_x;this.conf.resize.ny=this.conf.resize.sep_y;if(typeof(window.addEventListener)=="function"){window.addEventListener("mousemove",this._doOnMouseMove,false);window.addEventListener("mouseup",this._doOnMouseUp,false);window.addEventListener(window.dhx4.dnd.evs.move,this._doOnMouseMove,false);window.addEventListener(window.dhx4.dnd.evs.end,this._doOnMouseUp,false)}else{document.body.attachEvent("onmousemove",this._doOnMouseMove);document.body.attachEvent("onmouseup",this._doOnMouseUp)}g=null};this._onResize=function(l){if(!this.conf.resize.active){this._initResizeArea();this.conf.resize.active=true}if(this.conf.mode=="v"){var g=(l.type=="mousemove"?l.clientX:(l.pageX||l.touches[0].pageX));var h=this.conf.resize.sx-g;this.conf.resize.nx=this.conf.resize.sep_x-h;if(this.conf.resize.nx>this.conf.resize.sep_x+this.conf.resize.min_wb){this.conf.resize.nx=this.conf.resize.sep_x+this.conf.resize.min_wb}else{if(this.conf.resize.nx<this.conf.resize.sep_x-this.conf.resize.min_wa){this.conf.resize.nx=this.conf.resize.sep_x-this.conf.resize.min_wa}}this.r_sep.style.left=this.conf.resize.nx+"px"}else{var m=(l.type=="mousemove"?l.clientY:(l.pageY||l.touches[0].pageY));var h=this.conf.resize.sy-m;this.conf.resize.ny=this.conf.resize.sep_y-h;if(this.conf.resize.ny>this.conf.resize.sep_y+this.conf.resize.min_hb){this.conf.resize.ny=this.conf.resize.sep_y+this.conf.resize.min_hb}else{if(this.conf.resize.ny<this.conf.resize.sep_y-this.conf.resize.min_ha){this.conf.resize.ny=this.conf.resize.sep_y-this.conf.resize.min_ha}}this.r_sep.style.top=this.conf.resize.ny+"px"}};this._afterResize=function(q){if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",this._doOnMouseMove,false);window.removeEventListener("mouseup",this._doOnMouseUp,false);window.removeEventListener(window.dhx4.dnd.evs.move,this._doOnMouseMove,false);window.removeEventListener(window.dhx4.dnd.evs.end,this._doOnMouseUp,false)}else{document.body.detachEvent("onmousemove",this._doOnMouseMove);document.body.detachEvent("onmouseup",this._doOnMouseUp)}if(!this.conf.resize.active){this.conf.resize=null;return}if(q.type==window.dhx4.dnd.evs.end){this.sep.className=this.sep.className.replace(/\s{0,}dhxlayout_sep_resize_actv/gi,"")}else{if(q.button!==this.conf.btn_left){return}}var m=this._getLayout();var h=m._getMainInst();var n=(h.checkEvent("onPanelResizeFinish")==true?{}:false);if(n!==false){h.forEachItem(function(s){n[s.conf.name]={w:s.conf.size.w,h:s.conf.size.h};s=null})}var l=this.conf.resize.nx-this.conf.resize.sep_x;var g=this.conf.resize.ny-this.conf.resize.sep_y;m.cdata.a._setSize(m.cdata.a.conf.size.x,m.cdata.a.conf.size.y,m.cdata.a.conf.size.w+l,m.cdata.a.conf.size.h+g,"a");m.cdata.b._setSize(m.cdata.b.conf.size.x+l,m.cdata.b.conf.size.y+g,m.cdata.b.conf.size.w-l,m.cdata.b.conf.size.h-g,"b");this._setSize(parseInt(this.r_sep.style.left),parseInt(this.r_sep.style.top),parseInt(this.r_sep.style.width),parseInt(this.r_sep.style.height));if(window.dhx4.isIE){var r=this;window.setTimeout(function(){r._removeResizeArea();r=null},1)}else{this._removeResizeArea()}if(n!==false){var o=[];h.forEachItem(function(s){var u=n[s.conf.name];if(!(u.w==s.conf.size.w&&u.h==s.conf.size.h)){o.push(s.conf.name)}s=null});h._callMainEvent("onPanelResizeFinish",[o])}h=m=null;this.conf.resize.active=false;this.conf.resize=null;if(window.dhx4.dnd.p_en==true){window.dhx4.dnd._touchOn()}};this._initResizeArea=function(){if(this.r_sep==null){this.r_sep=document.createElement("DIV");this.r_sep.className="dhxlayout_resize_sep";this.r_sep.style.left=this.sep.style.left;this.r_sep.style.top=this.sep.style.top;this.r_sep.style.width=this.sep.style.width;this.r_sep.style.height=this.sep.style.height;this.sep.parentNode.appendChild(this.r_sep);if(window.dhx4.isIE){this.r_sep.onselectstart=function(){return false}}}if(this.r_area==null){this.r_area=document.createElement("DIV");this.r_area.className="dhxlayout_resize_area";this.sep.parentNode.appendChild(this.r_area);if(window.dhx4.isIE){this.r_area.onselectstart=function(){return false}}if(this.conf.mode=="v"){var g=parseInt(this.r_sep.style.left)-this.conf.resize.min_wa;var n=parseInt(this.r_sep.style.top);var l=this.conf.resize.min_wa+this.conf.resize.min_wb+parseInt(this.r_sep.style.width);var m=parseInt(this.r_sep.style.height)}else{var g=parseInt(this.r_sep.style.left);var n=parseInt(this.r_sep.style.top)-this.conf.resize.min_ha;var l=parseInt(this.r_sep.style.width);var m=this.conf.resize.min_ha+this.conf.resize.min_hb+parseInt(this.r_sep.style.height)}this.r_area.style.left=g+"px";this.r_area.style.top=n+"px";if(!dhtmlXLayoutObject.prototype._confGlob.reszieCover){dhtmlXLayoutObject.prototype._confGlob.reszieCover={};this.r_area.style.width=l+"px";this.r_area.style.height=m+"px";dhtmlXLayoutObject.prototype._confGlob.reszieCover.w=parseInt(this.r_area.style.width)-this.r_area.offsetWidth;dhtmlXLayoutObject.prototype._confGlob.reszieCover.h=parseInt(this.r_area.style.height)-this.r_area.offsetHeight}this.r_area.style.width=l+dhtmlXLayoutObject.prototype._confGlob.reszieCover.w+"px";this.r_area.style.height=m+dhtmlXLayoutObject.prototype._confGlob.reszieCover.h+"px"}document.body.className+=" dhxlayout_resize_"+this.conf.mode};this._removeResizeArea=function(){this.r_sep.onselectstart=null;this.r_sep.parentNode.removeChild(this.r_sep);this.r_sep=null;this.r_area.onselectstart=null;this.r_area.parentNode.removeChild(this.r_area);this.r_area=null;document.body.className=String(document.body.className).replace(/\s{0,}dhxlayout_resize_[vh]/gi,"")};this._doOnMouseDown=function(g){g=g||event;if(g.preventDefault){g.preventDefault()}else{g.cancelBubble=true}c._beforeResize(g)};this._doOnBodyMouseDown=function(g){g=g||event;if(c.conf.resize==null){return}if(c.conf.resize.active==true&&g.button!==c.conf.btn_left){if(g.preventDefault){g.preventDefault()}g.returnValue=false;g.cancelBubble=true;return false}};this._doOnMouseMove=function(g){g=g||event;if(g.preventDefault){g.preventDefault()}else{g.cancelBubble=true}c._onResize(g)};this._doOnMouseUp=function(g){g=g||event;if(g.type=="mouseup"&&g.button!==c.conf.btn_left){return}c._afterResize(g)};if(typeof(window.addEventListener)=="function"){this.sep.addEventListener("mousedown",this._doOnMouseDown,false);this.sep.addEventListener(window.dhx4.dnd.evs.start,this._doOnMouseDown,false);document.body.addEventListener("mousedown",this._doOnBodyMouseDown,false);document.body.addEventListener("contextmenu",this._doOnBodyMouseDown,false)}else{this.sep.attachEvent("onmousedown",this._doOnMouseDown);document.body.attachEvent("onmousedown",this._doOnBodyMouseDown);document.body.attachEvent("oncontextmenu",this._doOnBodyMouseDown)}this._unload=function(){if(typeof(window.addEventListener)=="function"){this.sep.removeEventListener("mousedown",this._doOnMouseDown,false);this.sep.removeEventListener(window.dhx4.dnd.evs.start,this._doOnMouseDown,false);document.body.removeEventListener("mousedown",this._doOnBodyMouseDown,false);document.body.removeEventListener("contextmenu",this._doOnBodyMouseDown,false)}else{this.sep.detachEvent("onmousedown",this._doOnMouseDown);document.body.detachEvent("onmousedown",this._doOnBodyMouseDown);document.body.detachEvent("oncontextmenu",this._doOnBodyMouseDown)}if(window.dhx4.isIE==true){this.sep.onselectstart=null}this.sep.parentNode.removeChild(this.sep);this.sep=null;for(var g in this){this[g]=null}c=null};return this}dhtmlXLayoutObject.prototype.setSeparatorSize=function(e,g){if(typeof(e)=="number"){var h=this.setSeparatorSize({index:e,current:-1},g);if(h.sep!=null){h.sep._setWH(g)}return}for(var c in this.cdata){if(this.cdata[c].dataType=="layout"&&this.cdata[c].dataNested==true&&this.cdata[c].dataObj!=null){e=this.cdata[c].dataObj.setSeparatorSize(e,g);if(e.sep!=null){return e}}if(c=="a"&&this.sep!=null){e.current++;if(e.index==e.current){return{sep:this.sep}}}}return e};window.dhtmlXLayoutCell=function(g,e){dhtmlXCellObject.apply(this,[g,"_layout"]);var c=this;this.layout=e;this.conf.skin=this.layout.conf.skin;this.conf.mode=this.layout.conf.mode;this.conf.collapsed=false;this.conf.fixed={w:false,h:false};this.conf.docked=true;this.conf.min_width=26;this.conf.min_height=26;this.attachEvent("_onCellUnload",function(){this.cell.childNodes[this.conf.idx.hdr].ondblclick=null;if(this.conf.mode!="c"){this.cell.childNodes[this.conf.idx.hdr].lastChild.ondblclick=null}this._unloadDocking();this.layout=null;c=null});this._hdrInit();this.cell.childNodes[this.conf.idx.hdr].ondblclick=function(){var h=c.layout._getMainInst();h._callMainEvent("onDblClick",[c.conf.name]);h=null};this.attachEvent("_onContentLoaded",function(){var h=this.layout._getMainInst();h._callMainEvent("onContentLoaded",[this.conf.name]);h=null});if(this.conf.mode!="c"){var a=document.createElement("DIV");a.className="dhxlayout_arrow dhxlayout_arrow_"+this.conf.mode+this._idd;this.cell.childNodes[this.conf.idx.hdr].appendChild(a);a.onclick=function(h){if(c.conf.collapsed){c.expand()}else{c.collapse()}};a=null}this.attachEvent("_onBeforeContentAttach",function(h){if(h=="tabbar"||h=="layout"||h=="acc"){this._hideBorders()}if(h=="sidebar"&&this.conf.skin!="dhx_skyblue"){this._hideBorders();this.showHeader()}});this._initDocking();return this};dhtmlXLayoutCell.prototype=new dhtmlXCellObject();dhtmlXLayoutCell.prototype.getId=function(){return this.conf.name};dhtmlXLayoutCell.prototype._initDocking=function(){var a=this;this.dock=function(){var e=this.layout._getMainInst();if(e.dhxWins==null||this.conf.docked){e=null;return}var c=e.dhxWins.window(this.conf.name);c.close();this._attachFromCell(c);this.conf.docked=true;if(!this.conf.dock_collapsed){this.expand()}e._callMainEvent("onDock",[this.conf.name]);e=c=null};this.undock=function(c,n,l,m){var g=this.layout._getMainInst();if(g.dhxWins==null||this.conf.docked==false){g=null;return}this.conf.dock_collapsed=this.conf.collapsed;if(!this.conf.collapsed){this.collapse()}if(g.dhxWins.window(this.conf.name)!=null){var e=g.dhxWins.window(this.conf.name);e.show()}else{if(c==null){c=20}if(n==null){n=20}if(l==null){l=320}if(m==null){m=200}var e=g.dhxWins.createWindow(this.conf.name,c,n,l,m);e.button("close").hide();e.addUserButton("dock",99,"Dock");e.button("dock").show();e.button("dock").attachEvent("onClick",this._doOnDockClick);e.setText(this.getText());e.attachEvent("onClose",this._doOnDockWinClose)}this.conf.docked=false;e._attachFromCell(this);g._callMainEvent("onUnDock",[this.conf.name]);g=e=null};this._doOnDockClick=function(){a.dock()};this._doOnDockWinClose=function(c){c.hide();return false};this._unloadDocking=function(){a=null}};dhtmlXLayoutCell.prototype._hdrInit=function(){var c="";if(window.dhx4.isIE){if(navigator.userAgent.indexOf("MSIE 9.0")!=-1){c=" dhx_cell_hdr_text_ie9"}else{if(window.dhx4.isIE8){c=" dhx_cell_hdr_text_ie8"}else{if(window.dhx4.isIE7){c=" dhx_cell_hdr_text_ie7"}else{if(window.dhx4.isIE6){c=" dhx_cell_hdr_text_ie6"}}}}}else{if(window.dhx4.isChrome||window.dhx4.isKHTML){c=" dhx_cell_hdr_text_chrome"}}var a=document.createElement("DIV");a.className="dhx_cell_hdr";a.innerHTML="<div class='dhx_cell_hdr_text"+c+"'></div>";this.cell.insertBefore(a,this.cell.childNodes[this.conf.idx.cont]);a=null;this.conf.ofs_nodes.t._getHdrHeight="func";this.conf.hdr={visible:true};this.conf.idx_data.hdr="dhx_cell_hdr";this._updateIdx();this.attachEvent("_onSetSize",this._hdrOnSetSize);this.attachEvent("_onBorderChange",this._hdrOnBorderChange);this.attachEvent("_onViewSave",this._hdrOnViewSave);this.attachEvent("_onViewRestore",this._hdrOnViewRestore)};dhtmlXLayoutCell.prototype.showHeader=function(a){if(this.conf.hdr.visible||this.conf.collapsed){return}if(this.conf.hdr.w_saved>this._getAvailWidth()||this.conf.hdr.h_saved>this._getAvailHeight()){return}this.conf.hdr.w_saved=this.conf.hdr.h_saved=null;this.conf.hdr.visible=true;this.cell.childNodes[this.conf.idx.hdr].className="dhx_cell_hdr";if(a!==true){this._adjustCont(this._idd)}};dhtmlXLayoutCell.prototype.hideHeader=function(a){if(!this.conf.hdr.visible||this.conf.collapsed){return}this.conf.hdr.w_saved=this._getMinWidth(this._idd);this.conf.hdr.h_saved=this._getMinHeight(this._idd);this.conf.hdr.visible=false;this.cell.childNodes[this.conf.idx.hdr].className="dhx_cell_hdr dhx_cell_hdr_hidden";this._hdrUpdBorder();this._mtbUpdBorder();if(a!==true){this._adjustCont(this._idd)}};dhtmlXLayoutCell.prototype.isHeaderVisible=function(){return(this.conf.hdr.visible==true)};dhtmlXLayoutCell.prototype.showArrow=function(){this.cell.childNodes[this.conf.idx.hdr].childNodes[1].style.display=""};dhtmlXLayoutCell.prototype.hideArrow=function(){this.cell.childNodes[this.conf.idx.hdr].childNodes[1].style.display="none"};dhtmlXLayoutCell.prototype.isArrowVisible=function(){return(this.cell.childNodes[this.conf.idx.hdr].childNodes[1].style.display=="")};dhtmlXLayoutCell.prototype.setText=function(a){this.conf.hdr.text=a;this._hdrUpdText()};dhtmlXLayoutCell.prototype.getText=function(){return this.conf.hdr.text};dhtmlXLayoutCell.prototype.setCollapsedText=function(a){this.conf.hdr.text_collapsed=a;this._hdrUpdText()};dhtmlXLayoutCell.prototype.getCollapsedText=function(){return(this.conf.hdr.text_collapsed!=null?this.conf.hdr.text_collapsed:this.conf.hdr.text)};dhtmlXLayoutCell.prototype._hdrUpdText=function(){var a=(this.conf.collapsed==true&&this.conf.hdr.text_collapsed!=null?this.conf.hdr.text_collapsed:this.conf.hdr.text);this.cell.childNodes[this.conf.idx.hdr].firstChild.innerHTML="<span>"+a+"</span>"};dhtmlXLayoutCell.prototype._hdrUpdBorder=function(){if(this.conf.borders==true){this.cell.childNodes[this.conf.idx.hdr].className="dhx_cell_hdr"+(this.conf.hdr.visible?"":" dhx_cell_hdr_hidden")}else{if(!this.conf.hdr.visible){this.cell.childNodes[this.conf.idx.hdr].className="dhx_cell_hdr dhx_cell_hdr_hidden_no_borders"}}};dhtmlXLayoutCell.prototype._hdrOnSetSize=function(){if(this.conf.collapsed&&this.conf.mode=="v"){this._fitHdr()}};dhtmlXLayoutCell.prototype._hdrOnBorderChange=function(){this.hideHeader(true);this._hdrUpdBorder()};dhtmlXLayoutCell.prototype._hdrOnViewSave=function(a){this.views[a].hdr_vis=this.conf.hdr.visible};dhtmlXLayoutCell.prototype._hdrOnViewRestore=function(a){if(this.conf.hdr.visible!=this.views[a].hdr_vis){this[this.views[a].hdr_vis?"showHeader":"hideHeader"](true)}this.views[a].hdr_vis=null;delete this.views[a].hdr_vis};dhtmlXLayoutCell.prototype._getHdrHeight=function(a){if(this.conf.collapsed&&this.conf.mode=="v"&&a!==true){return 27}return this.cell.childNodes[this.conf.idx.hdr].offsetHeight};dhtmlXLayoutCell.prototype._fitHdr=function(){if(this.conf.collapsed){if(typeof(dhtmlXLayoutObject.prototype._confGlob.hdrColH)=="undefined"){this.cell.childNodes[this.conf.idx.hdr].style.height=this.cell.offsetHeight+"px";dhtmlXLayoutObject.prototype._confGlob.hdrColH=parseInt(this.cell.childNodes[this.conf.idx.hdr].style.height)-this._getHdrHeight(true)}this.cell.childNodes[this.conf.idx.hdr].style.height=this.cell.offsetHeight+dhtmlXLayoutObject.prototype._confGlob.hdrColH+"px"}else{this.cell.childNodes[this.conf.idx.hdr].style.height=null}};dhtmlXLayoutCell.prototype.expand=function(m){if(!this.conf.collapsed){return true}var e=this.layout;if(this.conf.mode=="v"){var l=(m?e.conf.hh:e.cdata[e.conf.nextCell[this._idd]]._getMinWidth(this._idd));var g=e.cont.offsetWidth-e.conf.sw;if(l+this.conf.size.w_avl>g){e=null;return false}}else{var h=(m?e.conf.hh:e.cdata[e.conf.nextCell[this._idd]]._getMinHeight(this._idd)+e.cdata[e.conf.nextCell[this._idd]]._getHdrHeight());var c=e.cont.offsetHeight-e.conf.sw;if(h+this.conf.size.h_avl>c){e=null;return false}}if(this.conf.docked==false){this.dock();return}this.cell.className=String(this.cell.className).replace(/\s{0,}dhxlayout_collapsed_[hv]/gi,"");this.conf.collapsed=false;if(this.conf.mode=="v"){this.conf.size.w=Math.min(g-l,this.conf.size.w_saved);this.conf.size.w_saved=this.conf.size.w_avl=null}else{this.conf.size.h=Math.min(c-h,this.conf.size.h_saved);this.conf.size.h_saved=this.conf.size.h_avl=null}if(this.conf.mode=="v"){this._fitHdr()}e.setSizes(e.conf.nextCell[this._idd],e.conf.nextCell[this._idd],m==true,"expand");e.sep._blockSep();e=null;this._hdrUpdText();var a=this.layout._getMainInst();a._callMainEvent("onExpand",[this.conf.name]);a=null;return true};dhtmlXLayoutCell.prototype.collapse=function(){if(this.conf.collapsed){return false}var c=this.layout;if(c.cdata[c.conf.nextCell[this._idd]].expand(true)==false){return false}if(this.conf.mode=="v"){this.conf.size.w_saved=this.conf.size.w;this.conf.size.w_avl=this._getMinWidth(this._idd)}else{this.conf.size.h_saved=this.conf.size.h;this.conf.size.h_avl=this._getMinHeight(this._idd)+this._getHdrHeight()}this.cell.className+=" dhxlayout_collapsed_"+this.conf.mode;this.conf.collapsed=true;if(this.conf.mode=="v"){this.conf.size.w=c.conf.hh}else{this.conf.size.h=this._getHdrHeight()}c.setSizes(c.conf.nextCell[this._idd],c.conf.nextCell[this._idd],false,"collapse");c.sep._blockSep();c=null;this._hdrUpdText();var a=this.layout._getMainInst();a._callMainEvent("onCollapse",[this.conf.name]);a=null;return true};dhtmlXLayoutCell.prototype.isCollapsed=function(){return(this.conf.collapsed==true)};dhtmlXLayoutCell.prototype.setMinWidth=function(a){this.conf.min_width=parseInt(a)||0};dhtmlXLayoutCell.prototype.setMinHeight=function(a){this.conf.min_height=parseInt(a)||0};dhtmlXLayoutCell.prototype._getMinWidth=function(c){if(this.dataType=="layout"&&this.dataObj!=null){if(this.dataObj.conf.pattern=="1C"){return Math.max(this.conf.min_width,this.dataObj.cdata.a._getMinWidth(c))}else{if(this.dataObj.conf.mode=="v"){var a=c||this._idd;if(this.dataObj.cdata[a].conf.collapsed){a=this.dataObj.conf.nextCell[a]}return Math.max(this.conf.min_width,this.dataObj.cdata[a]._getMinWidth(c)+this.dataObj.cdata[this.dataObj.conf.nextCell[a]]._getWidth()+this.dataObj.conf.sw)}else{return Math.max(this.conf.min_width,this.dataObj.cdata.a._getMinWidth(c),this.dataObj.cdata.b._getMinWidth(c))}}}return Math.max(this.conf.min_width,1)};dhtmlXLayoutCell.prototype._getMinHeight=function(e){var c=0;if(this.conf.idx.menu!=null){c+=this.cell.childNodes[this.conf.idx.menu].offsetHeight}if(this.dataType=="layout"&&this.dataObj!=null){if(this.dataObj.conf.pattern=="1C"){return Math.max(this.conf.min_height,this.dataObj.cdata.a._getMinHeight(e))}else{if(this.dataObj.conf.mode=="h"){var a=e;if(this.dataObj.cdata[a].conf.collapsed){a=this.dataObj.conf.nextCell[a]}return Math.max(this.conf.min_height,this.dataObj.cdata[a]._getMinHeight(e)+this.dataObj.cdata[a]._getHdrHeight()+this.dataObj.cdata[this.dataObj.conf.nextCell[a]]._getHeight()+this.dataObj.conf.sw)}else{return Math.max(this.conf.min_height,this.dataObj.cdata.a._getMinHeight(e)+this.dataObj.cdata.a._getHdrHeight(),this.dataObj.cdata.b._getMinHeight(e)+this.dataObj.cdata.b._getHdrHeight())}}}return Math.max(this.conf.min_height,c)};dhtmlXLayoutCell.prototype._getAvailWidth=function(e){if(this.dataType=="layout"&&this.dataObj!=null){if(this.dataObj.conf.pattern=="1C"){return this.dataObj.cdata.a._getAvailWidth(e)}else{if(this.dataObj.conf.mode=="v"){var a=(this.dataObj.cdata.a.conf.collapsed==true);var c=(this.dataObj.cdata.b.conf.collapsed==true);if(e=="a"){return this.dataObj.cdata[c?"a":"b"]._getAvailWidth(e)}else{return this.dataObj.cdata[a?"b":"a"]._getAvailWidth(e)}}else{return Math.min(this.dataObj.cdata.a._getAvailWidth(e),this.dataObj.cdata.b._getAvailWidth(e))}}}return this.cell.offsetWidth-this._getMinWidth()};dhtmlXLayoutCell.prototype._getAvailHeight=function(g){if(this.dataType=="layout"&&this.dataObj!=null){if(this.dataObj.conf.pattern=="1C"){return this.dataObj.cdata.a._getAvailHeight(g)}else{if(this.dataObj.conf.mode=="h"){var c=(this.dataObj.cdata.a.conf.collapsed==true);var e=(this.dataObj.cdata.b.conf.collapsed==true);if(g=="a"){return this.dataObj.cdata[e?"a":"b"]._getAvailHeight(g)}else{return this.dataObj.cdata[c?"b":"a"]._getAvailHeight(g)}}else{return Math.min(this.dataObj.cdata.a._getAvailHeight(g),this.dataObj.cdata.b._getAvailHeight(g))}}}var a=this._getHdrHeight();if(this.conf.mode=="v"&&this.conf.collapsed){a=this.conf.hh}return this.cell.offsetHeight-a-this._getMinHeight()};dhtmlXLayoutCell.prototype.setWidth=function(g){if(this.conf.mode=="v"){if(this.conf.collapsed){return}var h=this.layout;var l=h.cdata[h.conf.nextCell[this._idd]];if(l.conf.collapsed){g=g+h.conf.sw+l._getWidth();m=h=l=null;return}var e=this._getMinWidth(this._idd);var n=h.cont.offsetWidth-l._getMinWidth(this._idd)-h.conf.sw;g=Math.max(e,Math.min(g,n));this.conf.size.w=g;h.setSizes(l._idd,l._idd);h=l=null}else{if(this.layout==null||this.layout.parentLayout==null){return}var m=this.layout.parentLayout;var h=this.layout;var l=h.cdata[h.conf.nextCell[this._idd]];for(var c in m.cdata){if(m.cdata[c].dataObj==h){m.cdata[c].setWidth(g)}}m=h=null}};dhtmlXLayoutCell.prototype.setHeight=function(n){if(this.conf.mode=="h"){if(this.conf.collapsed){return}var g=this.layout;var m=g.cdata[g.conf.nextCell[this._idd]];if(m.conf.collapsed){n=n+g.conf.sw+m._getHeight();var o=(this.layout!=null&&this.layout.parentLayout!=null?this.layout.parentLayout:null);if(o!=null){for(var c in o.cdata){if(o.cdata[c].dataObj==g){o.cdata[c].setHeight(n)}}}o=g=m=null;return}var l=this._getMinHeight(this._idd)+this._getHdrHeight();var e=g.cont.offsetHeight-m._getMinHeight(this._idd)-m._getHdrHeight()-g.conf.sw;n=Math.max(l,Math.min(n,e));this.conf.size.h=n;g.setSizes(m._idd,m._idd);g=m=null}else{if(this.layout==null||this.layout.parentLayout==null){return}var o=this.layout.parentLayout;var g=this.layout;var m=g.cdata[g.conf.nextCell[this._idd]];for(var c in o.cdata){if(o.cdata[c].dataObj==g){o.cdata[c].setHeight(n)}}o=g=null}};dhtmlXLayoutCell.prototype.getWidth=function(){return this.conf.size.w};dhtmlXLayoutCell.prototype.getHeight=function(){return this.conf.size.h};dhtmlXLayoutCell.prototype.fixSize=function(c,g){this.conf.fixed.w=window.dhx4.s2b(c);this.conf.fixed.h=window.dhx4.s2b(g);var a=this.layout._getMainInst();var e={};a.forEachItem(function(h){if(h.conf.fsize!=null){var o=h.getId();var n={h:(h.conf.fixed.w==true),v:(h.conf.fixed.h==true)};for(var l in n){if(n[l]==true&&h.conf.fsize[l]!=null){if(!(h.conf.fsize[l] instanceof Array)){h.conf.fsize[l]=[h.conf.fsize[l]]}for(var m=0;m<h.conf.fsize[l].length;m++){e[h.conf.fsize[l][m]]=true}}}}h=null});a._forEachSep(function(h){h._lockSep(e[h.conf.idx]==true);h=null});a=null};dhtmlXCellObject.prototype.attachLayout=function(a){this.callEvent("_onBeforeContentAttach",["layout"]);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(typeof(window.dhtmlXLayoutCell)!="undefined"&&this instanceof dhtmlXLayoutCell){c._isParentCell=true}if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={t:-1,r:-1,l:-1,b:-1}}if(typeof(window.dhtmlXTabBarCell)!="undefined"&&(this instanceof window.dhtmlXTabBarCell)){if(this.conf.skin=="dhx_skyblue"){c._ofs={t:-1,r:-1,b:-1,l:-1}}}if(typeof(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){if(this.conf.skin=="dhx_web"){c._ofs={l:8}}if(this.conf.skin=="dhx_terrace"){c._ofs={l:11}}else{c._ofs={l:-1}}}if(typeof(window.dhtmlXCarouselCell)!="undefined"&&(this instanceof window.dhtmlXCarouselCell)){this._hideBorders()}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};function dhtmlXTabBar(g,m){var h=this;this.conf={skin:(window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxtabbar")||"dhx_skyblue"),css:"dhxtabbar",lastActive:null,closeButton:false,align:"left",tabsMode:(m=="bottom"?"bottom":"top"),tabsContCss:"",contZone:true,transSpeed:"0.15s",arwMode:"always",tabsOfs:1,tabsTop:0,url_demand:false,urls:{},autoload:{},tabsWidth:{dhx_terrace:[44,14],dhx_web:[35,9],dhx_skyblue:[35,9]}};var c=navigator.userAgent;if(c.indexOf("Safari")>=0&&(c.indexOf("5.1.7")>=0||(c.match(/7[\.\d]* mobile/gi)!=null&&c.match(/AppleWebKit/gi)!=null))){this.conf.tabsContCss=" safari_517_fix"}var l;if(g!=null&&typeof(g)=="object"&&typeof(g.tagName)=="undefined"){l=g.parent;if(typeof(g.skin)!="undefined"){this.conf.skin=g.skin}if(typeof(g.mode)!="undefined"){this.conf.tabsMode=(g.mode=="bottom"?"bottom":"top")}if(typeof(g.align)!="undefined"){this.conf.align=(g.align=="right"?"right":"left")}if(typeof(g.close_button)!="undefined"){this.conf.closeButton=window.dhx4.s2b(g.close_button)}if(typeof(g.content_zone)!="undefined"){this.conf.contZone=window.dhx4.s2b(g.content_zone)}if(typeof(g.xml)!="undefined"){this.conf.autoload.xml=g.xml}if(typeof(g.json)!="undefined"){this.conf.autoload.xml=g.json}if(typeof(g.tabs)!="undefined"){this.conf.autoload.tabs=g.tabs}if(typeof(g.onload)!="undefined"){this.conf.autoload.tabs=g.tabs}if(typeof(g.arrows_mode)!="undefined"){this.conf.autoload.arrows_mode=g.arrows_mode}}else{l=g}window.dhtmlXCellTop.apply(this,[l,g.offsets]);if(this.base._ofs!=null&&this.base._ofs.t!=null){this.conf.tabsTop=this.base._ofs.t}this.tabsMode=document.createElement("DIV");this.tabsMode.className="dhxtabbar_tabs_"+this.conf.tabsMode;this.cont.appendChild(this.tabsMode);this.tabsArea=document.createElement("DIV");this.tabsArea.className="dhxtabbar_tabs dhxtabbar_tabs_"+this.conf.tabsMode;this.tabsArea.innerHTML="<div class='dhxtabbar_tabs_ar_left'><div class='dhxtabbar_arrow_img'></div></div><div class='dhxtabbar_tabs_base'><div class='dhxtabbar_tabs_cont_"+this.conf.align+this.conf.tabsContCss+"'><div class='dhxtabbar_tabs_line'></div></div></div><div class='dhxtabbar_tabs_ar_right'><div class='dhxtabbar_arrow_img'></div></div>";this.tabsArea.style.top=(this.conf.tabsMode=="top"?this.conf.tabsTop+"px":"auto");this.tabsMode.appendChild(this.tabsArea);this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]="0px";this.tabsArea.childNodes[0].onclick=function(){if(h.conf.align=="left"){h._moveTabs(1)}else{h._moveTabs(-1)}};this.tabsArea.childNodes[2].onclick=function(){if(h.conf.align=="left"){h._moveTabs(-1)}else{h._moveTabs(1)}};this._onTabsAreaClick=function(a){return this._callMainEvent("onTabClose",[a])};this.tabsArea.onclick=function(n){n=n||event;var a=(n.target||n.srcElement);while(a!=null){if(typeof(a._tabCloseId)!="undefined"){if(h._onTabsAreaClick(a._tabCloseId)!==true){return}h.t[a._tabCloseId].conf.remove=true;h._hideTab(a._tabCloseId);a=null}else{if(typeof(a._tabId)!="undefined"){h._doOnClick(a._tabId);a=null}}if(a!=null){a=a.parentNode;if(a==this){a=null}}}};this.tabsArea.onselectstart=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}};this._doOnClick=function(a){this.callEvent("onTabClick",[a,this.conf.lastActive]);if(this.t[a].conf.enabled){this._setTabActive(a)}};this.t={};this.addTab=function(a,v,o,s,r,w){if(typeof(w)!="boolean"){w=(this.conf.closeButton==true)}r=window.dhx4.s2b(r);var q=document.createElement("DIV");q.className="dhxtabbar_tab";q.innerHTML="<div class='dhxtabbar_tab_text"+(w?" dhxtabbar_tab_text_close":"")+"'>"+v+"</div>"+(w?"<div class='dhxtabbar_tab_close'></div>":"");q._tabId=a;if(w){q.childNodes[1]._tabCloseId=a}var n=this.tabsArea.childNodes[1].firstChild;if(s!=null&&s+1>0&&s+1<n.childNodes.length){n.insertBefore(q,n.childNodes[s+1])}else{n.appendChild(q)}var x=false;if(typeof(o)=="undefined"||o==null||o=="*"){o=this._getLabelWidth(v,w);x=true}else{o=parseInt(o)}q.style.width=o+"px";var u=new dhtmlXTabBarCell(a,this);this.tabsMode.appendChild(u.cell);this.t[a]={tab:q,cell:u,conf:{text:v,visible:true,active:false,enabled:true,close:w,width:o,autowidth:x}};n=u=null;if(r){this._setTabActive(a)}else{this._adjustCell(a)}if(this.conf.initSeq!=true&&this.conf.arwMode=="auto"){this.setSizes()}};this.setSizes=function(){this._adjustCont();if(this.conf.tabsAreaOfs==null){this.tabsArea.style.width=this.cont.offsetWidth+"px";this.conf.tabsAreaOfs=parseInt(this.tabsArea.style.width)-this.tabsArea.offsetWidth}this.tabsArea.style.width=this.cont.offsetWidth+this.conf.tabsAreaOfs+"px";this._adjustCell(this.conf.lastActive);this._adjustTabs(true);this.callEvent("_onSetSizes",[])};this._adjustCell=function(q){if(!this.conf.contZone||q==null){return}var o=(this.conf.tabsMode=="top"?this.tabsArea.offsetHeight:0)+this.conf.tabsTop;var n=this.cont.offsetHeight-this.tabsArea.offsetHeight-this.conf.tabsTop;var a=this.t[q].cell.dataType;if(this.conf.skin=="dhx_skyblue"&&(a=="layout"||a=="tabbar"||a=="acc")){if(this.conf.tabsMode=="top"){o=o-1}n=n+1}if(q!=this.conf.lastActive){o=-5000;this.t[q].cell.cell.style.visibility="hidden";this.t[q].cell.cell.style.zIndex=0}this.t[q].cell._setSize(0,o,this.cont.offsetWidth,n)};this.setTabsMode=function(a){this.conf.tabsMode=(a=="bottom"?"bottom":"top");this.tabsMode.className="dhxtabbar_tabs_"+this.conf.tabsMode;this.tabsArea.className="dhxtabbar_tabs dhxtabbar_tabs_"+this.conf.tabsMode;this.tabsArea.style.top=(this.conf.tabsMode=="top"?this.conf.tabsTop+"px":"auto");this.setSizes()};this._tabCss=function(s,q){var n=this.t[s].conf.active;var r=!this.t[s].conf.enabled;var o=!this.t[s].conf.visible;return"dhxtabbar_tab"+(o?" dhxtabbar_tab_hidden":(n||r?" dhxtabbar_tab"+(n?"_actv":"")+(r?"_dis":""):""))};this._getLabelWidth=function(o,n){if(this.tabsTextTest==null){this.tabsTextTest=document.createElement("SPAN");this.tabsTextTest.className="dhxtabbar_tabs_text_test_"+this.conf.skin}document.body.appendChild(this.tabsTextTest);this.tabsTextTest.innerHTML=o;var a=this.tabsTextTest.offsetWidth;if(window.dhx4.isIE&&a==0){a=this.tabsTextTest.offsetWidth}a+=this.conf.tabsWidth[this.conf.skin][0];if(n==true){a+=this.conf.tabsWidth[this.conf.skin][1]}document.body.removeChild(this.tabsTextTest);return a};this._adjustTabs=function(r){if(this._checkArrows()==true||r==true){this.tabsArea.childNodes[1].style.left=this.tabsArea.childNodes[0].offsetWidth-1+"px";this.tabsArea.childNodes[1].style.width=Math.max(0,this.tabsArea.offsetWidth-this.tabsArea.childNodes[0].offsetWidth-this.tabsArea.childNodes[2].offsetWidth)+1+"px"}var u=this.tabsArea.childNodes[1];if(u.offsetWidth<5){u=null;return}var a=parseInt(u.childNodes[0].style[this.conf.align]);var o=null;for(var s=0;s<u.childNodes[0].childNodes.length;s++){var v=u.childNodes[0].childNodes[s]._tabId;if(v!=null&&this.t[v].conf.visible){var n=this.t[v].tab.offsetWidth-this.conf.tabsOfs;if(this.t[v].conf.active){if(a<0||u.offsetWidth<n){o={d:1,id:v}}else{if(a+n>u.offsetWidth){o={d:-1,id:v}}}}a+=n}}if(o!=null){this._moveTabs(o.d,o.id)}else{if(u.offsetWidth>a+1){u.childNodes[0].style[this.conf.align]=Math.min(0,parseInt(u.childNodes[0].style[this.conf.align])+(u.offsetWidth-a))+"px"}}u=o=null};this._moveTabs=function(y,r){var o=this.tabsArea.childNodes[1].childNodes[0];var v=0;var A=[];var D=null;for(var a=0;a<o.childNodes.length;a++){var n=o.childNodes[a]._tabId;if(n!=null&&this.t[n].conf.visible){A.push({id:n,w:this.t[n].tab.offsetWidth-this.conf.tabsOfs,ind:v});if(n==r){D=v}v++}}var C=parseInt(this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]);var u=this.tabsArea.offsetWidth-this.tabsArea.childNodes[0].offsetWidth-this.tabsArea.childNodes[2].offsetWidth;var w=null;var s=null;for(var a=0;a<A.length;a++){A[a].x=C;if(w==null&&C>=0&&C+A[a].w>0){w=A[a]}if(C<u&&C+A[a].w<=u){s=A[a]}C+=A[a].w}if(D!=null){var E=A[D]}else{var E=null;if(y>0){if(w==null){if(A.length>0){E=A[A.length-1]}}else{if(w.ind>0&&A.length>=w.ind){E=A[w.ind-1]}}}else{if(s==null){if(A.length>0){E=A[0]}}else{if(A.length>s.ind){E=A[s.ind+1]}}}}if(E!=null){if(y>0){if(C<u){o.style[this.conf.align]=Math.min(0,parseInt(o.style[this.conf.align])+(u-C))+"px"}else{o.style[this.conf.align]=parseInt(o.style[this.conf.align])-E.x+"px"}}else{o.style[this.conf.align]=parseInt(o.style[this.conf.align])-E.x+u-E.w+"px"}}o=E=A=null};this._getNextVisible=function(n,a){return this._getNearVisible(n,a,"next")};this._getPrevVisible=function(n,a){return this._getNearVisible(n,a,"previous")};this._getFirstVisible=function(){return this._getNearVisible(null,false,"first")};this._getNearVisible=function(s,o,r){if(r=="first"){var q=this.tabsArea.childNodes[1].childNodes[0].childNodes[1];r="next"}else{if(s==null||this.t[s]==null){return(o?this._getFirstVisible():null)}var q=this.t[s].tab[r+"Sibling"]}var n=null;while(q!=null&&n==null){var a=q._tabId;if(a!=null&&n==null&&this.t[a].conf.visible){n=a}else{q=q[r+"Sibling"]}}q=null;return n};this._showTab=function(n,a){if(this.t[n]==null){return}if(this.t[n].conf.transActv==true){if(this.t[n].conf.transMode=="show"){return}}else{if(this.t[n].conf.visible==true){return}}if(this.conf.transProp!==false){this.t[n].conf.transActv=true;this.t[n].conf.transMode="show";this.t[n].conf.transProp=this.conf.transProp;this.t[n].conf.transActvId=(a?n:null);if(!this.t[n].conf.transEv){this.t[n].tab.addEventListener(this.conf.transEv,this._doOnTrEnd,false);this.t[n].conf.transEv=true}this.t[n].conf.visible=true;this.t[n].tab.className=this._tabCss(n);this.t[n].tab.style[this.conf.transProp]=this.conf.transValueWidth;this.t[n].tab.style.width=this.t[n].conf.width+"px";if(this.t[n].tab.clientWidth>=this.t[n].conf.width){this.t[n].tab.style.visibility="visible"}}else{this.t[n].conf.visible=true;this.t[n].tab.style.display="";if(a||this.t[n].conf.active){this.t[n].conf.active=false;this._setTabActive(n)}else{this._adjustTabs()}}};this._hideTab=function(s,a){if(this.t[s]==null){return}if(this.t[s].conf.transActv==true){if(this.t[s].conf.transMode=="hide"){return}}else{if(this.t[s].conf.visible!=true){return}}var n=false;if(this.conf.lastActive==s){this.conf.lastActive=null;this.t[s].conf.active=false;this.t[s].tab.className=this._tabCss(s);n=true}var q=this._getPrevVisible(s);var o=this._getNextVisible(s);var r=(n&&a!==false?(a==true?null:a)||o||q:null);if(this.conf.transProp!==false){this.t[s].conf.transActv=true;this.t[s].conf.transMode="hide";this.t[s].conf.transProp=this.conf.transProp;this.t[s].conf.transActvId=r;this.t[s].conf.visible=false;if(!this.t[s].conf.transEv){this.t[s].tab.addEventListener(this.conf.transEv,this._doOnTrEnd,false);this.t[s].conf.transEv=true}this.t[s].tab.style.visibility="hidden";this.t[s].tab.className=h._tabCss(s);this.t[s].tab.style[this.conf.transProp]=this.conf.transValueWidth;this.t[s].tab.style.width="0px"}else{this.t[s].tab.style.display="none";this.t[s].conf.visible=false;if(this.conf.contZone){this.t[s].cell.cell.style.visibility="hidden";this.t[s].cell.cell.style.top="-5000px"}if(r!=null){this._setTabActive(r)}this._adjustTabs();if(this.t[s].conf.remove){this._removeTab(s)}}};this._isTabVisible=function(a){return(this.t[a].conf.visible==true)};this._doOnTrEnd=function(){var o=this._tabId;if(h.t[o]==null){return}var a=h.t[o];var n=a.conf.transActvId;if(a.conf.transMode=="hide"){if(a.conf.remove){h._removeTab(o)}else{a.tab.style[a.conf.transProp]="";if(h.conf.contZone){a.cell.cell.style.visibility="hidden";a.cell.cell.style.top="-5000px"}a.conf.transActv=false}}else{if(a.conf.transMode=="show"){a.tab.style[a.conf.transProp]="";a.tab.style.visibility="visible";a.conf.transMode=null;a.conf.transActv=false}}if(n!=null){h._setTabActive(n)}else{h._adjustTabs()}a=null};this.enableTabCloseButton=function(a){this.conf.closeButton=window.dhx4.s2b(a)};this.unload=function(){this.conf.unloading=true;this.clearAll();this.t=null;if(this.tabsTextTest!=null){if(this.tabsTextTest.parentNode){this.tabsTextTest.parentNode.removeChild(this.tabsTextTest)}this.tabsTextTest=null}window.dhx4._enableDataLoading(this,null,null,null,"clear");this.tabsArea.childNodes[0].onclick=null;this.tabsArea.childNodes[2].onclick=null;this.tabsArea.onclick=null;this.tabsArea.onselectstart=null;this.tabsArea.parentNode.removeChild(this.tabsArea);this.tabsArea=null;this.tabsMode.parentNode.removeChild(this.tabsMode);this.tabsMode=null;this._unloadTop();window.dhx4._eventable(this,"clear");for(var n in this){this[n]=null}h=null};this.enableContentZone=function(a){this.conf.contZone=(a==true)};this.setSkin=function(o){this._setBaseSkin(o);this.conf.skin=o;if(this.tabsTextTest!=null){this.tabsTextTest.className="dhxtabbar_tabs_text_test_"+this.conf.skin}for(var n in this.t){this.t[n].cell._resetSizeState();if(this.t[n].conf.autowidth==true){this.t[n].conf.width=this._getLabelWidth(this.t[n].conf.text,this.t[n].conf.close);if(this.t[n].conf.visible){this.t[n].tab.style.width=this.t[n].conf.width+"px"}}}this.conf.tabsAreaOfs=null;this._fixTabsOfs();this.setSizes()};this.setAlign=function(a){a=(a=="left"?"left":"right");if(a==this.conf.align){this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]="0px";return}if(this.conf.transProp!==false){this.tabsArea.childNodes[1].childNodes[0].style[this.conf.transProp]=""}this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]="";this.conf.align=a;this.tabsArea.childNodes[1].childNodes[0].className="dhxtabbar_tabs_cont_"+this.conf.align+this.conf.tabsContCss;this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]="0px";if(this.conf.transProp!==false){this.conf.transValuePos=this.conf.align+" "+this.conf.transSpeed;this.tabsArea.childNodes[1].childNodes[0].style[this.conf.transProp]=this.conf.transValuePos}};this._initObj=function(r){this.conf.initSeq=true;this.clearAll();var a=false;if(r.settings!=null){if(r.settings.skin!=null){this.setSkin(r.settings.skin)}if(r.settings.closeButton!=null){this.enableTabCloseButton(window.dhx4.s2b(r.settings.closeButton))}if(r.settings.align!=null){this.setAlign(r.settings.align)}if(r.settings.hrefmode=="ajax"){a=true}if(r.settings.hrefmode=="ajax-html"){a=true;this.conf.url_demand=true}}if(r.tabs!=null){for(var o=0;o<r.tabs.length;o++){var n=r.tabs[o];if(typeof(n.id)=="undefined"){n.id=window.dhx4.newId()}if(!isNaN(parseInt(n.width))){n.width=parseInt(n.width)}else{n.width=null}this.addTab(n.id,n.text||n.label||"",n.width,n.index,window.dhx4.s2b(n.selected)||window.dhx4.s2b(n.active),n.close);if(n.content!=null){this.cells(n.id).attachHTMLString(n.content)}else{if(n.href!=null){if(this.conf.url_demand==true){this.conf.urls[n.id]={href:n.href,ajax:a}}else{this.cells(n.id).attachURL(n.href,a)}}}if(typeof(n.enabled)!="undefined"&&window.dhx4.s2b(n.enabled)==false){this.tabs(n.id).disable()}else{if(typeof(n.disabled)!="undefined"&&window.dhx4.s2b(n.disabled)==true){this.tabs(n.id).disable()}}}}this.conf.initSeq=false;if(this.conf.arwMode=="auto"){this.setSizes()}if(this.conf.url_demand==true){this._loadURLOnDemand(this.conf.lastActive)}};this._xmlToObj=function(v){var u={settings:{},tabs:[]};var n=v.getElementsByTagName("tabbar")[0];if(n!=null){for(var x in {skin:1,align:1,closeButton:1,hrefmode:1}){if(n.getAttribute(x)!=null){u.settings[x]=n.getAttribute(x)}}var A=n.getElementsByTagName("tab");for(var o=0;o<A.length;o++){var s={text:(A[o].firstChild.nodeValue||"")};for(var x in {id:1,width:1,close:1,selected:1,active:1,enabled:1,disabled:1,href:1}){if(A[o].getAttribute(x)!=null){s[x]=A[o].getAttribute(x)}}var C=A[o].getElementsByTagName("content")[0];if(C!=null){s.content="";for(var y=0;y<C.childNodes.length;y++){s.content+=(C.childNodes[y].nodeValue||"")}}u.tabs.push(s)}}return u};dhx4._enableDataLoading(this,"_initObj","_xmlToObj","tabbar",{struct:true});var e=window.dhx4.transDetect();this.conf.transProp=e.transProp;this.conf.transEv=e.transEv;this.conf.transValueWidth="width "+this.conf.transSpeed;e=null;if(this.conf.transProp!==false){this.conf.transValuePos=this.conf.align+" "+this.conf.transSpeed;this.tabsArea.childNodes[1].childNodes[0].style[this.conf.transProp]=this.conf.transValuePos}this._callMainEvent=function(n,a){return this.callEvent(n,a)};window.dhx4._eventable(this);if(this.conf.autoload.json!=null){this.loadStruct(this.conf.autoload.json,this.conf.autoload.onload)}else{if(this.conf.autoload.xml!=null){this.loadStruct(this.conf.autoload.xml,this.conf.autoload.onload)}else{if(this.conf.autoload.tabs!=null){this.loadStruct({tabs:this.conf.autoload.tabs})}}}if(this.conf.autoload.arrows_mode!=null){this.setArrowsMode(this.conf.autoload.arrows_mode)}this._fixTabsOfs();this.setSizes();return this}dhtmlXTabBar.prototype=new dhtmlXCellTop();dhtmlXTabBar.prototype._fixTabsOfs=function(){this.conf.tabsOfs=(this.conf.skin=="dhx_web"?0:1)};dhtmlXTabBar.prototype.cells=dhtmlXTabBar.prototype.tabs=function(a){if(this.t[a]){return this.t[a].cell}return null};dhtmlXTabBar.prototype.getAllTabs=function(){var e=[];for(var c in this.t){e.push(c)}return e};dhtmlXTabBar.prototype._setTabActive=function(c,a){if(!this.t[c]||this.t[c].conf.active){return}if(typeof(a)=="undefined"){a=true}if(a==true&&this.callEvent("onSelect",[c,this.conf.lastActive])!==true){return}this.setTabInActive();this.t[c].conf.active=true;if(this.conf.contZone){this.t[c].cell.cell.style.visibility="visible";this.t[c].cell.cell.style.top="0px";this.t[c].cell.cell.style.zIndex=1}this.t[c].tab.className=this._tabCss(c);this.conf.lastActive=c;this.setSizes();if(this.conf.url_demand==true){this._loadURLOnDemand(c)}};dhtmlXTabBar.prototype.setTabInActive=function(){if(this.conf.lastActive&&this.t[this.conf.lastActive]){this.t[this.conf.lastActive].conf.active=false;if(this.conf.contZone){this.t[this.conf.lastActive].cell.cell.style.visibility="hidden";this.t[this.conf.lastActive].cell.cell.style.top="-5000px";this.t[this.conf.lastActive].cell.cell.style.zIndex=0}this.t[this.conf.lastActive].tab.className=this._tabCss(this.conf.lastActive);this.conf.lastActive=null}};dhtmlXTabBar.prototype._isTabActive=function(a){return(a==this.conf.lastActive&&this.conf.lastActive!=null)};dhtmlXTabBar.prototype.getActiveTab=function(){return this.conf.lastActive};dhtmlXTabBar.prototype.goToNextTab=function(){var a=this._getNextVisible(this.conf.lastActive,true);if(a!=null){this._setTabActive(a)}};dhtmlXTabBar.prototype.goToPrevTab=function(){var a=this._getPrevVisible(this.conf.lastActive,true);if(a!=null){this._setTabActive(a)}};dhtmlXTabBar.prototype._enableTab=function(c,a){if(!this.t[c]||this.t[c].conf.enabled){return}this.t[c].conf.enabled=true;this.t[c].tab.className=this._tabCss(c);if(a==true){this._setTabActive(c)}};dhtmlXTabBar.prototype._disableTab=function(c,a){if(!this.t[c]||!this.t[c].conf.enabled){return}this.t[c].conf.enabled=false;this.t[c].tab.className=this._tabCss(c);if(a!==false&&this.conf.lastActive==c){if(a==true){a=this._getNextVisible(c)||this._getPrevVisible(c)}this._setTabActive(a)}};dhtmlXTabBar.prototype._isTabEnabled=function(a){return(this.t[a]!=null&&this.t[a].conf.enabled==true)};dhtmlXTabBar.prototype._setTabText=function(g,e,c){if(!this.t[g]){return}var a=false;if(typeof(c)=="undefined"||c==null){c=this._getLabelWidth(e,this.t[g].conf.close);a=true}this.t[g].tab.style.width=c+"px";this.t[g].tab.childNodes[0].innerHTML=e;this.t[g].conf.text=e;this.t[g].conf.width=c;this.t[g].conf.autowidth=a};dhtmlXTabBar.prototype._getTabText=function(a){if(!this.t[a]){return null}return this.t[a].conf.text};dhtmlXTabBar.prototype._removeTab=function(n,e,l){if(!this.t[n]){return}if(l!=true&&this.t[n].conf.remove!=true){this.t[n].conf.remove=true;this._hideTab(n,e);return}if(typeof(e)=="undefined"){e=true}var g=this._getNextVisible(n);var h=this._getPrevVisible(n);if(this.t[n].conf.transEv==true){this.t[n].tab.removeEventListener(this.conf.transEv,this._doOnTrEnd,false);this.t[n].conf.transEv=false}for(var c in this.t[n].conf){this.t[n].conf[c]=null}this.t[n].conf=null;delete this.t[n].conf;this.t[n].cell._unload();this.t[n].cell=null;this.t[n].tab.parentNode.removeChild(this.t[n].tab);this.t[n].tab=null;this.t[n]=null;delete this.t[n];if(this.conf.lastActive==n&&e!=false){this.conf.lastActive=null;var m=(e==true?(g||h||this._getFirstVisible()):e);if(m!=null){this._setTabActive(m)}}else{if(l!=true){this._adjustTabs()}}};dhtmlXTabBar.prototype.clearAll=function(){for(var c in this.t){this._removeTab(c,false,true)}this.tabsArea.childNodes[1].childNodes[0].style[this.conf.align]="0px"};dhtmlXTabBar.prototype.moveTab=function(e,a){if(!this.t[e]||a<0){return}a+=1;var c=this.tabsArea.childNodes[1].firstChild;if(c.childNodes[a]!=this.t[e].tab){c.removeChild(this.t[e].tab);if(a>=c.childNodes.length){c.appendChild(this.t[e].tab)}else{c.insertBefore(this.t[e].tab,c.childNodes[a])}}c=null};dhtmlXTabBar.prototype._getIndex=function(g){var a=-1;var e=this.tabsArea.childNodes[1].firstChild;for(var c=1;c<e.childNodes.length;c++){if(e.childNodes[c]._tabId==g){a=c-1}}e=null;return a};dhtmlXTabBar.prototype.getNumberOfTabs=function(g){var e=0;for(var c in this.t){e+=(g!=true?1:(this.t[c].conf.visible==true?1:0))}return e};dhtmlXTabBar.prototype.forEachCell=dhtmlXTabBar.prototype.forEachTab=function(e){for(var c in this.t){e.apply(window,[this.t[c].cell])}};dhtmlXTabBar.prototype.enableAutoReSize=function(){this._initFSResize()};dhtmlXTabBar.prototype.setArrowsMode=function(a){a={auto:"auto",always:"always"}[String(a)];if(a==null||a==this.conf.mode){return}this.conf.arwMode=a;if(a=="always"){this.tabsArea.childNodes[0].className="dhxtabbar_tabs_ar_left";this.tabsArea.childNodes[2].className="dhxtabbar_tabs_ar_right"}this.setSizes()};dhtmlXTabBar.prototype._checkArrows=function(){var h=false;if(this.conf.arwMode=="auto"){var g=0;for(var e in this.t){g+=this.t[e].tab.offsetWidth}var c=this.tabsArea.childNodes[0];var l=this.tabsArea.childNodes[2];if(g>this.cont.offsetWidth){if(c.className.search(/dhxtabbar_tabs_ar_hidden/)>=0){c.className=c.className.replace(/\s{0,}dhxtabbar_tabs_ar_hidden/,"");l.className=l.className.replace(/\s{0,}dhxtabbar_tabs_ar_hidden/,"");h=true}}else{if(c.className.search(/dhxtabbar_tabs_ar_hidden/)<1){c.className+=" dhxtabbar_tabs_ar_hidden";l.className+=" dhxtabbar_tabs_ar_hidden";h=true}}c=l=null}return h};dhtmlXTabBar.prototype._loadURLOnDemand=function(a){if(a!=null&&this.conf.urls[a]!=null){this.cells(a).attachURL(this.conf.urls[a].href,this.conf.urls[a].ajax);this.conf.urls[a]=null}};window.dhtmlXTabBarCell=function(g,e){dhtmlXCellObject.apply(this,[g,"_tabbar"]);this.tabbar=e;this.conf.skin=this.tabbar.conf.skin;this.conf.tabbar_funcs={show:"_showTab",hide:"_hideTab",isVisible:"_isTabVisible",enable:"_enableTab",disable:"_disableTab",isEnabled:"_isTabEnabled",getIndex:"_getIndex",getText:"_getTabText",setText:"_setTabText",setActive:"_setTabActive",isActive:"_isTabActive",close:"_removeTab"};this._tabbarCall=function(a){return function(){var h=[this._idd];for(var l=0;l<arguments.length;l++){h.push(arguments[l])}return this.tabbar[a].apply(this.tabbar,h)}};for(var c in this.conf.tabbar_funcs){if(typeof(this[c])!="function"){this[c]=this._tabbarCall(this.conf.tabbar_funcs[c])}}this.attachEvent("_onCellUnload",function(){this.tabbar=null;for(var h in this.conf.tabbar_funcs){this[h]=null;this.conf.tabbar_funcs[h]=null}this.conf.tabbar_funcs=null});this.attachEvent("_onContentLoaded",function(){this.tabbar._callMainEvent("onContentLoaded",arguments);this.tabbar._callMainEvent("onTabContentLoaded",arguments)});this.attachEvent("_onContentAttach",function(){this.tabbar._adjustCell(this.tabbar.conf.lastActive)});this.attachEvent("_onBeforeContentAttach",function(a){if(a=="sidebar"&&this.conf.skin!="dhx_skyblue"){this._hideBorders()}})};window.dhtmlXTabBarCell.prototype=new dhtmlXCellObject();dhtmlXCellObject.prototype.attachTabbar=function(a){this.callEvent("_onBeforeContentAttach",["tabbar"]);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}}if(typeof(window.dhtmlXTabBarCell)!="undefined"&&(this instanceof window.dhtmlXTabBarCell)){if(this.conf.skin=="dhx_skyblue"){c._ofs={t:-1,r:-1,b:-1,l:-1}}}if(typeof(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){c._ofs={l:-1}}if(typeof(window.dhtmlXCarouselCell)!="undefined"&&(this instanceof window.dhtmlXCarouselCell)){this._hideBorders()}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};function dhtmlXTabBarInitFromHTML(){var z=document.getElementsByTagName("div");for(var i=0;i<z.length;i++){if(z[i].className.indexOf("dhtmlxTabBar")!=-1){var conf={settings:{},tabs:[]};var n=z[i];var id=n.id;n.className="";var k=new Array();for(var j=0;j<n.childNodes.length;j++){if(n.childNodes[j].tagName&&n.childNodes[j].tagName!="!"){k[k.length]=n.childNodes[j]}}var skin=n.getAttribute("skin");if(skin!=null){conf.settings.skin=skin}var w=new dhtmlXTabBar({parent:id,mode:n.getAttribute("mode")});window[id]=w;acs=n.getAttribute("onbeforeinit");if(acs){eval(acs)}align=n.getAttribute("align");if(align){conf.settings.align=align}var cont={};for(var j=0;j<k.length;j++){var m=k[j];var tab={id:m.id,text:m.getAttribute("name"),width:m.getAttribute("width"),selected:m.getAttribute("selected"),active:m.getAttribute("active"),close:m.getAttribute("close")};var href=m.getAttribute("href");if(href){cont[m.id]={href:href}}else{cont[m.id]={cont:m}}conf.tabs.push(tab)}w.loadStruct(conf);for(var a in cont){if(cont[a].href){w.cells(a).attachURL(cont[a].href);cont[a].href=null}else{w.cells(a).attachObject(cont[a].cont);if(cont[a].cont.style.display=="none"){cont[a].cont.style.display=""}cont[a].cont=null}cont[a]=null}var selId=n.getAttribute("select");if(selId!=null){w.tabs(selId).setActive()}else{if(w.getActiveTab()==null){var v=w._getFirstVisible();if(v!=null){w.cells(v).setActive()}}}acs=n.getAttribute("oninit");if(acs){eval(acs)}}}if(typeof(window.addEventListener)=="function"){window.removeEventListener("load",dhtmlXTabBarInitFromHTML,false)}else{window.detachEvent("onload",dhtmlXTabBarInitFromHTML)}}if(typeof(window.addEventListener)=="function"){window.addEventListener("load",dhtmlXTabBarInitFromHTML,false)}else{window.attachEvent("onload",dhtmlXTabBarInitFromHTML)}function dhtmlXSideBar(c){var e=this;this.conf={skin:(c.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxsidebar")||"dhx_skyblue"),css:"dhxsidebar",width:c.width||200,scroll_size:12,scroll_mult:20,close_button:false,icons_path:c.icons_path||"",selected:null,single_cell:(typeof(c.single_cell)=="undefined"?false:window.dhx4.s2b(c.single_cell)),cell:null};this.setTemplate(c.template);window.dhtmlXCellTop.apply(this,[c.parent,(c==null?null:c.offsets)]);window.dhx4._eventable(this);if(window.navigator.msPointerEnabled==true){this.conf.touch_ms=true;this.conf.touch_start="MSPointerDown",this.conf.touch_end="MSPointerUp"}else{this.conf.touch_ms=false;this.conf.touch_start="touchstart",this.conf.touch_end="touchend"}this.side=document.createElement("DIV");this.side.className="dhxsidebar_side dhxsidebar_tpl_"+this.conf.tpl_name;this.side.innerHTML="<div class='dhxsidebar_side_items'></div>";this.cont.appendChild(this.side);window.setTimeout(function(){if(e!=null&&e.side!=null){e.side.firstChild.style.top="0px"}},1);this.arw=document.createElement("DIV");this.arw.className="dhxsidebar_arrows dhxsidebar_arrows_hidden";this.arw.innerHTML="<div class='dhxsidebar_arrow dhxsidebar_arrow_left'><div class='dhxsidebar_arrow_image'></div></div><div class='dhxsidebar_arrow dhxsidebar_arrow_right'><div class='dhxsidebar_arrow_image'></div></div>";this.cont.appendChild(this.arw);this._doOnArwClick=function(h){h=h||event;if(h.type!="click"&&h.preventDefault){h.preventDefault()}var g=h.target||h.srcElement;if(g.className.match(/dhxsidebar_arrow_image/)!=null){g=g.parentNode}if(g.className.match(/dhxsidebar_arrow_left/)!=null){e._scrollSide(-e.conf.scroll_size)}else{if(g.className.match(/dhxsidebar_arrow_right/)!=null){e._scrollSide(e.conf.scroll_size)}}g=null};if(typeof(window.addEventListener)=="function"){this.arw.addEventListener(this.conf.touch_start,this._doOnArwClick,false);this.arw.addEventListener("click",this._doOnArwClick,false)}else{this.arw.attachEvent("onclick",this._doOnArwClick)}this._doOnSideClick=function(l){l=l||event;var h=l.target||l.srcElement;var m=null;var g=false;if(l.type=="touchstart"||l.type=="pointerdown"||l.type=="MSPointerDown"){if(l.preventDefault){l.preventDefault()}if(this.className.match(/dhxsidebar_touch/gi)==null){if(l.type=="touchstart"||(l.type=="pointerdown"&&l.pointerType=="touch")){this.className+=" dhxsidebar_touch"}}}while(h!=null&&m==null&&l.type!="pointerdown"&&l.type!="MSPointerDown"){if(typeof(h.className)!="undefined"){if(h.className.match(/^dhxsidebar_item/)!=null&&typeof(h._idd)!="undefined"){m=h._idd}else{if(h.className.match(/^dhxsidebar_bubble/)!=null){g=true;m=h.parentNode._idd}}}h=h.parentNode}if(m!=null){if(g==false||(g==true&&e.callEvent("onBubbleClick",[m,e.t[m].conf.bubble])==true)){e._setItemActive(m,true)}}h=null};if(typeof(window.addEventListener)=="function"){this.side.addEventListener(this.conf.touch_start,this._doOnSideClick,false);this.side.addEventListener(this.conf.touch_end,this._doOnSideClick,false);this.side.addEventListener("mouseup",this._doOnSideClick,false)}else{this.side.attachEvent("onclick",this._doOnSideClick)}this.side.onmouseover=function(){this.className=this.className.replace(/\s*dhxsidebar_touch/gi,"")};this._doOnSideScroll=function(g){g=g||event;var h=(g.type=="mousewheel"?-g.wheelDelta:g.deltaY);e._scrollSide(h/Math.abs(h)*3)};this._scrollSide=function(g){var h=parseInt(this.side.firstChild.style.top||0)-g*this.conf.scroll_mult;if(h+this.side.firstChild.offsetHeight<this.side.clientHeight){h=this.side.clientHeight-this.side.firstChild.offsetHeight}if(h>0){h=0}this.side.firstChild.style.top=h+"px"};if(typeof(window.addEventListener)=="function"){this.side.addEventListener("wheel",this._doOnSideScroll,false)}else{this.side.attachEvent("onmousewheel",this._doOnSideScroll)}this.t={};this.s={};this._adjustCell=function(q,n){if(this.conf.single_cell!=true&&q==null){return}var g=this.conf.width;var l=this.cont.offsetWidth-g;var o=0;var m=this.cont.offsetHeight;if(this.conf.single_cell==true){if(n==true){this.conf.cell._setSize(g,o,l,m)}}else{if(q!=this.conf.selected){o=-5000;this.t[q].cell.cell.style.visibility="hidden";this.t[q].cell.cell.style.zIndex=0}this.t[q].cell._setSize(g,o,l,m)}};var a=window.dhx4.transDetect();this.conf.transProp=a.transProp;this.conf.transEv=a.transEv;this.conf.transValue="all 0.1s";this._doOnTrEnd=function(h){var m=this._idd;if(e.t[m]==null){return}var g=e.t[m];var l=g.conf.transActvId;if(g.conf.transMode=="hide"){if(g.conf.remove==true){e._removeItem(m)}else{g.item.style[g.conf.transProp]="";if(e.conf.single_cell!=true){g.cell.cell.style.visibility="hidden";g.cell.cell.style.top="-5000px"}g.conf.transActv=false}}else{if(g.conf.transMode=="show"){g.item.style[g.conf.transProp]="";g.item.style.visibility="visible";g.conf.transMode=null;g.conf.transActv=false}}if(l!=null){e._setItemActive(l)}else{e._checkHeight()}g=null};this._initObj=function(g){this.clearAll();if(g.items!=null){this.addItem(g.items)}};this._xmlToObj=function(s){var h=[];var n=s.getElementsByTagName("sidebar");if(n!=null&&n[0]!=null){var l=n[0].getElementsByTagName("item");for(var o=0;o<l.length;o++){var m={};for(var g=0;g<l[o].attributes.length;g++){m[l[o].attributes[g].nodeName]=l[o].attributes[g].nodeValue}h.push(m)}}return{items:h}};dhx4._enableDataLoading(this,"_initObj","_xmlToObj","sidebar",{struct:true});this.unload=function(){this.conf.unloading=true;if(typeof(window.addEventListener)=="function"){this.side.removeEventListener("wheel",this._doOnSideScroll,false)}else{this.side.detachEvent("onmousewheel",this._doOnSideScroll)}this.clearAll();this.s=this.t=null;if(typeof(window.addEventListener)=="function"){this.arw.removeEventListener(this.conf.touch_start,this._doOnArwClick,false);this.arw.removeEventListener("click",this._doOnArwClick,false)}else{this.arw.detachEvent("onclick",this._doOnArwClick)}this.arw.parentNode.removeChild(this.arw);this.arw=null;if(typeof(window.addEventListener)=="function"){this.side.removeEventListener(this.conf.touch_start,this._doOnSideClick,false);this.side.removeEventListener(this.conf.touch_end,this._doOnSideClick,false);this.side.removeEventListener("click",this._doOnSideClick,false)}else{this.side.detachEvent("onclick",this._doOnSideClick)}this.side.onmouseover=null;this.side.parentNode.removeChild(this.side);this.side=null;this._unloadTop();if(this.conf.single_cell==true){this.conf.cell._unload();this.conf.cell=null}window.dhx4._eventable(this,"clear");window.dhx4._enableDataLoading(this,null,null,null,"clear");for(var g in this){this[g]=null}e=null};if(this.conf.single_cell==true){this.conf.cell=new dhtmlXSideBarCell("master",this);this.cont.appendChild(this.conf.cell.cell);this._cells_native=this.cells;this.cells=function(g){this.conf.cell._idd=g;return this.conf.cell}}this.setSizes();if(c.items!=null){this._initObj(c)}else{if(c.json!=null){this.loadStruct(c.json,c.onload)}else{if(c.xml!=null){this.loadStruct(c.xml,c.onload)}}}return this}dhtmlXSideBar.prototype=new dhtmlXCellTop();dhtmlXSideBar.prototype._addItem=function(c){var g=(typeof(c.id)!="undefined"?c.id:window.dhx4.newId());if(c.type=="separator"){var e=document.createElement("DIV");e.className="dhxsidebar_sep";this.side.firstChild.appendChild(e);this.s[g]={sep:e};e=null;return}c.icons_path=this.conf.icons_path;var e=document.createElement("DIV");e.className="dhxsidebar_item";e.innerHTML=window.dhx4.template(this.conf.tpl_str,c);e._idd=g;this.side.firstChild.appendChild(e);e.ondragstart=function(){return false};if(this.conf.single_cell==true){var a=this.conf.cell}else{var a=new dhtmlXSideBarCell(g,this);this.cont.appendChild(a.cell)}this.t[g]={item:e,cell:a,init:c,conf:{selected:false,visible:true,close:close}};if(typeof(c.bubble)!="undefined"){this._setItemBubble(g,c.bubble)}a=e=null;if(window.dhx4.s2b(c.selected)==true){this._setItemActive(g)}else{this._adjustCell(g)}this._checkHeight()};dhtmlXSideBar.prototype.addItem=function(a){if(!(a instanceof Array)){a=[a]}for(var c=0;c<a.length;c++){this._addItem(a[c])}};dhtmlXSideBar.prototype.items=dhtmlXSideBar.prototype.cells=function(a){if(this.conf.single_cell==true){return this.conf.cell}if(this.t[a]!=null){return this.t[a].cell}return null};dhtmlXSideBar.prototype.forEachCell=dhtmlXSideBar.prototype.forEachItem=function(e){if(this.conf.single_cell==true){if(typeof(e)=="function"){e.apply(window,[this.conf.cell])}else{if(typeof(e)=="string"&&typeof(window[e])=="function"){window[e].apply(window,[this.conf.cell])}}return}for(var c in this.t){if(typeof(e)=="function"){e.apply(window,[this.t[c].cell])}else{if(typeof(e)=="string"&&typeof(window[e])=="function"){window[e].apply(window,[this.t[c].cell])}}}};dhtmlXSideBar.prototype.getAllItems=function(){var e=[];for(var c in this.t){e.push(c)}return e};dhtmlXSideBar.prototype.getNumberOfItems=function(){return this.getAllItems().length};dhtmlXSideBar.prototype.clearAll=function(){for(var c in this.t){this._removeItem(c,false,true)}for(var c in this.s){this.removeSep(c)}};dhtmlXSideBar.prototype.setSizes=function(){this._adjustCont();this._adjustSide();this._checkHeight();this._adjustCell(this.conf.selected,true);this.callEvent("_onSetSizes",[])};dhtmlXSideBar.prototype.setSideWidth=function(a){this.conf.width=a;this.setSizes()};dhtmlXSideBar.prototype._adjustSide=function(){if(this.conf.side_ofs==null){this.conf.side_ofs={};this.side.style.width=this.conf.width+"px";this.side.style.height=this.cont.offsetHeight+"px";this.conf.side_ofs.w=this.side.offsetWidth-parseInt(this.side.style.width);this.conf.side_ofs.h=this.side.offsetHeight-parseInt(this.side.style.height)}this.side.style.width=this.conf.width-this.conf.side_ofs.w+"px";this.side.style.height=this.cont.offsetHeight-this.arw.offsetHeight-this.conf.side_ofs.h+"px";this.arw.style.width=this.side.style.width;this._scrollSide(0)};dhtmlXSideBar.prototype._checkHeight=function(){var a=(this.arw.className.match(/dhxsidebar_arrows_hidden/)!=null);if(this.conf.side_hfix==null){this.conf.side_hfix=this.side.offsetHeight-this.side.clientHeight}if(this.side.firstChild.offsetHeight>this.cont.clientHeight-this.conf.side_hfix){if(a==true){this.arw.className="dhxsidebar_arrows";this._adjustSide()}}else{if(a==false){this.arw.className="dhxsidebar_arrows dhxsidebar_arrows_hidden";this.side.firstChild.style.top="0px";this._adjustSide()}}};dhtmlXSideBar.prototype.removeSep=function(c){if(this.s[c]==null){return}this.side.firstChild.removeChild(this.s[c].sep);this.s[c].sep=null;this.s[c]=null;try{delete this.s[c]}catch(a){}};dhtmlXSideBar.prototype._setItemActive=function(e,c){if(this.conf.selected==e){return}if(typeof(c)=="undefined"){c=false}if(c==true&&this.callEvent("onBeforeSelect",[e,this.conf.selected])!==true){return}var a=null;if(this.conf.selected!=null){a=this.conf.selected;this._setItemInactive(this.conf.selected)}if(this.t[e]!=null){this.conf.selected=e;this.t[e].selected=true;this.t[e].item.className+=" dhxsidebar_item_selected";if(this.conf.single_cell!=true){this.t[e].cell.cell.style.visibility="visible";this.t[e].cell.cell.style.top="0px";this.t[e].cell.cell.style.zIndex=1}}else{this.conf.selected=null}this._adjustCell(e);if(c==true){this.callEvent("onSelect",[e,a])}};dhtmlXSideBar.prototype._setItemInactive=function(a){if(this.t[a]==null){return}this.t[a].selected=false;this.t[a].item.className=this.t[a].item.className.replace(/\s{0,}dhxsidebar_item_selected/gi,"");if(this.conf.single_cell!=true){this.t[a].cell.cell.style.visibility="hidden";this.t[a].cell.cell.style.top="-5000px";this.t[a].cell.cell.style.zIndex=0}};dhtmlXSideBar.prototype._isItemActive=function(a){return(this.conf.selected==a)};dhtmlXSideBar.prototype._getNextVisible=function(c,a){return this._getNearVisible(c,a,"next")};dhtmlXSideBar.prototype._getPrevVisible=function(c,a){return this._getNearVisible(c,a,"previous")};dhtmlXSideBar.prototype._getFirstVisible=function(){return this._getNearVisible(null,false,"first")};dhtmlXSideBar.prototype._getNearVisible=function(l,c,h){if(h=="first"){var e=this.side.firstChild.firstChild;h="next"}else{if(l==null||this.t[l]==null){return(c?this._getFirstVisible():null)}var e=this.t[l].item[h+"Sibling"]}var g=null;while(e!=null&&g==null){var a=e._idd;if(a!=null&&g==null&&this.t[a].conf.visible){g=a}else{e=e[h+"Sibling"]}}e=null;return g};dhtmlXSideBar.prototype.goToNextItem=function(a){var c=this._getNextVisible(this.conf.selected,true);if(c!=null){this._setItemActive(c,a)}};dhtmlXSideBar.prototype.goToPrevItem=function(a){var c=this._getPrevVisible(this.conf.selected,true);if(c!=null){this._setItemActive(c,a)}};dhtmlXSideBar.prototype.getActiveItem=function(){return this.conf.selected};dhtmlXSideBar.prototype.setTemplate=function(g,c){this.conf.tpl_name=(g!=null&&this.templates[g]!=null?g:"details");this.conf.tpl_str=this.templates[this.conf.tpl_name];if(c!=null){this.conf.icons_path=c}for(var e in this.t){this.t[e].init.icons_path=this.conf.icons_path;this.t[e].item.innerHTML=window.dhx4.template(this.conf.tpl_str,this.t[e].init)}if(this.side!=null){this.side.className="dhxsidebar_side dhxsidebar_tpl_"+this.conf.tpl_name}if(this._scrollSide!=null){this._scrollSide(0);this._checkHeight()}};dhtmlXSideBar.prototype.templates={details:"<img class='dhxsidebar_item_icon' src='#icons_path##icon#' border='0'><div class='dhxsidebar_item_text'>#text#</div>",tiles:"<img class='dhxsidebar_item_icon' src='#icons_path##icon#' border='0'><div class='dhxsidebar_item_text'>#text#</div>",icons:"<img class='dhxsidebar_item_icon' src='#icons_path##icon#' border='0'>",icons_text:"<div class='dhxsidebar_item_icon'><img class='dhxsidebar_item_icon' src='#icons_path##icon#' border='0'></div><div class='dhxsidebar_item_text'>#text#</div>",text:"<div class='dhxsidebar_item_text'>#text#</div>"};dhtmlXSideBar.prototype.tpl_bubble="<div class='dhxsidebar_bubble'>#value#</div>";window.dhtmlXSideBarCell=function(g,e){dhtmlXCellObject.apply(this,[g,"_sidebar"]);this.sidebar=e;this.conf.skin=this.sidebar.conf.skin;this.conf.sidebar_funcs={show:"_showItem",hide:"_hideItem",isVisible:"_isItemVisible",setActive:"_setItemActive",isActive:"_isItemActive",setText:"_setItemText",getText:"_getItemText",remove:"_removeItem",setBubble:"_setItemBubble",getBubble:"_getItemBubble",clearBubble:"_clearItemBubble"};this._sidebarCall=function(a){return function(){var h=[this._idd];for(var l=0;l<arguments.length;l++){h.push(arguments[l])}return this.sidebar[a].apply(this.sidebar,h)}};for(var c in this.conf.sidebar_funcs){if(typeof(this[c])!="function"){this[c]=this._sidebarCall(this.conf.sidebar_funcs[c])}}this.attachEvent("_onCellUnload",function(){this.sidebar=null;for(var h in this.conf.sidebar_funcs){this[h]=this.conf.sidebar_funcs[h]=null}this.conf.sidebar_funcs=null});this.attachEvent("_onContentLoaded",function(){this.sidebar.callEvent("onContentLoaded",arguments)});this.attachEvent("_onBeforeContentAttach",function(a){if(a=="tabbar"||a=="layout"||a=="acc"){this._hideBorders()}if(a=="sidebar"&&this.conf.skin!="dhx_skyblue"){this._hideBorders()}if((this.conf.skin=="dhx_web"||this.conf.skin=="dhx_terrace")&&(a=="menu"||a=="toolbar"||a=="ribbon")){if(this.cell.className.match(/dhx_cell_cont_no_top/gi)==null){this.cell.className+=" dhx_cell_cont_no_top"}}})};dhtmlXSideBarCell.prototype=new dhtmlXCellObject();dhtmlXSideBar.prototype._setItemText=function(g,e){if(this.t[g]!=null){for(var c in e){this.t[g].init[c]=e[c]}this.t[g].init.icons_path=this.conf.icons_path;this.t[g].item.innerHTML=window.dhx4.template(this.conf.tpl_str,this.t[g].init);if(this.t[g].conf.bubble!=null){this.t[g].item.innerHTML+=window.dhx4.template(this.tpl_bubble,{value:this.t[g].conf.bubble})}}};dhtmlXSideBar.prototype._getItemText=function(g){var e={};if(this.t[g]!=null){for(var c in this.t[g].init){e[c]=this.t[g].init[c]}}return e};dhtmlXSideBar.prototype._removeItem=function(o,n,l){if(this.t[o]==null){return}if(l!=true&&this.t[o].conf.remove!=true){this.t[o].conf.remove=true;this._hideItem(o,n);return}if(typeof(n)=="undefined"){n=true}var g=this._getNextVisible(o);var h=this._getPrevVisible(o);if(this.t[o].conf.transEv==true){this.t[o].item.removeEventListener(this.conf.transEv,this._doOnTrEnd);this.t[o].conf.transEv=false}if(this.conf.single_cell!=true){this.t[o].cell._unload();this.t[o].cell=null}this.t[o].item.parentNode.removeChild(this.t[o].item);this.t[o].item=null;for(var c in this.t[o]){this.t[o][c]=null}this.t[o]=null;try{delete this.t[o]}catch(m){}if(this.conf.selected==o&&n!=false){this.conf.selected=null;var n=(n==true?(g||h||this._getFirstVisible()):n);if(n!=null){this._setItemActive(n)}}else{if(l!=true){this._checkHeight()}}};dhtmlXSideBar.prototype._showItem=function(c,a){if(this.t[c]==null||this.t[c].conf.visible==true||this.t[c].conf.transActv==true){return}if(this.conf.transProp!==false){this.t[c].conf.transActv=true;this.t[c].conf.transMode="show";this.t[c].conf.transProp=this.conf.transProp;this.t[c].conf.transActvId=(a?c:null);if(this.t[c].conf.transEv!=true){this.t[c].item.addEventListener(this.conf.transEv,this._doOnTrEnd);this.t[c].conf.transEv=true}this.t[c].conf.visible=true;this.t[c].item.style[this.conf.transProp]=this.conf.transValue;this.t[c].item.className="dhxsidebar_item"}else{this.t[c].conf.visible=true;this.t[c].item.style.display="";if(a==true){this._setItemActive(c)}else{this._checkHeight()}}};dhtmlXSideBar.prototype._hideItem=function(h,g){if(this.t[h]==null||this.t[h].conf.visible!=true||this.t[h].conf.transActv==true){return}var e=false;if(this.conf.selected==h){this.conf.selected=null;this.t[h].conf.active=false;this.t[h].item.className="dhxsidebar_item";e=true}var c=this._getPrevVisible(h);var a=this._getNextVisible(h);var g=(e&&g!==false?(g==true?null:g)||a||c:null);if(this.conf.transProp!==false){this.t[h].conf.transActv=true;this.t[h].conf.transMode="hide";this.t[h].conf.transProp=this.conf.transProp;this.t[h].conf.transActvId=g;this.t[h].conf.visible=false;if(this.t[h].conf.transEv!=true){this.t[h].item.addEventListener(this.conf.transEv,this._doOnTrEnd);this.t[h].conf.transEv=true}this.t[h].item.style[this.conf.transProp]=this.conf.transValue;this.t[h].item.className="dhxsidebar_item dhxsidebar_item_hidden"}else{this.t[h].item.style.display="none";this.t[h].conf.visible=false;if(this.conf.single_cell!=true){this.t[h].cell.cell.style.visibility="hidden";this.t[h].cell.cell.style.top="-5000px"}if(g!=null){this._setItemActive(g)}this._checkHeight();if(this.t[h].conf.remove==true){this._removeItem(h)}}};dhtmlXSideBar.prototype._isItemVisible=function(a){return(this.t[a].conf.visible==true)};dhtmlXSideBar.prototype._setItemBubble=function(c,a){if(this.t[c]==null){return}this.t[c].item.innerHTML=window.dhx4.template(this.conf.tpl_str,this.t[c].init)+window.dhx4.template(this.tpl_bubble,{value:String(a)});this.t[c].conf.bubble=a};dhtmlXSideBar.prototype._getItemBubble=function(a){if(this.t[a]==null){return null}return(typeof(this.t[a].conf.bubble)=="undefuned"?null:this.t[a].conf.bubble)};dhtmlXSideBar.prototype._clearItemBubble=function(a){if(this.t[a]==null){return}this.t[a].item.innerHTML=window.dhx4.template(this.conf.tpl_str,this.t[a].init);this.t[a].conf.bubble=null};dhtmlXCellObject.prototype.attachSidebar=function(a){this.callEvent("_onBeforeContentAttach",["sidebar"]);if(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.dhtmlXWindowsCell)!="undefined"&&(this instanceof window.dhtmlXWindowsCell)){}else{if(this.conf.skin=="dhx_skyblue"){c._ofs={t:-1,r:-1,b:-1,l:-1}}if(this.conf.skin=="dhx_web"){if(typeof(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){c._ofs={l:8}}if(typeof(window.dhtmlXLayoutCell)!="undefined"&&(this instanceof window.dhtmlXLayoutCell)){c._ofs={t:2}}if(typeof(window.dhtmlXTabBarCell)!="undefined"&&(this instanceof window.dhtmlXTabBarCell)){c._ofs={t:8}}if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={t:2}}}if(this.conf.skin=="dhx_terrace"){if(typeof(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){c._ofs={l:-1}}if(typeof(window.dhtmlXLayoutCell)!="undefined"&&(this instanceof window.dhtmlXLayoutCell)){c._ofs={t:-1}}if(typeof(window.dhtmlXTabBarCell)!="undefined"&&(this instanceof window.dhtmlXTabBarCell)){c._ofs={t:-1}}if(typeof(window.dhtmlXAccordionCell)!="undefined"&&(this instanceof window.dhtmlXAccordionCell)){c._ofs={t:-1,r:-1,b:-1,l:-1}}}}this._attachObject(c);a.skin=this.conf.skin;a.parent=c;this.dataType="sidebar";this.dataObj=new dhtmlXSideBar(a);a.parent=c=null;a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};function dhtmlXCarousel(g,l,n){if(typeof(g)=="string"||(typeof(g)=="object"&&typeof(g.tagName)!="undefined")){g={parent:(typeof(g)=="string"?document.getElementById(g):g),effect:l,skin:n,delete_conf:true}}else{if(typeof(g)=="undefined"||g==null){g={}}}this.conf={skin:(g.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxcarousel")||"dhx_skyblue"),css:"dhxcarousel",items_count:0,selected:-1,item_width:Number(g.item_width)||"auto",item_height:Number(g.item_height)||"auto",ofs_item:Number(g.offset_item)||1,ofs_left:Number(g.offset_left)||0,ofs_top:Number(g.offset_top)||0,buttons:(typeof(g.buttons)=="undefined"?true:window.dhx4.s2b(g.buttons)),drops:false,keys:(typeof(g.keys)=="undefined"?true:window.dhx4.s2b(g.keys)),key_data:{left:37,right:39},arw:["&#9668;","&#9658;"]};this.conf.autowidth=(this.conf.item_width=="auto");this.conf.autoheight=(this.conf.item_height=="auto");var e=window.dhx4.transDetect();this.conf.transProp=e.transProp;this.conf.transEv=e.transEv;this.conf.anim_type=(g.effect||"slide");if(this.ef[this.conf.anim_type]==true){var h=this["_"+this.conf.anim_type+"_init"]();if(h===false){this.conf.anim_type="slide";h=this["_"+this.conf.anim_type+"_init"]()}if(typeof(h)=="object"){for(var c in h){if(typeof(this.conf[c])=="undefined"){this.conf[c]=h[c]}}}}this.conf.anim_f=this["_"+this.conf.anim_type+"_f"]();var m=this;window.dhtmlXCellTop.apply(this,[g.parent,g.offsets]);this.area=document.createElement("DIV");this.area.className="dhxcarousel_area";this.cont.appendChild(this.area);if(typeof(window.addEventListener)=="function"){this._doOnTouchStart=function(a){if(window.dhx4.dnd._mTouch(a)==true){return}if(m.conf.animating==true){return}if(a.preventDefault){a.preventDefault()}m.area.className+=" dhxcarousel_area_dnd";m.conf.touch_conf={t:new Date().getTime(),dx:null,dy:null};if(a.type.match(/^touch/)!=null){m.conf.touch_conf.id=a.touches[0].identifier;m.conf.touch_conf.x=a.touches[0].clientX;m.conf.touch_conf.y=a.touches[0].clientY}else{m.area.style.touchAction=m.area.style.msTouchAction="none";m.conf.touch_conf.x=a.clientX;m.conf.touch_conf.y=a.clientY}window.addEventListener(window.dhx4.dnd.evs.move,m._doOnTouchMove,false);window.addEventListener(window.dhx4.dnd.evs.end,m._doOnTouchEnd,false)};this._doOnTouchMove=function(a){};this._doOnTouchEnd=function(s){if(s.type.match(/^touch/)!=null){var o=0;for(var r=0;r<s.changedTouches.length;r++){if(s.changedTouches[r].identifier==m.conf.touch_conf.id){o=m.conf.touch_conf.x-s.changedTouches[r].clientX}}}else{var o=m.conf.touch_conf.x-s.clientX}window.removeEventListener(window.dhx4.dnd.evs.move,m._doOnTouchMove,false);window.removeEventListener(window.dhx4.dnd.evs.end,m._doOnTouchEnd,false);m.area.className=m.area.className.replace(/\s*dhxcarousel_area_dnd$/,"");if(o==0||new Date().getTime()-m.conf.touch_conf.t>400){return}var a=o/Math.abs(o);m._animateStart(a)};this.area.addEventListener(window.dhx4.dnd.evs.start,this._doOnTouchStart,false)}this.cdata={};this.ind={};this.addCell=function(s,r){this.conf.items_count++;if(this.conf.selected==-1){this.conf.selected=0}this.setSizes();this._checkControls();if(typeof(r)=="undefined"||r==null){r=this.conf.items_count-1}else{if(r<0){r=0}else{if(r>this.conf.items_count-1){r=this.conf.items_count-1}}}for(var q in this.cdata){if(this.cdata[q].index>=r){this.cdata[q].index++;this.ind[this.cdata[q].index]=q;this._adjustCell(q)}}if(s==null){s=String(window.dhx4.newId())}while(this.cdata[s]!=null){s=String(window.dhx4.newId())}var o=new dhtmlXCarouselCell(s,this);if(this.area.childNodes[r]!=null){this.area.insertBefore(o.cell,this.area.childNodes[r])}else{this.area.appendChild(o.cell)}this.cdata[s]={index:r,cell:o};this.ind[r]=s;this._adjustCell(s);this._addBar();this._setBarIndex(this.conf.selected);o=null;this[this.conf.anim_f.cell_added](s);return s};this._removeCell=function(u){var r=this.cdata[u].index;this.cdata[u].cell._unload();this.cdata[u].index=this.cdata[u].cell=null;this.cdata[u]=null;delete this.cdata[u];delete this.ind[r];this.conf.items_count--;if(this.conf.unloading==true){return}this.ind={};var o=0;for(var q in this.cdata){if(this.cdata[q].index>r){this.cdata[q].index--}this.ind[this.cdata[q].index]=q}var s=false;if(this.conf.selected>r){this.conf.selected--}else{if(this.conf.selected==r){this.conf.selected=Math.min(this.conf.selected,this.conf.items_count-1);s=true}else{}}this._removeBar(false);this._setBarIndex(this.conf.selected);if(s==true){if(this.conf.selected>=0){this[this.conf.anim_f.update_selected](this.ind[this.conf.selected])}}this.setSizes();this._checkControls()};this.setSizes=function(){this._adjustCont();var u={};this.area.style.height=this.cont.offsetHeight-this.controls.offsetHeight+"px";this.conf.width=(this.conf.autowidth?this.cont.offsetWidth-this.conf.ofs_left*2:this.conf.item_width);this.conf.height=(this.conf.autoheight?this.area.offsetHeight-this.conf.ofs_top*2:this.conf.item_height);this.conf.top=Math.max(0,(this.conf.autoheight?this.conf.ofs_top:Math.floor((this.area.offsetHeight-this.conf.height)/2)));this.area.style.width=this[this.conf.anim_f.detect_aw]()*(this.conf.width+this.conf.ofs_item)+this.conf.ofs_item+"px";this.area.style.left=Math.round(this.cont.offsetWidth/2-this.conf.width/2-this.conf.ofs_item)+"px";for(var q in this.cdata){var r={};for(var o in this.cdata[q].cell.conf.size){r[o]=this.cdata[q].cell.conf.size[o]}if(this.conf.autowidth==true){r.w=this.conf.width;r.x=this[this.conf.anim_f.detect_x](q)}if(this.conf.autoheight==true){r.h=this.conf.height}u[q]=r}this.area.style.left=Math.round(this.cont.offsetWidth/2-this.conf.width/2-this.conf.ofs_item)-(this.conf.width+this.conf.ofs_item)*this.conf.selected+"px";this._adjustControls();if(this.conf.autoheight!=true){this.conf.top=Math.max(0,Math.floor(this.area.offsetHeight-this.conf.height)/2);for(var q in u){u[q].y=this.conf.top}}for(var q in u){this.cdata[q].cell._setSize(u[q].x,u[q].y,u[q].w,u[q].h)}this.callEvent("_onSetSizes",[])};this._adjustCell=function(a){this.cdata[a].cell._setSize(this[this.conf.anim_f.detect_x](a),this.conf.top,this.conf.width,this.conf.height)};this._animateStart=function(o,a){if((this.conf.selected<=0&&o<0)||(this.conf.selected>=this.conf.items_count-1&&o>0)){return}if(this.conf.animating==true){return}this.conf.animating=true;this[this.conf.anim_f.prepare](o,a)};this._animateTransEnd=function(a){m[m.conf.anim_f.end](a||event,this)};this._animateEnd=function(a){this.conf.selected=this.conf.selected+a;this._checkControls();this._setBarIndex(this.conf.selected);this.callEvent("onSelect",[this.ind[this.conf.selected]]);this.conf.animating=false};this._initControls();this.setCellSize=function(a,o){this.conf.item_width=(a==null?"auto":a);this.conf.item_height=(o==null?"auto":o);this.setSizes()};this.setOffset=function(q,o,a){if(q!=null){this.conf.ofs_left=q}if(o!=null){this.conf.ofs_top=o}if(a!=null){this.conf.ofs_item=a}this.setSizes()};this.enableHotKeys=function(a){this.conf.keys=window.dhx4.s2b(a)};this.goFirst=function(){if(this.conf.selected==0){return}this._animateStart(-this.conf.selected)};this.goLast=function(){if(this.conf.selected==this.conf.items_count-1){return}this._animateStart(this.conf.items_count-1-this.conf.selected)};this.goNext=function(){this._animateStart(1)};this.goPrev=function(){this._animateStart(-1)};this.getActiveIndex=function(){return this.conf.selected};this.getActiveId=function(){return this.ind[this.conf.selected]};this.getActiveCell=function(){var a=this.getActiveId();if(a!=null){return this.cdata[a].cell}return null};this.unload=function(){this.conf.unloading=true;if(typeof(window.addEventListener)=="function"){window.removeEventListener("keydown",this._doOnWinKeyDown,false);this.area.removeEventListener(window.dhx4.dnd.evs.start,this._doOnTouchStart,false)}else{document.body.detachEvent("onkeydown",this._doOnWinKeyDown)}for(var o in this.cdata){this._removeCell(o)}this.cdata[o]=null;this.area.parentNode.removeChild(this.area);this.area=null;this._unloadControls();this._unloadTop();window.dhx4._eventable(this,"clear");for(var o in this){this[o]=null}m=null};window.dhx4._eventable(this);this._callMainEvent=function(o,a){this.callEvent(o,a)};this.conf.ev_coverclick=this.attachEvent("_cellCoverClick",function(a){var o=a-this.conf.selected;if(Math.abs(o)==1){this._animateStart(o)}});this._doOnWinKeyDown=function(q){q=q||event;if(m.conf.keys==true){if(q.ctrlKey==true&&q.shiftKey!=true&&q.altKey!=true){var o=q.keyCode;var a=m.conf.key_data;if(o==a.left||o==a.right){if(q.preventDefault){q.preventDefault()}else{q.returnValue=false}m._animateStart(o==a.left?-1:1)}}}};if(typeof(window.addEventListener)=="function"){window.addEventListener("keydown",this._doOnWinKeyDown,false)}else{document.body.attachEvent("onkeydown",this._doOnWinKeyDown)}if(g.delete_conf==true){for(var c in g){g[c]=null}g=null}return this}dhtmlXCarousel.prototype=new dhtmlXCellTop();dhtmlXCarousel.prototype.ef={};dhtmlXCarousel.prototype.cells=function(a){return this.cdata[a].cell};dhtmlXCarousel.prototype.forEachCell=function(e){for(var c in this.cdata){if(typeof(e)=="function"){e.apply(window,[this.cdata[c].cell])}else{if(typeof(e)=="string"&&typeof(window[e])=="function"){window[e].apply(window,[this.cdata[c].cell])}}}};dhtmlXCarousel.prototype._initControls=function(){var a=this;this.controls=document.createElement("DIV");this.controls.className="dhx_carousel_controls";this.controls.innerHTML="<div class='dhx_carousel_bars'></div><div class='dhx_carousel_btn dhx_carousel_btn_prev'>"+this.conf.arw[0]+"</div><div class='dhx_carousel_btn dhx_carousel_btn_next'>"+this.conf.arw[1]+"</div>";this.cont.appendChild(this.controls);this._doOnControlClick=function(l){if(a.conf.clear_click==true){a.conf.clear_click=false;return}l=l||event;if(window.dhx4.dnd.evs.start!=null&&l.type!="click"&&a.conf.clear_click!=true){if(window.dhx4.dnd._mTouch(l)==true){return}a.conf.clear_click=true}var c=l.target||l.srcElement;var h=null;if(c.className!=null){if(c.className.match(/btn_prev/)!=null){h=-1}else{if(c.className.match(/btn_next/)!=null){h=1}else{if(c.className.match(/dhx_carousel_onebar/)!=null&&c.className.match(/dhx_carousel_baractv/)==null){for(var g=0;g<c.parentNode.childNodes.length;g++){if(c.parentNode.childNodes[g]==c){h=g-a.conf.selected}}}}}}if(h!=null){a._animateStart(h)}c=null};if(typeof(window.addEventListener)=="function"){this.controls.addEventListener("click",this._doOnControlClick,false);if(window.dhx4.dnd.evs.start!=null){this.controls.addEventListener(window.dhx4.dnd.evs.start,this._doOnControlClick,false)}}else{this.controls.attachEvent("onclick",this._doOnControlClick);if(window.dhx4.isIE6||window.dhx4.isIE7||window.dhx4.isIE8){this.controls.onselectstart=function(c){c=c||event;if(c.preventDefault){c.preventDefault()}c.returnValue=false;return false}}}this.showControls=function(){this.controls.style.display="";this.setSizes()};this.hideControls=function(){this.controls.style.display="none";this.setSizes()};this._checkControls=function(){this.controls.childNodes[1].className="dhx_carousel_btn dhx_carousel_btn_prev"+(this.conf.selected<=0?"_dis":"");this.controls.childNodes[2].className="dhx_carousel_btn dhx_carousel_btn_next"+(this.conf.selected>=this.conf.items_count-1||this.conf.items_count==0?"_dis":"")};this._adjustControls=function(){this.controls.firstChild.style.left=Math.round(this.cont.offsetWidth/2-this.controls.firstChild.offsetWidth/2)+"px"};this._addBar=function(){var c=document.createElement("DIV");c.className="dhx_carousel_onebar";c.innerHTML="<div class='dhx_carousel_barcore'>&nbsp;</div>";this.controls.firstChild.appendChild(c);c=null;this._adjustControls()};this._removeBar=function(e){var c=this.controls.firstChild.lastChild;if(c!=null){c.parentNode.removeChild(c);c=null;if(e!==false){this._adjustControls()}}};this._setBarIndex=function(c){for(var e=0;e<this.controls.firstChild.childNodes.length;e++){this.controls.firstChild.childNodes[e].className="dhx_carousel_onebar"+(e==c?" dhx_carousel_baractv":"")}};this._unloadControls=function(){if(typeof(window.addEventListener)=="function"){this.controls.removeEventListener("click",this._doOnControlClick,false);if(window.dhx4.dnd.evs.start!=null){this.controls.removeEventListener(window.dhx4.dnd.evs.start,this._doOnControlClick,false)}}else{this.controls.detachEvent("onclick",this._doOnControlClick);if(window.dhx4.isIE6||window.dhx4.isIE7||window.dhx4.isIE8){this.controls.onselectstart=null}}while(this.controls.firstChild.childNodes.length>0){this._removeBar(false)}this.cont.removeChild(this.controls);this.controls=null;a=null};if(this.conf.buttons!=true){this.hideControls()}this._checkControls()};window.dhtmlXCarouselCell=function(e,c){dhtmlXCellObject.apply(this,[e,"_carousel"]);var a=this;this.carousel=c;this.conf.skin=this.carousel.conf.skin;this.attachEvent("_onCellUnload",function(){this.carousel=null;a=null});this.attachEvent("_onContentLoaded",function(){this.carousel._callMainEvent("onContentLoaded",[this._idd])});this._showCover=function(){if(this.conf.cover==true){return}this._showCellCover();var g=this.cell.childNodes[this.conf.idx.cover];g.onclick=function(){a.carousel._callMainEvent("_cellCoverClick",[a._idd])};g=null};this._hideCover=function(){if(this.conf.cover!=true){return}this.cell.childNodes[this.conf.idx.cover].onclick=null;this._hideCellCover()};return this};dhtmlXCarouselCell.prototype=new dhtmlXCellObject();dhtmlXCarouselCell.prototype.getId=function(){return this._idd};dhtmlXCarouselCell.prototype.getIndex=function(){return this.carousel.cdata[this._idd].index};dhtmlXCarouselCell.prototype.setActive=function(){var a=this.getIndex()-this.carousel.conf.selected;if(a!=0){this.carousel._animateStart(a)}};dhtmlXCarouselCell.prototype.remove=function(){this.carousel._removeCell(this._idd)};dhtmlXCellObject.prototype.attachCarousel=function(a){this.callEvent("_onBeforeContentAttach",["carousel"]);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(window.dhtmlXSideBarCell)!="undefined"&&(this instanceof window.dhtmlXSideBarCell)){if(this.conf.skin=="dhx_terrace"){c._ofs={t:-1,r:-1,b:-1,l:-1}}}if(typeof(a)=="undefined"||a==null){a={}}if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}a.parent=c;this.dataType="carousel";this.dataObj=new dhtmlXCarousel(a);a.parent=null;c=a=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCarousel.prototype.ef.slide=true;dhtmlXCarousel.prototype.ef.slide_conf={anim_step:25,anim_timeout:10,anim_slide:"left 0.3s"};dhtmlXCarousel.prototype.ef.slide_f={prepare:"_slide_prepare",start:"_slide_start",end:"_slide_end",update_selected:"_slide_update_selected",detect_x:"_slide_detect_x",detect_aw:"_slide_detect_area_width",cell_added:"_slide_cell_added"};dhtmlXCarousel.prototype._slide_init=function(){return this.ef.slide_conf};dhtmlXCarousel.prototype._slide_f=function(){return this.ef.slide_f};dhtmlXCarousel.prototype._slide_prepare=function(c,a){var g=this.conf.anim_step;var h=this.conf.width+this.conf.ofs_item;if(a==false){g=h+1}this.area._init=parseInt(this.area.style.left);var e=this.ind[this.conf.selected+c];this._slide_update_selected(e);if(this.conf.transProp!==false&&a!=false){if(this.conf.transEvInit!=true){this.area.addEventListener(this.conf.transEv,this._animateTransEnd,false);this.conf.transEvInit=true}this.conf.current_dir=c;this.area.style[this.conf.transProp]=this.conf.anim_slide;this.area.style.left=this.area._init+h*(-c)+"px"}else{this._slide_start(g,0,h,c)}};dhtmlXCarousel.prototype._slide_start=function(h,a,l,c){var g=false;a+=h;if(a>=l){a=l;g=true}this.area.style.left=this.area._init+a*(-c)+"px";if(g!=true){var e=this;window.setTimeout(function(){e._slide_start(h,a,l,c);e=null},this.conf.anim_timeout)}else{this.cdata[this.ind[this.conf.selected]].cell._showCover();this._animateEnd(c)}};dhtmlXCarousel.prototype._slide_end=function(c,a){if(c.type==this.conf.transEv&&a==this.area){this.area.style[this.conf.transProp]="";if(this.conf.transEvInit==true){this.area.removeEventListener(this.conf.transEv,this._animateTransEnd,false);this.conf.transEvInit=false}this.cdata[this.ind[this.conf.selected]].cell._showCover();this._animateEnd(this.conf.current_dir)}};dhtmlXCarousel.prototype._slide_update_selected=function(a){this.cdata[a].cell._hideCover()};dhtmlXCarousel.prototype._slide_detect_x=function(e){var c=this.cdata[e].index;var a=c*(this.conf.width+this.conf.ofs_item)+this.conf.ofs_item;return a};dhtmlXCarousel.prototype._slide_cell_added=function(a){if(this.conf.selected!=this.cdata[a].index){this.cdata[a].cell._showCover()}if(this.cdata[a].index<=this.conf.selected&&this.conf.items_count>1){this._animateStart(1,false)}};dhtmlXCarousel.prototype._slide_detect_area_width=function(){return this.conf.items_count};dhtmlXCarousel.prototype.ef.flip=true;dhtmlXCarousel.prototype.ef.flip_conf={anim_flip:"transform 0.3s ease-out",anim_flip_ang:-87,anim_flip_trstyle:"transform"};dhtmlXCarousel.prototype.ef.flip_f={prepare:"_flip_prepare",start:"_flip_start",end:"_flip_end",update_selected:"_flip_update_selected",detect_x:"_flip_detect_x",detect_aw:"_flip_detect_area_width",cell_added:"_flip_cell_added"};dhtmlXCarousel.prototype._flip_init=function(){var a=(this.conf.transProp==false?false:this.ef.flip_conf);if(a!==false&&window.dhx4.isKHTML==true&&a.anim_flip.match("webkit")==null){a.anim_flip=a.anim_flip.replace(/transform/,"-webkit-transform");a.anim_flip_trstyle="webkitTransform"}return a};dhtmlXCarousel.prototype._flip_f=function(){return this.ef.flip_f};dhtmlXCarousel.prototype._flip_prepare=function(a){this.conf.flip_data={fromIndex:this.conf.selected,toIndex:this.conf.selected+a,mode:0,dir:a};this._flip_start()};dhtmlXCarousel.prototype._flip_start=function(){var a=this.cdata[this.ind[this.conf.flip_data.mode==0?this.conf.flip_data.fromIndex:this.conf.flip_data.toIndex]].cell;if(this.area.className.match(/dhxcarousel_area_flip/)==null){this.area.className+=" dhxcarousel_area_flip"}if(a.conf.tr_ev!=true){a.cell.addEventListener(this.conf.transEv,this._animateTransEnd,false);a.conf.tr_ev=true}if(this.conf.flip_data.mode==0){a.cell.style[this.conf.anim_flip_trstyle]="rotateY("+String(this.conf.flip_data.dir>0?this.conf.anim_flip_ang:-this.conf.anim_flip_ang)+"deg)"}else{a.cell.style.visibility="visible";a.cell.style[this.conf.anim_flip_trstyle]="rotateY(0deg)"}a.cell.style[this.conf.transProp]=this.conf.anim_flip;a=null};dhtmlXCarousel.prototype._flip_end=function(n,m){if(n.type==this.conf.transEv){var a=this.cdata[this.ind[this.conf.flip_data.mode==0?this.conf.flip_data.fromIndex:this.conf.flip_data.toIndex]].cell;if(m==a.cell){a.cell.removeEventListener(this.conf.transEv,this._animateTransEnd,false);a.conf.tr_ev=false;if(this.conf.flip_data.mode==0){a.cell.style[this.conf.transProp]="";a.cell.style.visibility="hidden";this.conf.flip_data.mode=1;this._flip_start()}else{var g=this.conf.flip_data.dir;var h=Math.min(this.conf.flip_data.fromIndex,this.conf.flip_data.toIndex)+1;var c=Math.max(this.conf.flip_data.fromIndex,this.conf.flip_data.toIndex)-1;for(var l=h;l<=c;l++){this.cdata[this.ind[l]].cell.cell.style[this.conf.anim_flip_trstyle]="rotateY("+String(this.conf.anim_flip_ang*g/Math.abs(g))+"deg)"}if(this.area.className.match(/dhxcarousel_area_flip/)!=null){this.area.className=String(this.area.className).replace(/\s{0,}dhxcarousel_area_flip/gi,"")}this.conf.flip_data=null;a.cell.style[this.conf.transProp]="";this._animateEnd(g)}}a=null}};dhtmlXCarousel.prototype._flip_update_selected=function(a){};dhtmlXCarousel.prototype._flip_detect_x=function(e){var c=0;var a=c*(this.conf.width+this.conf.ofs_item)+this.conf.ofs_item;return a};dhtmlXCarousel.prototype._flip_cell_added=function(a){if(this.conf.selected!=this.cdata[a].index){this.cdata[a].cell.cell.style[this.conf.anim_flip_trstyle]="rotateY("+String(this.cdata[a].index<this.conf.selected?this.conf.anim_flip_ang:-this.conf.anim_flip_ang)+"deg)";this.cdata[a].cell.cell.style.visibility="hidden"}else{this.cdata[a].cell.cell.style[this.conf.anim_flip_trstyle]="rotateY(0deg)"}};dhtmlXCarousel.prototype._flip_detect_area_width=function(){return 1};dhtmlXCarousel.prototype.ef.cards=true;dhtmlXCarousel.prototype.ef.cards_conf={anim_cards:"left 0.3s"};dhtmlXCarousel.prototype.ef.cards_f={prepare:"_cards_prepare",start:"_cards_start",end:"_cards_end",update_selected:"_cards_update_selected",detect_x:"_cards_detect_x",detect_aw:"_cards_detect_area_width",cell_added:"_cards_cell_added"};dhtmlXCarousel.prototype._cards_init=function(){return(this.conf.transProp==false?false:this.ef.cards_conf)};dhtmlXCarousel.prototype._cards_f=function(){return this.ef.cards_f};dhtmlXCarousel.prototype._cards_prepare=function(e,c){if(e>0){var g=this.ind[this.conf.selected+e];var a=this.cdata[g].cell;this._cards_update_selected(g);if(a.conf.transEvInit!=true){a.cell.addEventListener(this.conf.transEv,this._animateTransEnd,false);a.conf.transEvInit=true}this.conf.current_id=g;this.conf.current_dir=e;a.cell.style[this.conf.transProp]=this.conf.anim_cards;a.cell.style.left=this._cards_detect_x(g,0)+"px";a=null}else{this._cards_adjust_middle(this.conf.selected+e+1,this.conf.selected-1,1);var g=this.ind[this.conf.selected];var a=this.cdata[g].cell;a._hideCover();if(a.conf.transEvInit!=true){a.cell.addEventListener(this.conf.transEv,this._animateTransEnd,false);a.conf.transEvInit=true}this.conf.current_id=g;this.conf.current_dir=e;this.cdata[this.ind[this.conf.selected+e]].cell._hideCover();a.cell.style[this.conf.transProp]=this.conf.anim_cards;a.cell.style.left=this._cards_detect_x(g,1)+"px";a=null}};dhtmlXCarousel.prototype._cards_start=function(e,a,g,c){};dhtmlXCarousel.prototype._cards_end=function(g,c){if(g.type==this.conf.transEv&&this.conf.current_id!=null&&c==this.cdata[this.conf.current_id].cell.cell){var a=this.cdata[this.conf.current_id].cell;a.cell.style[this.conf.transProp]="";if(a.conf.transEvInit!=true){a.cell.removeEventListener(this.conf.transEv,this._animateTransEnd,false);a.conf.transEvInit=false}this.conf.current_id=null;if(this.conf.current_dir>0){this._cards_adjust_middle(this.conf.selected+1,this.conf.selected+this.conf.current_dir-1,0)}this.cdata[this.ind[this.conf.selected]].cell._showCover();this._animateEnd(this.conf.current_dir)}};dhtmlXCarousel.prototype._cards_update_selected=function(a){this.cdata[a].cell._hideCover()};dhtmlXCarousel.prototype._cards_adjust_middle=function(e,h,c){for(var g=e;g<=h;g++){var l=this.ind[g];var a=this.cdata[l].cell;a.conf.size.x=this._cards_detect_x(l,c);a.cell.style.left=a.conf.size.x+"px";a=null}};dhtmlXCarousel.prototype._cards_detect_x=function(e,c){if(typeof(c)=="undefined"||c==null){c=(this.cdata[e].index<=this.conf.selected?0:1)}var a=c*(this.conf.width+this.conf.ofs_left+this.conf.ofs_item)+this.conf.ofs_item;return a};dhtmlXCarousel.prototype._cards_cell_added=function(a){this.cdata[a].cell.conf.size.x=this._cards_detect_x(a);this.cdata[a].cell.cell.style.left=this.cdata[a].cell.conf.size.x+"px";if(this.conf.selected!=this.cdata[a].index){this.cdata[a].cell._showCover()}};dhtmlXCarousel.prototype._cards_detect_area_width=function(){return 2};function dhtmlXWindows(n){var l=this;var g={};if(typeof(n)!="undefined"){for(var e in n){g[e]=n[e]}}n=null;this.conf={skin:window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxwins")||"dhx_skyblue",vp_pos_ofs:20,vp_custom:false,vp_of_auto:(g.vp_overflow=="auto"),vp_of_id:window.dhx4.newId(),ofs_w:null,ofs_h:null,button_last:null,dblclick_tm:300,dblclick_last:null,dblclick_id:null,dblclick_mode:"minmax",dblclick_active:false,dblclick_ev:(navigator.userAgent.indexOf("MSIE 6.0")>=0||navigator.userAgent.indexOf("MSIE 7.0")>=0||navigator.userAgent.indexOf("MSIE 8.0")>=0),fr_cover:(navigator.userAgent.indexOf("MSIE 6.0")>=0)};var c=window.dhx4.transDetect();this.conf.tr={prop:c.transProp,ev:c.transEv,height_open:"height 0.2s cubic-bezier(0.25,0.1,0.25,1)",height_close:"height 0.18s cubic-bezier(0.25,0.1,0.25,1)",op_open:"opacity 0.16s ease-in",op_close:"opacity 0.2s ease-out",op_v_open:"1",op_v_close:"0.4"};if(!g.viewport){this.attachViewportTo(document.body)}else{if(g.viewport.object!=null){this.attachViewportTo(g.viewport.object)}else{if(g.viewport.left!=null&&g.viewport.top!=null&&g.viewport.width!=null&&g.viewport.height!=null){this.setViewport(g.viewport.left,g.viewport.top,g.viewport.width,g.viewport.height,g.viewport.parent)}else{this.attachViewportTo(document.body)}}}this.w={};this.createWindow=function(q,F,D,s,I){var o={};if(arguments.length==1&&typeof(q)=="object"){o=q}else{o.id=q;o.left=F;o.top=D;o.width=s;o.height=I;if(typeof(o.id)=="undefined"||o.id==null){o.id=window.dhx4.newId()}while(this.w[o.id]!=null){o.id=window.dhx4.newId()}}if(o.left==null){o.left=0}if(o.top==null){o.top=0}o.move=(o.move!=null&&window.dhx4.s2b(o.move)==false?false:(o.deny_move!=null&&window.dhx4.s2b(o.deny_move)==true?false:true));o.park=(o.park!=null&&window.dhx4.s2b(o.park)==false?false:(o.deny_park!=null&&window.dhx4.s2b(o.deny_park)==true?false:true));o.resize=(o.resize!=null&&window.dhx4.s2b(o.resize)==false?false:(o.deny_resize!=null&&window.dhx4.s2b(o.deny_resize)==true?false:true));o.keep_in_viewport=(o.keep_in_viewport!=null&&window.dhx4.s2b(o.keep_in_viewport));o.modal=(o.modal!=null&&window.dhx4.s2b(o.modal));o.center=(o.center!=null&&window.dhx4.s2b(o.center));o.text=(o.text!=null?o.text:(o.caption!=null?o.caption:"dhtmlxWindow"));o.header=(!(o.header!=null&&window.dhx4.s2b(o.header)==false));var J=document.createElement("DIV");J.className="dhxwin_active";this.vp.appendChild(J);J._isWindow=true;J._idd=o.id;var w=document.createElement("DIV");w.className="dhxwin_hdr";w.style.zIndex=0;w.innerHTML="<div class='dhxwin_icon'></div><div class='dhxwin_text'><div class='dhxwin_text_inside'>"+o.text+"</div></div><div class='dhxwin_btns'></div>";J.appendChild(w);w.onselectstart=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};w.oncontextmenu=function(a){a=a||event;a.cancelBubble=true;return false};w._isWinHdr=true;w.firstChild._isWinIcon=true;var u=document.createElement("DIV");u.className="dhxwin_brd";J.appendChild(u);var C=document.createElement("DIV");C.className="dhxwin_fr_cover";C.innerHTML="<iframe class='dhxwin_fr_cover_inner' frameborder='0' border='0'></iframe><div class='dhxwin_fr_cover_inner'></div>";J.appendChild(C);this.w[o.id]={win:J,hdr:w,brd:u,fr_cover:C,b:{},conf:{z_id:window.dhx4.newId(),actv:false,modal:false,maxed:false,parked:false,sticked:false,visible:true,header:true,text:o.text,keep_in_vp:o.keep_in_viewport,allow_move:o.move,allow_park:o.park,allow_resize:o.resize,max_w:null,max_h:null,min_w:80,min_h:80}};var v={help:{title:"Help",visible:false},stick:{title:"Stick",visible:false},park:{title:"Park",visible:true},minmax:{title:"Min/Max",visible:true},close:{title:"Close",visible:true}};for(var E in v){var A=new dhtmlXWindowsButton(this,o.id,E,v[E].title,false);if(v[E].visible==false){A.hide()}w.lastChild.appendChild(A.button);this.w[o.id].b[E]=A;A=null}this._winAdjustTitle(o.id);this.w[o.id].win.style.zIndex=window.dhx4.zim.reserve(this.w[o.id].conf.z_id);var H=new dhtmlXWindowsCell(o.id,this);this.w[o.id].win.insertBefore(H.cell,C);this.w[o.id].cell=H;if(typeof(window.addEventListener)=="function"){this.w[o.id].win.addEventListener("mousedown",this._winOnMouseDown,false);this.w[o.id].win.addEventListener("mouseup",this._winOnMouseDown,false);if(this.conf.dblclick_ev){this.w[o.id].win.addEventListener("dblclick",this._winOnMouseDown,false)}if(this.conf.dnd_enabled==true&&window.dhx4.dnd.evs.start!=null){this.w[o.id].win.addEventListener(window.dhx4.dnd.evs.start,this._winOnMouseDown,false);if(window.dhx4.dnd.p_en!=true){this.w[o.id].win.addEventListener(window.dhx4.dnd.evs.start,this._winOnMouseDown,false);this.w[o.id].win.addEventListener(window.dhx4.dnd.evs.end,this._winOnMouseDown,false)}}}else{this.w[o.id].win.attachEvent("onmousedown",this._winOnMouseDown);this.w[o.id].win.attachEvent("onmouseup",this._winOnMouseDown);if(this.conf.dblclick_ev){this.w[o.id].win.attachEvent("ondblclick",this._winOnMouseDown)}}this._winInitFRM(o.id);this._winSetPosition(o.id,o.left,o.top);this._winSetSize(o.id,o.width,o.height);this._winMakeActive(o.id);if(o.center==true){this.w[o.id].cell.center()}if(o.modal==true){this.w[o.id].cell.setModal(true)}if(o.header==false){this.w[o.id].cell.hideHeader()}f=J=w=u=C=H=null;return this.w[o.id].cell};this._winOnMouseDown=function(q){q=q||event;var a=q.target||q.srcElement;var o={press_type:q.type};if(q.type=="MSPointerDown"||q.type=="pointerdown"){l.conf.ev_skip=true}else{if(l.conf.ev_skip==true){l.conf.ev_skip=false;a=null;return}}while(a!=null&&a._isWindow!=true){if(typeof(a.className)!="undefined"&&o.mode==null){if(typeof(a._buttonName)!="undefined"){o.mode="button";o.button_name=a._buttonName}else{if(a._isWinHdr==true){o.mode="hdr"}else{if(a._isWinIcon==true){o.mode="icon"}}}}a=a.parentNode}if(o.mode==null){o.mode="win"}o.id=(a!=null&&a._isWindow==true?a._idd:null);a=null;if(o.id!=null&&l.w[o.id]!=null){l.callEvent("_winMouseDown",[q,o])}};this._winOnParkTrans=function(o){if(o.stopPropagation){o.stopPropagation()}var a=l.w[this._idd];if(o.propertyName=="opacity"){l._winCellClearOpacity(this._idd)}if(o.propertyName=="height"&&a.conf.tr_mode=="park"){if(a.conf.tr_mode=="park"){a.win.style[l.conf.tr.prop]="";if(!a.conf.parked){l._winAdjustCell(this._idd);l._callMainEvent("onParkDown",this._idd);if(a.conf.keep_in_vp){l._winAdjustPosition(this._idd,a.conf.x,a.conf.y)}}else{a.hdr.style.zIndex=3;l._callMainEvent("onParkUp",this._idd)}}}a=null};this.unload=function(){this.conf.unloading=true;if(this._dndInitModule){this._dndUnloadModule()}for(var o in this.w){this._winClose(o)}this.w=null;if(this.cm!=null&&typeof(this._unloadContextMenu)=="function"){this._unloadContextMenu()}window.dhx4._eventable(this,"clear");this.attachViewportTo(null);for(var o in this.conf){this.conf[o]=null;delete this.conf[o]}for(var o in this){this[o]=null}l=o=null};window.dhx4._eventable(this);this.attachEvent("_winMouseDown",this._winMouseDownHandler);if(this._dndInitModule){this._dndInitModule()}if(g.wins!=null){for(var m=0;m<g.wins.length;m++){var h=g.wins[m];this.createWindow(h)}}g=null;return this}dhtmlXWindows.prototype.forEachWindow=function(e){for(var c in this.w){e.apply(window,[this.w[c].cell])}};dhtmlXWindows.prototype.window=function(a){if(this.w[a]!=null){return this.w[a].cell}return null};dhtmlXWindows.prototype.isWindow=function(a){return(this.w[a]!=null)};dhtmlXWindows.prototype.findByText=function(g){var e=[];for(var c in this.w){if((this.w[c].cell.getText()).indexOf(String(g))>=0){e.push(this.w[c])}}return e};dhtmlXWindows.prototype.setSkin=function(e){if(e==this.conf.skin){return}if(this.vp!=null){this.vp.className=String(this.vp.className).replace("dhxwins_vp_"+this.conf.skin," dhxwins_vp_"+e)}for(var c in this.w){this.w[c].cell._resetSizeState();this._winAdjustCell(c);this._winAdjustTitle(c)}this.conf.skin=e};dhtmlXWindows.prototype.getBottommostWindow=function(){return this._getTopBottomWin(false)};dhtmlXWindows.prototype.getTopmostWindow=function(){return this._getTopBottomWin(true)};dhtmlXWindows.prototype._getTopBottomWin=function(h){var g=null;for(var c in this.w){if(this.w[c].conf.visible){var e=false;if(g!=null){e=g.z>this.w[c].win.style.zIndex;if(h){e=!e}}if(g==null||e){g={win:this.w[c].cell,z:this.w[c].win.style.zIndex}}}}return(g?g.win:null)};dhtmlXWindows.prototype._winMakeActive=function(e,h){if(e!=null&&h!==true&&this.w[e].conf.actv==true){return}var u=[];var n={};for(var c=0;c<this._zOrder.length;c++){var m=this._zOrder[c].name;var g=this._zOrder[c].value;var v=[];for(var r in this.w){var s=this.w[r];if(n[r]==null&&s.conf[m]===g&&s.conf.visible==true){if(e!=r){window.dhx4.zim.clear(s.conf.z_id);v.push([r,Number(s.win.style.zIndex)]);n[r]=true}}s=null}v.sort(function(w,q){return(w[1]<q[1]?1:-1)});if(e!=null&&this.w[e].conf[m]===g&&n[e]==null){window.dhx4.zim.clear(this.w[e].conf.z_id);var l=[[e,Number(this.w[e].win.style.zIndex)]];v=l.concat(v);n[e]=true}u=u.concat(v)}for(var c=u.length-1;c>=0;c--){var r=u[c][0];var s=this.w[r];s.win.style.zIndex=window.dhx4.zim.reserve(s.conf.z_id);if(s.conf.modal&&this.mcover!=null){for(var o in this.mcover){this.mcover[o].style.zIndex=s.win.style.zIndex}}this._winAdjustFRMZIndex(r);if(e==null&&c==0){e=r}s.conf.actv=(e==r);s.win.className=(s.conf.actv?"dhxwin_active":"dhxwin_inactive");s=null}if(e!=null&&this.conf.last_active!=e){this._callMainEvent("onFocus",e)}this.conf.last_active=e};dhtmlXWindows.prototype._zOrder=[{name:"modal",value:true},{name:"sticked",value:true},{name:"sticked",value:false}];dhtmlXWindows.prototype._vpPull={};dhtmlXWindows.prototype._vpOf={};dhtmlXWindows.prototype._vpPullAdd=function(){if(this.vp==null){return}var e=null;for(var c in this._vpPull){if(this._vpPull[c].vp==this.vp){this._vpPull[c].count++;e=c}}if(e==null){this._vpPull[window.dhx4.newId()]={vp:this.vp,count:1}}if(this.vp==document.body&&this.conf.vp_of_auto==true){this._vpOfInit()}this._vpOfUpd()};dhtmlXWindows.prototype._vpPullRemove=function(){if(this.vp==null){return 0}var e=0;for(var c in this._vpPull){if(this._vpPull[c].vp==this.vp){e=--this._vpPull[c].count;if(e==0){this._vpPull[c].vp=null;this._vpPull[c].count=null;delete this._vpPull[c]}}}this._vpOfClear();return e};dhtmlXWindows.prototype._vpOfInit=function(){this._vpOf[this.conf.vp_of_id]=true};dhtmlXWindows.prototype._vpOfClear=function(){this._vpOf[this.conf.vp_of_id]=false;delete this._vpOf[this.conf.vp_of_id];this._vpOfUpd()};dhtmlXWindows.prototype._vpOfUpd=function(){var e=false;for(var c in this._vpOf){e=e||this._vpOf[c]}if(e==true){if(document.body.className.match(/dhxwins_vp_auto/)==null){document.body.className+=" dhxwins_vp_auto"}}else{if(document.body.className.match(/dhxwins_vp_auto/)!=null){document.body.className=String().replace(/\s{0,}dhxwins_vp_auto/gi,"")}}};dhtmlXWindows.prototype.attachViewportTo=function(h){var e=this._vpPullRemove();if(this.conf.vp_custom){while(this.vp.childNodes.length>0){this.vp.removeChild(this.vp.lastChild)}this.vp.parentNode.removeChild(this.vp);this.vp=null}else{if(this.vp!=null&&e==0){this.vp.className=String(this.vp.className).replace(new RegExp("\\s{1,}dhxwins_vp_"+this.conf.skin),"")}}if(h==null){this.vp=null}else{this.vp=(typeof(h)=="string"?document.getElementById(h):h);var g="dhxwins_vp_"+this.conf.skin;if(this.vp.className.indexOf(g)<0){this.vp.className+=" "+g}h=null;for(var c in this.w){this.vp.appendChild(this.w[c].win)}this.conf.vp_custom=false}if(this.vp==document.body){document.body.style.position="static"}this._vpPullAdd()};dhtmlXWindows.prototype.setViewport=function(c,l,g,a,h){var e=document.createElement("DIV");e.style.position="absolute";e.style.left=c+"px";e.style.top=l+"px";e.style.width=g+"px";e.style.height=a+"px";if(typeof(h)=="undefined"||h==null){h=document.body}else{if(typeof(h)=="string"){h=document.getElementById(h)}}h.appendChild(e);this.attachViewportTo(e);this.conf.vp_custom=true;h=e=null};dhtmlXWindows.prototype._winSetPosition=function(g,a,e){var c=this.w[g];if(c.conf.maxed){c.conf.lastMX+=(a-c.conf.x);c.conf.lastMY+=(e-c.conf.y)}c.conf.x=a;c.conf.y=e;c.win.style.left=c.conf.x+"px";c.win.style.top=c.conf.y+"px";this._winAdjustFRMPosition(g);c=null};dhtmlXWindows.prototype._winAdjustPosition=function(m,c,l){var e=this.w[m];if(typeof(c)=="undefined"){c=e.conf.x}if(typeof(l)=="undefined"){l=e.conf.y}var a=(e.conf.keep_in_vp?0:-e.conf.w+this.conf.vp_pos_ofs);var h=(e.conf.keep_in_vp?this.vp.clientWidth-e.conf.w:this.vp.clientWidth-this.conf.vp_pos_ofs);if(c<a){c=a}else{if(c>h){c=h}}var g=(e.conf.keep_in_vp?this.vp.clientHeight-e.conf.h:this.vp.clientHeight-this.conf.vp_pos_ofs);if(l<0){l=0}else{if(l>g){l=g}}if(c!=e.conf.x||l!=e.conf.y){this._winSetPosition(m,c,l)}e=null};dhtmlXWindows.prototype._winSetSize=function(n,l,e,m,c){var g=this.w[n];var a=(l!=null?l:g.conf.w);var h=(e!=null?e:g.conf.h);if(this.conf.ofs_w==null){g.win.style.width=a+"px";g.win.style.height=h+"px";this.conf.ofs_w=g.win.offsetWidth-a;this.conf.ofs_h=g.win.offsetHeight-h}if(g.conf.min_w!=null&&a<g.conf.min_w){a=g.conf.min_w}if(g.conf.max_w!=null&&a>g.conf.max_w){a=g.conf.max_w}if(!g.conf.parked&&g.conf.min_h!=null&&h<g.conf.min_h){h=g.conf.min_h}if(g.conf.max_h!=null&&h>g.conf.max_h){h=g.conf.max_h}if(g.conf.keep_in_vp){if(a>this.vp.clientWidth){a=this.vp.clientWidth}if(h>this.vp.clientHeight){h=this.vp.clientHeight}}g.win.style.width=a-this.conf.ofs_w+"px";g.win.style.height=h-this.conf.ofs_h+"px";g.conf.w=a;g.conf.h=h;this._winAdjustFRMSize(n);if(c){this._winAdjustPosition(n,g.conf.x,g.conf.y)}if(!g.conf.parked&&m!=true){this._winAdjustCell(n)}g=null};dhtmlXWindows.prototype._winMinmax=function(h,e){if(typeof(e)!="undefined"&&this.w[h].conf.maxed==e){return}if(this.w[h].conf.allow_resize==false){return}var c=this.w[h];if(c.conf.parked){this._winPark(h,false)}if(c.conf.maxed){this._winSetSize(h,c.conf.lastMW,c.conf.lastMH);this._winAdjustPosition(h,c.conf.lastMX,c.conf.lastMY);c.conf.maxed=false}else{var a=0;var g=0;if(c.conf.max_w!=null){a=c.conf.x+Math.round(c.conf.w-c.conf.max_w)/2}if(c.conf.max_h!=null){g=Math.max(c.conf.y+Math.round(c.conf.h-c.conf.max_h)/2,0)}c.conf.lastMX=c.conf.x;c.conf.lastMY=c.conf.y;c.conf.lastMW=c.conf.w;c.conf.lastMH=c.conf.h;this._winSetSize(h,this.vp.clientWidth,this.vp.clientHeight);this._winAdjustPosition(h,a,g);c.conf.maxed=true}c.b.minmax.setCss(c.conf.maxed?"minmaxed":"minmax");if(c.conf.maxed){this._callMainEvent("onMaximize",h)}else{this._callMainEvent("onMinimize",h)}c=null};dhtmlXWindows.prototype._winShow=function(c,a){if(this.w[c].conf.visible==true){return}this.w[c].win.style.display="";this.w[c].conf.visible=true;if(a==true||this.conf.last_active==null){this._winMakeActive(c,true)}this._callMainEvent("onShow",c)};dhtmlXWindows.prototype._winHide=function(c,a){if(this.w[c].conf.visible==false){return}this.w[c].win.style.display="none";this.w[c].conf.visible=false;if(this.w[c].conf.actv){this.w[c].conf.actv=false;this.w[c].win.className="dhxwin_inactive";this._winMakeActive(null,true)}this._callMainEvent("onHide",c)};dhtmlXWindows.prototype._winPark=function(e,a){if(this.w[e].conf.allow_park==false){return}if(this.w[e].conf.header==false){return}var c=this.w[e];if(a==true&&this.conf.tr.prop!==false){c.win.style[this.conf.tr.prop]=this.conf.tr[c.conf.parked?"height_open":"height_close"];if(!c.conf.tr_ev){c.win.addEventListener(this.conf.tr.ev,this._winOnParkTrans,false);c.conf.tr_ev=true}}if(c.conf.parked){c.hdr.className=String(c.hdr.className).replace(/\s{1,}dhxwin_hdr_parked/gi,"");c.hdr.style.zIndex=0;c.conf.parked=false;c.conf.tr_mode="park";this._winCellSetOpacity(e,"open",a);this._winSetSize(e,c.conf.w,c.conf.lastPH,(a==true&&this.conf.tr.prop!==false));if(!(a==true&&this.conf.tr.prop!==false)){this._callMainEvent("onParkDown",e);if(c.conf.keep_in_vp){this._winAdjustPosition(e,c.conf.x,c.conf.y)}}if(window.dhx4.isIE8==true&&this.conf.tr.prop==false&&c.cell.cell.className.match(/dhxwin_parked/)!=null){c.cell.cell.className=c.cell.cell.className.replace(/\s{0,}dhxwin_parked/gi,"")}}else{c.conf.lastPH=c.conf.h;c.hdr.className+=" dhxwin_hdr_parked";if(a==false||this.conf.tr.prop==false){c.hdr.style.zIndex=3}c.conf.parked=true;c.conf.tr_mode="park";this._winCellSetOpacity(e,"close",a);this._winSetSize(e,c.conf.w,c.hdr.offsetHeight+this.conf.ofs_h,(a==true&&this.conf.tr.prop!==false));if(!(a==true&&this.conf.tr.prop!==false)){this._callMainEvent("onParkUp",e)}if(window.dhx4.isIE8==true&&this.conf.tr.prop==false&&c.cell.cell.className.match(/dhxwin_parked/)==null){c.cell.cell.className+=" dhxwin_parked"}}c=null};dhtmlXWindows.prototype._winCellSetOpacity=function(m,l,e,h){var c=this.w[m].cell;for(var g in c.conf.idx){if({pr1:true,pr2:true}[g]!=true){if(e==true&&this.conf.tr.prop!=false){c.cell.childNodes[c.conf.idx[g]].style[this.conf.tr.prop]=this.conf.tr["op_"+l]}c.cell.childNodes[c.conf.idx[g]].style.opacity=this.conf.tr["op_v_"+l]}}c=null};dhtmlXWindows.prototype._winCellClearOpacity=function(g){var c=this.w[g].cell;for(var e in c.conf.idx){if({pr1:true,pr2:true}[e]!=true){if(this.conf.tr.prop!=false){c.cell.childNodes[c.conf.idx[e]].style[this.conf.tr.prop]=""}}}c=null};dhtmlXWindows.prototype._winStick=function(c,a){if(typeof(a)!="undefined"&&this.w[c].conf.sticked==a){return}this.w[c].conf.sticked=!this.w[c].conf.sticked;this.w[c].b.stick.setCss(this.w[c].conf.sticked?"sticked":"stick");this._winMakeActive(this.conf.last_active,true);if(this.w[c].conf.sticked){this._callMainEvent("onStick",c)}else{this._callMainEvent("onUnStick",c)}};dhtmlXWindows.prototype._winClose=function(g){if(this._callMainEvent("onClose",g)!==true&&this.conf.unloading!=true){return}var e=this.w[g];if(e.conf.fs_mode){e.cell.setToFullScreen(false)}if(e.conf.modal){this._winSetModal(g,false)}window.dhx4.zim.clear(e.conf.z_id);if(this.cm!=null&&this.cm.icon[g]!=null){this._detachContextMenu("icon",g,null)}if(typeof(window.addEventListener)=="function"){e.win.removeEventListener("mousedown",this._winOnMouseDown,false);e.win.removeEventListener("mouseup",this._winOnMouseDown,false);if(this.conf.dblclick_ev){e.win.removeEventListener("dblclick",this._winOnMouseDown,false)}if(this.conf.dnd_enabled==true&&window.dhx4.dnd.evs.start!=null){e.win.removeEventListener(window.dhx4.dnd.evs.start,this._winOnMouseDown,false);if(window.dhx4.dnd.p_en!=true){e.win.removeEventListener(window.dhx4.dnd.evs.start,this._winOnMouseDown,false);e.win.removeEventListener(window.dhx4.dnd.evs.end,this._winOnMouseDown,false)}}}else{e.win.detachEvent("onmousedown",this._winOnMouseDown);e.win.detachEvent("onmouseup",this._winOnMouseDown);if(this.conf.dblclick_ev){e.win.attachEvent("ondblclick",this._winOnMouseDown)}}for(var c in e.b){this._winRemoveButton(g,c,true)}e.b=null;e.cell._unload();e.cell=null;e.brd.parentNode.removeChild(e.brd);e.brd=null;if(e.fr_cover!=null){e.fr_cover.parentNode.removeChild(e.fr_cover);e.fr_cover=null}if(e.fr_m_cover!=null){e.fr_m_cover.parentNode.removeChild(e.fr_m_cover);e.fr_m_cover=null}e.hdr._isWinHdr=true;e.hdr.firstChild._isWinIcon=true;e.hdr.onselectstart=null;e.hdr.parentNode.removeChild(e.hdr);e.hdr=null;for(var c in e.conf){e.conf[c]=null;delete e.conf[c]}e.conf=null;e.win._idd=null;e.win._isWindow=null;e.win.parentNode.removeChild(e.win);e.win=null;e=null;this.w[g]=null;delete this.w[g];if(!this.conf.unloading){this._winMakeActive(null,true)}};dhtmlXWindows.prototype._winSetModal=function(m,g,l){if(this.w[m].conf.modal==g){return}if(typeof(l)=="undefined"){l=true}var e=this.w[m];if(g==true&&e.conf.modal==false){if(this.conf.last_modal!=null){this._winSetModal(this.conf.last_modal,false,false)}if(this.mcover==null){var h=document.createElement("DIV");h.className="dhxwins_mcover";this.vp.insertBefore(h,e.fr_m_cover||e.win);this.mcover={d:h};if(this.conf.fr_cover){this.mcover.f=document.createElement("IFRAME");this.mcover.f.className="dhxwins_mcover";this.mcover.f.border=0;this.mcover.f.frameBorder=0;this.vp.insertBefore(this.mcover.f,h)}h=null}else{if(this.mcover.d.nextSibling!=(e.fr_m_cover||e.win)){this.vp.insertBefore(this.mcover.d,e.fr_m_cover||e.win);if(this.mcover.f!=null){this.vp.insertBefore(this.mcover.f,this.mcover.d)}}}e.conf.modal=true;this.conf.last_modal=m;this._winMakeActive(m,true)}else{if(g==false&&e.conf.modal==true){e.conf.modal=false;this.conf.last_modal=null;if(l&&this.mcover!=null){for(var c in this.mcover){this.vp.removeChild(this.mcover[c]);this.mcover[c]=null}this.mcover=null}}}e=null};dhtmlXWindows.prototype._winMouseDownHandler=function(g,c){var a=g.target||g.srcElement;if(g.button>=2){return}if(c.mode=="button"){if(c.press_type=="mousedown"){this.conf.button_last=c.button_name}else{if((c.press_type=="mouseup"&&c.button_name==this.conf.button_last)||c.press_type=="MSPointerDown"||c.press_type=="pointerdown"){this.conf.button_last=null;if(this._winButtonClick(c.id,c.button_name,g)!==true){return}}}}if((c.press_type=="mousedown"||c.press_type=="dblclick")&&c.mode=="hdr"){this.conf.dblclick_active=false;if(this.conf.dblclick_ev==true){if(c.press_type=="dblclick"){this.conf.dblclick_active=true}}else{if(this.conf.dblclick_last==null){this.conf.dblclick_last=new Date().getTime();this.dblclick_id=c.id}else{var a=new Date().getTime();if(this.conf.dblclick_last+this.conf.dblclick_tm>a&&this.dblclick_id==c.id){this.conf.dblclick_active=true;this.conf.dblclick_last=null;this.dblclick_id=null}else{this.conf.dblclick_last=a;this.dblclick_id=c.id}}}if(this.conf.dblclick_active){this._winDoHeaderDblClick(c.id);return}}if(c.press_type=="mousedown"||(c.press_type==window.dhx4.dnd.evs.start)){this._winMakeActive(c.id)}if(c.press_type=="touchend"){}};dhtmlXWindows.prototype._winDoHeaderDblClick=function(a){if(this.conf.dblclick_mode=="minmax"){this._winMinmax(a);return}if(this.conf.dblclick_mode=="park"){this._winPark(a,true);return}if(typeof(this.conf.dblclick_mode)=="function"){this.conf.dblclick_mode.apply(window,[a]);return}if(typeof(window[this.conf.dblclick_mode])=="function"){window[this.conf.dblclick_mode].apply(window,[a]);return}};dhtmlXWindows.prototype._winAdjustCell=function(c){var q=this.w[c];var o=1;var n=(q.conf.header?q.hdr.offsetHeight:1);var g=q.win.clientWidth-2;var r=q.win.clientHeight-n-1;q.brd.style.left=o+"px";q.brd.style.top=n+"px";if(q.conf.brd==null){q.brd.style.width=g+"px";q.brd.style.height=r+"px";q.conf.brd={w:g-q.brd.offsetWidth,h:r-q.brd.offsetHeight}}q.brd.style.width=g+q.conf.brd.w+"px";q.brd.style.height=r+q.conf.brd.h+"px";var e=5;var a=1+e;var m=(q.conf.header?n:n+e);var h=q.brd.clientWidth;var l=q.brd.clientHeight;q.cell._setSize(a,m,h,l);q.fr_cover.style.left=a+"px";q.fr_cover.style.top=m+"px";q.fr_cover.style.width=h+"px";q.fr_cover.style.height=l+"px";q=null};dhtmlXWindows.prototype._winAdjustTitle=function(g){var a=this.w[g].hdr.childNodes[0];var e=this.w[g].hdr.childNodes[1];var c=this.w[g].hdr.childNodes[2];e.style.paddingLeft=a.offsetWidth+12+"px";e.style.paddingRight=c.offsetWidth+10+"px";e=c=a=null};dhtmlXWindows.prototype._callMainEvent=function(c,g){var a=this.w[g];if(a.cell.checkEvent(c)){var e=a.cell._callMainEvent(c,[a.cell])}else{var e=this.callEvent(c,[a.cell])}a=null;return e};dhtmlXWindows.prototype._winInitFRM=function(e){if(this.conf.fr_cover!=true){return}var a=this.w[e];var c=document.createElement("IFRAME");c.className="dhxwin_main_fr_cover";c.border=0;c.frameBorder=0;c.style.zIndex=a.win.style.zIndex;a.win.parentNode.insertBefore(c,a.win);a.fr_m_cover=c;c=null};dhtmlXWindows.prototype._winAdjustFRMSize=function(c){var a=this.w[c];if(a.fr_m_cover!=null){a.fr_m_cover.style.width=a.conf.w+"px";a.fr_m_cover.style.height=a.conf.h+"px"}a=null};dhtmlXWindows.prototype._winAdjustFRMPosition=function(c){var a=this.w[c];if(a.fr_m_cover!=null){a.fr_m_cover.style.left=a.win.style.left;a.fr_m_cover.style.top=a.win.style.top}a=null};dhtmlXWindows.prototype._winAdjustFRMZIndex=function(c){var a=this.w[c];if(a.fr_m_cover!=null){a.fr_m_cover.style.zIndex=a.win.style.zIndex}a=null};function dhtmlXWindowsCell(h,g){dhtmlXCellObject.apply(this,[h,"_wins"]);this.wins=g;this.cell._winId=h;this.conf.skin=this.wins.conf.skin;this.attachEvent("_onCellUnload",function(){if(this._unloadResize){this._unloadResize()}window.dhx4._eventable(this.cell,"clear");this.cell._winId=null;this.wins=null;this.setText=null;this.getText=null;this.allowMove=null;this.denyMove=null;this.isMovable=null;this.allowResize=null;this.denyResize=null;this.isResizable=null;this.maximize=null;this.minimize=null;this.isMaximized=null;this.setPosition=null;this.getPosition=null;this.adjustPosition=null;this.park=null;this.isParked=null;this.allowPark=null;this.denyPark=null;this.isParkable=null;this.show=null;this.hide=null;this.isHidden=null;this.stick=null;this.unstick=null;this.isSticked=null;this.setDimension=null;this.getDimension=null;this.setMinDimension=null;this.getMinDimension=null;this.setMaxDimension=null;this.getMaxDimension=null;this.keepInViewport=null;this.center=null;this.centerOnScreen=null;this.bringToTop=null;this.bringToBottom=null;this.isOnTop=null;this.isOnBottom=null;this.showHeader=null;this.hideHeader=null;this.setModal=null;this.isModal=null;this.close=null;this._adjustByCont=null;this.button=null;this.addUserButton=null;this.removeUserButton=null;e=null});this.attachEvent("_onContentLoaded",function(){this.wins._callMainEvent("onContentLoaded",this._idd)});this.attachEvent("_onContentMouseDown",function(l,a){this.wins.callEvent("_winMouseDown",[a,{id:l,mode:"win"}])});this._callMainEvent=function(l,a){return this.callEvent(l,a)};this.conf.tr={};for(var c in this.wins.conf.tr){this.conf.tr[c]=this.wins.conf.tr[c]}if(this.conf.tr.prop!=false){}if(this._initResize){this._initResize()}window.dhx4._eventable(this.cell);var e=this;this.cell.attachEvent("_setCellSize",function(a,n){var l=e.wins.w[this._winId].conf.w-e.conf.size.w;var m=e.wins.w[this._winId].conf.h-e.conf.size.h;e.setDimension(a+l,n+m)});return this}dhtmlXWindowsCell.prototype=new dhtmlXCellObject();dhtmlXWindowsCell.prototype.setText=function(a){this.wins.w[this._idd].conf.text=a;this.wins.w[this._idd].hdr.childNodes[1].firstChild.innerHTML=a};dhtmlXWindowsCell.prototype.getText=function(){return this.wins.w[this._idd].conf.text};dhtmlXWindowsCell.prototype.allowMove=function(){this.wins.w[this._idd].conf.allow_move=true};dhtmlXWindowsCell.prototype.denyMove=function(){this.wins.w[this._idd].conf.allow_move=false};dhtmlXWindowsCell.prototype.isMovable=function(){return(this.wins.w[this._idd].conf.allow_move==true)};dhtmlXWindowsCell.prototype.allowResize=function(){this.wins.w[this._idd].conf.allow_resize=true;this.wins.w[this._idd].b.minmax.enable()};dhtmlXWindowsCell.prototype.denyResize=function(){this.wins.w[this._idd].conf.allow_resize=false;this.wins.w[this._idd].b.minmax.disable()};dhtmlXWindowsCell.prototype.isResizable=function(){return(this.wins.w[this._idd].conf.allow_resize==true)};dhtmlXWindowsCell.prototype.maximize=function(){this.wins._winMinmax(this._idd,true)};dhtmlXWindowsCell.prototype.minimize=function(){this.wins._winMinmax(this._idd,false)};dhtmlXWindowsCell.prototype.isMaximized=function(){return(this.wins.w[this._idd].conf.maxed==true)};dhtmlXWindowsCell.prototype.setPosition=function(a,c){this.wins._winSetPosition(this._idd,a,c)};dhtmlXWindowsCell.prototype.getPosition=function(){var a=this.wins.w[this._idd];var c=[a.conf.x,a.conf.y];a=null;return c};dhtmlXWindowsCell.prototype.adjustPosition=function(){this.wins._winAdjustPosition(this._idd)};dhtmlXWindowsCell.prototype.park=function(){this.wins._winPark(this._idd,true)};dhtmlXWindowsCell.prototype.isParked=function(){return(this.wins.w[this._idd].conf.parked==true)};dhtmlXWindowsCell.prototype.allowPark=function(){this.wins.w[this._idd].conf.allow_park=true;this.wins.w[this._idd].b.park.enable()};dhtmlXWindowsCell.prototype.denyPark=function(){this.wins.w[this._idd].conf.allow_park=false;this.wins.w[this._idd].b.park.disable()};dhtmlXWindowsCell.prototype.isParkable=function(){return(this.wins.w[this._idd].conf.allow_park==true)};dhtmlXWindowsCell.prototype.show=function(a){this.wins._winShow(this._idd,window.dhx4.s2b(a))};dhtmlXWindowsCell.prototype.hide=function(){this.wins._winHide(this._idd)};dhtmlXWindowsCell.prototype.isHidden=function(){return(this.wins.w[this._idd].conf.visible!=true)};dhtmlXWindowsCell.prototype.stick=function(){this.wins._winStick(this._idd,true)};dhtmlXWindowsCell.prototype.unstick=function(){this.wins._winStick(this._idd,false)};dhtmlXWindowsCell.prototype.isSticked=function(){return(this.wins.w[this._idd].conf.sticked==true)};dhtmlXWindowsCell.prototype.setDimension=function(e,a){var c=this.wins.w[this._idd];if(c.conf.parked){this.wins._winPark(this._idd,false)}if(c.conf.maxed){if(e!=null){c.conf.lastMW=e}if(a!=null){c.conf.lastMH=a}this.wins._winMinmax(this._idd)}else{this.wins._winSetSize(this._idd,e,a,false,true)}c=null};dhtmlXWindowsCell.prototype.getDimension=function(){var a=this.wins.w[this._idd];var c=[a.conf.w,a.conf.h];a=null;return c};dhtmlXWindowsCell.prototype.setMinDimension=function(e,a){var c=this.wins.w[this._idd];c.conf.min_w=e;c.conf.min_h=a;this.wins._winSetSize(this._idd,c.conf.w,c.conf.h);c=null};dhtmlXWindowsCell.prototype.getMinDimension=function(){var a=this.wins.w[this._idd];var c=[a.conf.min_w,a.conf.min_h];a=null;return c};dhtmlXWindowsCell.prototype.setMaxDimension=function(e,a){var c=this.wins.w[this._idd];c.conf.max_w=e;c.conf.max_h=a;this.wins._winSetSize(this._idd,c.conf.w,c.conf.h);c=null};dhtmlXWindowsCell.prototype.getMaxDimension=function(){var a=this.wins.w[this._idd];var c=[a.conf.max_w,a.conf.max_h];a=null;return c};dhtmlXWindowsCell.prototype.keepInViewport=function(a){this.wins.w[this._idd].conf.keep_in_vp=window.dhx4.s2b(a)};dhtmlXWindowsCell.prototype.center=function(){var e=this.wins.vp;var c=this.wins.w[this._idd];var a=Math.round((e.clientWidth-c.conf.w)/2);var g=Math.round((e.clientHeight-c.conf.h)/2);this.wins._winSetPosition(this._idd,a,g);e=c=null};dhtmlXWindowsCell.prototype.centerOnScreen=function(){var c=this.wins.w[this._idd];var l=window.dhx4.screenDim();var h=window.dhx4.absLeft(this.wins.vp);var g=window.dhx4.absTop(this.wins.vp);var e=this.wins.vp.parentNode;while(e!=null){if(e.scrollLeft){h=h-e.scrollLeft}if(e.scrollTop){g=g-e.scrollTop}e=e.parentNode}var a=Math.round((l.right-l.left-c.conf.w)/2);var m=Math.round((l.bottom-l.top-c.conf.h)/2);this.wins._winAdjustPosition(this._idd,a-h,m-g);d=c=null};dhtmlXWindowsCell.prototype.bringToTop=function(){this.wins._winMakeActive(this._idd,true)};dhtmlXWindowsCell.prototype.bringToBottom=function(){var a=(this.wins.w[this._idd].conf.actv?null:this.wins.conf.last_active);window.dhx4.zim.clear(this.wins.w[this._idd].conf.z_id);this.wins.w[this._idd].win.style.zIndex=0;this.wins._winMakeActive(a,true)};dhtmlXWindowsCell.prototype.isOnTop=function(){return(this.wins.w[this._idd].conf.actv==true)};dhtmlXWindowsCell.prototype.isOnBottom=function(){var e={id:null,z:+Infinity};for(var c in this.wins.w){if(this.wins.w[c].conf.visible&&this.wins.w[c].win.style.zIndex<e.z){e.id=c;e.z=this.wins.w[c].win.style.zIndex}}return(e.id==this._idd)};dhtmlXWindowsCell.prototype.showHeader=function(){var a=this.wins.w[this._idd];if(a.conf.header==false){a.hdr.className=String(a.hdr.className).replace(/\s{0,}dhxwin_hdr_hidden/gi,"");a.brd.className=String(a.brd.className).replace(/\s{0,}dhxwin_hdr_hidden/gi,"");this.conf.cells_cont=null;a.conf.brd=null;a.conf.header=true;this.wins._winAdjustCell(this._idd)}a=null};dhtmlXWindowsCell.prototype.hideHeader=function(){var a=this.wins.w[this._idd];if(a.conf.header==true){if(a.conf.parked){this.wins._winPark(this._idd,false)}a.hdr.className+=" dhxwin_hdr_hidden";a.brd.className+=" dhxwin_hdr_hidden";this.conf.cells_cont=null;a.conf.brd=null;a.conf.header=false;this.wins._winAdjustCell(this._idd)}a=null};dhtmlXWindowsCell.prototype.setModal=function(a){this.wins._winSetModal(this._idd,window.dhx4.s2b(a))};dhtmlXWindowsCell.prototype.isModal=function(){return(this.wins.w[this._idd].conf.modal==true)};dhtmlXWindowsCell.prototype._adjustByCont=function(a,c){a+=this.wins.w[this._idd].conf.w-this.conf.size.w;c+=this.wins.w[this._idd].conf.h-this.conf.size.h;this.wins._winSetSize(this._idd,a,c)};dhtmlXWindowsCell.prototype.close=function(){this.wins._winClose(this._idd)};dhtmlXWindowsCell.prototype.setIconCss=function(a){this.wins.w[this._idd].hdr.firstChild.className="dhxwin_icon "+a;this.wins._winAdjustTitle(this._idd)};dhtmlXWindowsCell.prototype.setToFullScreen=function(c){c=window.dhx4.s2b(c);var a=this.wins.w[this._idd];if(a.conf.fs_mode==c){a=null;return}if(this.wins.fsn==null){this.wins.fsn=document.createElement("DIV");this.wins.fsn.className=this.wins.vp.className+" dhxwins_vp_fs";document.body.appendChild(this.wins.fsn)}if(c){this.wins.fsn.appendChild(a.win);this.maximize();this.hideHeader()}else{this.wins.vp.appendChild(a.win);this.minimize();this.showHeader();if(this.wins.fsn.childNodes.length==0){this.wins.fsn.parentNode.removeChild(this.wins.fsn);this.wins.fsn=null}}a.conf.fs_mode=c;a=null};dhtmlXWindowsCell.prototype.button=function(a){if(a=="minmax1"||a=="minmax2"){a="minmax"}return this.wins.w[this._idd].b[a]};dhtmlXWindowsCell.prototype.addUserButton=function(m,l,e){var a=new dhtmlXWindowsButton(this.wins,this._idd,m,e,true);var g=null;var c=this.wins.w[this._idd].hdr.lastChild;if(isNaN(l)){l=0}else{if(l<0){l=0}}if(c.childNodes[l]!=null){g=c.childNodes[l]}if(g!=null){c.insertBefore(a.button,g)}else{c.appendChild(a.button)}this.wins.w[this._idd].b[m]=a;a=g=c=null;this.wins._winAdjustTitle(this._idd)};dhtmlXWindowsCell.prototype.removeUserButton=function(a){if(this.wins.w[this._idd].b[a]==null||this.wins.w[this._idd].b[a].conf.custom!=true){return}this.wins._winRemoveButton(this._idd,a)};window.dhtmlXWindowsButton=function(h,c,a,g,e){this.conf={wins:h,winId:c,name:a,enabled:true,visible:true,custom:true};this.button=document.createElement("DIV");this.button._buttonName=a;this.button.title=g;this.enable=function(){this.conf.enabled=true;this.setCss(this.conf.css)};this.disable=function(){this.conf.enabled=false;this.setCss(this.conf.css)};this.isEnabled=function(){return(this.conf.enabled==true)};this.show=function(){this.button.style.display="";this.conf.visible=true;this.conf.wins._winAdjustTitle(this.conf.winId)};this.hide=function(){this.button.style.display="none";this.conf.visible=false;this.conf.wins._winAdjustTitle(this.conf.winId)};this.isHidden=function(){return(this.conf.visible==false)};this.setCss=function(m){this.conf.css=m;var l=(this.conf.enabled?"":"_dis");this.button.className="dhxwin_button"+l+" dhxwin_button_"+this.conf.css+l};this._doOnClick=function(l){return this.callEvent("onClick",[this.conf.wins.w[this.conf.winId].cell,this])};this.unload=function(l){dhx4._eventable(this,"clear");this.button._buttonName=null;this.button.parentNode.removeChild(this.button);if(this.conf.wins.cm!=null&&this.conf.wins.cm.button[this.conf.winId]!=null&&this.conf.wins.cm.button[this.conf.winId][this.conf.name]!=null){this.conf.wins._detachContextMenu("button",this.conf.winId,this.conf.name)}this.button=null;this.enable=null;this.disable=null;this.isEnabled=null;this.show=null;this.hide=null;this.isHidden=null;this.setCss=null;this.unload=null;if(l!=true){this.conf.wins._winAdjustTitle(this.conf.winId)}this.conf.wins=null;this.conf.winId=null;this.conf=null};this.setCss(a);dhx4._eventable(this);return this};dhtmlXWindows.prototype._winButtonClick=function(e,a,c){if(!this.w[e].b[a].isEnabled()){return true}if(this.w[e].b[a]._doOnClick()!==true){return}if(a=="help"){this._callMainEvent("onHelp",e)}if(a=="park"){this._winPark(e,true)}if(a=="minmax"){this._winMinmax(e)}if(a=="stick"){this._winStick(e);return false}if(a=="close"){this._winClose(e);return false}return true};dhtmlXWindows.prototype._winRemoveButton=function(e,a,c){this.w[e].b[a].unload(c);this.w[e].b[a]=null;delete this.w[e].b[a]};dhtmlXWindows.prototype._dndInitModule=function(){var a=this;this.conf.dnd_enabled=true;this.conf.dnd_tm=null;this.conf.dnd_time=0;this._dndOnMouseDown=function(h,l){if(a.conf.dblclick_active){return}if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}if(a._callMainEvent("onBeforeMoveStart",l)!==true){return}a.conf.dnd={id:l,x:a._dndPos(h,"X"),y:a._dndPos(h,"Y"),ready:true,css:false,css_touch:false,css_vp:false,tr:null,mode:"def",moved:false,prevent:false};if(a.w[l].conf.keep_in_vp){a.conf.dnd.minX=0;a.conf.dnd.maxX=a.vp.clientWidth-a.w[l].conf.w;a.conf.dnd.minY=0;a.conf.dnd.maxY=a.vp.clientHeight-a.w[l].conf.h}else{a.conf.dnd.minX=-a.w[l].conf.w+a.conf.vp_pos_ofs;a.conf.dnd.maxX=a.vp.clientWidth-a.conf.vp_pos_ofs;a.conf.dnd.minY=0;a.conf.dnd.maxY=a.vp.clientHeight-a.conf.vp_pos_ofs}var c=["MozTransform","WebkitTransform","OTransform","msTransform","transform"];for(var g=0;g<c.length;g++){if(document.documentElement.style[c[g]]!=null&&a.conf.dnd.tr==null){a.conf.dnd.tr=c[g];a.conf.dnd.mode="tr"}}if(a.conf.dnd.mode=="tr"){a.w[l].win.style[a.conf.dnd.tr]="translate(0px,0px)"}if(window.dhx4.dnd._mTouch(h)==false&&h.type==window.dhx4.dnd.evs.start){if(a.conf.dnd.css_touch==false){a.w[l].win.className+=" dhxwin_dnd_touch";a.conf.dnd.css_touch=true}if(a.conf.dnd.css_vp==false){a.vp.className+=" dhxwins_vp_dnd";a.conf.dnd.css_vp=true}}else{a._dndInitEvents()}};this._dndOnMouseMove=function(l){l=l||event;var h=a.conf.dnd;var c=a._dndPos(l,"X")-h.x;var m=a._dndPos(l,"Y")-h.y;if(l.type==window.dhx4.dnd.evs.move){if(h.moved!=true&&(Math.abs(c)>20||Math.abs(m)>20)){if(a.conf.dnd_tm!=null){window.clearTimeout(a.conf.dnd_tm);a.conf.dnd_tm=null}window.removeEventListener(window.dhx4.dnd.evs.start,a._dndOnMouseMove,false);return}}if(h.ready!=true){return}var g=a.w[h.id];if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}if(h.css!=true){if(h.css_touch==false){g.win.className+=" dhxwin_dnd"}g.fr_cover.className+=" dhxwin_fr_cover_dnd";h.css=true}if(h.css_vp!=true){a.vp.className+=" dhxwins_vp_dnd";h.css_vp=true}h.newX=g.conf.x+c;h.newY=g.conf.y+m;if(h.mode=="tr"){h.newX=Math.min(Math.max(h.newX,h.minX),h.maxX);c=h.newX-g.conf.x;h.newY=Math.min(Math.max(h.newY,h.minY),h.maxY);m=h.newY-g.conf.y;g.win.style[h.tr]="translate("+c+"px,"+m+"px)"}else{if(h.newX<h.minX||h.newX>h.maxX){h.newX=Math.min(Math.max(h.newX,h.minX),h.maxX)}else{h.x=a._dndPos(l,"X")}if(h.newY<h.minY||h.newY>h.maxY){h.newY=Math.min(Math.max(h.newY,h.minY),h.maxY)}else{h.y=a._dndPos(l,"Y")}a._winSetPosition(h.id,h.newX,h.newY)}h.moved=true;g=h=null};this._dndOnMouseUp=function(h){h=h||event;if(a.conf.dnd!=null){var g=a.conf.dnd;var c=a.w[g.id];if(g.newX!=null){if(g.mode=="tr"){a._winSetPosition(g.id,g.newX,g.newY);c.win.style[g.tr]="translate(0px,0px)"}}if(g.css==true){if(g.css_touch==false){c.win.className=String(c.win.className).replace(/\s{0,}dhxwin_dnd/gi,"")}c.fr_cover.className=String(c.fr_cover.className).replace(/\s{0,}dhxwin_fr_cover_dnd/gi,"")}if(g.css_touch==true){c.win.className=String(c.win.className).replace(/\s{0,}dhxwin_dnd_touch/gi,"")}if(g.css_vp==true){a.vp.className=String(a.vp.className).replace(/\s{0,}dhxwins_vp_dnd/gi,"")}a._dndUnloadEvents();if(g.moved==true){a._callMainEvent("onMoveFinish",g.id)}else{a._callMainEvent("onMoveCancel",g.id)}c=g=a.conf.dnd=null}if(window.dhx4.dnd.p_en==true&&h.type==window.dhx4.dnd.evs.end){window.dhx4.dnd._touchOn();window.removeEventListener(window.dhx4.dnd.evs.end,a._dndOnMouseUp,false);window.removeEventListener(window.dhx4.dnd.evs.move,a._dndOnMouseMove,false);if(a.conf.dnd_tm!=null){window.clearTimeout(a.conf.dnd_tm)}a.conf.dnd_tm=null}};this._dndOnSelectStart=function(c){c=c||event;if(c.preventDefault){c.preventDefault()}else{c.returnValue=false}return false};this._dndInitEvents=function(){if(typeof(window.addEventListener)=="function"){window.addEventListener("mousemove",this._dndOnMouseMove,false);window.addEventListener("mouseup",this._dndOnMouseUp,false);window.addEventListener("selectstart",this._dndOnSelectStart,false)}else{document.body.attachEvent("onmousemove",this._dndOnMouseMove);document.body.attachEvent("onmouseup",this._dndOnMouseUp);document.body.attachEvent("onselectstart",this._dndOnSelectStart)}};this._dndUnloadEvents=function(){if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",this._dndOnMouseMove,false);window.removeEventListener("mouseup",this._dndOnMouseUp,false);window.removeEventListener("selectstart",this._dndOnSelectStart,false)}else{document.body.detachEvent("onmousemove",this._dndOnMouseMove);document.body.detachEvent("onmouseup",this._dndOnMouseUp);document.body.detachEvent("onselectstart",this._dndOnSelectStart)}};this._dndUnloadModule=function(){this.detachEvent(this.conf.dnd_evid);this.conf.dnd_evid=null;this._dndOnMouseDown=null;this._dndOnMouseMove=null;this._dndOnMouseUp=null;this._dndOnSelectStart=null;this._dndInitEvents=null;this._dndUnloadEvents=null;this._dndInitModule=null;this._dndUnloadModule=null;a=null};this._dndPos=function(e,c){var g=e[this.conf.dnd_ev_prefix+c];if((g==null||g==0)&&e.touches!=null){g=e.touches[0][this.conf.dnd_ev_prefix+c]}return g};this.conf.dnd_evid=this.attachEvent("_winMouseDown",function(g,c){if(this.w[c.id]==null||this.w[c.id].conf.allow_move!=true){return}if(g.type==window.dhx4.dnd.evs.start){if(c.mode=="hdr"){if(this.w[c.id].conf.maxed&&this.w[c.id].conf.max_w==null&&this.w[c.id].conf.max_h==null){return}this.conf.dnd_ev_prefix="page";this.conf.dnd={x:this._dndPos(g,"X"),y:this._dndPos(g,"Y")};if(this.conf.dnd_time<1){this._dndOnMouseDown(g,c.id)}else{if(this.conf.dnd_tm!=null){window.clearTimeout(this.conf.dnd_tm)}this.conf.dnd_tm=window.setTimeout(function(){a._dndOnMouseDown(g,c.id)},this.conf.dnd_time)}if(window.dhx4.dnd.p_en==true){window.dhx4.dnd._touchOff();window.addEventListener(window.dhx4.dnd.evs.end,this._dndOnMouseUp,false)}window.addEventListener(window.dhx4.dnd.evs.move,this._dndOnMouseMove,false)}return false}if(g.type==window.dhx4.dnd.evs.end){if(this.conf.dnd_tm!=null){window.clearTimeout(this.conf.dnd_tm);this.conf.dnd_tm=null}this._dndOnMouseUp(g);window.removeEventListener(window.dhx4.dnd.evs.move,this._dndOnMouseMove,false);return false}if(g.button>=2){return}this.conf.dnd_ev_prefix="client";if(!(c.mode=="hdr"&&g.type=="mousedown")){return}if(this.w[c.id].conf.maxed&&this.w[c.id].conf.max_w==null&&this.w[c.id].conf.max_h==null){return}if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}this._dndOnMouseDown(g,c.id);return false})};dhtmlXWindowsCell.prototype._initResize=function(){var a=this;var c=navigator.userAgent;this.conf.resize={b_width:6,c_type:(c.indexOf("MSIE 10.0")>0||c.indexOf("MSIE 9.0")>0||c.indexOf("MSIE 8.0")>0||c.indexOf("MSIE 7.0")>0||c.indexOf("MSIE 6.0")>0)};this._rOnCellMouseMove=function(n){if(a.wins.conf.resize_actv==true||a.wins.w[a._idd].conf.allow_resize==false||a.conf.progress==true||a.wins.w[a._idd].conf.maxed==true||a.wins.w[a._idd].conf.fs_mode==true){var l=a.wins.w[a._idd].brd;if(l.style.cursor!="default"){l.style.cursor="default"}l=null;return}n=n||event;var v=a.wins.w[a._idd].brd;var g=a.conf.resize;var q=(a.wins.w[a._idd].conf.header==false);var s=n.clientX;var o=n.clientY;var h=window.dhx4.absLeft(v);var u=window.dhx4.absTop(v);var m="";if(s<=h+g.b_width){m="w"}else{if(s>=h+v.offsetWidth-g.b_width){m="e"}}if(o>=u+v.offsetHeight-g.b_width){m="s"+m}else{if(q&&o<=u+g.b_width){m="n"+m}}if(m==""){m=false}if(g.mode!=m){g.mode=m;if(m==false){v.style.cursor="default"}else{v.style.cursor=m+"-resize"}}v=g=null};this._rOnCellMouseDown=function(m){if(a.conf.resize.mode==false){return}if(a.conf.progress==true){return}if(a.wins.w[a._idd].conf.allow_resize==false){return}if(a.wins.w[a._idd].conf.fs_mode==true){return}if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}if(a.wins._callMainEvent("onBeforeResizeStart",a._idd)!==true){return}var g=a.wins.w[a._idd];var l=a.conf.resize;a.wins.conf.resize_actv=true;l.min_w=g.conf.min_w;l.min_h=g.conf.min_h;l.max_w=g.conf.max_w||+Infinity;l.max_h=g.conf.max_h||+Infinity;if(g.cell.dataType=="layout"&&g.cell.dataObj!=null&&typeof(g.cell.dataObj._getWindowMinDimension)=="function"){var h=g.cell.dataObj._getWindowMinDimension(g.cell);l.min_w=Math.max(h.w,l.min_w);l.min_h=Math.max(h.h,l.min_h)}l.vp_l=a.wins.conf.vp_pos_ofs;l.vp_r=a.wins.vp.clientWidth-a.wins.conf.vp_pos_ofs;l.vp_b=a.wins.vp.clientHeight-a.wins.conf.vp_pos_ofs;l.x=m.clientX;l.y=m.clientY;if(typeof(window.addEventListener)=="function"){window.addEventListener("mousemove",a._rOnWinMouseMove,false);window.addEventListener("mouseup",a._rOnWinMouseUp,false);window.addEventListener("selectstart",a._rOnSelectStart,false)}else{document.body.attachEvent("onmousemove",a._rOnWinMouseMove);document.body.attachEvent("onmouseup",a._rOnWinMouseUp);document.body.attachEvent("onselectstart",a._rOnSelectStart)}l.resized=false;l.vp_cursor=a.wins.vp.style.cursor;a.wins.vp.style.cursor=l.mode+"-resize";g=l=null};this._rOnWinMouseMove=function(m){m=m||event;var h=a.wins.w[a._idd];var l=a.conf.resize;if(!l.resized){h.fr_cover.className+=" dhxwin_fr_cover_resize";l.resized=true}var g=m.clientX-l.x;var n=m.clientY-l.y;if(l.mode.indexOf("e")>=0){l.rw=Math.min(Math.max(h.conf.w+g,l.min_w),l.max_w);l.rx=null;if(h.conf.x+l.rw<l.vp_l){l.rw=l.vp_l-h.conf.x}else{if(h.conf.x+l.rw>a.wins.vp.clientWidth){l.rw=a.wins.vp.clientWidth-h.conf.x}}}else{if(l.mode.indexOf("w")>=0){l.rw=Math.min(Math.max(h.conf.w-g,l.min_w),l.max_w);l.rx=h.conf.x+h.conf.w-l.rw;if(l.rx<0){l.rw=l.rw+l.rx;l.rx=0}else{if(l.rx>l.vp_r){l.rw=l.rw-l.vp_r;l.rx=l.vp_r}}}}if(l.mode.indexOf("s")>=0){l.rh=Math.min(Math.max(h.conf.h+n,l.min_h),l.max_h);l.ry=null;if(h.conf.y+l.rh>a.wins.vp.clientHeight){l.rh=a.wins.vp.clientHeight-h.conf.y}}else{if(l.mode.indexOf("n")>=0){l.rh=Math.min(Math.max(h.conf.h-n,l.min_h),l.max_h);l.ry=h.conf.y+h.conf.h-l.rh;if(l.ry<0){l.rh=l.rh+l.ry;l.ry=0}else{if(l.ry>l.vp_b){l.rh=l.rh-l.vp_b;l.ry=l.vp_b}}}}a._rAdjustSizer();h=l=null};this._rOnWinMouseUp=function(){var g=a.conf.resize;var e=a.wins.w[a._idd];a.wins.conf.resize_actv=false;a.wins.vp.style.cursor=g.vp_cursor;e.fr_cover.className=String(e.fr_cover.className).replace(/\s{0,}dhxwin_fr_cover_resize/gi,"");if(g.resized){a.wins._winSetSize(a._idd,g.rw,g.rh);if(g.rx==null){g.rx=e.conf.x}if(g.ry==null){g.ry=e.conf.y}if(g.rx!=e.conf.x||g.ry!=e.conf.y){a.wins._winSetPosition(a._idd,g.rx,g.ry)}}if(g.obj!=null){g.obj.parentNode.removeChild(g.obj);g.obj=null}if(g.objFR!=null){g.objFR.parentNode.removeChild(g.objFR);g.objFR=null}if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",a._rOnWinMouseMove,false);window.removeEventListener("mouseup",a._rOnWinMouseUp,false);window.removeEventListener("selectstart",a._rOnSelectStart,false)}else{document.body.detachEvent("onmousemove",a._rOnWinMouseMove);document.body.detachEvent("onmouseup",a._rOnWinMouseUp);document.body.detachEvent("onselectstart",a._rOnSelectStart)}if(g.resized==true){if(a.dataType=="layout"&&a.dataObj!=null){a.dataObj.callEvent("onResize",[])}a.wins._callMainEvent("onResizeFinish",a._idd)}else{a.wins._callMainEvent("onResizeCancel",a._idd)}g.mode="";e=g=null};this._rOnSelectStart=function(g){g=g||event;if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false};this._rInitSizer=function(){var g=a.conf.resize;var e=a.wins.w[a._idd];g.obj=document.createElement("DIV");g.obj.className="dhxwin_resize";g.obj.style.zIndex=e.win.style.zIndex;g.obj.style.cursor=g.mode+"-resize";a.wins.vp.appendChild(g.obj);if(a.wins.conf.fr_cover==true){g.objFR=document.createElement("IFRAME");g.objFR.className="dhxwin_resize_fr_cover";g.objFR.style.zIndex=g.obj.style.zIndex;a.wins.vp.insertBefore(g.objFR,g.obj)}g.rx=e.conf.x;g.ry=e.conf.y;g.rw=e.conf.w;g.rh=e.conf.h;g=null};this._rAdjustSizer=function(){var e=a.conf.resize;if(!e.obj){this._rInitSizer()}e.obj.style.width=e.rw+"px";e.obj.style.height=e.rh+"px";if(e.rx!=null){e.obj.style.left=e.rx+"px"}if(e.ry!=null){e.obj.style.top=e.ry+"px"}if(e.objFR!=null){e.objFR.style.width=e.obj.style.width;e.objFR.style.height=e.obj.style.height;if(e.rx!=null){e.objFR.style.left=e.obj.style.left}if(e.ry!=null){e.objFR.style.top=e.obj.style.top}}e=null};if(typeof(window.addEventListener)=="function"){this.wins.w[this._idd].brd.addEventListener("mousemove",this._rOnCellMouseMove,false);this.wins.w[this._idd].brd.addEventListener("mousedown",this._rOnCellMouseDown,false)}else{this.wins.w[this._idd].brd.attachEvent("onmousemove",this._rOnCellMouseMove);this.wins.w[this._idd].brd.attachEvent("onmousedown",this._rOnCellMouseDown)}this._unloadResize=function(){if(typeof(window.addEventListener)=="function"){this.wins.w[this._idd].brd.removeEventListener("mousemove",this._rOnCellMouseMove,false);this.wins.w[this._idd].brd.removeEventListener("mousedown",this._rOnCellMouseDown,false)}else{this.wins.w[this._idd].brd.detachEvent("onmousemove",this._rOnCellMouseMove);this.wins.w[this._idd].brd.detachEvent("onmousedown",this._rOnCellMouseDown)}this._initResize=null;this._rOnCellMouseMove=null;this._rOnCellMouseDown=null;this._rOnWinMouseMove=null;this._rOnWinMouseUp=null;this._rOnSelectStart=null;this._rInitSizer=null;this._rAdjustSizer=null;this._unloadResize=null;this.conf.resize=null;a=null}};dhtmlXWindows.prototype.attachContextMenu=function(a){return this._renderContextMenu("icon",null,null,a)};dhtmlXWindows.prototype.getContextMenu=function(){if(this.cm!=null&&this.cm.global!=null){return this.cm.global}return null};dhtmlXWindows.prototype.detachContextMenu=function(){this._detachContextMenu("icon",null,null)};dhtmlXWindowsCell.prototype.attachContextMenu=function(a){return this.wins._renderContextMenu("icon",this._idd,null,a)};dhtmlXWindowsCell.prototype.getContextMenu=function(){if(this.wins.cm!=null&&this.wins.cm.icon[this._idd]!=null){return this.wins.cm.icon[this._idd]}return null};dhtmlXWindowsCell.prototype.detachContextMenu=function(){this.wins._detachContextMenu("icon",this._idd,null)};dhtmlXWindowsButton.prototype.attachContextMenu=function(a){return this.conf.wins._renderContextMenu("button",this.conf.winId,this.conf.name,a)};dhtmlXWindowsButton.prototype.getContextMenu=function(){if(this.conf.wins.cm==null||this.conf.wins.cm.button[this.conf.winId]==null){return null}if(this.conf.wins.cm.button[this.conf.winId][this.conf.name]!=null){return this.conf.wins.cm.button[this.conf.winId][this.conf.name]}return null};dhtmlXWindowsButton.prototype.detachContextMenu=function(){this.conf.wins._detachContextMenu("button",this.conf.winId,this.conf.name)};dhtmlXWindows.prototype._renderContextMenu=function(m,l,e,c){var g=this;var a=false;if(this.cm==null){this.cm={global:null,icon:{},button:{}};a=true}if(l==null){if(this.cm.global!=null){return}}else{if(m=="icon"){if(this.cm.icon[l]!=null){return}}else{if(m=="button"){if(this.cm.button[l]!=null&&this.cm.button[l][e]!=null){return}}}}if(c==null){c={}}c.parent=null;c.context=true;var h=new dhtmlXMenuObject(c);h.setAutoHideMode(false);h.attachEvent("onShow",function(){this.conf.wins_menu_open=true});h.attachEvent("onHide",function(){this.conf.wins_menu_open=false;g.conf.opened_menu=null});if(l==null){this.cm.global=h}else{if(m=="icon"){this.cm.icon[l]=h}else{if(m=="button"){if(this.cm.button[l]==null){this.cm.button[l]={}}this.cm.button[l][e]=h}}}if(a){this._showContextMenu=function(r,q){if(r.button>=2){return}if(q.mode=="icon"&&q.id!=null&&q.press_type=="mousedown"){var s=this.cm.icon[q.id]||this.cm.global;if(s==null){return}r.cancelBubble=true;var o=this.w[q.id].hdr.firstChild;if(s.conf.wins_menu_open&&this.conf.opened_menu==q.id){s.hideContextMenu()}else{this._hideContextMenu();s.showContextMenu(window.dhx4.absLeft(o),window.dhx4.absTop(o)+o.offsetHeight);this.conf.opened_menu=q.id}s=o=null}if(q.mode=="button"&&q.id!=null&&q.press_type=="mousedown"){if(this.cm.button[q.id]==null||this.cm.button[q.id][q.button_name]==null){return}r.cancelBubble=true;this.conf.button_last=null;var s=this.cm.button[q.id][q.button_name];var n=this.w[q.id].b[q.button_name].button;if(s.conf.wins_menu_open&&this.conf.opened_menu==q.id){s.hideContextMenu()}else{this._hideContextMenu();s.showContextMenu(window.dhx4.absLeft(n),window.dhx4.absTop(n)+n.offsetHeight);this.conf.opened_menu=q.id}s=n=null}};this._hideContextMenu=function(s){if(s!=null){s=s||event;if(s.type=="keydown"&&s.keyCode!=27){return}var r=s.target||s.srcElement;var o=true;while(r!=null&&o==true){if(r.className!=null&&r.className.search(/SubLevelArea_Polygon/)>=0){o=false}else{r=r.parentNode}}}if(o||s==null){if(g.cm.global!=null){g.cm.global.hideContextMenu()}for(var q in g.cm.icon){if(g.cm.icon[q]!=null){g.cm.icon[q].hideContextMenu()}}for(var q in g.cm.button){for(var n in g.cm.button[q]){if(g.cm.button[q][n]!=null){g.cm.button[q][n].hideContextMenu()}}}}};this._detachContextMenu=function(q,o,n){if(this.cm==null){return}if(o==null){if(this.cm.global!=null){this.cm.global.unload();this.cm.global=null}}else{if(q=="icon"){if(this.cm.icon[o]!=null){this.cm.icon[o].unload();this.cm.icon[o]=null}}else{if(q=="button"){if(this.cm.button[o]!=null&&this.cm.button[o][n]!=null){this.cm.button[o][n].unload();this.cm.button[o][n]=null}}}}};this.attachEvent("_winMouseDown",this._showContextMenu);if(typeof(window.addEventListener)=="function"){window.addEventListener("mousedown",this._hideContextMenu,false);window.addEventListener("keydown",this._hideContextMenu,false)}else{document.body.attachEvent("onmousedown",this._hideContextMenu);document.body.attachEvent("onkeydown",this._hideContextMenu)}this._unloadContextMenu=function(){this._detachContextMenu("icon",null,null);this.cm=null;if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousedown",this._hideContextMenu,false);window.removeEventListener("keydown",this._hideContextMenu,false)}else{document.body.detachEvent("onmousedown",this._hideContextMenu);document.body.detachEvent("onkeydown",this._hideContextMenu)}g=null}}return h};if(!window.dhtmlx){window.dhtmlx={}}(function(){var q=null;function s(y,w){var x=y.callback;r(false);y.box.parentNode.removeChild(y.box);q=y.box=null;if(x){x(w)}}function a(x){if(q){x=x||event;var w=x.which||event.keyCode;if(dhtmlx.message.keyboard){if(w==13||w==32){s(q,true)}if(w==27){s(q,false)}}if(x.preventDefault){x.preventDefault()}return !(x.cancelBubble=true)}}if(document.attachEvent){document.attachEvent("onkeydown",a)}else{document.addEventListener("keydown",a,true)}function r(x){if(!r.cover){r.cover=document.createElement("DIV");r.cover.onkeydown=a;r.cover.className="dhx_modal_cover";document.body.appendChild(r.cover)}var w=document.body.scrollHeight;r.cover.style.display=x?"inline-block":"none"}function l(x,w){return"<div class='dhtmlx_popup_button' result='"+w+"' ><div>"+x+"</div></div>"}function e(x){if(!u.area){u.area=document.createElement("DIV");u.area.className="dhtmlx_message_area";u.area.style[u.position]="5px";document.body.appendChild(u.area)}u.hide(x.id);var w=document.createElement("DIV");w.innerHTML="<div>"+x.text+"</div>";w.className="dhtmlx-info dhtmlx-"+x.type;w.onclick=function(){if(x){u.hide(x.id)}x=null};if(u.position=="bottom"&&u.area.firstChild){u.area.insertBefore(w,u.area.firstChild)}else{u.area.appendChild(w)}if(x.expire>0){u.timers[x.id]=window.setTimeout(function(){u.hide(x.id)},x.expire)}u.pull[x.id]=w;w=null;return x.id}function m(x,A,E){var D=document.createElement("DIV");D.className=" dhtmlx_modal_box dhtmlx-"+x.type;D.setAttribute("dhxbox",1);var w="";if(x.width){D.style.width=x.width}if(x.height){D.style.height=x.height}if(x.title){w+='<div class="dhtmlx_popup_title">'+x.title+"</div>"}w+='<div class="dhtmlx_popup_text"><span>'+(x.content?"":x.text)+'</span></div><div  class="dhtmlx_popup_controls">';if(A){w+=l(x.ok||"OK",true)}if(E){w+=l(x.cancel||"Cancel",false)}if(x.buttons){for(var y=0;y<x.buttons.length;y++){w+=l(x.buttons[y],y)}}w+="</div>";D.innerHTML=w;if(x.content){var C=x.content;if(typeof C=="string"){C=document.getElementById(C)}if(C.style.display=="none"){C.style.display=""}D.childNodes[x.title?1:0].appendChild(C)}D.onclick=function(I){I=I||event;var H=I.target||I.srcElement;if(!H.className){H=H.parentNode}if(H.className=="dhtmlx_popup_button"){var F=H.getAttribute("result");F=(F=="true")||(F=="false"?false:F);s(x,F)}};x.box=D;if(A||E){q=x}return D}function v(A,C,E){var D=A.tagName?A:m(A,C,E);if(!A.hidden){r(true)}document.body.appendChild(D);var w=A.left||Math.abs(Math.floor(((window.innerWidth||document.documentElement.offsetWidth)-D.offsetWidth)/2));var F=A.top||Math.abs(Math.floor(((window.innerHeight||document.documentElement.offsetHeight)-D.offsetHeight)/2));if(A.position=="top"){D.style.top="-3px"}else{D.style.top=F+"px"}D.style.left=w+"px";D.onkeydown=a;D.focus();if(A.hidden){dhtmlx.modalbox.hide(D)}return D}function o(w){return v(w,true,false)}function c(w){return v(w,true,true)}function h(w){return v(w)}function n(x,w,y){if(typeof x!="object"){if(typeof w=="function"){y=w;w=""}x={text:x,type:w,callback:y}}return x}function g(y,x,w,A){if(typeof y!="object"){y={text:y,type:x,expire:w,id:A}}y.id=y.id||u.uid();y.expire=y.expire||u.expire;return y}dhtmlx.alert=function(){var w=n.apply(this,arguments);w.type=w.type||"confirm";return o(w)};dhtmlx.confirm=function(){var w=n.apply(this,arguments);w.type=w.type||"alert";return c(w)};dhtmlx.modalbox=function(){var w=n.apply(this,arguments);w.type=w.type||"alert";return h(w)};dhtmlx.modalbox.hide=function(w){while(w&&w.getAttribute&&!w.getAttribute("dhxbox")){w=w.parentNode}if(w){w.parentNode.removeChild(w);r(false);q=null}};var u=dhtmlx.message=function(A,y,x,C){A=g.apply(this,arguments);A.type=A.type||"info";var w=A.type.split("-")[0];switch(w){case"alert":return o(A);case"confirm":return c(A);case"modalbox":return h(A);default:return e(A);break}};u.seed=(new Date()).valueOf();u.uid=function(){return u.seed++};u.expire=4000;u.keyboard=true;u.position="top";u.pull={};u.timers={};u.hideAll=function(){for(var w in u.pull){u.hide(w)}};u.hide=function(x){var w=u.pull[x];if(w&&w.parentNode){window.setTimeout(function(){w.parentNode.removeChild(w);w=null},2000);w.className+=" hidden";if(u.timers[x]){window.clearTimeout(u.timers[x])}delete u.pull[x]}}})();if(!window.dhx){dhx={}}dhx.assert=function(c,a){if(!c){dhx.assert_error(a)}};dhx.assert_error=function(message){dhx.log("error",message);if(dhx.message&&typeof message=="string"){dhx.message({type:"debug",text:message,expire:-1})}if(dhx.debug!==false){eval("debugger;")}};dhx.assert_core_ready=function(){if(window.dhx_on_core_ready){dhx_on_core_ready()}};dhx.codebase="./";dhx.name="Core";dhx.clone=function(c){var a=dhx.clone._function;a.prototype=c;return new a()};dhx.clone._function=function(){};dhx.extend=function(e,c,a){dhx.assert(e,"Invalid mixing target");dhx.assert(c,"Invalid mixing source");if(e._dhx_proto_wait){dhx.PowerArray.insertAt.call(e._dhx_proto_wait,c,1);return e}for(var g in c){if(!e[g]||a){e[g]=c[g]}}if(c.defaults){dhx.extend(e.defaults,c.defaults)}if(c.$init){c.$init.call(e)}return e};dhx.copy=function(a){dhx.assert(a,"Invalid mixing target");if(arguments.length>1){var c=arguments[0];a=arguments[1]}else{var c=(dhx.isArray(a)?[]:{})}for(var e in a){if(a[e]&&typeof a[e]=="object"&&!dhx.isDate(a[e])){c[e]=(dhx.isArray(a[e])?[]:{});dhx.copy(c[e],a[e])}else{c[e]=a[e]}}return c};dhx.single=function(e){var a=null;var c=function(g){if(!a){a=new e({})}if(a._reinit){a._reinit.apply(a,arguments)}return a};return c};dhx.protoUI=function(){if(dhx.debug_proto){dhx.log("UI registered: "+arguments[0].name)}var e=arguments;var a=e[0].name;var c=function(h){if(!c){return dhx.ui[a].prototype}var m=c._dhx_proto_wait;if(m){var l=[m[0]];for(var g=1;g<m.length;g++){l[g]=m[g];if(l[g]._dhx_proto_wait){l[g]=l[g].call(dhx,l[g].name)}if(l[g].prototype&&l[g].prototype.name){dhx.ui[l[g].prototype.name]=l[g]}}dhx.ui[a]=dhx.proto.apply(dhx,l);if(c._dhx_type_wait){for(var g=0;g<c._dhx_type_wait.length;g++){dhx.Type(dhx.ui[a],c._dhx_type_wait[g])}}c=m=null}if(this!=dhx){return new dhx.ui[a](h)}else{return dhx.ui[a]}};c._dhx_proto_wait=Array.prototype.slice.call(arguments,0);return dhx.ui[a]=c};dhx.proto=function(){if(dhx.debug_proto){dhx.log("Proto chain:"+arguments[0].name+"["+arguments.length+"]")}var l=arguments;var h=l[0];var c=!!h.$init;var n=[];dhx.assert(h,"Invalid mixing target");for(var g=l.length-1;g>0;g--){dhx.assert(l[g],"Invalid mixing source");if(typeof l[g]=="function"){l[g]=l[g].prototype}if(l[g].$init){n.push(l[g].$init)}if(l[g].defaults){var e=l[g].defaults;if(!h.defaults){h.defaults={}}for(var a in e){if(dhx.isUndefined(h.defaults[a])){h.defaults[a]=e[a]}}}if(l[g].type&&h.type){for(var a in l[g].type){if(!h.type[a]){h.type[a]=l[g].type[a]}}}for(var m in l[g]){if(!h[m]){h[m]=l[g][m]}}}if(c){n.push(h.$init)}h.$init=function(){for(var q=0;q<n.length;q++){n[q].apply(this,arguments)}};var o=function(q){this.$ready=[];dhx.assert(this.$init,"object without init method");this.$init(q);if(this._parseSettings){this._parseSettings(q,this.defaults)}for(var r=0;r<this.$ready.length;r++){this.$ready[r].call(this)}};o.prototype=h;h=l=null;return o};dhx.bind=function(c,a){return function(){return c.apply(a,arguments)}};dhx.require=function(c,n,m){if(typeof c!="string"){var l=c.length||0;var h=n;if(!l){for(var a in c){l++}n=function(){l--;if(l===0){h.apply(this,arguments)}};for(var a in c){dhx.require(a,n,m)}}else{n=function(){if(l){l--;dhx.require(c[c.length-l-1],n,m)}else{return h.apply(this,arguments)}};n()}return}if(dhx._modules[c]!==true){if(c.substr(-4)==".css"){var g=dhx.html.create("LINK",{type:"text/css",rel:"stylesheet",href:dhx.codebase+c});document.head.appendChild(g);if(n){n.call(m||window)}return}var e=arguments[4];if(!n){dhx.exec(dhx.ajax().sync().get(dhx.codebase+c).responseText);dhx._modules[c]=true}else{if(!dhx._modules[c]){dhx._modules[c]=[[n,m]];dhx.ajax(dhx.codebase+c,function(r){dhx.exec(r);var q=dhx._modules[c];dhx._modules[c]=true;for(var o=0;o<q.length;o++){q[o][0].call(q[o][1]||window,!o)}})}else{dhx._modules[c].push([n,m])}}}};dhx._modules={};dhx.exec=function(code){if(window.execScript){window.execScript(code)}else{window.eval(code)}};dhx.wrap=function(c,a){if(!c){return a}return function(){var e=c.apply(this,arguments);a.apply(this,arguments);return e}};dhx.isUndefined=function(c){return typeof c=="undefined"};dhx.delay=function(g,c,e,a){return window.setTimeout(function(){var h=g.apply(c,(e||[]));g=c=e=null;return h},a||1)};dhx.uid=function(){if(!this._seed){this._seed=(new Date).valueOf()}this._seed++;return this._seed};dhx.toNode=function(a){if(typeof a=="string"){return document.getElementById(a)}return a};dhx.toArray=function(a){return dhx.extend((a||[]),dhx.PowerArray,true)};dhx.toFunctor=function(str){return(typeof(str)=="string")?eval(str):str};dhx.isArray=function(a){return Array.isArray?Array.isArray(a):(Object.prototype.toString.call(a)==="[object Array]")};dhx.isDate=function(a){return a instanceof Date};dhx._events={};dhx.event=function(g,e,a,c){g=dhx.toNode(g);var h=dhx.uid();if(c){a=dhx.bind(a,c)}dhx._events[h]=[g,e,a];if(g.addEventListener){g.addEventListener(e,a,false)}else{if(g.attachEvent){g.attachEvent("on"+e,a)}}return h};dhx.eventRemove=function(c){if(!c){return}dhx.assert(this._events[c],"Removing non-existing event");var a=dhx._events[c];if(a[0].removeEventListener){a[0].removeEventListener(a[1],a[2],false)}else{if(a[0].detachEvent){a[0].detachEvent("on"+a[1],a[2])}}delete this._events[c]};dhx.log=function(c,e,a){if(arguments.length==1){e=c;c="log"}if(window.console&&console.log){c=c.toLowerCase();if(window.console[c]){window.console[c](e||"unknown error")}else{window.console.log(c+": "+e)}if(a){window.console.log(a)}}};dhx.log_full_time=function(a){dhx._start_time_log=new Date();dhx.log("Timing start ["+a+"]");window.setTimeout(function(){var c=new Date();dhx.log("Timing end ["+a+"]:"+(c.valueOf()-dhx._start_time_log.valueOf())/1000+"s")},1)};dhx.log_time=function(a){var e="_start_time_log"+a;if(!dhx[e]){dhx[e]=new Date();dhx.log("Info","Timing start ["+a+"]")}else{var c=new Date();dhx.log("Info","Timing end ["+a+"]:"+(c.valueOf()-dhx[e].valueOf())/1000+"s");dhx[e]=null}};dhx.debug_code=function(a){a.call(dhx)};dhx.EventSystem={$init:function(){if(!this._evs_events){this._evs_events={};this._evs_handlers={};this._evs_map={}}},blockEvent:function(){this._evs_events._block=true},unblockEvent:function(){this._evs_events._block=false},mapEvent:function(a){dhx.extend(this._evs_map,a,true)},on_setter:function(a){if(a){for(var c in a){if(typeof a[c]=="function"){this.attachEvent(c,a[c])}}}},callEvent:function(e,h){if(this._evs_events._block){return true}e=e.toLowerCase();var g=this._evs_events[e.toLowerCase()];var a=true;if(dhx.debug){dhx.log("info","["+this.name+"] event:"+e,h)}if(g){for(var c=0;c<g.length;c++){if(g[c].apply(this,(h||[]))===false){a=false}}}if(this._evs_map[e]&&!this._evs_map[e].callEvent(e,h)){a=false}return a},attachEvent:function(c,a,g){dhx.assert(a,"Invalid event handler for "+c);c=c.toLowerCase();g=g||dhx.uid();a=dhx.toFunctor(a);var e=this._evs_events[c]||dhx.toArray();e.push(a);this._evs_events[c]=e;this._evs_handlers[g]={f:a,t:c};return g},detachEvent:function(g){if(!this._evs_handlers[g]){return}var c=this._evs_handlers[g].t;var a=this._evs_handlers[g].f;var e=this._evs_events[c];e.remove(a);delete this._evs_handlers[g]},hasEvent:function(a){a=a.toLowerCase();return this._evs_events[a]?true:false}};dhx.extend(dhx,dhx.EventSystem);dhx.PowerArray={removeAt:function(c,a){if(c>=0){this.splice(c,(a||1))}},remove:function(a){this.removeAt(this.find(a))},insertAt:function(c,e){if(!e&&e!==0){this.push(c)}else{var a=this.splice(e,(this.length-e));this[e]=c;this.push.apply(this,a)}},find:function(c){for(var a=0;a<this.length;a++){if(c==this[a]){return a}}return -1},each:function(a,e){for(var c=0;c<this.length;c++){a.call((e||this),this[c])}},map:function(a,e){for(var c=0;c<this.length;c++){this[c]=a.call((e||this),this[c])}return this},filter:function(a,e){for(var c=0;c<this.length;c++){if(!a.call((e||this),this[c])){this.splice(c,1);c--}}return this}};dhx.env={};(function(){if(navigator.userAgent.indexOf("Mobile")!=-1){dhx.env.mobile=true}if(dhx.env.mobile||navigator.userAgent.indexOf("iPad")!=-1||navigator.userAgent.indexOf("Android")!=-1){dhx.env.touch=true}if(navigator.userAgent.indexOf("Opera")!=-1){dhx.env.isOpera=true}else{dhx.env.isIE=!!document.all;dhx.env.isFF=!document.all;dhx.env.isWebKit=(navigator.userAgent.indexOf("KHTML")!=-1);dhx.env.isSafari=dhx.env.isWebKit&&(navigator.userAgent.indexOf("Mac")!=-1)}if(navigator.userAgent.toLowerCase().indexOf("android")!=-1){dhx.env.isAndroid=true}dhx.env.transform=false;dhx.env.transition=false;var e={};e.names=["transform","transition"];e.transform=["transform","WebkitTransform","MozTransform","OTransform","msTransform"];e.transition=["transition","WebkitTransition","MozTransition","OTransition","msTransition"];var m=document.createElement("DIV");for(var h=0;h<e.names.length;h++){var g=e[e.names[h]];for(var c=0;c<g.length;c++){if(typeof m.style[g[c]]!="undefined"){dhx.env[e.names[h]]=g[c];break}}}m.style[dhx.env.transform]="translate3d(0,0,0)";dhx.env.translate=(m.style[dhx.env.transform])?"translate3d":"translate";var l="";var a=false;if(dhx.env.isOpera){l="-o-";a="O"}if(dhx.env.isFF){l="-Moz-"}if(dhx.env.isWebKit){l="-webkit-"}if(dhx.env.isIE){l="-ms-"}dhx.env.transformCSSPrefix=l;dhx.env.transformPrefix=a||(dhx.env.transformCSSPrefix.replace(/-/gi,""));dhx.env.transitionEnd=((dhx.env.transformCSSPrefix=="-Moz-")?"transitionend":(dhx.env.transformPrefix+"TransitionEnd"))})();dhx.env.svg=(function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")})();dhx.html={_native_on_selectstart:0,denySelect:function(){if(!dhx._native_on_selectstart){dhx._native_on_selectstart=document.onselectstart}document.onselectstart=dhx.html.stopEvent},allowSelect:function(){if(dhx._native_on_selectstart!==0){document.onselectstart=dhx._native_on_selectstart||null}dhx._native_on_selectstart=0},index:function(c){var a=0;while(c=c.previousSibling){a++}return a},_style_cache:{},createCss:function(e){var g="";for(var c in e){g+=c+":"+e[c]+";"}var a=this._style_cache[g];if(!a){a="s"+dhx.uid();this.addStyle("."+a+"{"+g+"}");this._style_cache[g]=a}return a},addStyle:function(c){var a=document.createElement("style");a.setAttribute("type","text/css");a.setAttribute("media","screen");if(a.styleSheet){a.styleSheet.cssText=c}else{a.appendChild(document.createTextNode(c))}document.getElementsByTagName("head")[0].appendChild(a)},create:function(c,a,e){a=a||{};var g=document.createElement(c);for(var h in a){g.setAttribute(h,a[h])}if(a.style){g.style.cssText=a.style}if(a["class"]){g.className=a["class"]}if(e){g.innerHTML=e}return g},getValue:function(a){a=dhx.toNode(a);if(!a){return""}return dhx.isUndefined(a.value)?a.innerHTML:a.value},remove:function(c){if(c instanceof Array){for(var a=0;a<c.length;a++){this.remove(c[a])}}else{if(c&&c.parentNode){c.parentNode.removeChild(c)}}},insertBefore:function(c,e,a){if(!c){return}if(e&&e.parentNode){e.parentNode.insertBefore(c,e)}else{a.appendChild(c)}},locate:function(c,h){if(c.tagName){var a=c}else{c=c||event;var a=c.target||c.srcElement}while(a){if(a.getAttribute){var g=a.getAttribute(h);if(g){return g}}a=a.parentNode}return null},offset:function(g){if(g.getBoundingClientRect){var m=g.getBoundingClientRect();var n=document.body;var c=document.documentElement;var a=window.pageYOffset||c.scrollTop||n.scrollTop;var h=window.pageXOffset||c.scrollLeft||n.scrollLeft;var l=c.clientTop||n.clientTop||0;var o=c.clientLeft||n.clientLeft||0;var q=m.top+a-l;var e=m.left+h-o;return{y:Math.round(q),x:Math.round(e)}}else{var q=0,e=0;while(g){q=q+parseInt(g.offsetTop,10);e=e+parseInt(g.offsetLeft,10);g=g.offsetParent}return{y:q,x:e}}},posRelative:function(a){a=a||event;if(!dhx.isUndefined(a.offsetX)){return{x:a.offsetX,y:a.offsetY}}else{return{x:a.layerX,y:a.layerY}}},pos:function(a){a=a||event;if(a.pageX||a.pageY){return{x:a.pageX,y:a.pageY}}var c=((dhx.env.isIE)&&(document.compatMode!="BackCompat"))?document.documentElement:document.body;return{x:a.clientX+c.scrollLeft-c.clientLeft,y:a.clientY+c.scrollTop-c.clientTop}},preventEvent:function(a){if(a&&a.preventDefault){a.preventDefault()}return dhx.html.stopEvent(a)},stopEvent:function(a){(a||event).cancelBubble=true;return false},addCss:function(c,a){c.className+=" "+a},removeCss:function(c,a){c.className=c.className.replace(RegExp(" "+a,"g"),"")}};dhx.ready=function(a){if(this._ready){a.call()}else{this._ready_code.push(a)}};dhx._ready_code=[];(function(){var a=document.getElementsByTagName("SCRIPT");dhx.assert(a.length,"Can't locate codebase");if(a.length){a=(a[a.length-1].getAttribute("src")||"").split("/");a.splice(a.length-1,1);dhx.codebase=a.slice(0,a.length).join("/")+"/"}dhx.event(window,"load",function(){dhx4.callEvent("onReady",[]);dhx.delay(function(){dhx._ready=true;for(var c=0;c<dhx._ready_code.length;c++){dhx._ready_code[c].call()}dhx._ready_code=[]})})})();dhx.locale=dhx.locale||{};dhx.assert_core_ready();dhx.ready(function(){dhx.event(document.body,"click",function(a){dhx4.callEvent("onClick",[a||event])})});(function(){var e={};var c=new RegExp("(\\r\\n|\\n)","g");var a=new RegExp('(\\")',"g");dhx.Template=function(h){if(typeof h=="function"){return h}if(e[h]){return e[h]}h=(h||"").toString();if(h.indexOf("->")!=-1){h=h.split("->");switch(h[0]){case"html":h=dhx.html.getValue(h[1]);break;case"http":h=new dhx.ajax().sync().get(h[1],{uid:dhx.uid()}).responseText;break;default:break}}h=(h||"").toString();h=h.replace(c,"\\n");h=h.replace(a,'\\"');h=h.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"');h=h.replace(/\{common\.([^}\(]*)\}/g,"\"+(common.$1||'')+\"");h=h.replace(/\{common\.([^\}\(]*)\(\)\}/g,'"+(common.$1?common.$1.apply(this, arguments):"")+"');h=h.replace(/\{obj\.([^}]*)\}/g,'"+(obj.$1)+"');h=h.replace("{obj}",'"+obj+"');h=h.replace(/#([^#'";, ]+)#/gi,'"+(obj.$1)+"');try{e[h]=Function("obj","common",'return "'+h+'";')}catch(g){dhx.assert_error("Invalid template:"+h)}return e[h]};dhx.Template.empty=function(){return""};dhx.Template.bind=function(g){return dhx.bind(dhx.Template(g),this)};dhx.Type=function(n,m){if(n._dhx_proto_wait){if(!n._dhx_type_wait){n._dhx_type_wait=[]}n._dhx_type_wait.push(m);return}if(typeof n=="function"){n=n.prototype}if(!n.types){n.types={"default":n.type};n.type.name="default"}var g=m.name;var l=n.type;if(g){l=n.types[g]=dhx.clone(m.baseType?n.types[m.baseType]:n.type)}for(var h in m){if(h.indexOf("template")===0){l[h]=dhx.Template(m[h])}else{l[h]=m[h]}}return g}})();dhx.Settings={$init:function(){this._settings=this.config={}},define:function(c,a){if(typeof c=="object"){return this._parseSeetingColl(c)}return this._define(c,a)},_define:function(c,a){var e=this[c+"_setter"];return this._settings[c]=e?e.call(this,a,c):a},_parseSeetingColl:function(e){if(e){for(var c in e){this._define(c,e[c])}}},_parseSettings:function(e,a){var c={};if(a){c=dhx.extend(c,a)}if(typeof e=="object"&&!e.tagName){dhx.extend(c,e,true)}this._parseSeetingColl(c)},_mergeSettings:function(a,e){for(var c in e){switch(typeof a[c]){case"object":a[c]=this._mergeSettings((a[c]||{}),e[c]);break;case"undefined":a[c]=e[c];break;default:break}}return a},debug_freid_c_id:true,debug_freid_a_name:true};dhx.ajax=function(a,c,e){if(arguments.length!==0){var g=new dhx.ajax();if(e){g.master=e}return g.get(a,null,c)}if(!this.getXHR){return new dhx.ajax()}return this};dhx.ajax.count=0;dhx.ajax.prototype={master:null,getXHR:function(){if(dhx.env.isIE){return new ActiveXObject("Microsoft.xmlHTTP")}else{return new XMLHttpRequest()}},send:function(h,o,m){var c=this.getXHR();if(!dhx.isArray(m)){m=[m]}if(typeof o=="object"){var l=[];for(var e in o){var n=o[e];if(n===null||n===dhx.undefined){n=""}l.push(e+"="+encodeURIComponent(n))}o=l.join("&")}if(o&&this.request==="GET"){h=h+(h.indexOf("?")!=-1?"&":"?")+o;o=null}c.open(this.request,h,!this._sync);if(this.request==="POST"){c.setRequestHeader("Content-type","application/x-www-form-urlencoded")}var g=this;c.onreadystatechange=function(){if(!c.readyState||c.readyState==4){if(dhx.debug_time){dhx.log_full_time("data_loading")}dhx.ajax.count++;if(m&&g){for(var a=0;a<m.length;a++){if(m[a]){var q=(m[a].success||m[a]);if(c.status>=400||(!c.status&&!c.responseText)){q=m[a].error}if(q){q.call((g.master||g),c.responseText,c.responseXML,c)}}}}if(g){g.master=null}m=g=null}};c.send(o||null);return c},get:function(a,e,c){if(arguments.length==2){c=e;e=null}this.request="GET";return this.send(a,e,c)},post:function(a,e,c){this.request="POST";return this.send(a,e,c)},put:function(a,e,c){this.request="PUT";return this.send(a,e,c)},del:function(a,e,c){this.request="DELETE";return this.send(a,e,c)},sync:function(){this._sync=true;return this},bind:function(a){this.master=a;return this}};dhx.send=function(e,c,m,l){var g=dhx.html.create("FORM",{target:(l||"_self"),action:e,method:(m||"POST")},"");for(var a in c){var h=dhx.html.create("INPUT",{type:"hidden",name:a,value:c[a]},"");g.appendChild(h)}g.style.display="none";document.body.appendChild(g);g.submit();document.body.removeChild(g)};dhx.AtomDataLoader={$init:function(a){this.data={};if(a){this._settings.datatype=a.datatype||"json";this.$ready.push(this._load_when_ready)}},_load_when_ready:function(){this._ready_for_data=true;if(this._settings.url){this.url_setter(this._settings.url)}if(this._settings.data){this.data_setter(this._settings.data)}},url_setter:function(a){if(!this._ready_for_data){return a}this.load(a,this._settings.datatype);return a},data_setter:function(a){if(!this._ready_for_data){return a}this.parse(a,this._settings.datatype);return true},debug_freid_c_datatype:true,debug_freid_c_dataFeed:true,load:function(a,c){if(a.$proxy){a.load(this,typeof c=="string"?c:"json");return}this.callEvent("onXLS",[]);if(typeof c=="string"){this.data.driver=dhx.DataDriver[c];c=arguments[2]}else{if(!this.data.driver){this.data.driver=dhx.DataDriver.json}}var e=[{success:this._onLoad,error:this._onLoadError}];if(c){if(dhx.isArray(c)){e.push.apply(e,c)}else{e.push(c)}}return dhx.ajax(a,e,this)},parse:function(c,a){this.callEvent("onXLS",[]);this.data.driver=dhx.DataDriver[a||"json"];this._onLoad(c,null)},_onLoad:function(m,c,a,e){var h=this.data.driver;var g=h.toObject(m,c);if(g){var l=h.getRecords(g)[0];this.data=(h?h.getDetails(l):m)}else{this._onLoadError(m,c,a)}this.callEvent("onXLE",[])},_onLoadError:function(e,a,c){this.callEvent("onXLE",[]);this.callEvent("onLoadError",arguments);dhx4.callEvent("onLoadError",[e,a,c,this])},_check_data_feed:function(c){if(!this._settings.dataFeed||this._ignore_feed||!c){return true}var a=this._settings.dataFeed;if(typeof a=="function"){return a.call(this,(c.id||c),c)}a=a+(a.indexOf("?")==-1?"?":"&")+"action=get&id="+encodeURIComponent(c.id||c);this.callEvent("onXLS",[]);dhx.ajax(a,function(l,g,e){this._ignore_feed=true;var h=dhx.DataDriver.toObject(l,g);if(h){this.setValues(h.getDetails(h.getRecords()[0]))}else{this._onLoadError(l,g,e)}this._ignore_feed=false;this.callEvent("onXLE",[])},this);return false}};dhx.DataDriver={};dhx.DataDriver.json={toObject:function(data){if(!data){data="[]"}if(typeof data=="string"){try{eval("dhx.temp="+data)}catch(e){dhx.assert_error(e);return null}data=dhx.temp}if(data.data){var t=data.data.config={};for(var key in data){if(key!="data"){t[key]=data[key]}}data=data.data}return data},getRecords:function(a){if(a&&!dhx.isArray(a)){return[a]}return a},getDetails:function(a){if(typeof a=="string"){return{id:dhx.uid(),value:a}}return a},getInfo:function(c){var a=c.config;if(!a){return{}}return{_size:(a.total_count||0),_from:(a.pos||0),_parent:(a.parent||0),_config:(a.config),_key:(a.dhx_security)}},child:"data"};dhx.DataDriver.html={toObject:function(c){if(typeof c=="string"){var a=null;if(c.indexOf("<")==-1){a=dhx.toNode(c)}if(!a){a=document.createElement("DIV");a.innerHTML=c}return a.getElementsByTagName(this.tag)}return c},getRecords:function(c){var e=[];for(var a=0;a<c.childNodes.length;a++){var g=c.childNodes[a];if(g.nodeType==1){e.push(g)}}return e},getDetails:function(a){return dhx.DataDriver.xml.tagToObject(a)},getInfo:function(a){return{_size:0,_from:0}},tag:"LI"};dhx.DataDriver.jsarray={toObject:function(data){if(typeof data=="string"){eval("dhx.temp="+data);return dhx.temp}return data},getRecords:function(a){return a},getDetails:function(e){var a={};for(var c=0;c<e.length;c++){a["data"+c]=e[c]}return a},getInfo:function(a){return{_size:0,_from:0}}};dhx.DataDriver.csv={toObject:function(a){return a},getRecords:function(a){return a.split(this.row)},getDetails:function(e){e=this.stringToArray(e);var a={};for(var c=0;c<e.length;c++){a["data"+c]=e[c]}return a},getInfo:function(a){return{_size:0,_from:0}},stringToArray:function(c){c=c.split(this.cell);for(var a=0;a<c.length;a++){c[a]=c[a].replace(/^[ \t\n\r]*(\"|)/g,"").replace(/(\"|)[ \t\n\r]*$/g,"")}return c},row:"\n",cell:","};dhx.DataDriver.xml={_isValidXML:function(a){if(!a||!a.documentElement){return null}if(a.getElementsByTagName("parsererror").length){return null}return a},toObject:function(e,a){if(this._isValidXML(c)){return c}if(typeof e=="string"){var c=this.fromString(e.replace(/^[\s]+/,""))}else{c=e}if(this._isValidXML(c)){return c}return null},getRecords:function(a){return this.xpath(a,this.records)},records:"/*/item",child:"item",config:"/*/config",getDetails:function(a){return this.tagToObject(a,{})},getInfo:function(c){var a=this.xpath(c,this.config);if(a.length){a=this.assignTypes(this.tagToObject(a[0],{}))}else{a=null}return{_size:(c.documentElement.getAttribute("total_count")||0),_from:(c.documentElement.getAttribute("pos")||0),_parent:(c.documentElement.getAttribute("parent")||0),_config:a,_key:(c.documentElement.getAttribute("dhx_security")||null)}},xpath:function(h,q){if(window.XPathResult){var g=h;if(h.nodeName.indexOf("document")==-1){h=h.ownerDocument}var n=[];var c=h.evaluate(q,g,null,XPathResult.ANY_TYPE,null);var o=c.iterateNext();while(o){n.push(o);o=c.iterateNext()}return n}else{var m=true;try{if(typeof(h.selectNodes)=="undefined"){m=false}}catch(l){}if(m){return h.selectNodes(q)}else{var a=q.split("/").pop();return h.getElementsByTagName(a)}}},assignTypes:function(c){for(var a in c){var e=c[a];if(typeof e=="object"){this.assignTypes(e)}else{if(typeof e=="string"){if(e===""){continue}if(e=="true"){c[a]=true}else{if(e=="false"){c[a]=false}else{if(e==e*1){c[a]=c[a]*1}}}}}}return c},tagToObject:function(e,o){o=o||{};var h=false;var g=e.attributes;if(g&&g.length){for(var m=0;m<g.length;m++){o[g[m].name]=g[m].value}h=true}var c=e.childNodes;var n={};for(var m=0;m<c.length;m++){if(c[m].nodeType==1){var l=c[m].tagName;if(typeof o[l]!="undefined"){if(!dhx.isArray(o[l])){o[l]=[o[l]]}o[l].push(this.tagToObject(c[m],{}))}else{o[c[m].tagName]=this.tagToObject(c[m],{})}h=true}}if(!h){return this.nodeValue(e)}o.value=o.value||this.nodeValue(e);return o},nodeValue:function(a){if(a.firstChild){return a.firstChild.data}return""},fromString:function(g){try{if(window.DOMParser){return(new DOMParser()).parseFromString(g,"text/xml")}if(window.ActiveXObject){var a=new ActiveXObject("Microsoft.xmlDOM");a.loadXML(g);return a}}catch(c){dhx.assert_error(c);return null}dhx.assert_error("Load from xml string is not supported")}};dhx.DataLoader=dhx.proto({$init:function(a){a=a||"";this._ajax_queue=dhx.toArray();this.data=new dhx.DataStore();this.data.attachEvent("onClearAll",dhx.bind(this._call_onclearall,this));this.data.attachEvent("onServerConfig",dhx.bind(this._call_on_config,this));this.data.feed=this._feed},_feed:function(e,a,c){if(this._load_count){return this._load_count=[e,a,c]}else{this._load_count=true}this._feed_last=[e,a];this._feed_common.call(this,e,a,c)},_feed_common:function(g,c,e){var a=this.data.url;if(g<0){g=0}this.load(a+((a.indexOf("?")==-1)?"?":"&")+(this.dataCount()?("continue=true&"):"")+"start="+g+"&count="+c,[this._feed_callback,e])},_feed_callback:function(){var a=this._load_count;var c=this._feed_last;this._load_count=false;if(typeof a=="object"&&(a[0]!=c[0]||a[1]!=c[1])){this.data.feed.apply(this,a)}},load:function(a,c){var e=dhx.AtomDataLoader.load.apply(this,arguments);this._ajax_queue.push(e);if(!this.data.url){this.data.url=a}},loadNext:function(e,h,g,c,a){if(this._settings.datathrottle&&!a){if(this._throttle_request){window.clearTimeout(this._throttle_request)}this._throttle_request=dhx.delay(function(){this.loadNext(e,h,g,c,true)},this,0,this._settings.datathrottle);return}if(!h&&h!==0){h=this.dataCount()}this.data.url=this.data.url||c;if(this.callEvent("onDataRequest",[h,e,g,c])&&this.data.url){this.data.feed.call(this,h,e,g)}},_maybe_loading_already:function(c,e){var a=this._feed_last;if(this._load_count&&a){if(a[0]<=e&&(a[1]+a[0]>=c+e)){return true}}return false},_onLoad:function(g,c,a){this._ajax_queue.remove(a);var e=this.data.driver.toObject(g,c);if(e){this.data._parse(e)}else{return this._onLoadError(g,c,a)}this._call_onready();this.callEvent("onXLE",[])},removeMissed_setter:function(a){return this.data._removeMissed=a},scheme_setter:function(a){this.data.scheme(a)},dataFeed_setter:function(a){this.data.attachEvent("onBeforeFilter",dhx.bind(function(m,l){if(this._settings.dataFeed){var h={};if(!m&&!l){return}if(typeof m=="function"){if(!l){return}m(l,h)}else{h={text:l}}this.clearAll();var c=this._settings.dataFeed;var g=[];if(typeof c=="function"){return c.call(this,l,h)}for(var e in h){g.push("dhx_filter["+e+"]="+encodeURIComponent(h[e]))}this.load(c+(c.indexOf("?")<0?"?":"&")+g.join("&"),this._settings.datatype);return false}},this));return a},debug_freid_c_ready:true,debug_freid_c_datathrottle:true,_call_onready:function(){if(this._settings.ready&&!this._ready_was_used){var a=dhx.toFunctor(this._settings.ready);if(a){dhx.delay(a,this,arguments)}this._ready_was_used=true}},_call_onclearall:function(){for(var a=0;a<this._ajax_queue.length;a++){this._ajax_queue[a].abort()}this._ajax_queue=dhx.toArray()},_call_on_config:function(a){this._parseSeetingColl(a)}},dhx.AtomDataLoader);dhx.DataStore=function(){this.name="DataStore";dhx.extend(this,dhx.EventSystem);this.setDriver("json");this.pull={};this.order=dhx.toArray();this._marks={}};dhx.DataStore.prototype={setDriver:function(a){dhx.assert(dhx.DataDriver[a],"incorrect DataDriver");this.driver=dhx.DataDriver[a]},_parse:function(e,a){this.callEvent("onParse",[this.driver,e]);if(this._filter_order){this.filter()}var g=this.driver.getInfo(e);if(g._key){dhx.securityKey=g._key}if(g._config){this.callEvent("onServerConfig",[g._config])}var c=this.driver.getRecords(e);this._inner_parse(g,c);if(this._scheme_group&&this._group_processing){this._group_processing(this._scheme_group)}if(this._scheme_sort){this.blockEvent();this.sort(this._scheme_sort);this.unblockEvent()}this.callEvent("onStoreLoad",[this.driver,e]);this.refresh()},_inner_parse:function(c,m){var o=(c._from||0)*1;var l=true;var n=false;if(o===0&&this.order[0]){if(this._removeMissed){n={};for(var g=0;g<this.order.length;g++){n[this.order[g]]=true}}l=false;o=this.order.length}var e=0;for(var g=0;g<m.length;g++){var q=this.driver.getDetails(m[g]);var a=this.id(q);if(!this.pull[a]){this.order[e+o]=a;e++}else{if(l&&this.order[e+o]){e++}}if(this.pull[a]){dhx.extend(this.pull[a],q,true);if(this._scheme_update){this._scheme_update(this.pull[a])}if(n){delete n[a]}}else{this.pull[a]=q;if(this._scheme_init){this._scheme_init(q)}}}if(n){this.blockEvent();for(var h in n){this.remove(h)}this.unblockEvent()}if(!this.order[c._size-1]){this.order[c._size-1]=dhx.undefined}},id:function(a){return a.id||(a.id=dhx.uid())},changeId:function(c,a){if(this.pull[c]){this.pull[a]=this.pull[c]}this.pull[a].id=a;this.order[this.order.find(c)]=a;if(this._filter_order){this._filter_order[this._filter_order.find(c)]=a}if(this._marks[c]){this._marks[a]=this._marks[c];delete this._marks[c]}this.callEvent("onIdChange",[c,a]);if(this._render_change_id){this._render_change_id(c,a)}delete this.pull[c]},item:function(a){return this.pull[a]},update:function(c,a){if(dhx.isUndefined(a)){a=this.item(c)}if(this._scheme_update){this._scheme_update(a)}if(this.callEvent("onBeforeUpdate",[c,a])===false){return false}this.pull[c]=a;this.callEvent("onStoreUpdated",[c,a,"update"])},refresh:function(a){if(this._skip_refresh){return}if(a){this.callEvent("onStoreUpdated",[a,this.pull[a],"paint"])}else{this.callEvent("onStoreUpdated",[null,null,null])}},silent:function(c,a){this._skip_refresh=true;c.call(a||this);this._skip_refresh=false},getRange:function(g,e){if(g){g=this.indexById(g)}else{g=(this.$min||this.startOffset)||0}if(e){e=this.indexById(e)}else{e=Math.min(((this.$max||this.endOffset)||Infinity),(this.dataCount()-1));if(e<0){e=0}}if(g>e){var c=e;e=g;g=c}return this.getIndexRange(g,e)},getIndexRange:function(g,e){e=Math.min((e||Infinity),this.dataCount()-1);var a=dhx.toArray();for(var c=(g||0);c<=e;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,g){dhx.assert(a>=0&&g>=0,"DataStore::move","Incorrect indexes");var e=this.idByIndex(a);var c=this.item(e);this.order.removeAt(a);this.order.insertAt(e,Math.min(this.order.length,g));this.callEvent("onStoreUpdated",[e,c,"move"])},scheme:function(a){this._scheme={};this._scheme_init=a.$init;this._scheme_update=a.$update;this._scheme_serialize=a.$serialize;this._scheme_group=a.$group;this._scheme_sort=a.$sort;for(var c in a){if(c.substr(0,1)!="$"){this._scheme[c]=a[c]}}},sync:function(g,e,a){if(typeof g=="string"){g=$$("source")}if(typeof e!="function"){a=e;e=null}if(dhx.debug_bind){this.debug_sync_master=g;dhx.log("[sync] "+this.debug_bind_master.name+"@"+this.debug_bind_master._settings.id+" <= "+this.debug_sync_master.name+"@"+this.debug_sync_master._settings.id)}this._backbone_source=false;if(g.name!="DataStore"){if(g.data&&g.data.name=="DataStore"){g=g.data}else{this._backbone_source=true}}var c=dhx.bind(function(n,h,m){if(this._backbone_source){if(!n){return}if(n.indexOf("change")===0){if(n=="change"){this.pull[h.id]=h.attributes;this.refresh(h.id);return}else{return}}if(n=="reset"){m=h}this.order=[];this.pull={};this._filter_order=null;for(var l=0;l<m.models.length;l++){var o=m.models[l].id;this.order.push(o);this.pull[o]=m.models[l].attributes}}else{this._filter_order=null;this.order=dhx.toArray([].concat(g.order));this.pull=g.pull}if(e){this.silent(e)}if(this._on_sync){this._on_sync()}if(dhx.debug_bind){dhx.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)}this.callEvent("onSyncApply",[]);if(!a){this.refresh()}else{a=false}},this);if(this._backbone_source){g.bind("all",c)}else{this._sync_events=[g.attachEvent("onStoreUpdated",c),g.attachEvent("onIdChange",dhx.bind(function(h,l){this.changeId(h,l)},this))]}c()},add:function(l,c){if(this._scheme){for(var e in this._scheme){if(dhx.isUndefined(l[e])){l[e]=this._scheme[e]}}}if(this._scheme_init){this._scheme_init(l)}var m=this.id(l);var a=arguments[2]||this.order;var h=a.length;if(dhx.isUndefined(c)||c<0){c=h}if(c>h){dhx.log("Warning","DataStore:add","Index of out of bounds");c=Math.min(a.length,c)}if(this.callEvent("onBeforeAdd",[m,l,c])===false){return false}dhx.assert(!this.exists(m),"Not unique ID");this.pull[m]=l;a.insertAt(m,c);if(this._filter_order){var g=this._filter_order.length;if(!c&&this.order.length){g=0}this._filter_order.insertAt(m,g)}this.callEvent("onAfterAdd",[m,c]);this.callEvent("onStoreUpdated",[m,l,"add"]);return m},remove:function(e){if(dhx.isArray(e)){for(var a=0;a<e.length;a++){this.remove(e[a])}return}if(this.callEvent("onBeforeDelete",[e])===false){return false}dhx.assert(this.exists(e),"Not existing ID in remove command"+e);var c=this.item(e);this.order.remove(e);if(this._filter_order){this._filter_order.remove(e)}delete this.pull[e];if(this._marks[e]){delete this._marks[e]}this.callEvent("onAfterDelete",[e]);this.callEvent("onStoreUpdated",[e,c,"delete"])},clearAll:function(){this.pull={};this.order=dhx.toArray();this._filter_order=this.url=null;this.callEvent("onClearAll",[]);this.refresh()},idByIndex:function(a){if(a>=this.order.length||a<0){dhx.log("Warning","DataStore::idByIndex Incorrect index")}return this.order[a]},indexById:function(c){var a=this.order.find(c);if(!this.pull[c]){dhx.log("Warning","DataStore::indexById Non-existing ID: "+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(h,c,a){var e=h;if(typeof h=="function"){e={as:h,dir:c}}else{if(typeof h=="string"){e={by:h.replace(/#/g,""),dir:c,as:a}}}var g=[e.by,e.dir,e.as];if(!this.callEvent("onBeforeSort",g)){return}this._sort_core(e);this.refresh();this.callEvent("onAfterSort",g)},_sort_core:function(a){if(this.order.length){var e=this._sort._create(a);var c=this.getRange(this.first(),this.last());c.sort(e);this.order=c.map(function(g){dhx.assert(g,"Client sorting can't be used with dynamic loading");return this.id(g)},this)}},_filter_reset:function(a){if(this._filter_order&&!a){this.order=this._filter_order;delete this._filter_order}},_filter_core:function(e,h,c){var g=dhx.toArray();for(var a=0;a<this.order.length;a++){var l=this.order[a];if(e(this.item(l),h)){g.push(l)}}if(!c||!this._filter_order){this._filter_order=this.order}this.order=g},filter:function(g,e,a){if(!this.callEvent("onBeforeFilter",[g,e])){return}this._filter_reset(a);if(!this.order.length){return}if(g){var c=g;e=e||"";if(typeof g=="string"){g=g.replace(/#/g,"");if(typeof e=="function"){c=function(h){return e(h[g])}}else{e=e.toString().toLowerCase();c=function(l,h){dhx.assert(l,"Client side filtering can't be used with dynamic loading");return(l[g]||"").toString().toLowerCase().indexOf(h)!=-1}}}this._filter_core(c,e,a,this._filterMode)}this.refresh();this.callEvent("onAfterFilter",[])},each:function(e,c){for(var a=0;a<this.order.length;a++){e.call((c||this),this.item(this.order[a]))}},_methodPush:function(a,c){return function(){return a[c].apply(a,arguments)}},addMark:function(h,g,a,c){var e=this._marks[h]||{};this._marks[h]=e;if(!e[g]){e[g]=c||true;if(a){this.item(h).$css=(this.item(h).$css||"")+" "+g;this.refresh(h)}}return e[g]},removeMark:function(h,g,a){var e=this._marks[h];if(e&&e[g]){delete e[g]}if(a){var c=this.item(h).$css;if(c){this.item(h).$css=c.replace(g,"");this.refresh(h)}}},hasMark:function(e,c){var a=this._marks[e];return(a&&a[c])},provideApi:function(g,c){this.debug_bind_master=g;if(c){this.mapEvent({onbeforesort:g,onaftersort:g,onbeforeadd:g,onafteradd:g,onbeforedelete:g,onafterdelete:g,onbeforeupdate:g})}var e=["sort","add","remove","exists","idByIndex","indexById","item","update","refresh","dataCount","filter","next","previous","clearAll","first","last","serialize","sync","addMark","removeMark","hasMark"];for(var a=0;a<e.length;a++){g[e[a]]=this._methodPush(this,e[a])}},serialize:function(){var g=this.order;var a=[];for(var c=0;c<g.length;c++){var e=this.pull[g[c]];if(this._scheme_serialize){e=this._scheme_serialize(e);if(e===false){continue}}a.push(e)}return a},_sort:{_create:function(a){return this._dir(a.dir,this._by(a.by,a.as))},_as:{date:function(e,c){e=e-0;c=c-0;return e>c?1:(e<c?-1:0)},"int":function(e,c){e=e*1;c=c*1;return e>c?1:(e<c?-1:0)},string_strict:function(e,c){e=e.toString();c=c.toString();return e>c?1:(e<c?-1:0)},string:function(e,c){if(!c){return 1}if(!e){return -1}e=e.toString().toLowerCase();c=c.toString().toLowerCase();return e>c?1:(e<c?-1:0)}},_by:function(c,a){if(!c){return a}if(typeof a!="function"){a=this._as[a||"string"]}dhx.assert(a,"Invalid sorting method");return function(g,e){return a(g[c],e[c])}},_dir:function(c,a){if(c=="asc"||!c){return a}return function(g,e){return a(g,e)*-1}}}};dhx.BaseBind={debug_freid_ignore:{id:true},bind:function(h,g,e){if(typeof h=="string"){h=dhx.ui.get(h)}if(h._initBindSource){h._initBindSource()}if(this._initBindSource){this._initBindSource()}if(!h.getBindData){dhx.extend(h,dhx.BindSource)}if(!this._bind_ready){var l=this.render;if(this.filter){var c=this._settings.id;this.data._on_sync=function(){h._bind_updated[c]=false}}this.render=function(){if(this._in_bind_processing){return}this._in_bind_processing=true;var m=this.callEvent("onBindRequest");this._in_bind_processing=false;return l.apply(this,((m===false)?arguments:[]))};if(this.getValue||this.getValues){this.save=function(){if(this.validate&&!this.validate()){return}h.setBindData((this.getValue?this.getValue:this.getValues()),this._settings.id)}}this._bind_ready=true}h.addBind(this._settings.id,g,e);if(dhx.debug_bind){dhx.log("[bind] "+this.name+"@"+this._settings.id+" <= "+h.name+"@"+h._settings.id)}var a=this._settings.id;this.attachEvent(this.touchable?"onAfterRender":"onBindRequest",function(){return h.getBindData(a)});if(!this._settings.dataFeed&&this.loadNext){this.data.attachEvent("onStoreLoad",function(){h._bind_updated[a]=false})}if(this.isVisible(this._settings.id)){this.refresh()}},unbind:function(a){return this._unbind(a)},_unbind:function(e){e.removeBind(this._settings.id);var c=(this._sync_events||(this.data?this.data._sync_events:0));if(c&&e.data){for(var a=0;a<c.length;a++){e.data.detachEvent(c[a])}}}};dhx.BindSource={$init:function(){this._bind_hash={};this._bind_updated={};this._ignore_binds={};this._bind_specific_rules(this)},saveBatch:function(a){this._do_not_update_binds=true;a.call(this);this._do_not_update_binds=false;this._update_binds()},setBindData:function(c,a){if(a){this._ignore_binds[a]=true}if(dhx.debug_bind){dhx.log("[bind:save] "+this.name+"@"+this._settings.id+" <= @"+a)}if(this.setValue){this.setValue(c)}else{if(this.setValues){this.setValues(c)}else{var e=this.getCursor();if(e){c=dhx.extend(this.item(e),c,true);this.update(e,c)}}}this.callEvent("onBindUpdate",[c,a]);if(this.save){this.save()}if(a){this._ignore_binds[a]=false}},getBindData:function(a,e){if(this._bind_updated[a]){return false}var c=dhx.ui.get(a);if(c.isVisible(c._settings.id)){this._bind_updated[a]=true;if(dhx.debug_bind){dhx.log("[bind:request] "+this.name+"@"+this._settings.id+" => "+c.name+"@"+c._settings.id)}this._bind_update(c,this._bind_hash[a][0],this._bind_hash[a][1]);if(e&&c.filter){c.refresh()}}},addBind:function(a,e,c){this._bind_hash[a]=[e,c]},removeBind:function(a){delete this._bind_hash[a];delete this._bind_updated[a];delete this._ignore_binds[a]},_bind_specific_rules:function(a){if(a.filter){dhx.extend(this,dhx.CollectionBind)}else{if(a.setValue){dhx.extend(this,dhx.ValueBind)}else{dhx.extend(this,dhx.RecordBind)}}},_update_binds:function(){if(!this._do_not_update_binds){for(var a in this._bind_hash){if(this._ignore_binds[a]){continue}this._bind_updated[a]=false;this.getBindData(a,true)}}},_bind_update_common:function(e,c,a){if(e.setValue){e.setValue(a?a[c]:a)}else{if(!e.filter){if(!a&&e.clear){e.clear()}else{if(e._check_data_feed(a)){e.setValues(dhx.clone(a))}}}else{e.data.silent(function(){this.filter(c,a)})}}e.callEvent("onBindApply",[a,c,this])}};dhx.DataValue=dhx.proto({name:"DataValue",isVisible:function(){return true},$init:function(a){this.data=""||a;var c=(a&&a.id)?a.id:dhx.uid();this._settings={id:c};dhx.ui.views[c]=this},setValue:function(a){this.data=a;this.callEvent("onChange",[a])},getValue:function(){return this.data},refresh:function(){this.callEvent("onBindRequest")}},dhx.EventSystem,dhx.BaseBind);dhx.DataRecord=dhx.proto({name:"DataRecord",isVisible:function(){return true},$init:function(a){this.data=a||{};var c=(a&&a.id)?a.id:dhx.uid();this._settings={id:c};dhx.ui.views[c]=this},getValues:function(){return this.data},setValues:function(a){this.data=a;this.callEvent("onChange",[a])},refresh:function(){this.callEvent("onBindRequest")}},dhx.EventSystem,dhx.BaseBind,dhx.AtomDataLoader,dhx.Settings);dhx.DataCollection=dhx.proto({name:"DataCollection",isVisible:function(){if(!this.data.order.length&&!this.data._filter_order&&!this._settings.dataFeed){return false}return true},$init:function(a){this.data.provideApi(this,true);var c=(a&&a.id)?a.id:dhx.uid();this._settings.id=c;dhx.ui.views[c]=this;this.data.attachEvent("onStoreLoad",dhx.bind(function(){this.callEvent("onBindRequest",[])},this))},refresh:function(){this.callEvent("onBindRequest",[])}},dhx.DataLoader,dhx.EventSystem,dhx.BaseBind,dhx.Settings);dhx.ValueBind={$init:function(){this.attachEvent("onChange",this._update_binds)},_bind_update:function(h,g,e){var c=this.getValue()||"";if(e){c=e(c)}if(h.setValue){h.setValue(c)}else{if(!h.filter){var a={};a[g]=c;if(h._check_data_feed(c)){h.setValues(a)}}else{h.data.silent(function(){this.filter(g,c)})}}h.callEvent("onBindApply",[c,g,this])}};dhx.RecordBind={$init:function(){this.attachEvent("onChange",this._update_binds)},_bind_update:function(e,c){var a=this.getValues()||null;this._bind_update_common(e,c,a)}};dhx.CollectionBind={$init:function(){this._cursor=null;this.attachEvent("onSelectChange",function(c){var a=this.getSelected();this.setCursor(a?(a.id||a):null)});this.attachEvent("onAfterCursorChange",this._update_binds);this.data.attachEvent("onStoreUpdated",dhx.bind(function(e,a,c){if(e&&e==this.getCursor()&&c!="paint"){this._update_binds()}},this));this.data.attachEvent("onClearAll",dhx.bind(function(){this._cursor=null},this));this.data.attachEvent("onIdChange",dhx.bind(function(c,a){if(this._cursor==c){this._cursor=a}},this))},setCursor:function(a){if(a==this._cursor||(a!==null&&!this.item(a))){return}this.callEvent("onBeforeCursorChange",[this._cursor]);this._cursor=a;this.callEvent("onAfterCursorChange",[a])},getCursor:function(){return this._cursor},_bind_update:function(e,c){var a=this.item(this.getCursor())||this._settings.defaultData||null;this._bind_update_common(e,c,a)}};if(!dhx.ui){dhx.ui={}}if(!dhx.ui.views){dhx.ui.views={};dhx.ui.get=function(a){if(a._settings){return a}return dhx.ui.views[a]}}dhtmlXDataStore=function(c){var e=new dhx.DataCollection(c);var a="_dp_init";e[a]=function(h){var g="_methods";h[g]=["dummy","dummy","changeId","dummy"];this.data._old_names={add:"inserted",update:"updated","delete":"deleted"};this.data.attachEvent("onStoreUpdated",function(n,l,m){if(n&&!h._silent){h.setUpdated(n,true,this._old_names[m])}});g="_getRowData";h[g]=function(q,l){var n=this.obj.data.item(q);var o={id:q};o[this.action_param]=this.obj.getUserData(q);if(n){for(var m in n){o[m]=n[m]}}return o};this.changeId=function(m,l){this.data.changeId(m,l);h._silent=true;this.data.callEvent("onStoreUpdated",[l,this.item(l),"update"]);h._silent=false};g="_clearUpdateFlag";h[g]=function(){};this._userdata={}};e.dummy=function(){};e.setUserData=function(l,g,h){this._userdata[l]=h};e.getUserData=function(h,g){return this._userdata[h]};e.dataFeed=function(g){this.define("dataFeed",g)};dhx.extend(e,dhx.BindSource);return e};if(window.dhtmlXDataView){dhtmlXDataView.prototype._initBindSource=function(){this.isVisible=function(){if(!this.data.order.length&&!this.data._filter_order&&!this._settings.dataFeed){return false}return true};var a="_settings";this._settings=this._settings||this[a];if(!this._settings.id){this._settings.id=dhx.uid()}this.unbind=dhx.BaseBind.unbind;this.unsync=dhx.BaseBind.unsync;dhx.ui.views[this._settings.id]=this}}if(window.dhtmlXChart){dhtmlXChart.prototype._initBindSource=function(){this.isVisible=function(){if(!this.data.order.length&&!this.data._filtered_state&&!this._settings.dataFeed){return false}return true};var a="_settings";this._settings=this._settings||this[a];if(!this._settings.id){this._settings.id=dhx.uid()}this.unbind=dhx.BaseBind.unbind;this.unsync=dhx.BaseBind.unsync;dhx.ui.views[this._settings.id]=this}}dhx.BaseBind.unsync=function(a){return dhx.BaseBind._unbind.call(this,a)};dhx.BaseBind.unbind=function(a){return dhx.BaseBind._unbind.call(this,a)};dhx.BaseBind.legacyBind=function(){return dhx.BaseBind.bind.apply(this,arguments)};dhx.BaseBind.legacySync=function(a,c){if(this._initBindSource){this._initBindSource()}if(a._initBindSource){a._initBindSource()}this.attachEvent("onAfterEditStop",function(e){this.save(e);return true});this.attachEvent("onDataRequest",function(h,g){for(var e=h;e<h+g;e++){if(!a.data.order[e]){a.loadNext(g,h);return false}}});this.save=function(l){if(!l){l=this.getCursor()}var h=this.item(l);var e=a.item(l);for(var g in h){if(g.indexOf("$")!==0){e[g]=h[g]}}a.refresh(l)};if(a&&a.name=="DataCollection"){return a.data.sync.apply(this.data,arguments)}else{return this.data.sync.apply(this.data,arguments)}};if(window.dhtmlXForm){dhtmlXForm.prototype.bind=function(a){dhx.BaseBind.bind.apply(this,arguments);a.getBindData(this._settings.id)};dhtmlXForm.prototype.unbind=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXForm.prototype._initBindSource=function(){if(dhx.isUndefined(this._settings)){this._settings={id:dhx.uid(),dataFeed:this._server_feed};dhx.ui.views[this._settings.id]=this}};dhtmlXForm.prototype._check_data_feed=function(c){if(!this._settings.dataFeed||this._ignore_feed||!c){return true}var a=this._settings.dataFeed;if(typeof a=="function"){return a.call(this,(c.id||c),c)}a=a+(a.indexOf("?")==-1?"?":"&")+"action=get&id="+encodeURIComponent(c.id||c);this.load(a);return false};dhtmlXForm.prototype.setValues=dhtmlXForm.prototype.setFormData;dhtmlXForm.prototype.getValues=function(){return this.getFormData(false,true)};dhtmlXForm.prototype.dataFeed=function(a){if(this._settings){this._settings.dataFeed=a}else{this._server_feed=a}};dhtmlXForm.prototype.refresh=dhtmlXForm.prototype.isVisible=function(a){return true}}if(window.scheduler){if(!window.Scheduler){window.Scheduler={}}Scheduler.$syncFactory=function(a){a.sync=function(e,h){if(this._initBindSource){this._initBindSource()}if(e._initBindSource){e._initBindSource()}var g="_process_loading";var c=function(q){a.clearAll();var l=e.data.order;var o=e.data.pull;var m=[];for(var n=0;n<l.length;n++){if(h&&h.copy){m[n]=dhx.clone(o[l[n]])}else{m[n]=o[l[n]]}}a[g](m);a.callEvent("onSyncApply",[])};this.save=function(n){if(!n){n=this.getCursor()}var m=this.item(n);var l=e.item(n);if(this.callEvent("onStoreSave",[n,m,l])){dhx.extend(e.item(n),m,true);e.update(n)}};this.item=function(l){return this.getEvent(l)};this._sync_events=[e.data.attachEvent("onStoreUpdated",function(n,l,m){c.call(this)}),e.data.attachEvent("onIdChange",function(m,l){combo.changeOptionId(m,l)})];this.attachEvent("onEventChanged",function(l){this.save(l)});this.attachEvent("onEventAdded",function(m,l){if(!e.data.pull[m]){e.add(l)}});this.attachEvent("onEventDeleted",function(l){if(e.data.pull[l]){e.remove(l)}});c()};a.unsync=function(c){dhx.BaseBind._unbind.call(this,c)};a._initBindSource=function(){if(!this._settings){this._settings={id:dhx.uid()}}}};Scheduler.$syncFactory(window.scheduler)}if(window.dhtmlXCombo){dhtmlXCombo.prototype.bind=function(){dhx.BaseBind.bind.apply(this,arguments)};dhtmlXCombo.unbind=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXCombo.unsync=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXCombo.prototype.dataFeed=function(a){if(this._settings){this._settings.dataFeed=a}else{this._server_feed=a}};dhtmlXCombo.prototype.sync=function(c,g){if(this._initBindSource){this._initBindSource()}if(c._initBindSource){c._initBindSource()}var e=this;var a=function(h){e.clearAll();e.addOption(this.serialize());e.callEvent("onSyncApply",[])};this._sync_events=[c.data.attachEvent("onStoreUpdated",function(m,h,l){a.call(this)}),c.data.attachEvent("onIdChange",function(l,h){e.changeOptionId(l,h)})];a.call(c)};dhtmlXCombo.prototype._initBindSource=function(){if(dhx.isUndefined(this._settings)){this._settings={id:dhx.uid(),dataFeed:this._server_feed};dhx.ui.views[this._settings.id]=this;this.data={silent:dhx.bind(function(a){a.call(this)},this)};dhx4._eventable(this.data);this.attachEvent("onChange",function(){this.callEvent("onSelectChange",[this.getSelectedValue()])});this.attachEvent("onXLE",function(){this.callEvent("onBindRequest",[])})}};dhtmlXCombo.prototype.item=function(a){return this.getOption(a)};dhtmlXCombo.prototype.getSelected=function(){return this.getSelectedValue()};dhtmlXCombo.prototype.isVisible=function(){if(!this.optionsArr.length&&!this._settings.dataFeed){return false}return true};dhtmlXCombo.prototype.refresh=function(){this.render(true)}}if(window.dhtmlXGridObject){dhtmlXGridObject.prototype.bind=function(a,e,c){dhx.BaseBind.bind.apply(this,arguments)};dhtmlXGridObject.prototype.unbind=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXGridObject.prototype.unsync=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXGridObject.prototype.dataFeed=function(a){if(this._settings){this._settings.dataFeed=a}else{this._server_feed=a}};dhtmlXGridObject.prototype.sync=function(a,o){if(this._initBindSource){this._initBindSource()}if(a._initBindSource){a._initBindSource()}var c=this;var n="_parsing";var e="_parser";var l="_locator";var g="_process_store_row";var m="_get_store_data";this.save=function(q){if(!q){q=this.getCursor()}dhx.extend(a.item(q),this.item(q),true);a.update(q)};var h=function(w){var s=c.getCursor?c.getCursor():null;var v=0;if(c._legacy_ignore_next){v=c._legacy_ignore_next;c._legacy_ignore_next=false}else{c.clearAll()}var r=this.dataCount();if(r){c[n]=true;for(var q=v;q<r;q++){var u=this.order[q];if(!u){continue}if(v&&c.rowsBuffer[q]){continue}c.rowsBuffer[q]={idd:u,data:this.pull[u]};c.rowsBuffer[q][e]=c[g];c.rowsBuffer[q][l]=c[m];c.rowsAr[u]=this.pull[u]}if(!c.rowsBuffer[r-1]){c.rowsBuffer[r-1]=dhtmlx.undefined;c.xmlFileUrl=c.xmlFileUrl||this.url}if(c.pagingOn){c.changePage()}else{if(c._srnd&&c._fillers){c._update_srnd_view()}else{c.render_dataset();c.callEvent("onXLE",[])}}c[n]=false}if(s&&c.setCursor){c.setCursor(c.rowsAr[s]?s:null)}c.callEvent("onSyncApply",[])};this._sync_events=[a.data.attachEvent("onStoreUpdated",function(s,q,r){if(r=="delete"){c.deleteRow(s);c.data.callEvent("onStoreUpdated",[s,q,r])}else{if(r=="update"){c.callEvent("onSyncUpdate",[q,r]);c.update(s,q);c.data.callEvent("onStoreUpdated",[s,q,r])}else{if(r=="add"){c.callEvent("onSyncUpdate",[q,r]);c.add(s,q,this.indexById(s));c.data.callEvent("onStoreUpdated",[s,q,r])}else{h.call(this)}}}}),a.data.attachEvent("onStoreLoad",function(r,q){c.xmlFileUrl=a.data.url;c._legacy_ignore_next=r.getInfo(q)._from}),a.data.attachEvent("onIdChange",function(r,q){c.changeRowId(r,q)})];c.attachEvent("onDynXLS",function(s,r){for(var q=s;q<s+r;q++){if(!a.data.order[q]){a.loadNext(r,s);return false}}c._legacy_ignore_next=s;h.call(a.data)});h.call(a.data);c.attachEvent("onEditCell",function(q,v,s,r,u){if(q==2&&r!=u){this.save(v)}return true});c.attachEvent("onClearAll",function(){var q="_f_rowsBuffer";this[q]=null});if(o&&o.sort){c.attachEvent("onBeforeSorting",function(s,r,q){if(r=="connector"){return false}var u=this.getColumnId(s);a.sort("#"+u+"#",(q=="asc"?"asc":"desc"),(r=="int"?r:"string"));c.setSortImgState(true,s,q);return false})}if(o&&o.filter){c.attachEvent("onFilterStart",function(s,q){var r="_con_f_used";if(c[r]&&c[r].length){return false}a.data.silent(function(){a.filter();for(var u=0;u<s.length;u++){if(q[u]==""){continue}var v=c.getColumnId(s[u]);a.filter("#"+v+"#",q[u],u!=0)}});a.refresh();return false});c.collectValues=function(q){var r=this.getColumnId(q);return(function(v){var s=[];var u={};this.data.each(function(x){var w=x[v];if(!u[w]){u[w]=true;s.push(w)}});s.sort();return s}).call(a,r)}}if(o&&o.select){c.attachEvent("onRowSelect",function(q){a.setCursor(q)})}c.clearAndLoad=function(q){a.clearAll();a.load(q)}};dhtmlXGridObject.prototype._initBindSource=function(){if(dhx.isUndefined(this._settings)){this._settings={id:dhx.uid(),dataFeed:this._server_feed};dhx.ui.views[this._settings.id]=this;this.data={silent:dhx.bind(function(e){e.call(this)},this)};dhx4._eventable(this.data);var a="_cCount";for(var c=0;c<this[a];c++){if(!this.columnIds[c]){this.columnIds[c]="cell"+c}}this.attachEvent("onSelectStateChanged",function(e){this.callEvent("onSelectChange",[e])});this.attachEvent("onSelectionCleared",function(){this.callEvent("onSelectChange",[null])});this.attachEvent("onEditCell",function(e,g){if(e===2&&this.getCursor){if(g&&g==this.getCursor()){this._update_binds()}}return true});this.attachEvent("onXLE",function(){this.callEvent("onBindRequest",[])})}};dhtmlXGridObject.prototype.item=function(l){if(l===null){return null}var h=this.getRowById(l);if(!h){return null}var a="_attrs";var g=dhx.copy(h[a]);g.id=l;var e=this.getColumnsNum();for(var c=0;c<e;c++){g[this.columnIds[c]]=this.cells(l,c).getValue()}return g};dhtmlXGridObject.prototype.update=function(l,h){for(var g=0;g<this.columnIds.length;g++){var e=this.columnIds[g];if(!dhx.isUndefined(h[e])){this.cells(l,g).setValue(h[e])}}var c="_attrs";var a=this.getRowById(l)[c];for(var e in h){a[e]=h[e]}this.callEvent("onBindUpdate",[l])};dhtmlXGridObject.prototype.add=function(m,l,e){var a=[];for(var h=0;h<this.columnIds.length;h++){var g=this.columnIds[h];a[h]=dhx.isUndefined(l[g])?"":l[g]}this.addRow(m,a,e);var c="_attrs";this.getRowById(m)[c]=dhx.copy(l)};dhtmlXGridObject.prototype.getSelected=function(){return this.getSelectedRowId()};dhtmlXGridObject.prototype.isVisible=function(){var a="_f_rowsBuffer";if(!this.rowsBuffer.length&&!this[a]&&!this._settings.dataFeed){return false}return true};dhtmlXGridObject.prototype.refresh=function(){this.render_dataset()};dhtmlXGridObject.prototype.filter=function(l,h){if(this._settings.dataFeed){var g={};if(!l&&!h){return}if(typeof l=="function"){if(!h){return}l(h,g)}else{if(dhx.isUndefined(l)){g=h}else{g[l]=h}}this.clearAll();var a=this._settings.dataFeed;if(typeof a=="function"){return a.call(this,h,g)}var e=[];for(var c in g){e.push("dhx_filter["+c+"]="+encodeURIComponent(g[c]))}this.load(a+(a.indexOf("?")<0?"?":"&")+e.join("&"));return false}if(h===null){return this.filterBy(0,function(){return false})}this.filterBy(0,function(m,n){return l.call(this,n,h)})}}if(window.dhtmlXTreeObject){dhtmlXTreeObject.prototype.bind=function(){dhx.BaseBind.bind.apply(this,arguments)};dhtmlXTreeObject.prototype.unbind=function(a){dhx.BaseBind._unbind.call(this,a)};dhtmlXTreeObject.prototype.dataFeed=function(a){if(this._settings){this._settings.dataFeed=a}else{this._server_feed=a}};dhtmlXTreeObject.prototype._initBindSource=function(){if(dhx.isUndefined(this._settings)){this._settings={id:dhx.uid(),dataFeed:this._server_feed};dhx.ui.views[this._settings.id]=this;this.data={silent:dhx.bind(function(a){a.call(this)},this)};dhx4._eventable(this.data);this.attachEvent("onSelect",function(a){this.callEvent("onSelectChange",[a])});this.attachEvent("onEdit",function(a,c){if(a===2){if(c&&c==this.getCursor()){this._update_binds()}}return true})}};dhtmlXTreeObject.prototype.item=function(a){if(a===null){return null}return{id:a,text:this.getItemText(a)}};dhtmlXTreeObject.prototype.getSelected=function(){return this.getSelectedItemId()};dhtmlXTreeObject.prototype.isVisible=function(){return true};dhtmlXTreeObject.prototype.refresh=function(){};dhtmlXTreeObject.prototype.filter=function(l,h){if(this._settings.dataFeed){var g={};if(!l&&!h){return}if(typeof l=="function"){if(!h){return}l(h,g)}else{if(dhx.isUndefined(l)){g=h}else{g[l]=h}}this.deleteChildItems(0);var a=this._settings.dataFeed;if(typeof a=="function"){return a.call(this,[(data.id||data),data])}var e=[];for(var c in g){e.push("dhx_filter["+c+"]="+encodeURIComponent(g[c]))}this.loadXML(a+(a.indexOf("?")<0?"?":"&")+e.join("&"));return false}};dhtmlXTreeObject.prototype.update=function(c,a){if(!dhx.isUndefined(a.text)){this.setItemText(c,a.text)}}}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._headers=null;this._payload=null;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);dhx4._eventable(this);if(this.connector_init){this.setTransactionMode("POST",true);this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true"}return this}dataProcessor.prototype={setTransactionMode:function(c,a){if(typeof c=="object"){this._tMode=c.mode||this._tMode;this._headers=this._headers||c.headers;this._payload=this._payload||c.payload}else{this._tMode=c;this._tSend=a}if(this._tMode=="REST"){this._tSend=false;this._endnm=true}},escape:function(a){if(this._utf){return encodeURIComponent(a)}else{return escape(a)}},enableUTFencoding:function(a){this._utf=dhx4.s2b(a)},setDataColumns:function(a){this._columns=(typeof a=="string")?a.split(","):a},getSyncState:function(){return !this.updatedRows.length},enableDataNames:function(a){this._endnm=dhx4.s2b(a)},enablePartialDataSend:function(a){this._changed=dhx4.s2b(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(g,e,h){if(this._silent_mode){return}var c=this.findRow(g);h=h||"updated";var a=this.obj.getUserData(g,this.action_param);if(a&&h=="updated"){h=a}if(e){this.set_invalid(g,false);this.updatedRows[c]=g;this.obj.setUserData(g,this.action_param,h);if(this._in_progress[g]){this._in_progress[g]="wait"}}else{if(!this.is_invalid(g)){this.updatedRows.splice(c,1);this.obj.setUserData(g,this.action_param,"")}}if(!e){this._clearUpdateFlag(g)}this.markRow(g,e,h);if(e&&this.autoUpdate){this.sendData(g)}},_clearUpdateFlag:function(a){},markRow:function(l,e,h){var g="";var c=this.is_invalid(l);if(c){g=this.styles[c];e=true}if(this.callEvent("onRowMark",[l,e,h,c])){g=this.styles[e?h:"clear"]+g;this.obj[this._methods[0]](l,g);if(c&&c.details){g+=this.styles[c+"_cell"];for(var a=0;a<c.details.length;a++){if(c.details[a]){this.obj[this._methods[1]](l,a,g)}}}}},getState:function(a){return this.obj.getUserData(a,this.action_param)},is_invalid:function(a){return this._invalid[a]},set_invalid:function(e,c,a){if(a){c={value:c,details:a,toString:function(){return this.value.toString()}}}this._invalid[e]=c},checkBeforeUpdate:function(a){return true},sendData:function(a){if(this._waitMode&&(this.obj.mytype=="tree"||this.obj._h2)){return}if(this.obj.editStop){this.obj.editStop()}if(typeof a=="undefined"||this._tSend){return this.sendAllData()}if(this._in_progress[a]){return false}this.messages=[];if(this.getState(a)!=="deleted"){if(!this.checkBeforeUpdate(a)&&this.callEvent("onValidationError",[a,this.messages])){return false}}this._beforeSendData(this._getRowData(a),a)},_beforeSendData:function(a,c){if(!this.callEvent("onBeforeUpdate",[c,this.getState(c),a])){return false}this._sendData(a,c)},serialize:function(g,h){if(typeof g=="string"){return g}if(typeof h!="undefined"){return this.serialize_one(g,"")}else{var a=[];var e=[];for(var c in g){if(g.hasOwnProperty(c)){a.push(this.serialize_one(g[c],c+this.post_delim));e.push(c)}}a.push("ids="+this.escape(e.join(",")));if(dhtmlx.security_key){a.push("dhx_security="+dhtmlx.security_key)}return a.join("&")}},serialize_one:function(g,c){if(typeof g=="string"){return g}var a=[];for(var e in g){if(g.hasOwnProperty(e)){if((e=="id"||e==this.action_param)&&this._tMode=="REST"){continue}a.push(this.escape((c||"")+e)+"="+this.escape(g[e]))}}return a.join("&")},_sendData:function(h,l){if(!h){return}if(!this.callEvent("onBeforeDataSending",l?[l,this.getState(l),h]:[null,null,h])){return false}if(l){this._in_progress[l]=(new Date()).valueOf()}var q=this;var o=function(s){var v=[];if(l){v.push(l)}else{if(h){for(var u in h){v.push(u)}}}return q.afterUpdate(q,s,v)};var c=this.serverProcessor+(this._user?(dhtmlx.url(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&")):"");if(this._tMode=="GET"){dhx4.ajax.get(c+((c.indexOf("?")!=-1)?"&":"?")+this.serialize(h,l),o)}else{if(this._tMode=="POST"){dhx4.ajax.post(c,this.serialize(h,l),o)}else{if(this._tMode=="REST"){var e=this.getState(l);var g=c.replace(/(\&|\?)editing\=true/,"");var m=g.split("?");if(m[1]){m[1]="?"+m[1]}var n="";var a="post";if(e=="inserted"){n=this.serialize(h,l)}else{if(e=="deleted"){a="DELETE";g=m[0]+l+(m[1]||"")}else{a="PUT";n=this.serialize(h,l);g=m[0]+l+(m[1]||"")}}if(this._payload){for(var r in this._payload){g=g+(g.indexOf("?")===-1?"?":"&")+this.escape(r)+"="+this.escape(this._payload[r])}}dhx4.ajax.query({url:g,method:a,headers:this._headers,data:n,callback:o})}}}this._waitMode++},sendAllData:function(){if(!this.updatedRows.length){return}this.messages=[];var c=true;for(var a=0;a<this.updatedRows.length;a++){if(this.getState(this.updatedRows[a])!=="deleted"){c&=this.checkBeforeUpdate(this.updatedRows[a])}}if(!c&&!this.callEvent("onValidationError",["",this.messages])){return false}if(this._tSend){this._sendData(this._getAllData())}else{for(var a=0;a<this.updatedRows.length;a++){if(!this._in_progress[this.updatedRows[a]]){if(this.is_invalid(this.updatedRows[a])){continue}this._beforeSendData(this._getRowData(this.updatedRows[a]),this.updatedRows[a]);if(this._waitMode&&(this.obj.mytype=="tree"||this.obj._h2)){return}}}}},_getAllData:function(g){var c={};var a=false;for(var e=0;e<this.updatedRows.length;e++){var h=this.updatedRows[e];if(this._in_progress[h]||this.is_invalid(h)){continue}if(!this.callEvent("onBeforeUpdate",[h,this.getState(h),this._getRowData(h)])){continue}c[h]=this._getRowData(h,h+this.post_delim);a=true;this._in_progress[h]=(new Date()).valueOf()}return a?c:null},setVerificator:function(c,a){this.mandatoryFields[c]=a||(function(e){return(e!=="")})},clearVerificator:function(a){this.mandatoryFields[a]=false},findRow:function(c){var a=0;for(a=0;a<this.updatedRows.length;a++){if(c==this.updatedRows[a]){break}}return a},defineAction:function(a,c){if(!this._uActions){this._uActions=[]}this._uActions[a]=c},afterUpdateCallback:function(c,m,l,h){var a=c;var g=(l!="error"&&l!="invalid");if(!g){this.set_invalid(c,l)}if((this._uActions)&&(this._uActions[l])&&(!this._uActions[l](h))){return(delete this._in_progress[a])}if(this._in_progress[a]!="wait"){this.setUpdated(c,false)}var e=c;switch(l){case"inserted":case"insert":if(m!=c){this.obj[this._methods[2]](c,m);c=m}break;case"delete":case"deleted":this.obj.setUserData(c,this.action_param,"true_deleted");this.obj[this._methods[3]](c);delete this._in_progress[a];return this.callEvent("onAfterUpdate",[c,l,m,h]);break}if(this._in_progress[a]!="wait"){if(g){this.obj.setUserData(c,this.action_param,"")}delete this._in_progress[a]}else{delete this._in_progress[a];this.setUpdated(m,true,this.obj.getUserData(c,this.action_param))}this.callEvent("onAfterUpdate",[e,l,m,h])},afterUpdate:function(o,n,a){if(window.JSON){try{var u=JSON.parse(n.xmlDoc.responseText);var h=u.action||this.getState(a)||"updated";var c=u.sid||a[0];var g=u.tid||a[0];o.afterUpdateCallback(c,g,h,u);o.finalizeUpdate();return}catch(q){}}var s=dhx4.ajax.xmltop("data",n.xmlDoc);if(!s||s.tagName=="DIV"){return this.cleanUpdate(a)}var r=dhx4.ajax.xpath("//data/action",s);if(!r.length){return this.cleanUpdate(a)}for(var m=0;m<r.length;m++){var l=r[m];var h=l.getAttribute("type");var c=l.getAttribute("sid");var g=l.getAttribute("tid");o.afterUpdateCallback(c,g,h,l)}o.finalizeUpdate()},cleanUpdate:function(c){if(c){for(var a=0;a<c.length;a++){delete this._in_progress[c[a]]}}},finalizeUpdate:function(){if(this._waitMode){this._waitMode--}if((this.obj.mytype=="tree"||this.obj._h2)&&this.updatedRows.length){this.sendData()}this.callEvent("onAfterUpdateFinish",[]);if(!this.updatedRows.length){this.callEvent("onFullSync",[])}},init:function(a){this.obj=a;if(a._dp_init){a._dp_init(this)}if(this.connector_init){a._dataprocessor=this}},setOnAfterUpdate:function(a){this.attachEvent("onAfterUpdate",a)},enableDebug:function(a){},setOnBeforeUpdateHandler:function(a){this.attachEvent("onBeforeDataSending",a)},setAutoUpdate:function(e,c){e=e||2000;this._user=c||(new Date()).valueOf();this._need_update=false;this._update_busy=false;this.attachEvent("onAfterUpdate",function(g,l,m,h){this.afterAutoUpdate(g,l,m,h)});this.attachEvent("onFullSync",function(){this.fullSync()});var a=this;window.setInterval(function(){a.loadUpdate()},e)},afterAutoUpdate:function(a,e,g,c){if(e=="collision"){this._need_update=true;return false}else{return true}},fullSync:function(){if(this._need_update==true){this._need_update=false;this.loadUpdate()}return true},getUpdates:function(a,c){if(this._update_busy){return false}else{this._update_busy=true}dhx4.ajax.get(a,c)},_v:function(a){if(a.firstChild){return a.firstChild.nodeValue}return""},_a:function(a){var e=[];for(var c=0;c<a.length;c++){e[c]=this._v(a[c])}return e},loadUpdate:function(){var c=this;var a=this.obj.getUserData(0,"version");var e=this.serverProcessor+dhtmlx.url(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+a].join("&");e=e.replace("editing=true&","");this.getUpdates(e,function(o){var q=dhx4.ajax.xmltop("updates",o.xmlDoc);var l=dhx4.ajax.xpath("//userdata",q);c.obj.setUserData(0,"version",c._v(l[0]));var g=dhx4.ajax.xpath("//update",q);if(g.length){c._silent_mode=true;for(var m=0;m<g.length;m++){var h=g[m].getAttribute("status");var s=g[m].getAttribute("id");var n=g[m].getAttribute("parent");switch(h){case"inserted":c.callEvent("insertCallback",[g[m],s,n]);break;case"updated":c.callEvent("updateCallback",[g[m],s,n]);break;case"deleted":c.callEvent("deleteCallback",[g[m],s,n]);break}}c._silent_mode=false}c._update_busy=false;c=null})}};if(window.dataProcessor&&!dataProcessor.prototype.init_original){dataProcessor.prototype.connector_init=true};