text: /*
  Product Name: dhtmlxGrid 
  Version: 4.0.1 
  Edition: Standard 
  License: content of this file is covered by GPL. Usage outside GPL terms is prohibited. To obtain Commercial or Enterprise license contact sales@dhtmlx.com
  Copyright UAB Dinamenta http://www.dhtmlx.com
  */
  
  if(typeof(window.dhx4)=="undefined"){window.dhx4={version:"4.0.1",skin:null,skinDetect:function(b){var c=document.createElement("DIV");c.className=b+"_skin_detect";if(document.body.firstChild){document.body.insertBefore(c,document.body.firstChild)}else{document.body.appendChild(c)}var a=c.offsetWidth;c.parentNode.removeChild(c);c=null;return{10:"dhx_skyblue",20:"dhx_web",30:"dhx_terrace"}[a]||null},lastId:1,newId:function(){return this.lastId++},zim:{data:{},step:5,first:function(){return 100},last:function(){var c=this.first();for(var b in this.data){c=Math.max(c,this.data[b])}return c},reserve:function(a){this.data[a]=this.last()+this.step;return this.data[a]},clear:function(a){if(this.data[a]!=null){this.data[a]=null;delete this.data[a]}}},s2b:function(a){return(a==true||a==1||a=="true"||a=="1"||a=="yes"||a=="y")},trim:function(a){return String(a).replace(/^\s{1,}/,"").replace(/\s{1,}$/,"")},template:function(b,c,a){return b.replace(/#([a-zA-Z0-9_-]{1,})#/g,function(e,d){if(d.length>0&&typeof(c[d])!="undefined"){if(a==true){return window.dhx4.trim(c[d])}return String(c[d])}return""})},absLeft:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this._aOfs(a).left},absTop:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this._aOfs(a).top},_aOfsSum:function(a){var c=0,b=0;while(a){c=c+parseInt(a.offsetTop);b=b+parseInt(a.offsetLeft);a=a.offsetParent}return{top:c,left:b}},_aOfsRect:function(d){var g=d.getBoundingClientRect();var h=document.body;var b=document.documentElement;var a=window.pageYOffset||b.scrollTop||h.scrollTop;var e=window.pageXOffset||b.scrollLeft||h.scrollLeft;var f=b.clientTop||h.clientTop||0;var i=b.clientLeft||h.clientLeft||0;var j=g.top+a-f;var c=g.left+e-i;return{top:Math.round(j),left:Math.round(c)}},_aOfs:function(a){if(a.getBoundingClientRect){return this._aOfsRect(a)}else{return this._aOfsSum(a)}},_isObj:function(a){return(a!=null&&typeof(a)=="object"&&typeof(a.length)=="undefined")},_copyObj:function(d){if(this._isObj(d)){var c={};for(var b in d){if(typeof(d[b])=="object"&&d[b]!=null){c[b]=this._copyObj(d[b])}else{c[b]=d[b]}}}else{var c=[];for(var b=0;b<d.length;b++){if(typeof(d[b])=="object"&&d[b]!=null){c[b]=this._copyObj(d[b])}else{c[b]=d[b]}}}return c},screenDim:function(){var a=(navigator.userAgent.indexOf("MSIE")>=0);var b={};b.left=document.body.scrollLeft;b.right=b.left+(window.innerWidth||document.body.clientWidth);b.top=Math.max((a?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);b.bottom=b.top+(a?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0):window.innerHeight);return b},selectTextRange:function(d,g,b){d=(typeof(d)=="string"?document.getElementById(d):d);var a=d.value.length;g=Math.max(Math.min(g,a),0);b=Math.min(b,a);if(d.setSelectionRange){d.setSelectionRange(g,b)}else{if(d.createTextRange){var c=d.createTextRange();c.moveStart("character",g);c.moveEnd("character",b-a);try{c.select()}catch(f){}}}},transData:null,transDetect:function(){if(this.transData==null){this.transData={transProp:false,transEv:null};var c={MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd",OTransition:"oTransitionEnd",msTransition:"transitionend",transition:"transitionend"};for(var b in c){if(this.transData.transProp==false&&document.documentElement.style[b]!=null){this.transData.transProp=b;this.transData.transEv=c[b]}}c=null}return this.transData}};window.dhx4.isIE=(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>=0);window.dhx4.isIE6=(window.XMLHttpRequest==null&&navigator.userAgent.indexOf("MSIE")>=0);window.dhx4.isOpera=(navigator.userAgent.indexOf("Opera")>=0);window.dhx4.isChrome=(navigator.userAgent.indexOf("Chrome")>=0);window.dhx4.isKHTML=(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0);window.dhx4.isFF=(navigator.userAgent.indexOf("Firefox")>=0);window.dhx4.isIPad=(navigator.userAgent.search(/iPad/gi)>=0)}if(typeof(window.dhx4.ajax)=="undefined"){window.dhx4.ajax={cache:false,get:function(a,b){this._call("GET",a,null,true,b)},getSync:function(a){return this._call("GET",a,null,false)},post:function(b,a,c){if(arguments.length==1){a=""}else{if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a])=="function")){c=a;a=""}else{a=String(a)}}this._call("POST",b,a,true,c)},postSync:function(b,a){a=(a==null?"":String(a));return this._call("POST",b,a,false)},getLong:function(a,b){this._call("GET",a,null,true,b,{url:a})},postLong:function(b,a,c){if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a]))){c=a;a=""}this._call("POST",b,a,true,c,{url:b,postData:a})},_call:function(g,b,a,f,e,d){var c=(window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"));if(f==true){c.onreadystatechange=function(){if(c.readyState==4&&c.status==200){if(typeof(e)=="function"){e.apply(window,[{xmlDoc:c}])}if(d!=null){if(typeof(d.postData)!="undefined"){dhx4.ajax.postLong(d.url,d.postData,e)}else{dhx4.ajax.getLong(d.url,e)}}e=null;c=null}}}if(g=="GET"&&this.cache!=true){b+=(b.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime()}c.open(g,b,f);if(g=="POST"){c.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(this.cache!=true){a+=(a.length>0?"&":"")+"dhxr"+new Date().getTime()}}else{a=null}c.setRequestHeader("X-Requested-With","XMLHttpRequest");c.send(a);if(!f){return{xmlDoc:c}}}}}if(typeof(window.dhx4._enableDataLoading)=="undefined"){window.dhx4._enableDataLoading=function(obj,initObj,xmlToJson,xmlRootTag,mode){if(mode=="clear"){for(var a in obj._dhxdataload){obj._dhxdataload[a]=null;delete obj._dhxdataload[a]}obj._loadData=null;obj._dhxdataload=null;obj.load=null;obj.loadStruct=null;obj=null;return}obj._dhxdataload={initObj:initObj,xmlToJson:xmlToJson,xmlRootTag:xmlRootTag,onBeforeXLS:null};obj._loadData=function(data,loadParams,onLoad){if(arguments.length==2){onLoad=loadParams;loadParams=null}var obj=null;if(arguments.length==3){onLoad=arguments[2]}if(typeof(data)=="string"){var k=data.replace(/^\s{1,}/,"").replace(/\s{1,}$/,"");var tag=new RegExp("^<"+this._dhxdataload.xmlRootTag);if(tag.test(k.replace(/^<\?xml[^\?]*\?>\s*/,""))){if(window.DOMParser){obj=(new window.DOMParser()).parseFromString(data,"text/xml")}else{if(typeof(window.ActiveXObject)!="undefined"){obj=new window.ActiveXObject("Microsoft.XMLDOM");obj.async="false";obj.loadXML(data)}}if(obj!=null){obj=this[this._dhxdataload.xmlToJson].apply(this,[obj])}}if(obj==null&&(k.match(/^\{.*\}$/)!=null||k.match(/^\[.*\]$/)!=null)){try{eval("dhx4.temp="+k)}catch(e){dhx4.temp=null}obj=dhx4.temp;dhx4.temp=null}if(obj==null){this.callEvent("onXLS",[]);var params=[];if(typeof(this._dhxdataload.onBeforeXLS)=="function"){var k=this._dhxdataload.onBeforeXLS.apply(this,[data]);if(k!=null&&typeof(k)=="object"){if(k.url!=null){data=k.url}if(k.params!=null){for(var a in k.params){params.push(a+"="+encodeURIComponent(k.params[a]))}}}}var t=this;dhx4.ajax.post(data,params.join("&")+(typeof(loadParams)=="string"?"&"+loadParams:""),function(r){var obj=null;if(r.xmlDoc.getResponseHeader("Content-Type").search(/xml/gi)>=0||(r.xmlDoc.responseText.replace(/^\s{1,}/,"")).match(/^</)!=null){obj=t[t._dhxdataload.xmlToJson].apply(t,[r.xmlDoc.responseXML])}else{try{eval("dhx4.temp="+r.xmlDoc.responseText)}catch(e){dhx4.temp=null}obj=dhx4.temp;dhx4.temp=null}if(obj!=null){t[t._dhxdataload.initObj].apply(t,[obj,data])}t.callEvent("onXLE",[]);if(onLoad!=null){if(typeof(onLoad)=="function"){onLoad.apply(t,[])}else{if(typeof(window[onLoad])=="function"){window[onLoad].apply(t,[])}}}onLoad=null;t=null});return}}else{if(typeof(data.documentElement)=="object"||(typeof(data.tagName)!="undefined"&&typeof(data.getElementsByTagName)!="undefined"&&data.getElementsByTagName(this._dhxdataload.xmlRootTag).length>0)){obj=this[this._dhxdataload.xmlToJson].apply(this,[data])}else{obj=window.dhx4._copyObj(data)}}if(obj!=null){this[this._dhxdataload.initObj].apply(this,[obj])}if(onLoad!=null){if(typeof(onLoad)=="function"){onLoad.apply(this,[])}else{if(typeof(window[onLoad])=="function"){window[onLoad].apply(this,[])}}onLoad=null}};if(mode!=null){var k={struct:"loadStruct",data:"load"};for(var a in mode){if(mode[a]==true){obj[k[a]]=function(){return this._loadData.apply(this,arguments)}}}}obj=null}}if(typeof(window.dhx4._eventable)=="undefined"){window.dhx4._eventable=function(a,b){if(b=="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(c,e){c=String(c).toLowerCase();if(!this.dhxevs.data[c]){this.dhxevs.data[c]={}}var d=window.dhx4.newId();this.dhxevs.data[c][d]=e;return d};a.detachEvent=function(f){for(var d in this.dhxevs.data){var e=0;for(var c in this.dhxevs.data[d]){if(c==f){this.dhxevs.data[d][c]=null;delete this.dhxevs.data[d][c]}else{e++}}if(e==0){this.dhxevs.data[d]=null;delete this.dhxevs.data[d]}}};a.checkEvent=function(c){c=String(c).toLowerCase();return(this.dhxevs.data[c]!=null)};a.callEvent=function(d,f){d=String(d).toLowerCase();if(this.dhxevs.data[d]==null){return true}var e=true;for(var c in this.dhxevs.data[d]){e=this.dhxevs.data[d][c].apply(this,f)&&e}return e};a.detachAllEvents=function(){for(var d in this.dhxevs.data){for(var c in this.dhxevs.data[d]){this.dhxevs.data[d][c]=null;delete this.dhxevs.data[d][c]}this.dhxevs.data[d]=null;delete this.dhxevs.data[d]}};a=null}}dhtmlx=function(c){for(var b in c){dhtmlx[b]=c[b]}return dhtmlx};dhtmlx.extend_api=function(a,d,c){var b=window[a];if(!b){return}window[a]=function(g){if(g&&typeof g=="object"&&!g.tagName){var f=b.apply(this,(d._init?d._init(g):arguments));for(var e in dhtmlx){if(d[e]){this[d[e]](dhtmlx[e])}}for(var e in g){if(d[e]){this[d[e]](g[e])}else{if(e.indexOf("on")==0){this.attachEvent(e,g[e])}}}}else{var f=b.apply(this,arguments)}if(d._patch){d._patch(this)}return f||this};window[a].prototype=b.prototype;if(c){dhtmlXHeir(window[a].prototype,c)}};dhtmlxAjax={get:function(a,c){var b=new dtmlXMLLoaderObject(true);b.async=(arguments.length<3);b.waitCall=c;b.loadXML(a);return b},post:function(a,c,d){var b=new dtmlXMLLoaderObject(true);b.async=(arguments.length<4);b.waitCall=d;b.loadXML(a,true,c);return b},getSync:function(a){return this.get(a,null,true)},postSync:function(a,b){return this.post(a,b,null,true)}};function dtmlXMLLoaderObject(b,d,c,a){this.xmlDoc="";if(typeof(c)!="undefined"){this.async=c}else{this.async=true}this.onloadAction=b||null;this.mainObject=d||null;this.waitCall=null;this.rSeed=a||false;return this}dtmlXMLLoaderObject.count=0;dtmlXMLLoaderObject.prototype.waitLoadFunction=function(b){var a=true;this.check=function(){if((b)&&(b.onloadAction!=null)){if((!b.xmlDoc.readyState)||(b.xmlDoc.readyState==4)){if(!a){return}a=false;dtmlXMLLoaderObject.count++;if(typeof b.onloadAction=="function"){b.onloadAction(b.mainObject,null,null,null,b)}if(b.waitCall){b.waitCall.call(this,b);b.waitCall=null}}}};return this.check};dtmlXMLLoaderObject.prototype.getXMLTopNode=function(c,a){if(typeof this.xmlDoc.status=="undefined"||this.xmlDoc.status<400){if(this.xmlDoc.responseXML){var b=this.xmlDoc.responseXML.getElementsByTagName(c);if(b.length==0&&c.indexOf(":")!=-1){var b=this.xmlDoc.responseXML.getElementsByTagName((c.split(":"))[1])}var d=b[0]}else{var d=this.xmlDoc.documentElement}if(d){this._retry=false;return d}if(!this._retry&&_isIE){this._retry=true;var a=this.xmlDoc;this.loadXMLString(this.xmlDoc.responseText.replace(/^[\s]+/,""),true);return this.getXMLTopNode(c,a)}}dhtmlxError.throwError("LoadXML","Incorrect XML",[(a||this.xmlDoc),this.mainObject]);return document.createElement("DIV")};dtmlXMLLoaderObject.prototype.loadXMLString=function(b,a){if(!_isIE){var c=new DOMParser();this.xmlDoc=c.parseFromString(b,"text/xml")}else{this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");this.xmlDoc.async=this.async;this.xmlDoc.onreadystatechange=function(){};this.xmlDoc.loadXML(b)}if(a){return}if(this.onloadAction){this.onloadAction(this.mainObject,null,null,null,this)}if(this.waitCall){this.waitCall();this.waitCall=null}};dtmlXMLLoaderObject.prototype.loadXML=function(c,b,a,d){if(this.rSeed){c+=((c.indexOf("?")!=-1)?"&":"?")+"a_dhx_rSeed="+(new Date()).valueOf()}this.filePath=c;if((!_isIE)&&(window.XMLHttpRequest)){this.xmlDoc=new XMLHttpRequest()}else{this.xmlDoc=new ActiveXObject("Microsoft.XMLHTTP")}if(this.async){this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this)}this.xmlDoc.open(b?"POST":"GET",c,this.async);if(d){this.xmlDoc.setRequestHeader("User-Agent","dhtmlxRPC v0.1 ("+navigator.userAgent+")");this.xmlDoc.setRequestHeader("Content-type","text/xml")}else{if(b){this.xmlDoc.setRequestHeader("Content-type",(this.contenttype||"application/x-www-form-urlencoded"))}}this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");this.xmlDoc.send(null||a);if(!this.async){(new this.waitLoadFunction(this))()}};dtmlXMLLoaderObject.prototype.destructor=function(){this._filterXPath=null;this._getAllNamedChilds=null;this._retry=null;this.async=null;this.rSeed=null;this.filePath=null;this.onloadAction=null;this.mainObject=null;this.xmlDoc=null;this.doXPath=null;this.doXPathOpera=null;this.doXSLTransToObject=null;this.doXSLTransToString=null;this.loadXML=null;this.loadXMLString=null;this.doSerialization=null;this.xmlNodeToJSON=null;this.getXMLTopNode=null;this.setXSLParamValue=null;return null};dtmlXMLLoaderObject.prototype.xmlNodeToJSON=function(d){var c={};for(var b=0;b<d.attributes.length;b++){c[d.attributes[b].name]=d.attributes[b].value}c._tagvalue=d.firstChild?d.firstChild.nodeValue:"";for(var b=0;b<d.childNodes.length;b++){var a=d.childNodes[b].tagName;if(a){if(!c[a]){c[a]=[]}c[a].push(this.xmlNodeToJSON(d.childNodes[b]))}}return c};function callerFunction(a,b){this.handler=function(c){if(!c){c=window.event}a(c,b);return true};return this.handler}function getAbsoluteLeft(a){return getOffset(a).left}function getAbsoluteTop(a){return getOffset(a).top}function getOffsetSum(a){var c=0,b=0;while(a){c=c+parseInt(a.offsetTop);b=b+parseInt(a.offsetLeft);a=a.offsetParent}return{top:c,left:b}}function getOffsetRect(d){var g=d.getBoundingClientRect();var h=document.body;var b=document.documentElement;var a=window.pageYOffset||b.scrollTop||h.scrollTop;var e=window.pageXOffset||b.scrollLeft||h.scrollLeft;var f=b.clientTop||h.clientTop||0;var i=b.clientLeft||h.clientLeft||0;var j=g.top+a-f;var c=g.left+e-i;return{top:Math.round(j),left:Math.round(c)}}function getOffset(a){if(a.getBoundingClientRect){return getOffsetRect(a)}else{return getOffsetSum(a)}}function convertStringToBoolean(a){if(typeof(a)=="string"){a=a.toLowerCase()}switch(a){case"1":case"true":case"yes":case"y":case 1:case true:return true;break;default:return false}}function getUrlSymbol(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,b){a.onmousedown=this.preCreateDragCopy;a.dragStarter=b;this.addDragLanding(a,b)};dhtmlDragAndDropObject.prototype.addDragLanding=function(a,b){a.dragLanding=b};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(c){if(!c){c=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,c);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(c,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 b=dragger.dragNode.pWindow;if(a.pWindow&&a.pWindow.dhtmlDragAndDrop.lastLanding){a.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(a.pWindow.dhtmlDragAndDrop.lastLanding)}if(_isIE){var f=document.createElement("Div");f.innerHTML=dragger.dragNode.outerHTML;dragger.dragNode=f.childNodes[0]}else{dragger.dragNode=dragger.dragNode.cloneNode(true)}dragger.dragNode.pWindow=window;dragger.gldragNode.old=dragger.dragNode;document.body.appendChild(dragger.dragNode);b.dhtmlDragAndDrop.dragNode=dragger.dragNode}dragger.dragNode.style.left=c.clientX+15+(dragger.fx?dragger.fx*(-1):0)+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";dragger.dragNode.style.top=c.clientY+3+(dragger.fy?dragger.fy*(-1):0)+(document.body.scrollTop||document.documentElement.scrollTop)+"px";if(!c.srcElement){var d=c.target}else{d=c.srcElement}dragger.checkLanding(d,c)};dhtmlDragAndDropObject.prototype.calculateFramePosition=function(e){if(window.name){var c=parent.frames[window.name].frameElement.offsetParent;var d=0;var b=0;while(c){d+=c.offsetLeft;b+=c.offsetTop;c=c.offsetParent}if((parent.dhtmlDragAndDrop)){var a=parent.dhtmlDragAndDrop.calculateFramePosition(1);d+=a.split("_")[0]*1;b+=a.split("_")[1]*1}if(e){return d+"_"+b}else{this.fx=d}this.fy=b}return"0_0"};dhtmlDragAndDropObject.prototype.checkLanding=function(b,a){if((b)&&(b.dragLanding)){if(this.lastLanding){this.lastLanding.dragLanding._dragOut(this.lastLanding)}this.lastLanding=b;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((b)&&(b.tagName!="BODY")){this.checkLanding(b.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(b,c){dragger=window.dhtmlDragAndDrop;if(!c){dragger.stopFrameRoute();var a=dragger.lastLanding;dragger.lastLanding=null;if(a){a.dragLanding._drag(dragger.dragStartNode,dragger.dragStartObject,a,(_isIE?event.srcElement:b.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(c){if(c){window.dhtmlDragAndDrop.stopDrag(1,1)}for(var a=0;a<window.frames.length;a++){try{if((window.frames[a]!=c)&&(window.frames[a].dhtmlDragAndDrop)){window.frames[a].dhtmlDragAndDrop.stopFrameRoute(window)}}catch(b){}}try{if((parent.dhtmlDragAndDrop)&&(parent!=window)&&(parent!=c)){parent.dhtmlDragAndDrop.stopFrameRoute(window)}}catch(b){}};dhtmlDragAndDropObject.prototype.initFrameRoute=function(c,d){if(c){window.dhtmlDragAndDrop.preCreateDragCopy();window.dhtmlDragAndDrop.dragStartNode=c.dhtmlDragAndDrop.dragStartNode;window.dhtmlDragAndDrop.dragStartObject=c.dhtmlDragAndDrop.dragStartObject;window.dhtmlDragAndDrop.dragNode=c.dhtmlDragAndDrop.dragNode;window.dhtmlDragAndDrop.gldragNode=c.dhtmlDragAndDrop.dragNode;window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag;window.waitDrag=0;if(((!_isIE)&&(d))&&((!_isFF)||(_FFrv<1.8))){window.dhtmlDragAndDrop.calculateFramePosition()}}try{if((parent.dhtmlDragAndDrop)&&(parent!=window)&&(parent!=c)){parent.dhtmlDragAndDrop.initFrameRoute(window)}}catch(b){}for(var a=0;a<window.frames.length;a++){try{if((window.frames[a]!=c)&&(window.frames[a].dhtmlDragAndDrop)){window.frames[a].dhtmlDragAndDrop.initFrameRoute(window,((!c||d)?1:0))}}catch(b){}}};_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])}}}}dtmlXMLLoaderObject.prototype.doXPath=function(c,e,d,i){if(_isKHTML||(!_isIE&&!window.XPathResult)){return this.doXPathOpera(c,e)}if(_isIE){if(!e){if(!this.xmlDoc.nodeName){e=this.xmlDoc.responseXML}else{e=this.xmlDoc}}if(!e){dhtmlxError.throwError("LoadXML","Incorrect XML",[(e||this.xmlDoc),this.mainObject])}if(d!=null){e.setProperty("SelectionNamespaces","xmlns:xsl='"+d+"'")}if(i=="single"){return e.selectSingleNode(c)}else{return e.selectNodes(c)||new Array(0)}}else{var a=e;if(!e){if(!this.xmlDoc.nodeName){e=this.xmlDoc.responseXML}else{e=this.xmlDoc}}if(!e){dhtmlxError.throwError("LoadXML","Incorrect XML",[(e||this.xmlDoc),this.mainObject])}if(e.nodeName.indexOf("document")!=-1){a=e}else{a=e;e=e.ownerDocument}var g=XPathResult.ANY_TYPE;if(i=="single"){g=XPathResult.FIRST_ORDERED_NODE_TYPE}var f=new Array();var b=e.evaluate(c,a,function(j){return d},g,null);if(g==XPathResult.FIRST_ORDERED_NODE_TYPE){return b.singleNodeValue}var h=b.iterateNext();while(h){f[f.length]=h;h=b.iterateNext()}return f}};function _dhtmlxError(b,a,c){if(!this.catches){this.catches=new Array()}return this}_dhtmlxError.prototype.catchError=function(b,a){this.catches[b]=a};_dhtmlxError.prototype.throwError=function(b,a,c){if(this.catches[b]){return this.catches[b](b,a,c)}if(this.catches.ALL){return this.catches.ALL(b,a,c)}alert("Error type: "+arguments[0]+"\nDescription: "+arguments[1]);return null};window.dhtmlxError=new _dhtmlxError();dtmlXMLLoaderObject.prototype.doXPathOpera=function(c,a){var e=c.replace(/[\/]+/gi,"/").split("/");var d=null;var b=1;if(!e.length){return[]}if(e[0]=="."){d=[a]}else{if(e[0]==""){d=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(e[b].replace(/\[[^\]]*\]/g,""));b++}else{return[]}}for(b;b<e.length;b++){d=this._getAllNamedChilds(d,e[b])}if(e[b-1].indexOf("[")!=-1){d=this._filterXPath(d,e[b-1])}return d};dtmlXMLLoaderObject.prototype._filterXPath=function(e,d){var g=new Array();var d=d.replace(/[^\[]*\[\@/g,"").replace(/[\[\]\@]*/g,"");for(var f=0;f<e.length;f++){if(e[f].getAttribute(d)){g[g.length]=e[f]}}return g};dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(e,d){var h=new Array();if(_isKHTML){d=d.toUpperCase()}for(var g=0;g<e.length;g++){for(var f=0;f<e[g].childNodes.length;f++){if(_isKHTML){if(e[g].childNodes[f].tagName&&e[g].childNodes[f].tagName.toUpperCase()==d){h[h.length]=e[g].childNodes[f]}}else{if(e[g].childNodes[f].tagName==d){h[h.length]=e[g].childNodes[f]}}}}return h};function dhtmlXHeir(e,d){for(var f in d){if(typeof(d[f])=="function"){e[f]=d[f]}}return e}function dhtmlxEvent(b,c,a){if(b.addEventListener){b.addEventListener(c,a,false)}else{if(b.attachEvent){b.attachEvent("on"+c,a)}}}dtmlXMLLoaderObject.prototype.xslDoc=null;dtmlXMLLoaderObject.prototype.setXSLParamValue=function(b,c,d){if(!d){d=this.xslDoc}if(d.responseXML){d=d.responseXML}var a=this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+b+"']",d,"http://www.w3.org/1999/XSL/Transform","single");if(a!=null){a.firstChild.nodeValue=c}};dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(d,b){if(!d){d=this.xslDoc}if(d.responseXML){d=d.responseXML}if(!b){b=this.xmlDoc}if(b.responseXML){b=b.responseXML}if(!_isIE){if(!this.XSLProcessor){this.XSLProcessor=new XSLTProcessor();this.XSLProcessor.importStylesheet(d)}var a=this.XSLProcessor.transformToDocument(b)}else{var a=new ActiveXObject("Msxml2.DOMDocument.3.0");try{b.transformNodeToObject(d,a)}catch(c){a=b.transformNode(d)}}return a};dtmlXMLLoaderObject.prototype.doXSLTransToString=function(c,b){var a=this.doXSLTransToObject(c,b);if(typeof(a)=="string"){return a}return this.doSerialization(a)};dtmlXMLLoaderObject.prototype.doSerialization=function(b){if(!b){b=this.xmlDoc}if(b.responseXML){b=b.responseXML}if(!_isIE){var a=new XMLSerializer();return a.serializeToString(b)}else{return b.xml}};dhtmlxEventable=function(obj){obj.attachEvent=function(name,catcher,callObj){name="ev_"+name.toLowerCase();if(!this[name]){this[name]=new this.eventCatcher(callObj||this)}return(name+":"+this[name].addEvent(catcher))};obj.callEvent=function(name,arg0){name="ev_"+name.toLowerCase();if(this[name]){return this[name].apply(this,arg0)}return true};obj.checkEvent=function(name){return(!!this["ev_"+name.toLowerCase()])};obj.eventCatcher=function(obj){var dhx_catch=[];var z=function(){var res=true;for(var i=0;i<dhx_catch.length;i++){if(dhx_catch[i]!=null){var zr=dhx_catch[i].apply(obj,arguments);res=res&&zr}}return res};z.addEvent=function(ev){if(typeof(ev)!="function"){ev=eval(ev)}if(ev){return dhx_catch.push(ev)-1}return false};z.removeEvent=function(id){dhx_catch[id]=null};return z};obj.detachEvent=function(id){if(id!=false){var list=id.split(":");this[list[0]].removeEvent(list[1])}};obj.detachAllEvents=function(){for(var name in this){if(name.indexOf("ev_")==0){this.detachEvent(name);this[name]=null}}};obj=null};function dataProcessor(a){this.serverProcessor=a;this.action_param="!nativeeditor_status";this.object=null;this.updatedRows=[];this.autoUpdate=true;this.updateMode="cell";this._tMode="GET";this.post_delim="_";this._waitMode=0;this._in_progress={};this._invalid={};this.mandatoryFields=[];this.messages=[];this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",error:"color:red;",clear:"font-weight:normal;text-decoration:none;"};this.enableUTFencoding(true);dhtmlxEventable(this);return this}dataProcessor.prototype={setTransactionMode:function(b,a){this._tMode=b;this._tSend=a},escape:function(a){if(this._utf){return encodeURIComponent(a)}else{return escape(a)}},enableUTFencoding:function(a){this._utf=convertStringToBoolean(a)},setDataColumns:function(a){this._columns=(typeof a=="string")?a.split(","):a},getSyncState:function(){return !this.updatedRows.length},enableDataNames:function(a){this._endnm=convertStringToBoolean(a)},enablePartialDataSend:function(a){this._changed=convertStringToBoolean(a)},setUpdateMode:function(b,a){this.autoUpdate=(b=="cell");this.updateMode=b;this.dnd=a},ignore:function(b,a){this._silent_mode=true;b.call(a||window);this._silent_mode=false},setUpdated:function(d,c,e){if(this._silent_mode){return}var b=this.findRow(d);e=e||"updated";var a=this.obj.getUserData(d,this.action_param);if(a&&e=="updated"){e=a}if(c){this.set_invalid(d,false);this.updatedRows[b]=d;this.obj.setUserData(d,this.action_param,e);if(this._in_progress[d]){this._in_progress[d]="wait"}}else{if(!this.is_invalid(d)){this.updatedRows.splice(b,1);this.obj.setUserData(d,this.action_param,"")}}if(!c){this._clearUpdateFlag(d)}this.markRow(d,c,e);if(c&&this.autoUpdate){this.sendData(d)}},_clearUpdateFlag:function(a){},markRow:function(f,c,e){var d="";var b=this.is_invalid(f);if(b){d=this.styles[b];c=true}if(this.callEvent("onRowMark",[f,c,e,b])){d=this.styles[c?e:"clear"]+d;this.obj[this._methods[0]](f,d);if(b&&b.details){d+=this.styles[b+"_cell"];for(var a=0;a<b.details.length;a++){if(b.details[a]){this.obj[this._methods[1]](f,a,d)}}}}},getState:function(a){return this.obj.getUserData(a,this.action_param)},is_invalid:function(a){return this._invalid[a]},set_invalid:function(c,b,a){if(a){b={value:b,details:a,toString:function(){return this.value.toString()}}}this._invalid[c]=b},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.checkBeforeUpdate(a)&&this.callEvent("onValidationError",[a,this.messages])){return false}this._beforeSendData(this._getRowData(a),a)},_beforeSendData:function(a,b){if(!this.callEvent("onBeforeUpdate",[b,this.getState(b),a])){return false}this._sendData(a,b)},serialize:function(d,e){if(typeof d=="string"){return d}if(typeof e!="undefined"){return this.serialize_one(d,"")}else{var a=[];var c=[];for(var b in d){if(d.hasOwnProperty(b)){a.push(this.serialize_one(d[b],b+this.post_delim));c.push(b)}}a.push("ids="+this.escape(c.join(",")));if(dhtmlx.security_key){a.push("dhx_security="+dhtmlx.security_key)}return a.join("&")}},serialize_one:function(d,b){if(typeof d=="string"){return d}var a=[];for(var c in d){if(d.hasOwnProperty(c)){a.push(this.escape((b||"")+c)+"="+this.escape(d[c]))}}return a.join("&")},_sendData:function(b,c){if(!b){return}if(!this.callEvent("onBeforeDataSending",c?[c,this.getState(c),b]:[null,null,b])){return false}if(c){this._in_progress[c]=(new Date()).valueOf()}var a=new dtmlXMLLoaderObject(this.afterUpdate,this,true);var d=this.serverProcessor+(this._user?(getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&")):"");if(this._tMode!="POST"){a.loadXML(d+((d.indexOf("?")!=-1)?"&":"?")+this.serialize(b,c))}else{a.loadXML(d,true,this.serialize(b,c))}this._waitMode++},sendAllData:function(){if(!this.updatedRows.length){return}this.messages=[];var b=true;for(var a=0;a<this.updatedRows.length;a++){b&=this.checkBeforeUpdate(this.updatedRows[a])}if(!b&&!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(d){var b={};var a=false;for(var c=0;c<this.updatedRows.length;c++){var e=this.updatedRows[c];if(this._in_progress[e]||this.is_invalid(e)){continue}if(!this.callEvent("onBeforeUpdate",[e,this.getState(e)])){continue}b[e]=this._getRowData(e,e+this.post_delim);a=true;this._in_progress[e]=(new Date()).valueOf()}return a?b:null},setVerificator:function(b,a){this.mandatoryFields[b]=a||(function(c){return(c!="")})},clearVerificator:function(a){this.mandatoryFields[a]=false},findRow:function(b){var a=0;for(a=0;a<this.updatedRows.length;a++){if(b==this.updatedRows[a]){break}}return a},defineAction:function(a,b){if(!this._uActions){this._uActions=[]}this._uActions[a]=b},afterUpdateCallback:function(b,g,f,e){var a=b;var d=(f!="error"&&f!="invalid");if(!d){this.set_invalid(b,f)}if((this._uActions)&&(this._uActions[f])&&(!this._uActions[f](e))){return(delete this._in_progress[a])}if(this._in_progress[a]!="wait"){this.setUpdated(b,false)}var c=b;switch(f){case"inserted":case"insert":if(g!=b){this.obj[this._methods[2]](b,g);b=g}break;case"delete":case"deleted":this.obj.setUserData(b,this.action_param,"true_deleted");this.obj[this._methods[3]](b);delete this._in_progress[a];return this.callEvent("onAfterUpdate",[b,f,g,e]);break}if(this._in_progress[a]!="wait"){if(d){this.obj.setUserData(b,this.action_param,"")}delete this._in_progress[a]}else{delete this._in_progress[a];this.setUpdated(g,true,this.obj.getUserData(b,this.action_param))}this.callEvent("onAfterUpdate",[c,f,g,e])},afterUpdate:function(l,p,n,m,j){j.getXMLTopNode("data");if(!j.xmlDoc.responseXML){return}var o=j.doXPath("//data/action");for(var g=0;g<o.length;g++){var h=o[g];var f=h.getAttribute("type");var a=h.getAttribute("sid");var e=h.getAttribute("tid");l.afterUpdateCallback(a,e,f,h)}l.finalizeUpdate()},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(this.obj._dp_init){this.obj._dp_init(this)}},setOnAfterUpdate:function(a){this.attachEvent("onAfterUpdate",a)},enableDebug:function(a){},setOnBeforeUpdateHandler:function(a){this.attachEvent("onBeforeDataSending",a)},setAutoUpdate:function(c,b){c=c||2000;this._user=b||(new Date()).valueOf();this._need_update=false;this._loader=null;this._update_busy=false;this.attachEvent("onAfterUpdate",function(d,f,g,e){this.afterAutoUpdate(d,f,g,e)});this.attachEvent("onFullSync",function(){this.fullSync()});var a=this;window.setInterval(function(){a.loadUpdate()},c)},afterAutoUpdate:function(a,c,d,b){if(c=="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,b){if(this._update_busy){return false}else{this._update_busy=true}this._loader=this._loader||new dtmlXMLLoaderObject(true);this._loader.async=true;this._loader.waitCall=b;this._loader.loadXML(a)},_v:function(a){if(a.firstChild){return a.firstChild.nodeValue}return""},_a:function(a){var c=[];for(var b=0;b<a.length;b++){c[b]=this._v(a[b])}return c},loadUpdate:function(){var b=this;var a=this.obj.getUserData(0,"version");var c=this.serverProcessor+getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+a].join("&");c=c.replace("editing=true&","");this.getUpdates(c,function(){var f=b._loader.doXPath("//userdata");b.obj.setUserData(0,"version",b._v(f[0]));var d=b._loader.doXPath("//update");if(d.length){b._silent_mode=true;for(var g=0;g<d.length;g++){var e=d[g].getAttribute("status");var j=d[g].getAttribute("id");var h=d[g].getAttribute("parent");switch(e){case"inserted":b.callEvent("insertCallback",[d[g],j,h]);break;case"updated":b.callEvent("updateCallback",[d[g],j,h]);break;case"deleted":b.callEvent("deleteCallback",[d[g],j,h]);break}}b._silent_mode=false}b._update_busy=false;b=null})}};if(window.dhtmlXGridObject&&!dhtmlXGridObject.prototype._init_point_connector){dhtmlXGridObject.prototype._init_point_connector=dhtmlXGridObject.prototype._init_point;dhtmlXGridObject.prototype._init_point=function(){this._con_f_used=[].concat(this._con_f_used);dhtmlXGridObject.prototype._con_f_used=[];var a=function(e){e=e.replace(/(\?|\&)connector[^\f]*/g,"");return e+(e.indexOf("?")!=-1?"&":"?")+"connector=true"+(this.hdr.rows.length>0?"&dhx_no_header=1":"")};var d=function(e){return a.call(this,e)+(this._connector_sorting||"")+(this._connector_filter||"")};var c=function(f,g,e){this._connector_sorting="&dhx_sort["+g+"]="+e;return d.call(this,f)};var b=function(f,e,h){var j=[];for(var g=0;g<e.length;g++){j[g]="dhx_filter["+e[g]+"]="+encodeURIComponent(h[g])}this._connector_filter="&"+j.join("&");return d.call(this,f)};this.attachEvent("onCollectValues",function(e){if(this._con_f_used[e]){if(typeof(this._con_f_used[e])=="object"){return this._con_f_used[e]}else{return false}}return true});this.attachEvent("onDynXLS",function(){this.xmlFileUrl=d.call(this,this.xmlFileUrl);return true});this.attachEvent("onBeforeSorting",function(h,g,f){if(g=="connector"){var e=this;this.clearAndLoad(c.call(this,this.xmlFileUrl,h,f),function(){e.setSortImgState(true,h,f)});return false}return true});this.attachEvent("onFilterStart",function(f,e){var h=this.getSortingState();if(this._con_f_used.length){var g=this;this.clearAndLoad(b.call(this,this.xmlFileUrl,f,e));if(h.length){g.setSortImgState(true,h[0],h[1])}return false}return true});this.attachEvent("onXLE",function(f,e,h,g){if(!g){return}});if(this._init_point_connector){this._init_point_connector()}};dhtmlXGridObject.prototype._con_f_used=[];dhtmlXGridObject.prototype._in_header_connector_text_filter=function(b,a){if(!this._con_f_used[a]){this._con_f_used[a]=1}return this._in_header_text_filter(b,a)};dhtmlXGridObject.prototype._in_header_connector_select_filter=function(b,a){if(!this._con_f_used[a]){this._con_f_used[a]=2}return this._in_header_select_filter(b,a)};dhtmlXGridObject.prototype.load_connector=dhtmlXGridObject.prototype.load;dhtmlXGridObject.prototype.load=function(b,e,d){if(!this._colls_loaded&&this.cellType){var a=[];for(var c=0;c<this.cellType.length;c++){if(this.cellType[c].indexOf("co")==0||this.cellType[c].indexOf("clist")==0||this._con_f_used[c]==2){a.push(c)}}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(b,q,n){this._parseHead_connector.apply(this,arguments);if(!this._colls_loaded){var o=this.xmlLoader.doXPath("./coll_options",arguments[0]);for(var h=0;h<o.length;h++){var m=o[h].getAttribute("for");var p=[];var d=null;if(this.cellType[m]=="combo"){d=this.getColumnCombo(m)}else{if(this.cellType[m].indexOf("co")==0){d=this.getCombo(m)}}var g=this.xmlLoader.doXPath("./item",o[h]);var a=[];for(var e=0;e<g.length;e++){var c=g[e].getAttribute("value");if(d){var l=g[e].getAttribute("label")||c;if(d.addOption){a.push([c,l])}else{d.put(c,l)}p[p.length]=l}else{p[p.length]=c}}if(a.length){if(d){d.addOption(a)}}else{if(p.length&&!d){if(this.registerCList){this.registerCList(m*1,p)}}}if(this._con_f_used[m*1]){this._con_f_used[m*1]=p}}this._colls_loaded=true}}}if(window.dataProcessor&&!dataProcessor.prototype.init_original){dataProcessor.prototype.init_original=dataProcessor.prototype.init;dataProcessor.prototype.init=function(a){this.init_original(a);a._dataprocessor=this;this.setTransactionMode("POST",true);this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true"}}dhtmlxError.catchError("LoadXML",function(e,d,f){alert(f[0].responseText)});function dhtmlXCalendarObject(f,l){this.i={};var c=null;if(typeof(f)=="string"){var d=document.getElementById(f)}else{var d=f}if(d&&typeof(d)=="object"&&d.tagName&&String(d.tagName).toLowerCase()!="input"){c=d}d=null;if(typeof(f)!="object"||!f.length){f=[f]}for(var b=0;b<f.length;b++){if(typeof(f[b])=="string"){f[b]=(document.getElementById(f[b])||null)}if(f[b]!=null&&f[b].tagName&&String(f[b].tagName).toLowerCase()=="input"){this.i[window.dhx4.newId()]={input:f[b]}}else{if(!(f[b] instanceof Array)&&f[b] instanceof Object&&(f[b].input!=null||f[b].button!=null)){if(f[b].input!=null&&typeof(f[b].input)=="string"){f[b].input=document.getElementById(f[b].input)}if(f[b].button!=null&&typeof(f[b].button)=="string"){f[b].button=document.getElementById(f[b].button)}this.i[window.dhx4.newId()]=f[b]}}f[b]=null}this.conf={skin:(l||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhtmlxcalendar")||"dhx_skyblue"),zi:window.dhx4.newId(),touch:(typeof(window.ontouchstart)!="undefined")};this.setSkin=function(m,a){if(this.conf.skin==m&&!a){return}this.conf.skin=m;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(c!=null){this._hasParent=true;c.appendChild(this.base);c=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);if(this.conf.touch){this.base.ontouchstart=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}a.cancelBubble=true}}else{this.base.onclick=function(a){a=a||event;a.cancelBubble=true};this.base.onmousedown=function(){return false}}this.loadUserLanguage=function(o){if(!this.langData[o]){return}this.lang=o;this.setWeekStartDay(this.langData[this.lang].weekstart);this.setDateFormat(this.langData[this.lang].dateformat||"%Y-%m-%d");if(this.msCont){var n=0;for(var m=0;m<this.msCont.childNodes.length;m++){for(var a=0;a<this.msCont.childNodes[m].childNodes.length;a++){this.msCont.childNodes[m].childNodes[a].innerHTML=this.langData[this.lang].monthesSNames[n++]}}}};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 g=document.createElement("UL");g.className="dhtmlxcalendar_line";this.contMonth.appendChild(g);var j=document.createElement("LI");j.className="dhtmlxcalendar_cell dhtmlxcalendar_month_hdr";j.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>";g.appendChild(j);var e=this;j[this.conf.touch?"ontouchstart":"onclick"]=function(o){o=o||event;var m=(o.target||o.srcElement);if(m.className&&m.className.indexOf("dhtmlxcalendar_month_arrow")===0){e._hideSelector();var n=(m.parentNode.firstChild==m?-1:1);var a=new Date(e._activeMonth);e._drawMonth(new Date(e._activeMonth.getFullYear(),e._activeMonth.getMonth()+n,1,0,0,0,0));e._evOnArrowClick([a,new Date(e._activeMonth)]);return}if(m.className&&m.className=="dhtmlxcalendar_month_label_month"){o.cancelBubble=true;e._showSelector("month",Math.round(m.offsetLeft+m.offsetWidth/2),m.offsetTop+m.offsetHeight+2,"selector_month",true);return}if(m.className&&m.className=="dhtmlxcalendar_month_label_year"){o.cancelBubble=true;e._showSelector("year",Math.round(m.offsetLeft+m.offsetWidth/2),m.offsetTop+m.offsetHeight+2,"selector_year",true);return}e._hideSelector()};this.contDays=document.createElement("DIV");this.contDays.className="dhtmlxcalendar_days_cont";this.base.firstChild.appendChild(this.contDays);this.setWeekStartDay=function(a){if(a==0){a=7}this._wStart=Math.min(Math.max((isNaN(a)?1:a),1),7);this._drawDaysOfWeek()};this._drawDaysOfWeek=function(){if(this.contDays.childNodes.length==0){var o=document.createElement("UL");o.className="dhtmlxcalendar_line";this.contDays.appendChild(o)}else{var o=this.contDays.firstChild}var m=this._wStart;var n=this.langData[this.lang].daysSNames;n.push(String(this.langData[this.lang].daysSNames[0]).valueOf());for(var p=0;p<8;p++){if(o.childNodes[p]==null){var a=document.createElement("LI");o.appendChild(a)}else{var a=o.childNodes[p]}if(p==0){a.className="dhtmlxcalendar_cell_wn";a.innerHTML="<div class='dhtmlxcalendar_label'>"+(this.langData[this.lang].weekname||"w")+"</div>"}else{a.className="dhtmlxcalendar_cell"+(m>=6?" dhtmlxcalendar_day_weekday_cell":"")+(p==1?"_first":"");a.innerHTML=n[m];if(++m>7){m=1}}}if(this._activeMonth!=null){this._drawMonth(this._activeMonth)}};this._wStart=this.langData[this.lang].weekstart;this.setWeekStartDay(this._wStart);this.contDates=document.createElement("DIV");this.contDates.className="dhtmlxcalendar_dates_cont";this.base.firstChild.appendChild(this.contDates);this.contDates[this.conf.touch?"ontouchend":"onclick"]=function(q){q=q||event;var m=(q.target||q.srcElement);if(m.parentNode!=null&&m.parentNode._date!=null){m=m.parentNode}if(m._date!=null&&!m._css_dis){var o=e._activeDate.getHours();var n=e._activeDate.getMinutes();var p=m._date;if(e.checkEvent("onBeforeChange")){if(!e.callEvent("onBeforeChange",[new Date(m._date.getFullYear(),m._date.getMonth(),m._date.getDate(),o,n)])){return}}if(e._activeDateCell!=null){e._activeDateCell._css_date=false;e._updateCellStyle(e._activeDateCell._q,e._activeDateCell._w)}var a=(e._activeDate.getFullYear()+"_"+e._activeDate.getMonth()!=p.getFullYear()+"_"+p.getMonth());e._nullDate=false;e._activeDate=new Date(p.getFullYear(),p.getMonth(),p.getDate(),o,n);e._activeDateCell=m;e._activeDateCell._css_date=true;e._activeDateCell._css_hover=false;e._updateCellStyle(e._activeDateCell._q,e._activeDateCell._w);if(a){e._drawMonth(e._activeDate)}if(e._activeInp&&e.i[e._activeInp]&&e.i[e._activeInp].input!=null){e.i[e._activeInp].input.value=e._dateToStr(new Date(e._activeDate.getTime()))}if(!e._hasParent){e._hide()}e._evOnClick([new Date(e._activeDate.getTime())])}};if(!this.conf.touch){this.contDates.onmouseover=function(m){m=m||event;var a=(m.target||m.srcElement);if(a.parentNode!=null&&a.parentNode._date!=null){a=a.parentNode}if(a._date!=null){if(e._lastHover==a||a._css_hover){return}a._css_hover=true;e._updateCellStyle(a._q,a._w);e._lastHover=a;e._evOnMouseOver([new Date(a._date.getFullYear(),a._date.getMonth(),a._date.getDate(),0,0,0,0),m]);a=null}};this.contDates.onmouseout=function(a){e._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);e._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 b=0;b<6;b++){var g=document.createElement("UL");g.className="dhtmlxcalendar_line";this.contDates.appendChild(g);for(var i=0;i<=7;i++){var j=document.createElement("LI");if(i==0){j.className="dhtmlxcalendar_cell_wn"}else{j.className="dhtmlxcalendar_cell"}g.appendChild(j)}}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 g=document.createElement("UL");g.className="dhtmlxcalendar_line";this.contTime.appendChild(g);var j=document.createElement("LI");j.className="dhtmlxcalendar_cell dhtmlxcalendar_time_hdr";j.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>";g.appendChild(j);j[this.conf.touch?"ontouchstart":"onclick"]=function(n){n=n||event;var a=(n.target||n.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"){n.cancelBubble=true;var m=e.contMonth.offsetHeight+e.contDays.offsetHeight+e.contDates.offsetHeight+a.offsetTop;e._showSelector("hours",Math.round(a.offsetLeft+a.offsetWidth/2),m-2,"selector_hours",true);return}if(a.className&&a.className=="dhtmlxcalendar_label_minutes"){n.cancelBubble=true;if(e._minutesInterval==1){var o=e.getFormatedDate("%i");a.innerHTML="<span class='dhtmlxcalendar_selected_date'>"+o.charAt(0)+"</span>"+o.charAt(1);a.firstChild._par=true;e._selectorMode=1}var m=e.contMonth.offsetHeight+e.contDays.offsetHeight+e.contDates.offsetHeight+a.offsetTop;e._showSelector("minutes",Math.round(a.offsetLeft+a.offsetWidth/2),m-2,"selector_minutes",true);return}e._hideSelector()};this._activeMonth=null;this._activeDate=new Date();this._activeDateCell=null;this.setDate=function(m){this._nullDate=(typeof(m)=="undefined"||m===""||!m);if(!(m instanceof Date)){m=this._strToDate(String(m||""));if(m=="Invalid Date"){m=new Date()}}var a=m.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(m){if(this._nullDate){return null}var a=new Date(this._activeDate.getTime());if(m){return this._dateToStr(a)}return a};this._drawMonth=function(t){if(!(t instanceof Date)){return}if(isNaN(t.getFullYear())){t=new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),1,0,0,0,0)}this._activeMonth=new Date(t.getFullYear(),t.getMonth(),1,0,0,0,0);this._activeDateCell=null;var r=new Date(this._activeMonth.getTime());var n=r.getDay();var x=n-this._wStart;if(x<0){x=x+7}r.setDate(r.getDate()-x);var A=t.getMonth();var C=new Date(this._activeDate.getFullYear(),this._activeDate.getMonth(),this._activeDate.getDate(),0,0,0,0).getTime();var p=0;for(var m=0;m<6;m++){var s=this._wStart;for(var z=0;z<=7;z++){if(z==0){var y=this.getWeekNumber(new Date(r.getFullYear(),r.getMonth(),r.getDate()+p,0,0,0,0));this.contDates.childNodes[m].childNodes[z].innerHTML="<div class='dhtmlxcalendar_label'>"+y+"</div>"}else{var a=new Date(r.getFullYear(),r.getMonth(),r.getDate()+p,0,0,0,0);var v=a.getDay();var o=a.getTime();var u="dhtmlxcalendar_label";if(this._tipData[o]!=null){if(this._tipData[o].usePopup&&typeof(window.dhtmlXPopup)=="function"){this.contDates.childNodes[m].childNodes[z].removeAttribute("title");this._initTooltipPopup()}else{this.contDates.childNodes[m].childNodes[z].setAttribute("title",this._tipData[o].text)}if(this._tipData[o].showIcon){u+=" dhtmlxcalendar_label_title"}}else{this.contDates.childNodes[m].childNodes[z].removeAttribute("title")}this.contDates.childNodes[m].childNodes[z].innerHTML="<div class='"+u+"'>"+a.getDate()+"</div>";this.contDates.childNodes[m].childNodes[z]._date=new Date(o);this.contDates.childNodes[m].childNodes[z]._q=m;this.contDates.childNodes[m].childNodes[z]._w=z;this.contDates.childNodes[m].childNodes[z]._css_month=(a.getMonth()==A);this.contDates.childNodes[m].childNodes[z]._css_date=(!this._nullDate&&o==C);this.contDates.childNodes[m].childNodes[z]._css_weekend=(s>=6);this.contDates.childNodes[m].childNodes[z]._css_dis=this._isOutOfRange(o);this.contDates.childNodes[m].childNodes[z]._css_holiday=(this._holidays[o]==true);this._updateCellStyle(m,z);if(o==C){this._activeDateCell=this.contDates.childNodes[m].childNodes[z]}if(++s>7){s=1}p++}}}this.contMonth.firstChild.firstChild.childNodes[1].innerHTML=this._buildMonthHdr(t)};this._updateCellStyle=function(o,a){var n=this.contDates.childNodes[o].childNodes[a];var m="dhtmlxcalendar_cell dhtmlxcalendar_cell";m+=(n._css_month?"_month":"");m+=(n._css_date?"_date":"");m+=(n._css_weekend?"_weekend":"");m+=(n._css_holiday?"_holiday":"");m+=(n._css_dis?"_dis":"");m+=(n._css_hover&&!n._css_dis?"_hover":"");n.className=m;n=null};this._minutesInterval=5;this._initSelector=function(t,o){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;";if(!this.conf.touch){this._sel.firstChild.firstChild.firstChild.childNodes[0].onmouseover=function(){this.className="dhtmlxcalendar_selector_cell_left dhtmlxcalendar_selector_cell_left_hover"};this._sel.firstChild.firstChild.firstChild.childNodes[0].onmouseout=function(){this.className="dhtmlxcalendar_selector_cell_left"};this._sel.firstChild.firstChild.firstChild.childNodes[2].onmouseover=function(){this.className="dhtmlxcalendar_selector_cell_right dhtmlxcalendar_selector_cell_right_hover"};this._sel.firstChild.firstChild.firstChild.childNodes[2].onmouseout=function(){this.className="dhtmlxcalendar_selector_cell_right"};this._sel.onmouseover=function(w){w=w||event;var q=(w.target||w.srcElement);if(q._cell===true){if(e._selHover!=q){e._clearSelHover()}if(String(q.className).match(/^\s{0,}dhtmlxcalendar_selector_cell\s{0,}$/gi)!=null){q.className+=" dhtmlxcalendar_selector_cell_hover";e._selHover=q}}};this._sel.onmouseout=function(){e._clearSelHover()}}this._sel.firstChild.firstChild.firstChild.childNodes[0][this.conf.touch?"ontouchstart":"onclick"]=function(q){q=q||event;q.cancelBubble=true;e._scrollYears(-1)};this._sel.firstChild.firstChild.firstChild.childNodes[2][this.conf.touch?"ontouchstart":"onclick"]=function(q){q=q||event;q.cancelBubble=true;e._scrollYears(1)};this._sel._ta={};this._selHover=null;this._sel.appendChild(document.createElement("DIV"));this._sel.lastChild.className="dhtmlxcalendar_selector_obj_arrow"}if(this._sel._ta[t]==true){return}if(t=="month"){this._msCells={};this.msCont=document.createElement("DIV");this.msCont.className="dhtmlxcalendar_area_"+o;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.msCont);var m=0;for(var a=0;a<4;a++){var s=document.createElement("UL");s.className="dhtmlxcalendar_selector_line";this.msCont.appendChild(s);for(var u=0;u<3;u++){var v=document.createElement("LI");v.innerHTML=this.langData[this.lang].monthesSNames[m];v.className="dhtmlxcalendar_selector_cell";s.appendChild(v);v._month=m;v._cell=true;this._msCells[m++]=v}}this.msCont[this.conf.touch?"ontouchstart":"onclick"]=function(w){w=w||event;w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._month!=null){e._hideSelector();e._updateActiveMonth();e._drawMonth(new Date(e._activeMonth.getFullYear(),q._month,1,0,0,0,0));e._doOnSelectorChange()}}}if(t=="year"){this._ysCells={};this.ysCont=document.createElement("DIV");this.ysCont.className="dhtmlxcalendar_area_"+o;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.ysCont);for(var a=0;a<4;a++){var s=document.createElement("UL");s.className="dhtmlxcalendar_selector_line";this.ysCont.appendChild(s);for(var u=0;u<3;u++){var v=document.createElement("LI");v.className="dhtmlxcalendar_selector_cell";v._cell=true;s.appendChild(v)}}this.ysCont[this.conf.touch?"ontouchstart":"onclick"]=function(w){w=w||event;w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._year!=null){e._hideSelector();e._drawMonth(new Date(q._year,e._activeMonth.getMonth(),1,0,0,0,0));e._doOnSelectorChange()}}}if(t=="hours"){this._hsCells={};this.hsCont=document.createElement("DIV");this.hsCont.className="dhtmlxcalendar_area_"+o;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.hsCont);var m=0;for(var a=0;a<4;a++){var s=document.createElement("UL");s.className="dhtmlxcalendar_selector_line";this.hsCont.appendChild(s);for(var u=0;u<6;u++){var v=document.createElement("LI");v.innerHTML=this._fixLength(m,2);v.className="dhtmlxcalendar_selector_cell";s.appendChild(v);v._hours=m;v._cell=true;this._hsCells[m++]=v}}this.hsCont[this.conf.touch?"ontouchstart":"onclick"]=function(w){w=w||event;w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._hours!=null){e._hideSelector();e._activeDate.setHours(q._hours);e._updateActiveHours();e._updateVisibleHours();e._doOnSelectorChange()}}}if(t=="minutes"){var r=4;var n=3;var p=2;if(this._minutesInterval==1){if(this._selectorMode==1){r=2;n=3;p=1}else{r=2;n=5;p=1;o+="5"}}if(this._minutesInterval==10){r=2}if(this._minutesInterval==15){r=1;n=4;o+="4"}this._rsCells={};this.rsCont=document.createElement("DIV");this.rsCont.className="dhtmlxcalendar_area_"+o;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.rsCont);var m=0;for(var a=0;a<r;a++){var s=document.createElement("UL");s.className="dhtmlxcalendar_selector_line";this.rsCont.appendChild(s);for(var u=0;u<n;u++){var v=document.createElement("LI");v.innerHTML=(p>1?this._fixLength(m,p):m);v.className="dhtmlxcalendar_selector_cell";s.appendChild(v);v._minutes=m;v._cell=true;this._rsCells[m]=v;m+=this._minutesInterval}}this.rsCont[this.conf.touch?"ontouchstart":"onclick"]=function(x){x=x||event;x.cancelBubble=true;var w=(x.target||x.srcElement);if(w._minutes!=null){if(e._minutesInterval==1){var q=e.getFormatedDate("%i");if(e._selectorMode==1){q=w._minutes.toString()+q.charAt(1)}else{q=q.charAt(0)+w._minutes.toString()}e._activeDate.setMinutes(Number(q));e._hideSelector();if(e._selectorMode==1){e._updateVisibleMinutes(true);e._selectorMode=2;e._showSelector("minutes",e._sel._x,e._sel._y,"selector_minutes",true);e._updateActiveMinutes();return}else{e._selectorMode=1}}else{e._hideSelector();e._activeDate.setMinutes(w._minutes);e._updateActiveMinutes()}e._updateVisibleMinutes();e._doOnSelectorChange()}}}this._sel._ta[t]=true};this._showSelector=function(p,m,q,o,a){if(a===true&&this._sel!=null&&this._isSelectorVisible()&&p==this._sel._t){this._hideSelector();return}if(this.conf.skin=="dhx_terrace"){m+=12}if(!this._sel||!this._sel._ta[p]){this._initSelector(p,o)}if(p!=this._sel._t&&this._sel._t=="minutes"&&this._minutesInterval==1){this.contTime.firstChild.firstChild.childNodes[3].innerHTML=this.getFormatedDate("%i")}this._sel._x=m;this._sel._y=q;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=p;this._sel.className="dhtmlxcalendar_selector_obj dhtmlxcalendar_"+o;this._sel.childNodes[0].firstChild.firstChild.childNodes[0].style.display=this._sel.childNodes[0].firstChild.firstChild.childNodes[2].style.display=(p=="year"?"":"none");var n=Math.max(0,m-Math.round(this._sel.offsetWidth/2));if(n+this._sel.offsetWidth>this._sel.parentNode.offsetWidth){n=this._sel.parentNode.offsetWidth-this._sel.offsetWidth}this._sel.style.left=n+"px";if(p=="hours"||p=="minutes"){this._sel.style.top=q-this._sel.offsetHeight+"px"}else{this._sel.style.top=q+"px"}this._sel.childNodes[1].style.width=this._sel.childNodes[0].offsetWidth+"px";this._sel.style.visibility="visible";this._doOnSelectorShow(p)};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(n){if(!this._sel){return}if(!this._sel._ta[n]){return}if(n=="month"){this.msCont.onclick=this.msCont.ontouchstart=null;this._msActive=null;for(var m in this._msCells){this._msCells[m]._cell=null;this._msCells[m]._month=null;this._msCells[m].parentNode.removeChild(this._msCells[m]);this._msCells[m]=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(n=="year"){this.ysCont.onclick=this.ysCont.ontouchstart=null;for(var m in this._ysCells){this._ysCells[m]._cell=null;this._ysCells[m]._year=null;this._ysCells[m].parentNode.removeChild(this._ysCells[m]);this._ysCells[m]=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(n=="hours"){this.hsCont.onclick=this.hsCont.ontouchstart=null;this._hsActive=null;for(var m in this._hsCells){this._hsCells[m]._cell=null;this._hsCells[m]._hours=null;this._hsCells[m].parentNode.removeChild(this._hsCells[m]);this._hsCells[m]=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(n=="minutes"){this.rsCont.onclick=this.rsCont.ontouchstart=null;this._rsActive=null;for(var m in this._rsCells){this._rsCells[m]._cell=null;this._rsCells[m]._minutes=null;this._rsCells[m].parentNode.removeChild(this._rsCells[m]);this._rsCells[m]=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[n]=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(r){for(var n in this._ysCells){this._ysCells[n]=null;delete this._ysCells[n]}var o=12*Math.floor(r.getFullYear()/12);for(var p=0;p<4;p++){for(var m=0;m<3;m++){this.ysCont.childNodes[p].childNodes[m].innerHTML=o;this.ysCont.childNodes[p].childNodes[m]._year=o;this.ysCont.childNodes[p].childNodes[m].className="dhtmlxcalendar_selector_cell";this._ysCells[o++]=this.ysCont.childNodes[p].childNodes[m]}}this._updateActiveYear()};this._scrollYears=function(a){var n=(a<0?this.ysCont.firstChild.firstChild._year:this.ysCont.lastChild.lastChild._year)+a;var m=new Date(n,this._activeMonth.getMonth(),1,0,0,0,0);this._updateYearsList(m)};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(m){var a=this._fixLength(this._activeDate.getMinutes(),2).toString();if(m==true){a=a.charAt(0)+"<span class='dhtmlxcalendar_selected_date'>"+a.charAt(1)+"</span>"}this.contTime.firstChild.firstChild.childNodes[3].innerHTML=a;if(m==true){this.contTime.firstChild.firstChild.childNodes[3].lastChild._par=true}};this._fixLength=function(a,m){while(String(a).length<m){a="0"+String(a)}return a};this._dateFormat="";this._dateFormatRE=null;this.setDateFormat=function(p){var o={};if(this._strToDate!=null){for(var m in this.i){if(this.i[m].input!=null&&this.i[m].input.value.length>0){var q=this._strToDate(this.i[m].input.value);if(q instanceof Date){o[m]=q}}}}this._dateFormat=p;var n=String(this._dateFormat).replace(/%[a-zA-Z]+/g,function(a){var r=a.replace(/%/,"");switch(r){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"("+e.langData[e.lang].monthesSNames.join("|").toLowerCase()+"){1,}";case"F":return"("+e.langData[e.lang].monthesFNames.join("|").toLowerCase()+"){1,}";case"D":return"[a-z]{2}";case"a":case"A":return"AM|PM"}return a});this._dateFormatRE=new RegExp(n,"i");for(var m in o){this.i[m].input.value=this._dateToStr(o[m])}o=null};this.setDateFormat(this.langData[this.lang].dateformat||"%Y-%m-%d");this._getInd=function(n,a){for(var m=0;m<a.length;m++){if(a[m].toLowerCase()==n){return m}}return -1};this._updateDateStr=function(m){if(!this._dateFormatRE||!m.match(this._dateFormatRE)){return}if(m==this.getFormatedDate()){return}var a=this._strToDate(m);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(p,q,m,o){var n=this._strToDate(q,p);if(o){return n}this.setDate(n)};this.getFormatedDate=function(m,a){if(!(a&&a instanceof Date)){if(this._nullDate){return""}a=new Date(this._activeDate)}return this._dateToStr(a,m)};this.getWeekNumber=function(p){if(typeof(p)=="string"){p=this._strToDate(p)}if(!(p instanceof Date)){return"Invalid Date"}if(typeof(this._ftDay)=="undefined"){this._ftDay=4}var u=this._wStart;var o=u+7;var t=4;var m=new Date(p.getFullYear(),0,1,0,0,0,0);var n=m.getDay();if(n==0){n=7}if(t<u){t+=7;n+=7}var r=0;if(n>=u&&n<=t){}else{r=1}var q=n-u;var s=new Date(p.getFullYear(),0,1-q+r*7,0,0,0,0);var w=604800000;var a=new Date(p.getFullYear(),p.getMonth(),p.getDate()+1,0,0,0,0);var v=Math.ceil((a.getTime()-s.getTime())/w);return v};this.showWeekNumbers=function(){this.base.firstChild.className="dhtmlxcalendar_wn"};this.hideWeekNumbers=function(){this.base.firstChild.className=""};this.show=function(n){if(!n&&this._hasParent){this._show();return}if(typeof(n)=="object"&&typeof(n._dhtmlxcalendar_uid)!="undefined"&&this.i[n._dhtmlxcalendar_uid]==n){this._show(n._dhtmlxcalendar_uid);return}if(typeof(n)=="undefined"){for(var m in this.i){if(!n){n=m}}}if(!n){return}this._show(n)};this.hide=function(){if(this._isVisible()){this._hide()}};this.isVisible=function(){return this._isVisible()};this._activeInp=null;this.pos="bottom";this.setPosition=function(a,m){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(m)!="undefined"&&!isNaN(m)){this.base.style.top=m+"px";this._py=m}this._ifrSize()}};this._show=function(r,a){if(a===true&&this._activeInp==r&&this._isVisible()){this._hide();return}this.base.style.visibility="hidden";this.base.style.display="";if(!r){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 o=(this.i[r].input||this.i[r].button);var m=(navigator.appVersion.indexOf("MSIE")!=-1);var p=Math.max((m?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);var n=p+(m?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(o)+o.offsetWidth+"px";this.base.style.top=Math.min(this._getTop(o),n-this.base.offsetHeight)+"px"}else{if(this.pos=="bottom"){var q=this._getTop(o)+o.offsetHeight+1;if(q+this.base.offsetHeight>n){q=this._getTop(o)-this.base.offsetHeight}this.base.style.left=this._getLeft(o)+"px";this.base.style.top=q+"px"}else{this.base.style.left=(this._px||0)+"px";this.base.style.top=(this._py||0)+"px"}}this._activeInp=r;o=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 n=0,m=0;while(a){n=n+parseInt(a.offsetTop);m=m+parseInt(a.offsetLeft);a=a.offsetParent}return{top:n,left:m}};this._posGetOffsetRect=function(o){var r=o.getBoundingClientRect();var s=document.body;var m=document.documentElement;var a=window.pageYOffset||m.scrollTop||s.scrollTop;var p=window.pageXOffset||m.scrollLeft||s.scrollLeft;var q=m.clientTop||s.clientTop||0;var t=m.clientLeft||s.clientLeft||0;var u=r.top+a-q;var n=r.left+p-t;return{top:Math.round(u),left:Math.round(n)}};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(n){var a=this._extractDates(n);for(var m=0;m<a.length;m++){this._rangeSet[new Date(a[m].getFullYear(),a[m].getMonth(),a[m].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(m){if(m==null){this._clearHolidays()}else{if(m!=null){var a=this._extractDates(m);for(var n=0;n<a.length;n++){this._holidays[new Date(a[n].getFullYear(),a[n].getMonth(),a[n].getDate(),0,0,0,0).getTime()]=true}}}this._drawMonth(this._activeMonth)};this._extractDates=function(n){if(typeof(n)=="string"||n instanceof Date){n=[n]}var m=[];for(var o=0;o<n.length;o++){if(typeof(n[o])=="string"){var p=n[o].split(",");for(var a=0;a<p.length;a++){m.push(this._strToDate(p[a]))}}else{if(n[o] instanceof Date){m.push(n[o])}}}return m};this._clearRange=function(){this._rangeActive=false;this._rangeType=null;this._rangeFrom=null;this._rangeTo=null};this._clearRangeSet=function(){for(var m in this._rangeSet){this._rangeSet[m]=null;delete this._rangeSet[m]}};this._clearHolidays=function(){for(var m in this._holidays){this._holidays[m]=null;delete this._holidays[m]}};this._isOutOfRange=function(m){if(this._rangeSet[m]==true){return true}if(this._rangeActive){if(this._rangeType=="in"&&(m<this._rangeFrom||m>this._rangeTo)){return true}if(this._rangeType=="out"&&(m>=this._rangeFrom&&m<=this._rangeTo)){return true}if(this._rangeType=="from"&&m<this._rangeFrom){return true}if(this._rangeType=="to"&&m>this._rangeTo){return true}}var a=new Date(m);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(o,n,a){var m=false;if(o!=null&&n!=null){if(!(o instanceof Date)){o=this._strToDate(o)}if(!(n instanceof Date)){n=this._strToDate(n)}if(o.getTime()>n.getTime()){return}this._rangeFrom=new Date(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0,0).getTime();this._rangeTo=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0).getTime();this._rangeActive=true;this._rangeType="in";m=true}if(!m&&o!=null&&n==null){if(!(o instanceof Date)){o=this._strToDate(o)}this._rangeFrom=new Date(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0,0).getTime();this._rangeTo=null;if(a===true){this._rangeFrom++}this._rangeActive=true;this._rangeType="from";m=true}if(!m&&o==null&&n!=null){if(!(n instanceof Date)){n=this._strToDate(n)}this._rangeFrom=null;this._rangeTo=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0).getTime();if(a===true){this._rangeTo--}this._rangeActive=true;this._rangeType="to";m=true}if(m){this._drawMonth(this._activeMonth)}};this.setInsensitiveRange=function(m,a){if(m!=null&&a!=null){if(!(m instanceof Date)){m=this._strToDate(m)}if(!(a instanceof Date)){a=this._strToDate(a)}if(m.getTime()>a.getTime()){return}this._rangeFrom=new Date(m.getFullYear(),m.getMonth(),m.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(m!=null&&a==null){this.setSensitiveRange(null,m,true);return}if(m==null&&a!=null){this.setSensitiveRange(a,null,true);return}};this.disableDays=function(r,p){if(r=="week"){if(typeof(p)!="object"&&typeof(p.length)=="undefined"){p=[p]}if(!this._rangeWeekData){this._rangeWeekData={}}for(var m in this._rangeWeekData){this._rangeWeekData[m]=false;delete this._rangeWeekData[m]}for(var o=0;o<p.length;o++){this._rangeWeekData[p[o]]=true;if(p[o]==7){this._rangeWeekData[0]=true}}this._rangeWeek=true}if(r=="month"){if(typeof(p)!="object"&&typeof(p.length)=="undefined"){p=[p]}if(!this._rangeMonthData){this._rangeMonthData={}}for(var m in this._rangeMonthData){this._rangeMonthData[m]=false;delete this._rangeMonthData[m]}for(var o=0;o<p.length;o++){this._rangeMonthData[p[o]]=true}this._rangeMonth=true}if(r=="year"){var n=this._extractDates(p);if(!this._rangeYearData){this._rangeYearData={}}for(var m in this._rangeYearData){this._rangeYearData[m]=false;delete this._rangeYearData[m]}for(var o=0;o<n.length;o++){this._rangeYearData[n[o].getMonth()+"_"+n[o].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(n,r,s,a){var o=this._extractDates(n);for(var p=0;p<o.length;p++){var m=new Date(o[p].getFullYear(),o[p].getMonth(),o[p].getDate(),0,0,0,0).getTime();this._tipData[m]={text:r,showIcon:s,usePopup:a}}this._drawMonth(this._activeMonth)};this.clearTooltip=function(m){var n=this._extractDates(m);for(var o=0;o<n.length;o++){var a=new Date(n[o].getFullYear(),n[o].getMonth(),n[o].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(m){var a=new Date(m.getFullYear(),m.getMonth(),m.getDate(),0,0,0,0).getTime();if(this._tipData[a]!=null){if(this._tipTM){window.clearTimeout(this._tipTM)}this._tipCellDate=m;this._tipCellDim=this.getCellDimension(m);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(o,a,p,m,n){if(!e._tipPopup){e._tipPopup=new dhtmlXPopup({mode:"top"})}e._tipPopup.attachHTML(e._tipText);e._tipPopup.show(e._tipCellDim.x,e._tipCellDim.y,e._tipCellDim.w,e._tipCellDim.h);e.callEvent("onPopupShow",[e._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(n){if(typeof(n)=="string"){n=this._strToDate(n)}if(!(n instanceof Date)){return null}var o=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0).getTime();var m=null;for(var r=0;r<this.contDates.childNodes.length;r++){for(var a=0;a<this.contDates.childNodes[r].childNodes.length;a++){var s=this.contDates.childNodes[r].childNodes[a];if(s._date!=null&&s._date.getTime()==o){m={x:this._getLeft(s),y:this._getTop(s),w:s.offsetWidth,h:s.offsetHeight}}s=null}}return m};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(m){m=m||event;var a=(m.target||m.srcElement);if(a._dhtmlxcalendar_uid&&a._dhtmlxcalendar_uid!=e._activeInp&&e._isVisible()&&e._activeInp){e._hide();return}if(!a._dhtmlxcalendar_uid||!e.i[a._dhtmlxcalendar_uid]){if(e._isSelectorVisible()){e._hideSelector()}else{if(!e._hasParent&&e._isVisible()){e._hide()}}}};this._doOnKeyDown=function(a){a=a||event;if(a.keyCode==27||a.keyCode==13){if(e._isSelectorVisible()){e._hideSelector()}else{if(e._isVisible()&&!e._hasParent){e._hide()}}}};this._doOnInpClick=function(m){m=m||event;var a=(m.target||m.srcElement);if(!a._dhtmlxcalendar_uid){return}if(!e._listenerEnabled){e._updateFromInput(a)}e._show(a._dhtmlxcalendar_uid,true)};this._doOnInpKeyUp=function(m){m=m||event;var a=(m.target||m.srcElement);if(m.keyCode==13||!a._dhtmlxcalendar_uid){return}if(!e._listenerEnabled){e._updateFromInput(a)}};this._doOnBtnClick=function(m){m=m||event;var a=(m.target||m.srcElement);if(!a._dhtmlxcalendar_uid){return}if(e.i[a._dhtmlxcalendar_uid].input!=null){e._updateFromInput(e.i[a._dhtmlxcalendar_uid].input)}e._show(a._dhtmlxcalendar_uid,true)};this._doOnUnload=function(){if(e&&e.unload){e.unload()}};if(typeof(window.addEventListener)=="function"){document.body.addEventListener((this.conf.touch?"touchstart":"click"),e._doOnClick,false);window.addEventListener("keydown",e._doOnKeyDown,false);window.addEventListener("unload",e._doOnUnload,false)}else{document.body.attachEvent("onclick",e._doOnClick);document.body.attachEvent("onkeydown",e._doOnKeyDown);window.attachEvent("onunload",e._doOnUnload)}this.attachObj=function(n){var m=window.dhx4.newId();if(typeof(n)=="string"){this.i[m]={input:document.getElementById(n)}}else{if(typeof(n.tagName)!="undefined"){this.i[m]={input:n}}else{if(typeof(n)=="object"&&(n.input!=null||n.button!=null)){this.i[m]={};if(n.input!=null){this.i[m].input=(typeof(n.input)=="string"?document.getElementById(n.input):n.input)}if(n.button!=null){this.i[m].button=(typeof(n.button)=="string"?document.getElementById(n.button):n.button)}}}}this._attachEventsToObject(m);return m};this.detachObj=function(o){var n=null;if(this.i[o]!=null){n=o}else{if(typeof(o)=="string"){o=document.getElementById(o);n=o._dhtmlxcalendar_uid}else{if(typeof(o.tagName)!="undefined"){n=o._dhtmlxcalendar_uid}else{if(typeof(o)=="object"&&(o.input!=null||o.button!=null)){if(n==null&&o.input!=null){n=(typeof(o.input)=="string"?document.getElementById(o.input):o.input)._dhtmlxcalendar_uid}if(n==null&&o.button!=null){n=(typeof(o.button)=="string"?document.getElementById(o.button):o.button)._dhtmlxcalendar_uid}}}}}if(n!=null&&this.i[n]!=null){this._detachEventsFromObject(n);for(var m in this.i[m]){this.i[n][m]._dhtmlxcalendar_uid=null;this.i[n][m]=null;delete this.i[n][m]}this.i[n]=null;delete this.i[n];return true}return false};this._attachEventsToObject=function(m){if(this.i[m].button!=null){this.i[m].button._dhtmlxcalendar_uid=m;if(typeof(window.addEventListener)=="function"){this.i[m].button.addEventListener((this.conf.touch?"touchstart":"click"),e._doOnBtnClick,false)}else{this.i[m].button.attachEvent("onclick",e._doOnBtnClick)}}else{if(this.i[m].input!=null){this.i[m].input._dhtmlxcalendar_uid=m;if(typeof(window.addEventListener)=="function"){this.i[m].input.addEventListener((this.conf.touch?"touchstart":"click"),e._doOnInpClick,false);this.i[m].input.addEventListener("keyup",e._doOnInpKeyUp,false)}else{this.i[m].input.attachEvent("onclick",e._doOnInpClick);this.i[m].input.attachEvent("onkeyup",e._doOnInpKeyUp)}}}};this._detachEventsFromObject=function(m){if(this.i[m].button!=null){if(typeof(window.addEventListener)=="function"){this.i[m].button.removeEventListener((this.conf.touch?"touchstart":"click"),e._doOnBtnClick,false)}else{this.i[m].button.detachEvent("onclick",e._doOnBtnClick)}}else{if(this.i[m].input!=null){if(typeof(window.addEventListener)=="function"){this.i[m].input.removeEventListener((this.conf.touch?"touchstart":"click"),e._doOnInpClick,false);this.i[m].input.removeEventListener("keyup",e._doOnInpKeyUp,false)}else{this.i[m].input.detachEvent("onclick",e._doOnInpClick);this.i[m].input.detachEvent("onkeyup",e._doOnInpKeyUp)}}}};this.enableListener=function(a){if(!a){return}if(typeof(window.addEventListener)=="function"){a.addEventListener("focus",e._listenerEvFocus,false);a.addEventListener("blur",e._listenerEvBlur,false)}else{a.attachEvent("onfocus",e._listenerEvFocus);a.attachEvent("onblur",e._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",e._listenerEvFocus,false);a.removeEventListener("blur",e._listenerEvBlur,false)}else{a.detachEvent("onfocus",e._listenerEvFocus);a.detachEvent("onblur",e._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(){e._startListener(a)},100)}};this._listenerEvFocus=function(m){m=m||event;var a=m.target||m.srcElement;a._f0=true;e._startListener(a);a=null};this._listenerEvBlur=function(m){m=m||event;var a=m.target||m.srcElement;a._f0=false;a=null};for(var h in this.i){this._attachEventsToObject(h)}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((this.conf.touch?"touchstart":"click"),e._doOnClick,false);window.removeEventListener("keydown",e._doOnKeyDown,false);window.removeEventListener("unload",e._doOnUnload,false)}else{document.body.detachEvent("onclick",e._doOnClick);document.body.detachEvent("onkeydown",e._doOnKeyDown);window.detachEvent("onunload",e._doOnKeyDown)}this._doOnClick=null;this._doOnKeyDown=null;this._doOnUnload=null;for(var m in this.i){this.i[m]._dhtmlxcalendar_uid=null;this._detachEventsFromObject(m);this.disableListener(this.i[m].input);this.i[m]=null;delete this.i[m]}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 m in this._sel._ta){this._sel._ta[m]=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 m in this){delete this[m]}m=e=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(e){var b=this;var d=function(f){return(String(f).length==1?"0"+String(f):f)};var a=function(f,g){return"<span class='dhtmlxcalendar_month_label_"+f+"'>"+g+"</span>"};var c=String(this.langData[this.lang].hdrformat||("%F %Y")).replace(/%[a-z]/gi,function(f){switch(f){case"%m":return a("month",d(e.getMonth()+1));case"%n":return a("month",e.getMonth()+1);case"%M":return a("month",b.langData[b.lang].monthesSNames[e.getMonth()]);case"%F":return a("month",b.langData[b.lang].monthesFNames[e.getMonth()]);case"%y":return a("year",d(e.getYear()%100));case"%Y":return a("year",e.getFullYear());case"%%":return"%";default:return f}});b=d=a=null;return c};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._strToDate=function(g,s){s=(s||this._dateFormat);s=s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\\:|]/g,"\\$&");var u=[];var l=[];s=s.replace(/%[a-z]/gi,function(e){switch(e){case"%d":case"%m":case"%y":case"%h":case"%H":case"%i":case"%s":l.push(e);return"(\\d{2})";case"%D":case"%l":case"%M":case"%F":l.push(e);return"([a-zéûä\u0430-\u044F\u0451]{1,})";case"%j":case"%n":case"%g":case"%G":l.push(e);return"(\\d{1,2})";case"%Y":l.push(e);return"(\\d{4})";case"%a":l.push(e);return"(\\[am|pm])";case"%A":l.push(e);return"(\\[AM|PM])"}return e});var x=new RegExp(s);var m=g.match(x);if(m==null||m.length-1!=l.length){return"Invalid Date"}for(var b=1;b<m.length;b++){u.push(m[b])}var c={"%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};var n={};var i={};for(var b=0;b<l.length;b++){if(typeof(c[l[b]])!="undefined"){var d=c[l[b]];if(!n[d]){n[d]=[];i[d]=[]}n[d].push(u[b]);i[d].push(l[b])}}u=[];l=[];for(var b=1;b<=7;b++){if(n[b]!=null){for(var o=0;o<n[b].length;o++){u.push(n[b][o]);l.push(i[b][o])}}}var j=this;var a=new Date();a.setDate(1);a.setMinutes(0);a.setSeconds(0);for(var b=0;b<u.length;b++){switch(l[b]){case"%d":case"%j":case"%n":case"%m":case"%Y":case"%H":case"%G":case"%i":case"%s":if(!isNaN(u[b])){a[{"%d":"setDate","%j":"setDate","%n":"setMonth","%m":"setMonth","%Y":"setFullYear","%H":"setHours","%G":"setHours","%i":"setMinutes","%s":"setSeconds"}[l[b]]](Number(u[b])+(l[b]=="%m"||l[b]=="%n"?-1:0))}break;case"%M":case"%F":var h=this._getInd(u[b].toLowerCase(),j.langData[j.lang][{"%M":"monthesSNames","%F":"monthesFNames"}[l[b]]]);if(h>=0){a.setMonth(h)}break;case"%y":if(!isNaN(u[b])){var t=Number(u[b]);a.setFullYear(t+(t>50?1900:2000))}break;case"%g":case"%h":if(!isNaN(u[b])){var t=Number(u[b]);if(t<=12&&t>=0){a.setHours(t+(this._getInd("pm",u)>=0?(t==12?0:12):(t==12?-12:0)))}}break}}j=null;return a};dhtmlXCalendarObject.prototype._dateToStr=function(f,d){var c=this;if(f instanceof Date){var e=function(g){return(String(g).length==1?"0"+String(g):g)};var a=function(g){switch(g){case"%d":return e(f.getDate());case"%j":return f.getDate();case"%D":return c.langData[c.lang].daysSNames[f.getDay()];case"%l":return c.langData[c.lang].daysFNames[f.getDay()];case"%m":return e(f.getMonth()+1);case"%n":return f.getMonth()+1;case"%M":return c.langData[c.lang].monthesSNames[f.getMonth()];case"%F":return c.langData[c.lang].monthesFNames[f.getMonth()];case"%y":return e(f.getYear()%100);case"%Y":return f.getFullYear();case"%g":return(f.getHours()+11)%12+1;case"%h":return e((f.getHours()+11)%12+1);case"%G":return f.getHours();case"%H":return e(f.getHours());case"%i":return e(f.getMinutes());case"%s":return e(f.getSeconds());case"%a":return(f.getHours()>11?"pm":"am");case"%A":return(f.getHours()>11?"PM":"AM");case"%%":"%";default:return g}};var b=String(d||this._dateFormat).replace(/%[a-zA-Z]/g,a)}c=null;return(b||String(f))};window.dhtmlxDblCalendarObject=window.dhtmlXDoubleCalendarObject=window.dhtmlXDoubleCalendar=function(b){var a=this;this.leftCalendar=new dhtmlXCalendarObject(b);this.leftCalendar.hideTime();this.rightCalendar=new dhtmlXCalendarObject(b);this.rightCalendar.hideTime();this.leftCalendar.attachEvent("onClick",function(c){a._updateRange("rightCalendar",c,null);a._evOnClick(["left",c])});this.rightCalendar.attachEvent("onClick",function(c){a._updateRange("leftCalendar",null,c);a._evOnClick(["right",c])});this.leftCalendar.attachEvent("onBeforeChange",function(c){return a._evOnBeforeChange(["left",c])});this.rightCalendar.attachEvent("onBeforeChange",function(c){return a._evOnBeforeChange(["right",c])});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(c){this.leftCalendar.setDateFormat(c);this.rightCalendar.setDateFormat(c)};this.setDates=function(d,c){if(d!=null){this.leftCalendar.setDate(d)}if(c!=null){this.rightCalendar.setDate(c)}this._updateRange()};this._updateRange=function(c,e,d){if(arguments.length==3){(c=="leftCalendar"?this.leftCalendar:this.rightCalendar).setSensitiveRange(e,d)}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(c){return this.callEvent("onClick",c)};this._evOnBeforeChange=function(c){return this.callEvent("onBeforeChange",c)};window.dhx4._eventable(this);return this};function dhtmlXCombo(f,j,c,h,e){var g=this;var d=null;var l=null;if(typeof(f)=="object"&&!f.tagName){d=f;f=d.parent;c=d.width;j=d.name;h=d.mode;l=d.skin}this.cont=(typeof(f)=="string"?document.getElementById(f):f);this.conf={skin:null,form_name:j||"dhxcombo",combo_width:(parseInt(c)||this.cont.offsetWidth||120)-(dhx4.isFF||dhx4.isIE?2:0),combo_image:false,combo_focus:false,opts_type:(typeof(h)=="string"&&typeof(this.modes[h])!="undefined"?h:"option"),opts_count:8,opts_count_min:3,opts_width:null,item_h:null,list_zi_id:window.dhx4.newId(),allow_free_text:true,allow_empty_value:true,enabled:true,img_path:"",img_def:"",img_def_dis:true,template:{input:"#text#",option:"#text#"},f_mode:false,f_url:false,f_cache:false,f_cache_data:{},f_dyn:false,f_dyn_end:false,f_mask:"",f_ac:true,f_ac_text:"",f_server_tm:null,f_server_last:"",last_hover:null,last_selected:null,last_match:null,last_text:"",last_value:"",tm_hover:null,tm_confirm_blur:null,clear_click:false,clear_blur:false,clear_bsp:false,clear_key:false,sp:{dhx_skyblue:{list_ofs:1},dhx_web:{list_ofs:0},dhx_terrace:{list_ofs:1}}};this.conf.combo_image=(this.modes[this.conf.opts_type].image==true);this.t={};this.base=document.createElement("DIV");this.base.style.width=this.conf.combo_width+"px";this.base.innerHTML="<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.style.display="none";document.body.insertBefore(this.list,document.body.firstChild);this.setSkin(l||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(u){if(this.conf.f_server_tm){window.clearTimeout(this.conf.f_server_tm)}var n=String(this.base.firstChild.value).replace(new RegExp(this.conf.f_ac_text+"$","i"),"");if(this.conf.f_server_last==n.toLowerCase()){this._checkForMatch();return}if(this.conf.f_url!=null&&this.checkEvent("onDynXLS")){this.conf.f_server_last=n.toLowerCase();this.callEvent("onDynXLS",[n]);return}if(this.conf.f_url!=null){if(n.length==0){this.conf.f_server_last=n.toLowerCase();this.clearAll();return}if(this.conf.f_cache==true&&this.conf.f_cache_data[n]!=null){this.clearAll();this.conf.f_server_last=n.toLowerCase();for(var p=0;p<this.conf.f_cache_data[n].data.length;p++){this.load(this.conf.f_cache_data[n].data[p])}if(this.conf.f_dyn){this.conf.f_dyn_end=this.conf.f_cache_data[n].dyn_end;this.conf.f_mask=this.conf.f_cache_data[n].mask}if(u!==true){this._showList(true);this._checkForMatch()}}else{this.conf.f_server_tm=window.setTimeout(function(){g.conf.f_server_last=n.toLowerCase();g.conf.f_mask=n;var a="mask="+encodeURIComponent(n);if(g.conf.f_dyn){a+="&pos=0";g.conf.f_dyn_end=false}window.dhx4.ajax.post(g.conf.f_url,a,function(v){if(g.conf.f_cache){if(!g.conf.f_cache_data[n]){g.conf.f_cache_data[n]={data:[],dyn_end:false,mask:n}}g.conf.f_cache_data[n].data.push(v.xmlDoc.responseXML)}g.clearAll();g.load(v.xmlDoc.responseXML);if(g.conf.f_ac&&g.conf.f_mode=="start"&&g.conf.clear_bsp==false&&g.list.firstChild!=null){var q=g.list.firstChild._optId;var w=String(g.t[q].obj.getText(g.list.firstChild,true));if(String(w).toLowerCase().indexOf(String(n).toLowerCase())===0){g.base.firstChild.value=w;g._selectRange(n.length,w.length)}}if(u!==true){g._showList(true);g._checkForMatch()}})},200)}}else{this.conf.f_server_last=n.toLowerCase();var o=(n.length==0?true:new RegExp((this.conf.f_mode=="start"?"^":"")+n,"i"));var t=null;for(var m in this.t){var s=this.t[m].obj.getText(this.t[m].item,true);if(o===true||o.test(s)==true){this.t[m].item.style.display="";if(t==null&&n.length>0){t=String(this.t[m].obj.getText(this.t[m].item,true))}}else{this.t[m].item.style.display="none"}}if(this.conf.f_ac&&this.conf.f_mode=="start"&&this.conf.clear_bsp==false&&t!=null){this.conf.f_ac_text=t.replace(new RegExp("^"+n,"i"),"");this.base.firstChild.value=t;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(u!==true){this._showList(true);this._checkForMatch()}}};this._initObj=function(a){if(typeof(a.template)!="undefined"){this.setTemplate(a.template)}this.addOption(a.options)};this._xmlToObj=function(v,y){var D={options:[]};var z=(y==true?v:v.getElementsByTagName("complete"));if(z.length>0){var o=z[0].childNodes;for(var m=0;m<o.length;m++){if(typeof(o[m].tagName)!="undefined"){if(String(o[m].tagName).toLowerCase()=="template"){for(var C=0;C<o[m].childNodes.length;C++){if(o[m].childNodes[C].tagName!=null){var u=o[m].childNodes[C].tagName;if(typeof(this.conf.template[u])!="undefined"){this.conf.template[u]=(o[m].childNodes[C].firstChild!=null?o[m].childNodes[C].firstChild.nodeValue:"")}}}}if(String(o[m].tagName).toLowerCase()=="option"){var s=false;if(y==true){s=(window.dhx4.s2b(o[m].selected)||o[m].getAttribute("selected")!=null)}else{s=window.dhx4.s2b(o[m].getAttribute("selected"))}var p={value:o[m].getAttribute("value"),text:(o[m].firstChild!=null?o[m].firstChild.nodeValue:""),selected:s,checked:window.dhx4.s2b(o[m].getAttribute("checked"))};for(var A in {img:1,img_dis:1,img_src:1,img_src_dis:1}){if(o[m].getAttribute(A)!=null){p[A]=o[m].getAttribute(A)}}for(var C=0;C<o[m].childNodes.length;C++){if(o[m].childNodes[C].tagName!=null&&String(o[m].childNodes[C].tagName).toLowerCase()=="text"){p.text={};var r=o[m].childNodes[C];for(var x=0;x<r.childNodes.length;x++){if(r.childNodes[x].tagName!=null){p.text[r.childNodes[x].tagName]=(r.childNodes[x].firstChild!=null?r.childNodes[x].firstChild.nodeValue:"")}}}}D.options.push(p)}}}z=o=null}return D};window.dhx4._enableDataLoading(this,"_initObj","_xmlToObj","complete",{data:true});window.dhx4._eventable(this);this._getNearItem=function(n,m){var a=null;while(n!=null){n=n[m<0?"previousSibling":"nextSibling"];if(a==null&&n!=null&&n.style.display==""&&n._optId!=null){a=n;n=null}}return a};this.setName(this.conf.form_name);this._doOnListMouseMove=function(m){m=m||event;var a=m.target||m.srcElement;while(a!=null&&a!=this){if(typeof(a._optId)!="undefined"){if(g.conf.tm_hover){window.clearTimeout(g.conf.tm_hover)}g._setSelected(a._optId)}a=a.parentNode}a=null};this._doOnListMouseDown=function(a){a=a||event;a.cancelBubble=true;g.conf.clear_click=true;window.setTimeout(function(){g.base.firstChild.focus()},1)};this._doOnListMouseUp=function(n){n=n||event;var a=n.target||n.srcElement;while(a!=null&&a!=this){if(typeof(a._optId)!="undefined"){var m=true;if(typeof(g.t[a._optId].obj.optionClick)=="function"&&g.t[a._optId].obj.optionClick(a,n,g)!==true){m=false}if(m){g._setSelected(a._optId,null,true);g._confirmSelect("click")}}a=a.parentNode}a=null};this._doOnListMouseOut=function(a){if(g.conf.tm_hover){window.clearTimeout(g.conf.tm_hover)}g.conf.tm_hover=window.setTimeout(function(){var m=g.conf.last_match||g.conf.last_selected;if(g.conf.last_match==null&&g.t[m]!=null){if(g.base.firstChild.value!=g.t[m].obj.getText(g.t[m].item,true)){m=null}}g._setSelected(m,null,true)},1)};this._doOnBaseMouseDown=function(q){if(!g.conf.enabled){return}g.conf.clear_click=true;q=q||event;var m=q.target||q.srcElement;if(m!=this.firstChild){window.setTimeout(function(){g.base.firstChild.focus()},1);var o=m;while(o!=this&&o!=null){if(o==this.lastChild){if(typeof(g.modes[g.conf.opts_type].topImageClick)=="function"){var n=(g.conf.last_hover||g.conf.last_selected);var a=(n!=null?g.t[n].item:null);if(g.modes[g.conf.opts_type].topImageClick(a,g)!==true){n=a=null;return}}o=null}else{o=o.parentNode}}}if(g._isListVisible()){g._hideList()}else{if(m!=this.firstChild){g.conf.clear_blur=true}g._showList();g._setSelected(g.conf.last_selected,true,true)}m=null};this._doOnBodyMouseDown=function(){if(g.conf.clear_click){g.conf.clear_click=false;return}g._confirmSelect("blur")};this._doOnInputFocus=function(){g.conf.clear_blur=false;if(g.conf.tm_confirm_blur){window.clearTimeout(g.conf.tm_confirm_blur)}if(g.conf.combo_focus==false){g.conf.combo_focus=true;g.callEvent("onFocus",[])}};this._doOnInputBlur=function(){if(g.conf.clear_blur==true){g.conf.clear_blur=false;return}if(g.conf.tm_confirm_blur){window.clearTimeout(g.conf.tm_confirm_blur)}g.conf.tm_confirm_blur=window.setTimeout(function(){if(g.conf.clear_click==false){g._confirmSelect("blur");g.conf.combo_focus=false;g.callEvent("onBlur",[])}},20)};this._doOnInputKeyUp=function(a){a=a||event;if(g.conf.f_mode!=false){g.conf.clear_bsp=(a.keyCode==8||a.keyCode==46);g._filterOpts();return}else{g._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;g._keyOnUpDown(a.keyCode==38?-1:1)}if(a.keyCode==113){if(!g._isListVisible()){g._showList();if(g.base.firstChild.value==g.conf.last_text){g._setSelected(g.conf.last_selected,true,true);g.base.firstChild.value=g.conf.last_text;g.conf.f_server_last=g.base.firstChild.value.toLowerCase()}else{g.conf.f_server_last=g.base.firstChild.value.toLowerCase();if(g.conf.f_mode==false){g._checkForMatch()}}}else{}}if(a.keyCode==27){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}a.cancelBubble=true;g._cancelSelect()}if(a.keyCode==13){if(a.preventDefault){a.preventDefault()}g._confirmSelect("kbd")}g.conf.clear_key=true;g.callEvent("onKeyPressed",[a.keyCode||a.charCode])};this._doOnInputKeyPress=function(a){if(g.conf.clear_key){g.conf.clear_key=false;return}a=a||event;g.callEvent("onKeyPressed",[a.keyCode||a.charCode])};this._keyOnUpDown=function(a){var m=null;if(this.conf.last_hover){m=this.t[this.conf.last_hover].item}else{if(this.conf.last_selected){m=this.t[this.conf.last_selected].item}}if(!m&&this._getListVisibleCount()==0){return}if(m!=null&&m.style.display!=""){m=null}this._showList();if(m!=null){if(this.t[m._optId].obj.isSelected(m)){m=this._getNearItem(m,a)}}else{m=this.list.firstChild;if(m.style.display!=""){m=this._getNearItem(m,1)}}if(m==null){return}this._setSelected(m._optId,true,true);if(this.conf.f_mode==false){this.base.firstChild.value=this.t[m._optId].obj.getText(m,true)}else{var n=String(this.t[m._optId].obj.getText(m,true));if(this.conf.f_mode=="start"&&this.conf.f_ac==true){if(n.toLowerCase().indexOf(this.conf.f_server_last)===0){this.conf.f_ac_text=n.substring(this.conf.f_server_last.length,n.length);this.base.firstChild.value=n;this._selectRange(this.conf.f_server_last.length,this.base.firstChild.value.length)}else{this.base.firstChild.value=n;this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this._selectRange(0,this.base.firstChild.value.length)}}else{this.base.firstChild.value=n;this.conf.f_server_last=this.base.firstChild.value.toLowerCase()}}m=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 b=0;b<this.conf.evs_nodes.length;b++){for(var i in this.conf.evs_nodes[b].evs){if(window.addEventListener){this.conf.evs_nodes[b].node.addEventListener(i,this[this.conf.evs_nodes[b].evs[i]],false)}else{this.conf.evs_nodes[b].node.attachEvent("on"+i,this[this.conf.evs_nodes[b].evs[i]])}}}this.unload=function(){this.clearAll();this.t=null;for(var n=0;n<this.conf.evs_nodes.length;n++){for(var m in this.conf.evs_nodes[n].evs){if(window.addEventListener){this.conf.evs_nodes[n].node.removeEventListener(m,this[this.conf.evs_nodes[n].evs[m]],false)}else{this.conf.evs_nodes[n].node.detachEvent("on"+m,this[this.conf.evs_nodes[n].evs[m]])}this.conf.evs_nodes[n].evs[m]=null;delete this.conf.evs_nodes[n].evs[m]}this.conf.evs_nodes[n].node=null;this.conf.evs_nodes[n].evs=null;delete this.conf.evs_nodes[n].node;delete this.conf.evs_nodes[n].evs;this.conf.evs_nodes[n]=null}window.dhx4._eventable(this,"clear");window.dhx4._enableDataLoading(this,null,null,null,"clear");this.DOMelem_input=this.DOMelem_button=this.DOMlist=null;for(var m in this.conf){this.conf[m]=null;delete this.conf[m]}this.conf=null;this.base.parentNode.removeChild(this.base);this.list.parentNode.removeChild(this.list);this.base=this.list=this.cont=null;this.modes=null;for(var m in this){if(typeof(this[m])=="function"){this[m]=null}}g=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=f;f=null;if(d!=null){if(d.filter!=null){if(typeof(d.filter)=="string"){this.enableFilteringMode(true,d.filter,window.dhx4.s2b(d.filter_cache),window.dhx4.s2b(d.filter_sub_load))}else{this.enableFilteringMode(true)}}if(d.image_path!=null){this.setImagePath(d.image_path)}if(d.default_image!=null||d.default_image_dis!=null){this.setDefaultImage(d.default_image,d.default_image_dis)}if(d.items||d.options){this.addOption(d.items||d.options)}if(d.xml||d.json){this.load(d.xml||d.json)}if(typeof(d.readonly)!="undefined"){this.readonly(d.readonly)}d=null}return this}function dhtmlXComboFromSelect(c){if(typeof(c)=="string"){c=document.getElementById(c)}var b=c.offsetWidth;var j=c.getAttribute("name")||null;var d=document.createElement("SPAN");c.parentNode.insertBefore(d,c);var f=c.getAttribute("mode")||c.getAttribute("opt_type")||"option";var e=new dhtmlXCombo(d,j,b,f);d=null;var h=c.getAttribute("imagePath");if(h){e.setImagePath(h)}var i=c.getAttribute("defaultImage");var g=c.getAttribute("defaultImageDis");if(window.dhx4.s2b(g)==true){g=true}if(i!=null||g!=null){e.setDefaultImage(i,g)}var a=e._xmlToObj([c],true);if(a.options.length>0){e.addOption(a.options)}a=null;c.parentNode.removeChild(c);c=null;return e}dhtmlXCombo.prototype.setName=function(a){this.conf.form_name=a;this.base.childNodes[1].name=a;this.base.childNodes[2].name=a+"_new_value"};dhtmlXCombo.prototype.readonly=function(a){if(window.dhx4.s2b(a)){this.base.firstChild.setAttribute("readOnly","true")}else{this.base.firstChild.removeAttribute("readOnly")}};dhtmlXCombo.prototype.setPlaceholder=function(a){if(typeof(a)=="undefined"||a==null){a=""}this.base.firstChild.setAttribute("placeholder",String(a))};dhtmlXCombo.prototype.setTemplate=function(c){for(var b in c){if(typeof(this.conf.template[b])!="undefined"){this.conf.template[b]=String(c[b])}}for(var b in this.t){this.t[b].obj.setText(this.t[b].item,this.t[b].item._conf.text)}this._confirmSelect()};dhtmlXCombo.prototype.setSkin=function(a){if(a==this.conf.skin){return}this.conf.skin=a;this.base.className="dhxcombo_"+this.conf.skin+(this.conf.enabled?"":" dhxcombo_disabled");this.list.className="dhxcombolist_"+this.conf.skin};dhtmlXCombo.prototype.getInput=function(){return this.base.firstChild};dhtmlXCombo.prototype.getButton=function(){return this.base.childNodes[this.base.childNodes.length-(this.conf.combo_image?2:1)]};dhtmlXCombo.prototype.getList=function(){return this.list};dhtmlXCombo.prototype.getBase=function(){return this.base};dhtmlXCombo.prototype.getParent=function(){return this.DOMParent};dhtmlXCombo.prototype.forEachOption=function(a){for(var b=0;b<this.list.childNodes.length;b++){a.apply(window,[this._getOption(this.list.childNodes[b]._optId,b)])}};dhtmlXCombo.prototype.setFocus=function(){if(this.conf.enabled){this.base.firstChild.focus()}};dhtmlXCombo.prototype.setFontSize=function(a,b){if(a!=null){this.base.firstChild.style.fontSize=a}if(b!=null){this.list.style.fontSize=b}};dhtmlXCombo.prototype.getOption=function(e){var f=null;var c=null;for(var d=0;d<this.list.childNodes.length;d++){if(f==null){var b=this.list.childNodes[d]._optId;if(this.t[b].obj.getValue(this.t[b].item)==e){f=b;c=d}}}return(f==null?null:this._getOption(f,c))};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(e){var f=null;var c=null;for(var d=0;d<this.list.childNodes.length;d++){if(f==null){var b=this.list.childNodes[d]._optId;if(this.t[b].obj.getText(this.t[b].item,true)==e){f=b;c=d}}}return(f==null?null:this._getOption(f,c))};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(b){var a=this.getOption(b);return(a!=null?a.index:-1)};dhtmlXCombo.prototype.setComboText=function(a){this.conf.last_text=this.base.firstChild.value=a;this.conf.f_server_last=this.base.firstChild.value.toLowerCase()};dhtmlXCombo.prototype.setComboValue=function(b){var a=this.getOption(b);if(a!=null){this.selectOption(a.index)}else{this.conf.last_value=b;this.base.childNodes[1].value=this.conf.last_value;this.base.childNodes[2].value="true"}};dhtmlXCombo.prototype.selectOption=function(b,c,a){if(b<0||b>=this.list.childNodes.length){return}var d=this.list.childNodes[b]._optId;this._setSelected(d,this._isListVisible(),true);this._confirmSelect("script")};dhtmlXCombo.prototype.unSelectOption=function(){};dhtmlXCombo.prototype.confirmValue=function(){this._confirmSelect("script")};dhtmlXCombo.prototype.enable=function(a){a=(typeof(a)=="undefined"?true:window.dhx4.s2b(a));if(this.conf.enabled==a){return}this.conf.enabled=a;if(a){this.base.className="dhxcombo_"+this.conf.skin;this.base.firstChild.removeAttribute("disabled")}else{this._hideList();this.base.className="dhxcombo_"+this.conf.skin+" dhxcombo_disabled";this.base.firstChild.setAttribute("disabled","true")}this._updateTopImage(this.conf.last_selected)};dhtmlXCombo.prototype.disable=function(a){a=(typeof(a)=="undefined"?true:window.dhx4.s2b(a));this.enable(!a)};dhtmlXCombo.prototype.isEnabled=function(){return(this.conf.enabled==true)};dhtmlXCombo.prototype.show=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.base.style.display=(a==true?"":"none")};dhtmlXCombo.prototype.hide=function(a){if(typeof(a)=="undefined"){a=true}this.show(!a)};dhtmlXCombo.prototype.isVisible=function(){return(this.base.style.display=="")};dhtmlXCombo.prototype.enableFilteringMode=function(d,b,a,c){if(d==true||d=="between"){this.conf.f_mode=(d==true?"start":"between");if(b!=null){this.conf.f_url=b;this.conf.f_cache=window.dhx4.s2b(a);this.conf.f_dyn=window.dhx4.s2b(c)}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(b){for(var c=0;c<this.list.childNodes.length;c++){var a=b.apply(window,[this._getOption(this.list.childNodes[c]._optId,c)]);this.list.childNodes[c].style.display=(a===true?"":"none")}};dhtmlXCombo.prototype.sort=function(c){var a=[];for(var b=0;b<this.list.childNodes.length;b++){var d=this.list.childNodes[b]._optId;a.push([d,this._getOption(d,b)])}if(c=="asc"||c=="desc"){k=true;a.sort(function(f,e){f=f[1].text_option.toLowerCase();e=e[1].text_option.toLowerCase();var g=(c=="asc"?1:-1);return(f>e?g:-1*g)})}else{if(typeof(c)=="function"||typeof(window[c])=="function"){if(typeof(window[c])=="function"){c=window[c]}a.sort(function(f,e){return c.apply(window,[f[1],e[1]])})}}while(this.list.childNodes.length>0){this.list.removeChild(this.list.lastChild)}for(var b=0;b<a.length;b++){this.list.appendChild(this.t[a[b][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(d){var a=window.dhx4.trim(this.base.firstChild.value).toLowerCase();var e=null;var b=this.list.firstChild;while(b!=null){if(b.style.display==""&&b._optId!=null){var c=window.dhx4.trim(this.t[b._optId].obj.getText(b,true)).toLowerCase();if(a==c){e=b._optId;b=null}}if(b!=null){b=b.nextSibling}}if(this.conf.last_match==null){if(e!=null){this._setSelected(e,true,true);this.conf.last_match=e}else{if(this.conf.f_mode!="between"||d==true){this._setSelected(null,true,true);this.conf.last_match=null}}}else{if(e!=null){if(e!=this.conf.last_match){this._setSelected(e,true,true);this.conf.last_match=e}}else{this._setSelected(null,true,true);this.conf.last_match=null}}};dhtmlXCombo.prototype._selectRange=function(b,a){if(this.conf.combo_focus==true){window.dhx4.selectTextRange(this.base.firstChild,b,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);this.list.style.visibility="hidden";this.list.style.display="";this.list.style.width=Math.max(this.conf.opts_width||0,this.conf.combo_width)+"px";this.list.style.top=window.dhx4.absTop(this.base)+this.base.offsetHeight-1+"px";this.list.style.left=window.dhx4.absLeft(this.base)+"px";this._checkListHeight();this.list.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";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 b=0;b<this.list.childNodes.length;b++){a+=(this.list.childNodes[b].style.display==""?1:0)}return a};dhtmlXCombo.prototype._checkListHeight=function(){if(!this._isListVisible()){return}if(this.conf.item_h==null){var i=this.list.firstChild;while(i!=null){if(i.style.display==""){this.conf.item_h=i.offsetHeight;i=null}else{i=i.nextSibling}}i=null}var j=window.dhx4.screenDim();var e=window.dhx4.absTop(this.base);var a=this.base.offsetHeight;var b=Math.max(0,Math.floor((e-j.top)/this.conf.item_h));var g=Math.max(0,Math.floor((j.bottom-(e+a))/this.conf.item_h));var l=this._getListVisibleCount();if(g<Math.min(this.conf.opts_count_min,l)&&b>g){g=null}var f=Math.min((g==null?b:g),this.conf.opts_count,l);var c=(f<l?(f*this.conf.item_h)+"px":"");var d=this.conf.sp[this.conf.skin].list_ofs;this.list.style.height=c;this.list.style.top=(g==null?e-this.list.offsetHeight+d:e+a-d)+"px"};dhtmlXCombo.prototype._scrollToItem=function(e){var d=this.t[e].item.offsetTop;var c=d+this.t[e].item.offsetHeight;var b=this.list.scrollTop;var a=b+this.list.clientHeight;if(d<b){this.list.scrollTop=d}else{if(c>a){this.list.scrollTop=c-this.list.clientHeight}}};dhtmlXCombo.prototype._setSelected=function(e,d,b){if(b){this._updateTopImage(e)}if(e!=null&&this.conf.last_hover==e){if(d){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.t[e].item==this.t[e].item.parentNode.lastChild&&this.conf.f_url!=null&&this.conf.f_dyn==true&&!this.conf.f_dyn_end){var c="mask="+encodeURIComponent(this.conf.f_mask)+"&pos="+this.list.childNodes.length;var a=this;window.dhx4.ajax.post(this.conf.f_url,c,function(g){if(a.conf.f_cache){a.conf.f_cache_data[a.conf.f_mask].data.push(g.xmlDoc.responseXML)}var f=a.list.childNodes.length;a.load(g.xmlDoc.responseXML);if(f==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}}a=null})}if(d){this._scrollToItem(e)}}};dhtmlXCombo.prototype.addOption=function(f,g,b,a,d){var c=null;if(!(f instanceof Array)){var h=this._renderOption({value:f,text:g,css:b,img:a});if(c==null&&window.dhx4.s2b(d)==true){c=h}}else{for(var e=0;e<f.length;e++){if(f[e] instanceof Array){h=this._renderOption({value:f[e][0],text:f[e][1],css:f[e][2],img:f[e][3]});if(c==null&&window.dhx4.s2b(f[e][4])==true){c=h}}else{var h=this._renderOption(f[e]);if(c==null&&window.dhx4.s2b(f[e].selected)==true){c=h}}}}if(c!=null){this._setSelected(c,this._isListVisible(),true);this._confirmSelect("onInit")}};dhtmlXCombo.prototype.updateOption=function(a,c,b,d){var e=this._getOptionId(a);if(e==null){return}this.t[e].obj.update(this.t[e].item,{value:c,text:b,css:d});if(this.conf.last_selected==e){this.conf.last_text=this.base.firstChild.value=this.t[e].obj.getText(this.t[e].item,true);this.conf.f_server_last=this.base.firstChild.value.toLowerCase()}};dhtmlXCombo.prototype.deleteOption=function(d){for(var b in this.t){var c=this.t[b].obj.getValue(this.t[b].item);if(c==d){this._removeOption(b)}}if(this._isListVisible()){this._showList(true)}};dhtmlXCombo.prototype.clearAll=function(){for(var b in this.t){this._removeOption(b)}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;this._hideList()};dhtmlXCombo.prototype._renderOption=function(b){var c=window.dhx4.newId();var a=document.createElement("DIV");a._optId=c;a._tpl=this.conf.template;if(typeof(b.img)=="undefined"&&typeof(b.img_src)!="undefined"){b.img=b.img_src;delete b.img_src}if(typeof(b.img_dis)=="undefined"&&typeof(b.img_src_dis)!="undefined"){b.img_dis=b.img_src_dis;delete b.img_src_dis}b.img_path=this.conf.img_path;b.img_def=this.conf.img_def;b.img_def_dis=this.conf.img_def_dis;this.list.appendChild(a);this.t[a._optId]={obj:this.modes[this.conf.opts_type].render(a,b),item:a,conf:{type:this.conf.opts_type}};a=null;return c};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(b){var a=false;if(this.conf.f_server_tm){window.clearTimeout(this.conf.f_server_tm)}if(this.conf.last_hover!=null){a=a||(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)){a=a||(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(b!="blur"){this._selectRange(this.base.firstChild.value.length,this.base.firstChild.value.length)}}this._hideList();if(a==true&&b!="onInit"&&b!="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(g,d){if(!this.t[g]){return null}if(typeof(d)=="undefined"){d=-1}if(d<0){for(var f=0;f<this.list.childNodes.length;f++){if(d<0&&this.list.childNodes[f]._optId==g){d=f}}}var e={value:this.t[g].obj.getValue(this.t[g].item),text:this.t[g].obj.getText(this.t[g].item),text_input:this.t[g].obj.getText(this.t[g].item,true),text_option:this.t[g].obj.getText(this.t[g].item,null,true),css:this.t[g].obj.getCss(this.t[g].item),selected:(g==this.conf.last_selected),index:d};if(typeof(this.t[g].obj.getExtraData)=="function"){var c=this.t[g].obj.getExtraData(this.t[g].item);for(var b in c){if(typeof(e[b])=="undefined"){e[b]=c[b]}}}return e};dhtmlXCombo.prototype._getOptionProp=function(d,c,b){if(d!=null){var a=this._getOption(d);if(a!=null){return a[c]}}return b};dhtmlXCombo.prototype._getOptionId=function(b){var d=null;for(var a=0;a<this.list.childNodes.length;a++){if(d==null){var c=this.list.childNodes[a]._optId;if(b==this.t[c].obj.getValue(this.t[c].item)){d=c}}}return d};dhtmlXCombo.prototype._getOptionValue=function(a){return this._getOptionProp(a,"value",null)};dhtmlXCombo.prototype.setSize=function(a){this.conf.combo_width=parseInt(a);this.base.style.width=this.conf.combo_width+"px";this.base.firstChild.style.width=(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.modes={};dhtmlXCombo.prototype.doWithItem=function(a,g,e,c){var f=(a>=0&&a<this.list.childNodes.length?this.list.childNodes[a]._optId:null);if(f==null){return null}if(typeof(this.t[f].obj[g])!="function"){return null}var d=[this.t[f].item];for(var b=2;b<arguments.length;b++){d.push(arguments[b])}return this.t[f].obj[g].apply(this.t[f].obj,d)};function dhtmlXComboExtend(d,c){for(var b in dhtmlXCombo.prototype.modes[c]){if(typeof(dhtmlXCombo.prototype.modes[d][b])=="undefined"){dhtmlXCombo.prototype.modes[d][b]=dhtmlXCombo.prototype.modes[c][b]}}}dhtmlXCombo.prototype.modes.option={image:false,option_css:"dhxcombo_option_text",render:function(a,b){a._conf={value:b.value,css:""};a.className="dhxcombo_option";a.innerHTML="<div class='"+this.option_css+"'>&nbsp;</div>";if(b.css!=null){a.lastChild.style.cssText=b.css;a._conf.css=b.css}this.setText(a,b.text);return this},destruct:function(a){a._conf=null},update:function(a,b){a._conf.value=b.value;a._conf.css=b.css;a.lastChild.style.cssText=b.css;this.setText(a,b.text)},setText:function(b,c){b._conf.text=c;var a=(typeof(c)=="object"?window.dhx4.template(b._tpl.option,b._conf.text,true):window.dhx4.trim(b._conf.text||""));b.lastChild.innerHTML=(a.length==0?"&nbsp;":a)},getText:function(c,a,b){if(window.dhx4.s2b(a)&&typeof(c._conf.text)=="object"){return window.dhx4.template(c._tpl.input,c._conf.text,true)}if(window.dhx4.s2b(b)&&typeof(c._conf.text)=="object"){return window.dhx4.template(c._tpl.option,c._conf.text,true)}return c._conf.text},getValue:function(a){return a._conf.value},getCss:function(a){return a._conf.css},setSelected:function(a,b){a.className="dhxcombo_option"+(b?" 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,b){a._conf={value:b.value,css:"",checked:window.dhx4.s2b(b.checked)};a.className="dhxcombo_option";a.innerHTML="<div class='"+String(this.image_css).replace("#state#",(a._conf.checked?"1":"0"))+"'></div><div class='"+this.option_css+"'>&nbsp;</div>";a.firstChild._optChbxId=a._optId;if(b.css!=null){a.lastChild.style.cssText+=b.css;a._conf.css=b.css}this.setText(a,b.text);return this},setChecked:function(a,b){a._conf.checked=window.dhx4.s2b(b);a.firstChild.className=String(this.image_css).replace("#state#",(a._conf.checked?"1":"0"))},isChecked:function(a){return(a._conf.checked==true)},getExtraData:function(a){return{type:"checkbox",checked:a._conf.checked}},optionClick:function(d,c,e){var b=true;var a=(c.target||c.srcElement);while(b==true&&a!=null&&a!=d){if(a._optChbxId!=null){if(e.callEvent("onCheck",[d._conf.value,!d._conf.checked])===true){this.setChecked(d,!this.isChecked(d))}b=false}else{a=a.parentNode}}a=e=d=null;return b},getTopImage:function(b,a){return""},topImageClick:function(a,b){return true}};dhtmlXComboExtend("checkbox","option");dhtmlXCombo.prototype.setChecked=function(a,b){this.doWithItem(a,"setChecked",b)};dhtmlXCombo.prototype.getChecked=function(a,d){var b=[];for(var c=0;c<this.list.childNodes.length;c++){if(this.isChecked(c)){b.push(this._getOptionProp(this.list.childNodes[c]._optId,"value",""))}}return b};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,b){a._conf={value:b.value,css:""};a.className="dhxcombo_option";a.innerHTML="<div class='"+this.image_css+"'></div><div class='"+this.option_css+"'>&nbsp;</div>";if(b.css!=null){a.lastChild.style.cssText+=b.css;a._conf.css=b.css}this.setText(a,b.text);this.setImage(a,b.img,b.img_dis,b.img_path,b.img_def,b.img_def_dis);return this},update:function(a,b){a._conf.value=b.value;a._conf.css=b.css;a.lastChild.style.cssText=b.css;this.setText(a,b.text);this.setImage(a,b.img,b.img_dis,b.img_path,b.img_def,b.img_def_dis)},setImage:function(c,a,e,f,d,b){if(a!=null&&a.length>0){a=f+a}else{if(d!=null&&d.length>0){a=f+d}else{a=null}}if(e!=null&&e.length>0){e=f+e}else{if(b!=null&&b.length>0){e=f+b}else{if(b==true){e=a}else{e=null}}}c._conf.img=a;c._conf.img_dis=e;c.firstChild.style.backgroundImage=(a!=null?"url("+a+")":"none")},getExtraData:function(a){return{type:"image"}},getTopImage:function(d,c){var b=(c?"img":"img_dis");if(d!=null&&d._conf[b]!=null){return"<div class='"+this.image_css+"' style='background-image:url("+d._conf[b]+");'></div>"}return""}};dhtmlXComboExtend("image","option");dhtmlXCombo.prototype.setDefaultImage=function(a,b){if(a!=null){this.conf.img_def=a}if(b!=null){this.conf.img_def_dis=b}};dhtmlXCombo.prototype.setImagePath=function(a){this.conf.img_path=a};function dhtmlXMenuObject(e,f){var d=this;this.conf={skin:(f||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,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(e)=="object"&&e!=null&&typeof(e.tagName)=="undefined"){if(e.icons_path!=null||e.icon_path!=null){this.conf.icons_path=(e.icons_path||e.icon_path)}if(e.skin!=null){this.conf.skin=e.skin}if(e.visible_area){this.conf.v_enabled=true;this.conf.v={x1:e.visible_area.x1,x2:e.visible_area.x2,y1:e.visible_area.y1,y2:e.visible_area.y2}}for(var c 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(e[c]!=null){this.conf.autoload[c]=e[c]}}e=e.parent}if(e==null){this.base=document.body}else{var b=(typeof(e)=="string"?document.getElementById(e):e);if(b!=null){this.base=b;if(!this.base.id){this.base.id=(new Date()).valueOf()}this.base.className+=" dhtmlxMenu_"+this.conf.skin+"_Middle dir_left";this.base._autoSkinUpdate=true;if(this.base.oncontextmenu){this.base._oldContextMenuHandler=this.base.oncontextmenu}this.conf.ctx_baseid=this.base.id;this.base.onselectstart=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};this.base.oncontextmenu=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false}}else{this.base=document.body}}this.idPrefix="";this.topId="dhxWebMenuTopId";this.idPull={};this.itemPull={};this.userData={};this.radio={};this.setSkin=function(h){var i=this.conf.skin;this.conf.skin=h;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_"+i+"_Middle","")+" dhtmlxMenu_"+this.conf.skin+"_Middle"}for(var g in this.idPull){this.idPull[g].className=String(this.idPull[g].className).replace(i,this.conf.skin)}};this.setSkin(this.conf.skin);this._addSubItemToSelected=function(h,g){var a=true;for(var i=0;i<this.conf.selected_sub.length;i++){if((this.conf.selected_sub[i][0]==h)&&(this.conf.selected_sub[i][1]==g)){a=false}}if(a==true){this.conf.selected_sub.push(new Array(h,g))}return a};this._removeSubItemFromSelected=function(i,h){var a=new Array();var g=false;for(var j=0;j<this.conf.selected_sub.length;j++){if((this.conf.selected_sub[j][0]==i)&&(this.conf.selected_sub[j][1]==h)){g=true}else{a[a.length]=this.conf.selected_sub[j]}}if(g==true){this.conf.selected_sub=a}return g};this._getSubItemToDeselectByPolygon=function(i){var a=new Array();for(var j=0;j<this.conf.selected_sub.length;j++){if(this.conf.selected_sub[j][1]==i){a[a.length]=this.conf.selected_sub[j][0];a=a.concat(this._getSubItemToDeselectByPolygon(this.conf.selected_sub[j][0]));var h=true;for(var g=0;g<this.conf.opened_poly.length;g++){if(this.conf.opened_poly[g]==this.conf.selected_sub[j][0]){h=false}}if(h==true){this.conf.opened_poly[this.conf.opened_poly.length]=this.conf.selected_sub[j][0]}this.conf.selected_sub[j][0]=-1;this.conf.selected_sub[j][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(v,i){var E=this._countVisiblePolygonItems(v);if(E==0){return}var z="polygon_"+v;if((this.idPull[z]!=null)&&(this.idPull[v]!=null)){if(this.conf.top_mode&&this.conf.mode=="web"&&!this.conf.context){if(!this.idPull[v]._mouseOver&&i==this.conf.dir_toplv){return}}if(!this.conf.fixed_pos){this._autoDetectVisibleArea()}var A=0;var D=0;var H=null;var s=null;if(this.idPull[z]._zId==null){this.idPull[z]._zId=window.dhx4.newId()}this.idPull[z]._zInd=window.dhx4.zim.reserve(this.idPull[z]._zId);this.idPull[z].style.visibility="hidden";this.idPull[z].style.left="0px";this.idPull[z].style.top="0px";this.idPull[z].style.display="";this.idPull[z].style.zIndex=this.idPull[z]._zInd;if(this.conf.auto_overflow){if(this.idPull[z].firstChild.offsetHeight>this.conf.v.y1+this.conf.v.y2){var r=Math.floor((this.conf.v.y2-this.conf.v.y1-35)/24);this.conf.overflow_limit=r}else{this.conf.overflow_limit=0;if(this.idPull["arrowup_"+v]!=null){this._removeUpArrow(String(v).replace(this.idPrefix,""))}if(this.idPull["arrowdown_"+v]!=null){this._removeDownArrow(String(v).replace(this.idPrefix,""))}}}if(this.conf.overflow_limit>0&&this.conf.overflow_limit<E){if(this.idPull["arrowup_"+v]==null){this._addUpArrow(String(v).replace(this.idPrefix,""))}if(this.idPull["arrowdown_"+v]==null){this._addDownArrow(String(v).replace(this.idPrefix,""))}H=this.idPull["arrowup_"+v];H.style.display="none";s=this.idPull["arrowdown_"+v];s.style.display="none"}if(this.conf.overflow_limit>0){if(this.conf.overflow_limit<E){this.idPull[z].childNodes[1].style.height=24*this.conf.overflow_limit+"px";H.style.width=s.style.width=this.idPull[z].childNodes[1].style.width=this.idPull[z].childNodes[1].childNodes[0].offsetWidth+"px";this.idPull[z].childNodes[1].scrollTop=0;H.style.display="";A=H.offsetHeight;s.style.display="";D=s.offsetHeight}else{this.idPull[z].childNodes[1].style.height="";this.idPull[z].childNodes[1].style.width=""}}if(this.itemPull[v]!=null){var p="polygon_"+this.itemPull[v]["parent"]}else{if(this.conf.context){var p=this.idPull[this.idPrefix+this.topId]}}var a=(this.idPull[v].tagName!=null?window.dhx4.absLeft(this.idPull[v]):this.idPull[v][0]);var F=(this.idPull[v].tagName!=null?window.dhx4.absTop(this.idPull[v]):this.idPull[v][1]);var g=(this.idPull[v].tagName!=null?this.idPull[v].offsetWidth:0);var j=(this.idPull[v].tagName!=null?this.idPull[v].offsetHeight:0);var o=0;var n=0;var q=this.idPull[z].offsetWidth;var C=this.idPull[z].childNodes[1].offsetHeight+A+D;if(i=="bottom"){if(this.conf.rtl){o=a+(g!=null?g:0)-q}else{if(this.conf.align=="right"){o=a+g-q}else{o=a-1+(i==this.conf.dir_toplv?this.conf.tl_rmarg:0)}}n=F-1+j+this.conf.tl_botmarg}if(i=="right"){o=a+g-1;n=F+2}if(i=="left"){o=a-this.idPull[z].offsetWidth+2;n=F+2}if(i=="top"){o=a-1;n=F-C+2}if(this.conf.fixed_pos){var u=65536;var t=65536}else{var u=(this.conf.v.x2!=null?this.conf.v.x2:0);var t=(this.conf.v.y2!=null?this.conf.v.y2:0);if(u==0){if(window.innerWidth){u=window.innerWidth;t=window.innerHeight}else{u=document.body.offsetWidth;t=document.body.scrollHeight}}}if(o+q>u&&!this.conf.rtl){o=a-q+2}if(o<this.conf.v.x1&&this.conf.rtl){o=a+g-2}if(o<0){o=0}if(n+C>t&&this.conf.v.y2!=null){n=Math.max(F+j-C+2,(this.conf.v_enabled?this.conf.v.y1+2:2));if(this.conf.context&&this.idPrefix+this.topId==v&&s!=null){n=n-2}if(this.itemPull[v]!=null&&!this.conf.context){if(this.itemPull[v]["parent"]==this.idPrefix+this.topId){n=n-this.base.offsetHeight}}}this.idPull[z].style.left=o+"px";this.idPull[z].style.top=n+"px";if(typeof(this._menuEffect)!="undefined"&&this._menuEffect!==false){this._showPolygonEffect(z)}else{this.idPull[z].style.visibility="";if(this.conf.overflow_limit>0&&this.conf.overflow_limit<E){this.idPull[z].childNodes[1].scrollTop=0;this._checkArrowsState(v)}if(window.dhx4.isIE6){var m=z+"_ie6cover";if(this.idPull[m]==null){var l=document.createElement("IFRAME");l.className="dhtmlxMenu_IE6CoverFix_"+this.conf.skin;l.frameBorder=0;l.setAttribute("src","javascript:false;");document.body.insertBefore(l,document.body.firstChild);this.idPull[m]=l}this.idPull[m].style.left=o+"px";this.idPull[m].style.top=n+"px";this.idPull[m].style.width=this.idPull[z].offsetWidth+"px";this.idPull[m].style.height=this.idPull[z].offsetHeight+"px";this.idPull[m].style.zIndex=this.idPull[z].style.zIndex-1;this.idPull[m].style.display=""}}v=String(v).replace(this.idPrefix,"");if(v==this.topId){v=null}this.callEvent("onShow",[v]);if(v!=null&&this.conf.skin=="dhx_terrace"&&this.itemPull[this.idPrefix+v].parent==this.idPrefix+this.topId){this._improveTerraceButton(this.idPrefix+v,false)}}};this._redistribSubLevelSelection=function(l,j){while(this.conf.opened_poly.length>0){this.conf.opened_poly.pop()}var a=this._getSubItemToDeselectByPolygon(j);this._removeSubItemFromSelected(-1,-1);for(var g=0;g<a.length;g++){if((this.idPull[a[g]]!=null)&&(a[g]!=l)){if(this.itemPull[a[g]]["state"]=="enabled"){this.idPull[a[g]].className="sub_item"}}}for(var g=0;g<this.conf.opened_poly.length;g++){if(this.conf.opened_poly[g]!=j){this._hidePolygon(this.conf.opened_poly[g])}}if(this.itemPull[l]["state"]=="enabled"){this.idPull[l].className="sub_item_selected";if(this.itemPull[l]["complex"]&&this.conf.dload&&(this.itemPull[l]["loaded"]=="no")){if(this.conf.dload_icon==true){this._updateLoaderIcon(l,true)}this.itemPull[l].loaded="get";var h=l.replace(this.idPrefix,"");this._dhxdataload.onBeforeXLS=function(){var m={params:{}};m.params[this.conf.dload_pid]=h;for(var i in this.conf.dload_params){m.params[i]=this.conf.dload_params[i]}return m};this.loadStruct(this.conf.dload_url)}if(this.itemPull[l]["complex"]||(this.conf.dload&&(this.itemPull[l]["loaded"]=="yes"))){if((this.itemPull[l]["complex"])&&(this.idPull["polygon_"+l]!=null)){this._updateItemComplexState(l,true,true);this._showPolygon(l,this.conf.dir_sublv)}}this._addSubItemToSelected(l,j);this.conf.selected=l}};this._doOnClick=function(g,s,i){this.conf.last_click=g;if(this.itemPull[this.idPrefix+g]["href_link"]!=null&&this.itemPull[this.idPrefix+g].state=="enabled"){var l=document.createElement("FORM");var o=String(this.itemPull[this.idPrefix+g]["href_link"]).split("?");l.action=o[0];if(o[1]!=null){var h=String(o[1]).split("&");for(var a=0;a<h.length;a++){var r=String(h[a]).split("=");var n=document.createElement("INPUT");n.type="hidden";n.name=(r[0]||"");n.value=(r[1]||"");l.appendChild(n)}}if(this.itemPull[this.idPrefix+g]["href_target"]!=null){l.target=this.itemPull[this.idPrefix+g]["href_target"]}l.style.display="none";document.body.appendChild(l);l.submit();if(l!=null){document.body.removeChild(l);l=null}return}if(s.charAt(0)=="c"){return}if(s.charAt(1)=="d"){return}if(s.charAt(2)=="s"){return}if(this.checkEvent("onClick")){this.callEvent("onClick",[g,this.conf.ctx_zoneid,i])}else{if((s.charAt(1)=="d")||(this.conf.mode=="win"&&s.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(h,l){var a=new Array();for(var i=0;i<l.length;i++){if(typeof(l[i])=="object"){if(l[i].length==5){if(typeof(l[i][0])!="object"){if((l[i][0].replace(this.idPrefix,"")==h)&&(i==0)){a=l}}}var g=this._searchMenuNode(h,l[i]);if(g.length>0){a=g}}}return a};this._getMenuNodes=function(i){var g=new Array;for(var h in this.itemPull){if(this.itemPull[h]["parent"]==i){g[g.length]=h}}return g};this._genStr=function(a){var g="";var i="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var h=0;h<a;h++){g+=i.charAt(Math.round(Math.random()*(i.length-1)))}return g};this.getItemType=function(a){a=this.idPrefix+a;if(this.itemPull[a]==null){return null}return this.itemPull[a]["type"]};this.forEachItem=function(h){for(var g in this.itemPull){h(String(g).replace(this.idPrefix,""))}};this._clearAndHide=function(){d.conf.selected=-1;d.conf.last_click=-1;while(d.conf.opened_poly.length>0){d.conf.opened_poly.pop()}for(var a=0;a<d.conf.selected_sub.length;a++){var g=d.conf.selected_sub[a][0];if(d.idPull[g]!=null){if(d.itemPull[g]["state"]=="enabled"){if(d.idPull[g].className=="sub_item_selected"){d.idPull[g].className="sub_item"}if(d.idPull[g].className=="dhtmlxMenu_"+d.conf.skin+"_TopLevel_Item_Selected"){if(d.itemPull[g]["cssNormal"]!=null){d.idPull[g].className=d.itemPull[g]["cssNormal"]}else{d.idPull[g].className="dhtmlxMenu_"+d.conf.skin+"_TopLevel_Item_Normal"}}}}d._hidePolygon(g)}d.conf.is_touched=false;if(d.conf.context&&d.conf.ctx_hideall){d._hidePolygon(d.idPrefix+d.topId)}};this._showSubLevelItem=function(g,a){if(document.getElementById("arrow_"+this.idPrefix+g)!=null){document.getElementById("arrow_"+this.idPrefix+g).style.display=(a?"none":"")}if(document.getElementById("image_"+this.idPrefix+g)!=null){document.getElementById("image_"+this.idPrefix+g).style.display=(a?"none":"")}if(document.getElementById(this.idPrefix+g)!=null){document.getElementById(this.idPrefix+g).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(d.conf.context){if(d.conf.ctx_autohide&&(!window.dhx4.isOpera||(d._isContextMenuVisible()&&window.dhx4.isOpera))){d._hideContextMenu()}}else{if(d._clearAndHide){d._clearAndHide()}}};this._bodyContext=function(h){h=h||event;var g=String((h.srcElement||h.target).className);if(g.search("dhtmlxMenu")!=-1&&g.search("SubLevelArea")!=-1){return}var a=true;var i=h.target||h.srcElement;while(i!=null){if(i.id!=null){if(d.isContextZone(i.id)){a=false}}if(i==document.body){a=false}i=i.parentNode}if(a){d.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(h){}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 g in this.conf.ctx_zones){this.removeContextZone(g)}}if(this.cont!=null){this.cont.className="";this.cont.parentNode.removeChild(this.cont);this.cont=null}if(this.base!=null){this.base.className="";if(!this.conf.context){this.base.oncontextmenu=(this.base._oldContextMenuHandler||null)}this.base.onselectstart=null;this.base=null}for(var g in this){this[g]=null}d=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 c in {onclick:1,oncheckboxclick:1,onradioclick:1}){if(this.conf.autoload[c]!=null){if(typeof(this.conf.autoload[c])=="function"){this.attachEvent(c,this.conf.autoload[c])}else{if(typeof(window[this.conf.autoload[c]])=="function"){this.attachEvent(c,window[this.conf.autoload[c]])}}}}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 c in this.conf.autoload){this.conf.autoload[c]=null;delete this.conf.autoload[c]}this.conf.autoload=null;return this}dhtmlXMenuObject.prototype._init=function(){if(this._isInited==true){return}if(this.conf.dload){this._dhxdataload.onBeforeXLS=function(){var c={params:{}};for(var b in this.conf.dload_params){c.params[b]=this.conf.dload_params[b]}return c};this.loadStruct(this.conf.dload_url)}else{this._initTopLevelMenu();this._isInited=true}};dhtmlXMenuObject.prototype._countVisiblePolygonItems=function(f){var d=0;for(var b in this.itemPull){var c=this.itemPull[b]["parent"];var e=this.itemPull[b]["type"];if(this.idPull[b]!=null){if(c==f&&(e=="item"||e=="radio"||e=="checkbox")&&this.idPull[b].style.display!="none"){d++}}}return d};dhtmlXMenuObject.prototype._redefineComplexState=function(b){if(this.idPrefix+this.topId==b){return}if((this.idPull["polygon_"+b]!=null)&&(this.idPull[b]!=null)){var a=this._countVisiblePolygonItems(b);if((a>0)&&(!this.itemPull[b]["complex"])){this._updateItemComplexState(b,true,false)}if((a==0)&&(this.itemPull[b]["complex"])){this._updateItemComplexState(b,false,false)}}};dhtmlXMenuObject.prototype._updateItemComplexState=function(e,c,d){if((!this.conf.context)&&(this._getItemLevelType(e.replace(this.idPrefix,""))=="TopLevel")){this.itemPull[e]["complex"]=c;return}if((this.idPull[e]==null)||(this.itemPull[e]==null)){return}this.itemPull[e]["complex"]=c;if(e==this.idPrefix+this.topId){return}var a=null;var b=this.idPull[e].childNodes[this.conf.rtl?0:2];if(b.childNodes[0]){if(String(b.childNodes[0].className).search("complex_arrow")===0){a=b.childNodes[0]}}if(this.itemPull[e]["complex"]){if(a==null){a=document.createElement("DIV");a.className="complex_arrow";a.id="arrow_"+e;while(b.childNodes.length>0){b.removeChild(b.childNodes[0])}b.appendChild(a)}if(this.conf.dload&&(this.itemPull[e].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[e]["complex"])&&(a!=null)){b.removeChild(a);if(this.itemPull[e]["hotkey_backup"]!=null&&this.setHotKey){this.setHotKey(e.replace(this.idPrefix,""),this.itemPull[e]["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(c,d){c=this.idPrefix+c;var f=(this.itemPull[c]["parent"]==this.idPrefix+this.topId&&!this.conf.context);var g=null;if(f){for(var a=0;a<this.idPull[c].childNodes.length;a++){try{if(this.idPull[c].childNodes[a].className=="dhtmlxMenu_TopLevel_Item_Icon"){g=this.idPull[c].childNodes[a]}}catch(h){}}}else{try{var g=this.idPull[c].childNodes[this.conf.rtl?2:0].childNodes[0]}catch(h){}if(!(g!=null&&typeof(g.className)!="undefined"&&g.className=="sub_icon")){g=null}}if(this.itemPull[c]["type"]=="radio"){var j=this.itemPull[c][(this.itemPull[c]["state"]=="enabled"?"imgen":"imgdis")]}else{var j=this.itemPull[c][(this.itemPull[c]["state"]=="enabled"?"imgen":"imgdis")]}if(j.length>0){if(g!=null){g.src=this.conf.icons_path+j}else{if(f){var g=document.createElement("IMG");g.className="dhtmlxMenu_TopLevel_Item_Icon";g.src=this.conf.icons_path+j;g.border="0";g.id="image_"+c;if(!this.conf.rtl&&this.idPull[c].childNodes.length>0){this.idPull[c].insertBefore(g,this.idPull[c].childNodes[0])}else{this.idPull[c].appendChild(g)}}else{var g=document.createElement("IMG");g.className="sub_icon";g.src=this.conf.icons_path+j;g.border="0";g.id="image_"+c;var i=this.idPull[c].childNodes[this.conf.rtl?2:0];while(i.childNodes.length>0){i.removeChild(i.childNodes[0])}i.appendChild(g)}}}else{if(g!=null){var b=g.parentNode;b.removeChild(g);b.innerHTML="&nbsp;";b=g=null}}};dhtmlXMenuObject.prototype._getAllParents=function(f){var c=new Array();for(var b in this.itemPull){if(this.itemPull[b]["parent"]==f){c[c.length]=this.itemPull[b]["id"];if(this.itemPull[b]["complex"]){var d=this._getAllParents(this.itemPull[b]["id"]);for(var e=0;e<d.length;e++){c[c.length]=d[e]}}}}return c};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(e){e=this.idPrefix+e;var d=-1;if(this.itemPull[e]==null){return d}var a=this.itemPull[e]["parent"];var c=(this.idPull["polygon_"+a]!=null?this.idPull["polygon_"+a].tbd:this.cont);for(var b=0;b<c.childNodes.length;b++){if(c.childNodes[b]==this.idPull["separator_"+e]||c.childNodes[b]==this.idPull[e]){d=b}}return d};dhtmlXMenuObject.prototype.setItemPosition=function(g,f){g=this.idPrefix+g;if(this.idPull[g]==null){return}var b=(this.itemPull[g]["parent"]==this.idPrefix+this.topId);var a=this.idPull[g];var d=this.getItemPosition(g.replace(this.idPrefix,""));var c=this.itemPull[g]["parent"];var e=(this.idPull["polygon_"+c]!=null?this.idPull["polygon_"+c].tbd:this.cont);e.removeChild(e.childNodes[d]);if(f<0){f=0}if(b&&f<1){f=1}if(f<e.childNodes.length){e.insertBefore(a,e.childNodes[f])}else{e.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(d,b){var a=this._getSubItemToDeselectByPolygon("parent");this._removeSubItemFromSelected(-1,-1);for(var c=0;c<a.length;c++){if(a[c]!=d){this._hidePolygon(a[c])}if((this.idPull[a[c]]!=null)&&(a[c]!=d)){this.idPull[a[c]].className=this.idPull[a[c]].className.replace(/Selected/g,"Normal")}}if(this.itemPull[this.idPrefix+d]["state"]=="enabled"){this.idPull[this.idPrefix+d].className="dhtmlxMenu_"+this.conf.skin+"_TopLevel_Item_Selected";this._addSubItemToSelected(this.idPrefix+d,"parent");this.conf.selected=(this.conf.mode=="win"?(this.conf.selected!=-1?d:this.conf.selected):d);if((this.itemPull[this.idPrefix+d]["complex"])&&(this.conf.selected!=-1)){this._showPolygon(this.idPrefix+d,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 b=0;b<a.length;b++){if(this.itemPull[a[b]]["type"]=="item"){this._renderToplevelItem(a[b],null)}if(this.itemPull[a[b]]["type"]=="separator"){this._renderSeparator(a[b],null)}}}};dhtmlXMenuObject.prototype._renderToplevelItem=function(g,f){var e=this;var a=document.createElement("DIV");a.id=g;if(this.itemPull[g]["state"]=="enabled"&&this.itemPull[g]["cssNormal"]!=null){a.className=this.itemPull[g]["cssNormal"]}else{a.className="dhtmlxMenu_"+this.conf.skin+"_TopLevel_Item_"+(this.itemPull[g]["state"]=="enabled"?"Normal":"Disabled")}if(this.itemPull[g]["title"]!=""){var d=document.createElement("DIV");d.className="top_level_text";d.innerHTML=this.itemPull[g]["title"];a.appendChild(d)}if(this.itemPull[g]["tip"].length>0){a.title=this.itemPull[g]["tip"]}if((this.itemPull[g]["imgen"]!="")||(this.itemPull[g]["imgdis"]!="")){var c=this.itemPull[g][(this.itemPull[g]["state"]=="enabled")?"imgen":"imgdis"];if(c){var b=document.createElement("IMG");b.border="0";b.id="image_"+g;b.src=this.conf.icons_path+c;b.className="dhtmlxMenu_TopLevel_Item_Icon";if(a.childNodes.length>0&&!this.conf.rtl){a.insertBefore(b,a.childNodes[0])}else{a.appendChild(b)}}}a.onselectstart=function(h){h=h||event;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}return false};a.oncontextmenu=function(h){h=h||event;if(h.preventDefault){h.preventDefault()}else{h.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(f!=null){f++;if(f<0){f=0}if(f>this.cont.childNodes.length-1){f=null}}if(f!=null){this.cont.insertBefore(a,this.cont.childNodes[f])}else{this.cont.appendChild(a)}this.idPull[a.id]=a;if(this.itemPull[g]["complex"]&&(!this.conf.dload)){this._addSubMenuPolygon(this.itemPull[g]["id"],this.itemPull[g]["id"])}a.onmouseover=function(){if(e.conf.mode=="web"){window.clearTimeout(e.conf.tm_handler)}var h=e._getSubItemToDeselectByPolygon("parent");e._removeSubItemFromSelected(-1,-1);for(var l=0;l<h.length;l++){if(h[l]!=this.id){e._hidePolygon(h[l])}if((e.idPull[h[l]]!=null)&&(h[l]!=this.id)){if(e.itemPull[h[l]]["cssNormal"]!=null){e.idPull[h[l]].className=e.itemPull[h[l]]["cssNormal"]}else{if(e.idPull[h[l]].className=="sub_item_selected"){e.idPull[h[l]].className="sub_item"}e.idPull[h[l]].className=e.idPull[h[l]].className.replace(/Selected/g,"Normal")}}}if(e.itemPull[this.id]["state"]=="enabled"){this.className="dhtmlxMenu_"+e.conf.skin+"_TopLevel_Item_Selected";e._addSubItemToSelected(this.id,"parent");e.conf.selected=(e.conf.mode=="win"?(e.conf.selected!=-1?this.id:e.conf.selected):this.id);if(e.conf.dload){if(e.itemPull[this.id].loaded=="no"){this._dynLoadTM=new Date().getTime();e.itemPull[this.id].loaded="get";var m=this.id.replace(e.idPrefix,"");e._dhxdataload.onBeforeXLS=function(){var n={params:{}};n.params[this.conf.dload_pid]=m;for(var i in this.conf.dload_params){n.params[i]=this.conf.dload_params[i]}return n};e.loadStruct(e.conf.dload_url)}if(e.conf.top_mode&&e.conf.mode=="web"&&!e.conf.context){this._mouseOver=true}}if((!e.conf.dload)||(e.conf.dload&&(!e.itemPull[this.id]["loaded"]||e.itemPull[this.id]["loaded"]=="yes"))){if((e.itemPull[this.id]["complex"])&&(e.conf.selected!=-1)){if(e.conf.top_mode&&e.conf.mode=="web"&&!e.conf.context){this._mouseOver=true;var j=this.id;this._menuOpenTM=window.setTimeout(function(){e._showPolygon(j,e.conf.dir_toplv)},e.conf.top_tmtime)}else{e._showPolygon(this.id,e.conf.dir_toplv)}}}}e._doOnTouchMenu(this.id.replace(e.idPrefix,""))};a.onmouseout=function(){if(!((e.itemPull[this.id]["complex"])&&(e.conf.selected!=-1))&&(e.itemPull[this.id]["state"]=="enabled")){if(e.itemPull[this.id]["cssNormal"]!=null){a.className=e.itemPull[this.id]["cssNormal"]}else{a.className="dhtmlxMenu_"+e.conf.skin+"_TopLevel_Item_Normal"}}if(e.conf.mode=="web"){window.clearTimeout(e.conf.tm_handler);e.conf.tm_handler=window.setTimeout(function(){e._clearAndHide()},e.conf.tm_sec,"JavaScript")}if(e.conf.top_mode&&e.conf.mode=="web"&&!e.conf.context){this._mouseOver=false;window.clearTimeout(this._menuOpenTM)}};a.onclick=function(l){if(e.conf.mode=="web"){window.clearTimeout(e.conf.tm_handler)}if(e.conf.mode!="web"&&e.itemPull[this.id]["state"]=="disabled"){return}l=l||event;l.cancelBubble=true;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}if(e.conf.mode=="win"){if(e.itemPull[this.id]["complex"]){if(e.conf.selected==this.id){e.conf.selected=-1;var j=false}else{e.conf.selected=this.id;var j=true}if(j){e._showPolygon(this.id,e.conf.dir_toplv)}else{e._hidePolygon(this.id)}}}var h=(e.itemPull[this.id]["complex"]?"c":"-");var m=(e.itemPull[this.id]["state"]!="enabled"?"d":"-");var i={ctrl:l.ctrlKey,alt:l.altKey,shift:l.shiftKey};e._doOnClick(this.id.replace(e.idPrefix,""),h+m+"t",i);return false};if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXMenuObject.prototype._addSubMenuPolygon=function(f,e){var b=this._renderSublevelPolygon(f,e);var a=this._getMenuNodes(e);for(c=0;c<a.length;c++){if(this.itemPull[a[c]]["type"]=="separator"){this._renderSeparator(a[c],null)}else{this._renderSublevelItem(a[c],null)}}if(f==e){var d="topLevel"}else{var d="subLevel"}for(var c=0;c<a.length;c++){if(this.itemPull[a[c]]["complex"]){this._addSubMenuPolygon(f,this.itemPull[a[c]]["id"])}}};dhtmlXMenuObject.prototype._renderSublevelPolygon=function(e,d){var b=document.createElement("DIV");b.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_Polygon "+(this.conf.rtl?"dir_right":"");b.dir="ltr";b.oncontextmenu=function(f){f=f||event;if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}f.cancelBubble=true;return false};b.id="polygon_"+d;b.onclick=function(f){f=f||event;f.cancelBubble=true};b.style.display="none";document.body.insertBefore(b,document.body.firstChild);b.innerHTML='<div style="position:relative;"></div><div style="position: relative; overflow:hidden;"></div><div style="position:relative;"></div>';var c=document.createElement("TABLE");c.className="dhtmlxMebu_SubLevelArea_Tbl";c.cellSpacing=0;c.cellPadding=0;c.border=0;var a=document.createElement("TBODY");c.appendChild(a);b.childNodes[1].appendChild(c);b.tbl=c;b.tbd=a;this.idPull[b.id]=b;if(this.sxDacProc!=null){this.idPull["sxDac_"+d]=new this.sxDacProc(b,b.className);if(window.dhx4.isIE){this.idPull["sxDac_"+d]._setSpeed(this.dacSpeedIE);this.idPull["sxDac_"+d]._setCustomCycle(this.dacCyclesIE)}else{this.idPull["sxDac_"+d]._setSpeed(this.dacSpeed);this.idPull["sxDac_"+d]._setCustomCycle(this.dacCycles)}}return b};dhtmlXMenuObject.prototype._renderSublevelItem=function(a,j){var h=this;var i=document.createElement("TR");i.className=(this.itemPull[a]["state"]=="enabled"?"sub_item":"sub_item_dis");var g=document.createElement("TD");g.className="sub_item_icon";var l=this.itemPull[a][(this.itemPull[a]["state"]=="enabled"?"imgen":"imgdis")];if(l!=""){var o=this.itemPull[a]["type"];if(o=="checkbox"||o=="radio"){var e=document.createElement("DIV");e.id="image_"+this.itemPull[a]["id"];e.className="sub_icon "+l;g.appendChild(e)}if(!(o=="checkbox"||o=="radio")){var e=document.createElement("IMG");e.id="image_"+this.itemPull[a]["id"];e.className="sub_icon";e.src=this.conf.icons_path+l;g.appendChild(e)}}else{g.innerHTML="&nbsp;"}var f=document.createElement("TD");f.className="sub_item_text";if(this.itemPull[a]["title"]!=""){var n=document.createElement("DIV");n.className="sub_item_text";n.innerHTML=this.itemPull[a]["title"];f.appendChild(n)}else{f.innerHTML="&nbsp;"}var d=document.createElement("TD");d.className="sub_item_hk";if(this.itemPull[a]["complex"]){var b=document.createElement("DIV");b.className="complex_arrow";b.id="arrow_"+this.itemPull[a]["id"];d.appendChild(b)}else{if(this.itemPull[a]["hotkey"].length>0&&!this.itemPull[a]["complex"]){var c=document.createElement("DIV");c.className="sub_item_hk";c.innerHTML=this.itemPull[a]["hotkey"];d.appendChild(c)}else{d.innerHTML="&nbsp;"}}i.appendChild(this.conf.rtl?d:g);i.appendChild(f);i.appendChild(this.conf.rtl?g:d);i.id=this.itemPull[a]["id"];i.parent=this.itemPull[a]["parent"];if(this.itemPull[a]["tip"].length>0){i.title=this.itemPull[a]["tip"]}i.onselectstart=function(p){p=p||event;if(p.preventDefault){p.preventDefault()}else{p.returnValue=false}return false};i.onmouseover=function(p){if(h.conf.hide_tm[this.id]){window.clearTimeout(h.conf.hide_tm[this.id])}if(h.conf.mode=="web"){window.clearTimeout(h.conf.tm_handler)}if(!this._visible){h._redistribSubLevelSelection(this.id,this.parent)}this._visible=true};i.onmouseout=function(){if(h.conf.mode=="web"){if(h.conf.tm_handler){window.clearTimeout(h.conf.tm_handler)}h.conf.tm_handler=window.setTimeout(function(){if(h&&h._clearAndHide){h._clearAndHide()}},h.conf.tm_sec,"JavaScript")}var p=this;if(h.conf.hide_tm[this.id]){window.clearTimeout(h.conf.hide_tm[this.id])}h.conf.hide_tm[this.id]=window.setTimeout(function(){p._visible=false},50)};i.onclick=function(q){if(!h.checkEvent("onClick")&&h.itemPull[this.id]["complex"]){return}q=q||event;q.cancelBubble=true;if(q.preventDefault){q.preventDefault()}else{q.returnValue=false}tc=(h.itemPull[this.id]["complex"]?"c":"-");td=(h.itemPull[this.id]["state"]=="enabled"?"-":"d");var p={ctrl:q.ctrlKey,alt:q.altKey,shift:q.shiftKey};switch(h.itemPull[this.id]["type"]){case"checkbox":h._checkboxOnClickHandler(this.id.replace(h.idPrefix,""),tc+td+"n",p);break;case"radio":h._radioOnClickHandler(this.id.replace(h.idPrefix,""),tc+td+"n",p);break;case"item":h._doOnClick(this.id.replace(h.idPrefix,""),tc+td+"n",p);break}return false};var m=this.idPull["polygon_"+this.itemPull[a]["parent"]];if(j!=null){j++;if(j<0){j=0}if(j>m.tbd.childNodes.length-1){j=null}}if(j!=null&&m.tbd.childNodes[j]!=null){m.tbd.insertBefore(i,m.tbd.childNodes[j])}else{m.tbd.appendChild(i)}this.idPull[i.id]=i};dhtmlXMenuObject.prototype._renderSeparator=function(b,g){var a=(this.conf.context?"SubLevelArea":(this.itemPull[b]["parent"]==this.idPrefix+this.topId?"TopLevel":"SubLevelArea"));if(a=="TopLevel"&&this.conf.context){return}var e=this;if(a!="TopLevel"){var f=document.createElement("TR");f.className="sub_sep";var c=document.createElement("TD");c.colSpan="3";f.appendChild(c)}var d=document.createElement("DIV");d.id="separator_"+b;d.className=(a=="TopLevel"?"top_sep":"sub_sep");d.onselectstart=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}};d.onclick=function(l){l=l||event;l.cancelBubble=true;var j={ctrl:l.ctrlKey,alt:l.altKey,shift:l.shiftKey};e._doOnClick(this.id.replace("separator_"+e.idPrefix,""),"--s",j)};if(a=="TopLevel"){if(g!=null){g++;if(g<0){g=0}if(this.cont.childNodes[g]!=null){this.cont.insertBefore(d,this.cont.childNodes[g])}else{this.cont.appendChild(d)}}else{var i=this.cont.childNodes[this.cont.childNodes.length-1];if(String(i).search("TopLevel_Text")==-1){this.cont.appendChild(d)}else{this.cont.insertBefore(d,i)}}this.idPull[d.id]=d}else{var h=this.idPull["polygon_"+this.itemPull[b]["parent"]];if(g!=null){g++;if(g<0){g=0}if(g>h.tbd.childNodes.length-1){g=null}}if(g!=null&&h.tbd.childNodes[g]!=null){h.tbd.insertBefore(f,h.tbd.childNodes[g])}else{h.tbd.appendChild(f)}c.appendChild(d);this.idPull[d.id]=f}};dhtmlXMenuObject.prototype.addNewSeparator=function(a,b){b=this.idPrefix+(b!=null?b:this._genStr(24));var c=this.idPrefix+this.getParentId(a);this._addItemIntoGlobalStrorage(b,c,"","separator",false,"","");this._renderSeparator(b,this.getItemPosition(a))};dhtmlXMenuObject.prototype._initObj=function(l,m,g){if(!(l instanceof Array)){g=l.parentId;if(g!=null&&String(g).indexOf(this.idPrefix)!==0){g=this.idPrefix+String(g)}l=l.items}for(var c=0;c<l.length;c++){if(typeof(l[c].id)=="undefined"||l[c].id==null){l[c].id=this._genStr(24)}if(String(l[c].id).indexOf(this.idPrefix)!==0){l[c].id=this.idPrefix+String(l[c].id)}var d={type:"item",tip:"",hotkey:"",state:"enabled",imgen:"",imgdis:""};for(var n in d){if(typeof(l[c][n])=="undefined"){l[c][n]=d[n]}}if(l[c].imgen==""&&l[c].img!=null){l[c].imgen=l[c].img}if(l[c].imgdis==""&&l[c].img_disabled!=null){l[c].imgdis=l[c].img_disabled}if(l[c].title==null&&l[c].text!=null){l[c].title=l[c].text}if(l[c].href!=null){if(l[c].href.link!=null){l[c].href_link=l[c].href.link}if(l[c].href.target!=null){l[c].href_target=l[c].href.target}}if(l[c].userdata!=null){for(var n in l[c].userdata){this.userData[l[c].id+"_"+n]=l[c].userdata[n]}}if(typeof(l[c].enabled)!="undefined"&&window.dhx4.s2b(l[c].enabled)==false){l[c].state="disabled"}else{if(typeof(l[c].disabled)!="undefined"&&window.dhx4.s2b(l[c].disabled)==true){l[c].state="disabled"}}if(typeof(l[c].parent)=="undefined"){l[c].parent=(g!=null?g:this.idPrefix+this.topId)}if(l[c].type=="checkbox"){l[c].checked=window.dhx4.s2b(l[c].checked);l[c].imgen=l[c].imgdis="chbx_"+(l[c].checked?"1":"0")}if(l[c].type=="radio"){l[c].checked=window.dhx4.s2b(l[c].checked);l[c].imgen=l[c].imgdis="rdbt_"+(l[c].checked?"1":"0");if(typeof(l[c].group)=="undefined"||l[c].group==null){l[c].group=this._genStr(24)}if(this.radio[l[c].group]==null){this.radio[l[c].group]=[]}this.radio[l[c].group].push(l[c].id)}this.itemPull[l[c].id]=l[c];if(l[c].items!=null&&l[c].items.length>0){this.itemPull[l[c].id].complex=true;this._initObj(l[c].items,true,l[c].id)}else{if(this.conf.dload&&l[c].complex==true){this.itemPull[l[c].id].loaded="no"}}this.itemPull[l[c].id].items=null}if(m!==true){if(this.conf.dload==true){if(g==null){this._initTopLevelMenu()}else{this._addSubMenuPolygon(g,g);if(this.conf.selected==g){var j=(this.itemPull[g].parent==this.idPrefix+this.topId);var b=(j&&!this.conf.context?this.conf.dir_toplv:this.conf.dir_sublv);var e=false;if(j&&this.conf.top_mode&&this.conf.mode=="web"&&!this.conf.context){var o=this.idPull[g];if(o._mouseOver==true){var f=this.conf.top_tmtime-(new Date().getTime()-o._dynLoadTM);if(f>1){var i=g;var h=this;o._menuOpenTM=window.setTimeout(function(){h._showPolygon(i,b);h=i=null},f);e=true}}}if(!e){this._showPolygon(g,b)}}this.itemPull[g].loaded="yes";if(this.conf.dload_icon==true){this._updateLoaderIcon(g,false)}}}else{this._init()}}};dhtmlXMenuObject.prototype._xmlToJson=function(f,e){var h=[];if(e==null){var j=f.getElementsByTagName(this.conf.tags.root);if(j==null||j.length==0){return data}j=j[0]}else{j=f}if(j.getAttribute("parentId")!=null){e=this.idPrefix+j.getAttribute("parentId")}for(var b=0;b<j.childNodes.length;b++){if(typeof(j.childNodes[b].tagName)!="undefined"&&String(j.childNodes[b].tagName).toLowerCase()==this.conf.tags.item){var a=j.childNodes[b];var n={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){n.cssNormal=a.getAttribute("cssNormal")}if(n.type=="checkbox"){n.checked=a.getAttribute("checked")}if(n.type=="radio"){n.checked=a.getAttribute("checked");n.group=a.getAttribute("group")}n.state="enabled";if(a.getAttribute("enabled")!=null&&window.dhx4.s2b(a.getAttribute("enabled"))==false){n.state="disabled"}else{if(a.getAttribute("disabled")!=null&&window.dhx4.s2b(a.getAttribute("disabled"))==true){n.state="disabled"}}n.parent=(e!=null?e:this.idPrefix+this.topId);if(this.conf.dload){n.complex=(a.getAttribute("complex")!=null);if(n.complex){n.loaded="no"}}else{var c=this._xmlToJson(a,n.id);n.items=c.items;n.complex=(n.items.length>0)}for(var l=0;l<a.childNodes.length;l++){if(typeof(a.childNodes[l].tagName)!="undefined"){var m=String(a.childNodes[l].tagName||"").toLowerCase();if(m==this.conf.tags.userdata){var g=a.childNodes[l];if(g.getAttribute("name")!=null){this.userData[n.id+"_"+g.getAttribute("name")]=(g.firstChild!=null&&g.firstChild.nodeValue!=null?g.firstChild.nodeValue:"")}}if(m==this.conf.tags.text_ext){n.title=a.childNodes[l].firstChild.nodeValue}if(m==this.conf.tags.tooltip){n.tip=a.childNodes[l].firstChild.nodeValue}if(m==this.conf.tags.hotkey){n.hotkey=a.childNodes[l].firstChild.nodeValue}if(m==this.conf.tags.href&&n.type=="item"){n.href_link=a.childNodes[l].firstChild.nodeValue;if(a.childNodes[l].getAttribute("target")!=null){n.href_target=a.childNodes[l].getAttribute("target")}}}}h.push(n)}}var a={parentId:e,items:h};return a};dhtmlXMenuObject.prototype.enableDynamicLoading=function(a,b){this.conf.dload=true;this.conf.dload_url=a;this.conf.dload_sign=(String(this.conf.dload_url).search(/\?/)==-1?"?":"&");this.conf.dload_icon=b;this._init()};dhtmlXMenuObject.prototype._updateLoaderIcon=function(d,c){if(this.idPull[d]==null){return}if(String(this.idPull[d].className).search("TopLevel_Item")>=0){return}var b=(this.conf.rtl?0:2);if(!this.idPull[d].childNodes[b]){return}if(!this.idPull[d].childNodes[b].childNodes[0]){return}var a=this.idPull[d].childNodes[b].childNodes[0];if(String(a.className).search("complex_arrow")===0){a.className="complex_arrow"+(c?"_loading":"")}};dhtmlXMenuObject.prototype.addNewSibling=function(d,e,a,b,c,h){var g=this.idPrefix+(e!=null?e:this._genStr(24));var f=this.idPrefix+(d!=null?this.getParentId(d):this.topId);this._addItemIntoGlobalStrorage(g,f,a,"item",b,c,h);if((f==this.idPrefix+this.topId)&&(!this.conf.context)){this._renderToplevelItem(g,this.getItemPosition(d))}else{this._renderSublevelItem(g,this.getItemPosition(d))}};dhtmlXMenuObject.prototype.addNewChild=function(g,f,d,a,b,c,e){if(g==null){if(this.conf.context){g=this.topId}else{this.addNewSibling(g,d,a,b,c,e);if(f!=null){this.setItemPosition(d,f)}return}}d=this.idPrefix+(d!=null?d:this._genStr(24));if(this.setHotKey){this.setHotKey(g,"")}g=this.idPrefix+g;this._addItemIntoGlobalStrorage(d,g,a,"item",b,c,e);if(this.idPull["polygon_"+g]==null){this._renderSublevelPolygon(g,g)}this._renderSublevelItem(d,f-1);this._redefineComplexState(g)};dhtmlXMenuObject.prototype.removeItem=function(d,f,e){if(!f){d=this.idPrefix+d}var g=null;if(d!=this.idPrefix+this.topId){if(this.itemPull[d]==null){return}if(this.idPull["polygon_"+d]&&this.idPull["polygon_"+d]._tmShow){window.clearTimeout(this.idPull["polygon_"+d]._tmShow)}var m=this.itemPull[d]["type"];if(m=="separator"){var l=this.idPull["separator_"+d];if(this.itemPull[d]["parent"]==this.idPrefix+this.topId){l.onclick=null;l.onselectstart=null;l.id=null;l.parentNode.removeChild(l)}else{l.childNodes[0].childNodes[0].onclick=null;l.childNodes[0].childNodes[0].onselectstart=null;l.childNodes[0].childNodes[0].id=null;l.childNodes[0].removeChild(l.childNodes[0].childNodes[0]);l.removeChild(l.childNodes[0]);l.parentNode.removeChild(l)}this.idPull["separator_"+d]=null;this.itemPull[d]=null;delete this.idPull["separator_"+d];delete this.itemPull[d];l=null}else{g=this.itemPull[d]["parent"];var l=this.idPull[d];l.onclick=null;l.oncontextmenu=null;l.onmouseover=null;l.onmouseout=null;l.onselectstart=null;l.id=null;while(l.childNodes.length>0){l.removeChild(l.childNodes[0])}l.parentNode.removeChild(l);this.idPull[d]=null;this.itemPull[d]=null;delete this.idPull[d];delete this.itemPull[d];l=null}m=null}for(var i in this.itemPull){if(this.itemPull[i]["parent"]==d){this.removeItem(i,true,true)}}var j=new Array(d);if(g!=null&&!e){if(this.idPull["polygon_"+g]!=null){if(this.idPull["polygon_"+g].tbd.childNodes.length==0){j.push(g);this._updateItemComplexState(g,false,false)}}}for(var b=0;b<j.length;b++){if(this.idPull["polygon_"+j[b]]){var c=this.idPull["polygon_"+j[b]];c.onclick=null;c.oncontextmenu=null;c.tbl.removeChild(c.tbd);c.tbd=null;c.childNodes[1].removeChild(c.tbl);c.tbl=null;c.id=null;c.parentNode.removeChild(c);c=null;if(window.dhx4.isIE6){var h="polygon_"+j[b]+"_ie6cover";if(this.idPull[h]!=null){document.body.removeChild(this.idPull[h]);delete this.idPull[h]}}if(this.idPull["arrowup_"+d]!=null&&this._removeArrow){this._removeArrow("arrowup_"+d)}if(this.idPull["arrowdown_"+d]!=null&&this._removeArrow){this._removeArrow("arrowdown_"+d)}this.idPull["polygon_"+j[b]]=null;delete this.idPull["polygon_"+j[b]]}}j=null;if(this.conf.skin=="dhx_terrace"&&arguments.length==1){this._improveTerraceSkin()}};dhtmlXMenuObject.prototype._addItemIntoGlobalStrorage=function(h,a,c,g,d,b,f){var e={id:h,title:c,imgen:(b!=null?b:""),imgdis:(f!=null?f:""),type:g,state:(d==true?"disabled":"enabled"),parent:a,complex:false,hotkey:"",tip:""};this.itemPull[e.id]=e};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(b){if(b==document.body){b="document.body."+this.idPrefix;var d=document.body}else{var d=document.getElementById(b)}var f=false;for(var c in this.conf.ctx_zones){f=f||(c==b)||(this.conf.ctx_zones[c]==d)}if(f==true){return false}this.conf.ctx_zones[b]=d;var e=this;if(window.dhx4.isOpera){this.operaContext=function(a){e._doOnContextMenuOpera(a,e)};d.addEventListener("mouseup",this.operaContext,false)}else{if(d.oncontextmenu!=null&&!d._oldContextMenuHandler){d._oldContextMenuHandler=d.oncontextmenu}d.oncontextmenu=function(g){for(var a in dhtmlXMenuObject.prototype.liveInst){if(a!=e.conf.live_id){if(dhtmlXMenuObject.prototype.liveInst[a].context){dhtmlXMenuObject.prototype.liveInst[a]._hideContextMenu()}}}g=g||event;g.cancelBubble=true;if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}e._doOnContextBeforeCall(g,this);return false}}};dhtmlXMenuObject.prototype._doOnContextMenuOpera=function(c,a){for(var b in dhtmlXMenuObject.prototype.liveInst){if(b!=a.conf.live_id){if(dhtmlXMenuObject.prototype.liveInst[b].context){dhtmlXMenuObject.prototype.liveInst[b]._hideContextMenu()}}}c.cancelBubble=true;if(c.preventDefault){c.preventDefault()}else{c.returnValue=false}if(c.button==0&&c.ctrlKey==true){a._doOnContextBeforeCall(c,this)}return false};dhtmlXMenuObject.prototype.removeContextZone=function(a){if(!this.isContextZone(a)){return false}if(a==document.body){a="document.body."+this.idPrefix}var b=this.conf.ctx_zones[a];if(window.dhx4.isOpera){b.removeEventListener("mouseup",this.operaContext,false)}else{b.oncontextmenu=(b._oldContextMenuHandler!=null?b._oldContextMenuHandler:null);b._oldContextMenuHandler=null}try{this.conf.ctx_zones[a]=null;delete this.conf.ctx_zones[a]}catch(c){}return true};dhtmlXMenuObject.prototype.isContextZone=function(a){if(a==document.body&&this.conf.ctx_zones["document.body."+this.idPrefix]!=null){return true}var b=false;if(this.conf.ctx_zones[a]!=null){if(this.conf.ctx_zones[a]==document.getElementById(a)){b=true}}return b};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(b,c,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(b,c);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(f,h){this.conf.ctx_zoneid=h.id;this._clearAndHide();this._hideContextMenu();var d=(f.srcElement||f.target);var b=(window.dhx4.isIE||window.dhx4.isOpera||window.dhx4.isKHTML?f.offsetX:f.layerX);var a=(window.dhx4.isIE||window.dhx4.isOpera||window.dhx4.isKHTML?f.offsetY:f.layerY);var g=window.dhx4.absLeft(d)+b;var c=window.dhx4.absTop(d)+a;if(this.checkEvent("onBeforeContextMenu")){if(this.callEvent("onBeforeContextMenu",[h.id,f])){if(this.conf.ctx_autoshow){this._showContextMenu(g,c,h.id);this.callEvent("onAfterContextMenu",[h.id,f])}}}else{if(this.conf.ctx_autoshow){this._showContextMenu(g,c,h.id);this.callEvent("onAfterContextMenu",[h.id])}}};dhtmlXMenuObject.prototype.showContextMenu=function(a,b){this._showContextMenu(a,b,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 d in this.itemPull){if(this.itemPull[d].parent==this.idPrefix+this.topId&&this.idPull[d]!=null){var f=false;var e=false;if(this.idPull[d].parentNode.firstChild==this.idPull[d]){f=true}if(this.idPull[d].parentNode.lastChild==this.idPull[d]){e=true}for(var c in this.itemPull){if(this.itemPull[c].type=="separator"&&this.itemPull[c].parent==this.idPrefix+this.topId){if(this.idPull[d].nextSibling==this.idPull["separator_"+c]){e=true}if(this.idPull[d].previousSibling==this.idPull["separator_"+c]){f=true}}}this.idPull[d].style.borderLeftWidth=(f?"1px":"0px");this.idPull[d].style.borderTopLeftRadius=this.idPull[d].style.borderBottomLeftRadius=(f?"3px":"0px");this.idPull[d].style.borderTopRightRadius=this.idPull[d].style.borderBottomRightRadius=(e?"3px":"0px");this.idPull[d]._bl=f;this.idPull[d]._br=e}}};dhtmlXMenuObject.prototype._improveTerraceButton=function(b,a){if(a){this.idPull[b].style.borderBottomLeftRadius=(this.idPull[b]._bl?"3px":"0px");this.idPull[b].style.borderBottomRightRadius=(this.idPull[b]._br?"3px":"0px")}else{this.idPull[b].style.borderBottomLeftRadius="0px";this.idPull[b].style.borderBottomRightRadius="0px"}};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(e,d,b){var c=false;var a=this.idPrefix+e;if((this.itemPull[a]!=null)&&(this.idPull[a]!=null)){if(this.itemPull[a]["state"]!=d){this.itemPull[a]["state"]=d;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+e,this.itemPull[this.idPrefix+e]["complex"],false);this._updateItemImage(e,b);if((this.idPrefix+this.conf.last_click==a)&&(b!="TopLevel")){this._redistribSubLevelSelection(a,this.itemPull[a]["parent"])}if(b=="TopLevel"&&!this.conf.context){}}}return c};dhtmlXMenuObject.prototype.getItemText=function(a){return(this.itemPull[this.idPrefix+a]!=null?this.itemPull[this.idPrefix+a]["title"]:"")};dhtmlXMenuObject.prototype.setItemText=function(f,d){f=this.idPrefix+f;if((this.itemPull[f]!=null)&&(this.idPull[f]!=null)){this._clearAndHide();this.itemPull[f]["title"]=d;if(this.itemPull[f]["parent"]==this.idPrefix+this.topId&&!this.conf.context){var c=null;for(var a=0;a<this.idPull[f].childNodes.length;a++){try{if(this.idPull[f].childNodes[a].className=="top_level_text"){c=this.idPull[f].childNodes[a]}}catch(b){}}if(String(this.itemPull[f]["title"]).length==""||this.itemPull[f]["title"]==null){if(c!=null){c.parentNode.removeChild(c)}}else{if(!c){c=document.createElement("DIV");c.className="top_level_text";if(this.conf.rtl&&this.idPull[f].childNodes.length>0){this.idPull[f].insertBefore(c,this.idPull[f].childNodes[0])}else{this.idPull[f].appendChild(c)}}c.innerHTML=this.itemPull[f]["title"]}}else{var c=null;for(var a=0;a<this.idPull[f].childNodes[1].childNodes.length;a++){if(String(this.idPull[f].childNodes[1].childNodes[a].className||"")=="sub_item_text"){c=this.idPull[f].childNodes[1].childNodes[a]}}if(String(this.itemPull[f]["title"]).length==""||this.itemPull[f]["title"]==null){if(c){c.parentNode.removeChild(c);c=null;this.idPull[f].childNodes[1].innerHTML="&nbsp;"}}else{if(!c){c=document.createElement("DIV");c.className="sub_item_text";this.idPull[f].childNodes[1].innerHTML="";this.idPull[f].childNodes[1].appendChild(c)}c.innerHTML=this.itemPull[f]["title"]}}}};dhtmlXMenuObject.prototype.loadFromHTML=function(c,f,d){var b=this.conf.tags.item;this.conf.tags.item="div";var e=(typeof(c)=="string"?document.getElementById(c):c);var a=this._xmlToJson(e,this.idPrefix+this.topId);this._initObj(a);this.conf.tags.item=b;if(f){e.parentNode.removeChild(e)}e=objOd=null;if(onload!=null){if(typeof(d)=="function"){d()}else{if(typeof(window[d])=="function"){window[d]()}}}};dhtmlXMenuObject.prototype.hideItem=function(a){this._changeItemVisible(a,false)};dhtmlXMenuObject.prototype.showItem=function(a){this._changeItemVisible(a,true)};dhtmlXMenuObject.prototype.isItemHidden=function(b){var a=null;if(this.idPull[this.idPrefix+b]!=null){a=(this.idPull[this.idPrefix+b].style.display=="none")}return a};dhtmlXMenuObject.prototype._changeItemVisible=function(c,b){var a=this.idPrefix+c;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=(b?"":"none");this._redefineComplexState(this.itemPull[this.idPrefix+c]["parent"])};dhtmlXMenuObject.prototype.setUserData=function(c,a,b){this.userData[this.idPrefix+c+"_"+a]=b};dhtmlXMenuObject.prototype.getUserData=function(b,a){return(this.userData[this.idPrefix+b+"_"+a]!=null?this.userData[this.idPrefix+b+"_"+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(b){var a=new Array(null,null);b=this.idPrefix+b;if(this.itemPull[b]["type"]=="item"){a[0]=this.itemPull[b]["imgen"];a[1]=this.itemPull[b]["imgdis"]}return a};dhtmlXMenuObject.prototype.setItemImage=function(c,a,b){if(this.itemPull[this.idPrefix+c]["type"]!="item"){return}this.itemPull[this.idPrefix+c]["imgen"]=a;this.itemPull[this.idPrefix+c]["imgdis"]=b;this._updateItemImage(c,this._getItemLevelType(c))};dhtmlXMenuObject.prototype.clearItemImage=function(a){this.setItemImage(a,"","")};dhtmlXMenuObject.prototype.setVisibleArea=function(b,a,d,c){this.conf.v_enabled=true;this.conf.v.x1=b;this.conf.v.x2=a;this.conf.v.y1=d;this.conf.v.y2=c};dhtmlXMenuObject.prototype.setTooltip=function(b,a){b=this.idPrefix+b;if(!(this.itemPull[b]!=null&&this.idPull[b]!=null)){return}this.idPull[b].title=(a.length>0?a:null);this.itemPull[b]["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(c,a,b){if(this.itemPull[this.idPrefix+c]==null){return}this.itemPull[this.idPrefix+c]["href_link"]=a;if(b!=null){this.itemPull[this.idPrefix+c]["href_target"]=b}};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(b){var a=new Array(b);while(this.getParentId(b)!=this.topId){b=this.getParentId(b);a[a.length]=b}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(b,a){if(this.itemPull[this.idPrefix+b]==null){return}this.itemPull[this.idPrefix+b]["checked"]=a};dhtmlXMenuObject.prototype._updateCheckboxImage=function(b){if(this.idPull[this.idPrefix+b]==null){return}this.itemPull[this.idPrefix+b]["imgen"]="chbx_"+(this._getCheckboxState(b)?"1":"0");this.itemPull[this.idPrefix+b]["imgdis"]=this.itemPull[this.idPrefix+b]["imgen"];try{this.idPull[this.idPrefix+b].childNodes[(this.conf.rtl?2:0)].childNodes[0].className="sub_icon "+this.itemPull[this.idPrefix+b]["imgen"]}catch(a){}};dhtmlXMenuObject.prototype._checkboxOnClickHandler=function(d,a,b){if(a.charAt(1)=="d"){return}if(this.itemPull[this.idPrefix+d]==null){return}var c=this._getCheckboxState(d);if(this.checkEvent("onCheckboxClick")){if(this.callEvent("onCheckboxClick",[d,c,this.conf.ctx_zoneid,b])){this.setCheckboxState(d,!c)}}else{this.setCheckboxState(d,!c)}if(this.checkEvent("onClick")){this.callEvent("onClick",[d])}};dhtmlXMenuObject.prototype.setCheckboxState=function(b,a){this._setCheckboxState(b,a);this._updateCheckboxImage(b)};dhtmlXMenuObject.prototype.getCheckboxState=function(a){return this._getCheckboxState(a)};dhtmlXMenuObject.prototype.addCheckbox=function(h,d,i,j,l,a,e){if(this.conf.context&&d==this.topId){}else{if(this.itemPull[this.idPrefix+d]==null){return}if(h=="child"&&this.itemPull[this.idPrefix+d]["type"]!="item"){return}}var f="chbx_"+(a?"1":"0");var c=f;if(h=="sibling"){var b=this.idPrefix+(j!=null?j:this._genStr(24));var g=this.idPrefix+this.getParentId(d);this._addItemIntoGlobalStrorage(b,g,l,"checkbox",e,f,c);this.itemPull[b]["checked"]=a;this._renderSublevelItem(b,this.getItemPosition(d))}else{var b=this.idPrefix+(j!=null?j:this._genStr(24));var g=this.idPrefix+d;this._addItemIntoGlobalStrorage(b,g,l,"checkbox",e,f,c);this.itemPull[b]["checked"]=a;if(this.idPull["polygon_"+g]==null){this._renderSublevelPolygon(g,g)}this._renderSublevelItem(b,i-1);this._redefineComplexState(g)}};dhtmlXMenuObject.prototype.setHotKey=function(g,a){g=this.idPrefix+g;if(!(this.itemPull[g]!=null&&this.idPull[g]!=null)){return}if(this.itemPull[g]["parent"]==this.idPrefix+this.topId&&!this.conf.context){return}if(this.itemPull[g]["complex"]){return}var b=this.itemPull[g]["type"];if(!(b=="item"||b=="checkbox"||b=="radio")){return}var f=null;try{if(this.idPull[g].childNodes[this.conf.rtl?0:2].childNodes[0].className=="sub_item_hk"){f=this.idPull[g].childNodes[this.conf.rtl?0:2].childNodes[0]}}catch(d){}if(a.length==0){this.itemPull[g]["hotkey_backup"]=this.itemPull[g]["hotkey"];this.itemPull[g]["hotkey"]="";if(f!=null){f.parentNode.removeChild(f)}}else{this.itemPull[g]["hotkey"]=a;this.itemPull[g]["hotkey_backup"]=null;if(f==null){f=document.createElement("DIV");f.className="sub_item_hk";var c=this.idPull[g].childNodes[this.conf.rtl?0:2];while(c.childNodes.length>0){c.removeChild(c.childNodes[0])}c.appendChild(f)}f.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 c=this._getSubItemToDeselectByPolygon(a);for(var b=0;b<this.conf.opened_poly.length;b++){if(this.conf.opened_poly[b]!=a){this._hidePolygon(this.conf.opened_poly[b])}}for(var b=0;b<c.length;b++){if(this.idPull[c[b]]!=null&&this.itemPull[c[b]]["state"]=="enabled"){this.idPull[c[b]].className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_Item_Normal"}}};dhtmlXMenuObject.prototype._checkArrowsState=function(d){var b=this.idPull["polygon_"+d].childNodes[1];var c=this.idPull["arrowup_"+d];var a=this.idPull["arrowdown_"+d];if(b.scrollTop==0){c.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowUp_Disabled"}else{c.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowUp"+(c.over?"_Over":"")}if(b.scrollTop+b.offsetHeight<b.scrollHeight){a.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowDown"+(a.over?"_Over":"")}else{a.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowDown_Disabled"}b=c=a=null};dhtmlXMenuObject.prototype._addUpArrow=function(d){var b=this;var c=document.createElement("DIV");c.pId=this.idPrefix+d;c.id="arrowup_"+this.idPrefix+d;c.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowUp";c.over=false;c.onselectstart=function(f){f=f||event;if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}return false};c.oncontextmenu=function(f){f=f||event;if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}return false};c.onmouseover=function(){if(b.conf.mode=="web"){window.clearTimeout(b.conf.tm_handler)}b._clearAllSelectedSubItemsInPolygon(this.pId);if(this.className=="dhtmlxMenu_"+b.conf.skin+"_SubLevelArea_ArrowUp_Disabled"){return}this.className="dhtmlxMenu_"+b.conf.skin+"_SubLevelArea_ArrowUp_Over";this.over=true;b._canScrollUp=true;b._doScrollUp(this.pId,true)};c.onmouseout=function(){if(b.conf.mode=="web"){window.clearTimeout(b.conf.tm_handler);b.conf.tm_handler=window.setTimeout(function(){b._clearAndHide()},b.conf.tm_sec,"JavaScript")}this.over=false;b._canScrollUp=false;if(this.className=="dhtmlxMenu_"+b.conf.skin+"_SubLevelArea_ArrowUp_Disabled"){return}this.className="dhtmlxMenu_"+b.conf.skin+"_SubLevelArea_ArrowUp";window.clearTimeout(b.conf.of_utm)};c.onclick=function(f){f=f||event;if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}f.cancelBubble=true;return false};var a=this.idPull["polygon_"+this.idPrefix+d];a.childNodes[0].appendChild(c);this.idPull[c.id]=c;a=c=null};dhtmlXMenuObject.prototype._addDownArrow=function(d){var b=this;var c=document.createElement("DIV");c.pId=this.idPrefix+d;c.id="arrowdown_"+this.idPrefix+d;c.className="dhtmlxMenu_"+this.conf.skin+"_SubLevelArea_ArrowDown";c.over=false;c.onselectstart=function(f){f=f||event;if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}return false};c.oncontextmenu=function(f){f=f||event;if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}return false};c.onmouseover=function(){if(b.conf.mode=="web"){window.clearTimeout(b.conf.tm_handler)}b._clearAllSelectedSubItemsInPolygon(this.pId);if(this.className=="dhtmlxMenu_"+b.conf.skin+"_SubLevelArea_ArrowDown_Disabled"){return}this.className="dhtmlxMenu_"+b.conf.skin+"_SubLevelArea_ArrowDown_Over";this.over=true;b._canScrollDown=true;b._doScrollDown(this.pId,true)};c.onmouseout=function(){if(b.conf.mode=="web"){window.clearTimeout(b.conf.tm_handler);b.conf.tm_handler=window.setTimeout(function(){b._clearAndHide()},b.conf.tm_sec,"JavaScript")}this.over=false;b._canScrollDown=false;if(this.className=="dhtmlxMenu_"+b.conf.skin+"_SubLevelArea_ArrowDown_Disabled"){return}this.className="dhtmlxMenu_"+b.conf.skin+"_SubLevelArea_ArrowDown";window.clearTimeout(b.conf.of_dtm)};c.onclick=function(f){f=f||event;if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}f.cancelBubble=true;return false};var a=this.idPull["polygon_"+this.idPrefix+d];a.childNodes[2].appendChild(c);this.idPull[c.id]=c;a=c=null};dhtmlXMenuObject.prototype._removeUpArrow=function(b){var a="arrowup_"+this.idPrefix+b;this._removeArrow(a)};dhtmlXMenuObject.prototype._removeDownArrow=function(b){var a="arrowdown_"+this.idPrefix+b;this._removeArrow(a)};dhtmlXMenuObject.prototype._removeArrow=function(a){var b=this.idPull[a];b.onselectstart=null;b.oncontextmenu=null;b.onmouseover=null;b.onmouseout=null;b.onclick=null;if(b.parentNode){b.parentNode.removeChild(b)}b=null;this.idPull[a]=null;try{delete this.idPull[a]}catch(c){}};dhtmlXMenuObject.prototype._isArrowExists=function(a){if(this.idPull["arrowup_"+a]!=null&&this.idPull["arrowdown_"+a]!=null){return true}return false};dhtmlXMenuObject.prototype._doScrollUp=function(f,d){var a=this.idPull["polygon_"+f].childNodes[1];if(this._canScrollUp&&a.scrollTop>0){var c=false;var e=a.scrollTop-this.conf.of_ustep;if(e<0){c=true;e=0}a.scrollTop=e;if(!c){var b=this;this.conf.of_utm=window.setTimeout(function(){b._doScrollUp(f,false);b=null},this.conf.of_utime)}else{d=true}}else{this._canScrollUp=false;this._checkArrowsState(f)}if(d){this._checkArrowsState(f)}};dhtmlXMenuObject.prototype._doScrollDown=function(f,d){var a=this.idPull["polygon_"+f].childNodes[1];if(this._canScrollDown&&a.scrollTop+a.offsetHeight<=a.scrollHeight){var c=false;var e=a.scrollTop+this.conf.of_dstep;if(e+a.offsetHeight>=a.scrollHeight){c=true;e=a.scrollHeight-a.offsetHeight}a.scrollTop=e;if(!c){var b=this;this.conf.of_dtm=window.setTimeout(function(){b._doScrollDown(f,false);b=null},this.conf.of_dtime)}else{d=true}}else{this._canScrollDown=false;this._checkArrowsState(f)}if(d){this._checkArrowsState(f)}};dhtmlXMenuObject.prototype._countPolygonItems=function(f){var d=0;for(var b in this.itemPull){var c=this.itemPull[b]["parent"];var e=this.itemPull[b]["type"];if(c==this.idPrefix+f&&(e=="item"||e=="radio"||e=="checkbox")){d++}}return d};dhtmlXMenuObject.prototype.setOverflowHeight=function(e){if(e==="auto"){this.conf.overflow_limit=0;this.conf.auto_overflow=true;return}if(this.conf.overflow_limit==0&&e<=0){return}this._clearAndHide();if(this.conf.overflow_limit>=0&&e>0){this.conf.overflow_limit=e;return}if(this.conf.overflow_limit>0&&e<=0){for(var d in this.itemPull){if(this._isArrowExists(d)){var c=String(d).replace(this.idPrefix,"");this._removeUpArrow(c);this._removeDownArrow(c);this.idPull["polygon_"+d].childNodes[1].style.height=""}}this.conf.overflow_limit=0;return}};dhtmlXMenuObject.prototype._getRadioImgObj=function(c){try{var a=this.idPull[this.idPrefix+c].childNodes[(this.conf.rtl?2:0)].childNodes[0]}catch(b){var a=null}return a};dhtmlXMenuObject.prototype._setRadioState=function(d,c){var b=this._getRadioImgObj(d);if(b!=null){var a=this.itemPull[this.idPrefix+d];a.checked=c;a.imgen="rdbt_"+(a.checked?"1":"0");a.imgdis=a.imgen;b.className="sub_icon "+a.imgen}};dhtmlXMenuObject.prototype._radioOnClickHandler=function(d,a,b){if(a.charAt(1)=="d"||this.itemPull[this.idPrefix+d]["group"]==null){return}var c=this.itemPull[this.idPrefix+d]["group"];if(this.checkEvent("onRadioClick")){if(this.callEvent("onRadioClick",[c,this.getRadioChecked(c),d,this.conf.ctx_zoneid,b])){this.setRadioChecked(c,d)}}else{this.setRadioChecked(c,d)}if(this.checkEvent("onClick")){this.callEvent("onClick",[d])}};dhtmlXMenuObject.prototype.getRadioChecked=function(d){var f=null;for(var c=0;c<this.radio[d].length;c++){var e=this.radio[d][c].replace(this.idPrefix,"");var a=this._getRadioImgObj(e);if(a!=null){var b=(a.className).match(/rdbt_1$/gi);if(b!=null){f=e}}}return f};dhtmlXMenuObject.prototype.setRadioChecked=function(b,d){if(this.radio[b]==null){return}for(var a=0;a<this.radio[b].length;a++){var c=this.radio[b][a].replace(this.idPrefix,"");this._setRadioState(c,(c==d))}};dhtmlXMenuObject.prototype.addRadioButton=function(i,e,j,l,m,n,a,f){if(this.conf.context&&e==this.topId){}else{if(this.itemPull[this.idPrefix+e]==null){return}if(i=="child"&&this.itemPull[this.idPrefix+e]["type"]!="item"){return}}var c=this.idPrefix+(l!=null?l:this._genStr(24));var g="rdbt_"+(a?"1":"0");var b=g;if(i=="sibling"){var h=this.idPrefix+this.getParentId(e);this._addItemIntoGlobalStrorage(c,h,m,"radio",f,g,b);this._renderSublevelItem(c,this.getItemPosition(e))}else{var h=this.idPrefix+e;this._addItemIntoGlobalStrorage(c,h,m,"radio",f,g,b);if(this.idPull["polygon_"+h]==null){this._renderSublevelPolygon(h,h)}this._renderSublevelItem(c,j-1);this._redefineComplexState(h)}var d=(n!=null?n:this._genStr(24));this.itemPull[c]["group"]=d;if(this.radio[d]==null){this.radio[d]=new Array()}this.radio[d][this.radio[d].length]=c;if(a==true){this.setRadioChecked(d,String(c).replace(this.idPrefix,""))}};dhtmlXMenuObject.prototype.serialize=function(){var a="<menu>"+this._readLevel(this.idPrefix+this.topId)+"</menu>";return a};dhtmlXMenuObject.prototype._readLevel=function(d){var e="";for(var i in this.itemPull){if(this.itemPull[i]["parent"]==d){var b="";var c="";var l="";var h=String(this.itemPull[i]["id"]).replace(this.idPrefix,"");var g="";var j=(this.itemPull[i]["title"]!=""?' text="'+this.itemPull[i]["title"]+'"':"");var f="";if(this.itemPull[i]["type"]=="item"){if(this.itemPull[i]["imgen"]!=""){b=' img="'+this.itemPull[i]["imgen"]+'"'}if(this.itemPull[i]["imgdis"]!=""){c=' imgdis="'+this.itemPull[i]["imgdis"]+'"'}if(this.itemPull[i]["hotkey"]!=""){l="<hotkey>"+this.itemPull[i]["hotkey"]+"</hotkey>"}}if(this.itemPull[i]["type"]=="separator"){g=' type="separator"'}else{if(this.itemPull[i]["state"]=="disabled"){f=' enabled="false"'}}if(this.itemPull[i]["type"]=="checkbox"){g=' type="checkbox"'+(this.itemPull[i]["checked"]?' checked="true"':"")}if(this.itemPull[i]["type"]=="radio"){g=' type="radio" group="'+this.itemPull[i]["group"]+'" '+(this.itemPull[i]["checked"]?' checked="true"':"")}e+="<item id='"+h+"'"+j+g+b+c+f+">";e+=l;if(this.itemPull[i]["complex"]){e+=this._readLevel(i)}e+="</item>"}}return e};dhtmlXMenuObject.prototype.enableEffect=function(c,e,d){this._menuEffect=(c=="opacity"||c=="slide"||c=="slide+"?c:false);this._pOpStyleIE=(navigator.userAgent.search(/MSIE\s[678]\.0/gi)>=0);for(var b in this.idPull){if(b.search(/polygon/)===0){this._pOpacityApply(b,(this._pOpStyleIE?100:1));this.idPull[b].style.height=""}}this._pOpMax=(typeof(e)=="undefined"?100:e)/(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=d||50};dhtmlXMenuObject.prototype._showPolygonEffect=function(a){this._pShowHide(a,true)};dhtmlXMenuObject.prototype._hidePolygonEffect=function(a){this._pShowHide(a,false)};dhtmlXMenuObject.prototype._pOpacityApply=function(a,b){this.idPull[a].style[this._pOpStyleName]=String(this._pOpStyleValue).replace("#",b||this.idPull[a]._op)};dhtmlXMenuObject.prototype._pShowHide=function(a,b){if(!this.idPull){return}if(this.idPull[a]._tmShow!=null){if((this.idPull[a]._step_h>0&&b==true)||(this.idPull[a]._step_h<0&&b==false)){return}window.clearTimeout(this.idPull[a]._tmShow);this.idPull[a]._tmShow=null;this.idPull[a]._max_h=null}if(b==false&&(this.idPull[a].style.visibility=="hidden"||this.idPull[a].style.display=="none")){return}if(b==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=(b==true?0:this.idPull[a]._max_h);this.idPull[a]._step_h=Math.round(this.idPull[a]._max_h/this._pSlSteps)*(b==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)*(b==true?1:-1);if(this._pOpStyleIE){this.idPull[a].op_step=Math.round(this.idPull[a].op_step)}this.idPull[a]._op=(b==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(c,b){if(!this.idPull){return}if(this.idPull[c]._tmShow){window.clearTimeout(this.idPull[c]._tmShow)}this.idPull[c]._h=Math.max(0,Math.min(b,this.idPull[c]._max_h));if(this._menuEffect.search(/slide/)===0){this.idPull[c].style.height=this.idPull[c]._h+"px"}b+=this.idPull[c]._step_h;if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[c]._op=Math.max(0,Math.min(this._pOpMax,this.idPull[c]._op+this.idPull[c].op_step));this._pOpacityApply(c)}if((this.idPull[c]._step_h>0&&b<=this.idPull[c]._max_h)||(this.idPull[c]._step_h<0&&b>=0)){var a=this;this.idPull[c]._tmShow=window.setTimeout(function(){a._pEffectSet(c,b)},this.idPull[c]._step_tm)}else{if(this._menuEffect.search(/slide/)===0){this.idPull[c].style.height=""}if(this.idPull[c]._step_h<0){this.idPull[c].style.visibility="hidden"}if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[c]._op=(this.idPull[c]._step_h<0?(this._pOpStyleIE?100:1):this._pOpMax);this._pOpacityApply(c)}this.idPull[c]._tmShow=null;this.idPull[c]._h=null;this.idPull[c]._max_h=null;this.idPull[c]._step_tm=null}};var globalActiveDHTMLGridObject;String.prototype._dhx_trim=function(){return this.replace(/&nbsp;/g," ").replace(/(^[ \t]*)|([ \t]*$)/g,"")};function dhtmlxArray(a){return dhtmlXHeir((a||new Array()),dhtmlxArray._master)}dhtmlxArray._master={_dhx_find:function(b){for(var a=0;a<this.length;a++){if(b==this[a]){return a}}return -1},_dhx_insertAt:function(c,b){this[this.length]=null;for(var a=this.length-1;a>=c;a--){this[a]=this[a-1]}this[c]=b},_dhx_removeAt:function(a){this.splice(a,1)},_dhx_swapItems:function(a,c){var b=this[a];this[a]=this[c];this[c]=b}};function dhtmlXGridObject(id){if(_isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}if(id){if(typeof(id)=="object"){this.entBox=id;if(!this.entBox.id){this.entBox.id="cgrid2_"+this.uid()}}else{this.entBox=document.getElementById(id)}}else{this.entBox=document.createElement("DIV");this.entBox.id="cgrid2_"+this.uid()}this.entBox.innerHTML="";dhtmlxEventable(this);var self=this;this._wcorr=0;this.fontWidth=7;this.cell=null;this.row=null;this.iconURL="";this.editor=null;this._f2kE=true;this._dclE=true;this.combos=new Array(0);this.defVal=new Array(0);this.rowsAr={};this.rowsBuffer=dhtmlxArray();this.rowsCol=dhtmlxArray();this._data_cache={};this._ecache={};this._ud_enabled=true;this.xmlLoader=new dtmlXMLLoaderObject(this.doLoadDetails,this,true,this.no_cashe);this._maskArr=[];this.selectedRows=dhtmlxArray();this.UserData={};this._sizeFix=this._borderFix=0;this.entBox.className+=" gridbox";this.entBox.style.width=this.entBox.getAttribute("width")||(window.getComputedStyle?(this.entBox.style.width||window.getComputedStyle(this.entBox,null)["width"]):(this.entBox.currentStyle?this.entBox.currentStyle.width:this.entBox.style.width||0))||"100%";this.entBox.style.height=this.entBox.getAttribute("height")||(window.getComputedStyle?(this.entBox.style.height||window.getComputedStyle(this.entBox,null)["height"]):(this.entBox.currentStyle?this.entBox.currentStyle.height:this.entBox.style.height||0))||"100%";this.entBox.style.cursor="default";this.entBox.onselectstart=function(){return false};var t_creator=function(name){var t=document.createElement("TABLE");t.cellSpacing=t.cellPadding=0;t.style.cssText="width:100%;table-layout:fixed;";t.className=name.substr(2);return t};this.obj=t_creator("c_obj");this.hdr=t_creator("c_hdr");this.hdr.style.marginRight="20px";this.hdr.style.paddingRight="20px";this.objBox=document.createElement("DIV");this.objBox.style.width="100%";this.objBox.style.overflow="auto";this.objBox.appendChild(this.obj);this.objBox.className="objbox";if(dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(this)}this.hdrBox=document.createElement("DIV");this.hdrBox.style.width="100%";this.hdrBox.style.height="25px";this.hdrBox.style.overflow="hidden";this.hdrBox.className="xhdr";this.preloadImagesAr=new Array(0);this.sortImg=document.createElement("DIV");this.sortImg.style.display="none";this.hdrBox.appendChild(this.sortImg);this.hdrBox.appendChild(this.hdr);this.hdrBox.style.position="relative";this.entBox.appendChild(this.hdrBox);this.entBox.appendChild(this.objBox);this.entBox.grid=this;this.objBox.grid=this;this.hdrBox.grid=this;this.obj.grid=this;this.hdr.grid=this;this.cellWidthPX=[];this.cellWidthPC=[];this.cellWidthType=this.entBox.cellwidthtype||"px";this.delim=this.entBox.delimiter||",";this._csvDelim=",";this.hdrLabels=[];this.columnIds=[];this.columnColor=[];this._hrrar=[];this.cellType=dhtmlxArray();this.cellAlign=[];this.initCellWidth=[];this.fldSort=[];this._srdh=(_isIE&&(document.compatMode!="BackCompat")?22:20);this.imgURL=window.dhx_globalImgPath||"";this.isActive=false;this.isEditable=true;this.useImagesInHeader=false;this.pagingOn=false;this.rowsBufferOutSize=0;dhtmlxEvent(window,"unload",function(){try{if(self.destructor){self.destructor()}}catch(e){}});this.setSkin=function(name){this.skin_name=name;if(this._imgURL){this.setImagePath(this._imgURL)}var classname=this.entBox.className.split(" gridbox")[0];this.entBox.className=classname+" gridbox gridbox_"+name;this.skin_h_correction=0;this.enableAlterCss("ev_"+name,"odd_"+name,this.isTreeGrid());this._fixAlterCss();switch(name){case"clear":this._topMb=document.createElement("DIV");this._topMb.className="topMumba";this._topMb.innerHTML="<img style='left:0px'   src='"+this.imgURL+"skinC_top_left.gif'><img style='right:20px' src='"+this.imgURL+"skinC_top_right.gif'>";this.entBox.appendChild(this._topMb);this._botMb=document.createElement("DIV");this._botMb.className="bottomMumba";this._botMb.innerHTML="<img style='left:0px'   src='"+this.imgURL+"skinD_bottom_left.gif'><img style='right:20px' src='"+this.imgURL+"skinD_bottom_right.gif'>";this.entBox.appendChild(this._botMb);if(this.entBox.style.position!="absolute"){this.entBox.style.position="relative"}this.skin_h_correction=20;break;case"dhx_terrace":this._srdh=33;this.forceDivInHeader=true;break;case"dhx_skyblue":case"dhx_web":case"glassy_blue":case"dhx_black":case"dhx_blue":case"modern":case"light":this._srdh=30;this.forceDivInHeader=true;break;case"xp":this.forceDivInHeader=true;if((_isIE)&&(document.compatMode!="BackCompat")){this._srdh=26}else{this._srdh=22}break;case"mt":if((_isIE)&&(document.compatMode!="BackCompat")){this._srdh=26}else{this._srdh=22}break;case"gray":if((_isIE)&&(document.compatMode!="BackCompat")){this._srdh=22}break;case"sbdark":break}if(_isIE&&this.hdr){var d=this.hdr.parentNode;d.removeChild(this.hdr);d.appendChild(this.hdr)}this.setSizes()};if(_isIE){this.preventIECaching(true)}if(window.dhtmlDragAndDropObject){this.dragger=new dhtmlDragAndDropObject()}this._doOnScroll=function(e,mode){this.callEvent("onScroll",[this.objBox.scrollLeft,this.objBox.scrollTop]);this.doOnScroll(e,mode)};this.doOnScroll=function(e,mode){this.hdrBox.scrollLeft=this.objBox.scrollLeft;if(this.ftr){this.ftr.parentNode.scrollLeft=this.objBox.scrollLeft}if(mode){return}if(this._srnd){if(this._dLoadTimer){window.clearTimeout(this._dLoadTimer)}this._dLoadTimer=window.setTimeout(function(){if(self._update_srnd_view){self._update_srnd_view()}},100)}};this.attachToObject=function(obj){obj.appendChild(this.globalBox?this.globalBox:this.entBox);this.setSizes()};this.init=function(fl){if((this.isTreeGrid())&&(!this._h2)){this._h2=new dhtmlxHierarchy();if((this._fake)&&(!this._realfake)){this._fake._h2=this._h2}this._tgc={imgURL:null}}if(!this._hstyles){return}if(!this.skin_name){this.setSkin("dhx_skyblue")}this.editStop();this.lastClicked=null;this.resized=null;this.fldSorted=this.r_fldSorted=null;this.cellWidthPX=[];this.cellWidthPC=[];if(this.hdr.rows.length>0){var temp=this.xmlFileUrl;this.clearAll(true);this.xmlFileUrl=temp}var hdrRow=this.hdr.insertRow(0);for(var i=0;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()}if(this._init_point){this._init_point()}};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){var splitOuterBorder=(this.globalBox.offsetWidth-this.globalBox.clientWidth)/2;if(this._delta_x&&!this._realfake){var ow=this.globalBox.clientWidth;this.globalBox.style.width=this._delta_x;this.entBox.style.width=Math.max(0,(this.globalBox.clientWidth+(quirks?splitOuterBorder*2:0))-this._fake.entBox.clientWidth)+"px";if(ow!=this.globalBox.clientWidth){this._fake._correctSplit(this._fake.entBox.clientWidth)}}if(this._delta_y&&!this._realfake){this.globalBox.style.height=this._delta_y;this.entBox.style.overflow=this._fake.entBox.style.overflow="hidden";this.entBox.style.height=this._fake.entBox.style.height=this.globalBox.clientHeight+(quirks?splitOuterBorder*2:0)+"px"}}else{if(this._delta_x){if(this.entBox.parentNode&&this.entBox.parentNode.tagName=="TD"){this.entBox.style.width="1px";this.entBox.style.width=parseInt(this._delta_x)*this.entBox.parentNode.clientWidth/100-outerBorder*2+"px"}else{this.entBox.style.width=this._delta_x}}if(this._delta_y){this.entBox.style.height=this._delta_y}}}window.clearTimeout(this._sizeTime);if(!this.entBox.offsetWidth&&(!this.globalBox||!this.globalBox.offsetWidth)){this._sizeTime=window.setTimeout(function(){if(self.setSizes){self.setSizes()}},250);return}var border_x=((!this._wthB)&&((this.entBox.cmp||this._delta_x)&&(this.skin_name||"").indexOf("dhx")==0&&!quirks)?2:0);var border_y=((!this._wthB)&&((this.entBox.cmp||this._delta_y)&&(this.skin_name||"").indexOf("dhx")==0&&!quirks)?2:0);if(this._sizeFix){border_x-=this._sizeFix;border_y-=this._sizeFix}var isVScroll=this.parentGrid?false:(this.objBox.scrollHeight>this.objBox.offsetHeight);var scrfix=dhtmlx.$customScroll?0:18;var gridWidth=this.entBox.clientWidth-(this.skin_h_correction||0)*(quirks?0:1)-border_x;var gridWidthActive=this.entBox.clientWidth-(this.skin_h_correction||0)-border_x;var gridHeight=this.entBox.clientHeight-border_y;var summ=this.setColumnSizes(gridWidthActive-(isVScroll?scrfix:0)-(this._correction_x||0));var isHScroll=this.parentGrid?false:((this.objBox.scrollWidth>this.objBox.offsetWidth)||(this.objBox.style.overflowX=="scroll"));var headerHeight=this.hdr.clientHeight;var footerHeight=this.ftr?this.ftr.clientHeight:0;var newWidth=gridWidth;var newHeight=gridHeight-headerHeight-footerHeight;if(this._awdth&&this._awdth[0]&&this._awdth[1]==99999){isHScroll=0}if(this._ahgr){if(this._ahgrMA){newHeight=this.entBox.parentNode.clientHeight-headerHeight-footerHeight}else{newHeight=this.obj.offsetHeight+(isHScroll?scrfix:0)+(this._correction_y||0)}if(this._ahgrM){if(this._ahgrF){newHeight=Math.min(this._ahgrM,newHeight+headerHeight+footerHeight)-headerHeight-footerHeight}else{newHeight=Math.min(this._ahgrM,newHeight)}}if(isVScroll&&newHeight>=this.obj.scrollHeight+(isHScroll?scrfix:0)){isVScroll=false;this.setColumnSizes(gridWidthActive-(this._correction_x||0))}}if((this._awdth)&&(this._awdth[0])){if(this.cellWidthType=="%"){this.cellWidthType="px"}if(this._fake){summ+=this._fake.entBox.clientWidth}var newWidth=Math.min(Math.max(summ+(isVScroll?scrfix:0),this._awdth[2]),this._awdth[1])+(this._correction_x||0);this.objBox.style.overflowX=(!isVScroll&&this.objBox.scrollWidth<=newWidth)?"hidden":"auto";if(this._fake){newWidth-=this._fake.entBox.clientWidth}}newHeight=Math.max(0,newHeight);this._ff_size_delta=(this._ff_size_delta==0.1)?0.2:0.1;if(!_isFF){this._ff_size_delta=0}if(!this.dontSetSizes){this.entBox.style.width=Math.max(0,newWidth+(quirks?2:0)*outerBorder+this._ff_size_delta)+"px";this.entBox.style.height=newHeight+(quirks?2:0)*outerBorder+headerHeight+footerHeight+"px"}this.objBox.style.height=newHeight+((quirks&&!isVScroll)?2:0)*outerBorder+"px";this.hdrBox.style.height=headerHeight+"px";if(newHeight!=gridHeight){this.doOnScroll(0,!this._srnd)}var ext=this["setSizes_"+this.skin_name];if(ext){ext.call(this)}this.setSortImgPos();if(headerHeight!=this.hdr.clientHeight&&this._ahgr){this.setSizes()}this.callEvent("onSetSizes",[])};this.setSizes_clear=function(){var y=this.hdr.offsetHeight;var x=this.entBox.offsetWidth;var y2=y+this.objBox.offsetHeight;this._topMb.style.top=(y||0)+"px";this._topMb.style.width=(x+20)+"px";this._botMb.style.top=(y2-3)+"px";this._botMb.style.width=(x+20)+"px"};this.chngCellWidth=function(){if((_isOpera)&&(this.ftr)){this.ftr.width=this.objBox.scrollWidth+"px"}var l=this._cCount;for(var i=0;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=convertStringToBoolean(state)};this.enableMultiselect=function(state){this.selMultiRows=convertStringToBoolean(state)};this.setImagePath=function(path){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}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++){this._setColumnSizeR(el._cellIndexS+i*1,a_sizes[i])}}else{this._setColumnSizeR(el._cellIndex,fcolW)}this.doOnScroll(0,1);this.setSizes();if(this._fake&&this._awdth){this._fake._correctSplit()}};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()}}};this.setSortImgState=function(state,ind,order,row){order=(order||"asc").toLowerCase();if(!convertStringToBoolean(state)){this.sortImg.style.display="none";this.fldSorted=this.r_fldSorted=null;return}if(order=="asc"){this.sortImg.className="dhxgrid_sort_asc"}else{this.sortImg.className="dhxgrid_sort_desc"}this.sortImg.style.display="";this.fldSorted=this.hdr.rows[0].childNodes[ind];var r=this.hdr.rows[row||1];if(!r){return}for(var i=0;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}}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].className.indexOf("rowselected")==-1&&(this._realfake||this.callEvent("onBeforeSelect",[this.rowsCol[i].idd,psid,el._cellIndex]))){this.rowsCol[i].className+=" rowselected";this.selectedRows[this.selectedRows.length]=this.rowsCol[i]}}else{this.clearSelection();return this.doClick(el,fl,0,show)}}}}else{if(selMethod==2){if(el.parentNode.className.indexOf("rowselected")!=-1){el.parentNode.className=el.parentNode.className.replace(/rowselected/g,"");this.selectedRows._dhx_removeAt(this.selectedRows._dhx_find(el.parentNode));var skipRowSelection=true;show=false}}}this.editStop();if(typeof(el.parentNode.idd)=="undefined"){return true}if((!skipRowSelection)&&(!el.parentNode._sRow)){if(this._realfake||this.callEvent("onBeforeSelect",[el.parentNode.idd,psid,el._cellIndex])){if(this.getSelectedRowId()!=el.parentNode.idd){if(selMethod==0){this.clearSelection()}this.cell=el;if((prow==el.parentNode)&&(this._chRRS)){fl=false}this.row=el.parentNode;this.row.className+=" rowselected";if(this.selectedRows._dhx_find(this.row)==-1){this.selectedRows[this.selectedRows.length]=this.row}}else{this.cell=el;this.row=el.parentNode}}else{fl=false}}if(this.cell&&this.cell.parentNode.className.indexOf("rowselected")!=-1){this.cell.className=this.cell.className.replace(/cellselected/g,"")+" cellselected"}if(selMethod!=1){if(!this.row){return}}this.lastClicked=el.parentNode;var rid=this.row.idd;var cid=this.cell;if(fl&&typeof(rid)!="undefined"&&cid&&!skipRowSelection){self.onRowSelectTime=setTimeout(function(){if(self.callEvent){self.callEvent("onRowSelect",[rid,cid._cellIndex])}},100)}else{this.callEvent("onRowSelectRSOnly",[rid])}if(this.checkEvent("onSelectStateChanged")){var afinal=this.getSelectedId();if(initial!=afinal){this.callEvent("onSelectStateChanged",[afinal,initial])}}}this.isActive=true;if(show!==false&&this.cell&&this.cell.parentNode.idd){this.moveToVisible(this.cell)}};this.selectAll=function(){this.clearSelection();var coll=this.rowsBuffer;if(this.pagingOn){coll=this.rowsCol}for(var i=0;i<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();c.className+=" editable";this.editor.edit();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;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.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=convertStringToBoolean(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=new dhtmlxHierarchy();if(this._fake){if(this._realfake){this._h2=this._fake._h2}else{this._fake._h2=this._h2}}}this.limit=this._limitC=0;this.editStop(true);if(this._dLoadTimer){window.clearTimeout(this._dLoadTimer)}if(this._dload){this.objBox.scrollTop=0;this.limit=this._limitC||0;this._initDrF=true}var len=this.rowsCol.length;len=this.obj.rows.length;for(var i=len-1;i>0;i--){var t_r=this.obj.rows[i];t_r.parentNode.removeChild(t_r)}if(header){this._master_row=null;this.obj.rows[0].parentNode.removeChild(this.obj.rows[0]);for(var i=this.hdr.rows.length-1;i>=0;i--){var t_r=this.hdr.rows[i];t_r.parentNode.removeChild(t_r)}if(this.ftr){this.ftr.parentNode.removeChild(this.ftr);this.ftr=null}this._aHead=this.ftr=this.cellWidth=this._aFoot=null;this.cellType=dhtmlxArray();this._hrrar=[];this.columnIds=[];this.combos=[];this._strangeParams=[];this.defVal=[];this._ivizcol=null}this.row=null;this.cell=null;this.rowsCol=dhtmlxArray();this.rowsAr={};this._RaSeCol=[];this.rowsBuffer=dhtmlxArray();this.UserData=[];this.selectedRows=dhtmlxArray();if(this.pagingOn||this._srnd){this.xmlFileUrl=""}if(this.pagingOn){this.changePage(1)}if(this._contextCallTimer){window.clearTimeout(this._contextCallTimer)}if(this._sst){this.enableStableSorting(true)}this._fillers=this.undefined;this.setSortImgState(false);this.setSizes();this.callEvent("onClearAll",[])};this.sortField=function(ind,repeatFl,r_el){if(this.getRowsNum()==0){return false}var el=this.hdr.rows[0].cells[ind];if(!el){return}if(el.tagName=="TH"&&(this.fldSort.length-1)>=el._cellIndex&&this.fldSort[el._cellIndex]!="na"){var data=this.getSortingState();var sortType=(data[0]==ind&&data[1]=="asc")?"des":"asc";if(!this.callEvent("onBeforeSorting",[ind,this.fldSort[ind],sortType])){return}this.sortImg.className="dhxgrid_sort_"+(sortType=="asc"?"asc":"desc");if(this.useImagesInHeader){var cel=this.hdr.rows[1].cells[el._cellIndex].firstChild;if(this.fldSorted!=null){var celT=this.hdr.rows[1].cells[this.fldSorted._cellIndex].firstChild;celT.src=celT.src.replace(/(\.asc\.)|(\.des\.)/,".")}cel.src=cel.src.replace(/(\.[a-z]+)$/,"."+sortType+"$1")}this.sortRows(el._cellIndex,this.fldSort[el._cellIndex],sortType);this.fldSorted=el;this.r_fldSorted=r_el;var c=this.hdr.rows[1];var c=r_el.parentNode;var real_el=c._childIndexes?c._childIndexes[el._cellIndex]:el._cellIndex;this.setSortImgPos(false,false,false,r_el)}};this.setCustomSorting=function(func,col){if(!this._customSorts){this._customSorts=new Array()}this._customSorts[col]=(typeof(func)=="string")?eval(func):func;this.fldSort[col]="cus"};this.enableHeaderImages=function(fl){this.useImagesInHeader=fl};this.setHeader=function(hdrStr,splitSign,styles){if(typeof(hdrStr)!="object"){var arLab=this._eSplit(hdrStr)}else{arLab=[].concat(hdrStr)}var arWdth=new Array(0);var arTyp=new dhtmlxArray(0);var arAlg=new Array(0);var arVAlg=new Array(0);var arSrt=new Array(0);for(var i=0;i<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]]){dhtmlxError.throwError("Configuration","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=convertStringToBoolean(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]=convertStringToBoolean(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.getHeaderCol(i)+"]]>"}else{out+=this.getHeaderCol(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=getOffset(oNode);return[pos.left,pos.top]}pNode=pNode||document.body;var oCurrentNode=oNode;var iLeft=0;var iTop=0;while((oCurrentNode)&&(oCurrentNode!=pNode)){iLeft+=oCurrentNode.offsetLeft-oCurrentNode.scrollLeft;iTop+=oCurrentNode.offsetTop-oCurrentNode.scrollTop;oCurrentNode=oCurrentNode.offsetParent}if(pNode==document.body){if(_isIE){iTop+=document.body.offsetTop||document.documentElement.offsetTop;iLeft+=document.body.offsetLeft||document.documentElement.offsetLeft}else{if(!_isFF){iLeft+=document.body.offsetLeft;iTop+=document.body.offsetTop}}}return[iLeft,iTop]};this.getFirstParentOfType=function(obj,tag){while(obj&&obj.tagName!=tag&&obj.tagName!="BODY"){obj=obj.parentNode}return obj};this.objBox.onscroll=function(){this.grid._doOnScroll()};this.objBox.ontouchend=function(){this.hdrBox.scrollLeft=this.objBox.scrollLeft};this.hdrBox.onscroll=function(){if(this._try_header_sync){return}this._try_header_sync=true;if(Math.abs(this.grid.objBox.scrollLeft-this.scrollLeft)>1){this.grid.objBox.scrollLeft=this.scrollLeft}this._try_header_sync=false};if((!_isOpera)||(_OperaRv>8.5)){this.hdr.onmousemove=function(e){this.grid.changeCursorState(e||window.event)};this.hdr.onmousedown=function(e){return this.grid.startColResize(e||window.event)}}this.obj.onmousemove=this._drawTooltip;this.objBox.onclick=function(e){(e||event).cancelBubble=true};this.obj.onclick=function(e){this.grid._doClick(e||window.event);if(this.grid._sclE){this.grid.editCell(e||window.event)}else{this.grid.editStop()}(e||event).cancelBubble=true};if(_isMacOS){this.entBox.oncontextmenu=function(e){e.cancelBubble=true;if(e.preventDefault){e.preventDefault()}else{e.returnValue=false}var that=this.grid;if(that._realfake){that=that._fake}return that._doContClick(e||window.event)}}else{this.entBox.onmousedown=function(e){return this.grid._doContClick(e||window.event)};this.entBox.oncontextmenu=function(e){if(this.grid._ctmndx){(e||event).cancelBubble=true}return !this.grid._ctmndx}}this.obj.ondblclick=function(e){if(!this.grid.wasDblClicked(e||window.event)){return false}if(this.grid._dclE){var row=this.grid.getFirstParentOfType((_isIE?event.srcElement:e.target),"TR");if(row==this.grid.row){this.grid.editCell(e||window.event)}}(e||event).cancelBubble=true;if(_isOpera){return false}};this.hdr.onclick=this._onHeaderClick;this.sortImg.onclick=function(){self._onHeaderClick.apply({grid:self},[null,self.r_fldSorted])};this.hdr.ondblclick=this._onHeaderDblClick;if(!document.body._dhtmlxgrid_onkeydown){dhtmlxEvent(document,"keydown",function(e){if(globalActiveDHTMLGridObject){return globalActiveDHTMLGridObject.doKey(e||window.event)}});document.body._dhtmlxgrid_onkeydown=true}dhtmlxEvent(document.body,"click",function(){if(self.editStop){self.editStop()}if(self.isActive){self.setActive(false)}});if(this.entBox.style.height.toString().indexOf("%")!=-1){this._delta_y=this.entBox.style.height}if(this.entBox.style.width.toString().indexOf("%")!=-1){this._delta_x=this.entBox.style.width}if(this._delta_x||this._delta_y){this._setAutoResize()}this.setColHidden=this.setColumnsVisibility;this.enableCollSpan=this.enableColSpan;this.setMultiselect=this.enableMultiselect;this.setMultiLine=this.enableMultiline;this.deleteSelectedItem=this.deleteSelectedRows;this.getSelectedId=this.getSelectedRowId;this.getHeaderCol=this.getColumnLabel;this.isItemExists=this.doesRowExist;this.getColumnCount=this.getColumnsNum;this.setSelectedRow=this.selectRowById;this.setHeaderCol=this.setColumnLabel;this.preventIECashing=this.preventIECaching;this.enableAutoHeigth=this.enableAutoHeight;this.getUID=this.uid;if(dhtmlx.image_path){this.setImagePath(dhtmlx.image_path)}if(dhtmlx.skin){this.setSkin(dhtmlx.skin)}return this}dhtmlXGridObject.prototype={getRowAttribute:function(b,a){return this.getRowById(b)._attrs[a]},setRowAttribute:function(c,a,b){this.getRowById(c)._attrs[a]=b},isTreeGrid:function(){return(this.cellType._dhx_find("tree")!=-1)},setRowHidden:function(g,c){var b=convertStringToBoolean(c);var e=this.getRowById(g);if(!e){return}if(e.expand===""){this.collapseKids(e)}if((c)&&(e.style.display!="none")){e.style.display="none";var d=this.selectedRows._dhx_find(e);if(d!=-1){e.className=e.className.replace("rowselected","");for(var a=0;a<e.childNodes.length;a++){e.childNodes[a].className=e.childNodes[a].className.replace(/cellselected/g,"")}this.selectedRows._dhx_removeAt(d)}this.callEvent("onGridReconstructed",[])}if((!c)&&(e.style.display=="none")){e.style.display="";this.callEvent("onGridReconstructed",[])}this.callEvent("onRowHide",[g,c]);this.setSizes()},setColumnHidden:function(c,b){if(!this.hdr.rows.length){if(!this._ivizcol){this._ivizcol=[]}return this._ivizcol[c]=b}if((this.fldSorted)&&(this.fldSorted.cellIndex==c)&&(b)){this.sortImg.style.display="none"}var a=convertStringToBoolean(b);if(a){if(!this._hrrar){this._hrrar=new Array()}else{if(this._hrrar[c]){return}}this._hrrar[c]="display:none;";this._hideShowColumn(c,"none")}else{if((!this._hrrar)||(!this._hrrar[c])){return}this._hrrar[c]="";this._hideShowColumn(c,"")}if((this.fldSorted)&&(this.fldSorted.cellIndex==c)&&(!b)){this.sortImg.style.display="inline"}this.setSortImgPos();this.callEvent("onColumnHidden",[c,b])},isColumnHidden:function(a){if((this._hrrar)&&(this._hrrar[a])){return true}return false},setColumnsVisibility:function(b){if(b){this._ivizcol=b.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(h,c,a,b,f){f=f||"_cellIndex";var g=h.rows.length;for(var e=0;e<g;e++){var l=h.rows[e].childNodes;if(l.length!=this._cCount){for(var d=0;d<l.length;d++){if(l[d][f]==c){l[d].style[a]=b;break}}}else{l[c].style[a]=b}}},_hideShowColumn:function(e,d){var a=e;if(this.hdr.rows[1]&&(this.hdr.rows[1]._childIndexes)&&(this.hdr.rows[1]._childIndexes[e]!=e)){a=this.hdr.rows[1]._childIndexes[e]}if(d=="none"){this.hdr.rows[0].cells[e]._oldWidth=this.hdr.rows[0].cells[e].style.width||(this.initCellWidth[e]+"px");this.hdr.rows[0].cells[e]._oldWidthP=this.cellWidthPC[e];this.obj.rows[0].cells[e].style.width="0px";var b={rows:[this.obj.rows[0]]};this.forEachRow(function(f){if(this.rowsAr[f].tagName=="TR"){b.rows.push(this.rowsAr[f])}});this._fixHiddenRowsAll(b,e,"display","none");if(this.isTreeGrid()){this._fixHiddenRowsAllTG(e,"none")}if((_isOpera&&_OperaRv<9)||_isKHTML||(_isFF)){this._fixHiddenRowsAll(this.hdr,e,"display","none","_cellIndexS")}if(this.ftr){this._fixHiddenRowsAll(this.ftr.childNodes[0],e,"display","none")}this._fixHiddenRowsAll(this.hdr,e,"whiteSpace","nowrap","_cellIndexS");if(!this.cellWidthPX.length&&!this.cellWidthPC.length){this.cellWidthPX=[].concat(this.initCellWidth)}if(this.cellWidthPX[e]){this.cellWidthPX[e]=0}if(this.cellWidthPC[e]){this.cellWidthPC[e]=0}}else{if(this.hdr.rows[0].cells[e]._oldWidth){var c=this.hdr.rows[0].cells[e];if(_isOpera||_isKHTML||(_isFF)){this._fixHiddenRowsAll(this.hdr,e,"display","","_cellIndexS")}if(this.ftr){this._fixHiddenRowsAll(this.ftr.childNodes[0],e,"display","")}var b={rows:[this.obj.rows[0]]};this.forEachRow(function(f){if(this.rowsAr[f].tagName=="TR"){b.rows.push(this.rowsAr[f])}});this._fixHiddenRowsAll(b,e,"display","");if(this.isTreeGrid()){this._fixHiddenRowsAllTG(e,"")}this._fixHiddenRowsAll(this.hdr,e,"whiteSpace","normal","_cellIndexS");if(c._oldWidthP){this.cellWidthPC[e]=c._oldWidthP}if(c._oldWidth){this.cellWidthPX[e]=parseInt(c._oldWidth)}}}this.setSizes();if((!_isIE)&&(!_isFF)){this.obj.border=1;this.obj.border=0}},enableColSpan:function(a){this._ecspn=convertStringToBoolean(a)},enableRowsHover:function(b,a){this._unsetRowHover(false,true);this._hvrCss=a;if(convertStringToBoolean(b)){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(b,c,a){this._sclE=convertStringToBoolean(b);this._dclE=convertStringToBoolean(c);this._f2kE=convertStringToBoolean(a)},enableLightMouseNavigation:function(a){if(convertStringToBoolean(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(b){var d=this.grid.getFirstParentOfType(b?b.target:event.srcElement,"TD");if(!d){return}this.grid.editStop();this.grid.doClick(d);this.grid.editCell();(b||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(b,d){if(d){that=this}else{that=this.grid}if((that._lahRw)&&(that._lahRw!=d)){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(b){var d=this.grid.getFirstParentOfType(b?b.target:event.srcElement,"TD");if(d&&d.parentNode!=this.grid._lahRw){this.grid._unsetRowHover(0,d);d=d.parentNode;if(!d.idd||d.idd=="__filler__"){return}for(var a=0;a<d.childNodes.length;a++){d.childNodes[a].className+=" "+this.grid._hvrCss}this.grid._lahRw=d}this._honmousemove(b)},_autoMoveSelect:function(a){if(!this.grid.editor){var b=this.grid.getFirstParentOfType(a?a.target:event.srcElement,"TD");if(b.parentNode.idd){this.grid.doClick(b,true,0)}}this._onmousemove(a)},enableDistributedParsing:function(c,a,b){if(convertStringToBoolean(c)){this._ads_count=a||10;this._ads_time=b||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 c=0;c<this.formInputs.length;c++){this.parentForm.removeChild(this.formInputs[c])}}var b;this.xmlLoader=this.xmlLoader.destructor();for(var c=0;c<this.rowsCol.length;c++){if(this.rowsCol[c]){this.rowsCol[c].grid=null}}for(c in this.rowsAr){if(this.rowsAr[c]){this.rowsAr[c]=null}}this.rowsCol=new dhtmlxArray();this.rowsAr={};this.entBox.innerHTML="";var d=function(){};this.entBox.onclick=this.entBox.onmousedown=this.entBox.onbeforeactivate=this.entBox.onbeforedeactivate=this.entBox.onbeforedeactivate=this.entBox.onselectstart=d;this.setSizes=this._update_srnd_view=this.callEvent=d;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=d;this.globalBox.onclick=this.globalBox.onmousedown=this.globalBox.onbeforeactivate=this.globalBox.onbeforedeactivate=this.globalBox.onbeforedeactivate=this.globalBox.onselectstart=d}for(b in this){if((this[b])&&(this[b].m_obj)){this[b].m_obj=null}this[b]=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(c,b,a){this._ahgr=convertStringToBoolean(c);this._ahgrF=convertStringToBoolean(a);this._ahgrM=b||null;if(arguments.length==1){this.objBox.style.overflowY=c?"hidden":"auto"}if(b=="auto"){this._ahgrM=null;this._ahgrMA=true;this._setAutoResize()}},enableStableSorting:function(a){this._sst=convertStringToBoolean(a);this.rowsCol.stablesort=function(f){var e=this.length-1;for(var d=0;d<this.length-1;d++){for(var c=0;c<e;c++){if(f(this[c],this[c+1])>0){var b=this[c];this[c]=this[c+1];this[c+1]=b}}e--}}},enableKeyboardSupport:function(a){this._htkebl=!convertStringToBoolean(a)},enableContextMenu:function(a){this._ctmndx=a},setScrollbarWidthCorrection:function(a){},enableTooltips:function(b){this._enbTts=b.split(",");for(var a=0;a<this._enbTts.length;a++){this._enbTts[a]=convertStringToBoolean(this._enbTts[a])}},enableResizing:function(b){this._drsclmn=b.split(",");for(var a=0;a<this._drsclmn.length;a++){this._drsclmn[a]=convertStringToBoolean(this._drsclmn[a])}},setColumnMinWidth:function(a,b){if(arguments.length==2){if(!this._drsclmW){this._drsclmW=new Array()}this._drsclmW[b]=a}else{this._drsclmW=a.split(",")}},enableCellIds:function(a){this._enbCid=convertStringToBoolean(a)},lockRow:function(a,c){var b=this.getRowById(a);if(b){b._locked=convertStringToBoolean(c);if((this.cell)&&(this.cell.parentNode.idd==a)){this.editStop()}}},_getRowArray:function(e){var d=new Array();for(var c=0;c<e.childNodes.length;c++){var b=this.cells3(e,c);d[c]=b.getValue()}return d},setDateFormat:function(b,a){this._dtmask=b;this._dtmask_inc=a},setNumberFormat:function(h,c,e,g){var d=h.replace(/[^0\,\.]*/g,"");var a=d.indexOf(".");if(a>-1){a=d.length-a-1}var b=d.indexOf(",");if(b>-1){b=d.length-a-2-b}if(typeof e!="string"){e=this.i18n.decimal_separator}if(typeof g!="string"){g=this.i18n.group_separator}var i=h.split(d)[0];var f=h.split(d)[1];this._maskArr[c]=[a,b,i,f,e,g]},_aplNFb:function(e,d){var b=this._maskArr[d];if(!b){return e}var c=parseFloat(e.toString().replace(/[^0-9]*/g,""));if(e.toString().substr(0,1)=="-"){c=c*-1}if(b[0]>0){c=c/Math.pow(10,b[0])}return c},_aplNF:function(f,e){var b=this._maskArr[e];if(!b){return f}var g=(parseFloat(f)<0?"-":"")+b[2];f=Math.abs(Math.round(parseFloat(f)*Math.pow(10,b[0]>0?b[0]:0))).toString();f=(f.length<b[0]?Math.pow(10,b[0]+1-f.length).toString().substr(1,b[0]+1)+f.toString():f).split("").reverse();f[b[0]]=(f[b[0]]||"0")+b[4];if(b[1]>0){for(var d=(b[0]>0?0:1)+b[0]+b[1];d<f.length;d+=b[1]){f[d]+=b[5]}}return g+f.reverse().join("")+b[3]},_launchCommands:function(a){for(var d=0;d<a.length;d++){var c=new Array();for(var b=0;b<a[d].childNodes.length;b++){if(a[d].childNodes[b].nodeType==1){c[c.length]=a[d].childNodes[b].firstChild.data}}this[a[d].getAttribute("command")].apply(this,c)}},_parseHead:function(e){var d=this.xmlLoader.doXPath("./head",e);if(d.length){var f=this.xmlLoader.doXPath("./column",d[0]);var g=this.xmlLoader.doXPath("./settings",d[0]);var u="setInitWidths";var p=false;if(g[0]){for(var h=0;h<g[0].childNodes.length;h++){switch(g[0].childNodes[h].tagName){case"colwidth":if(g[0].childNodes[h].firstChild&&g[0].childNodes[h].firstChild.data=="%"){u="setInitWidthsP"}break;case"splitat":p=(g[0].childNodes[h].firstChild?g[0].childNodes[h].firstChild.data:false);break}}}this._launchCommands(this.xmlLoader.doXPath("./beforeInit/call",d[0]));if(f.length>0){if(this.hdr.rows.length>0){this.clearAll(true)}var a=[[],[],[],[],[],[],[],[],[]];var o=["","width","type","align","sort","color","format","hidden","id"];var n=["",u,"setColTypes","setColAlign","setColSorting","setColumnColor","","","setColumnIds"];for(var t=0;t<f.length;t++){for(var r=1;r<o.length;r++){a[r].push(f[t].getAttribute(o[r]))}a[0].push((f[t].firstChild?f[t].firstChild.data:"").replace(/^\s*((\s\S)*.+)\s*$/gi,"$1"))}this.setHeader(a[0]);for(var t=0;t<n.length;t++){if(n[t]){this[n[t]](a[t].join(this.delim))}}for(var t=0;t<f.length;t++){if((this.cellType[t].indexOf("co")==0)||(this.cellType[t]=="clist")){var l=this.xmlLoader.doXPath("./option",f[t]);if(l.length){var q=new Array();if(this.cellType[t]=="clist"){for(var r=0;r<l.length;r++){q[q.length]=l[r].firstChild?l[r].firstChild.data:""}this.registerCList(t,q)}else{var v=this.getCombo(t);for(var r=0;r<l.length;r++){v.put(l[r].getAttribute("value"),l[r].firstChild?l[r].firstChild.data:"")}}}}else{if(a[6][t]){if((this.cellType[t].toLowerCase().indexOf("calendar")!=-1)||(this.fldSort[t]=="date")){this.setDateFormat(a[6][t])}else{this.setNumberFormat(a[6][t],t)}}}}this.init();var c=a[7].join(this.delim);if(this.setColHidden&&c.replace(/,/g,"")!=""){this.setColHidden(c)}if((p)&&(this.splitAt)){this.splitAt(p)}}this._launchCommands(this.xmlLoader.doXPath("./afterInit/call",d[0]))}var b=this.xmlLoader.doXPath("//rows/userdata",e);if(b.length>0){if(!this.UserData.gridglobaluserdata){this.UserData.gridglobaluserdata=new Hashtable()}for(var r=0;r<b.length;r++){var w="";for(var m=0;m<b[r].childNodes.length;m++){w+=b[r].childNodes[m].nodeValue}this.UserData.gridglobaluserdata.put(b[r].getAttribute("name"),w)}}},getCheckedRows:function(a){var b=new Array();this.forEachRowA(function(d){var c=this.cells(d,a);if(c.changeState&&c.getValue()!=0){b.push(d)}},true);return b.join(",")},checkAll:function(){var b=arguments.length?arguments[0]:1;for(var a=0;a<this.getColumnsNum();a++){if(this.getColType(a)=="ch"){this.setCheckedRows(a,b)}}},uncheckAll:function(){this.checkAll(0)},setCheckedRows:function(b,a){this.forEachRowA(function(c){if(this.cells(c,b).isCheckbox()){this.cells(c,b).setValue(a)}})},_drawTooltip:function(f){var g=this.grid.getFirstParentOfType(f?f.target:event.srcElement,"TD");if(!g||((this.grid.editor)&&(this.grid.editor.cell==g))){return true}var d=g.parentNode;if(!d.idd||d.idd=="__filler__"){return}var b=(f?f.target:event.srcElement);if(d.idd==window.unknown){return true}if(!this.grid.callEvent("onMouseOver",[d.idd,g._cellIndex,(f||window.event)])){return true}if((this.grid._enbTts)&&(!this.grid._enbTts[g._cellIndex])){if(b.title){b.title=""}return true}if(g._cellIndex>=this.grid._cCount){return}var a=this.grid.cells3(d,g._cellIndex);if(!a||!a.cell||!a.cell._attrs){return}if(b._title){a.cell.title=""}if(!a.cell._attrs.title){b._title=true}if(a){b.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(c){var a=[];for(var b=0;b<this.rowsBuffer.length;b++){if(this.rowsBuffer[b]){a.push(this.rowsBuffer[b].idd)}}return a.join(c||this.delim)},getAllItemIds:function(){return this.getAllRowIds()},setColspan:function(b,q,d){if(!this._ecspn){return}var a=this.getRowById(b);if((a._childIndexes)&&(a.childNodes[a._childIndexes[q]])){var g=a._childIndexes[q];var e=a.childNodes[g];var f=e.colSpan;e.colSpan=1;if((f)&&(f!=1)){for(var l=1;l<f;l++){var p=document.createElement("TD");if(e.nextSibling){a.insertBefore(p,e.nextSibling)}else{a.appendChild(p)}a._childIndexes[q+l]=g+l;p._cellIndex=q+l;p.style.textAlign=this.cellAlign[l];p.style.verticalAlign=this.cellVAlign[l];e=p;this.cells3(a,q+l).setValue("")}}for(var o=q*1+1*f;o<a._childIndexes.length;o++){a._childIndexes[o]+=(f-1)*1}}if((d)&&(d>1)){if(a._childIndexes){var g=a._childIndexes[q]}else{var g=q;a._childIndexes=new Array();for(var o=0;o<a.childNodes.length;o++){a._childIndexes[o]=o}}a.childNodes[g].colSpan=d;for(var o=1;o<d;o++){a._childIndexes[a.childNodes[g+1]._cellIndex]=g;a.removeChild(a.childNodes[g+1])}var h=a.childNodes[a._childIndexes[q]]._cellIndex;for(var o=h*1+1*d;o<a._childIndexes.length;o++){a._childIndexes[o]-=(d-1)}}},preventIECaching:function(a){this.no_cashe=convertStringToBoolean(a);this.xmlLoader.rSeed=this.no_cashe},enableColumnAutoSize:function(a){this._eCAS=convertStringToBoolean(a)},_onHeaderDblClick:function(c){var b=this.grid;var a=b.getFirstParentOfType(_isIE?event.srcElement:c.target,"TD");if(!b._eCAS){return false}b.adjustColumnSize(a._cellIndexS)},adjustColumnSize:function(g,b){if(this._hrrar&&this._hrrar[g]){return}this._notresize=true;var c=0;this._setColumnSizeR(g,20);for(var e=1;e<this.hdr.rows.length;e++){var n=this.hdr.rows[e];n=n.childNodes[(n._childIndexes)?n._childIndexes[g]:g];if((n)&&((!n.colSpan)||(n.colSpan<2))&&n._cellIndex==g){if((n.childNodes[0])&&(n.childNodes[0].className=="hdrcell")){n=n.childNodes[0]}c=Math.max(c,n.scrollWidth)}}var d=this.obj.rows.length;var h=0;var p=this.cellType._dhx_find("tree");for(var f=1;f<d;f++){var o=this.obj.rows[f];if(!this.rowsAr[o.idd]){continue}if(o._childIndexes&&o._childIndexes[g]!=g||!o.childNodes[g]){continue}h=(o.childNodes[g].innerText||o.childNodes[g].textContent||"").length*this.fontWidth;if(this._h2&&g==p){h+=this._h2.get[o.idd].level*22}if(h>c){c=h}}c+=20+(b||0);this._setColumnSizeR(g,c);this._notresize=false;this.setSizes()},detachHeader:function(a,c){c=c||this.hdr;var b=c.rows[a+1];if(b){b.parentNode.removeChild(b)}this.setSizes()},detachFooter:function(a){this.detachHeader(a,this.ftr)},attachHeader:function(a,d,b){if(typeof(a)=="string"){a=this._eSplit(a)}if(typeof(d)=="string"){d=d.split(this.delim)}b=b||"_aHead";if(this.hdr.rows.length){if(a){this._createHRow([a,d],this[(b=="_aHead")?"hdr":"ftr"])}else{if(this[b]){for(var c=0;c<this[b].length;c++){this.attachHeader.apply(this,this[b][c])}}}}else{if(!this[b]){this[b]=new Array()}this[b][this[b].length]=[a,d,b]}},_createHRow:function(c,m){if(!m){if(this.entBox.style.position!="absolute"){this.entBox.style.position="relative"}var g=document.createElement("DIV");g.className="c_ftr".substr(2);this.entBox.appendChild(g);var p=document.createElement("TABLE");p.cellPadding=p.cellSpacing=0;if(!_isIE||_isIE==8){p.width="100%";p.style.paddingRight="20px"}p.style.marginRight="20px";p.style.tableLayout="fixed";g.appendChild(p);p.appendChild(document.createElement("TBODY"));this.ftr=m=p;var f=p.insertRow(0);var a=((this.hdrLabels.length<=1)?c[0].length:this.hdrLabels.length);for(var d=0;d<a;d++){f.appendChild(document.createElement("TH"));f.childNodes[d]._cellIndex=d}if(_isIE&&_isIE<8){f.style.position="absolute"}else{f.style.height="auto"}}var e=c[1];var g=document.createElement("TR");m.rows[0].parentNode.appendChild(g);for(var d=0;d<c[0].length;d++){if(c[0][d]=="#cspan"){var h=g.cells[g.cells.length-1];h.colSpan=(h.colSpan||1)+1;continue}if((c[0][d]=="#rspan")&&(m.rows.length>1)){var r=m.rows.length-2;var q=false;var h=null;while(!q){var h=m.rows[r];for(var b=0;b<h.cells.length;b++){if(h.cells[b]._cellIndex==d){q=b+1;break}}r--}h=h.cells[q-1];h.rowSpan=(h.rowSpan||1)+1;continue}var l=document.createElement("TD");l._cellIndex=l._cellIndexS=d;if(this._hrrar&&this._hrrar[d]&&!_isIE){l.style.display="none"}if(typeof c[0][d]=="object"){l.appendChild(c[0][d])}else{if(this.forceDivInHeader){l.innerHTML="<div class='hdrcell'>"+(c[0][d]||"&nbsp;")+"</div>"}else{l.innerHTML=(c[0][d]||"&nbsp;")}if((c[0][d]||"").indexOf("#")!=-1){var p=c[0][d].match(/(^|{)#([^}]+)(}|$)/);if(p){var n="_in_header_"+p[2];if(this[n]){this[n]((this.forceDivInHeader?l.firstChild:l),d,c[0][d].split(p[0]))}}}}if(e){l.style.cssText=e[d]}g.appendChild(l)}var o=m;if(_isKHTML){if(m._kTimer){window.clearTimeout(m._kTimer)}m._kTimer=window.setTimeout(function(){m.rows[1].style.display="none";window.setTimeout(function(){m.rows[1].style.display=""},1)},500)}},attachFooter:function(a,b){this.attachHeader(a,b,"_aFoot")},setCellExcellType:function(c,a,b){this.changeCellType(this.getRowById(c),a,b)},changeCellType:function(c,d,b){b=b||this.cellType[d];var e=this.cells3(c,d);var a=e.getValue();e.cell._cellType=b;var e=this.cells3(c,d);e.setValue(a)},setRowExcellType:function(c,b){var d=this.rowsAr[c];for(var a=0;a<d.childNodes.length;a++){this.changeCellType(d,a,b)}},setColumnExcellType:function(a,c){for(var b=0;b<this.rowsBuffer.length;b++){if(this.rowsBuffer[b]&&this.rowsBuffer[b].tagName=="TR"){this.changeCellType(this.rowsBuffer[b],a,c)}}if(this.cellType[a]=="math"){this._strangeParams[b]=c}else{this.cellType[a]=c}},forEachRow:function(c){for(var b in this.rowsAr){if(this.rowsAr[b]&&this.rowsAr[b].idd){c.apply(this,[this.rowsAr[b].idd])}}},forEachRowA:function(c){for(var b=0;b<this.rowsBuffer.length;b++){if(this.rowsBuffer[b]){c.call(this,this.render_row(b).idd)}}},forEachCell:function(c,b){var d=this.getRowById(c);if(!d){return}for(var a=0;a<this._cCount;a++){b(this.cells3(d,a),a)}},enableAutoWidth:function(c,a,b){this._awdth=[convertStringToBoolean(c),parseInt(a||99999),parseInt(b||0)];if(arguments.length==1){this.objBox.style.overflowX=c?"hidden":"auto"}},updateFromXML:function(a,d,b,c){if(typeof d=="undefined"){d=true}this._refresh_mode=[true,d,b];this.load(a,c)},_refreshFromXML:function(d){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(m){var i=this.grid._h2.get[this.cell.parentNode.idd];if(i&&this.cell.parentNode.valTag){this.setLabel(m)}else{this.setValueX(m)}}}var l=this.cellType._dhx_find("tree");d.getXMLTopNode("rows");var e=d.doXPath("//rows")[0].getAttribute("parent")||0;var g={};if(this._refresh_mode[2]){if(l!=-1){this._h2.forEachChild(e,function(i){g[i.id]=true},this)}else{this.forEachRow(function(i){g[i]=true})}}var j=d.doXPath("//row");for(var c=0;c<j.length;c++){var h=j[c];var a=h.getAttribute("id");g[a]=false;var e=h.parentNode.getAttribute("id")||e;if(this.rowsAr[a]&&this.rowsAr[a].tagName!="TR"){if(this._h2){this._h2.get[a].buff.data=h}else{this.rowsBuffer[this.getRowIndex(a)].data=h}this.rowsAr[a]=h}else{if(this.rowsAr[a]){this._process_xml_row(this.rowsAr[a],h,-1);this._postRowProcessing(this.rowsAr[a],true)}else{if(this._refresh_mode[1]){var f={idd:a,data:h,_parser:this._process_xml_row,_locator:this._get_xml_data};var b=this.rowsBuffer.length;if(this._refresh_mode[1]=="top"){this.rowsBuffer.unshift(f);b=0}else{this.rowsBuffer.push(f)}if(this._h2){reset=true;(this._h2.add(a,(h.parentNode.getAttribute("id")||h.parentNode.getAttribute("parent")))).buff=this.rowsBuffer[this.rowsBuffer.length-1]}else{if(this._srnd){reset=true}}this.rowsAr[a]=h;h=this.render_row(b);this._insertRowAt(h,b?-1:0)}}}}if(this._refresh_mode[2]){for(a in g){if(g[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()}},getCustomCombo:function(c,b){var a=this.cells(c,b).cell;if(!a._combo){a._combo=new dhtmlXGridComboObject()}return a._combo},setTabOrder:function(b){var d=b.split(this.delim);this._tabOrder=[];var a=this._cCount||b.length;for(var c=0;c<a;c++){d[c]={c:parseInt(d[c]),ind:c}}d.sort(function(f,e){return(f.c>e.c?1:-1)});for(var c=0;c<a;c++){if(!d[c+1]||(typeof d[c].c=="undefined")){this._tabOrder[d[c].ind]=(d[0].ind+1)*-1}else{this._tabOrder[d[c].ind]=d[c+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 b=this._realfake?this._fake:this;if(this.editor&&this.editor.combo){this.editor.shiftNext()}else{if(!this.row.idd){return}var a=Math.max((b._r_select||0),this.getRowIndex(this.row.idd));var c=this._nextRow(a,1);if(c){b._r_select=null;this.selectCell(c,this.cell._cellIndex,true);if(b.pagingOn){b.showRow(c.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 b=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 c=this._nextRow(a-1,-1);this.selectCell(c,this.cell._cellIndex,true);if(b.pagingOn&&c){b.showRow(c.idd)}}else{this._key_events.k33_0_0.apply(this,[])}}this._still_active=true}},_build_master_row:function(){var c=document.createElement("DIV");var b=["<table><tr>"];for(var a=0;a<this._cCount;a++){b.push("<td></td>")}b.push("</tr></table>");c.innerHTML=b.join("");this._master_row=c.firstChild.rows[0]},_prepareRow:function(a){if(!this._master_row){this._build_master_row()}var c=this._master_row.cloneNode(true);for(var b=0;b<c.childNodes.length;b++){c.childNodes[b]._cellIndex=b;if(this._enbCid){c.childNodes[b].id="c_"+a+"_"+b}if(this.dragAndDropOff){this.dragger.addDraggableItem(c.childNodes[b],this)}}c.idd=a;c.grid=this;return c},_process_jsarray_row:function(b,c){b._attrs={};for(var a=0;a<b.childNodes.length;a++){b.childNodes[a]._attrs={}}this._fillRow(b,(this._c_order?this._swapColumns(c):c));return b},_get_jsarray_data:function(b,a){return b[a]},_process_json_row:function(a,b){b=this._c_order?this._swapColumns(b.data):b.data;return this._process_some_row(a,b)},_process_some_row:function(b,c){b._attrs={};for(var a=0;a<b.childNodes.length;a++){b.childNodes[a]._attrs={}}this._fillRow(b,c);return b},_get_json_data:function(b,a){return b.data[a]},_process_js_row:function(c,d){var a=[];for(var b=0;b<this.columnIds.length;b++){a[b]=d[this.columnIds[b]];if(!a[b]&&a[b]!==0){a[b]=""}}this._process_some_row(c,a);c._attrs=d;return c},_get_js_data:function(b,a){return b[this.columnIds[a]]},_process_csv_row:function(b,c){b._attrs={};for(var a=0;a<b.childNodes.length;a++){b.childNodes[a]._attrs={}}this._fillRow(b,(this._c_order?this._swapColumns(c.split(this.csv.cell)):c.split(this.csv.cell)));return b},_get_csv_data:function(b,a){return b.split(this.csv.cell)[a]},_process_store_row:function(e,d){var a=[];for(var c=0;c<this.columnIds.length;c++){a[c]=d[this.columnIds[c]]}for(var b=0;b<e.childNodes.length;b++){e.childNodes[b]._attrs={}}e._attrs=d;this._fillRow(e,a)},_process_xml_row:function(a,f){var n=this.xmlLoader.doXPath(this.xml.cell,f);var l=[];a._attrs=this._xml_attrs(f);if(this._ud_enabled){var m=this.xmlLoader.doXPath("./userdata",f);for(var e=m.length-1;e>=0;e--){var h="";for(var c=0;c<m[e].childNodes.length;c++){h+=m[e].childNodes[c].nodeValue}this.setUserData(a.idd,m[e].getAttribute("name"),h)}}for(var c=0;c<n.length;c++){var d=n[this._c_order?this._c_order[c]:c];if(!d){continue}var b=a._childIndexes?a._childIndexes[c]:c;var g=d.getAttribute("type");if(a.childNodes[b]){if(g){a.childNodes[b]._cellType=g}a.childNodes[b]._attrs=this._xml_attrs(d)}if(!d.getAttribute("xmlcontent")){if(d.firstChild){d=d.firstChild.data}else{d=""}}l.push(d)}for(c<n.length;c<a.childNodes.length;c++){a.childNodes[c]._attrs={}}if(a.parentNode&&a.parentNode.tagName=="row"){a._attrs.parent=a.parentNode.getAttribute("idd")}this._fillRow(a,l);return a},_get_xml_data:function(b,a){b=b.firstChild;while(true){if(!b){return""}if(b.tagName=="cell"){a--}if(a<0){break}b=b.nextSibling}return(b.firstChild?b.firstChild.data:"")},_fillRow:function(d,f){if(this.editor){this.editStop()}for(var b=0;b<d.childNodes.length;b++){if((b<f.length)||(this.defVal[b])){var c=d.childNodes[b]._cellIndex;var e=f[c];var a=this.cells4(d.childNodes[b]);if((this.defVal[c])&&((e=="")||(typeof(e)=="undefined"))){e=this.defVal[c]}if(a){a.setValue(e)}}else{d.childNodes[b].innerHTML="&nbsp;";d.childNodes[b]._clearCell=true}}return d},_postRowProcessing:function(f,h){if(f._attrs["class"]){f._css=f.className=f._attrs["class"]}if(f._attrs.locked){f._locked=true}if(f._attrs.bgColor){f.bgColor=f._attrs.bgColor}var g=0;for(var b=0;b<f.childNodes.length;b++){var j=f.childNodes[b];var e=j._cellIndex;var d=j._attrs.style||f._attrs.style;if(d){j.style.cssText+=";"+d}if(j._attrs["class"]){j.className=j._attrs["class"]}d=j._attrs.align||this.cellAlign[e];if(d){j.align=d}j.vAlign=j._attrs.valign||this.cellVAlign[e];var a=j._attrs.bgColor||this.columnColor[e];if(a){j.bgColor=a}if(j._attrs.colspan&&!h){this.setColspan(f.idd,b+g,j._attrs.colspan);g+=(j._attrs.colspan-1)}if(this._hrrar&&this._hrrar[e]&&!h){j.style.display="none"}}this.callEvent("onRowCreated",[f.idd,f,null])},load:function(a,c,b){this.callEvent("onXLS",[this]);if(arguments.length==2&&typeof c!="function"){b=c;c=null}b=b||"xml";if(!this.xmlFileUrl){this.xmlFileUrl=a}this._data_type=b;this.xmlLoader=new dtmlXMLLoaderObject(this.doLoadDetails,this,true,this.no_cashe);this.xmlLoader.onloadAction=function(g,e,i,h,f){if(!g.callEvent){return}f=g["_process_"+b](f);if(!g._contextCallTimer){g.callEvent("onXLE",[g,0,0,f])}if(c){c();c=null}};this.xmlLoader.loadXML(a)},loadXMLString:function(c,b){var a=new dtmlXMLLoaderObject(function(){});a.loadXMLString(c);this.parse(a,b,"xml")},loadXML:function(a,b){this.load(a,b,"xml")},parse:function(c,b,a){if(arguments.length==2&&typeof b!="function"){a=b;b=null}a=a||"xml";this._data_type=a;c=this["_process_"+a](c);if(!this._contextCallTimer){this.callEvent("onXLE",[this,0,0,c])}if(b){b()}},xml:{top:"rows",row:"./row",cell:"./cell",s_row:"row",s_cell:"cell",row_attrs:[],cell_attrs:[]},csv:{row:"\n",cell:","},_xml_attrs:function(b){var c={};if(b.attributes.length){for(var a=0;a<b.attributes.length;a++){c[b.attributes[a].name]=b.attributes[a].value}}return c},_process_xml:function(d){if(!d.doXPath){var m=new dtmlXMLLoaderObject(function(){});if(typeof d=="string"){m.loadXMLString(d)}else{if(d.responseXML){m.xmlDoc=d}else{m.xmlDoc={}}m.xmlDoc.responseXML=d}d=m}if(this._refresh_mode){return this._refreshFromXML(d)}this._parsing=true;var g=d.getXMLTopNode(this.xml.top);if(g.tagName!=this.xml.top){return}var l=g.getAttribute("dhx_security");if(l){dhtmlx.security_key=l}this._parseHead(g);var n=d.doXPath(this.xml.row,g);var f=parseInt(d.doXPath("//"+this.xml.top)[0].getAttribute("pos")||0);var j=parseInt(d.doXPath("//"+this.xml.top)[0].getAttribute("total_count")||0);var j=Math.min(j,32000000/this._srdh);var e=false;if(j&&j!=this.rowsBuffer.length){if(!this.rowsBuffer[j-1]){if(this.rowsBuffer.length){e=true}this.rowsBuffer[j-1]=null}if(j<this.rowsBuffer.length){this.rowsBuffer.splice(j,this.rowsBuffer.length-j);e=true}}if(this.isTreeGrid()){return this._process_tree_xml(d)}for(var b=0;b<n.length;b++){if(this.rowsBuffer[b+f]){continue}var a=n[b].getAttribute("id")||(b+f+1);this.rowsBuffer[b+f]={idd:a,data:n[b],_parser:this._process_xml_row,_locator:this._get_xml_data};this.rowsAr[a]=n[b]}this.callEvent("onDataReady",[]);if(e&&this._srnd){var c=this.objBox.scrollTop;this._reset_view();this.objBox.scrollTop=c}else{this.render_dataset()}this._parsing=false;return d.xmlDoc.responseXML?d.xmlDoc.responseXML:d.xmlDoc},_process_jsarray:function(data){this._parsing=true;if(data&&data.xmlDoc){eval("dhtmlx.temp="+data.xmlDoc.responseText+";");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(d){this._parsing=true;if(d.xmlDoc){d=d.xmlDoc.responseText}d=d.replace(/\r/g,"");d=d.split(this.csv.row);if(this._csvHdr){this.clearAll();var c=d.splice(0,1)[0].split(this.csv.cell);if(!this._csvAID){c.splice(0,1)}this.setHeader(c.join(this.delim));this.init()}for(var b=0;b<d.length;b++){if(!d[b]&&b==d.length-1){continue}if(this._csvAID){var e=b+1;this.rowsBuffer.push({idd:e,data:d[b],_parser:this._process_csv_row,_locator:this._get_csv_data})}else{var a=d[b].split(this.csv.cell);var e=a.splice(0,1)[0];this.rowsBuffer.push({idd:e,data:a,_parser:this._process_jsarray_row,_locator:this._get_jsarray_data})}this.rowsAr[e]=d[b]}this.render_dataset();this._parsing=false},_process_js:function(a){return this._process_json(a,"js")},_process_json:function(data,mode){this._parsing=true;if(data&&data.xmlDoc){eval("dhtmlx.temp="+data.xmlDoc.responseText+";");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{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.render_dataset();this._parsing=false},render_dataset:function(d,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){d=Math.max((d||0),(this.currentPage-1)*this.rowsBufferOutSize);a=Math.min(this.currentPage*this.rowsBufferOutSize,this.rowsBuffer.length)}else{d=d||0;a=a||this.rowsBuffer.length}for(var c=d;c<a;c++){var f=this.render_row(c);if(f==-1){if(this.xmlFileUrl){if(this.callEvent("onDynXLS",[c,(this._dpref?this._dpref:(a-c))])){this.load(this.xmlFileUrl+getUrlSymbol(this.xmlFileUrl)+"posStart="+c+"&count="+(this._dpref?this._dpref:(a-c)),this._data_type)}}a=c;break}if(!f.parentNode||!f.parentNode.tagName){this._insertRowAt(f,c);if(f._attrs.selected||f._attrs.select){this.selectRow(f,f._attrs.call?true:false,true);f._attrs.selected=f._attrs.select=null}}if(this._ads_count&&c-d==this._ads_count){var e=this;this._context_parsing=this._context_parsing||this._parsing;return this._contextCallTimer=window.setTimeout(function(){e._contextCallTimer=null;e.render_dataset(c,a);if(!e._contextCallTimer){if(e._context_parsing){e.callEvent("onXLE",[])}else{e._fixAlterCss()}e.callEvent("onDistributedEnd",[]);e._context_parsing=false}},this._ads_time)}}if(this._ads_count&&c==a){this.callEvent("onDistributedEnd",[])}if(this._srnd&&!this._fillers){var b=this.rowsBuffer.length-a;this._fillers=[];if(this._fake){this._fake._fillers=[]}while(b>0){var h=(_isIE||window._FFrv)?Math.min(b,50000):b;var g=this._add_filler(a,h);if(g){this._fillers.push(g)}b-=h;a+=h}}this.setSizes()},render_row:function(b){if(!this.rowsBuffer[b]){return -1}if(this.rowsBuffer[b]._parser){var a=this.rowsBuffer[b];if(this.rowsAr[a.idd]&&this.rowsAr[a.idd].tagName=="TR"){return this.rowsBuffer[b]=this.rowsAr[a.idd]}var c=this._prepareRow(a.idd);this.rowsBuffer[b]=c;this.rowsAr[a.idd]=c;a._parser.call(this,c,a.data);this._postRowProcessing(c);return c}return this.rowsBuffer[b]},_get_cell_value:function(b,a,c){if(b._locator){if(this._c_order){a=this._c_order[a]}return b._locator.call(this,b.data,a)}return this.cells3(b,a)[c?c:"getValue"]()},sortRows:function(c,f,b){this.editStop();b=(b||"asc").toLowerCase();f=(f||this.fldSort[c]);c=c||0;if(this.isTreeGrid()){this.sortTreeRows(c,f,b)}else{var a={};var e=this.cellType[c];var g="getValue";if(e=="link"){g="getContent"}if(e=="dhxCalendar"||e=="dhxCalendarA"){g="getDate"}for(var d=0;d<this.rowsBuffer.length;d++){a[this.rowsBuffer[d].idd]=this._get_cell_value(this.rowsBuffer[d],c,g)}this._sortRows(c,f,b,a)}this.callEvent("onAfterSorting",[c,f,b])},_sortCore:function(c,f,b,a,e){var d="sort";if(this._sst){e.stablesort=this.rowsCol.stablesort;d="stablesort"}if(f.length>4){f=window[f]}if(f=="cus"){var g=this._customSorts[c];e[d](function(i,h){return g(a[i.idd],a[h.idd],b,i.idd,h.idd)})}else{if(typeof(f)=="function"){e[d](function(i,h){return f(a[i.idd],a[h.idd],b,i.idd,h.idd)})}else{if(f=="str"){e[d](function(i,h){if(b=="asc"){return a[i.idd]>a[h.idd]?1:(a[i.idd]<a[h.idd]?-1:0)}else{return a[i.idd]<a[h.idd]?1:(a[i.idd]>a[h.idd]?-1:0)}})}else{if(f=="int"){e[d](function(j,i){var h=parseFloat(a[j.idd]);h=isNaN(h)?-99999999999999:h;var l=parseFloat(a[i.idd]);l=isNaN(l)?-99999999999999:l;if(b=="asc"){return h-l}else{return l-h}})}else{if(f=="date"){e[d](function(j,i){var h=Date.parse(a[j.idd])||(Date.parse("01/01/1900"));var l=Date.parse(a[i.idd])||(Date.parse("01/01/1900"));if(b=="asc"){return h-l}else{return l-h}})}}}}}},_sortRows:function(c,d,b,a){this._sortCore(c,d,b,a,this.rowsBuffer);this._reset_view();this.callEvent("onGridReconstructed",[])},_reset_view:function(c){if(!this.obj.rows[0]){return}if(this._lahRw){this._unsetRowHover(0,true)}this.callEvent("onResetView",[]);var a=this.obj.rows[0].parentNode;var d=a.removeChild(a.childNodes[0],true);if(_isKHTML){for(var b=a.parentNode.childNodes.length-1;b>=0;b--){if(a.parentNode.childNodes[b].tagName=="TR"){a.parentNode.removeChild(a.parentNode.childNodes[b],true)}}}else{if(_isIE){for(var b=a.childNodes.length-1;b>=0;b--){a.childNodes[b].removeNode(true)}}else{a.innerHTML=""}}a.appendChild(d);this.rowsCol=dhtmlxArray();if(this._sst){this.enableStableSorting(true)}this._fillers=this.undefined;if(!c){if(_isIE&&this._srnd){this.render_dataset()}else{this.render_dataset()}}},deleteRow:function(b,d){if(!d){d=this.getRowById(b)}if(!d){return}this.editStop();if(!this._realfake){if(this.callEvent("onBeforeRowDeleted",[b])==false){return false}}var a=0;if(this.cellType._dhx_find("tree")!=-1&&!this._realfake){a=this._h2.get[b].parent.id;this._removeTrGrRow(d)}else{if(d.parentNode){d.parentNode.removeChild(d)}var g=this.rowsCol._dhx_find(d);if(g!=-1){this.rowsCol._dhx_removeAt(g)}for(var c=0;c<this.rowsBuffer.length;c++){if(this.rowsBuffer[c]&&this.rowsBuffer[c].idd==b){this.rowsBuffer._dhx_removeAt(c);g=c;break}}}this.rowsAr[b]=null;for(var c=0;c<this.selectedRows.length;c++){if(this.selectedRows[c].idd==b){this.selectedRows._dhx_removeAt(c)}}if(this._srnd){for(var c=0;c<this._fillers.length;c++){var e=this._fillers[c];if(!e){continue}if(e[0]>=g){this._update_fillers(c,0,-1)}else{if(e[0]+e[1]>g){this._update_fillers(c,-1,0)}}}this._update_srnd_view()}if(this.pagingOn){this.changePage()}if(!this._realfake){this.callEvent("onAfterRowDeleted",[b,a])}this.callEvent("onGridReconstructed",[]);if(this._ahgr){this.setSizes()}return true},_addRow:function(g,h,b){if(b==-1||typeof b=="undefined"){b=this.rowsBuffer.length}if(typeof h=="string"){h=h.split(this.delim)}var l=this._prepareRow(g);l._attrs={};for(var c=0;c<l.childNodes.length;c++){l.childNodes[c]._attrs={}}this.rowsAr[l.idd]=l;if(this._h2){this._h2.get[l.idd].buff=l}this._fillRow(l,h);this._postRowProcessing(l);if(this._skipInsert){this._skipInsert=false;return this.rowsAr[l.idd]=l}if(this.pagingOn){this.rowsBuffer._dhx_insertAt(b,l);this.rowsAr[l.idd]=l;return l}if(this._fillers){this.rowsCol._dhx_insertAt(b,null);this.rowsBuffer._dhx_insertAt(b,l);if(this._fake){this._fake.rowsCol._dhx_insertAt(b,null)}this.rowsAr[l.idd]=l;var m=false;for(var d=0;d<this._fillers.length;d++){var e=this._fillers[d];if(e&&e[0]<=b&&(e[0]+e[1])>=b){e[1]=e[1]+1;var a=e[2].firstChild.style.height=parseInt(e[2].firstChild.style.height)+this._srdh+"px";m=true;if(this._fake){this._fake._fillers[d][1]++;this._fake._fillers[d][2].firstChild.style.height=a}}if(e&&e[0]>b){e[0]=e[0]+1;if(this._fake){this._fake._fillers[d][0]++}}}if(!m){this._fillers.push(this._add_filler(b,1,(b==0?{parentNode:this.obj.rows[0].parentNode,nextSibling:(this.rowsCol[1])}:this.rowsCol[b-1])))}return l}this.rowsBuffer._dhx_insertAt(b,l);return this._insertRowAt(l,b)},addRow:function(a,d,c){var b=this._addRow(a,d,c);if(!this.dragContext){this.callEvent("onRowAdded",[a])}if(this.pagingOn){this.changePage(this.currentPage)}if(this._srnd){this._update_srnd_view()}b._added=true;if(this._ahgr){this.setSizes()}this.callEvent("onGridReconstructed",[]);return b},_insertRowAt:function(c,d,b){this.rowsAr[c.idd]=c;if(this._skipInsert){this._skipInsert=false;return c}if((d<0)||((!d)&&(parseInt(d)!==0))){d=this.rowsCol.length}else{if(d>this.rowsCol.length){d=this.rowsCol.length}}if(this._cssEven){var a=c.className.replace(this._cssUnEven,"");if((this._cssSP?this.getLevel(c.idd):d)%2==1){c.className=a+" "+this._cssUnEven+(this._cssSU?(" "+this._cssUnEven+"_"+this.getLevel(c.idd)):"")}else{c.className=a+" "+this._cssEven+(this._cssSU?(" "+this._cssEven+"_"+this.getLevel(c.idd)):"")}}if(!b){if((d==(this.obj.rows.length-1))||(!this.rowsCol[d])){if(_isKHTML){this.obj.appendChild(c)}else{this.obj.firstChild.appendChild(c)}}else{this.rowsCol[d].parentNode.insertBefore(c,this.rowsCol[d])}}this.rowsCol._dhx_insertAt(d,c);this.callEvent("onRowInserted",[c,d]);return c},getRowById:function(c){var b=this.rowsAr[c];if(b){if(b.tagName!="TR"){for(var a=0;a<this.rowsBuffer.length;a++){if(this.rowsBuffer[a]&&this.rowsBuffer[a].idd==c){return this.render_row(a)}}if(this._h2){return this.render_row(null,b.idd)}}return b}return null},cellById:function(b,a){return this.cells(b,a)},cells:function(d,b){if(arguments.length==0){return this.cells4(this.cell)}else{var e=this.getRowById(d)}var a=(e._childIndexes?e.childNodes[e._childIndexes[b]]:e.childNodes[b]);if(!a&&e._childIndexes){a=e.firstChild||{}}return this.cells4(a)},cellByIndex:function(b,a){return this.cells2(b,a)},cells2:function(d,b){var e=this.render_row(d);var a=(e._childIndexes?e.childNodes[e._childIndexes[b]]:e.childNodes[b]);if(!a&&e._childIndexes){a=e.firstChild||{}}return this.cells4(a)},cells3:function(c,b){var a=(c._childIndexes?c.childNodes[c._childIndexes[b]]:c.childNodes[b]);return this.cells4(a)},cells4:function(a){var b=window["eXcell_"+(a._cellType||this.cellType[a._cellIndex])];if(b){return new b(a)}},cells5:function(a,c){var c=c||(a._cellType||this.cellType[a._cellIndex]);if(!this._ecache[c]){if(!window["eXcell_"+c]){var b=eXcell_ro}else{var b=window["eXcell_"+c]}this._ecache[c]=new b(a)}this._ecache[c].cell=a;return this._ecache[c]},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=convertStringToBoolean(a)}else{this.smartTabOrder=true}},setExternalTabOrder:function(e,a){var b=this;this.tabStart=(typeof(e)=="object")?e:document.getElementById(e);var c=this.tabStart.onkeydown;this.tabStart.onkeydown=function(g){if(c){c.call(this,g)}var f=(g||window.event);if(f.keyCode==9&&!f.shiftKey){f.cancelBubble=true;b.selectCell(0,0,0,0,1);if(b.smartTabOrder&&b.cells2(0,0).isDisabled()){b._key_events.k9_0_0.call(b)}this.blur();return false}};if(_isOpera){this.tabStart.onkeypress=this.tabStart.onkeydown}this.tabEnd=(typeof(a)=="object")?a:document.getElementById(a);var d=this.tabEnd.onkeydown;this.tabEnd.onkeydown=this.tabEnd.onkeypress=function(g){if(d){d.call(this,g)}var f=(g||window.event);if(f.keyCode==9&&f.shiftKey){f.cancelBubble=true;b.selectCell((b.getRowsNum()-1),(b.getColumnCount()-1),0,0,1);if(b.smartTabOrder&&b.cells2((b.getRowsNum()-1),(b.getColumnCount()-1)).isDisabled()){b._key_events.k9_0_1.call(b)}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 d(g,h){this[g]=h}function f(g,h){this[g].call(this,h)}function c(g,h){this[g].call(this,h.join(this.delim))}function a(g,l){for(var j=0;j<l.length;j++){if(typeof l[j]=="object"){var m=this.getCombo(j);for(var h in l[j]){m.put(h,l[j][h])}}}}function e(g,r,n){var t=1;var q=[];function s(u,h,v){if(!q[h]){q[h]=[]}if(typeof v=="object"){v.toString=function(){return this.text}}q[h][u]=v}for(var o=0;o<r.length;o++){if(typeof(r[o])=="object"&&r[o].length){for(var m=0;m<r[o].length;m++){s(o,m,r[o][m])}}else{s(o,0,r[o])}}for(var o=0;o<q.length;o++){for(var m=0;m<q[0].length;m++){var p=q[o][m];q[o][m]=(p||"").toString()||"&nbsp;";if(p&&p.colspan){for(var l=1;l<p.colspan;l++){s(m+l,o,"#cspan")}}if(p&&p.rowspan){for(var l=1;l<p.rowspan;l++){s(m,o+l,"#rspan")}}}}this.setHeader(q[0]);for(var o=1;o<q.length;o++){this.attachHeader(q[o])}}var b=[{name:"label",def:"&nbsp;",operation:"setHeader",type:e},{name:"id",def:"",operation:"columnIds",type:d},{name:"width",def:"*",operation:"setInitWidths",type:c},{name:"align",def:"left",operation:"cellAlign",type:d},{name:"valign",def:"middle",operation:"cellVAlign",type:d},{name:"sort",def:"na",operation:"fldSort",type:d},{name:"type",def:"ro",operation:"setColTypes",type:c},{name:"options",def:"",operation:"",type:a}];dhtmlx.extend_api("dhtmlXGridObject",{_init:function(g){return[g.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(n){for(var g=0;g<b.length;g++){var m=[];for(var h=0;h<n.length;h++){m[h]=n[h][b[g].name]||b[g].def}var l=b[g].type||f;l.call(this,b[g].operation,m,n)}this.init()},rows:function(g){},headers:function(h){for(var g=0;g<h.length;g++){this.attachHeader(h[g])}}})})();dhtmlXGridObject.prototype._dp_init=function(a){a.attachEvent("insertCallback",function(b,d){if(this.obj._h2){this.obj.addRow(d,c,null,parent)}else{this.obj.addRow(d,[],0)}var c=this.obj.getRowById(d);if(c){this.obj._process_xml_row(c,b.firstChild);this.obj._postRowProcessing(c)}});a.attachEvent("updateCallback",function(b,d){var c=this.obj.getRowById(d);if(c){this.obj._process_xml_row(c,b.firstChild);this.obj._postRowProcessing(c)}});a.attachEvent("deleteCallback",function(b,c){this.obj.setUserData(c,this.action_param,"true_deleted");this.obj.deleteRow(c)});a._methods=["setRowTextStyle","setCellTextStyle","changeRowId","deleteRow"];this.attachEvent("onEditCell",function(d,e,c){if(a._columns&&!a._columns[c]){return true}var b=this.cells(e,c);if(d==1){if(b.isCheckbox()){a.setUpdated(e,true)}}else{if(d==2){if(b.wasChanged()){a.setUpdated(e,true)}}}return true});this.attachEvent("onRowPaste",function(b){a.setUpdated(b,true)});this.attachEvent("onUndo",function(b){a.setUpdated(b,true)});this.attachEvent("onRowIdChange",function(d,b){var c=a.findRow(d);if(c<a.updatedRows.length){a.updatedRows[c]=b}});this.attachEvent("onSelectStateChanged",function(b){if(a.updateMode=="row"){a.sendData()}return true});this.attachEvent("onEnter",function(c,b){if(a.updateMode=="row"){a.sendData()}return true});this.attachEvent("onBeforeRowDeleted",function(b){if(!this.rowsAr[b]){return true}if(this.dragContext&&a.dnd){window.setTimeout(function(){a.setUpdated(b,true)},1);return true}var c=a.getState(b);if(this._h2){this._h2.forEachChild(b,function(d){a.setUpdated(d.id,false);a.markRow(d.id,true,"deleted")},this)}if(c=="inserted"){a.set_invalid(b,false);a.setUpdated(b,false);return true}if(c=="deleted"){return false}if(c=="true_deleted"){a.setUpdated(b,false);return true}a.setUpdated(b,true,"deleted");return false});this.attachEvent("onBindUpdate",function(b){if(typeof b=="object"){b=b.id}a.setUpdated(b,true)});this.attachEvent("onRowAdded",function(b){if(this.dragContext&&a.dnd){return true}a.setUpdated(b,true,"inserted");return true});a._getRowData=function(d,n){var g=[];g.gr_id=d;if(this.obj.isTreeGrid()){g.gr_pid=this.obj.getParentId(d)}var b=this.obj.getRowById(d);for(var h=0;h<this.obj._cCount;h++){if(this.obj._c_order){var l=this.obj._c_order[h]}else{var l=h}var m=this.obj.cells(b.idd,h);if(this._changed&&!m.wasChanged()){continue}if(this._endnm){g[this.obj.getColumnId(h)]=m.getValue()}else{g["c"+l]=m.getValue()}}var e=this.obj.UserData[d];if(e){for(var f=0;f<e.keys.length;f++){if(e.keys[f]&&e.keys[f].indexOf("__")!=0){g[e.keys[f]]=e.values[f]}}}var e=this.obj.UserData.gridglobaluserdata;if(e){for(var f=0;f<e.keys.length;f++){g[e.keys[f]]=e.values[f]}}return g};a._clearUpdateFlag=function(c){var d=this.obj.getRowById(c);if(d){for(var b=0;b<this.obj._cCount;b++){this.obj.cells(c,b).cell.wasChanged=false}}};a.checkBeforeUpdate=function(f){var e=true;var b=[];for(var d=0;d<this.obj._cCount;d++){if(this.mandatoryFields[d]){var c=this.mandatoryFields[d].call(this.obj,this.obj.cells(f,d).getValue(),f,d);if(typeof c=="string"){this.messages.push(c);e=false}else{e&=c;b[d]=!c}}}if(!e){this.set_invalid(f,"invalid",b);this.setUpdated(f,false)}return e}};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.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA")){return this.cell.firstChild.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(b){fntAr=b.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(b){this.cell.style.color=b};this.setBgColor=function(b){if(b==""){b=null}this.cell.bgColor=b};this.setHorAlign=function(b){if(b.length==1){if(b=="c"){this.cell.style.textAlign="center"}else{if(b=="l"){this.cell.style.textAlign="left"}else{this.cell.style.textAlign="right"}}}else{this.cell.style.textAlign=b}};this.wasChanged=function(){if(this.cell.wasChanged){return true}else{return false}};this.isCheckbox=function(){var b=this.cell.firstChild;if(b&&b.tagName=="INPUT"){type=b.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(b){if(this.isCheckbox()){if(b!="true"&&b!=1){b=false}this.cell.firstChild.checked=b}};this.setDisabled=function(b){if(b!="true"&&b!=1){b=false}if(this.isCheckbox()){this.cell.firstChild.disabled=b;if(this.disabledF){this.disabledF(b)}}this.cell._disabled=b}}dhtmlXGridCellObject.prototype={getAttribute:function(a){return this.cell._attrs[a]},setAttribute:function(a,b){this.cell._attrs[a]=b},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(b,a){this.cell.innerHTML=b;this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,(arguments.length>1?a:b)])};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(d){var a=d;var c=0;var b=0;while(a.tagName!="BODY"){c+=a.offsetLeft;b+=a.offsetTop;a=a.offsetParent}return new Array(c,b)}}eXcell.prototype=new dhtmlXGridCellObject;function eXcell_ed(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){this.cell.atag=((!this.grid.multiLine)&&(_isKHTML||_isMacOS||_isFF))?"INPUT":"TEXTAREA";this.val=this.getValue();this.obj=document.createElement(this.cell.atag);this.obj.setAttribute("autocomplete","off");this.obj.style.height=(this.cell.offsetHeight-(_isIE?4:4))+"px";this.obj.className="dhx_combo_edit";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(b){(b||event).cancelBubble=true};this.obj.onmousedown=function(b){(b||event).cancelBubble=true};this.obj.value=this.val;this.cell.innerHTML="";this.cell.appendChild(this.obj);this.obj.onselectstart=function(b){if(!b){b=event}b.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(b){if(!b||b.toString()._dhx_trim()==""){b=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(b)}}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 b=this.obj.value;this.setValue(b);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(b){if((b==true)||(b==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(b){if(b===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(b){this.setValue(b.toString())};this.detach=function(){return this.val!=this.getValue()};this.edit=null}eXcell_ch.prototype=new eXcell;eXcell_ch.prototype.setValue=function(b){this.cell.style.verticalAlign="middle";if(b){b=b.toString()._dhx_trim();if((b=="false")||(b=="0")){b=""}}if(b){b="1";this.cell.chstate="1"}else{b="0";this.cell.chstate="0"}var a=this;this.setCValue("<img src='"+this.grid.imgURL+"item_chk"+b+".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(b){if((b==true)||(b==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(b){if(b===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(b){this.cell.style.verticalAlign="middle";if(b){b=b.toString()._dhx_trim();if((b=="false")||(b=="0")){b=""}}if(b){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;b="1";this.cell.chstate="1"}else{b="0";this.cell.chstate="0"}this.setCValue("<img src='"+this.grid.imgURL+"radio_chk"+b+".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(f){(f||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;if(_isFF){var b=document.createElement("DIV");b.appendChild(this.obj);b.style.overflow="auto";b.className="dhx_textarea";this.obj.style.margin="0px 0px 0px 0px";this.obj.style.border="0px";this.obj=b}document.body.appendChild(this.obj);if(_isOpera){this.obj.onkeypress=function(e){if(e.keyCode==9){return false}}}this.obj.onkeydown=function(g){var f=(g||event);if(f.keyCode==9){globalActiveDHTMLGridObject.entBox.focus();globalActiveDHTMLGridObject.doKey({keyCode:f.keyCode,shiftKey:f.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 d=200}else{var d=this.cell.offsetWidth}this.obj.style.width=d+(_isFF?18:16)+"px";if(_isFF){this.obj.firstChild.style.width=parseInt(this.obj.style.width)+"px";this.obj.firstChild.style.height=this.obj.offsetHeight-3+"px"}if(_isIE){this.obj.select();this.obj.value=this.obj.value}if(_isFF){this.obj.firstChild.focus()}else{this.obj.focus()}};this.detach=function(){var b="";if(_isFF){b=this.obj.firstChild.value}else{b=this.obj.value}if(b==""){this.cell._clearCell=true}else{this.cell._clearCell=false}this.setValue(b);document.body.removeChild(this.obj);this.obj=null;return this.val!=this.getValue()};this.getValue=function(){if(this.obj){if(_isFF){return this.obj.firstChild.value}else{return this.obj.value}}if(this.cell._clearCell){return""}if(typeof this.cell._brval!="undefined"){return this.cell._brval}if((!this.grid.multiLine)){return this.cell._brval||this.cell.innerHTML}else{return this.cell._brval||this.cell.innerHTML.replace(/<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(b){this.cell._brval=b;if(!b||b.toString()._dhx_trim()==""){b=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(b)}}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 b=this.list.options[this.list.selectedIndex+1];if(b){b.selected=true}this.obj.value=this.list.options[this.list.selectedIndex].text;return true};this.shiftPrev=function(){if(this.list.selectedIndex!=0){var b=this.list.options[this.list.selectedIndex-1];if(b){b.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 d=this.grid.getPosition(this.cell);this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_combo_edit";this.obj.style.height=(this.cell.offsetHeight-4)+"px";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(i){(i||event).cancelBubble=true};this.obj.onmousedown=function(i){(i||event).cancelBubble=true};this.obj.value=this.text;this.obj.onselectstart=function(i){if(!i){i=event}i.cancelBubble=true;return true};var f=this;this.obj.onkeyup=function(m){var l=(m||event).keyCode;if(l==38||l==40||l==9){return}var n=this.readonly?String.fromCharCode(l):this.value;var o=f.list.options;for(var j=0;j<o.length;j++){if(o[j].text.indexOf(n)==0){return o[j].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=d[0]+"px";this.list.style.top=d[1]+this.cell.offsetHeight+"px";this.list.onclick=function(l){var j=l||window.event;var i=j.target||j.srcElement;if(i.tagName=="OPTION"){i=i.parentNode}f.editable=false;f.grid.editStop();j.cancelBubble=true};var b=this.combo.getKeys();var e=false;var h=0;for(var c=0;c<b.length;c++){var g=this.combo.get(b[c]);this.list.options[this.list.options.length]=new Option(g,b[c]);if(b[c]==this.val){h=this.list.options.length-1;e=true}}if(e==false){this.list.options[this.list.options.length]=new Option(this.text,this.val===null?"":this.val);h=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[h].selected=true;if((!_isFF)||(this.editable)){this.obj.focus();this.obj.focus()}if(!this.editable){this.obj.style.visibility="hidden";this.list.focus();this.list.onkeydown=function(i){i=i||window.event;f.grid.setActive(true);if(i.keyCode<30){return f.grid.doKey({target:f.cell,keyCode:i.keyCode,shiftKey:i.shiftKey,ctrlKey:i.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 b=this.list.options[this.list.selectedIndex];if(b&&b.text==this.obj.value){this.setValue(this.list.value)}else{var c=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex));var d=c.values._dhx_find(this.obj.value);if(d!=-1){this.setValue(c.keys[d])}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(d){if(typeof(d)=="object"){var c=this.grid.xmlLoader.doXPath("./option",d);if(c.length){this.cell._combo=new dhtmlXGridComboObject()}for(var b=0;b<c.length;b++){this.cell._combo.put(c[b].getAttribute("value"),c[b].firstChild?c[b].firstChild.data:"")}d=d.firstChild.data}if((d||"").toString()._dhx_trim()==""){d=null}this.cell.combo_value=d;if(d!==null){var a=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(d);this.setCValue(a===null?d:a,d)}else{this.setCValue("&nbsp;",d)}};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(c){if(typeof(c)=="object"){var b=this.grid.xmlLoader.doXPath("./option",c);if(b.length){this.cell._combo=new dhtmlXGridComboObject()}for(var a=0;a<b.length;a++){this.cell._combo.put(b[a].getAttribute("value"),b[a].firstChild?b[a].firstChild.data:"")}c=c.firstChild.data}if((c||"").toString()._dhx_trim()==""){c=null}if(c!==null){this.setCTxtValue((this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(c)||c,c)}else{this.setCTxtValue(" ",c)}this.cell.combo_value=c};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(b){}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 c=this.grid.getPosition(this.cell);this.colorPanel(4,this.obj);document.body.appendChild(this.obj);this.obj.style.left=c[0]+"px";this.obj.style.zIndex=1000;this.obj.style.top=c[1]+this.cell.offsetHeight+"px"};this.toolDNum=function(c){if(c.length==1){c="0"+c}return c};this.colorPanel=function(m,q){var h=document.createElement("TABLE");q.appendChild(h);h.cellSpacing=0;h.editor_obj=this;h.style.cursor="default";h.onclick=function(n){var j=n||window.event;var c=j.target||j.srcElement;var i=c.parentNode.parentNode.parentNode.editor_obj;i.setValue(c._bg);i.grid.editStop()};var f=256/m;for(var g=0;g<=(256/f);g++){var d=h.insertRow(g);for(var l=0;l<=(256/f);l++){for(var e=0;e<=(256/f);e++){R=new Number(f*g)-(g==0?0:1);G=new Number(f*l)-(l==0?0:1);B=new Number(f*e)-(e==0?0:1);var p=this.toolDNum(R.toString(16))+""+this.toolDNum(G.toString(16))+""+this.toolDNum(B.toString(16));var o=d.insertCell(l);o.width="10px";o.innerHTML="&nbsp;";o.title=p.toUpperCase();o.style.backgroundColor="#"+p;o._bg="#"+p;if(this.val!=null&&"#"+p.toUpperCase()==this.val.toUpperCase()){o.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?this.cell.offsetHeight-2:16))+";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(b){}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 c=this.cell.firstChild.firstChild.src+(this.cell.titFl!=null?"^"+this.cell._brval:"");c+="^"+this.cell.lnk;if(this.cell.trg){c+="^"+this.cell.trg}return c}}};this.isDisabled=function(){return true}}eXcell_img.prototype=new eXcell;eXcell_img.prototype.getTitle=function(){return this.cell._brval};eXcell_img.prototype.setValue=function(c){var b=c;if((c||"").indexOf("^")!=-1){var a=c.split("^");c=a[0];b=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+(c||"")._dhx_trim()+"' border='0'>",c);if(this.cell.lnk){this.cell.innerHTML="<a href='"+this.cell.lnk+"' target='"+this.cell.trg+"'>"+this.cell.innerHTML+"</a>"}this.cell._brval=b};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(b){if(isNaN(parseFloat(b))){b=this.val||0}var a="green";if(b<0){a="red"}this.setCValue("<span>$</span><span style='padding-right:2px;color:"+a+";'>"+b+"</span>",b)};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(c){if(!c||isNaN(Number(c))){if(c!==""){c=0}}if(c>0){var b="green";var a="dyn_up.gif"}else{if(c==0){var b="black";var a="dyn_.gif"}else{var b="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:"+b+";'>"+c+"</span></div>",c)};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;function eXcell_ron(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return true};this.getValue=function(){return this.cell._clearCell?"":this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex).toString()}}eXcell_ron.prototype=new eXcell;eXcell_ron.prototype.setValue=function(a){if(a===0){}else{if(!a||a.toString()._dhx_trim()==""){this.setCValue("&nbsp;");return this.cell._clearCell=true}}this.cell._clearCell=false;this.setCValue(a?this.grid._aplNF(a,this.cell._cellIndex):"0")};function eXcell_rotxt(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return true};this.setValue=function(b){if(!b){b=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(b)};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(b,c){for(var a=0;a<this.keys.length;a++){if(this.keys[a]==b){this.values[a]=c;return true}}this.values[this.values.length]=c;this.keys[this.keys.length]=b};this.get=function(b){for(var a=0;a<this.keys.length;a++){if(this.keys[a]==b){return this.values[a]}}return null};this.clear=function(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray()};this.remove=function(b){for(var a=0;a<this.keys.length;a++){if(this.keys[a]==b){this.keys._dhx_removeAt(a);this.values._dhx_removeAt(a);return true}}};this.size=function(){var a=0;for(var b=0;b<this.keys.length;b++){if(this.keys[b]!=null){a++}}return a};this.getKeys=function(){var a=new Array(0);for(var b=0;b<this.keys.length;b++){if(this.keys[b]!=null){a[a.length]=this.keys[b]}}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;dhtmlXGridObject.prototype.enableDragAndDrop=function(a){if(a=="temporary_disabled"){this.dADTempOff=false;a=true}else{this.dADTempOff=true}this.dragAndDropOff=convertStringToBoolean(a);this._drag_validate=true;if(a){this.objBox.ondragstart=function(b){(b||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=convertStringToBoolean(a)};dhtmlXGridObject.prototype._checkParent=function(d,b){var c=this._h2.get[d.idd].parent;if(!c.parent){return}for(var a=0;a<b.length;a++){if(b[a]==c.id){return true}}return this._checkParent(this.rowsAr[c.id],b)};dhtmlXGridObject.prototype._createDragNode=function(c,d){this.editStop();if(window.dhtmlDragAndDrop.dragNode){return null}if(!this.dADTempOff){return null}c.parentObject=new Object();c.parentObject.treeNod=this;var j=this.callEvent("onBeforeDrag",[c.parentNode.idd,c._cellIndex,d]);if(!j){return null}var f=new Array();f=this.getSelectedId();f=(((f)&&(f!=""))?f.split(this.delim):[]);var g=false;for(var b=0;b<f.length;b++){if(f[b]==c.parentNode.idd){g=true}}if(!g){this.selectRow(this.rowsAr[c.parentNode.idd],false,d.ctrlKey,false);if(!d.ctrlKey){f=[]}f[this.selMultiRows?f.length:0]=c.parentNode.idd}if(this.isTreeGrid()){for(var b=f.length-1;b>=0;b--){if(this._checkParent(this.rowsAr[f[b]],f)){f.splice(b,1)}}}var l=this;if(f.length&&this._dndorder){f.sort(function(i,e){return(l.rowsAr[i].rowIndex>l.rowsAr[e].rowIndex?1:-1)})}var a=this.getFirstParentOfType(_isIE?d.srcElement:d.target,"TD");if(a){this._dndExtra=a._cellIndex}this._dragged=new Array();for(var b=0;b<f.length;b++){if(this.rowsAr[f[b]]){this._dragged[this._dragged.length]=this.rowsAr[f[b]];this.rowsAr[f[b]].treeNod=this}}c.parentObject.parentNode=c.parentNode;var h=document.createElement("div");h.innerHTML=(j!==true?j:this.rowToDragElement(c.parentNode.idd));h.style.position="absolute";h.className="dragSpanDiv";return h};dhtmlXGridObject.prototype._createSdrgc=function(){this._sdrgc=document.createElement("DIV");this._sdrgc.innerHTML="&nbsp;";this._sdrgc.className="gridDragLine";this.objBox.appendChild(this._sdrgc)};function dragContext(t,s,r,q,p,o,m,n,i,g){this.source=t||"grid";this.target=s||"grid";this.mode=r||"move";this.dropmode=q||"child";this.sid=p||0;this.tid=o;this.sobj=m||null;this.tobj=n||null;this.sExtra=i||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(d,c){this[d]=c;return this};dragContext.prototype.uid=function(d,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 b=this.tobj.rowsAr[this.tid];var a=this.tobj._h2.get[b.idd].parent.id;if((this.alfa)&&(this.tobj._sbmod)&&(b.nextSibling)){var c=this.tobj._h2.get[b.nextSibling.idd].parent.id;if(c==this.tid){return this.tid}if(c!=a){return c}}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 b=this.tobj.rowsAr[this.tid];if((b.nextSibling)&&(this._h2.get[b.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 b=new Array();for(var a=0;a<this.sid.length;a++){b[b.length]=this.sid[a][(this.source=="tree")?"id":"idd"]}return b.join(",")};dhtmlXGridObject.prototype._drag=function(m,e,l,n){if(this._realfake){return this._fake._drag()}var j=(this.lastLanding);if(this._autoOpenTimer){window.clearTimeout(this._autoOpenTimer)}var d=l.parentNode;var b=m.parentObject;if(!d.idd){d.grid=this;this.dadmodefix=0}var h=new dragContext(0,0,0,((d.grid.dadmode==1||d.grid.dadmodec)?"sibling":"child"));if(b&&b.childNodes){h.set("source","tree").set("sobj",b.treeNod).set("sid",h.sobj._dragged)}else{if(!b){return true}if(b.treeNod.isTreeGrid&&b.treeNod.isTreeGrid()){h.set("source","treeGrid")}h.set("sobj",b.treeNod).set("sid",h.sobj._dragged)}if(d.grid.isTreeGrid()){h.set("target","treeGrid")}else{h.set("dropmode","sibling")}h.set("tobj",d.grid).set("tid",d.idd);if(((h.tobj.dadmode==2)&&(h.tobj.dadmodec==1))&&(h.tobj.dadmodefix<0)){if(h.tobj.obj.rows[1].idd!=h.tid){h.tid=d.previousSibling.idd}else{h.tid=0}}var a=this.getFirstParentOfType(n,"TD");if(a){h.set("tExtra",a._cellIndex)}if(a){h.set("sExtra",h.sobj._dndExtra)}if(h.sobj.dpcpy){h.set("mode","copy")}if(h.tobj._realfake){h.tobj=h.tobj._fake}if(h.sobj._realfake){h.sobj=h.sobj._fake}h.tobj._clearMove();if(b&&b.treeNod&&b.treeNod._nonTrivialRow){b.treeNod._nonTrivialRow(this,h.tid,h.dropmode,b)}else{h.tobj.dragContext=h;if(!h.tobj.callEvent("onDrag",[h.slist(),h.tid,h.sobj,h.tobj,h.sExtra,h.tExtra])){return h.tobj.dragContext=null}var o=new Array();if(typeof(h.sid)=="object"){var g=h.copy();for(var f=0;f<h.sid.length;f++){if(!g.set("alfa",(!f)).set("sid",h.sid[f][(h.source=="tree"?"id":"idd")]).valid()){continue}g.tobj._dragRoutine(g);if(g.target=="treeGrid"&&g.dropmode=="child"){g.tobj.openItem(g.tid)}o[o.length]=g.nid;g.set("dropmode","sibling").set("tid",g.nid)}g.close()}else{h.tobj._dragRoutine(h)}if(h.tobj.laterLink){h.tobj.laterLink()}h.tobj.callEvent("onDrop",[h.slist(),h.tid,o.join(","),h.sobj,h.tobj,h.sExtra,h.tExtra])}h.tobj.dragContext=null;h.close()};dhtmlXGridObject.prototype._dragRoutine=function(m){if((m.sobj==m.tobj)&&(m.source=="grid")&&(m.mode=="move")&&!this._fake){if(m.sobj._dndProblematic){return}var h=m.sobj.rowsAr[m.sid];var i=m.sobj.rowsCol._dhx_find(h);m.sobj.rowsCol._dhx_removeAt(m.sobj.rowsCol._dhx_find(h));m.sobj.rowsBuffer._dhx_removeAt(m.sobj.rowsBuffer._dhx_find(h));m.sobj.rowsBuffer._dhx_insertAt(m.ind(),h);if(m.tobj._fake){m.tobj._fake.rowsCol._dhx_removeAt(i);var n=m.tobj._fake.rowsAr[m.sid];n.parentNode.removeChild(n)}m.sobj._insertRowAt(h,m.ind());m.nid=m.sid;m.sobj.callEvent("onGridReconstructed",[]);return}var g;if(this._h2&&typeof m.tid!="undefined"&&m.dropmode=="sibling"&&(this._sbmod||m.tid)){if(m.alfa&&this._sbmod&&this._h2.get[m.tid].childs.length){this.openItem(m.tid);g=m.uid().tobj.addRowBefore(m.nid,m.data(),this._h2.get[m.tid].childs[0].id,m.img(),m.childs())}else{g=m.uid().tobj.addRowAfter(m.nid,m.data(),m.tid,m.img(),m.childs())}}else{g=m.uid().tobj.addRow(m.nid,m.data(),m.ind(),m.pid(),m.img(),m.childs())}g._attrs=m.attrs();if(m.source=="tree"){this.callEvent("onRowAdded",[m.nid]);var a=m.sobj._globalIdStorageFind(m.sid);if(a.childsCount){var f=m.copy().set("tid",m.nid).set("dropmode",m.target=="grid"?"sibling":"child");for(var d=0;d<a.childsCount;d++){m.tobj._dragRoutine(f.set("sid",a.childNodes[d].id));if(m.mode=="move"){d--}}f.close()}}else{m.tobj._copyUserData(m);this.callEvent("onRowAdded",[m.nid]);if((m.source=="treeGrid")){if(m.sobj==m.tobj){g._xml=m.sobj.rowsAr[m.sid]._xml}var e=m.sobj._h2.get[m.sid];if((e)&&(e.childs.length)){var f=m.copy().set("tid",m.nid);if(m.target=="grid"){f.set("dropmode","sibling")}else{f.tobj.openItem(m.tid);f.set("dropmode","child")}var b=e.childs.length;for(var d=0;d<b;d++){m.sobj.render_row_tree(null,e.childs[d].id);m.tobj._dragRoutine(f.set("sid",e.childs[d].id));if(b!=e.childs.length){d--;b=e.childs.length}}f.close()}}}if(m.mode=="move"){m.sobj[(m.source=="tree")?"deleteItem":"deleteRow"](m.sid);if((m.sobj==m.tobj)&&(!m.tobj.rowsAr[m.sid])){m.tobj.changeRowId(m.nid,m.sid);m.nid=m.sid}}};dhtmlXGridObject.prototype.gridToGrid=function(d,a,c){var e=new Array();for(var b=0;b<a.hdr.rows[0].cells.length;b++){e[b]=a.cells(d,b).getValue()}return e};dhtmlXGridObject.prototype.checkParentLine=function(a,b){if((!this._h2)||(!b)||(!a)){return false}if(a.id==b){return true}else{return this.checkParentLine(a.parent,b)}};dhtmlXGridObject.prototype._dragIn=function(e,c,b,f){if(!this.dADTempOff){return 0}var a=this.isTreeGrid();var d=c.parentNode.idd?c.parentNode:c.parentObject;if(this._drag_validate){if(e.parentNode==c.parentNode){return 0}if((a)&&(this==d.grid)&&((this.checkParentLine(this._h2.get[e.parentNode.idd],c.parentNode.idd)))){return 0}}if(!this.callEvent("onDragIn",[d.idd||d.id,e.parentNode.idd,d.grid||d.treeNod,(e.grid||e.parentNode.grid)])){return this._setMove(e,b,f,true)}this._setMove(e,b,f);if((a)&&(e.parentNode.expand!="")){this._autoOpenTimer=window.setTimeout(new callerFunction(this._autoOpenItem,this),1000);this._autoOpenId=e.parentNode.idd}else{if(this._autoOpenTimer){window.clearTimeout(this._autoOpenTimer)}}return e};dhtmlXGridObject.prototype._autoOpenItem=function(a,b){b.openItem(b._autoOpenId)};dhtmlXGridObject.prototype._dragOut=function(b){this._clearMove();var a=b.parentNode.parentObject?b.parentObject.id:b.parentNode.idd;this.callEvent("onDragOut",[a]);if(this._autoOpenTimer){window.clearTimeout(this._autoOpenTimer)}};dhtmlXGridObject.prototype._setMove=function(f,b,h,e){if(!f.parentNode.idd){return}var c=getAbsoluteTop(f);var a=getAbsoluteTop(this.objBox);if((c-a)>(parseInt(this.objBox.offsetHeight)-50)){this.objBox.scrollTop=parseInt(this.objBox.scrollTop)+20}if((c-a+parseInt(this.objBox.scrollTop))<(parseInt(this.objBox.scrollTop)+30)){this.objBox.scrollTop=parseInt(this.objBox.scrollTop)-20}if(e){return 0}if(this.dadmode==2){var g=h-c+(document.body.scrollTop||document.documentElement.scrollTop)-2-f.offsetHeight/2;if((Math.abs(g)-f.offsetHeight/6)>0){this.dadmodec=1;if(g<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=c-a+parseInt(this.objBox.scrollTop)+((this.dadmodefix>=0)?f.offsetHeight:0)+"px"}else{this._llSelD=f;if(f.parentNode.tagName=="TR"){for(var d=0;d<f.parentNode.childNodes.length;d++){var g=f.parentNode.childNodes[d];g._bgCol=g.style.backgroundColor;g.style.backgroundColor="#FFCCCC"}}}};dhtmlXGridObject.prototype._clearMove=function(){if(this._sdrgc){this._sdrgc.style.display="none"}if((this._llSelD)&&(this._llSelD.parentNode.tagName=="TR")){var b=this._llSelD.parentNode.childNodes;for(var a=0;a<b.length;a++){b[a].style.backgroundColor=b[a]._bgCol}}this._llSelD=null};dhtmlXGridObject.prototype.rowToDragElement=function(a){var b=this.cells(a,0).getValue();return b};dhtmlXGridObject.prototype._copyUserData=function(d){if(!d.tobj.UserData[d.nid]||d.tobj!=d.sobj){d.tobj.UserData[d.nid]=new Hashtable()}else{return}var b=d.sobj.UserData[d.sid];var a=d.tobj.UserData[d.nid];if(b){a.keys=a.keys.concat(b.keys);a.values=a.values.concat(b.values)}};dhtmlXGridObject.prototype.moveRow=function(c,d,a,b){switch(d){case"row_sibling":this.moveRowTo(c,a,"move","sibling",this,b);break;case"up":this.moveRowUp(c);break;case"down":this.moveRowDown(c);break}};dhtmlXGridObject.prototype._nonTrivialNode=function(m,l,g,h,c){if((m.callEvent)&&(!c)){if(!m.callEvent("onDrag",[h.idd,l.id,(g?g.id:null),this,m])){return false}}var j=h.idd;var a=j;while(m._idpull[a]){a+=(new Date()).getMilliseconds().toString()}var e=(this.isTreeGrid()?this.getItemImage(j):"");if(g){for(d=0;d<l.childsCount;d++){if(l.childNodes[d]==g){break}}if(d!=0){g=l.childNodes[d-1]}else{st="TOP";g=""}}var b=m._attachChildNode(l,a,this.gridToTreeElement(m,a,j),"",e,e,e,"","",g);if(this._h2){var f=this._h2.get[j];if(f.childs.length){for(var d=0;d<f.childs.length;d++){this._nonTrivialNode(m,b,0,this.rowsAr[f.childs[d].id],1);if(!this.dpcpy){d--}}}}if(!this.dpcpy){this.deleteRow(j)}if((m.callEvent)&&(!c)){m.callEvent("onDrop",[a,l.id,(g?g.id:null),this,m])}};dhtmlXGridObject.prototype.gridToTreeElement=function(b,c,a){return this.cells(a,0).getValue()};dhtmlXGridObject.prototype.treeToGridElement=function(d,e,a){var b=new Array();var f=this.cellType._dhx_find("tree");if(f==-1){f=0}for(var c=0;c<this.getColumnCount();c++){b[b.length]=(c!=f)?(d.getUserData(e,this.getColumnId(c))||""):d.getItemText(e)}return b};dhtmlXGridObject.prototype.moveRowTo=function(d,b,g,f,a,e){var h=new dragContext((a||this).isTreeGrid()?"treeGrid":"grid",(e||this).isTreeGrid()?"treeGrid":"grid",g,f||"sibling",d,b,a||this,e||this);h.tobj._dragRoutine(h);h.close();return h.nid};dhtmlXGridObject.prototype.enableMercyDrag=function(a){this.dpcpy=convertStringToBoolean(a)};dhtmlXGridObject.prototype.toPDF=function(e,l,p,n,i,t){var f={row:this.getSelectedRowId(),col:this.getSelectedCellIndex()};if(f.row===null||f.col===-1){f=false}else{var b=this.cells(f.row,f.col).cell;b.parentNode.className=b.parentNode.className.replace(" rowselected","");b.className=b.className.replace(" cellselected","");f.el=b}l=l||"color";var q=l=="full_color";var a=this;a._asCDATA=true;if(typeof(t)==="undefined"){this.target=' target="_blank"'}else{this.target=t}eXcell_ch.prototype.getContent=function(){return this.getValue()};eXcell_ra.prototype.getContent=function(){return this.getValue()};function s(v){var A=[];for(var y=1;y<a.hdr.rows.length;y++){A[y]=[];for(var x=0;x<a._cCount;x++){var D=a.hdr.rows[y].childNodes[x];if(!A[y][x]){A[y][x]=[0,0]}if(D){A[y][D._cellIndexS]=[D.colSpan,D.rowSpan]}}}var z="<rows profile='"+v+"'";if(p){z+=" header='"+p+"'"}if(n){z+=" footer='"+n+"'"}z+="><head>"+a._serialiseExportConfig(A).replace(/^<head/,"<columns").replace(/head>$/,"columns>");for(var y=2;y<a.hdr.rows.length;y++){var d=0;var H=a.hdr.rows[y];var C="";for(var x=0;x<a._cCount;x++){if((a._srClmn&&!a._srClmn[x])||(a._hrrar[x]&&(!a._fake||x>=a._fake.hdrLabels.length))){d++;continue}var F=A[y][x];var E=((F[0]&&F[0]>1)?' colspan="'+F[0]+'" ':"");if(F[1]&&F[1]>1){E+=' rowspan="'+F[1]+'" ';d=-1}var u="";for(var w=0;w<H.cells.length;w++){if(H.cells[w]._cellIndexS==x){if(H.cells[w].getElementsByTagName("SELECT").length){u=""}else{u=_isIE?H.cells[w].innerText:H.cells[w].textContent}u=u.replace(/[ \n\r\t\xA0]+/," ");break}}if(!u||u==" "){d++}C+="<column"+E+"><![CDATA["+u+"]]></column>"}if(d!=a._cCount){z+="\n<columns>"+C+"</columns>"}}z+="</head>\n";z+=j();return z}function c(){var d=[];if(i){for(var u=0;u<i.length;u++){d.push(o(a.getRowIndex(i[u])))}}else{for(var u=0;u<a.getRowsNum();u++){d.push(o(u))}}return d.join("\n")}function j(){var v=["<foot>"];if(!a.ftr){return""}for(var w=1;w<a.ftr.rows.length;w++){v.push("<columns>");var z=a.ftr.rows[w];for(var u=0;u<a._cCount;u++){if(a._srClmn&&!a._srClmn[u]){continue}if(a._hrrar[u]&&(!a._fake||u>=a._fake.hdrLabels.length)){continue}for(var d=0;d<z.cells.length;d++){var y="";var x="";if(z.cells[d]._cellIndexS==u){y=_isIE?z.cells[d].innerText:z.cells[d].textContent;y=y.replace(/[ \n\r\t\xA0]+/," ");if(z.cells[d].colSpan&&z.cells[d].colSpan!=1){x=" colspan='"+z.cells[d].colSpan+"' "}if(z.cells[d].rowSpan&&z.cells[d].rowSpan!=1){x=" rowspan='"+z.cells[d].rowSpan+"' "}break}}v.push("<column"+x+"><![CDATA["+y+"]]></column>")}v.push("</columns>")}v.push("</foot>");return v.join("\n")}function h(u,d){return(window.getComputedStyle?(window.getComputedStyle(u,null)[d]):(u.currentStyle?u.currentStyle[d]:null))||""}function o(w){if(!a.rowsBuffer[w]){return""}var d=a.render_row(w);if(d.style.display=="none"){return""}var u=a.isTreeGrid()?' level="'+a.getLevel(d.idd)+'"':"";var A="<row"+u+">";for(var y=0;y<a._cCount;y++){if(((!a._srClmn)||(a._srClmn[y]))&&(!a._hrrar[y]||(a._fake&&y<a._fake.hdrLabels.length))){var F=a.cells(d.idd,y);if(q){var x=h(F.cell,"color");var E=h(F.cell,"backgroundColor");var D=h(F.cell,"font-weight")||h(F.cell,"fontWeight");var z=h(F.cell,"font-style")||h(F.cell,"fontStyle");var C=h(F.cell,"text-align")||h(F.cell,"textAlign");var v=h(F.cell,"font-family")||h(F.cell,"fontFamily");if(E=="transparent"||E=="rgba(0, 0, 0, 0)"){E="rgb(255,255,255)"}A+="<cell bgColor='"+E+"' textColor='"+x+"' bold='"+D+"' italic='"+z+"' align='"+C+"' font='"+v+"'>"}else{A+="<cell>"}A+="<![CDATA["+(F.getContent?F.getContent():F.getTitle())+"]]></cell>"}}return A+"</row>"}function m(){var d="</rows>";return d}var r=document.createElement("div");r.style.display="none";document.body.appendChild(r);var g="form_"+a.uid();r.innerHTML='<form id="'+g+'" method="post" action="'+e+'" accept-charset="utf-8"  enctype="application/x-www-form-urlencoded"'+this.target+'><input type="hidden" name="grid_xml" id="grid_xml"/> </form>';document.getElementById(g).firstChild.value=encodeURIComponent(s(l).replace("\u2013","-")+c()+m());document.getElementById(g).submit();r.parentNode.removeChild(r);a=null;if(f){f.el.parentNode.className+=" rowselected";f.el.className+=" cellselected"}f=null};dhtmlXGridObject.prototype._serialiseExportConfig=function(f){function e(i){if(typeof(i)!=="string"){return i}i=i.replace(/&/g,"&amp;");i=i.replace(/"/g,"&quot;");i=i.replace(/'/g,"&apos;");i=i.replace(/</g,"&lt;");i=i.replace(/>/g,"&gt;");return i}var b="<head>";for(var c=0;c<this.hdr.rows[0].cells.length;c++){if(this._srClmn&&!this._srClmn[c]){continue}if(this._hrrar[c]&&(!this._fake||c>=this._fake.hdrLabels.length)){continue}var d=this.fldSort[c];if(d=="cus"){d=this._customSorts[c].toString();d=d.replace(/function[\ ]*/,"").replace(/\([^\f]*/,"")}var l=f[1][c];var g=((l[1]&&l[1]>1)?' rowspan="'+l[1]+'" ':"")+((l[0]&&l[0]>1)?' colspan="'+l[0]+'" ':"");b+="<column "+g+" width='"+this.getColWidth(c)+"' align='"+this.cellAlign[c]+"' type='"+this.cellType[c]+"' hidden='"+((this.isColumnHidden&&this.isColumnHidden(c))?"true":"false")+"' sort='"+(d||"na")+"' color='"+(this.columnColor[c]||"")+"'"+(this.columnIds[c]?(" id='"+this.columnIds[c]+"'"):"")+">";if(this._asCDATA){b+="<![CDATA["+this.getHeaderCol(c)+"]]>"}else{b+=this.getHeaderCol(c)}var h=this.combos[c]?this.getCombo(c):null;if(h){for(var a=0;a<h.keys.length;a++){b+="<option value='"+e(h.keys[a])+"'><![CDATA["+h.values[a]+"]]></option>"}}b+="</column>"}return b+="</head>"};if(window.eXcell_sub_row_grid){window.eXcell_sub_row_grid.prototype.getContent=function(){return""}}dhtmlXGridObject.prototype.toExcel=function(a,d,g,f,b){if(!document.getElementById("ifr")){var e=document.createElement("iframe");e.style.display="none";e.setAttribute("name","dhx_export_iframe");e.setAttribute("src","");e.setAttribute("id","dhx_export_iframe");document.body.appendChild(e)}var c=' target="dhx_export_iframe"';this.toPDF(a,d,g,f,b,c)};dhtmlXGridObject.prototype.filterBy=function(c,e,b){if(this.isTreeGrid()){return this.filterTreeBy(c,e,b)}if(this._f_rowsBuffer){if(!b){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 f=true;this.dma(true);if(typeof(c)=="object"){for(var a=0;a<e.length;a++){this._filterA(c[a],e[a])}}else{this._filterA(c,e)}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(b,c){if(c==""){return}var e=true;if(typeof(c)=="function"){e=false}else{c=(c||"").toString().toLowerCase()}if(!this.rowsBuffer.length){return}for(var a=this.rowsBuffer.length-1;a>=0;a--){if(e?(this._get_cell_value(this.rowsBuffer[a],b).toString().toLowerCase().indexOf(c)==-1):(!c.call(this,this._get_cell_value(this.rowsBuffer[a],b),this.rowsBuffer[a].idd))){this.rowsBuffer.splice(a,1)}}};dhtmlXGridObject.prototype.getFilterElement=function(a){if(!this.filters){return}for(var b=0;b<this.filters.length;b++){if(this.filters[b][1]==a){return(this.filters[b][0].combo||this.filters[b][0])}}return null};dhtmlXGridObject.prototype.collectValues=function(e){var n=this.callEvent("onCollectValues",[e]);if(n!==true){return n}if(this.isTreeGrid()){return this.collectTreeValues(e)}this.dma(true);this._build_m_order();e=this._m_order?this._m_order[e]:e;var l={};var h=[];var b=this._f_rowsBuffer||this.rowsBuffer;for(var g=0;g<b.length;g++){var a=this._get_cell_value(b[g],e);if(a&&(!b[g]._childIndexes||b[g]._childIndexes[e]!=b[g]._childIndexes[e-1])){l[a]=true}}this.dma(false);var m=(this.combos[e]||(this._col_combos?this._col_combos[e]:false));for(var j in l){if(l[j]===true){if(m){if(m.get&&m.get(j)){j=m.get(j)}else{if(m.getOption&&m.getOption(j)){j=m.getOption(j).text}}}h.push(j)}}return h.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 d=[];var c=[];this._build_m_order();for(var e=0;e<this.filters.length;e++){var g=this._m_order?this._m_order[this.filters[e][1]]:this.filters[e][1];if(g>=this._cCount){continue}c.push(g);var h=this.filters[e][0].old_value=this.filters[e][0].value;if(this.filters[e][0]._filter){h=this.filters[e][0]._filter()}var f;if(typeof h!="function"&&(f=(this.combos[g]||(this._col_combos?this._col_combos[g]:false)))){if(f.values){g=f.values._dhx_find(h);h=(g==-1)?h:f.keys[g]}else{if(f.getOptionByLabel){h=(f.getOptionByLabel(h)?f.getOptionByLabel(h).value:h)}}}d.push(h)}if(!this.callEvent("onFilterStart",[c,d])){return}this.filterBy(c,d);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(e,c,b){if(!this.filters){this.filters=[]}if(typeof(e)!="object"){e=document.getElementById(e)}if(!e){return}var a=this;if(!e.style.width){e.style.width="90%"}if(e.tagName=="SELECT"){this.filters.push([e,c]);this._loadSelectOptins(e,c);e.onchange=function(){a.filterByAll()};if(_isIE){e.style.marginTop="1px"}this.attachEvent("onEditCell",function(g,f,h){this._build_m_order();if(g==2&&this.filters&&(this._m_order?(h==this._m_order[c]):(h==c))){this._loadSelectOptins(e,c)}return true})}else{if(e.tagName=="INPUT"){this.filters.push([e,c]);e.old_value=e.value="";e.onkeydown=function(){if(this._timer){window.clearTimeout(this._timer)}this._timer=window.setTimeout(function(){if(e.value!=e.old_value){a.filterByAll();e.old_value=e.value}},500)}}else{if(e.tagName=="DIV"&&e.className=="combo"){this.filters.push([e,c]);e.style.padding="0px";e.style.margin="0px";if(!window.dhx_globalImgPath){window.dhx_globalImgPath=this.imgURL}var d=new dhtmlXCombo(e,"_filter","90%");d.filterSelfA=d.filterSelf;d.filterSelf=function(){if(this.getSelectedIndex()==0){this.setComboText("")}this.filterSelfA.apply(this,arguments);this.optionsArr[0].hide(false)};d.enableFilteringMode(true);e.combo=d;e.value="";this._loadComboOptins(e,c);d.attachEvent("onChange",function(){e.value=d.getSelectedValue();if(e.value===null){e.value=""}a.filterByAll()})}}}if(e.parentNode){e.parentNode.className+=" filter"}this._filters_ready()};dhtmlXGridObject.prototype.findCell=function(f,g,d,e){var e=e||(function(i,h){return h.toString().toLowerCase().indexOf(i)!=-1});if(e===true){e=function(i,h){return h.toString().toLowerCase()==i}}var c=new Array();f=f.toString().toLowerCase();if(typeof d!="number"){d=d?1:0}if(!this.rowsBuffer.length){return c}for(var b=(g||0);b<this._cCount;b++){if(this._h2){this._h2.forEachChild(0,function(h){if(d&&c.length==d){return c}if(e(f,this._get_cell_value(h.buff,b))){c.push([h.id,b])}},this)}else{for(var a=0;a<this.rowsBuffer.length;a++){if(e(f,this._get_cell_value(this.rowsBuffer[a],b))){c.push([this.rowsBuffer[a].idd,b]);if(d&&c.length==d){return c}}}}if(typeof(g)!="undefined"){return c}}return c};dhtmlXGridObject.prototype.makeSearch=function(d,c,a){if(typeof(d)!="object"){d=document.getElementById(d)}if(!d){return}var b=this;if(d.tagName=="INPUT"){d.onkeypress=function(){if(this._timer){window.clearTimeout(this._timer)}this._timer=window.setTimeout(function(){if(d.value==""){return}var e=b.findCell(d.value,c,true,a);if(e.length){if(b._h2){b.openItem(e[0][0])}b.selectCell(b.getRowIndex(e[0][0]),(c||0))}},500)}}if(d.parentNode){d.parentNode.className+=" filter"}};dhtmlXGridObject.prototype._loadSelectOptins=function(e,h){var a=this.collectValues(h);var b=e.value;e.innerHTML="";e.options[0]=new Option("","");var g=this._filter_tr?this._filter_tr[h]:null;for(var d=0;d<a.length;d++){e.options[e.options.length]=new Option(g?g(a[d]):a[d],a[d])}e.value=b};dhtmlXGridObject.prototype.setSelectFilterLabel=function(b,a){if(!this._filter_tr){this._filter_tr=[]}this._filter_tr[b]=a};dhtmlXGridObject.prototype._loadComboOptins=function(d,f){if(!d.combo){return}var a=this.collectValues(f);d.combo.clearAll();var e=[["","&nbsp;"]];for(var b=0;b<a.length;b++){e.push([a[b],a[b]])}d.combo.addOption(e)};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(b,a){this.attachEvent("onXLE",this.refreshFilters);this.attachEvent("onRowCreated",function(e,d){if(this._f_rowsBuffer){for(var c=0;c<this._f_rowsBuffer.length;c++){if(this._f_rowsBuffer[c].idd==e){return this._f_rowsBuffer[c]=d}}}});this.attachEvent("onClearAll",function(){this._f_rowsBuffer=null;if(!this.hdr.rows.length){this.filters=[]}});this._filters_ready=function(){}};dhtmlXGridObject.prototype._in_header_text_filter=function(b,a){b.innerHTML="<input type='text'>";b.onclick=b.onmousedown=function(c){(c||event).cancelBubble=true;return true};b.onselectstart=function(){return(event.cancelBubble=true)};this.makeFilter(b.firstChild,a)};dhtmlXGridObject.prototype._in_header_text_filter_inc=function(b,a){b.innerHTML="<input type='text'>";b.onclick=b.onmousedown=function(c){(c||event).cancelBubble=true;return true};b.onselectstart=function(){return(event.cancelBubble=true)};this.makeFilter(b.firstChild,a);b.firstChild._filter=function(){if(b.firstChild.value==""){return""}return function(c){return(c.toString().toLowerCase().indexOf(b.firstChild.value.toLowerCase())==0)}};this._filters_ready()};dhtmlXGridObject.prototype._in_header_select_filter=function(b,a){b.innerHTML="<select></select>";b.onclick=function(c){(c||event).cancelBubble=true;return false};this.makeFilter(b.firstChild,a)};dhtmlXGridObject.prototype._in_header_select_filter_strict=function(c,b){c.innerHTML="<select style='width:90%; font-size:8pt; font-family:Tahoma;'></select>";c.onclick=function(d){(d||event).cancelBubble=true;return false};this.makeFilter(c.firstChild,b);var a=this.combos;c.firstChild._filter=function(){var d=c.firstChild.value;if(!d){return""}if(a[b]){d=a[b].keys[a[b].values._dhx_find(d)]}d=d.toLowerCase();return function(e){return(e.toString().toLowerCase()==d)}};this._filters_ready()};dhtmlXGridObject.prototype._in_header_combo_filter=function(b,a){b.innerHTML="<div style='width:100%; padding-left:2px; overflow:hidden; ' class='combo'></div>";b.onselectstart=function(){return(event.cancelBubble=true)};b.onclick=b.onmousedown=function(c){(c||event).cancelBubble=true;return true};this.makeFilter(b.firstChild,a)};dhtmlXGridObject.prototype._search_common=function(b,a){b.innerHTML="<input type='text' style='width:90%; '>";b.onclick=b.onmousedown=function(c){(c||event).cancelBubble=true;return true};b.onselectstart=function(){return(event.cancelBubble=true)}};dhtmlXGridObject.prototype._in_header_text_search=function(c,b,a){this._search_common(c,b);this.makeSearch(c.firstChild,b)};dhtmlXGridObject.prototype._in_header_text_search_strict=function(b,a){this._search_common(b,a);this.makeSearch(b.firstChild,a,true)};dhtmlXGridObject.prototype._in_header_numeric_filter=function(b,a){this._in_header_text_filter.call(this,b,a);b.firstChild._filter=function(){var c=this.value;var e;var g="==";var d=parseFloat(c.replace("=",""));var f=null;if(c){if(c.indexOf("..")!=-1){c=c.split("..");d=parseFloat(c[0]);f=parseFloat(c[1]);return function(h){if(h>=d&&h<=f){return true}return false}}e=c.match(/>=|<=|>|</);if(e){g=e[0];d=parseFloat(c.replace(g,""))}return Function("v"," if (v "+g+" "+d+" ) return true; return false;")}return""}};dhtmlXGridObject.prototype._in_header_master_checkbox=function(d,b,e){d.innerHTML=e[0]+"<input type='checkbox' />"+e[1];var a=this;d.getElementsByTagName("input")[0].onclick=function(f){a._build_m_order();var c=a._m_order?a._m_order[b]:b;var g=this.checked?1:0;a.forEachRowA(function(i){var h=this.cells(i,c);if(h.isCheckbox()){h.setValue(g);h.cell.wasChanged=true}this.callEvent("onEditCell",[1,i,c,g]);this.callEvent("onCheckbox",[i,c,g])});(f||event).cancelBubble=true}};dhtmlXGridObject.prototype._in_header_stat_total=function(b,a,e){var d=function(){var h=0;this._build_m_order();var g=this._m_order?this._m_order[a]:a;for(var f=0;f<this.rowsBuffer.length;f++){var c=parseFloat(this._get_cell_value(this.rowsBuffer[f],g));h+=isNaN(c)?0:c}return this._maskArr[g]?this._aplNF(h,g):(Math.round(h*100)/100)};this._stat_in_header(b,d,a,e,e)};dhtmlXGridObject.prototype._in_header_stat_multi_total=function(e,d,j){var h=j[1].split(":");j[1]="";for(var b=0;b<h.length;b++){h[b]=parseInt(h[b])}var f=function(){var m=0;for(var l=0;l<this.rowsBuffer.length;l++){var i=1;for(var c=0;c<h.length;c++){i*=parseFloat(this._get_cell_value(this.rowsBuffer[l],h[c]))}m+=isNaN(i)?0:i}return this._maskArr[d]?this._aplNF(m,d):(Math.round(m*100)/100)};var a=[];for(var g=0;g<h.length;g++){a[h[g]]=true}this._stat_in_header(e,f,a,j,j)};dhtmlXGridObject.prototype._in_header_stat_max=function(b,a,e){var d=function(){this._build_m_order();var f=this._m_order?this._m_order[a]:a;var g=-999999999;if(this.getRowsNum()==0){return"&nbsp;"}for(var c=0;c<this.rowsBuffer.length;c++){g=Math.max(g,parseFloat(this._get_cell_value(this.rowsBuffer[c],f)))}return this._maskArr[a]?this._aplNF(g,a):g};this._stat_in_header(b,d,a,e)};dhtmlXGridObject.prototype._in_header_stat_min=function(b,a,e){var d=function(){this._build_m_order();var f=this._m_order?this._m_order[a]:a;var g=999999999;if(this.getRowsNum()==0){return"&nbsp;"}for(var c=0;c<this.rowsBuffer.length;c++){g=Math.min(g,parseFloat(this._get_cell_value(this.rowsBuffer[c],f)))}return this._maskArr[a]?this._aplNF(g,a):g};this._stat_in_header(b,d,a,e)};dhtmlXGridObject.prototype._in_header_stat_average=function(b,a,e){var d=function(){this._build_m_order();var g=this._m_order?this._m_order[a]:a;var i=0;var h=0;if(this.getRowsNum()==0){return"&nbsp;"}for(var f=0;f<this.rowsBuffer.length;f++){var c=parseFloat(this._get_cell_value(this.rowsBuffer[f],g));i+=isNaN(c)?0:c;h++}return this._maskArr[a]?this._aplNF(i/h,a):(Math.round(i/h*100)/100)};this._stat_in_header(b,d,a,e)};dhtmlXGridObject.prototype._in_header_stat_count=function(b,a,e){var d=function(){return this.getRowsNum()};this._stat_in_header(b,d,a,e)};dhtmlXGridObject.prototype._stat_in_header=function(b,d,a,h){var e=this;var g=function(){this.dma(true);b.innerHTML=(h[0]?h[0]:"")+d.call(this)+(h[1]?h[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 f=0;f<this._stat_events.length;f++){for(var c=0;c<4;c++){this.detachEvent(this._stat_events[f][c])}}this._stat_events=[]}})}this._stat_events.push([this.attachEvent("onGridReconstructed",g),this.attachEvent("onXLE",g),this.attachEvent("onFilterEnd",g),this.attachEvent("onEditCell",function(c,i,f){if(c==2&&(f==a||(a&&a[f]))){g.call(this)}return true})]);b.innerHTML=""};dhtmlXGridObject.prototype.loadCSVFile=function(b,a){this.load(b,a,"csv")};dhtmlXGridObject.prototype.enableCSVAutoID=function(a){this._csvAID=convertStringToBoolean(a)};dhtmlXGridObject.prototype.enableCSVHeader=function(a){this._csvHdr=convertStringToBoolean(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(h){this.editStop();if(this._mathSerialization){this._agetm="getMathValue"}else{if(this._strictText||h){this._agetm="getTitle"}else{this._agetm="getValue"}}var f=[];if(this._csvHdr){for(var e=1;e<this.hdr.rows.length;e++){var b=[];for(var g=0;g<this._cCount;g++){if((!this._srClmn)||(this._srClmn[g])){b.push(this.getColumnLabel(g,e-1))}}f.push(this.csvParser.str(b,this.csv.cell,this.csv.row))}}var g=0;var d=this.rowsBuffer.length;for(g;g<d;g++){var c=this._serializeRowToCVS(null,g);if(c!=""){f.push(c)}}return this.csvParser.block(f,this.csv.row)};dhtmlXGridObject.prototype._serializeRowToCVS=function(a,j,c,g){var h=new Array();if(!a){a=this.render_row(j);if(this._fake&&!this._fake.rowsAr[a.idd]){this._fake.render_row(j)}}if(!this._csvAID){h[h.length]=a.idd}c=c||0;g=g||this._cCount;var m=false;var d=c;while(a.childNodes[c]._cellIndex>d&&c){c--}for(var l=c;d<g;l++){if(!a.childNodes[l]){break}var b=a.childNodes[l]._cellIndex;if(((!this._srClmn)||(this._srClmn[b]))&&(!this._serialize_visible||!this._hrrar[b])){var e=a.childNodes[l];var f=this.cells(a.idd,b);while(d!=b){d++;h.push("");if(d>=g){break}}if(d>=g){break}d++;if(f.cell){zxVal=f[this._agetm]()}else{zxVal=""}if((this._chAttr)&&(f.wasChanged())){m=true}h[h.length]=((zxVal===null)?"":zxVal);if(this._ecspn&&e.colSpan&&e.colSpan>1){e=e.colSpan-1;for(var n=0;n<e;n++){h[h.length]="";d++}}}else{d++}}if((this._onlChAttr)&&(!m)){return""}return this.csvParser.str(h,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(c,b){if((!c)||(!b)){if(!this.selectedRows[0]){return}c=this.selectedRows[0].idd;b=this.cell._cellIndex}var a=this.cells(c,b);this.toClipBoard(((a.getLabel?a.getLabel():a.getValue())||"").toString())};dhtmlXGridObject.prototype.updateCellFromClipboard=function(c,b){if((!c)||(!b)){if(!this.selectedRows[0]){return}c=this.selectedRows[0].idd;b=this.cell._cellIndex}var a=this.cells(c,b);a[a.setImage?"setLabel":"setValue"](this.fromClipBoard())};dhtmlXGridObject.prototype.rowToClipboard=function(d){var a="";if(this._mathSerialization){this._agetm="getMathValue"}else{if(this._strictText){this._agetm="getTitle"}else{this._agetm="getValue"}}this._serialize_visible=true;if(d){a=this._serializeRowToCVS(this.getRowById(d))}else{var c=[];for(var b=0;b<this.selectedRows.length;b++){c[c.length]=this._serializeRowToCVS(this.selectedRows[b]);a=this.csvParser.block(c,this.csv.row)}}this._serialize_visible=false;this.toClipBoard(a)};dhtmlXGridObject.prototype.updateRowFromClipboard=function(e){var a=this.fromClipBoard();if(!a){return}if(e){var d=this.getRowById(e)}else{var d=this.selectedRows[0]}if(!d){return}var f=this.csvParser;a=f.unblock(a,this.csv.cell,this.csv.row)[0];if(!this._csvAID){a.splice(0,1)}for(var c=0;c<a.length;c++){var b=this.cells3(d,c);b[b.setImage?"setLabel":"setValue"](a[c])}};dhtmlXGridObject.prototype.csvParser={block:function(a,b){return a.join(b)},unblock:function(f,a,e){var d=(f||"").split(e);for(var b=0;b<d.length;b++){d[b]=(d[b]||"").split(a)}var c=d.length-1;if(d[c].length==1&&d[c][0]==""){d.splice(c,1)}return d},str:function(b,a,c){return b.join(a)}};dhtmlXGridObject.prototype.csvExtParser={_quote:RegExp('"',"g"),_quote_esc:RegExp('\\\\"',"g"),block:function(a,b){return a.join(b)},unblock:function(h,m,o){var c=[[]];var b=0;if(!h){return c}var j=/^[ ]*"/;var g=/"[ ]*$/;var a=new RegExp(".*"+o+".*$");var e=h.split(m);for(var d=0;d<e.length;d++){if(e[d].match(j)){var n=e[d].replace(j,"");while(!e[d].match(g)){d++;n+=e[d]}c[b].push(n.replace(g,"").replace(this._quote_esc,'"'))}else{if(e[d].match(a)){var f=e[d].indexOf(o);c[b].push(e[d].substr(0,f));b++;c[b]=[];e[d]=e[d].substr(f+1);d--}else{if(e[d]||d!=e.length-1){c[b].push(e[d])}}}}var l=c.length-1;if(l>0&&!c[l].length){c.splice(l,1)}return c},str:function(c,a,d){for(var b=0;b<c.length;b++){c[b]='"'+c[b].replace(this._quote,'\\"')+'"'}return c.join(a)}};dhtmlXGridObject.prototype.addRowFromClipboard=function(){var a=this.fromClipBoard();if(!a){return}var c=this.csvParser.unblock(a,this.csv.cell,this.csv.row);for(var b=0;b<c.length;b++){if(c[b]){a=c[b];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(f){if(!this.xslform){this.xslform=document.createElement("FORM");this.xslform.action=(f||"")+"xls.php";this.xslform.method="post";this.xslform.target=(_isIE?"_blank":"");document.body.appendChild(this.xslform);var e=document.createElement("INPUT");e.type="hidden";e.name="csv";this.xslform.appendChild(e);var d=document.createElement("INPUT");d.type="hidden";d.name="csv_header";this.xslform.appendChild(d)}var g=this.serializeToCSV();this.xslform.childNodes[0].value=g;var c=[];var a=this._cCount;for(var b=0;b<a;b++){c.push(this.getHeaderCol(b))}c=c.join(",");this.xslform.childNodes[1].value=c;this.xslform.submit()};dhtmlXGridObject.prototype.printView=function(o,b){var m="<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 v=null;if(this._fake){v=[].concat(this._hrrar);for(var u=0;u<this._fake._cCount;u++){this._hrrar[u]=null}}m+="<base  href='"+document.location.href+"'></base>";if(!this.parentGrid){m+=(o||"")}m+='<table width="100%" border="2px" cellpadding="0" cellspacing="0">';var n=Math.max(this.rowsBuffer.length,this.rowsCol.length);var l=this._cCount;var p=this._printWidth();m+='<tr class="header_row_1">';for(var u=0;u<l;u++){if(this._hrrar&&this._hrrar[u]){continue}var f=this.hdr.rows[1].cells[this.hdr.rows[1]._childIndexes?this.hdr.rows[1]._childIndexes[parseInt(u)]:u];var a=(f.colSpan||1);var z=(f.rowSpan||1);for(var t=1;t<a;t++){p[u]+=p[t]}m+='<td rowspan="'+z+'" width="'+p[u]+'%" style="background-color:lightgrey;" colspan="'+a+'">'+this.getHeaderCol(u)+"</td>";u+=a-1}m+="</tr>";for(var u=2;u<this.hdr.rows.length;u++){if(_isIE){m+="<tr style='background-color:lightgrey' class='header_row_"+u+"'>";var e=this.hdr.rows[u].childNodes;for(var t=0;t<e.length;t++){if(!this._hrrar||!this._hrrar[e[t]._cellIndex]){m+=e[t].outerHTML}}m+="</tr>"}else{m+="<tr class='header_row_"+u+"' style='background-color:lightgrey'>"+(this._fake?this._fake.hdr.rows[u].innerHTML:"")+this.hdr.rows[u].innerHTML+"</tr>"}}for(var u=0;u<n;u++){m+="<tr>";if(this.rowsCol[u]&&this.rowsCol[u]._cntr){m+=this.rowsCol[u].innerHTML.replace(/<img[^>]*>/gi,"")+"</tr>";continue}if(this.rowsCol[u]&&this.rowsCol[u].style.display=="none"){continue}var h;if(this.rowsCol[u]){h=this.rowsCol[u].idd}else{if(this.rowsBuffer[u]){h=this.rowsBuffer[u].idd}else{continue}}for(var t=0;t<l;t++){if(this._hrrar&&this._hrrar[t]){continue}if(this.rowsAr[h]&&this.rowsAr[h].tagName=="TR"){var y=this.cells(h,t);if(y._setState){var q=""}else{if(y.getContent){q=y.getContent()}else{if(y.getImage||y.combo){var q=y.cell.innerHTML}else{var q=y.getValue()}}}}else{var q=this._get_cell_value(this.rowsBuffer[u],t)}var r=this.columnColor[t]?"background-color:"+this.columnColor[t]+";":"";var s=this.cellAlign[t]?"text-align:"+this.cellAlign[t]+";":"";var w=y.getAttribute("colspan");m+='<td style="'+r+s+'" '+(w?'colSpan="'+w+'"':"")+">"+(q===""?"&nbsp;":q)+"</td>";if(w){t+=w-1}}m+="</tr>";if(this.rowsCol[u]&&this.rowsCol[u]._expanded){var g=this.cells4(this.rowsCol[u]._expanded.ctrl);if(g.getSubGrid){m+='<tr><td colspan="'+l+'">'+g.getSubGrid().printView()+"</td></tr>"}else{m+='<tr><td colspan="'+l+'">'+this.rowsCol[u]._expanded.innerHTML+"</td></tr>"}}}if(this.ftr){for(var u=1;u<this.ftr.childNodes[0].rows.length;u++){m+="<tr style='background-color:lightgrey'>"+((this._fake)?this._fake.ftr.childNodes[0].rows[u].innerHTML:"")+this.ftr.childNodes[0].rows[u].innerHTML+"</tr>"}}m+="</table>";if(this.parentGrid){return m}m+=(b||"");var x=window.open("","_blank");x.document.write(m);x.document.write("<script>window.onerror=function(){return true;}<\/script>");x.document.close();if(this._fake){this._hrrar=v}};dhtmlXGridObject.prototype._printWidth=function(){var e=[];var d=0;for(var c=0;c<this._cCount;c++){var a=this.getColWidth(c);e.push(a);d+=a}var g=[];var b=0;for(var c=0;c<e.length;c++){var f=Math.floor((e[c]/d)*100);b+=f;g.push(f)}g[g.length-1]+=100-b;return g};if(!window.clipboardData){window.clipboardData={_make:function(){var b=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(!b){return null}var a=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(!a){return null}a.addDataFlavor("text/unicode");var c=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);this._p=[b,a,c];return true},setData:function(a,d){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(c){dhtmlxError.throwError("Clipboard","Access to clipboard denied",[a,d]);return""}if(!this._make()){return false}this._p[2].data=d;this._p[1].setTransferData("text/unicode",this._p[2],d.length*2);var b=Components.interfaces.nsIClipboard;this._p[0].setData(this._p[1],null,b.kGlobalClipboard)},getData:function(a){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(c){dhtmlxError.throwError("Clipboard","Access to clipboard denied",[a]);return""}if(!this._make()){return false}this._p[0].getData(this._p[1],this._p[0].kGlobalClipboard);var b=new Object();var d=new Object();try{this._p[1].getTransferData("text/unicode",d,b)}catch(c){return""}if(d){d=d.value.QueryInterface(Components.interfaces.nsISupportsString)}if(d){return d.data.substring(0,b.value/2)}return""}}}dhtmlXGridObject.prototype.enableBlockSelection=function(c){if(typeof this._bs_mode=="undefined"){var a=this;this.obj.onmousedown=function(d){if(a._bs_mode){a._OnSelectionStart((d||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(c===false){this._bs_mode=false;return this._HideSelection()}else{this._bs_mode=true}var b=this._clip_area=document.createElement("textarea");b.style.cssText="position:absolute; width:1px; height:1px; overflow:hidden; color:transparent; background-color:transparent; bottom:1px; right:1px; border:none;";b.onkeydown=function(d){d=d||event;if(d.keyCode==86&&(d.ctrlKey||d.metaKey)){a.pasteBlockFromClipboard()}};document.body.insertBefore(this._clip_area,document.body.firstChild);dhtmlxEvent(this.entBox,"click",function(){if(!a.editor){a._clip_area.select()}})};dhtmlXGridObject.prototype.forceLabelSelection=function(a){this._strictText=convertStringToBoolean(a)};dhtmlXGridObject.prototype._OnSelectionStart=function(c,d){var b=this;if(c.button==2){return}var e=c.srcElement||c.target;if(this.editor){if(e.tagName&&(e.tagName=="INPUT"||e.tagName=="TEXTAREA")){return}this.editStop()}b.setActive(true);var g=this.getPosition(this.obj);var a=c.clientX-g[0]+(document.body.scrollLeft||(document.documentElement?document.documentElement.scrollLeft:0));var f=c.clientY-g[1]+(document.body.scrollTop||(document.documentElement?document.documentElement.scrollTop:0));this._CreateSelection(a-4,f-4);if(e==this._selectionObj){this._HideSelection();this._startSelectionCell=null}else{while(e&&(!e.tagName||e.tagName.toLowerCase()!="td")){e=e.parentNode}this._startSelectionCell=e}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(h){if(b._blsTimer){window.clearTimeout(b._blsTimer)}};this.obj.onmmold=this.obj.onmousemove;this._init_pos=[a,f];this._selectionObj.onmousemove=this.obj.onmousemove=function(h){h=h||c;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}b._OnSelectionMove(h)};this._oldDMP=document.body.onmouseup;document.body.onmouseup=function(h){h=h||c;b._OnSelectionStop(h,this);return true};this.callEvent("onBeforeBlockSelection",[]);document.body.onselectstart=function(){return false}};dhtmlXGridObject.prototype._getCellByPos=function(a,d){a=a;if(this._fake){a+=this._fake.objBox.scrollWidth}d=d;var b=0;for(var c=0;c<this.obj.rows.length;c++){d-=this.obj.rows[c].offsetHeight;if(d<=0){b=this.obj.rows[c];break}}if(!b||!b.idd){return null}for(var c=0;c<this._cCount;c++){a-=this.getColWidth(c);if(a<=0){while(true){if(b._childIndexes&&b._childIndexes[c+1]==b._childIndexes[c]){b=b.previousSibling}else{return this.cells(b.idd,c).cell}}}}return null};dhtmlXGridObject.prototype._OnSelectionMove=function(e){var q=this;this._ShowSelection();var m=this.getPosition(this.obj);var h=e.clientX-m[0]+(document.body.scrollLeft||(document.documentElement?document.documentElement.scrollLeft:0));var g=e.clientY-m[1]+(document.body.scrollTop||(document.documentElement?document.documentElement.scrollTop:0));if((Math.abs(this._init_pos[0]-h)<5)&&(Math.abs(this._init_pos[1]-g)<5)){return this._HideSelection()}var o=this._endSelectionCell;if(this._startSelectionCell==null){this._endSelectionCell=this._startSelectionCell=this.getFirstParentOfType(e.srcElement||e.target,"TD")}else{if(e.srcElement||e.target){if((e.srcElement||e.target).className=="dhtmlxGrid_selection"){this._endSelectionCell=(this._getCellByPos(h,g)||this._endSelectionCell)}else{var p=this.getFirstParentOfType(e.srcElement||e.target,"TD");if(p.parentNode.idd){this._endSelectionCell=p}}}}if(this._endSelectionCell){if(!this.callEvent("onBeforeBlockSelected",[this._endSelectionCell.parentNode.idd,this._endSelectionCell._cellIndex])){this._endSelectionCell=o}}var f=this.objBox.scrollLeft+this.objBox.clientWidth;var c=this.objBox.scrollTop+this.objBox.clientHeight;var j=this.objBox.scrollLeft;var i=this.objBox.scrollTop;var d=false;if(this._blsTimer){window.clearTimeout(this._blsTimer)}if(h+20>=f){this.objBox.scrollLeft=this.objBox.scrollLeft+20;d=true}else{if(h-20<j){this.objBox.scrollLeft=this.objBox.scrollLeft-20;d=true}}if(g+20>=c&&!this._realfake){this.objBox.scrollTop=this.objBox.scrollTop+20;d=true}else{if(g-20<i&&!this._realfake){this.objBox.scrollTop=this.objBox.scrollTop-20;d=true}}this._selectionArea=this._RedrawSelectionPos(this._startSelectionCell,this._endSelectionCell);if(d){var n=e.clientX;var l=e.clientY;this._blsTimer=window.setTimeout(function(){q._OnSelectionMove({clientX:n,clientY:l})},100)}};dhtmlXGridObject.prototype._OnSelectionStop=function(b){var a=this;if(this._blsTimer){window.clearTimeout(this._blsTimer)}this.obj.onmousedown=function(d){if(a._bs_mode){a._OnSelectionStart((d||b),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 c=this.getFirstParentOfType(b.srcElement||b.target,"TD");if((!c)||(!c.parentNode.idd)){c=this._endSelectionCell}while(c&&(!c.tagName||c.tagName.toLowerCase()!="td")){c=c.parentNode}if(!c){return this._HideSelection()}this._stopSelectionCell=c;this._selectionArea=this._RedrawSelectionPos(this._startSelectionCell,this._stopSelectionCell);this.callEvent("onBlockSelected",[])}document.body.onselectstart=function(){}};dhtmlXGridObject.prototype._RedrawSelectionPos=function(m,g){var j={};j.LeftTopCol=m._cellIndex;j.LeftTopRow=this.getRowIndex(m.parentNode.idd);j.RightBottomCol=g._cellIndex;j.RightBottomRow=this.getRowIndex(g.parentNode.idd);var d=m.offsetWidth;var c=m.offsetHeight;m=this.getPosition(m,this.obj);var n=g.offsetWidth;var h=g.offsetHeight;g=this.getPosition(g,this.obj);if(m[0]<g[0]){var e=m[0];var f=g[0]+n}else{var i=j.RightBottomCol;j.RightBottomCol=j.LeftTopCol;j.LeftTopCol=i;var e=g[0];var f=m[0]+d}if(m[1]<g[1]){var l=m[1];var a=g[1]+h}else{var i=j.RightBottomRow;j.RightBottomRow=j.LeftTopRow;j.LeftTopRow=i;var l=g[1];var a=m[1]+c}var o=f-e;var b=a-l;this._selectionObj.style.left=e+"px";this._selectionObj.style.top=l+"px";this._selectionObj.style.width=o+"px";this._selectionObj.style.height=b+"px";return j};dhtmlXGridObject.prototype._CreateSelection=function(a,c){if(this._selectionObj==null){var b=document.createElement("div");b.style.position="absolute";b.style.display="none";b.className="dhtmlxGrid_selection";this._selectionObj=b;this._selectionObj.onmousedown=function(d){d=d||event;if(d.button==2||(_isMacOS&&d.ctrlKey)){return this.parentNode.grid.callEvent("onBlockRightClick",["BLOCK",d])}};this._selectionObj.oncontextmenu=function(d){(d||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=c+"px";this._selectionObj.startX=a;this._selectionObj.startY=c};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;this._clip_area.value="";this._clip_area.blur()};dhtmlXGridObject.prototype.copyBlockToClipboard=function(){if(this._selectionArea!=null){var c=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 b=this._serializeRowToCVS(this.rowsBuffer[a],null,this._selectionArea.LeftTopCol,this._selectionArea.RightBottomCol+1);if(!this._csvAID){c[c.length]=b.substr(b.indexOf(this.csv.cell)+1)}else{c[c.length]=b}}c=c.join(this._CSVRowDelimiter);this._clip_area.value=c;this._clip_area.select();this._serialize_visible=false}};dhtmlXGridObject.prototype.pasteBlockFromClipboard=function(){this._clip_area.select();var a=this;window.setTimeout(function(){a._pasteBlockFromClipboard();a=null},1)};dhtmlXGridObject.prototype._pasteBlockFromClipboard=function(){var f=this._clip_area.value;if(this._selectionArea!=null){var q=this._selectionArea.LeftTopRow;var a=this._selectionArea.LeftTopCol}else{if(this.cell!=null&&!this.editor){var q=this.getRowIndex(this.cell.parentNode.idd);var a=this.cell._cellIndex}else{return false}}f=this.csvParser.unblock(f,this.csv.cell,this.csv.row);var g=q+f.length;var o=a+f[0].length;if(o>this._cCount){o=this._cCount}var d=0;for(var h=q;h<g;h++){var r=this.render_row(h);if(r==-1){continue}var c=0;for(var e=a;e<o;e++){if(this._hrrar[e]){o=Math.max(o+1,this._cCount);continue}var m=this.cells3(r,e);if(m.isDisabled()){c++;continue}if(this._onEditUndoRedo){this._onEditUndoRedo(2,r.idd,e,f[d][c],m.getValue())}if(m.combo){var p=m.combo.values;for(var b=0;b<p.length;b++){if(f[d][c]==p[b]){m.setValue(m.combo.keys[b]);p=null;break}}if(p!=null&&m.editable){m.setValue(f[d][c++])}else{c++}}else{m[m.setImage?"setLabel":"setValue"](f[d][c++])}m.cell.wasChanged=true}this.callEvent("onRowPaste",[r.idd]);d++}};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(c,b,a){if(arguments.length>2){if(b&&!this.rowsBuffer[b-1]){this.rowsBuffer[b-1]=0}b=a}this._srnd=convertStringToBoolean(c);this._srdh=this._srdh||20;this._dpref=b||0};dhtmlXGridObject.prototype.enablePreRendering=function(a){this._srnd_pr=parseInt(a||50)};dhtmlXGridObject.prototype.forceFullLoading=function(a,e){for(var c=0;c<this.rowsBuffer.length;c++){if(!this.rowsBuffer[c]){var d=a||(this.rowsBuffer.length-c);if(this.callEvent("onDynXLS",[c,d])){var b=this;this.load(this.xmlFileUrl+getUrlSymbol(this.xmlFileUrl)+"posStart="+c+"&count="+d,function(){window.setTimeout(function(){b.forceFullLoading(a,e)},100)},this._data_type)}return}}if(e){e.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(g,a,b,d){if(!a){return null}var f="__filler__";var e=this._prepareRow(f);e.firstChild.style.width="1px";for(var c=1;c<e.childNodes.length;c++){e.childNodes[c].style.display="none"}e.firstChild.style.height=a*this._srdh+"px";b=b||this.rowsCol[g];if(b&&b.nextSibling){b.parentNode.insertBefore(e,b.nextSibling)}else{if(_isKHTML){this.obj.appendChild(e)}else{this.obj.rows[0].parentNode.appendChild(e)}}this.callEvent("onAddFiller",[g,a,e,b,d]);return[g,a,e]};dhtmlXGridObject.prototype._update_srnd_view=function(){var f=Math.floor(this.objBox.scrollTop/this._srdh);var b=f+this._get_view_size();if(this.multiLine){var g=this.objBox.scrollTop;f=0;while(g>0){g-=this.rowsCol[f]?this.rowsCol[f].offsetHeight:this._srdh;f++}b=f+this._get_view_size();if(f>0){f--}}b+=(this._srnd_pr||0);if(b>this.rowsBuffer.length){b=this.rowsBuffer.length}for(var d=f;d<b;d++){if(!this.rowsCol[d]){var e=this._add_from_buffer(d);if(e==-1){if(this.xmlFileUrl){if(this._dpref&&this.rowsBuffer[b-1]){var c=this._dpref?this._dpref:(b-d);var a=Math.max(0,b-this._dpref);this._current_load=[a,b-a]}else{this._current_load=[d,(this._dpref?this._dpref:(b-d))]}if(this.callEvent("onDynXLS",this._current_load)){this.load(this.xmlFileUrl+getUrlSymbol(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[d].idd],this.rowsBuffer[d]);this._updateParentLine(this._h2.get[this.rowsBuffer[d].idd],this.rowsBuffer[d])}if(d&&d==(this._realfake?this._fake:this)["_r_select"]){this.selectCell(d,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(d){var e=this.render_row(d);if(e==-1){return -1}if(e._attrs.selected||e._attrs.select){this.selectRow(e,false,true);e._attrs.selected=e._attrs.select=null}if(!this._cssSP){if(this._cssEven&&d%2==0){e.className=this._cssEven+((e.className.indexOf("rowselected")!=-1)?" rowselected ":" ")+(e._css||"")}else{if(this._cssUnEven&&d%2==1){e.className=this._cssUnEven+((e.className.indexOf("rowselected")!=-1)?" rowselected ":" ")+(e._css||"")}}}else{if(this._h2){var a=this._h2.get[e.idd];e.className+=" "+((a.level%2)?(this._cssUnEven+" "+this._cssUnEven):(this._cssEven+" "+this._cssEven))+"_"+a.level+(this.rowsAr[a.id]._css||"")}}for(var b=0;b<this._fillers.length;b++){var c=this._fillers[b];if(c&&c[0]<=d&&(c[0]+c[1])>d){var g=d-c[0];if(g==0){this._insert_before(d,e,c[2]);this._update_fillers(b,-1,1)}else{if(g==c[1]-1){this._insert_after(d,e,c[2]);this._update_fillers(b,-1,0)}else{this._fillers.push(this._add_filler(d+1,c[1]-g-1,c[2],1));this._insert_after(d,e,c[2]);this._update_fillers(b,-c[1]+g,0)}}return}}};dhtmlXGridObject.prototype._update_fillers=function(c,a,d){var b=this._fillers[c];b[1]=b[1]+a;b[0]=b[0]+d;if(!b[1]){this.callEvent("onRemoveFiller",[b[2]]);b[2].parentNode.removeChild(b[2]);this._fillers.splice(c,1)}else{b[2].firstChild.style.height=parseFloat(b[2].firstChild.style.height)+a*this._srdh+"px";this.callEvent("onUpdateFiller",[b[2]])}};dhtmlXGridObject.prototype._insert_before=function(b,c,a){a.parentNode.insertBefore(c,a);this.rowsCol[b]=c;this.callEvent("onRowInserted",[c,null,a,"before"])};dhtmlXGridObject.prototype._insert_after=function(b,c,a){if(a.nextSibling){a.parentNode.insertBefore(c,a.nextSibling)}else{a.parentNode.appendChild(c)}this.rowsCol[b]=c;this.callEvent("onRowInserted",[c,null,a,"after"])};dhtmlxValidation=function(){};dhtmlxValidation.prototype={trackInput:function(c,d,b,a){dhtmlxEvent(c,"keyup",function(f){if(dhtmlxValidation._timer){window.clearTimeout(dhtmlxValidation._timer);dhtmlxValidation._timer=null}dhtmlxValidation._timer=window.setTimeout(function(){if(!dhtmlxValidation.checkInput(c,d)){if(!b||b(c,c.value,d)){c.className+=" dhtmlx_live_validation_error"}}else{c.className=c.className.replace(/[ ]*dhtmlx_live_validation_error/g,"");if(a){a(c,c.value,d)}}},250)})},checkInput:function(a,b){return this.checkValue(a.value,b)},checkValue:function(c,d){if(typeof d=="string"){d=d.split(",")}var a=true;for(var b=0;b<d.length;b++){if(!this["is"+d[b]]){alert("Incorrect validation rule: "+d[b])}else{a=a&&this["is"+d[b]](c)}}return a},isEmpty:function(a){return a==""},isNotEmpty:function(a){return !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(b){var a=b.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 b=a.toString().match(/^(\d{4})-(\d{2})-(\d{2})$/);return b&&!!(b[1]<=9999&&b[2]<=12&&b[3]<=31)||false},isValidTime:function(b){var a=b.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 b=a.toString().match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);return b&&!!(b[1]<=255&&b[2]<=255&&b[3]<=255&&b[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();dhtmlXGridObject.prototype.enableValidation=function(b,a){b=convertStringToBoolean(b);if(b){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(f,b,d,c,h){var i=this._validators;if(!i){return true}var g=(i.data[d]||this.cells(b,d).getAttribute("validate"))||"";if(f==1&&g){var e=this.editor||(this._fake||{}).editor;if(!e){return true}e.cell.className=e.cell.className.replace(/[ ]*dhtmlx_validation_error/g,"");if(i._live){var a=this;dhtmlxValidation.trackInput(e.getInput(),g,function(j,l,m){return a.callEvent("onLiveValidationError",[b,d,l,j,m])},function(j,l,m){return a.callEvent("onLiveValidationCorrect",[b,d,l,j,m])})}}if(f==2){this.validateCell(b,d,g,c)}return true};dhtmlXGridObject.prototype.validateCell=function(g,e,f,d){f=f||(this._validators.data[e]||this.cells(g,e).getAttribute("validate"));d=d||this.cells(g,e).getValue();if(!f){return}var b=this.cells(g,e).cell;var a=true;if(typeof f=="string"){f=f.split(this.delim)}for(var c=0;c<f.length;c++){if(!dhtmlxValidation.checkValue(d,f[c])){if(this.callEvent("onValidationError",[g,e,d,f[c]])){b.className+=" dhtmlx_validation_error"}a=false}}if(a){this.callEvent("onValidationCorrect",[g,e,d,f]);b.className=b.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(b){this.cell._val=b;b=this._sub.getItemText(this.cell._val);this.setCValue((b||"&nbsp;"),b)};this.edit=function(){this._sub.parentObject.style.display="block";var c=this.grid.getPosition(this.cell);this._sub.parentObject.style.top=c[1]+"px";this._sub.parentObject.style.left=c[0]+"px";this._sub.parentObject.style.position="absolute";var b=this.grid.editStop;this.grid.editStop=function(){};this.grid.editStop=b};this.detach=function(){this._sub.parentObject.style.display="none";if(this.grid._sub_id!=null){var b=this.cell._val;this.setValue(this._sub.getSelectedItemId());this.grid._sub_id=null;return this.cell._val!=b}}}eXcell_stree.prototype=new eXcell;dhtmlXGridObject.prototype.setSubTree=function(a,b){if(!this._sub_trees){this._sub_trees=[]}this._sub_trees[b]=[a];a.parentObject.style.display="none";var c=this;a.parentObject.onclick=function(d){(d||window.event).cancelBubble=true;return false};a.ev_onDblClick=null;a.attachEvent("onDblClick",function(d){c._sub_id=d;c.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 b=this.cell.firstChild.getAttribute("target");return this.cell.firstChild.innerHTML+"^"+this.cell.firstChild.getAttribute("href")+(b?("^"+b):"")}else{return""}};this.setValue=function(c){if((typeof(c)!="number")&&(!c||c.toString()._dhx_trim()=="")){this.setCValue("&nbsp;",b);return(this.cell._clearCell=true)}var b=c.split("^");if(b.length==1){b[1]=""}else{if(b.length>1){b[1]="href='"+b[1]+"'";if(b.length==3){b[1]+=" target='"+b[2]+"'"}else{b[1]+=" target='_blank'"}}}this.setCValue("<a "+b[1]+" onclick='(_isIE?event:arguments[0]).cancelBubble = true;'>"+b[0]+"</a>",b)}}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(b){this.cell.val=b;if(this._sub.getRowById(b)){b=this._sub.cells(b,this._sindex);if(b){b=b.getValue()}else{b=""}}this.setCValue((b||"&nbsp;"),b)};this.edit=function(){this.val=this.cell.val;this._sub.entBox.style.display="block";var c=this.grid.getPosition(this.cell);this._sub.entBox.style.top=c[1]+"px";this._sub.entBox.style.left=c[0]+"px";this._sub.entBox.style.position="absolute";this._sub.setSizes();var b=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=b};this.detach=function(){var b=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!=b}}eXcell_grid.prototype=new eXcell;dhtmlXGridObject.prototype.setSubGrid=function(b,a,d){if(!this._sub_grids){this._sub_grids=[]}this._sub_grids[a]=[b,d];b.entBox.style.display="none";var c=this;b.attachEvent("onRowSelect",function(e){c.editStop();return true});b._chRRS=false};function eXcell_dhxCalendar(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;if(!this.grid._grid_calendarA){var c=this.grid._grid_calendarA=new dhtmlxCalendarObject();this.grid.callEvent("onDhxCalendarCreated",[c]);var b=this.grid;c.attachEvent("onClick",function(){this._last_operation_calendar=true;window.setTimeout(function(){b.editStop()},1);return true});var d=function(f){(f||event).cancelBubble=true};dhtmlxEvent(c.base,"click",d);c=null}}}eXcell_dhxCalendar.prototype=new eXcell;eXcell_dhxCalendar.prototype.edit=function(){var b=this.grid.getPosition(this.cell);this.grid._grid_calendarA._show(false,false);this.grid._grid_calendarA.setPosition(b[0],b[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 c=this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"));var b=this.grid._grid_calendarA.getDate();this.cell.val=new Date(b);this.setCValue(c,b);this.cell._clearCell=!c;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 c=this.grid._grid_calendarA=new dhtmlxCalendarObject();this.grid.callEvent("onDhxCalendarCreated",[c]);var b=this.grid;c.attachEvent("onClick",function(){this._last_operation_calendar=true;window.setTimeout(function(){b.editStop()},1);return true});var d=function(f){(f||event).cancelBubble=true};dhtmlxEvent(c.base,"click",d)}}}eXcell_dhxCalendarA.prototype=new eXcell;eXcell_dhxCalendarA.prototype.edit=function(){var b=this.grid.getPosition(this.cell);this.grid._grid_calendarA._show(false,false);this.grid._grid_calendarA.setPosition(b[0]*1+this.cell.offsetWidth,b[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-(_isIE?4:2))+"px";this.obj.className="dhx_combo_edit";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.align;this.obj.onclick=function(c){(c||event).cancelBubble=true};this.obj.onmousedown=function(c){(c||event).cancelBubble=true};this.obj.value=this.getValue();this.cell.innerHTML="";this.cell.appendChild(this.obj);if(_isFF){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(c){if(!c){c=event}c.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 c=this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask||"%d/%m/%Y");var b=this.grid._grid_calendarA.getDate();this.cell.val=new Date(b);this.setCValue(c,b);this.cell._clearCell=!c;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(c){this.resetCounter(a._cellIndex)})}var b=function(){var c=this;window.setTimeout(function(){if(!c.resetCounter){return}if(c._fake&&!c._realfake&&a._cellIndex<c._fake._cCount){c._fake.resetCounter(a._cellIndex)}else{c.resetCounter(a._cellIndex)}},1);return true};this.grid.attachEvent("onBeforeSorting",b);this.grid.attachEvent("onFilterEnd",b)}this.edit=function(){};this.getValue=function(){return this.cell.innerHTML};this.setValue=function(d){this.cell.style.paddingRight="2px";var c=this.cell;window.setTimeout(function(){if(!c.parentNode){return}var e=c.parentNode.rowIndex;if(c.parentNode.grid.currentPage||e<0||c.parentNode.grid._srnd){e=c.parentNode.grid.rowsBuffer._dhx_find(c.parentNode)+1}if(e<=0){return}c.innerHTML=e;if(c.parentNode.grid._fake&&c._cellIndex<c.parentNode.grid._fake._cCount&&c.parentNode.grid._fake.rowsAr[c.parentNode.idd]){c.parentNode.grid._fake.cells(c.parentNode.idd,c._cellIndex).setCValue(e)}c=null},100)}}dhtmlXGridObject.prototype.resetCounter=function(b){if(this._fake&&!this._realfake&&b<this._fake._cCount){this._fake.resetCounter(b,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[b].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(b){}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(c){return null}};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.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(b){b=(b||"").toString();if(b.indexOf("1")!=-1||b.indexOf("true")!=-1){b="1";this.cell.chstate="1"}else{b="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(c){this.cell._val=c;var b=this._sub.itemPull[this._sub.idPrefix+this.cell._val];c=b?b.title:c;this.setCValue((c||"&nbsp;"),c)};this.edit=function(){var c=this.grid.getPosition(this.cell);this._sub.showContextMenu(c[0]+this.cell.offsetWidth,c[1]);var b=this.grid.editStop;this.grid.editStop=function(){};this.grid.editStop=b};this.detach=function(){if(this.grid._sub_id!=null){var b=this.cell._val;this.setValue(this.grid._sub_id);this.grid._sub_id=null;return this.cell._val!=b}this._sub.hideContextMenu()}}eXcell_context.prototype=new eXcell;dhtmlXGridObject.prototype.setSubContext=function(a,b,d){var c=this;a.attachEvent("onClick",function(f,e){c._sub_id=f;c.editStop();a.hideContextMenu();return true});if(!this._sub_context){this._sub_context=[]}this._sub_context[b]=[a,d];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(b){if(b.tagName&&b.tagName=="TABLE"){return this._process_inner_html(b,0)}var a=document.createElement("DIV");a.innerHTML=b.xmlDoc.responseText;var c=a.getElementsByTagName("TABLE")[0];this._process_inner_html(c,0)};dhtmlXGridObject.prototype._process_inner_html=function(c,e){var b=c.rows.length;for(var a=e;a<b;a++){var d=c.rows[a].getAttribute("id")||a;this.rowsBuffer.push({idd:d,data:c.rows[a],_parser:this._process_html_row,_locator:this._get_html_data})}this.render_dataset();this.setSizes()};dhtmlXGridObject.prototype._process_html_row=function(h,e){var g=e.getElementsByTagName("TD");var b=[];h._attrs=this._xml_attrs(e);for(var d=0;d<g.length;d++){var f=g[d];var a=f.getAttribute("type");if(h.childNodes[d]){if(a){h.childNodes[d]._cellType=a}h.childNodes[d]._attrs=this._xml_attrs(g[d])}if(f.firstChild){b.push(f.innerHTML)}else{b.push("")}if(f.colSpan>1){h.childNodes[d]._attrs.colspan=f.colSpan;for(var c=1;c<f.colSpan;c++){b.push("")}}}for(d<g.length;d<h.childNodes.length;d++){h.childNodes[d]._attrs={}}this._fillRow(h,(this._c_order?this._swapColumns(b):b));return h};dhtmlXGridObject.prototype._get_html_data=function(b,a){b=b.firstChild;while(true){if(!b){return""}if(b.tagName=="TD"){a--}if(a<0){break}b=b.nextSibling}return(b.firstChild?b.firstChild.data:"")};dhtmlxEvent(window,"load",function(){var c=document.getElementsByTagName("table");for(var b=0;b<c.length;b++){if(c[b].className=="dhtmlxGrid"){dhtmlXGridFromTable(c[b])}}});if(!window.dhtmlx){window.dhtmlx={}}(function(){var j=null;function m(r,p){var q=r.callback;l(false);r.box.parentNode.removeChild(r.box);j=r.box=null;if(q){q(p)}}function a(q){if(j){q=q||event;var p=q.which||event.keyCode;if(dhtmlx.message.keyboard){if(p==13||p==32){m(j,true)}if(p==27){m(j,false)}}if(q.preventDefault){q.preventDefault()}return !(q.cancelBubble=true)}}if(document.attachEvent){document.attachEvent("onkeydown",a)}else{document.addEventListener("keydown",a,true)}function l(q){if(!l.cover){l.cover=document.createElement("DIV");l.cover.onkeydown=a;l.cover.className="dhx_modal_cover";document.body.appendChild(l.cover)}var p=document.body.scrollHeight;l.cover.style.display=q?"inline-block":"none"}function f(q,p){return"<div class='dhtmlx_popup_button' result='"+p+"' ><div>"+q+"</div></div>"}function c(q){if(!n.area){n.area=document.createElement("DIV");n.area.className="dhtmlx_message_area";n.area.style[n.position]="5px";document.body.appendChild(n.area)}n.hide(q.id);var p=document.createElement("DIV");p.innerHTML="<div>"+q.text+"</div>";p.className="dhtmlx-info dhtmlx-"+q.type;p.onclick=function(){n.hide(q.id);q=null};if(n.position=="bottom"&&n.area.firstChild){n.area.insertBefore(p,n.area.firstChild)}else{n.area.appendChild(p)}if(q.expire>0){n.timers[q.id]=window.setTimeout(function(){n.hide(q.id)},q.expire)}n.pull[q.id]=p;p=null;return q.id}function g(q,s,v){var u=document.createElement("DIV");u.className=" dhtmlx_modal_box dhtmlx-"+q.type;u.setAttribute("dhxbox",1);var p="";if(q.width){u.style.width=q.width}if(q.height){u.style.height=q.height}if(q.title){p+='<div class="dhtmlx_popup_title">'+q.title+"</div>"}p+='<div class="dhtmlx_popup_text"><span>'+(q.content?"":q.text)+'</span></div><div  class="dhtmlx_popup_controls">';if(s){p+=f(q.ok||"OK",true)}if(v){p+=f(q.cancel||"Cancel",false)}if(q.buttons){for(var r=0;r<q.buttons.length;r++){p+=f(q.buttons[r],r)}}p+="</div>";u.innerHTML=p;if(q.content){var t=q.content;if(typeof t=="string"){t=document.getElementById(t)}if(t.style.display=="none"){t.style.display=""}u.childNodes[q.title?1:0].appendChild(t)}u.onclick=function(y){y=y||event;var x=y.target||y.srcElement;if(!x.className){x=x.parentNode}if(x.className=="dhtmlx_popup_button"){var w=x.getAttribute("result");w=(w=="true")||(w=="false"?false:w);m(q,w)}};q.box=u;if(s||v){j=q}return u}function o(q,r,t){var s=q.tagName?q:g(q,r,t);if(!q.hidden){l(true)}document.body.appendChild(s);var p=q.left||Math.abs(Math.floor(((window.innerWidth||document.documentElement.offsetWidth)-s.offsetWidth)/2));var u=q.top||Math.abs(Math.floor(((window.innerHeight||document.documentElement.offsetHeight)-s.offsetHeight)/2));if(q.position=="top"){s.style.top="-3px"}else{s.style.top=u+"px"}s.style.left=p+"px";s.onkeydown=a;s.focus();if(q.hidden){dhtmlx.modalbox.hide(s)}return s}function i(p){return o(p,true,false)}function b(p){return o(p,true,true)}function e(p){return o(p)}function h(q,p,r){if(typeof q!="object"){if(typeof p=="function"){r=p;p=""}q={text:q,type:p,callback:r}}return q}function d(r,q,p,s){if(typeof r!="object"){r={text:r,type:q,expire:p,id:s}}r.id=r.id||n.uid();r.expire=r.expire||n.expire;return r}dhtmlx.alert=function(){var p=h.apply(this,arguments);p.type=p.type||"confirm";return i(p)};dhtmlx.confirm=function(){var p=h.apply(this,arguments);p.type=p.type||"alert";return b(p)};dhtmlx.modalbox=function(){var p=h.apply(this,arguments);p.type=p.type||"alert";return e(p)};dhtmlx.modalbox.hide=function(p){while(p&&p.getAttribute&&!p.getAttribute("dhxbox")){p=p.parentNode}if(p){p.parentNode.removeChild(p);l(false)}};var n=dhtmlx.message=function(s,r,q,t){s=d.apply(this,arguments);s.type=s.type||"info";var p=s.type.split("-")[0];switch(p){case"alert":return i(s);case"confirm":return b(s);case"modalbox":return e(s);default:return c(s);break}};n.seed=(new Date()).valueOf();n.uid=function(){return n.seed++};n.expire=4000;n.keyboard=true;n.position="top";n.pull={};n.timers={};n.hideAll=function(){for(var p in n.pull){n.hide(p)}};n.hide=function(q){var p=n.pull[q];if(p&&p.parentNode){window.setTimeout(function(){p.parentNode.removeChild(p);p=null},2000);p.className+=" hidden";if(n.timers[q]){window.clearTimeout(n.timers[q])}delete n.pull[q]}}})();