
dhtmlx=function(obj){for (var a in obj)dhtmlx[a]=obj[a];return dhtmlx;};dhtmlx.extend_api=function(name,map,ext){var t = window[name];if (!t)return;window[name]=function(obj){if (obj && typeof obj == "object" && !obj.tagName){var that = t.apply(this,(map._init?map._init(obj):arguments));for (var a in dhtmlx)if (map[a])this[map[a]](dhtmlx[a]);for (var a in obj){if (map[a])this[map[a]](obj[a]);else if (a.indexOf("on")==0){this.attachEvent(a,obj[a]);}}}else
 var that = t.apply(this,arguments);if (map._patch)map._patch(this);return that||this;};window[name].prototype=t.prototype;if (ext)dhtmlXHeir(window[name].prototype,ext);};dhtmlxAjax={get:function(url,callback){var t=new dtmlXMLLoaderObject(true);t.async=(arguments.length<3);t.waitCall=callback;t.loadXML(url)
 return t;},
 post:function(url,post,callback){var t=new dtmlXMLLoaderObject(true);t.async=(arguments.length<4);t.waitCall=callback;t.loadXML(url,true,post)
 return t;},
 getSync:function(url){return this.get(url,null,true)
 },
 postSync:function(url,post){return this.post(url,post,null,true);}};function dtmlXMLLoaderObject(funcObject, dhtmlObject, async, rSeed){this.xmlDoc="";if (typeof (async)!= "undefined")
 this.async=async;else
 this.async=true;this.onloadAction=funcObject||null;this.mainObject=dhtmlObject||null;this.waitCall=null;this.rSeed=rSeed||false;return this;};dtmlXMLLoaderObject.prototype.waitLoadFunction=function(dhtmlObject){var once = true;this.check=function (){if ((dhtmlObject)&&(dhtmlObject.onloadAction != null)){if ((!dhtmlObject.xmlDoc.readyState)||(dhtmlObject.xmlDoc.readyState == 4)){if (!once)return;once=false;if (typeof dhtmlObject.onloadAction == "function")dhtmlObject.onloadAction(dhtmlObject.mainObject, null, null, null, dhtmlObject);if (dhtmlObject.waitCall){dhtmlObject.waitCall.call(this,dhtmlObject);dhtmlObject.waitCall=null;}}}};return this.check;};dtmlXMLLoaderObject.prototype.getXMLTopNode=function(tagName, oldObj){if (this.xmlDoc.responseXML){var temp = this.xmlDoc.responseXML.getElementsByTagName(tagName);if(temp.length==0 && tagName.indexOf(":")!=-1)
 var temp = this.xmlDoc.responseXML.getElementsByTagName((tagName.split(":"))[1]);var z = temp[0];}else
 var z = this.xmlDoc.documentElement;if (z){this._retry=false;return z;};if ((_isIE)&&(!this._retry)){var xmlString = this.xmlDoc.responseText;var oldObj = this.xmlDoc;this._retry=true;this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");this.xmlDoc.async=false;this.xmlDoc["loadXM"+"L"](xmlString);return this.getXMLTopNode(tagName, oldObj);};dhtmlxError.throwError("LoadXML", "Incorrect XML", [
 (oldObj||this.xmlDoc),
 this.mainObject
 ]);return document.createElement("DIV");};dtmlXMLLoaderObject.prototype.loadXMLString=function(xmlString){{
 try{var parser = new DOMParser();this.xmlDoc=parser.parseFromString(xmlString, "text/xml");}catch (e){this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");this.xmlDoc.async=this.async;this.xmlDoc["loadXM"+"L"](xmlString);}};this.onloadAction(this.mainObject, null, null, null, this);if (this.waitCall){this.waitCall();this.waitCall=null;}};dtmlXMLLoaderObject.prototype.loadXML=function(filePath, postMode, postVars, rpc){if (this.rSeed)filePath+=((filePath.indexOf("?") != -1) ? "&" : "?")+"a_dhx_rSeed="+(new Date()).valueOf();this.filePath=filePath;if ((!_isIE)&&(window.XMLHttpRequest))
 this.xmlDoc=new XMLHttpRequest();else {if (document.implementation&&document.implementation.createDocument){this.xmlDoc=document.implementation.createDocument("", "", null);this.xmlDoc.onload=new this.waitLoadFunction(this);this.xmlDoc.load(filePath);return;}else
 this.xmlDoc=new ActiveXObject("Microsoft.XMLHTTP");};if (this.async)this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this);this.xmlDoc.open(postMode ? "POST" : "GET", filePath, this.async);if (rpc){this.xmlDoc.setRequestHeader("User-Agent", "dhtmlxRPC v0.1 ("+navigator.userAgent+")");this.xmlDoc.setRequestHeader("Content-type", "text/xml");}else if (postMode)this.xmlDoc.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");this.xmlDoc.send(null||postVars);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(node){var t={};for (var i=0;i<node.attributes.length;i++)t[node.attributes[i].name]=node.attributes[i].value;t["_tagvalue"]=node.firstChild?node.firstChild.nodeValue:"";for (var i=0;i<node.childNodes.length;i++){var name=node.childNodes[i].tagName;if (name){if (!t[name])t[name]=[];t[name].push(this.xmlNodeToJSON(node.childNodes[i]));}};return t;};function callerFunction(funcObject, dhtmlObject){this.handler=function(e){if (!e)e=window.event;funcObject(e, dhtmlObject);return true;};return this.handler;};function getAbsoluteLeft(htmlObject){return getOffset(htmlObject).left;};function getAbsoluteTop(htmlObject){return getOffset(htmlObject).top;};function getOffsetSum(elem) {var top=0, left=0;while(elem){top = top + parseInt(elem.offsetTop);left = left + parseInt(elem.offsetLeft);elem = elem.offsetParent;};return {top: top, left: left}};function getOffsetRect(elem) {var box = elem.getBoundingClientRect();var body = document.body;var docElem = document.documentElement;var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;var clientTop = docElem.clientTop || body.clientTop || 0;var clientLeft = docElem.clientLeft || body.clientLeft || 0;var top = box.top + scrollTop - clientTop;var left = box.left + scrollLeft - clientLeft;return {top: Math.round(top), left: Math.round(left) }};function getOffset(elem) {if (elem.getBoundingClientRect){return getOffsetRect(elem);}else {return getOffsetSum(elem);}};function convertStringToBoolean(inputString){if (typeof (inputString)== "string")
 inputString=inputString.toLowerCase();switch (inputString){case "1":
 case "true":
 case "yes":
 case "y":
 case 1:
 case true:
 return true;break;default: return false;}};function getUrlSymbol(str){if (str.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(htmlNode){htmlNode.onmousedown=null;htmlNode.dragStarter=null;htmlNode.dragLanding=null;};dhtmlDragAndDropObject.prototype.addDraggableItem=function(htmlNode, dhtmlObject){htmlNode.onmousedown=this.preCreateDragCopy;htmlNode.dragStarter=dhtmlObject;this.addDragLanding(htmlNode, dhtmlObject);};dhtmlDragAndDropObject.prototype.addDragLanding=function(htmlNode, dhtmlObject){htmlNode.dragLanding=dhtmlObject;};dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(e){if ((e||window.event)&& (e||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;};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 ((e)&&(e.preventDefault)){e.preventDefault();return false;};return false;};dhtmlDragAndDropObject.prototype.callDrag=function(e){if (!e)e=window.event;dragger=window.dhtmlDragAndDrop;if ((new Date()).valueOf()-dragger.downtime<100) return;if ((e.button == 0)&&(_isIE))
 return dragger.stopDrag();if (!dragger.dragNode&&dragger.waitDrag){dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode, e);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();};if (dragger.dragNode.parentNode != window.document.body){var grd = dragger.gldragNode;if (dragger.gldragNode.old)grd=dragger.gldragNode.old;grd.parentNode.removeChild(grd);var oldBody = dragger.dragNode.pWindow;if (grd.pWindow && grd.pWindow.dhtmlDragAndDrop.lastLanding)grd.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(grd.pWindow.dhtmlDragAndDrop.lastLanding);if (_isIE){var div = document.createElement("Div");div.innerHTML=dragger.dragNode.outerHTML;dragger.dragNode=div.childNodes[0];}else
 dragger.dragNode=dragger.dragNode.cloneNode(true);dragger.dragNode.pWindow=window;dragger.gldragNode.old=dragger.dragNode;document.body.appendChild(dragger.dragNode);oldBody.dhtmlDragAndDrop.dragNode=dragger.dragNode;};dragger.dragNode.style.left=e.clientX+15+(dragger.fx
 ? dragger.fx*(-1)
 : 0)
 +(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";dragger.dragNode.style.top=e.clientY+3+(dragger.fy
 ? dragger.fy*(-1)
 : 0)
 +(document.body.scrollTop||document.documentElement.scrollTop)+"px";if (!e.srcElement)var z = e.target;else
 z=e.srcElement;dragger.checkLanding(z, e);};dhtmlDragAndDropObject.prototype.calculateFramePosition=function(n){if (window.name){var el = parent.frames[window.name].frameElement.offsetParent;var fx = 0;var fy = 0;while (el){fx+=el.offsetLeft;fy+=el.offsetTop;el=el.offsetParent;};if ((parent.dhtmlDragAndDrop)){var ls = parent.dhtmlDragAndDrop.calculateFramePosition(1);fx+=ls.split('_')[0]*1;fy+=ls.split('_')[1]*1;};if (n)return fx+"_"+fy;else
 this.fx=fx;this.fy=fy;};return "0_0";};dhtmlDragAndDropObject.prototype.checkLanding=function(htmlObject, e){if ((htmlObject)&&(htmlObject.dragLanding)){if (this.lastLanding)this.lastLanding.dragLanding._dragOut(this.lastLanding);this.lastLanding=htmlObject;this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding, this.dragStartNode, e.clientX,
 e.clientY, e);this.lastLanding_scr=(_isIE ? e.srcElement : e.target);}else {if ((htmlObject)&&(htmlObject.tagName != "BODY"))
 this.checkLanding(htmlObject.parentNode, e);else {if (this.lastLanding)this.lastLanding.dragLanding._dragOut(this.lastLanding, e.clientX, e.clientY, e);this.lastLanding=0;if (this._onNotFound)this._onNotFound();}}};dhtmlDragAndDropObject.prototype.stopDrag=function(e, mode){dragger=window.dhtmlDragAndDrop;if (!mode){dragger.stopFrameRoute();var temp = dragger.lastLanding;dragger.lastLanding=null;if (temp)temp.dragLanding._drag(dragger.dragStartNode, dragger.dragStartObject, temp, (_isIE
 ? event.srcElement
 : e.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(win){if (win)window.dhtmlDragAndDrop.stopDrag(1, 1);for (var i = 0;i < window.frames.length;i++){try{if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
 window.frames[i].dhtmlDragAndDrop.stopFrameRoute(window);}catch(e){}};try{if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
 parent.dhtmlDragAndDrop.stopFrameRoute(window);}catch(e){}};dhtmlDragAndDropObject.prototype.initFrameRoute=function(win, mode){if (win){window.dhtmlDragAndDrop.preCreateDragCopy();window.dhtmlDragAndDrop.dragStartNode=win.dhtmlDragAndDrop.dragStartNode;window.dhtmlDragAndDrop.dragStartObject=win.dhtmlDragAndDrop.dragStartObject;window.dhtmlDragAndDrop.dragNode=win.dhtmlDragAndDrop.dragNode;window.dhtmlDragAndDrop.gldragNode=win.dhtmlDragAndDrop.dragNode;window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag;window.waitDrag=0;if (((!_isIE)&&(mode))&&((!_isFF)||(_FFrv < 1.8)))
 window.dhtmlDragAndDrop.calculateFramePosition();};try{if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
 parent.dhtmlDragAndDrop.initFrameRoute(window);}catch(e){};for (var i = 0;i < window.frames.length;i++){try{if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
 window.frames[i].dhtmlDragAndDrop.initFrameRoute(window, ((!win||mode) ? 1 : 0));}catch(e){}}};var _isFF = false;var _isIE = false;var _isOpera = false;var _isKHTML = false;var _isMacOS = false;var _isChrome = 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)){var _KHTMLrv = parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf('Safari')+7, 5));if (_KHTMLrv > 525){_isFF=true;var _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 && document.compatMode != "BackCompat") _isIE=8;}else {_isFF=true;var _FFrv = parseFloat(navigator.userAgent.split("rv:")[1])
};dtmlXMLLoaderObject.prototype.doXPath=function(xpathExp, docObj, namespace, result_type){if (_isKHTML || (!_isIE && !window.XPathResult))
 return this.doXPathOpera(xpathExp, docObj);if (_isIE){if (!docObj)if (!this.xmlDoc.nodeName)docObj=this.xmlDoc.responseXML
 else
 docObj=this.xmlDoc;if (!docObj)dhtmlxError.throwError("LoadXML", "Incorrect XML", [
 (docObj||this.xmlDoc),
 this.mainObject
 ]);if (namespace != null)docObj.setProperty("SelectionNamespaces", "xmlns:xsl='"+namespace+"'");if (result_type == 'single'){return docObj.selectSingleNode(xpathExp);}else {return docObj.selectNodes(xpathExp)||new Array(0);}}else {var nodeObj = docObj;if (!docObj){if (!this.xmlDoc.nodeName){docObj=this.xmlDoc.responseXML
 }else {docObj=this.xmlDoc;}};if (!docObj)dhtmlxError.throwError("LoadXML", "Incorrect XML", [
 (docObj||this.xmlDoc),
 this.mainObject
 ]);if (docObj.nodeName.indexOf("document")!= -1){nodeObj=docObj;}else {nodeObj=docObj;docObj=docObj.ownerDocument;};var retType = XPathResult.ANY_TYPE;if (result_type == 'single')retType=XPathResult.FIRST_ORDERED_NODE_TYPE
 var rowsCol = new Array();var col = docObj.evaluate(xpathExp, nodeObj, function(pref){return namespace
 }, retType, null);if (retType == XPathResult.FIRST_ORDERED_NODE_TYPE){return col.singleNodeValue;};var thisColMemb = col.iterateNext();while (thisColMemb){rowsCol[rowsCol.length]=thisColMemb;thisColMemb=col.iterateNext();};return rowsCol;}};function _dhtmlxError(type, name, params){if (!this.catches)this.catches=new Array();return this;};_dhtmlxError.prototype.catchError=function(type, func_name){this.catches[type]=func_name;};_dhtmlxError.prototype.throwError=function(type, name, params){if (this.catches[type])return this.catches[type](type, name, params);if (this.catches["ALL"])return this.catches["ALL"](type, name, params);alert("Error type: "+arguments[0]+"\nDescription: "+arguments[1]);return null;};window.dhtmlxError=new _dhtmlxError();dtmlXMLLoaderObject.prototype.doXPathOpera=function(xpathExp, docObj){var z = xpathExp.replace(/[\/]+/gi, "/").split('/');var obj = null;var i = 1;if (!z.length)return [];if (z[0] == ".")obj=[docObj];else if (z[0] == ""){obj=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(z[i].replace(/\[[^\]]*\]/g, ""));i++;}else
 return [];for (i;i < z.length;i++)obj=this._getAllNamedChilds(obj, z[i]);if (z[i-1].indexOf("[")!= -1)
 obj=this._filterXPath(obj, z[i-1]);return obj;};dtmlXMLLoaderObject.prototype._filterXPath=function(a, b){var c = new Array();var b = b.replace(/[^\[]*\[\@/g, "").replace(/[\[\]\@]*/g, "");for (var i = 0;i < a.length;i++)if (a[i].getAttribute(b))
 c[c.length]=a[i];return c;};dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(a, b){var c = new Array();if (_isKHTML)b=b.toUpperCase();for (var i = 0;i < a.length;i++)for (var j = 0;j < a[i].childNodes.length;j++){if (_isKHTML){if (a[i].childNodes[j].tagName&&a[i].childNodes[j].tagName.toUpperCase()== b)
 c[c.length]=a[i].childNodes[j];}else if (a[i].childNodes[j].tagName == b)c[c.length]=a[i].childNodes[j];};return c;};function dhtmlXHeir(a, b){for (var c in b)if (typeof (b[c])== "function")
 a[c]=b[c];return a;};function dhtmlxEvent(el, event, handler){if (el.addEventListener)el.addEventListener(event, handler, false);else if (el.attachEvent)el.attachEvent("on"+event, handler);};dtmlXMLLoaderObject.prototype.xslDoc=null;dtmlXMLLoaderObject.prototype.setXSLParamValue=function(paramName, paramValue, xslDoc){if (!xslDoc)xslDoc=this.xslDoc

 if (xslDoc.responseXML)xslDoc=xslDoc.responseXML;var item =
 this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+paramName+"']", xslDoc,
 "http:/\/www.w3.org/1999/XSL/Transform", "single");if (item != null)item.firstChild.nodeValue=paramValue
};dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(xslDoc, xmlDoc){if (!xslDoc)xslDoc=this.xslDoc;if (xslDoc.responseXML)xslDoc=xslDoc.responseXML

 if (!xmlDoc)xmlDoc=this.xmlDoc;if (xmlDoc.responseXML)xmlDoc=xmlDoc.responseXML

 
 if (!_isIE){if (!this.XSLProcessor){this.XSLProcessor=new XSLTProcessor();this.XSLProcessor.importStylesheet(xslDoc);};var result = this.XSLProcessor.transformToDocument(xmlDoc);}else {var result = new ActiveXObject("Msxml2.DOMDocument.3.0");try{xmlDoc.transformNodeToObject(xslDoc, result);}catch(e){result = xmlDoc.transformNode(xslDoc);}};return result;};dtmlXMLLoaderObject.prototype.doXSLTransToString=function(xslDoc, xmlDoc){var res = this.doXSLTransToObject(xslDoc, xmlDoc);if(typeof(res)=="string")
 return res;return this.doSerialization(res);};dtmlXMLLoaderObject.prototype.doSerialization=function(xmlDoc){if (!xmlDoc)xmlDoc=this.xmlDoc;if (xmlDoc.responseXML)xmlDoc=xmlDoc.responseXML
 if (!_isIE){var xmlSerializer = new XMLSerializer();return xmlSerializer.serializeToString(xmlDoc);}else
 return xmlDoc.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) 
 delete this[name];}}};function dhtmlXAccordionItem(){};function dhtmlXAccordion(baseId, skin) {if (!window.dhtmlXContainer){alert(this.i18n.dhxcontalert);return;};var that = this;this.skin = (skin!=null?skin:"dhx_skyblue");if (baseId == document.body){this._isAccFS = true;document.body.className += " dhxacc_fullscreened";var contObj = document.createElement("DIV");contObj.className = "dhxcont_global_layout_area";baseId.appendChild(contObj);this.cont = new dhtmlXContainer(baseId);this.cont.setContent(contObj);baseId.adjustContent(baseId, 0);this.base = document.createElement("DIV");this.base.className = "dhx_acc_base_"+this.skin;this.base.style.overflow = "hidden";this.base.style.position = "absolute";this._adjustToFullScreen = function() {this.base.style.left = "2px";this.base.style.top = "2px";this.base.style.width = parseInt(contObj.childNodes[0].style.width)-4+"px";this.base.style.height = parseInt(contObj.childNodes[0].style.height)-4+"px";};this._adjustToFullScreen();contObj.childNodes[0].appendChild(this.base);this._resizeTM = null;this._resizeTMTime = 400;this._doOnResize = function() {window.clearTimeout(that._resizeTM);that._resizeTM = window.setTimeout(function(){that._adjustAccordion();}, that._resizeTMTime);};this._adjustAccordion = function() {document.body.adjustContent(document.body, 0);this._adjustToFullScreen();this.setSizes();};dhtmlxEvent(window, "resize", this._doOnResize);}else {this.base = (typeof(baseId)=="string"?document.getElementById(baseId):baseId);this.base.className = "dhx_acc_base_"+this.skin;};this.w = this.base.offsetWidth;this.h = this.base.offsetHeight;this.skinParams = {"dhx_blue": {"cell_height": 24, "cell_space": 1, "content_offset": 1 },
 "dhx_skyblue": {"cell_height": 27, "cell_space":-1, "content_offset":-1 },
 "dhx_black": {"cell_height": 24, "cell_space": 1, "content_offset": 1 },
 "dhx_web": {"cell_height": 26, "cell_space": 9, "content_offset": 0, "cell_pading_max": 1, "cell_pading_min": 0 }};this.sk = this.skinParams[this.skin];this.setSkinParameters = function(cellSpace, contentOffset) {if (!isNaN(cellSpace)) this.sk["cell_space"] = cellSpace;if (!isNaN(contentOffset)) this.sk["content_offset"] = contentOffset;this._reopenItem();};this.setSkin = function(skin) {if (!this.skinParams[skin])return;this.skin = skin;this.sk = this.skinParams[this.skin];this.base.className = "dhx_acc_base_"+this.skin+(this._r?" dhx_acc_rtl":"");for (var a in this.idPull)this.idPull[a].skin = this.skin;this._reopenItem();};this.idPull = {};this.opened = null;this.cells = function(itemId) {if (this.idPull[itemId] == null){return null;};return this.idPull[itemId];};this.itemH = 90;this.multiMode = false;this.enableMultiMode = function() {var totalItems = 0;for (var a in this.idPull)totalItems++;if (totalItems == 0){if (!this.userOffset)this.skinParams["dhx_skyblue"]["cell_space"] = 3;this.multiMode = true;}};this.userOffset = false;this.setOffset = function(cellOffset, contentOffset) {this.userOffset = true;if (!isNaN(cellOffset)) this.skinParams[this.skin]["cell_space"] = cellOffset;if (!isNaN(contentOffset)) this.skinParams[this.skin]["content_offset"] = contentOffset;this.setSizes();};this.imagePath = "";this.setIconsPath = function(path) {this.imagePath = path;};this.addItem = function(itemId, itemText) {var item = document.createElement("DIV");item.className = "dhx_acc_item";item.dir = "ltr";item._isAcc = true;item.skin = this.skin;this.base.appendChild(item);if (this.multiMode)item.h = this.itemH;var label = document.createElement("DIV");label._idd = itemId;label.className = "dhx_acc_item_label";label.innerHTML = "<span>"+itemText+"</span><div class='dhx_acc_item_label_btmbrd'>&nbsp;</div>"+
 "<div class='dhx_acc_item_arrow'></div>"+
 "<div class='dhx_acc_hdr_line_l'></div>"+
 "<div class='dhx_acc_hdr_line_r'></div>";label.onselectstart = function(e) {e = e||event;e.returnValue = false;};label.onclick = function() {if (!that.multiMode && that.idPull[this._idd]._isActive)return;if (that.multiMode){if (that.idPull[this._idd]._isActive){if (that.checkEvent("onBeforeActive")) {if (that.callEvent("onBeforeActive", [this._idd, "close"])) that.closeItem(this._idd, "dhx_accord_outer_event");}else {that.closeItem(this._idd, "dhx_accord_outer_event");}}else {if (that.checkEvent("onBeforeActive")) {if (that.callEvent("onBeforeActive", [this._idd, "open"])) that.openItem(this._idd, "dhx_accord_outer_event");}else {that.openItem(this._idd, "dhx_accord_outer_event");}};return;};if (that.checkEvent("onBeforeActive")) {if (that.callEvent("onBeforeActive", [this._idd, "open"])) that.openItem(this._idd, "dhx_accord_outer_event");}else {that.openItem(this._idd, "dhx_accord_outer_event");}};label.onmouseover = function() {this.className = "dhx_acc_item_label dhx_acc_item_lavel_hover";};label.onmouseout = function() {this.className = "dhx_acc_item_label";};item.appendChild(label);var contObj = document.createElement("DIV");contObj.className = "dhxcont_global_content_area";item.appendChild(contObj);var cont = new dhtmlXContainer(item);cont.setContent(contObj);item.adjustContent(item, this.sk["cell_height"]+this.sk["content_offset"]);item._id = itemId;this.idPull[itemId] = item;item.getId = function() {return this._id;};item.setText = function(text) {that.setText(this._id, text);};item.getText = function() {return that.getText(this._id);};item.open = function() {that.openItem(this._id);};item.isOpened = function() {return that.isActive(this._id);};item.close = function() {that.closeItem(this._id);};item.setIcon = function(icon) {that.setIcon(this._id, icon);};item.clearIcon = function() {that.clearIcon(this._id);};item.dock = function() {that.dockItem(this._id);};item.undock = function() {that.undockItem(this._id);};item.show = function() {that.showItem(this._id);};item.hide = function() {that.hideItem(this._id);};item.setHeight = function(height) {that.setItemHeight(this._id, height);};item.moveOnTop = function() {that.moveOnTop(this._id);};item._doOnAttachMenu = function() {that._reopenItem();};item._doOnAttachToolbar = function() {that._reopenItem();};item._doOnAttachStatusBar = function() {that._reopenItem();};this.openItem(itemId);if (!this.multiMode)this._defineLastItem();return item;};this.openItem = function(itemId, callEvent, reOpenItem) {if (this._openBuzy)return;if (this._enableOpenEffect && !reOpenItem){if (this.multiMode && this.idPull[itemId]._isActive)return;this._openWithEffect(itemId, null, null, null, null, callEvent);return;};if (this.multiMode){for (var a in this.idPull){if (this.idPull[a]._isActive || a == itemId){this.idPull[a].style.height = this.idPull[a].h+"px";this.idPull[a].childNodes[1].style.display = "";if (this.skin == "dhx_web")this.idPull[a]._setPadding(this.skinParams[this.skin]["cell_pading_max"], "dhxcont_acc_dhx_web");this.idPull[a].adjustContent(this.idPull[a], this.sk["cell_height"]+this.sk["content_offset"], null, null, (this.idPull[a]==this._lastVisible()&&this.skin!="dhx_web"?0:this.sk["cell_space"]));this.idPull[a].updateNestedObjects();this.idPull[a]._isActive = true;this._updateArrows();if (callEvent == "dhx_accord_outer_event" && a == itemId)this.callEvent("onActive", [itemId,true]);}};return;};if (itemId){if (this.idPull[itemId]._isActive && !reOpenItem)return;};var h = 0;for (var a in this.idPull){this.idPull[a].style.height = this.sk["cell_height"]+(this.idPull[a]!=this._lastVisible()&&a!=itemId?this.sk["cell_space"]:0)+"px";if (a != itemId){this.idPull[a].childNodes[1].style.display = "none";if (this.skin == "dhx_web")this.idPull[a]._setPadding(this.skinParams[this.skin]["cell_pading_min"], "");this.idPull[a]._isActive = false;h += this.idPull[a].offsetHeight;}};h = this.base.offsetHeight - h;if (itemId){this.idPull[itemId].style.height = h+"px";this.idPull[itemId].childNodes[1].style.display = "";if (this.skin == "dhx_web")this.idPull[itemId]._setPadding(this.skinParams[this.skin]["cell_pading_max"], "dhxcont_acc_dhx_web");this.idPull[itemId].adjustContent(this.idPull[itemId], this.sk["cell_height"]+this.sk["content_offset"], null, null, (this.idPull[itemId]==this._lastVisible()?0:this.sk["cell_space"]));this.idPull[itemId].updateNestedObjects();this.idPull[itemId]._isActive = true;if (callEvent == "dhx_accord_outer_event")this.callEvent("onActive", [itemId,true]);};this._updateArrows();return;};this._lastVisible = function() {var item = null;for (var q=this.base.childNodes.length-1;q>=0;q--)if (!this.base.childNodes[q]._isHidden && !item)item = this.base.childNodes[q];return item;};this.closeItem = function(itemId, callEvent) {if (this.idPull[itemId] == null)return;if (!this.idPull[itemId]._isActive)return;if (this._openBuzy)return;if (this._enableOpenEffect){this._openWithEffect(this.multiMode?itemId:null, null, null, null, null, callEvent);return;};this.idPull[itemId].style.height = this.sk["cell_height"]+(this.idPull[itemId]!=this._lastVisible()?this.sk["cell_space"]:0)+"px";this.idPull[itemId].childNodes[1].style.display = "none";if (this.skin == "dhx_web")this.idPull[itemId]._setPadding(this.skinParams[this.skin]["cell_pading_min"], "");this.idPull[itemId]._isActive = false;if (callEvent == "dhx_accord_outer_event")this.callEvent("onActive", [itemId,false]);this._updateArrows();};this._updateArrows = function() {for (var a in this.idPull){var label = this.idPull[a].childNodes[0];var arrow = null;for (var q=0;q<label.childNodes.length;q++){if (String(label.childNodes[q].className).search("dhx_acc_item_arrow") != -1) arrow = label.childNodes[q];};if (arrow != null){arrow.className = "dhx_acc_item_arrow "+(this.idPull[a]._isActive?"item_opened":"item_closed");arrow = null;}}};this.setText = function(itemId, itemText, moveLabel) {if (that.idPull[itemId] == null)return;var label = that.idPull[itemId].childNodes[0];var tObj = null;for (var q=0;q<label.childNodes.length;q++){if (label.childNodes[q].tagName != null){if (String(label.childNodes[q].tagName).toLowerCase() == "span") tObj = label.childNodes[q];}};if (!isNaN(moveLabel)) {tObj.style.paddingLeft = moveLabel+"px";tObj.style.paddingRight = moveLabel+"px";}else {tObj.innerHTML = itemText;}};this.getText = function(itemId) {if (that.idPull[itemId] == null)return;var label = that.idPull[itemId].childNodes[0];var tObj = null;for (var q=0;q<label.childNodes.length;q++){if (label.childNodes[q].tagName != null){if (String(label.childNodes[q].tagName).toLowerCase() == "span") tObj = label.childNodes[q];}};return tObj.innerHTML;};this._initWindows = function(id) {if (!window.dhtmlXWindows)return;if (!this.dhxWins){this.dhxWins = new dhtmlXWindows();this.dhxWins.setSkin(this.skin);this.dhxWins.setImagePath(this.imagePath);this.dhxWinsIdPrefix = "";if (!id)return;};var idd = this.dhxWinsIdPrefix+id;if (!this.dhxWins.window(idd)) {var self = this;var w1 = this.dhxWins.createWindow(idd, 20, 20, 320, 200);w1.setText(this.getText(id));w1.button("close").hide();w1.attachEvent("onClose", function(win){win.hide();});w1.addUserButton("dock", 99, this.dhxWins.i18n.dock, "dock");w1.button("dock").attachEvent("onClick", function(win){self.cells(id).dock();});}else {this.dhxWins.window(idd).show();}};this.dockWindow = function(itemId) {if (!this.idPull[itemId]._isUnDocked)return;if (!this.dhxWins)return;if (!this.dhxWins.window(this.dhxWinsIdPrefix+itemId)) return;this.dhxWins.window(this.dhxWinsIdPrefix+itemId).moveContentTo(this.idPull[itemId]);this.dhxWins.window(this.dhxWinsIdPrefix+itemId).close();this.idPull[itemId]._isUnDocked = false;this.showItem(itemId);this.callEvent("onDock", [itemId]);};this.undockWindow = function(itemId) {if (this.idPull[itemId]._isUnDocked)return;this._initWindows(itemId);this.idPull[itemId].moveContentTo(this.dhxWins.window(this.dhxWinsIdPrefix+itemId));this.idPull[itemId]._isUnDocked = true;this.hideItem(itemId);this.callEvent("onUnDock", [itemId]);};this.setSizes = function() {this._reopenItem();};this.showItem = function(itemId) {if (this.idPull[itemId] == null)return;if (!this.idPull[itemId]._isHidden)return;if (this.idPull[itemId]._isUnDocked){this.dockItem(itemId);return;};this.idPull[itemId].className = "dhx_acc_item";this.idPull[itemId]._isHidden = false;this._defineLastItem();this._reopenItem();};this.hideItem = function(itemId) {if (this.idPull[itemId] == null)return;if (this.idPull[itemId]._isHidden)return;this.closeItem(itemId);this.idPull[itemId].className = "dhx_acc_item_hidden";this.idPull[itemId]._isHidden = true;this._defineLastItem();this._reopenItem();};this._reopenItem = function() {var toOpen = null;for (var a in this.idPull)if (this.idPull[a]._isActive && !this.idPull[a]._isHidden)toOpen = a;this.openItem(toOpen, null, true);};this.forEachItem = function(handler) {for (var a in this.idPull)handler(this.idPull[a]);};this._enableOpenEffect = false;this._openStep = 10;this._openStepIncrement = 5;this._openStepTimeout = 10;this._openBuzy = false;this.setEffect = function(state) {this._enableOpenEffect = (state==true?true:false);};this._openWithEffect = function(toOpen, toClose, minH, maxH, step, callEvent) {if (this.multiMode){if (!step){this._openBuzy = true;step = this._openStep;if (this.idPull[toOpen]._isActive){toClose = toOpen;toOpen = null;minH = this.sk["cell_height"]+(this.idPull[toClose]!=this._lastVisible()?this.sk["cell_space"]:0);this.idPull[toClose].childNodes[1].style.display = "";}else {maxH = this.idPull[toOpen].h;this.idPull[toOpen].childNodes[1].style.display = "";}};var stopOpen = false;if (toOpen){var newH = parseInt(this.idPull[toOpen].style.height)+step;if (newH > maxH){newH = maxH;stopOpen = true;};this.idPull[toOpen].style.height = newH+"px";};if (toClose){var newH = parseInt(this.idPull[toClose].style.height)-step;if (newH < minH){newH = minH;stopOpen = true;};this.idPull[toClose].style.height = newH+"px";};step += this._openStepIncrement;if (stopOpen){if (toOpen){this.idPull[toOpen].adjustContent(this.idPull[toOpen], this.sk["cell_height"]+this.sk["content_offset"], null, null, (this.idPull[toOpen]==this._lastVisible()?0:this.sk["cell_space"]));this.idPull[toOpen].updateNestedObjects();this.idPull[toOpen]._isActive = true;};if (toClose){this.idPull[toClose].childNodes[1].style.display = "none";this.idPull[toClose]._isActive = false;};this._updateArrows();this._openBuzy = false;if (toOpen && callEvent == "dhx_accord_outer_event")this.callEvent("onActive", [toOpen,true]);if (toClose && callEvent == "dhx_accord_outer_event")this.callEvent("onActive", [toClose,false]);}else {var that = this;window.setTimeout(function(){that._openWithEffect(toOpen, toClose, minH, maxH, step, callEvent);},this._openStepTimeout);};return;};if (!step){this._openBuzy = true;step = this._openStep;if (toOpen)this.idPull[toOpen].childNodes[1].style.display = "";};if (!toClose || !minH || !maxH){minH = 0;maxH = 0;for (var a in this.idPull){var th = this.sk["cell_height"]+(this.idPull[a]!=this._lastVisible()&&a!=toOpen?this.sk["cell_space"]:0);if (this.idPull[a]._isActive && toOpen != a){toClose = a;minH = th;};if (a != toOpen)maxH += th;};maxH = this.base.offsetHeight - maxH;};var stopOpen = false;if (toOpen){var ha = parseInt(this.idPull[toOpen].style.height)+step;if (ha > maxH)stopOpen = true;};if (toClose){var hb = parseInt(this.idPull[toClose].style.height)-step;if (hb < minH)stopOpen = true;};step += this._openStepIncrement;if (stopOpen){ha = maxH;hb = minH;};if (toClose)this.idPull[toClose].style.height = hb+"px";if (toOpen)this.idPull[toOpen].style.height = ha+"px";if (stopOpen){if (toClose){this.idPull[toClose].childNodes[1].style.display = "none";this.idPull[toClose]._isActive = false;};if (toOpen){this.idPull[toOpen].adjustContent(this.idPull[toOpen], this.sk["cell_height"]+this.sk["content_offset"], null, null, (this.idPull[toOpen]==this._lastVisible()?0:this.sk["cell_space"]));this.idPull[toOpen].updateNestedObjects();this.idPull[toOpen]._isActive = true;};this._updateArrows();this._openBuzy = false;if (callEvent == "dhx_accord_outer_event" && toOpen)this.callEvent("onActive", [toOpen,true]);}else {var that = this;window.setTimeout(function(){that._openWithEffect(toOpen, toClose, minH, maxH, step, callEvent);},this._openStepTimeout);}};this.setActive = function(itemId) {this.openItem(itemId);};this.isActive = function(itemId) {return (this.idPull[itemId]._isActive === true?true:false);};this.dockItem = function(itemId) {this.dockWindow(itemId);};this.undockItem = function(itemId) {this.undockWindow(itemId);};this.setItemHeight = function(itemId, height) {if (!this.multiMode)return;if (isNaN(height)) return;this.idPull[itemId].h = height;this._reopenItem();};this.setIcon = function(itemId, icon) {if (this.idPull[itemId] == null)return;var label = this.idPull[itemId].childNodes[0];var iconObj = null;for (var q=0;q<label.childNodes.length;q++){if (label.childNodes[q].className == "dhx_acc_item_icon")iconObj = label.childNodes[q];};if (iconObj == null){iconObj = document.createElement("IMG");iconObj.className = "dhx_acc_item_icon";label.insertBefore(iconObj, label.childNodes[0]);this.setText(itemId, null, 20);};iconObj.src = this.imagePath+icon;};this.clearIcon = function(itemId) {if (this.idPull[itemId] == null)return;var label = this.idPull[itemId].childNodes[0];var iconObj = null;for (var q=0;q<label.childNodes.length;q++){if (label.childNodes[q].className == "dhx_acc_item_icon")iconObj = label.childNodes[q];};if (iconObj != null){label.removeChild(iconObj);iconObj = null;this.setText(itemId, null, 0);}};this.moveOnTop = function(itemId) {if (!this.idPull[itemId])return;if (this.base.childNodes.length <= 1)return;this.base.insertBefore(this.idPull[itemId], this.base.childNodes[0])
 this.setSizes();};this._defineLastItem = function() {if (this.multiMode)return;var done = false;for (var q=this.base.childNodes.length-1;q>=0;q--){if ((this.base.childNodes[q].className).search("last_item") >= 0) {if (this.base.childNodes[q]._isHidden || done){this.base.childNodes[q].className = String(this.base.childNodes[q].className).replace(/last_item/gi,"");}}else {if (!this.base.childNodes[q]._isHidden && !done){this.base.childNodes[q].className += " last_item";done = true;}}}};this.removeItem = function(itemId) {var item = this.idPull[itemId];var label = item.childNodes[0];label.onclick = null;label.onmouseover = null;label.onmouseout = null;label.onselectstart = null;label._idd = null;label.className = "";while (label.childNodes.length > 0)label.removeChild(label.childNodes[0]);if (label.parentNode)label.parentNode.removeChild(label);label = null;item._dhxContDestruct();while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);item._dhxContDestruct = null;item._doOnAttachMenu = null;item._doOnAttachToolbar = null;item._doOnAttachStatusBar = null;item.clearIcon = null;item.close = null;item.dock = null;item.getId = null;item.getText = null;item.hide = null;item.isOpened = null;item.open = null;item.setHeight = null;item.setIcon = null;item.setText = null;item.show = null;item.undock = null;if (item.parentNode)item.parentNode.removeChild(item);item = null;this.idPull[itemId] = null;try {delete this.idPull[itemId];}catch(e){}};this.unload = function() {for (var a in this.skinParams){this.skinParams[a] = null;try {delete this.skinParams[a];}catch(e){}};this.skinParams = null;for (var a in this.idPull)this.removeItem(a);this.idPull = null;this.sk = null;this._initWindows = null;this._lastVisible = null;this._reopenItem = null;this._updateArrows = null;this.addItem = null;this.attachEvent = null;this.callEvent = null;this.cells = null;this.checkEvent = null;this.clearIcon = null;this.closeItem = null;this.detachEvent = null;this.dockItem = null;this.dockWindow = null;this.enableMultiMode = null;this.eventCatcher = null;this.forEachItem = null;this.getText = null;this.h = null;this.hideItem = null;this.imagePath = null;this.isActive = null;this.itemH = null;this.multiMode = null;this.openItem = null;this.removeItem = null;this.setActive = null;this.setEffect = null;this.setIcon = null;this.setIconsPath = null;this.setItemHeight = null;this.setOffset = null;this.setSizes = null;this.setSkin = null;this.setSkinParameters = null;this.setText = null;this.showItem = null;this.skin = null;this.w = null;this.undockItem = null;this.undockWindow = null;this.undockWindowunload = null;this.unload = null;this.userOffset = null;if (this._isAccFS == true){if (_isIE){window.detachEvent("onresize", this._doOnResize);}else {window.removeEventListener("resize", this._doOnResize, false);};this._isAccFS = null;this._doOnResize = null;this._adjustAccordion = null;this._adjustToFullScreen = null;this._resizeTM = null;this._resizeTMTime = null;document.body.className = String(document.body.className).replace("dhxacc_fullscreened","");this.cont.obj._dhxContDestruct();if (this.cont.dhxcont.parentNode)this.cont.dhxcont.parentNode.removeChild(this.cont.dhxcont);this.cont.dhxcont = null;this.cont.setContent = null;this.cont = null;};if (this.dhxWins){this.dhxWins.unload();this.dhxWins = null;};this.base.className = "";this.base = null;for (var a in this)try {delete this[a];}catch(e){}};this._initWindows();dhtmlxEventable(this);return this;};dhtmlXAccordion.prototype.i18n = {dhxcontalert: "dhtmlxcontainer.js is missed on the page"
};(function(){dhtmlx.extend_api("dhtmlXAccordion",{_init:function(obj){return [obj.parent, obj.skin];},
 icon_path:"setIconsPath",
 items:"_items",
 effect: "setEffect",
 multi_mode:"enableMultiMode"
 },{_items:function(arr){var toOpen = [];var toClose = [];for (var i=0;i < arr.length;i++){var item=arr[i];this.addItem(item.id, item.text);if (item.img)this.cells(item.id).setIcon(item.img);if (item.height)this.cells(item.id).setHeight(item.height);if (item.open === true)toOpen[toOpen.length] = item.id;if (item.open === false)toClose[toClose.length] = item.id;};for (var q=0;q<toOpen.length;q++)this.cells(toOpen[q]).open();for (var q=0;q<toClose.length;q++)this.cells(toClose[q]).close();}});})();function dhtmlXContainer(obj) {var that = this;this.obj = obj;this.dhxcont = null;this.st = document.createElement("DIV");this.st.style.position = "absolute";this.st.style.left = "-200px";this.st.style.top = "0px";this.st.style.width = "100px";this.st.style.height = "1px";this.st.style.visibility = "hidden";this.st.style.overflow = "hidden";document.body.insertBefore(this.st, document.body.childNodes[0]);this.obj._getSt = function() {return that.st;};this.obj.dv = "def";this.obj.av = this.obj.dv;this.obj.cv = this.obj.av;this.obj.vs = {};this.obj.vs[this.obj.av] = {};this.obj.view = function(name) {if (!this.vs[name]){this.vs[name] = {};this.vs[name].dhxcont = this.vs[this.dv].dhxcont;var mainCont = document.createElement("DIV");mainCont.style.position = "relative";mainCont.style.left = "0px";mainCont.style.width = "200px";mainCont.style.height = "200px";mainCont.style.overflow = "hidden";that.st.appendChild(mainCont);this.vs[name].dhxcont.mainCont[name] = mainCont;};this.avt = this.av;this.av = name;return this;};this.obj.setActive = function() {if (!this.vs[this.av])return;this.cv = this.av;if (this.vs[this.avt].dhxcont == this.vs[this.avt].dhxcont.mainCont[this.avt].parentNode){that.st.appendChild(this.vs[this.avt].dhxcont.mainCont[this.avt]);if (this.vs[this.avt].menu)that.st.appendChild(document.getElementById(this.vs[this.avt].menuId));if (this.vs[this.avt].toolbar)that.st.appendChild(document.getElementById(this.vs[this.avt].toolbarId));if (this.vs[this.avt].sb)that.st.appendChild(document.getElementById(this.vs[this.avt].sbId));};if (this._isCell){};if (this.vs[this.av].dhxcont != this.vs[this.av].dhxcont.mainCont[this.av].parentNode){this.vs[this.av].dhxcont.insertBefore(this.vs[this.av].dhxcont.mainCont[this.av],this.vs[this.av].dhxcont.childNodes[this.vs[this.av].dhxcont.childNodes.length-1]);if (this.vs[this.av].menu)this.vs[this.av].dhxcont.insertBefore(document.getElementById(this.vs[this.av].menuId), this.vs[this.av].dhxcont.childNodes[0]);if (this.vs[this.av].toolbar)this.vs[this.av].dhxcont.insertBefore(document.getElementById(this.vs[this.av].toolbarId), this.vs[this.av].dhxcont.childNodes[(this.vs[this.av].menu?1:0)]);if (this.vs[this.av].sb)this.vs[this.av].dhxcont.insertBefore(document.getElementById(this.vs[this.av].sbId), this.vs[this.av].dhxcont.childNodes[this.vs[this.av].dhxcont.childNodes.length-1]);};if (this._doOnResize)this._doOnResize();this.avt = null;};this.obj._viewRestore = function() {var t = this.av;if (this.avt){this.av = this.avt;this.avt = null;};return t;};this.setContent = function(data) {this.obj.vs[this.obj.av].dhxcont = data;this.obj._init();};this.obj._init = function() {this.vs[this.av].dhxcont.innerHTML = "<div ida='dhxMainCont' style='position: relative;left: 0px;top: 0px;overflow: hidden;'></div>"+
 "<div ida='dhxContBlocker' class='dhxcont_content_blocker' style='display: none;'></div>";this.vs[this.av].dhxcont.mainCont = {};this.vs[this.av].dhxcont.mainCont[this.av] = this.vs[this.av].dhxcont.childNodes[0];};this.obj._genStr = function(w) {var s = "";var z = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for (var q=0;q<w;q++)s += z.charAt(Math.round(Math.random() * (z.length-1)));return s;};this.obj.setMinContentSize = function(w, h) {this.vs[this.av]._minDataSizeW = w;this.vs[this.av]._minDataSizeH = h;};this.obj._setPadding = function(p, altCss) {if (typeof(p)== "object") {this._offsetTop = p[0];this._offsetLeft = p[1];this._offsetWidth = p[2];this._offsetHeight = p[3];}else {this._offsetTop = p;this._offsetLeft = p;this._offsetWidth = -p*2;this._offsetHeight = -p*2;};this.vs[this.av].dhxcont.className = "dhxcont_global_content_area "+(altCss||"");};this.obj.moveContentTo = function(cont) {for (var a in this.vs){cont.view(a).setActive();var pref = null;if (this.vs[a].grid)pref = "grid";if (this.vs[a].tree)pref = "tree";if (this.vs[a].tabbar)pref = "tabbar";if (this.vs[a].folders)pref = "folders";if (this.vs[a].layout)pref = "layout";if (pref != null){cont.view(a).attachObject(this.vs[a][pref+"Id"]);cont.vs[a][pref] = this.vs[a][pref];cont.vs[a][pref+"Id"] = this.vs[a][pref+"Id"];cont.vs[a][pref+"Obj"] = this.vs[a][pref+"Obj"];this.vs[a][pref] = null;this.vs[a][pref+"Id"] = null;this.vs[a][pref+"Obj"] = null;};if (this.vs[a]._frame){cont.vs[a]._frame = this.vs[a]._frame;this.vs[a]._frame = null;};if (this.vs[a].menu != null){if (cont.cv == cont.av){cont.vs[cont.av].dhxcont.insertBefore(document.getElementById(this.vs[a].menuId), cont.vs[cont.av].dhxcont.childNodes[0]);}else {cont._getSt().appendChild(document.getElementById(this.vs[a].menuId));};cont.vs[a].menu = this.vs[a].menu;cont.vs[a].menuId = this.vs[a].menuId;cont.vs[a].menuHeight = this.vs[a].menuHeight;this.vs[a].menu = null;this.vs[a].menuId = null;this.vs[a].menuHeight = null;if (this.cv == this.av && this._doOnAttachMenu)this._doOnAttachMenu("unload");if (cont.cv == cont.av && cont._doOnAttachMenu)cont._doOnAttachMenu("move");};if (this.vs[a].toolbar != null){if (cont.cv == cont.av){cont.vs[cont.av].dhxcont.insertBefore(document.getElementById(this.vs[a].toolbarId), cont.vs[cont.av].dhxcont.childNodes[(cont.vs[cont.av].menu!=null?1:0)]);}else {cont._getSt().appendChild(document.getElementById(this.vs[a].toolbarId));};cont.vs[a].toolbar = this.vs[a].toolbar;cont.vs[a].toolbarId = this.vs[a].toolbarId;cont.vs[a].toolbarHeight = this.vs[a].toolbarHeight;this.vs[a].toolbar = null;this.vs[a].toolbarId = null;this.vs[a].toolbarHeight = null;if (this.cv == this.av && this._doOnAttachToolbar)this._doOnAttachToolbar("unload");if (cont.cv == cont.av && cont._doOnAttachToolbar)cont._doOnAttachToolbar("move");};if (this.vs[a].sb != null){if (cont.cv == cont.av){cont.vs[cont.av].dhxcont.insertBefore(document.getElementById(this.vs[a].sbId), cont.vs[cont.av].dhxcont.childNodes[cont.vs[cont.av].dhxcont.childNodes.length-1]);}else {cont._getSt().appendChild(document.getElementById(this.vs[a].sbId));};cont.vs[a].sb = this.vs[a].sb;cont.vs[a].sbId = this.vs[a].sbId;cont.vs[a].sbHeight = this.vs[a].sbHeight;this.vs[a].sb = null;this.vs[a].sbId = null;this.vs[a].sbHeight = null;if (this.cv == this.av && this._doOnAttachStatusBar)this._doOnAttachStatusBar("unload");if (cont.cv == cont.av && cont._doOnAttachStatusBar)cont._doOnAttachStatusBar("move");};var objA = this.vs[a].dhxcont.mainCont[a];var objB = cont.vs[a].dhxcont.mainCont[a];while (objA.childNodes.length > 0)objB.appendChild(objA.childNodes[0]);};cont.view(this.av).setActive();};this.obj.adjustContent = function(parentObj, offsetTop, marginTop, notCalcWidth, offsetBottom) {this.vs[this.av].dhxcont.style.left = (this._offsetLeft||0)+"px";this.vs[this.av].dhxcont.style.top = (this._offsetTop||0)+offsetTop+"px";var cw = parentObj.clientWidth+(this._offsetWidth||0);if (notCalcWidth !== true)this.vs[this.av].dhxcont.style.width = Math.max(0, cw)+"px";if (notCalcWidth !== true)if (this.vs[this.av].dhxcont.offsetWidth > cw)this.vs[this.av].dhxcont.style.width = Math.max(0, cw*2-this.vs[this.av].dhxcont.offsetWidth)+"px";var ch = parentObj.clientHeight+(this._offsetHeight||0);this.vs[this.av].dhxcont.style.height = Math.max(0, ch-offsetTop)+(marginTop!=null?marginTop:0)+"px";if (this.vs[this.av].dhxcont.offsetHeight > ch - offsetTop)this.vs[this.av].dhxcont.style.height = Math.max(0, (ch-offsetTop)*2-this.vs[this.av].dhxcont.offsetHeight)+"px";if (offsetBottom)if (!isNaN(offsetBottom)) this.vs[this.av].dhxcont.style.height = Math.max(0, parseInt(this.vs[this.av].dhxcont.style.height)-offsetBottom)+"px";if (this.vs[this.av]._minDataSizeH != null){if (parseInt(this.vs[this.av].dhxcont.style.height)< this.vs[this.av]._minDataSizeH) this.vs[this.av].dhxcont.style.height = this.vs[this.av]._minDataSizeH+"px";};if (this.vs[this.av]._minDataSizeW != null){if (parseInt(this.vs[this.av].dhxcont.style.width)< this.vs[this.av]._minDataSizeW) this.vs[this.av].dhxcont.style.width = this.vs[this.av]._minDataSizeW+"px";};if (notCalcWidth !== true){this.vs[this.av].dhxcont.mainCont[this.av].style.width = this.vs[this.av].dhxcont.clientWidth+"px";if (this.vs[this.av].dhxcont.mainCont[this.av].offsetWidth > this.vs[this.av].dhxcont.clientWidth)this.vs[this.av].dhxcont.mainCont[this.av].style.width = Math.max(0, this.vs[this.av].dhxcont.clientWidth*2-this.vs[this.av].dhxcont.mainCont[this.av].offsetWidth)+"px";};var menuOffset = (this.vs[this.av].menu!=null?(!this.vs[this.av].menuHidden?this.vs[this.av].menuHeight:0):0);var toolbarOffset = (this.vs[this.av].toolbar!=null?(!this.vs[this.av].toolbarHidden?this.vs[this.av].toolbarHeight:0):0);var statusOffset = (this.vs[this.av].sb!=null?(!this.vs[this.av].sbHidden?this.vs[this.av].sbHeight:0):0);this.vs[this.av].dhxcont.mainCont[this.av].style.height = this.vs[this.av].dhxcont.clientHeight+"px";if (this.vs[this.av].dhxcont.mainCont[this.av].offsetHeight > this.vs[this.av].dhxcont.clientHeight)this.vs[this.av].dhxcont.mainCont[this.av].style.height = Math.max(0, this.vs[this.av].dhxcont.clientHeight*2-this.vs[this.av].dhxcont.mainCont[this.av].offsetHeight)+"px";this.vs[this.av].dhxcont.mainCont[this.av].style.height = Math.max(0, parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)-menuOffset-toolbarOffset-statusOffset)+"px";};this.obj.coverBlocker = function() {return this.vs[this.av].dhxcont.childNodes[this.vs[this.av].dhxcont.childNodes.length-1];};this.obj.showCoverBlocker = function() {this.coverBlocker().style.display = "";};this.obj.hideCoverBlocker = function() {this.coverBlocker().style.display = "none";};this.obj.updateNestedObjects = function() {if (this.vs[this.av].grid){this.vs[this.av].grid.setSizes();};if (this.vs[this.av].sched){this.vs[this.av].sched.setSizes();};if (this.vs[this.av].tabbar){this.vs[this.av].tabbar.adjustOuterSize();};if (this.vs[this.av].folders){this.vs[this.av].folders.setSizes();};if (this.vs[this.av].editor){if (!_isIE)this.vs[this.av].editor._prepareContent(true);this.vs[this.av].editor.setSizes();};if (this.vs[this.av].layout){if (this.vs[this.av]._isAcc && this.vs[this.av].skin == "dhx_skyblue"){this.vs[this.av].layoutObj.style.width = parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)+2+"px";this.vs[this.av].layoutObj.style.height = parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)+2+"px";}else {this.vs[this.av].layoutObj.style.width = this.vs[this.av].dhxcont.mainCont[this.av].style.width;this.vs[this.av].layoutObj.style.height = this.vs[this.av].dhxcont.mainCont[this.av].style.height;};this.vs[this.av].layout.setSizes();};if (this.vs[this.av].accordion != null){if (this.vs[this.av].skin == "dhx_web"){this.vs[this.av].accordionObj.style.width = parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)+"px";this.vs[this.av].accordionObj.style.height = parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)+"px";}else {this.vs[this.av].accordionObj.style.width = parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)+2+"px";this.vs[this.av].accordionObj.style.height = parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)+2+"px";};this.vs[this.av].accordion.setSizes();};if (this.vs[this.av].dockedCell){this.vs[this.av].dockedCell.updateNestedObjects();};if (this.vs[this.av].form)this.vs[this.av].form.setSizes();};this.obj.attachStatusBar = function() {if (this.vs[this.av].sb)return;var sbObj = document.createElement("DIV");if (this._isCell){sbObj.className = "dhxcont_sb_container_layoutcell";}else {sbObj.className = "dhxcont_sb_container";};sbObj.id = "sbobj_"+this._genStr(12);sbObj.innerHTML = "<div class='dhxcont_statusbar'></div>";if (this.cv == this.av)this.vs[this.av].dhxcont.insertBefore(sbObj, this.vs[this.av].dhxcont.childNodes[this.vs[this.av].dhxcont.childNodes.length-1]);else that.st.appendChild(sbObj);sbObj.setText = function(text) {this.childNodes[0].innerHTML = text;};sbObj.getText = function() {return this.childNodes[0].innerHTML;};sbObj.onselectstart = function(e) {e=e||event;e.returnValue=false;return false;};this.vs[this.av].sb = sbObj;this.vs[this.av].sbHeight = (this.skin=="dhx_web"?41:(this.skin=="dhx_skyblue"?23:sbObj.offsetHeight));this.vs[this.av].sbId = sbObj.id;if (this._doOnAttachStatusBar)this._doOnAttachStatusBar("init");this.adjust();return this.vs[this._viewRestore()].sb;};this.obj.detachStatusBar = function() {if (!this.vs[this.av].sb)return;this.vs[this.av].sb.setText = null;this.vs[this.av].sb.getText = null;this.vs[this.av].sb.onselectstart = null;this.vs[this.av].sb.parentNode.removeChild(this.vs[this.av].sb);this.vs[this.av].sb = null;this.vs[this.av].sbHeight = null;this.vs[this.av].sbId = null;this._viewRestore();if (this._doOnAttachStatusBar)this._doOnAttachStatusBar("unload");};this.obj.attachMenu = function(skin) {if (this.vs[this.av].menu)return;var menuObj = document.createElement("DIV");menuObj.style.position = "relative";menuObj.style.overflow = "hidden";menuObj.id = "dhxmenu_"+this._genStr(12);if (this.cv == this.av)this.vs[this.av].dhxcont.insertBefore(menuObj, this.vs[this.av].dhxcont.childNodes[0]);else that.st.appendChild(menuObj);this.vs[this.av].menu = new dhtmlXMenuObject(menuObj.id, (skin||this.skin));this.vs[this.av].menuHeight = (this.skin=="dhx_web"?29:menuObj.offsetHeight);this.vs[this.av].menuId = menuObj.id;if (this._doOnAttachMenu)this._doOnAttachMenu("init");this.adjust();return this.vs[this._viewRestore()].menu;};this.obj.detachMenu = function() {if (!this.vs[this.av].menu)return;var menuObj = document.getElementById(this.vs[this.av].menuId);this.vs[this.av].menu.unload();this.vs[this.av].menu = null;this.vs[this.av].menuId = null;this.vs[this.av].menuHeight = null;menuObj.parentNode.removeChild(menuObj);menuObj = null;this._viewRestore();if (this._doOnAttachMenu)this._doOnAttachMenu("unload");};this.obj.attachToolbar = function(skin) {if (this.vs[this.av].toolbar)return;var toolbarObj = document.createElement("DIV");toolbarObj.style.position = "relative";toolbarObj.style.overflow = "hidden";toolbarObj.id = "dhxtoolbar_"+this._genStr(12);if (this.cv == this.av)this.vs[this.av].dhxcont.insertBefore(toolbarObj, this.vs[this.av].dhxcont.childNodes[(this.vs[this.av].menu!=null?1:0)]);else that.st.appendChild(toolbarObj);this.vs[this.av].toolbar = new dhtmlXToolbarObject(toolbarObj.id, (skin||this.skin));this.vs[this.av].toolbarHeight = (this.skin=="dhx_web"?41:toolbarObj.offsetHeight+(this._isLayout&&this.skin=="dhx_skyblue"?2:0));this.vs[this.av].toolbarId = toolbarObj.id;if (this._doOnAttachToolbar)this._doOnAttachToolbar("init");this.adjust();return this.vs[this._viewRestore()].toolbar;};this.obj.detachToolbar = function() {if (!this.vs[this.av].toolbar)return;var toolbarObj = document.getElementById(this.vs[this.av].toolbarId);this.vs[this.av].toolbar.unload();this.vs[this.av].toolbar = null;this.vs[this.av].toolbarId = null;this.vs[this.av].toolbarHeight = null;toolbarObj.parentNode.removeChild(toolbarObj);toolbarObj = null;this._viewRestore();if (this._doOnAttachToolbar)this._doOnAttachToolbar("unload");};this.obj.attachGrid = function() {if (this._isWindow && this.skin == "dhx_skyblue"){this.vs[this.av].dhxcont.mainCont[this.av].style.border = "#a4bed4 1px solid";this._redraw();};var obj = document.createElement("DIV");obj.id = "dhxGridObj_"+this._genStr(12);obj.style.width = "100%";obj.style.height = "100%";obj.cmp = "grid";document.body.appendChild(obj);this.attachObject(obj.id, false, true);this.vs[this.av].grid = new dhtmlXGridObject(obj.id);this.vs[this.av].grid.setSkin(this.skin);if (this.skin != "dhx_web"){this.vs[this.av].grid.entBox.style.border = "0px solid white";this.vs[this.av].grid._sizeFix=0;};this.vs[this.av].gridId = obj.id;this.vs[this.av].gridObj = obj;return this.vs[this._viewRestore()].grid;};this.obj.attachScheduler = function(day,mode) {var obj = document.createElement("DIV");obj.id = "dhxSchedObj_"+this._genStr(12);obj.innerHTML = '<div id="'+obj.id+'" class="dhx_cal_container" style="width:100%;height:100%;"><div class="dhx_cal_navline"><div class="dhx_cal_prev_button">&nbsp;</div><div class="dhx_cal_next_button">&nbsp;</div><div class="dhx_cal_today_button"></div><div class="dhx_cal_date"></div><div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div><div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div><div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div></div><div class="dhx_cal_header"></div><div class="dhx_cal_data"></div></div>';document.body.appendChild(obj.firstChild);this.attachObject(obj.id, false, true);this.vs[this.av].sched = scheduler;this.vs[this.av].schedId = obj.id;scheduler.setSizes = scheduler.update_view;scheduler.destructor=function(){};scheduler.init(obj.id,day,mode);return this.vs[this._viewRestore()].sched;};this.obj.attachTree = function(rootId) {if (this._isWindow && this.skin == "dhx_skyblue"){this.vs[this.av].dhxcont.mainCont[this.av].style.border = "#a4bed4 1px solid";this._redraw();};var obj = document.createElement("DIV");obj.id = "dhxTreeObj_"+this._genStr(12);obj.style.width = "100%";obj.style.height = "100%";obj.cmp = "tree";document.body.appendChild(obj);this.attachObject(obj.id, false, true);this.vs[this.av].tree = new dhtmlXTreeObject(obj.id, "100%", "100%", (rootId||0));this.vs[this.av].tree.setSkin(this.skin);this.vs[this.av].tree.allTree.childNodes[0].style.marginTop = "2px";this.vs[this.av].tree.allTree.childNodes[0].style.marginBottom = "2px";this.vs[this.av].treeId = obj.id;this.vs[this.av].treeObj = obj;return this.vs[this._viewRestore()].tree;};this.obj.attachTabbar = function(mode) {if (this._isWindow && this.skin == "dhx_skyblue"){this.vs[this.av].dhxcont.style.border = "none";this.setDimension(this.w, this.h);};var obj = document.createElement("DIV");obj.id = "dhxTabbarObj_"+this._genStr(12);obj.style.width = "100%";obj.style.height = "100%";obj.style.overflow = "hidden";obj.cmp = "tabbar";document.body.appendChild(obj);this.attachObject(obj.id, false, true);if (this.className == "dhtmlxLayoutSinglePoly")this.hideHeader();this.vs[this.av].tabbar = new dhtmlXTabBar(obj.id, mode||"top", 20);if (!this._isWindow)this.vs[this.av].tabbar._s.expand = true;this.vs[this.av].tabbar.setSkin(this.skin);this.vs[this.av].tabbar.adjustOuterSize();this.vs[this.av].tabbarId = obj.id;this.vs[this.av].tabbarObj = obj;return this.vs[this._viewRestore()].tabbar;};this.obj.attachFolders = function() {if (this._isWindow && this.skin == "dhx_skyblue"){this.vs[this.av].dhxcont.mainCont[this.av].style.border = "#a4bed4 1px solid";this._redraw();};var obj = document.createElement("DIV");obj.id = "dhxFoldersObj_"+this._genStr(12);obj.style.width = "100%";obj.style.height = "100%";obj.style.overflow = "hidden";obj.cmp = "folders";document.body.appendChild(obj);this.attachObject(obj.id, false, true);this.vs[this.av].folders = new dhtmlxFolders(obj.id);this.vs[this.av].folders.setSizes();this.vs[this.av].foldersId = obj.id;this.vs[this.av].foldersObj = obj;return this.vs[this._viewRestore()].folders;};this.obj.attachAccordion = function() {if (this._isWindow && this.skin == "dhx_skyblue"){this.vs[this.av].dhxcont.mainCont[this.av].style.border = "#a4bed4 1px solid";this._redraw();};var obj = document.createElement("DIV");obj.id = "dhxAccordionObj_"+this._genStr(12);if (this.skin == "dhx_web"){obj.style.left = "0px";obj.style.top = "0px";obj.style.width = parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)+"px";obj.style.height = parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)+"px";}else {obj.style.left = "-1px";obj.style.top = "-1px";obj.style.width = parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)+2+"px";obj.style.height = parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)+2+"px";};obj.style.position = "relative";obj.cmp = "accordion";document.body.appendChild(obj);this.attachObject(obj.id, false, true);this.vs[this.av].accordion = new dhtmlXAccordion(obj.id, this.skin);this.vs[this.av].accordion.setSizes();this.vs[this.av].accordionId = obj.id;this.vs[this.av].accordionObj = obj;return this.vs[this._viewRestore()].accordion;};this.obj.attachLayout = function(view, skin) {if (this._isCell && this.skin == "dhx_skyblue"){this.hideHeader();this.vs[this.av].dhxcont.style.border = "0px solid white";this.adjustContent(this.childNodes[0], 0);};if (this._isCell && this.skin == "dhx_web"){this.hideHeader();};var obj = document.createElement("DIV");obj.id = "dhxLayoutObj_"+this._genStr(12);obj.style.overflow = "hidden";obj.style.position = "absolute";obj.style.left = "0px";obj.style.top = "0px";obj.style.width = parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)+"px";obj.style.height = parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)+"px";if (this._isAcc && this.skin == "dhx_skyblue"){obj.style.left = "-1px";obj.style.top = "-1px";obj.style.width = parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.width)+2+"px";obj.style.height = parseInt(this.vs[this.av].dhxcont.mainCont[this.av].style.height)+2+"px";};obj.dhxContExists = true;obj.cmp = "layout";document.body.appendChild(obj);this.attachObject(obj.id, false, true);this.vs[this.av].layout = new dhtmlXLayoutObject(obj, view, (skin||this.skin));if (this._isWindow)this.attachEvent("_onBeforeTryResize", this.vs[this.av].layout._defineWindowMinDimension);this.vs[this.av].layoutId = obj.id;this.vs[this.av].layoutObj = obj;return this.vs[this._viewRestore()].layout;};this.obj.attachEditor = function(skin) {if (this._isWindow && this.skin == "dhx_skyblue"){this.vs[this.av].dhxcont.mainCont[this.av].style.border = "#a4bed4 1px solid";this._redraw();};var obj = document.createElement("DIV");obj.id = "dhxEditorObj_"+this._genStr(12);obj.style.position = "relative";obj.style.display = "none";obj.style.overflow = "hidden";obj.style.width = "100%";obj.style.height = "100%";obj.cmp = "editor";document.body.appendChild(obj);this.attachObject(obj.id, false, true);this.vs[this.av].editor = new dhtmlXEditor(obj.id, this.skin);this.vs[this.av].editorId = obj.id;this.vs[this.av].editorObj = obj;return this.vs[this._viewRestore()].editor;};this.obj.attachMap = function(opts) {var obj = document.createElement("DIV");obj.id = "GMapsObj_"+this._genStr(12);obj.style.position = "relative";obj.style.display = "none";obj.style.overflow = "hidden";obj.style.width = "100%";obj.style.height = "100%";obj.cmp = "gmaps";document.body.appendChild(obj);this.attachObject(obj.id, false, true);if (!opts)opts = {center: new google.maps.LatLng(40.719837,-73.992348), zoom: 11, mapTypeId: google.maps.MapTypeId.ROADMAP};this.vs[this.av].gmaps = new google.maps.Map(obj, opts);return this.vs[this.av].gmaps;};this.obj.attachObject = function(obj, autoSize, localCall) {if (typeof(obj)== "string") obj = document.getElementById(obj);if (autoSize){obj.style.visibility = "hidden";obj.style.display = "";var objW = obj.offsetWidth;var objH = obj.offsetHeight;};this._attachContent("obj", obj);if (autoSize && this._isWindow){obj.style.visibility = "visible";this._adjustToContent(objW, objH);};if (!localCall)this._viewRestore();};this.obj.detachObject = function(remove, moveTo) {var p = null;var pObj = null;var t = ["tree","grid","layout","tabbar","accordion","folders"];for (var q=0;q<t.length;q++){if (this.vs[this.av][t[q]]){p = this.vs[this.av][t[q]];pObj = this.vs[this.av][t[q]+"Obj"];if (remove){if (p.unload)p.unload();if (p.destructor)p.destructor();while (pObj.childNodes.length > 0)pObj.removeChild(pObj.childNodes[0]);pObj.parentNode.removeChild(pObj);pObj = null;p = null;}else {document.body.appendChild(pObj);pObj.style.display = "none";};this.vs[this.av][t[q]] = null;this.vs[this.av][t[q]+"Id"] = null;this.vs[this.av][t[q]+"Obj"] = null;}};if (p != null && pObj != null)return new Array(p, pObj);if (remove && this.vs[this.av]._frame){this._detachURLEvents();this.vs[this.av]._frame = null;};var objA = this.vs[this.av].dhxcont.mainCont[this.av];while (objA.childNodes.length > 0){if (remove == true){objA.removeChild(objA.childNodes[0]);}else {var obj = objA.childNodes[0];if (moveTo != null){if (typeof(moveTo)!= "object") moveTo = document.getElementById(moveTo);moveTo.appendChild(obj);}else {document.body.appendChild(obj);};obj.style.display = "none";}}};this.obj.appendObject = function(obj) {if (typeof(obj)== "string") {obj = document.getElementById(obj);};this._attachContent("obj", obj, true);};this.obj.attachHTMLString = function(str) {this._attachContent("str", str);var z=str.match(/<script[^>]*>[^\f]*?<\/script>/g)||[];for (var i=0;i<z.length;i++){var s=z[i].replace(/<([\/]{0,1})script[^>]*>/g,"")
 if (window.execScript)window.execScript(s);else window.eval(s);}};this.obj.attachURL = function(url, ajax) {this._attachContent((ajax==true?"urlajax":"url"), url, false);this._viewRestore();};this.obj.adjust = function() {if (this.skin == "dhx_skyblue"){if (this.vs[this.av].menu){if (this._isWindow || this._isLayout){this.vs[this.av].menu._topLevelOffsetLeft = 0;document.getElementById(this.vs[this.av].menuId).style.height = "26px";this.vs[this.av].menuHeight = document.getElementById(this.vs[this.av].menuId).offsetHeight;if (this._doOnAttachMenu)this._doOnAttachMenu("show");};if (this._isCell){document.getElementById(this.vs[this.av].menuId).className += " in_layoutcell";this.vs[this.av].menuHeight = 25;};if (this._isAcc){document.getElementById(this.vs[this.av].menuId).className += " in_acccell";this.vs[this.av].menuHeight = 25;};if (this._doOnAttachMenu)this._doOnAttachMenu("adjust");};if (this.vs[this.av].toolbar){if (this._isWindow || this._isLayout){document.getElementById(this.vs[this.av].toolbarId).style.height = "29px";this.vs[this.av].toolbarHeight = document.getElementById(this.vs[this.av].toolbarId).offsetHeight;if (this._doOnAttachToolbar)this._doOnAttachToolbar("show");};if (this._isCell){document.getElementById(this.vs[this.av].toolbarId).className += " in_layoutcell";};if (this._isAcc){document.getElementById(this.vs[this.av].toolbarId).className += " in_acccell";}}};if (this.skin == "dhx_web"){}};this.obj._attachContent = function(type, obj, append) {if (append !== true){if (this.vs[this.av]._frame){this._detachURLEvents();this.vs[this.av]._frame = null;};while (this.vs[this.av].dhxcont.mainCont[this.av].childNodes.length > 0)this.vs[this.av].dhxcont.mainCont[this.av].removeChild(this.vs[this.av].dhxcont.mainCont[this.av].childNodes[0]);};if (type == "url"){if (this._isWindow && obj.cmp == null && this.skin == "dhx_skyblue"){this.vs[this.av].dhxcont.mainCont[this.av].style.border = "#a4bed4 1px solid";this._redraw();};var fr = document.createElement("IFRAME");fr.frameBorder = 0;fr.border = 0;fr.style.width = "100%";fr.style.height = "100%";fr.setAttribute("src","javascript:false;");this.vs[this.av].dhxcont.mainCont[this.av].appendChild(fr);fr.src = obj;this.vs[this.av]._frame = fr;this._attachURLEvents();}else if (type == "urlajax"){if (this._isWindow && obj.cmp == null && this.skin == "dhx_skyblue"){this.vs[this.av].dhxcont.mainCont[this.av].style.border = "#a4bed4 1px solid";this.vs[this.av].dhxcont.mainCont[this.av].style.backgroundColor = "#FFFFFF";this._redraw();};var t = this;var xmlParser = function(){t.attachHTMLString(this.xmlDoc.responseText, this);if (t._doOnFrameContentLoaded)t._doOnFrameContentLoaded();this.destructor();};var xmlLoader = new dtmlXMLLoaderObject(xmlParser, window);xmlLoader.dhxWindowObject = this;xmlLoader.loadXML(obj);}else if (type == "obj"){if (this._isWindow && obj.cmp == null && this.skin == "dhx_skyblue"){this.vs[this.av].dhxcont.mainCont[this.av].style.border = "#a4bed4 1px solid";this.vs[this.av].dhxcont.mainCont[this.av].style.backgroundColor = "#FFFFFF";this._redraw();};this.vs[this.av].dhxcont._frame = null;this.vs[this.av].dhxcont.mainCont[this.av].appendChild(obj);this.vs[this.av].dhxcont.mainCont[this.av].style.overflow = (append===true?"auto":"hidden");obj.style.display = "";}else if (type == "str"){if (this._isWindow && obj.cmp == null && this.skin == "dhx_skyblue"){this.vs[this.av].dhxcont.mainCont[this.av].style.border = "#a4bed4 1px solid";this.vs[this.av].dhxcont.mainCont[this.av].style.backgroundColor = "#FFFFFF";this._redraw();};this.vs[this.av].dhxcont._frame = null;this.vs[this.av].dhxcont.mainCont[this.av].innerHTML = obj;}};this.obj._attachURLEvents = function() {var t = this;var fr = this.vs[this.av]._frame;if (_isIE){fr.onreadystatechange = function(a) {if (fr.readyState == "complete"){try {fr.contentWindow.document.body.onmousedown=function(){if(t._doOnFrameMouseDown)t._doOnFrameMouseDown();}}catch(e){};try{if(t._doOnFrameContentLoaded)t._doOnFrameContentLoaded();}catch(e){}}}}else {fr.onload = function() {try{fr.contentWindow.onmousedown=function(){if(t._doOnFrameMouseDown)t._doOnFrameMouseDown();}}catch(e){};try{if(t._doOnFrameContentLoaded)t._doOnFrameContentLoaded();}catch(e){}}}};this.obj._detachURLEvents = function() {if (_isIE){try {this.vs[this.av]._frame.onreadystatechange = null;this.vs[this.av]._frame.contentWindow.document.body.onmousedown = null;this.vs[this.av]._frame.onload = null;}catch(e) {}}else {try {this.vs[this.av]._frame.contentWindow.onmousedown = null;this.vs[this.av]._frame.onload = null;}catch(e) {}}};this.obj.showMenu = function() {if (!(this.vs[this.av].menu && this.vs[this.av].menuId)) return;if (document.getElementById(this.vs[this.av].menuId).style.display != "none") return;this.vs[this.av].menuHidden = false;if (this._doOnAttachMenu)this._doOnAttachMenu("show");document.getElementById(this.vs[this.av].menuId).style.display = "";this._viewRestore();};this.obj.hideMenu = function() {if (!(this.vs[this.av].menu && this.vs[this.av].menuId)) return;if (document.getElementById(this.vs[this.av].menuId).style.display == "none") return;document.getElementById(this.vs[this.av].menuId).style.display = "none";this.vs[this.av].menuHidden = true;if (this._doOnAttachMenu)this._doOnAttachMenu("hide");this._viewRestore();};this.obj.showToolbar = function() {if (!(this.vs[this.av].toolbar && this.vs[this.av].toolbarId)) return;if (document.getElementById(this.vs[this.av].toolbarId).style.display != "none") return;this.vs[this.av].toolbarHidden = false;if (this._doOnAttachToolbar)this._doOnAttachToolbar("show");document.getElementById(this.vs[this.av].toolbarId).style.display = "";this._viewRestore();};this.obj.hideToolbar = function() {if (!(this.vs[this.av].toolbar && this.vs[this.av].toolbarId)) return;if (document.getElementById(this.vs[this.av].toolbarId).style.display == "none") return;this.vs[this.av].toolbarHidden = true;document.getElementById(this.vs[this.av].toolbarId).style.display = "none";if (this._doOnAttachToolbar)this._doOnAttachToolbar("hide");this._viewRestore();};this.obj.showStatusBar = function() {if (!(this.vs[this.av].sb && this.vs[this.av].sbId)) return;if (document.getElementById(this.vs[this.av].sbId).style.display != "none") return;this.vs[this.av].sbHidden = false;if (this._doOnAttachStatusBar)this._doOnAttachStatusBar("show");document.getElementById(this.vs[this.av].sbId).style.display = "";this._viewRestore();};this.obj.hideStatusBar = function() {if (!(this.vs[this.av].sb && this.vs[this.av].sbId)) return;if (document.getElementById(this.vs[this.av].sbId).style.display == "none") return;this.vs[this.av].sbHidden = true;document.getElementById(this.vs[this.av].sbId).style.display = "none";if (this._doOnAttachStatusBar)this._doOnAttachStatusBar("hide");this._viewRestore();};this.obj._dhxContDestruct = function() {var av = this.av;for (var a in this.vs){this.av = a;this.detachMenu();this.detachToolbar();this.detachStatusBar();this.detachObject(true);this.vs[a].dhxcont.mainCont[a].parentNode.removeChild(this.vs[a].dhxcont.mainCont[a]);this.vs[a].dhxcont.mainCont[a] = null;};this.vs[this.dv].dhxcont.mainCont = null;this.vs[this.dv].dhxcont.parentNode.removeChild(this.vs[this.dv].dhxcont);for (var a in this.vs)this.vs[a].dhxcont = null;this.vs = null;this.attachMenu = null;this.attachToolbar = null;this.attachStatusBar = null;this.detachMenu = null;this.detachToolbar = null;this.detachStatusBar = null;this.showMenu = null;this.showToolbar = null;this.showStatusBar = null;this.hideMenu = null;this.hideToolbar = null;this.hideStatusBar = null;this.attachGrid = null;this.attachScheduler = null;this.attachTree = null;this.attachTabbar = null;this.attachFolders = null;this.attachAccordion = null;this.attachLayout = null;this.attachEditor = null;this.attachObject = null;this.detachObject = null;this.appendObject = null;this.attachHTMLString = null;this.attachURL = null;this.view = null;this.show = null;this.adjust = null;this.setMinContentSize = null;this.moveContentTo = null;this.adjustContent = null;this.coverBlocker = null;this.showCoverBlocker = null;this.hideCoverBlocker = null;this.updateNestedObjects = null;this._attachContent = null;this._attachURLEvents = null;this._detachURLEvents = null;this._viewRestore = null;this._setPadding = null;this._init = null;this._genStr = null;this._dhxContDestruct = null;that.st.parentNode.removeChild(that.st);that.st = null;that.setContent = null;that.dhxcont = null;that.obj = null;that = null;if (dhtmlx.detaches)for (var a in dhtmlx.detaches)dhtmlx.detaches[a](this);};if (dhtmlx.attaches)for (var a in dhtmlx.attaches)this.obj[a] = dhtmlx.attaches[a];};function dhtmlxDblCalendarObject(contId, isAutoDraw, options){this.scriptName = 'dhtmlxcalendar.js';this.entObj = document.createElement("DIV");this.winHeader = null
 this.style = "dhtmlxdblcalendar";this.uid = 'sc&dblCal'+Math.round(1000000*Math.random());this.numLoaded = 2;this.options = {isWinHeader: false,
 headerText: 'dhtmlxDblCalendarObject',
 headerButtons: '', 
 
 
 
 isWinDrag: false,
 msgClose: "Close",
 msgMinimize: "Minimize",
 msgToday: "Today",
 msgClear: "Clear"
 };if (options)for (x in options)this.options[x] = options[x];this.entBox = document.createElement("TABLE");this.entBox.cellPadding = "0px";this.entBox.cellSpacing = "0px";this.entBox.className = this.style;this.entObj.appendChild(this.entBox);var entRow = this.entBox.insertRow(0);var calLeft = entRow.insertCell(0);calLeft.style.paddingRight = '2px';var calRight = entRow.insertCell(1);this.leftCalendar = new dhtmlxCalendarObject(calLeft, false, this.options);this.leftCalendar._dblC = this;this.leftCalendar.setOnClickHandler(this.doOnCLeftClick);this.rightCalendar = new dhtmlxCalendarObject(calRight, false, this.options);this.rightCalendar._dblC = this;this.rightCalendar.setOnClickHandler(this.doOnCRightClick);this.doOnClick = null;this.onLanguageLoaded = null;this.getPosition = this.leftCalendar.getPosition;this.startDrag = this.leftCalendar.startDrag;this.stopDrag = this.leftCalendar.stopDrag;this.onDrag = this.leftCalendar.onDrag;this.drawHeader = this.leftCalendar.drawHeader;dhtmlxEventable(this);var self = this;if (typeof(contId)!= 'string') this.con = contId;else this.con = document.getElementById(contId);if (isAutoDraw)this.draw ();};dhtmlXDblCalendarObject = dhtmlxDblCalendarObject;dhtmlxDblCalendarObject.prototype.setHeader = function(isVisible, isDrag, btnsOpt){this.leftCalendar.options.isWinHeader = this.options.isWinHeader = isVisible;this.leftCalendar.options.isWinDrag = this.options.isWinDrag = isDrag;if (btnsOpt)this.options.headerButtons = this.leftCalendar.options.headerButtons = btnsOpt;if (this.isAutoDraw)this.drawHeader();};dhtmlxDblCalendarObject.prototype.setYearsRange = function(minYear, maxYear){var cs = [this.leftCalendar, this.rightCalendar];for (var ind=0;ind < cs.length;ind++){cs[ind].options.yearsRange = [parseInt(minYear), parseInt(maxYear)];cs[ind].allYears = [];for (var i=minYear;i <= maxYear;i++)cs[ind].allYears.push(i);}};dhtmlxDblCalendarObject.prototype.show = function(){this.parent.style.display = 'block';};dhtmlxDblCalendarObject.prototype.hide = function(){this.parent.style.display = 'none';};dhtmlxDblCalendarObject.prototype.createStructure = function(){if (this.options.isWinHeader){var headerRow = this.entBox.insertRow(0).insertCell(0);headerRow.colSpan = 2;headerRow.align = 'right';this.winHeader = document.createElement('DIV');headerRow.appendChild(this.winHeader);};this.setParent(this.con);};dhtmlxDblCalendarObject.prototype.draw = function(){if (!this.parent)this.createStructure();this.drawHeader();this.leftCalendar.draw();this.rightCalendar.draw();this.isAutoDraw = true;};dhtmlxDblCalendarObject.prototype.loadUserLanguage = function(lang, userCBfunction){this.numLoaded = 0;if (userCBfunction)this.onLanguageLoaded = userCBfunction;this.leftCalendar.loadUserLanguage(lang, this.languageLoaded);this.rightCalendar.loadUserLanguage(lang, this.languageLoaded);};dhtmlxDblCalendarObject.prototype.languageLoaded = function(status){var self = this._dblC;self.numLoaded ++;if (self.numLoaded == 2){for (param in this.options)self.options[param] = this.options[param];if (this.isAutoDraw)self.drawHeader();if (self.onLanguageLoaded)self.onLanguageLoaded(status);}};dhtmlxDblCalendarObject.prototype.setParent = function(newParent){if (newParent){this.parent = newParent;this.parent.style.display = 'block';this.parent.appendChild(this.entObj);}};dhtmlxDblCalendarObject.prototype.setOnClickHandler = function(func){this.doOnClick = func;};dhtmlxDblCalendarObject.prototype.doOnCLeftClick = function(date){date = new Date (date);this._dblC.rightCalendar.setSensitive(date, null);if (this._dblC.doOnClick)this._dblC.doOnClick(date, this, "left");return true;};dhtmlxDblCalendarObject.prototype.doOnCRightClick = function(date){date = new Date (date);this._dblC.leftCalendar.setSensitive(null, date);if (this._dblC.doOnClick)this._dblC.doOnClick(date, this, "right");return true;};dhtmlxDblCalendarObject.prototype.setSensitive = function(){this.rightCalendar.setSensitive(null, this.leftCalendar.date[0]);this.leftCalendar.setSensitive(this.rightCalendar.date[0], null);};dhtmlxDblCalendarObject.prototype.minimize = function(){if (!this.winHeader)return;var tr = this.winHeader.parentNode.parentNode.nextSibling;tr.parentNode.parentNode.style.width = parseInt(tr.parentNode.parentNode.offsetWidth) + 'px';if (tr)tr.style.display = (tr.style.display == 'none')? 'block': 'none';};dhtmlxDblCalendarObject.prototype.setDate = function(dateFrom,dateTo){this.leftCalendar.setDate(dateFrom);this.rightCalendar.setDate(dateTo);this.leftCalendar.setSensitive(null, this.rightCalendar.date[0]);this.rightCalendar.setSensitive(this.leftCalendar.date[0], null);};dhtmlxDblCalendarObject.prototype.setDateFormat = function(format){this.leftCalendar.setDateFormat(format);this.rightCalendar.setDateFormat(format);};dhtmlxDblCalendarObject.prototype.isVisible = function(){return (this.parent.style.display == 'block'?true:false);};dhtmlxDblCalendarObject.prototype.setHolidays = function(dates){this.leftCalendar.setHolidays(dates);this.rightCalendar.setHolidays(dates);};function dhtmlxCalendarObject (base, isAutoDraw, options){if (typeof(base)== "object" && base.parent)
 {options = {};for (i in base)options [i] = base [i];};this.isAutoDraw = base.autoDraw === false ? false : (isAutoDraw === false ? false : true)
 this.contId = base.parent || base;this.scriptName = 'dhtmlxcalendar.js';this.date = [this.cutTime(new Date())];this.selDate = [this.cutTime(new Date())];this.curDate = this.cutTime(new Date());this.entObj = document.createElement("DIV");this.monthPan = document.createElement("TABLE");this.dlabelPan = document.createElement("TABLE");this.daysPan = document.createElement("TABLE");this.parent = null;this.style = "dhtmlxcalendar";this.skinName = dhtmlx.skin || "";this.doOnClick = null;this.sensitiveFrom = null;this.sensitiveTo = null;this.insensitiveDates = null;this.activeCell = null;this.hotCell = null;this.winHeader = null
 this.onLanguageLoaded = null;this.dragging = false;this.minimized = false;this.uid = 'sc&Cal'+Math.round(1000000*Math.random());this.holidays = null;this.time = false;this.daysCells = {};this.weekCells = {};this.con = [];this.conInd = [];this.activeCon = null;this.activeConInd = 0;this.userPosition = false;this.useIframe = true;this._c = this;dhtmlxEventable(this);this.options = {btnPrev: "&laquo;",
 btnBgPrev: null,
 btnNext: "&raquo;",
 btnBgNext: null,
 yearsRange: [1900, 2100],
 
 isMonthEditable: false,
 isYearEditable: false,
 
 isWinHeader: false,
 headerText : 'Calendar header',
 headerButtons: 'TMX', 
 
 
 isWinDrag: true
 };defLeng = {langname: 'en-us',
 dateformat: '%Y-%m-%d',
 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"],
 weekend: [0, 6],
 weekstart: 0,
 msgClose: "Close",
 msgMinimize: "Minimize",
 msgToday: "Today",
 msgClear: "Clear"
 };if (!window.dhtmlxCalendarLangModules)window.dhtmlxCalendarLangModules = {};window.dhtmlxCalendarLangModules['en-us'] = defLeng;if (window.dhtmlxCalendarObjects)window.dhtmlxCalendarObjects.push(this);else window.dhtmlxCalendarObjects = [this];dhtmlxEvent(document.body,"click",function(ev){for (var i=0;i < window.dhtmlxCalendarObjects.length;i++){var wCal = window.dhtmlxCalendarObjects [i];if (wCal.con[0].nodeName == 'INPUT')wCal.hide ()
 }});for (lg in defLeng)this.options[lg] = defLeng[lg];if (options)for (param in options)this.options[param] = options[param];this.loadUserLanguage();if (options)for (param in options)this.options[param] = options[param];this.allYears = Array();with (this.options)
 for (var i=yearsRange[0];i <= yearsRange[1];i++)this.allYears.push(i);if(this.isAutoDraw !== false)this.draw(options);return this;};dhtmlXCalendarObject = dhtmlxCalendarObject;dhtmlxCalendarObject.prototype={createStructure:function(){var self = this;if (!this.entObj.className)this.setSkin (this.skinName);this.entObj.style.position = "relative";if (this.options.isWinHeader){this.winHeader = document.createElement('DIV');this.entObj.appendChild(this.winHeader);};this.entBox = document.createElement("TABLE");this.entBox.className = "entbox";with (this.entBox) {cellPadding = "0px";cellSpacing = "0px";width = '100%';};this.entObj.appendChild(this.entBox);var monthBox = this.entBox.insertRow(0).insertCell(0);with (this.monthPan) {cellPadding = "0px";cellSpacing = "0px";width = '100%';align = 'center';};this.monthPan.className = "dxcalmonth";monthBox.appendChild(this.monthPan);var dlabelBox = this.entBox.insertRow(1).insertCell(0);dlabelBox.appendChild(this.dlabelPan);with (this.dlabelPan) {cellPadding = "0px";cellSpacing = "0px";width = '100%';align = 'center';};this.dlabelPan.className = "dxcaldlabel";var daysBox = this.entBox.insertRow(2).insertCell(0);daysBox.appendChild(this.daysPan);with (this.daysPan) {cellPadding = "1px";cellSpacing = "0px";width = '100%';align = 'center';};if(_isIE || _isKHTML)this.daysPan.className = "dxcaldays_ie";else
 this.daysPan.className = "dxcaldays";this.daysPan.onmousemove = function (e) {self.doHotKeys(e);};this.daysPan.onmouseout = function () {self.endHotKeys();};if (typeof(this.contId)!= 'string') {if (!this.contId.nodeName){for (var i=0;i < this.contId.length;i++){this.con[i] = document.getElementById(this.contId[i]);this.selDate[i] = this.cutTime(new Date());this.conInd[this.contId[i]] = i;}}else {this.con [0] = this.contId;this.conInd [this.contId.id] = 0;}}else 
 {this.con [0] = document.getElementById(this.contId);this.conInd [this.contId] = 0;};this.activeCon = this.con[0];if (this.con[0].nodeName == 'INPUT'){var div = document.createElement('DIV');with (div.style) {position = 'absolute';display = 'none';zIndex = 101;};this.setParent(div);document.body.appendChild(div);conOnclick = function (e) {if (self.isVisible())
 self.hide()
 else {self.activeCon = this;if (this.value){self.setFormatedDate(null, this.value);}else if (self.time){self.tp.reset();};self.show(this.id);self.draw();};if (this.id != self.activeCon.id){self.show(this.id);self.draw();};(e||event).cancelBubble=true;};this.doOnClick = function (date) {self.hide();self.activeCon.focus();return true;};conOnkeydown = function(e){if((e||window.event).keyCode==27)
 self.hide();else if((e||window.event).keyCode==13)
 self.show();};for (i in this.con){this.con[i].onclick = conOnclick;this.con[i].onkeydown = conOnkeydown;}}else this.setParent(this.con [0]);if(_isIE && this.useIframe){if(this.parent.style.zIndex==0){this.parent.style.zIndex = 100;};if(this.ifr == undefined && this._dblC == undefined){this.ifr = document.createElement("IFRAME");this.ifr.src="javascript:'';"
 this.ifr.style.position = "absolute";this.ifr.style.zIndex = 1;this.ifr.frameBorder = "no";this.ifr.style.top = getAbsoluteTop(this.entObj) + 'px';this.ifr.scrolling = 'no';this.ifr.style.display = this.parent.style.display;this.ifr.className = this.style + (this.skinName?'_':"") + this.skinName + "_ifr";this.parent.appendChild(this.ifr);}};this.entObj.onclick = function (e) {e = e||event;if (e.stopPropagation)e.stopPropagation();else e.cancelBubble = true;};if (!this.entObj.className)this.setSkin (this.skinName);},

 
 drawHeader:function(){if (this._dblC 
 || !this.options.isWinHeader 
 || !this.winHeader)return 
 var self = this;while (this.winHeader.hasChildNodes())
 this.winHeader.removeChild(this.winHeader.firstChild);this.winHeader.className = 'winHeader';this.winHeader.onselectstart=function(){return false};this.headerLabel = document.createElement('div');this.headerLabel.className = 'winTitle';this.headerLabel.appendChild(document.createTextNode(this.options.headerText));this.headerLabel.setAttribute('title', this.options.headerText);this.winHeader.appendChild(this.headerLabel);if (this.options.isWinDrag){this.winHeader.onmousedown = function(e) {self.startDrag(e);}};if (this.options.headerButtons.indexOf('X')>=0) {var btnClose = document.createElement('DIV');btnClose.className = 'btn_close';btnClose.setAttribute('title', this.options.msgClose);btnClose.onmousedown =function (e) {(e||event).cancelBubble=true;};btnClose.onclick = function (e) {(e||event).cancelBubble=true;self.hide();};this.winHeader.appendChild(btnClose);};if (this.options.headerButtons.indexOf('M')>=0) {var btnMin = document.createElement('DIV');btnMin.className = 'btn_mini';btnMin.setAttribute('title', this.options.msgMinimize);btnMin.onmousedown =function (e) {(e||event).cancelBubble=true;};btnMin.onclick = function(e) {this.className = this.className == 'btn_mini' ? 'btn_maxi' : 'btn_mini';(e||event).cancelBubble=true;self.minimize();};this.winHeader.appendChild(btnMin);};if (this.options.headerButtons.indexOf('C')>=0) {var btnClear = document.createElement('DIV');btnClear.className = 'btn_clear';btnClear.setAttribute('title', this.options.msgClear);btnClear.onmousedown =function (e) {(e||event).cancelBubble=true;};btnClear.onclick = function(e) {(e||event).cancelBubble=true;self.activeCon.value = "";self.hide();};this.winHeader.appendChild(btnClear);};if (this.options.headerButtons.indexOf('T')>=0) {var btnToday = document.createElement('DIV');btnToday.className = 'btn_today';btnToday.setAttribute('title', this.options.msgToday);btnToday.onmousedown =function (e) {(e||event).cancelBubble=true;};btnToday.onclick = function(e) {(e||event).cancelBubble=true;self.setDate(new Date());};this.winHeader.appendChild(btnToday);}},
 
 
 drawMonth:function(){var self = this;if (this.monthPan.hasChildNodes()) 
 this.monthPan.removeChild(this.monthPan.firstChild);var row = this.monthPan.insertRow(0);var cArLeft = row.insertCell(0);var cContent = row.insertCell(1);var cArRight = row.insertCell(2);cArLeft.align = "left";cArLeft.className = 'month_btn_left';var btnLabel = document.createElement("div");btnLabel.innerHTML = " ";cArLeft.appendChild(btnLabel);cArLeft.onclick = function(){self.prevMonth() };cArLeft.onselectstart = function () {return false};cArRight.align = "right";cArRight.className = 'month_btn_right';var btnLabel = document.createElement("div");btnLabel.innerHTML = " ";cArRight.appendChild(btnLabel);cArRight.onclick = function(){self.nextMonth() };cArRight.onselectstart = function () {return false};cContent.align = 'center';var mHeader = document.createElement("TABLE");with (mHeader) {cellPadding = "0px";cellSpacing = "0px";align = "center";};var mRow = mHeader.insertRow(0);var cMonth = mRow.insertCell(0);var cComma = mRow.insertCell(1);var cYear = mRow.insertCell(2);cContent.appendChild(mHeader);var date = this.date[0];this.planeMonth = document.createElement('DIV');this.planeMonth._c = this;this.planeMonth.appendChild(document.createTextNode(this.options.monthesFNames[date.getMonth()]));this.planeMonth.className = 'planeMonth';cMonth.appendChild(this.planeMonth);if (this.options.isMonthEditable){this.planeMonth.style.cursor = 'pointer';this.editorMonth = new dhtmlxRichSelector({nodeBefore: this.planeMonth,
 valueList: [0,1,2,3,4,5,6,7,8,9,10,11],
 titleList: this.options.monthesFNames,
 activeValue: this.options.monthesFNames[date.getMonth()],
 onSelect: this.onMonthSelect,
 isAllowUserValue: false
 });this.editorMonth._c = this;};cComma.appendChild(document.createTextNode(","));cComma.className = 'comma';this.planeYear = document.createElement('DIV');this.planeYear._c = this;this.planeYear.appendChild(document.createTextNode(date.getFullYear()));this.planeYear.className = 'planeYear';cYear.appendChild(this.planeYear);if (this.options.isYearEditable){this.planeYear.style.cursor = 'pointer';this.editorYear = new dhtmlxRichSelector({nodeBefore: this.planeYear,
 valueList: this.allYears,
 titleList: this.allYears,
 activeValue: date.getFullYear(),
 onSelect: this.onYearSelect,
 isOrderedList: true,
 isNumbersList: true,
 isAllowUserValue: true
 });this.editorYear._c = this;}},

 
 drawDayLabels:function() {var self = this;if(!this.dlabelPan.hasChildNodes()) 
 {var row = this.dlabelPan.insertRow(-1);row.className = "daynames";for(var i=0;i<7;i++){(this.weekCells [i] = row.insertCell(i)).appendChild(document.createTextNode(this.getDayName(i)))
 }}else 
 {for(var i=0;i<7;i++)this.weekCells[i].childNodes [0].nodeValue = this.getDayName(i);}},

 
 drawDays:function() {var self = this;var row = {}, cell;if(!this.daysPan.hasChildNodes()) 
 {for (var weekNumber=0;weekNumber<6;weekNumber++){row = this.daysPan.insertRow(-1);this.daysCells [weekNumber] = {};for (var i=0;i<7;i++){(this.daysCells [weekNumber] [i] = row.insertCell(-1)).appendChild(document.createTextNode(""));}}};var date = this.date[0], tempDate = new Date(date);var selectedDate = this.selDate[this.activeConInd].toDateString();tempDate.setDate(1);var day1 = (tempDate.getDay() - this.options.weekstart) % 7;if (day1 <= 0)day1 += 7;tempDate.setDate(- day1);tempDate.setDate(tempDate.getDate() + 1);if (tempDate.getDate()< tempDate.getDay()) 
 tempDate.setMonth(tempDate.getMonth() - 1);var curDay = null;for (var weekNumber=0;weekNumber<6;weekNumber++){for (var i=0;i<7;i++){if (curDay == tempDate.getDate())
 tempDate.setDate(tempDate.getDate() + 1);curDay = tempDate.getDate();cell = this.daysCells [weekNumber] [i];cell.setAttribute('id', this.uid+tempDate.getFullYear()+tempDate.getMonth()+tempDate.getDate());cell.childNodes [0].nodeValue = tempDate.getDate();cell.thisdate = tempDate.toString();cell.className = "thismonth";cell.onclick = null;if(tempDate.getMonth()!=date.getMonth())
 cell.className = "othermonth";if (this.insensitiveDates){var c = false;for (var j=0;j<this.insensitiveDates.length;j++){var s = /\.|\-/.exec(this.insensitiveDates[j])
 if (s)var f = (this.insensitiveDates[j].split (s).length == 2 ? '%m'+s+'%d' : '%Y'+s+'%m'+s+'%d');if (s && this.getFormatedDate(f, tempDate)== this.insensitiveDates[j] || tempDate.getDay () == this.insensitiveDates[j]) {this.addClass(cell, "insensitive");tempDate.setDate(tempDate.getDate() + 1);c = true;break;}};if (c)continue;};if (this.sensitiveFrom && this.sensitiveFrom instanceof Array){var c = true;for (var j=0;j<this.sensitiveFrom.length;j++){var s = /\.|\-/.exec(this.sensitiveFrom[j]);var f = (this.sensitiveFrom[j].split (s).length == 2 ? '%m'+s+'%d' : '%Y'+s+'%m'+s+'%d');if (this.getFormatedDate(f, tempDate)== this.sensitiveFrom[j])
 c = false;};if (c){this.addClass(cell, "insensitive");tempDate.setDate(tempDate.getDate() + 1);continue;}};if ((this.sensitiveFrom && (tempDate.valueOf()< this.sensitiveFrom.valueOf()))
 || (this.sensitiveTo && (tempDate.valueOf() > this.sensitiveTo.valueOf()))) {this.addClass(cell, "insensitive");tempDate.setDate(tempDate.getDate() + 1);continue;};if (this.isWeekend(i)&& tempDate.getMonth()==date.getMonth()) 
 cell.className = "weekend";if (tempDate.toDateString()== this.curDate.toDateString())
 this.addClass(cell, "current");if (tempDate.toDateString()== selectedDate) {this.activeCell = cell;this.addClass(cell, "selected");};if (this.holidays)for (var j=0;j<this.holidays.length;j++){var s = /\.|\-/.exec(this.holidays[j]);var f = (this.holidays[j].split (s).length == 2 ? '%m'+s+'%d' : '%Y'+s+'%m'+s+'%d');if (this.getFormatedDate(f, tempDate)== this.holidays[j])
 this.addClass(cell, "holiday");};cell.onclick = function(){var date = new Date(this.thisdate);self.setDate (date);if(!self.doOnClick || self.doOnClick(date)){self.callEvent("onClick", [date]);}};tempDate.setDate(tempDate.getDate() + 1);}}},

 
 draw:function(){if (!this.parent)this.createStructure();var self = this;if (this.loadingLanguage){setTimeout(function() {self.draw();return;}, 20);return;};this.drawHeader();this.drawMonth();this.drawDayLabels();this.drawDays();this.isAutoDraw = true;},

 
 loadUserLanguage:function(language, userCBfunction){if (userCBfunction)this.onLanguageLoaded = userCBfunction;if (!language){language="en-us";};this.loadingLanguage = language;if (!language){this.loadUserLanguageCallback(false);return;};if (language == this.options.langname){this.loadUserLanguageCallback(true);return;};var __lm = window.dhtmlxCalendarLangModules;if (__lm[language]){for (lg in __lm[language])this.options[lg] = __lm[language][lg];this.loadUserLanguageCallback(true);return;};var src, path = null;var scripts = document.getElementsByTagName('SCRIPT');for (var i=0;i<scripts.length;i++)if(src = scripts[i].getAttribute('src'))
 if (src.indexOf(this.scriptName)>= 0) {path = src.substr(0, src.indexOf(this.scriptName));break;};if (path === null){this.loadUserLanguageCallback(false);return;};this.options.langname = language;var langPath = path + 'lang/' + language + '.js';for (var i=0;i<scripts.length;i++)if(src = scripts[i].getAttribute('src'))
 if (src == langPath)return;var script = document.createElement('SCRIPT');script.setAttribute('language', "Java-Script");script.setAttribute('type', "text/javascript");script.setAttribute('src', langPath);document.body.appendChild(script);},

 loadUserLanguageCallback:function(status) {this.loadingLanguage = null;if (this.isAutoDraw)this.draw();if (this.onLanguageLoaded && (typeof(this.onLanguageLoaded)== 'function'))
 this.onLanguageLoaded(status);},

 loadLanguageModule:function(langModule) {var __c = window.dhtmlxCalendarObjects;for (var i=0;i<__c.length;i++){if (__c[i].loadingLanguage == langModule.langname){for (lg in langModule)__c[i].options[lg] = langModule[lg];__c[i].loadUserLanguageCallback(true);}};window.dhtmlxCalendarLangModules[langModule.langname] = langModule;},

 

 show:function(conId){this.activeCon = this.con[this._activeConInd(conId)];this.parent.style.display = '';this.parent.style.visibility = 'hidden';if (this.activeCon.nodeName == 'INPUT' && !this.userPosition){if( typeof window.innerWidth == 'number' ){docWidth = window.innerWidth;docHeight = window.innerHeight;}else {docWidth = document.body.offsetWidth;docHeight = document.body.offsetHeight;};var aLeft = getAbsoluteLeft( this.activeCon);var aTop = getAbsoluteTop( this.activeCon);if (aTop + this.parent.offsetHeight > docHeight && this.parent.offsetHeight < aTop)this.parent.style.top = aTop - this.parent.offsetHeight + this.activeCon.offsetHeight + 'px';else
 this.parent.style.top = aTop + 'px';if (aLeft + this.parent.offsetWidth + this.activeCon.offsetWidth > docWidth)this.parent.style.left = aLeft + 'px';else
 this.parent.style.left = aLeft + this.activeCon.offsetWidth + 'px';};if (this.ifr != undefined){this.ifr.style.top = this.entObj.offsetTop + 'px';this.ifr.style.left = this.entObj.offsetLeft + 'px';this.ifr.style.display = 'block';};if (this.time && !this.minimized){this.tp.setPosition (getAbsoluteLeft (this.parent) + 30, getAbsoluteTop (this.parent) + 147);this.tp.show ();};this.parent.style.visibility = 'visible';return this;},

 
 hide:function(){this.parent.style.display = 'none';if(this.ifr!=undefined)this.ifr.style.display = 'none';if (this.time)this.tp.hide();return this;},

 
 setDateFormat:function(format){this.options.dateformat = format;},



 
 cutTime:function(date) {date = new Date(date);var ndate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 1, 1);return ndate;},


 
 setParent:function(newParent){if (newParent){this.parent = newParent;this.parent.appendChild(this.entObj);}},
 
 setDate:function(date, conId){tmpDate = date;conId = this._activeConInd (conId);this.activeCon = this.con [conId];if (typeof date != "Object"){date = this.setFormatedDate(null ,tmpDate);};if (isNaN(date)|| !date) {date = new Date;};this.date[conId] = new Date(this.cutTime(date));this.selDate[conId] = new Date(this.cutTime(date));if (this.isAutoDraw){this.draw();};if (this.activeCon.nodeName == 'INPUT'){this.activeCon.value = !tmpDate ? '' : this.getFormatedDate(this.options.dateformat, date);}},
 
 addClass:function(obj, styleName) {obj.className += ' ' + styleName;},

 
 resetClass:function(obj) {obj.className = obj.className.toString().split(' ')[0];},

 resetHotClass:function(obj) {obj.className = obj.className.toString().replace(/hover/, '');},

 
 setSkin:function(newSkin) {this.skinName = newSkin;var mode = "";mode = (this.minimized
 ? "_mini" 
 : (this.time 
 ? "_long"
 : (this.options.isWinHeader
 ? "_maxi"
 : ""
 )
 )
 );this.entObj.className = this.style + (newSkin ? '_' + newSkin : '');if (mode)this.entObj.className += " " + this.entObj.className + mode;if(this.ifr!=undefined){this.ifr.className = this.style + (newSkin ? '_' + newSkin : '') + mode + "_ifr";};if (this.time)(this.isVisible () && !this.minimized) ? this.tp.show () : this.tp.hide ();},
 
 
 getDate:function(conId)
 {return this.selDate[this._activeConInd(conId)].toString();},
 
 

 nextMonth:function(){var date = this.date[0], month;date.setDate(1);date.setMonth(month = date.getMonth() + 1);this.callEvent ("onChangeMonth",[(month+1 > 12 ? 1 : month+1), month || 12]);if (this.isAutoDraw)this.draw();},
 
 
 prevMonth:function(){var date = this.date[0], month;date.setDate(1);date.setMonth(month = date.getMonth()-1);this.callEvent ("onChangeMonth",[month+1 || 12,month+2 > 12 ? 1 : (month+2 || 12)]);if (this.isAutoDraw)this.draw();},
 
 setOnClickHandler:function(func){this.attachEvent("onClick",func);},

 

 getFormatedDate:function (dateformat, date, conInd) {if(!dateformat)dateformat = this.options.dateformat
 if(!date)date = this.selDate[this._activeConInd(conInd)];date = new Date(date);var out = '';var plain = true;for (var i=0;i<dateformat.length;i++){var replStr = dateformat.substr(i, 1);if (plain){if (replStr == '%'){plain = false;continue;};out += replStr;}else {switch (replStr) {case 'e':
 replStr = date.getDate();break;case 'd':
 replStr = date.getDate();if (replStr.toString().length == 1)
 replStr='0'+replStr;break;case 'j':
 var x = new Date(date.getFullYear(), 0, 0, 0, 0, 0, 0);replStr = Math.ceil((date.valueOf() - x.valueOf())/1000/60/60/24 - 1);while (replStr.toString().length < 3)
 replStr = '0' + replStr;break;case 'a':
 replStr = this.options.daysSNames[date.getDay()];break;case 'W':
 replStr = this.options.daysFNames[date.getDay()];break;case 'c':
 replStr = 1 + date.getMonth();break;case 'm':
 replStr = 1 + date.getMonth();if (replStr.toString().length == 1)
 replStr = '0' + replStr;break;case 'b':
 replStr = this.options.monthesSNames[date.getMonth()];break;case 'M':
 replStr = this.options.monthesFNames[date.getMonth()];break;case 'y':
 replStr = date.getFullYear();replStr = replStr.toString().substr(2);break;case 'Y':
 replStr = date.getFullYear();break;case 'H':
 case 'h':
 case 'i':
 case 's':
 case 'f':
 if (this.time){replStr = this.tp.getFormatedTime('%'+replStr, arguments[2]);};break;};out += replStr;plain = true;}};return out;},

 


 setFormatedDate: function(dateformatarg, date, conInd, skip){if (!date || !(typeof date == 'string')) return date;if (date == '0000-00-00'){this.setDate (new Date, conInd);return new Date;};if(!dateformatarg)dateformatarg = this.options.dateformat;if (this.time){this.tp.setFormatedTime(dateformatarg, date);};function parseMonth(val){var tmpAr = new Array(this.options.monthesSNames,this.options.monthesFNames);for(var j=0;j<tmpAr.length;j++){for (var i=0;i<tmpAr[j].length;i++)if (tmpAr[j][i].indexOf(val)== 0)
 return i;};return -1;};var outputDate = new Date(2008, 0, 1);var j=0;for(var i=0;i<dateformatarg.length;i++){var _char = dateformatarg.charAt(i);if(_char=="%"){var _cd = dateformatarg.charAt(i+1);var _nextpc = dateformatarg.indexOf("%",i+1);var _nextDelim = dateformatarg.substr(i+2,_nextpc-i-1-1);var _nDelimInDatePos = date.indexOf(_nextDelim,j);if(_nextDelim=="")_nDelimInDatePos = date.length
 if(_nDelimInDatePos==-1)return null;var value = date.substr(j, _nDelimInDatePos-j);if (_cd != 'M' && _cd != 'b')value = parseFloat(value);j=_nDelimInDatePos+_nextDelim.length
 switch (_cd) {case 'd':
 case 'e':
 outputDate.setDate(parseFloat(value));break;case "c":
 case "m":
 outputDate.setMonth(parseFloat(value) - 1);break;case "M":
 var val = parseMonth.call(this,value);if(val!=-1)outputDate.setMonth(parseFloat(val));else 
 return null;break;case "b":
 var val = parseMonth.call(this,value);if(val!=-1)outputDate.setMonth(parseFloat(val));else 
 return null;break;case 'Y':
 outputDate.setFullYear(parseFloat(value));break;case 'y':
 var year=parseFloat(value);outputDate.setFullYear(((year>20)?1900:2000) + year);break;}}};if (isNaN(outputDate))
 outputDate = new Date(this.selDate[this._activeConInd]);if (skip)return outputDate;this.setDate (outputDate, conInd);return this.selDate[this.activeConInd];},

 
 isWeekend:function(k){var q = k + this.options.weekstart;if (q > 6)q -= 7;for (var i=0;i<this.options.weekend.length;i++)if (this.options.weekend[i] == q)return true;return false;},

 
 getDayName:function(k){var q = k + this.options.weekstart;if (q > 6)q = q - 7;return this.options.daysSNames[q];},

 
 isVisible: function(){return this.parent.style.display != 'none';},
 doHotKeys:function(e){e = e||event;var cell = e.target || e.srcElement;if (cell.className.toString().indexOf('insensitive') >=0 ) {this.endHotKeys();}else {if (this.hotCell)this.resetHotClass(this.hotCell);this.addClass(cell, 'hover');this.hotCell = cell;}},

 endHotKeys:function(){if (this.hotCell){this.resetHotClass(this.hotCell);this.hotCell = null;}},
 _activeConInd:function(ind){if (!this.parent)this.createStructure();return (this.activeConInd = (this.conInd[ind]==0?'0':this.conInd[ind]) || (ind==0?'0':ind) || this.conInd[this.activeCon.id] || 0);}};function dhtmlxRichSelector(parametres) {for (x in parametres)this[x] = parametres[x];this.initValue = this.activeValue;if (!this.selectorSize)this.selectorSize = 7;var self = this;this.blurTimer = null;this.nodeBefore.onclick = function() {self.show();};this.editor = document.createElement('TEXTAREA');this.editor.value = this.activeValue;this.editor._s = this;this.editor.className = 'dhtmlxRichSelector';this.editor.onfocus = this.onFocus;this.editor.onblur = this.onBlur;this.selector = document.createElement('SELECT');this.selector.size = this.selectorSize;this.selector.className = 'dhtmlxRichSelector';if (this.valueList)for (var i = 0;i < this.valueList.length;i++)this.selector.options[i] = new Option(this.titleList[i], this.valueList[i], false, false);this.selector._s = this;this.selector.onfocus = this.onFocus;this.selector.onblur = this.onBlur;this.selector.onclick = function () {window.t = self;self.onSelect(self.selector.value);clearTimeout(self.blurTimer);};this.selector.getIndexByValue = function (Value, isFull) {var Select = this;Value = Value.toString().toUpperCase();if (!isFull)isFull=false;for (var i=0;i<Select.length;i++){var i_value = Select[i].text.toUpperCase();if (isFull){if(i_value == Value)return i;}else {if (i_value.indexOf(Value)== 0) return i;}};if (Select._s.isOrderedList){if (Select._s.isNumbersList)if (isNaN(Value)) return -1;i_value = Select[0].text.substring(0, Value.length).toUpperCase();if (i_value > Value)return 0;i_value = Select[Select.length-1].text.substring(0, Value.length);if (i_value < Value)return Select.length-1;};return -1;};this.con = document.createElement('DIV')
 this.con.className = 'dhtmlxRichSelector';with (this.con.style) {width = 'auto';display = 'none';};this.con.appendChild(this.editor);this.con.appendChild(this.selector);this.nodeBefore.parentNode.insertBefore(this.con, this.nodeBefore);return this;};dhtmlxRichSelector.prototype.show = function() {this.con.style.display = 'block';with (this.selector.style) {marginTop = parseInt(this.nodeBefore.offsetHeight)+'px';width = 'auto';};with (this.editor.style) {width = parseInt(this.nodeBefore.offsetWidth)+15+'px';height = parseInt(this.nodeBefore.offsetHeight)+'px';};this.selector.selectedIndex = this.selector.getIndexByValue(this.activeValue);this.editor.focus();};dhtmlxRichSelector.prototype.hide = function() {this.con.style.display = 'none';};dhtmlxRichSelector.prototype.onBlur = function() {var self = this._s;self.blurTimer = setTimeout(function(){if (self.isAllowUserValue){if (self.onSelect(self.editor.value))
 self.activeValue = self.editor.value;}else {if (self.onSelect(self.selector.value))
 self.activeValue = self.selector.value;}}, 10);};dhtmlxRichSelector.prototype.onFocus = function() {var self = this._s;if(self.blurTimer){clearTimeout(self.blurTimer);self.blurTimer = null;};if (this === this._s.selector)self.editor.focus();};dhtmlxCalendarObject.prototype.setHeader = function(isVisible, isDrag, btnsOpt){with (this.options) {isWinHeader = isVisible;isWinDrag = isDrag;if (btnsOpt)headerButtons = btnsOpt;};this.setSkin (this.skinName);};dhtmlxCalendarObject.prototype.setYearsRange = function(minYear, maxYear){this.options.yearsRange = [parseInt(minYear), parseInt(maxYear)];this.allYears = [];for (var i=minYear;i <= maxYear;i++)this.allYears.push(i);};dhtmlxCalendarObject.prototype.startDrag = function(e) {e = e||event;if ((e.button === 0)|| (e.button === 1)) {if (this.dragging){this.stopDrag(e);};this.drag_mx = e.clientX;this.drag_my = e.clientY;this.drag_spos = this.getPosition(this.parent);document.body.appendChild(this.parent);with (this.parent.style) {left = this.drag_spos[0] + 'px';top = this.drag_spos[1] + 'px';margin = '0px';position = 'absolute';};if (this.ifr){this.ifr.style.top = '0px';this.ifr.style.left = '0px';};this.bu_onmousemove = document.body.onmousemove;var self = this;document.body.onmousemove = function (e) {self.onDrag(e);};this.bu_onmouseup = document.body.onmouseup;document.body.onmouseup = function (e) {self.stopDrag(e);};this.dragging = true;}};dhtmlxCalendarObject.prototype.onDrag = function(e) {e = e||event;if ((e.button === 0)|| (e.button === 1)) {var delta_x = this.drag_mx - e.clientX;var delta_y = this.drag_my - e.clientY;this.parent.style.left = this.drag_spos[0] - delta_x + 'px';this.parent.style.top = this.drag_spos[1] - delta_y + 'px';if (this.time){this.tp.setPosition (getAbsoluteLeft (this.parent) + 30, getAbsoluteTop (this.parent) + 160);};if(this.ifr != undefined){this.ifr.style.left = 0;this.ifr.style.top = 0;}}else {this.stopDrag(e);}};dhtmlxCalendarObject.prototype.stopDrag = function(e) {e = e||event;document.body.onmouseup = (this.bu_onmouseup === window.undefined)? null: this.bu_onmouseup;document.body.onmousemove = (this.bu_onmousemove === window.undefined)? null: this.bu_onmousemove;this.dragging = false;};dhtmlxCalendarObject.prototype.minimize = function(){if (!this.winHeader)return;this.minimized = !this.minimized;this.entBox.style.display = (!this.minimized) ? '' : 'none';this.setSkin (this.skinName);};dhtmlxCalendarObject.prototype.onYearSelect = function(value) {if (!isNaN(value))
 {this._c.date[0].setFullYear(
 Math.min 
 (
 Math.max 
 (
 value, 
 this._c.allYears[0]
 ), 
 this._c.allYears.slice(-1)
 )
 );};this._c.draw();return (!isNaN(value));};dhtmlxCalendarObject.prototype.onMonthSelect = function(value) {this._c.date[0].setMonth(value);this._c.draw();return true;};dhtmlxCalendarObject.prototype.setPosition = function(argA,argB,argC){if(typeof(argA)=='object'){var posAr = this.getPosition(argA)
 var left = posAr[0]+argA.offsetWidth+(argC||0);var top = posAr[1]+(argB||0);};this.parent.style.position = "absolute";this.parent.style.top = (top||argA)+"px";this.parent.style.left = (left||argB)+"px";if (this.ifr != undefined){this.ifr.style.left = '0px';this.ifr.style.top = '0px';};if (this.time)this.tp.setPosition (getAbsoluteLeft (this.parent) + 30, getAbsoluteTop (this.parent) + 160);};dhtmlxCalendarObject.prototype.close = function(func){this.hide ();};dhtmlxCalendarObject.prototype.getPosition = function(oNode,pNode) {if(!pNode)var 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){if (document.documentElement.scrollTop)iTop+=document.documentElement.scrollTop;if (document.documentElement.scrollLeft)iLeft+=document.documentElement.scrollLeft;}else
 if (!_isFF){iLeft+=document.body.offsetLeft;iTop+=document.body.offsetTop;}};return new Array(iLeft,iTop);};dhtmlxCalendarObject.prototype.setSensitive = function(fromDate,toDate){if (fromDate)if (fromDate instanceof Date){this.sensitiveFrom = this.cutTime(fromDate);}else {this.sensitiveFrom = fromDate.toString ().split (',');};if (toDate)this.sensitiveTo = this.cutTime(toDate);if (this.isAutoDraw)this.draw();};dhtmlxCalendarObject.prototype.setHolidays = function(dates){this.holidays = dates.toString().split(",");if (this.isAutoDraw)this.draw();};dhtmlxCalendarObject.prototype.onChangeMonth = function (func) {this.attachEvent ("onChangeMonth",func);};dhtmlxCalendarObject.prototype.setInsensitiveDates = function (dates) {this.insensitiveDates = dates.toString().split(",");if (this.isAutoDraw)this.draw();};dhtmlxCalendarObject.prototype.enableTime = function (mode) {if (this.time = mode){this.tp = new dhtmlXTimePicker ();this.tp.setPosition (getAbsoluteLeft (this.parent) + 30, getAbsoluteTop (this.parent) + 160);for (m in dhtmlXTimePicker.prototype)(function (m) {if (!dhtmlxCalendarObject.prototype [m])dhtmlxCalendarObject.prototype [m] = function (){return this.tp[m].apply(this.tp, arguments)}})(m);}else {this.tp.entBox.parentNode.removeChild (this.tp.entBox);this.tp = null;};this.setSkin(this.skinName);};dhtmlxCalendarObject.prototype.setHeaderText = function (text) {this.options.headerText = text;if (this.headerLabel){this.headerLabel.childNodes[0].nodeValue = text;this.headerLabel.setAttribute('title', text);}};dhtmlxCalendarObject.prototype.disableIESelectFix = function (mode) {this.useIframe = !mode;if (this.ifr != undefined){this.ifr.parentNode.removeChild(this.ifr);this.ifr = null;}};function dhtmlXColorPickerInput(container){if (typeof(container)!="object")
 container=document.getElementById(container);var n=container;var cb=n.getAttribute("colorbox");var cc=n.getAttribute("customcolors");var cs=n.getAttribute("selectonclick");var cv=n.getAttribute("fullview");var sc=n.getAttribute("selectedcolor");var k=n;if (cb){var d=document.createElement("DIV");d.style.width=n.offsetWidth+"px";d.style.height=n.offsetHeight+"px";n.style.width=n.offsetWidth-n.offsetHeight-2;n.parentNode.insertBefore(d,n);d.style.position="relative";k=document.createElement("DIV");d.appendChild(k);d.appendChild(n);k.className="cs_colorBox";n.className+=" cs_colorInput";k.style.width=k.style.height=(n.offsetHeight-(document.all?0:2))+"px";n.style.left=n.offsetHeight+2+"px";};var z2=new dhtmlXColorPicker(null,cs,cc,true,cv);if (sc)z2.setColor(sc);z2.linkToObjects = [k,n,n];return z2;};function dhtmlXColorPicker(container, isClickOnly, customColors, hide, fullview)
{if (document.all)try {document.execCommand("BackgroundImageCache", false, true);}catch (e){};this._cc=customColors;if (!container){container=document.createElement("DIV");container.style.position="absolute";document.body.appendChild (container);container._dhx_remove=true;};if (typeof(container)!="object")
 this.container = document.getElementById(container);else
 this.container = container;dhtmlxEventable(this);this.skinName = dhtmlx.skin || '';this.ready = false;this.hideOnInit = hide || false;this.linkToObjects = [];this.imgURL = dhtmlx.image_path||window.dhx_globalImgPath||"";this.hideSelfOnSelect = true;this.hex = "000000";this.h = 100;this.s = 0.9;this.v = 0.1;this.r = 0;this.g = 0;this.b = 0;this.old_hue = 0;this.old_sat = 0;this.fullview = fullview || false;this.customColorsCount=(!this.fullview?10:8);this.language = null;this.elements = new Array();this.customColors = new Array();this.restoreFrom = null;if (!this.fullview){this.colorSelectH = 119;this.colorSelectW = 209;}else {this.colorSelectH = 255;this.colorSelectW = 255;};this.isClickOnly = isClickOnly||false;if (window.cs_dechex == null){var hexDigit = new Array(0,1,2,3,4,5,6,7,8,9,'a','b','c','d','e','f');window.cs_dechex = new Array();for (var i=0;i<256;i++){var retval = hexDigit[i>>4].toString()+hexDigit[i&15].toString();if (retval.length < 2)retval = '0'+retval;window.cs_dechex[i] = retval;}};defLeng = {langname: 'en-us',
 labelHue : "Hue",
 labelSat : "Sat",
 labelLum : "Lum",
 labelRed : "Red",
 labelGreen : "Green",
 labelBlue : "Blue",
 btnAddColor : "Add to Custom Colors",
 btnSelect : "Select",
 btnCancel : "Cancel"
 };if (window.dhtmlxColorPickerObjects)window.dhtmlxColorPickerObjects[window.dhtmlxColorPickerObjects.length] = this;else window.dhtmlxColorPickerObjects = [this];if (!window.dhtmlxColorPickerLangModules)window.dhtmlxColorPickerLangModules = {};window.dhtmlxColorPickerLangModules['en-us'] = defLeng;return this;};dhtmlXColorPicker.prototype.generate = function()
{X = (document.compatMode!="BackCompat"?"X":"");if (!this.fullview){var html = "<div class='dhtmlxcolorpicker" + (this.skinName != '' ? '_' + this.skinName : '') + "' csid='cs_Content' style='display:none;'>";if ((document.all)&&((this.container.style.position=="absolute")))
 html +="<iframe src='"+(this.imgURL||"")+"blank.html' frameBorder='0' style='position:absolute;top:0px;left:0px;width:252px;height:"+(this._cc?300:244)+"px;z-index:-1;'></iframe>";html += "<table cellpadding='0' cellspacing='0'>";html += "<tr><td style='width:2px;height:2px;background:url("+(this.imgURL||"")+"left_top.gif);'></td><td style='height:2px;background:url("+(this.imgURL||"")+"top.gif);'></td><td style='width:2px;height:2px;background:url("+(this.imgURL||"")+"right_top.gif);'></td></tr>";html += "<tr><td style='width:2px;background:url("+(this.imgURL||"")+"left.gif);'></td><td style='width:"+(document.all?247:243)+"px;height:"+(this._cc?281:240)+"px;'>";html +="<table class='cs_ContentTable' csid='cs_ContentTable' cellpadding='0px' cellspacing='0px'>";html += "<tr>";html += "<td><div class='cs_SelectorDiv_Mini' csid='cs_SelectorDiv'><div class='cs_SelectorVer' csid='cs_SelectorVer' style='left:100px;top:0px;'></div><div class='cs_SelectorHor' csid='cs_SelectorHor' style='left:0px;top:100px;'></div></div></td>";html += "<td><div class='cs_LumSelect_Mini' csid='cs_LumSelect'><div csid='cs_LumSelectArrow'></div><div class='cs_LumSelectLine' csid='cs_LumSelectLine' style='left:0px;top:0px;'></div></div></td>";html += "</tr>";html += "<tr><td style='padding-top:10px;' colspan='2'>";html += "<table class='cs_ColorArea_Mini' cellpadding='0px' cellspacing='0px'>";html += "<tr><td rowspan='2' valign='top' style='text-align:left;'><div class='cs_EndColor_Mini' csid='cs_EndColor' ></div></td><td>"+this.language.labelHue+":</td><td><input tabindex='1' class='cs_Input_Mini"+X+"' csid='cs_InputHue' value='' /></td><td>"+this.language.labelRed+":</td><td><input tabindex='4' class='cs_Input_Mini"+X+"' csid='cs_InputRed' value='' /></td></tr>";html += "<tr><td>"+this.language.labelSat+":</td><td><input tabindex='2' class='cs_Input_Mini"+X+"' csid='cs_InputSat' value='' /></td><td>"+this.language.labelGreen+":</td><td><input tabindex='4' class='cs_Input_Mini"+X+"' csid='cs_InputGreen' value='' /></td></tr>";html += "<tr><td style='vertical-align:top;width:80px;text-align:left;'># <input csid='cs_Hex' class='cs_Hex_Mini"+X+"'></td><td>"+this.language.labelLum+":</td><td><input tabindex='2' class='cs_Input_Mini"+X+"' csid='cs_InputLum' value='' /></td><td>"+this.language.labelBlue+":</td><td><input tabindex='4' class='cs_Input_Mini"+X+"' csid='cs_InputBlue' value='' /></td></tr>";if (this._cc){html += "<tr><td colspan='6'><input tabindex='7' class='cs_CustomColorAdd_Mini' csid='cs_CustomColorAdd' type='button' value='"+this.language.btnAddColor+"'></td></tr>";html += "<tr><td colspan='6'><div class='cs_CustomColors_Mini' csid='cs_CustomColors'></div></td></tr>";};html += "</table>";html += "</td></tr>";html += "</table>";html += "<table class='cs_ButtonsPanel' cellpadding='0' cellspacing='0' style='width:100%;'><tr><td style='width:100%;'><input tabindex='9' class='cs_ButtonCancel' csid='cs_ButtonCancel' type='button' value='"+this.language.btnCancel+"' /><input tabindex='8' class='cs_ButtonOk' csid='cs_ButtonOk' type='button' value='"+this.language.btnSelect+"' /></td></tr></table>";html += "</td><td style='width:2px;background:url("+(this.imgURL||"")+"right.gif);'></td></tr>";html += "<tr><td style='width:2px;height:2px;background:url("+(this.imgURL||"")+"left_bottom.gif);'></td><td style='height:2px;background:url("+(this.imgURL||"")+"bottom.gif);'></td><td style='width:2px;height:2px;background:url("+(this.imgURL||"")+"right_bottom.gif);'></td></tr>";html += "</table>";html +="</div>";}else {var html = "<div class='dhtmlxcolorpicker" + (this.skinName != '' ? '_' + this.skinName : '') + "' csid='cs_Content' style='display:none;'>";if ((document.all)&&((this.container.style.position=="absolute")))
 html +="<iframe src='"+(this.imgURL||"")+"blank.html' style='position:absolute;top:0px;left:0px;width:320px;height:"+(this._cc?454:407)+"px;z-index:-1;'></iframe>";html += "<table cellpadding='0' cellspacing='0'>";html += "<tr><td style='width:2px;height:2px;background:url("+(this.imgURL||"")+"left_top.gif);'></td><td style='height:2px;background:url("+(this.imgURL||"")+"top.gif);'></td><td style='width:2px;height:2px;background:url("+(this.imgURL||"")+"right_top.gif);'></td></tr>";html += "<tr><td style='width:2px;background:url("+(this.imgURL||"")+"left.gif);'></td><td style='width:316px;height:"+(this._cc?446:392)+"px;background:#E6E5E5;'>";html +="<table class='cs_ContentTable' csid='cs_ContentTable' cellpadding='0px' cellspacing='0px'>";html += "<tr>";html += "<td><div class='cs_SelectorDiv' csid='cs_SelectorDiv'><div class='cs_SelectorVer' csid='cs_SelectorVer' style='left:100px;top:0px;'></div><div class='cs_SelectorHor' csid='cs_SelectorHor' style='left:0px;top:100px;'></div></div></td>";html += "<td><div class='cs_LumSelect' csid='cs_LumSelect'><div class='cs_LumSelectArrow' csid='cs_LumSelectArrow' style='left:16px;top:124px;'></div><div class='cs_LumSelectLine' csid='cs_LumSelectLine' style='left:0px;top:0px;'></div></div></td>";html += "</tr>";html += "<tr><td style='padding-top:10px;' colspan='2'>";html += "<table class='cs_ColorArea' cellpadding='0px' cellspacing='0px'>";html += "<tr><td rowspan='3'><div class='cs_EndColor' csid='cs_EndColor'></div></td><td valign='top' style='text-align:center;width:80px;'># <input csid='cs_Hex' class='cs_Hex'></td><td>"+this.language.labelHue+":</td><td><input tabindex='1' class='cs_Input' csid='cs_InputHue' value='' /></td><td>"+this.language.labelRed+":</td><td><input tabindex='4' class='cs_Input' csid='cs_InputRed' value='' /></td></tr>";html += "<tr><td></td><td>"+this.language.labelSat+":</td><td><input tabindex='2' class='cs_Input' csid='cs_InputSat' value='' /></td><td>"+this.language.labelGreen+":</td><td><input tabindex='4' class='cs_Input' csid='cs_InputGreen' value='' /></td></tr>";html += "<tr><td></td><td>"+this.language.labelLum+":</td><td><input tabindex='2' class='cs_Input' csid='cs_InputLum' value='' /></td><td>"+this.language.labelBlue+":</td><td><input tabindex='4' class='cs_Input' csid='cs_InputBlue' value='' /></td></tr>";if (this._cc){html += "<tr><td>";html += "<div class='cs_CustomColors' csid='cs_CustomColors'></div>";html += "</td><td></td><td colspan='4' valign='top'><input tabindex='7' class='cs_CustomColorAdd' csid='cs_CustomColorAdd' type='button' value='"+this.language.btnAddColor+"'></td></tr>";};html += "</table>";html += "</td></tr>";html += "</table>";html += "<table cellpadding='0' cellspacing='0' style='width:100%;'><tr><td style='height:49px;background:url("+(this.imgURL||"")+"buttons_panel.gif);'><input tabindex='9' class='cs_ButtonCancel' csid='cs_ButtonCancel' type='button' value='"+this.language.btnCancel+"' /><input tabindex='8' class='cs_ButtonOk' csid='cs_ButtonOk' type='button' value='"+this.language.btnSelect+"' /></td></tr></table>";html += "</td><td style='width:2px;background:url("+(this.imgURL||"")+"right.gif);'></td></tr>";html += "<tr><td style='width:2px;height:2px;background:url("+(this.imgURL||"")+"left_bottom.gif);'></td><td style='height:2px;background:url("+(this.imgURL||"")+"bottom.gif);'></td><td style='width:2px;height:2px;background:url("+(this.imgURL||"")+"right_bottom.gif);'></td></tr>";html += "</table>";html +="</div>";};if (!this.fullview)this.container.style.width="252px";else 
 this.container.style.width="320px";this.container.innerHTML = html;this._initCsIdElement();if (!this.fullview)this.elements['cs_SelectorDiv'].style.backgroundImage='url('+(this.imgURL||"")+'colormini.png)';else
 this.elements['cs_SelectorDiv'].style.backgroundImage='url('+(this.imgURL||"")+'color.png)';this.elements['cs_SelectorDiv'].z = this;this.elements['cs_LumSelect'].z = this;this.elements['cs_LumSelectArrow'].z = this;this.z = this;this._drawLum();this._colorizeLum(this.old_hue, this.old_sat);this._initEvents();if (this._cc)this._initCustomColors();this.ColorNum = 0;this.restoreFromHSV();this._drawValues();};dhtmlXColorPicker.prototype._initCsIdElement = function(obj)
{if (obj == null)obj = this.container;var childs = obj.childNodes;var l = childs.length;for (var i=0;i<l;i++){if (childs[i].nodeType == 1){var attr = childs[i].getAttribute('csid');if (attr !== null){this.elements[attr] = childs[i];};if (childs[i].childNodes.length > 0){this._initCsIdElement(childs[i]);}}}};dhtmlXColorPicker.prototype._initEvents = function()
{this.elements['cs_SelectorDiv'].onmousedown = this._startMoveColor;this.elements['cs_SelectorDiv'].ondblclick = this.clickOk;this.elements['cs_LumSelect'].onmousedown = this._startMoveLum;this.elements['cs_LumSelect'].ondblclick = this.clickOk;this.elements['cs_LumSelectArrow'].onmousedown = this._startMoveLum;if (this._cc){this.elements['cs_CustomColorAdd'].z = this;this.elements['cs_CustomColorAdd'].onclick = this.addCustomColor;this.elements['cs_CustomColorAdd'].onmouseover = this.hoverButton;this.elements['cs_CustomColorAdd'].onmouseout = this.normalButton;};var inputs = new Array('cs_InputHue', 'cs_InputRed', 'cs_InputSat', 'cs_InputGreen', 'cs_InputLum', 'cs_InputBlue');for (var i=0;i<inputs.length;i++){this.elements[inputs[i]].z = this;this.elements[inputs[i]].onchange = i%2?this._changeValueRGB:this._changeValueHSV;};this.elements['cs_Hex'].z = this;this.elements['cs_Hex'].onchange = this._changeValueHEX;this.elements['cs_ButtonOk'].z = this;this.elements['cs_ButtonOk'].onclick = this.clickOk;this.elements['cs_ButtonOk'].onmouseover = this.hoverButton;this.elements['cs_ButtonOk'].onmouseout = this.normalButton;this.elements['cs_ButtonCancel'].z = this;this.elements['cs_ButtonCancel'].onclick = this.clickCancel;this.elements['cs_ButtonCancel'].onmouseover = this.hoverButton;this.elements['cs_ButtonCancel'].onmouseout = this.normalButton;};dhtmlXColorPicker.prototype.resetHandlers = function(ev)
{};dhtmlXColorPicker.prototype.clickOk = function(ev)
{var z = this.z;var t=z.getSelectedColor();z.callEvent ("onSelect", [t[0]]);if (z.hideSelfOnSelect)z.hide();};dhtmlXColorPicker.prototype.clickCancel = function(ev)
{var z = this.z;z.callEvent("onCancel",[]);if (this.z.hideSelfOnSelect)this.z.hide();};dhtmlXColorPicker.prototype._setCrossPos = function(ev)
{var z = this.z;var offset = z._getOffset(this.elements['cs_SelectorDiv']);var y = ev.clientY - offset[0];if (y < 0)y = 0;else if (y > this.colorSelectH)y = this.colorSelectH;var x = ev.clientX - offset[1];if (x < 0)x = 0;else if (x > this.colorSelectW)x = this.colorSelectW;z.elements['cs_SelectorVer'].style.left = x+'px';z.elements['cs_SelectorHor'].style.top = y+'px';var H = x==this.colorSelectW?0:360*x/this.colorSelectW;var S = 1-y/this.colorSelectH;return [H, S];};dhtmlXColorPicker.prototype._getScrollers = function(){return ([(document.body.scrollLeft||document.documentElement.scrollLeft),(document.body.scrollTop||document.documentElement.scrollTop)]);};dhtmlXColorPicker.prototype._setLumPos = function(ev)
{var z = this.z;var offset = z._getOffset(z.elements['cs_LumSelect']);var y = ev.clientY - offset[0] - 4;if (y < -3)y = -3;if (y > this.colorSelectH-4)y = this.colorSelectH-4;z.elements['cs_LumSelectArrow'].style.top = y+'px';z.elements['cs_LumSelectLine'].style.top = y+4+'px';var V = (y+3)/this.colorSelectH;return V;};dhtmlXColorPicker.prototype._startMoveColor = function(ev)
{var z = this.z;if (ev == null)ev = event;z.elements['cs_SelectorDiv'].onmousedown = null;z.b_move = document.body.onmousemove;z.b_up = document.body.onmouseup;var self=z;document.body.onmousemove = function(e) {if (e ==null)e = event;self._mouseMoveColor(e);};document.body.onmouseup = function(e) {if (e ==null)e = event;self._stopMoveColor(e);self = null;};z.elements['cs_SelectorDiv'].onmousemove = z._mouseMoveColor;z.elements['cs_SelectorDiv'].onmouseup = z._stopMoveColor;var HS = z._setCrossPos(ev);z.h = HS[0];z.s = HS[1];var col = z._calculateColor();z._colorizeLum(col[0], col[1]);};dhtmlXColorPicker.prototype._mouseMoveColor = function(ev)
{var z = this.z;if (ev == null)ev = event;var HS = z._setCrossPos(ev);if (z.isClickOnly)return;z.h = HS[0];z.s = HS[1];var col = z._calculateColor();z._colorizeLum(col[0], col[1]);};dhtmlXColorPicker.prototype._stopMoveColor = function(ev)
{var z = this.z;if (ev == null)ev = event;z.elements['cs_SelectorDiv'].onmousedown = z._startMoveColor;z.elements['cs_SelectorDiv'].onmousemove = null;z.elements['cs_SelectorDiv'].onmouseup = null;document.body.onmousemove = z.b_move;document.body.onmouseup = z.b_up;var HS = z._setCrossPos(ev);z.h = HS[0];z.s = HS[1];var col = z._calculateColor();z._colorizeLum(col[0], col[1]);};dhtmlXColorPicker.prototype._startMoveLum = function(ev)
{var z = this.z;if (ev == null)ev = event;z.elements['cs_LumSelect'].onmousedown = null;z.elements['cs_LumSelectArrow'].onmousedown = null;z.elements['cs_LumSelect'].onmousemove = z._mouseMoveLum;z.elements['cs_LumSelect'].onmouseup = z._stopMoveLum;z.b_move = document.body.onmousemove;z.b_up = document.body.onmouseup;z.b_selstart = document.body.onselectstart;var self=z;document.body.onmousemove = function(e) {if (e == null)e = event;self._mouseMoveLum(e);};document.body.onmouseup = function(e) {if (e == null)e = event;self._stopMoveLum(e);self = null;};document.body.onselectstart = function() {return false};z.v = z._setLumPos(ev);z._calculateColor();};dhtmlXColorPicker.prototype._mouseMoveLum = function(ev)
{var z = this.z;if (ev == null)ev = event;z.v = z._setLumPos(ev);if (z.isClickOnly)return;z._calculateColor();};dhtmlXColorPicker.prototype._stopMoveLum = function(ev)
{var z = this.z;if (ev == null)ev = event;z.elements['cs_LumSelect'].onmousedown = z._startMoveLum;z.elements['cs_LumSelectArrow'].onmousedown = z._startMoveLum;z.elements['cs_LumSelect'].onmousemove = null;z.elements['cs_LumSelect'].onmouseup = null;z.v = z._setLumPos(ev);z._calculateColor();document.body.onmousemove = z.b_move;document.body.onmouseup = z.b_up;document.body.onselectstart = z.b_selstart;};dhtmlXColorPicker.prototype._getOffset = function(node)
{var top = this._getOffsetTop(node);var left = this._getOffsetLeft(node);var mod=this._getScrollers();return [top-mod[1], left-mod[0]];};dhtmlXColorPicker.prototype._getOffsetTop = function(node)
{var offset = 0;if (node.offsetParent)offset += node.offsetTop+this._getOffsetTop(node.offsetParent);return offset;};dhtmlXColorPicker.prototype._getOffsetLeft = function(node)
{var offset = 0;if (node.offsetParent)offset += node.offsetLeft+this._getOffsetLeft(node.offsetParent);return offset;};dhtmlXColorPicker.prototype._calculateColor = function()
{if (this.restoreFrom == 'RGB'){var rgb = [this.r, this.g, this.b];}else {var rgb = this._hsv2rgb(this.h, this.s, 1-this.v);this.r = rgb[0];this.g = rgb[1];this.b = rgb[2];};this.hex = this._getColorHEX(rgb);this.elements['cs_EndColor'].style.backgroundColor = '#'+this.hex;this._drawValues();this.restoreFrom = null;return [this.h, this.s, 1-this.v];};dhtmlXColorPicker.prototype._drawValues = function()
{this.elements['cs_Hex'].value = this.hex;this.elements['cs_InputHue'].value = Math.floor(this.h);this.elements['cs_InputSat'].value = Math.floor(this.s*100);this.elements['cs_InputLum'].value = Math.floor((1-this.v)*100);this.elements['cs_InputRed'].value = Math.floor(this.r);this.elements['cs_InputGreen'].value = Math.floor(this.g);this.elements['cs_InputBlue'].value = Math.floor(this.b);};dhtmlXColorPicker.prototype.saveColor = function(rgb, num)
{var date = new Date();var datevalue = date.valueOf()+2678400000;date = new Date(datevalue);var str = 'color_'+num+'='+rgb+';expires='+date.toGMTString();document.cookie = str;};dhtmlXColorPicker.prototype.restoreColor = function(num) {var rgb = false;var name = 'color_'+num;if (document.cookie.length > 0){var pos = document.cookie.indexOf(name+'=');if (pos != -1){var pos2 = document.cookie.indexOf(';', pos);if (pos2 == -1)pos2 = document.cookie.length;var pos3 = document.cookie.indexOf('=', pos)+1;var rgb = document.cookie.substr(pos3, pos2-pos3);}};return rgb;};dhtmlXColorPicker.prototype._hsv2rgb = function(h, s, v)
{Hi = Math.floor((h/60))%6;f = h/60-Hi;p = v*(1-s);q = v*(1-f*s);t = v*(1-(1-f)*s);var r = 0;var g = 0;var b = 0;switch(Hi) {case 0:
 r = v;g = t;b = p;break;case 1:
 r = q;g = v;b = p;break;case 2:
 r = p;g = v;b = t;break;case 3:
 r = p;g = q;b = v;break;case 4:
 r = t;g = p;b = v;break;case 5:
 r = v;g = p;b = q;break;};r = Math.floor(r*255);g = Math.floor(g*255);b = Math.floor(b*255);return [r, g, b];};dhtmlXColorPicker.prototype._rgb2hsv = function(r, g, b)
{R = r/255;G = g/255;B = b/255;var MAX = Math.max(R, G, B);var MIN = Math.min(R, G, B);var V = MAX;var S = MAX==0?0:(1-MIN/MAX);var H = 0;if (MAX == MIN){H = 0;}else if (MAX == R && G>=B){H = 60*(G-B)/(MAX-MIN)+0;}else if (MAX == R && G < B){H = 60*(G-B)/(MAX-MIN)+360;}else if (MAX == G){H = 60*(B-R)/(MAX-MIN)+120;}else if (MAX == B){H = 60*(R-G)/(MAX-MIN)+240;};return [H, S, V];};dhtmlXColorPicker.prototype._drawLum = function()
{var color = this.colorSelectH;var lumElemCount = (!this.fullview?30:64);var colorInc = (!this.fullview?8:4);for (var i=0;i<lumElemCount;i++){var d = document.createElement('div');var c = this._dec2hex(color);d.style.backgroundColor = '#'+c+c+c;d.className = 'cs_LumElement';color-=colorInc;this.elements['cs_LumSelect'].appendChild(d);}};dhtmlXColorPicker.prototype._colorizeLum = function(hue, sat)
{this.old_hue = hue;this.old_sat = sat;var lum = 255;var colorInc = (!this.fullview?8:4);var l = this.elements['cs_LumSelect'].childNodes.length;for (var i=2;i<l;i++){var v = (lum>255)?1:(lum/255);var rgb = this._hsv2rgb(hue, sat, v);var rgb = '#'+this._getColorHEX(rgb);this.elements['cs_LumSelect'].childNodes[i].style.backgroundColor = rgb;lum-=colorInc;};this.callEvent("onChange", [this.getSelectedColor()])
};dhtmlXColorPicker.prototype._dec2hex = function(dec)
{return window.cs_dechex[dec]||'00';};dhtmlXColorPicker.prototype._hex2dec = function(hex)
{return parseInt(hex, 16);};dhtmlXColorPicker.prototype._initCustomColors = function()
{var colors = this.elements['cs_CustomColors'];for (var i=0;i<this.customColorsCount;i++){var d = document.createElement('div');d.className = (this.fullview?'cs_CustomColor':'cs_CustomColor_Mini');d.color_num = i;if (document.all){if (navigator.appName=='Opera'){if (!this.fullview){d.style.width = '18px';d.style.height = '18px';}else {d.style.width = '14px';d.style.height = '14px';}}else
 if (!this.fullview){if (document.compatMode != "BackCompat")d.style.width = '18px';else 
 d.style.width = '20px';d.style.height = '20px';}else {d.style.width = '16px';d.style.height = '16px';}};d.z = this;d.onclick=this._selectCustomColor;d.ondblclick=this.clickOk;var color = this.restoreColor(i)||'0,0,0';d.color = color;var rgb = color.split(',');d.style.backgroundColor = '#'+this._getColorHEX(rgb);this.customColors.push(d);colors.appendChild(d);}};dhtmlXColorPicker.prototype._reinitCustomColors = function()
{var colors = this.elements['cs_CustomColors'];for (var i=0;i<this.customColorsCount;i++){var d = this.customColors[i];var color = this.restoreColor(i)||'0,0,0';d.color = color;var rgb = color.split(',');d.style.backgroundColor = '#'+this._getColorHEX(rgb);this.customColors[i] = d;}};dhtmlXColorPicker.prototype._getColorHEX=function(rgb){var r = this._dec2hex(rgb[0]);var g = this._dec2hex(rgb[1]);var b = this._dec2hex(rgb[2]);return (r+g+b);};dhtmlXColorPicker.prototype._selectCustomColor = function(ev)
{if (ev == null)ev = event;var z = this.z;if (!this.selected){for (var i = 0;i< z.customColors.length;i++)z.customColors[i].style.border = '1px solid gray';this.style.border = '1px dashed black';this.selected = true;if (z.selectedColor != null){z.customColors[z.selectedColor].style.border = '1px solid gray';z.customColors[z.selectedColor].selected = false;}};z.selectedColor = this.color_num;z.ColorNum = this.color_num;var color = this.color.split(',');z.r = color[0];z.g = color[1];z.b = color[2];z.restoreFromRGB();};dhtmlXColorPicker.prototype.addCustomColor = function()
{var z = this.z;if (z.selectedColor != null){var d = z.customColors[z.selectedColor];var n = z.selectedColor;d.style.border = '1px solid gray';z.selectedColor = null;}else {var d = z.customColors[z.ColorNum];var n = z.ColorNum;d.style.border = '1px solid gray';};var rgb = z.r+','+z.g+','+z.b;z.saveColor(rgb, n);d.color = rgb;z.ColorNum = z.ColorNum==9?0:z.ColorNum+1;z.customColors[z.ColorNum].style.border = '1px dashed red';d.style.backgroundColor = z.elements['cs_EndColor'].style.backgroundColor;};dhtmlXColorPicker.prototype.restoreFromRGB = function()
{this.restoreFrom = 'RGB';var HSV = this._rgb2hsv(this.r, this.g, this.b);this.h = HSV[0];this.s = HSV[1];this.v = 1-HSV[2];if (this.ready)this.redraw();};dhtmlXColorPicker.prototype.restoreFromHSV = function()
{this.restoreFrom = 'HSV';var RGB = this._hsv2rgb(this.h, this.s, this.v);this.r = RGB[0];this.g = RGB[1];this.b = RGB[2];this.redraw();};dhtmlXColorPicker.prototype.restoreFromHEX = function()
{this.r = this._hex2dec(this.hex.substr(0,2));this.g = this._hex2dec(this.hex.substr(2,2));this.b = this._hex2dec(this.hex.substr(4,2));this.restoreFromRGB();};dhtmlXColorPicker.prototype.redraw = function()
{var x = this.colorSelectW*this.h/360;var y = (1-this.s)*this.colorSelectH;var top = (this.v)*this.colorSelectH;this.elements['cs_SelectorHor'].style.top = y+"px";this.elements['cs_SelectorVer'].style.left = x+"px";this.elements['cs_LumSelectArrow'].style.top = top-3+"px";this.elements['cs_LumSelectLine'].style.top = top+1+"px";var col = this._calculateColor();this._colorizeLum(col[0], col[1]);};dhtmlXColorPicker.prototype._changeValueHSV = function()
{var z = this.z;var H = parseInt(z.elements['cs_InputHue'].value)||0;var S = parseInt(z.elements['cs_InputSat'].value)||0;var V = parseInt(z.elements['cs_InputLum'].value)||0;if (H < 0 || H > 359)H = 0;if (S < 0 || S > 100)S = 0;if (V < 0 || V > 100)V = 0;z.elements['cs_InputHue'].value = H;z.elements['cs_InputSat'].value = S;z.elements['cs_InputLum'].value = V;z.h = H;z.s = S/100;z.v = 1-V/100;z.restoreFromHSV();};dhtmlXColorPicker.prototype._changeValueRGB = function()
{var z = this.z;var R = parseInt(z.elements['cs_InputRed'].value)||0;var G = parseInt(z.elements['cs_InputGreen'].value)||0;var B = parseInt(z.elements['cs_InputBlue'].value)||0;if (R < 0 || R > 255)R = 0;if (G < 0 || G > 255)G = 0;if (B < 0 || B > 255)B = 0;z.elements['cs_InputRed'].value = R;z.elements['cs_InputGreen'].value = G;z.elements['cs_InputBlue'].value = B;z.r = R;z.g = G;z.b = B;z.restoreFromRGB();};dhtmlXColorPicker.prototype._changeValueHEX = function()
{var z = this.z;var hex = (z.elements['cs_Hex'].value)||000000;hex = hex.replace(/[^a-fA-F0-9]/gi,"0");if (hex.length>6)hex = hex.substr(0,6)
 else while (hex.length<6)hex += '0';z.elements['cs_Hex'].value = hex;z.hex = hex;z.restoreFromHEX();};dhtmlXColorPicker.prototype.setCustomColors = function(colors)
{colors = colors.split(",");for (var i=0;i<colors.length;i++){var rgb = colors[i];if (rgb.substr(0, 1)== '#') {rgb = rgb.substr(1);};var R = this._hex2dec(rgb.substr(0, 2));var G = this._hex2dec(rgb.substr(2, 2));var B = this._hex2dec(rgb.substr(4, 2));rgb = R+','+G+','+B;this.saveColor(rgb, i);}};dhtmlXColorPicker.prototype.setColor = function(rgb)
{if (typeof(rgb)!= 'string') {var R = rgb[0];var G = rgb[1];var B = rgb[2];}else if (rgb.indexOf('rgb')!=-1) {var rgbArr = rgb.substr(rgb.indexOf("(")+1,rgb.lastIndexOf(")")-rgb.indexOf("(")-1).split(",");var R = rgbArr[0];var G = rgbArr[1];var B = rgbArr[2];}else {if (rgb.substr(0, 1)== '#') {rgb = rgb.substr(1);};var R = this._hex2dec(rgb.substr(0, 2));var G = this._hex2dec(rgb.substr(2, 2));var B = this._hex2dec(rgb.substr(4, 2));};R = parseInt(R)||0;G = parseInt(G)||0;B = parseInt(B)||0;if (R < 0 || R > 255)R = 0;if (G < 0 || G > 255)G = 0;if (B < 0 || B > 255)B = 0;this.r = R;this.g = G;this.b = B;this.restoreFromRGB();};dhtmlXColorPicker.prototype.close = function()
{this.elements['cs_SelectorDiv'].z = null;this.elements['cs_LumSelect'].z = null;this.elements['cs_LumSelectArrow'].z = null;this.elements['cs_ButtonOk'].z = null;this.elements['cs_ButtonCancel'].z = null;if (this.cc)this.elements['cs_CustomColorAdd'].z = null;this.container.innerHTML="";if (this.container._dhx_remove)this.container.parentNode.removeChild(this.container);};dhtmlXColorPicker.prototype.show = function()
{this.callEvent("onShow",[]);if (this.container.innerHTML=="")return;this.elements['cs_Content'].style.display = '';this.elements['cs_InputHue'].focus()
};dhtmlXColorPicker.prototype.setPosition = function(x,y)
{this.container.style.position='absolute';this.container.style.top=(y>0?y:10)+"px";this.container.style.left=x+"px";};dhtmlXColorPicker.prototype.hide = function()
{this.resetHandlers();if (this.elements['cs_Content'])this.elements['cs_Content'].style.display = 'none';};dhtmlXColorPicker.prototype.setOnSelectHandler = function(func){this.attachEvent ("onSelect", func);};dhtmlXColorPicker.prototype.setOnCancelHandler = function(func){this.attachEvent ("onCancel", func);};dhtmlXColorPicker.prototype.getSelectedColor = function(){var rgb_dec = new Array(this.r, this.g, this.b);var rgb_hex = this._dec2hex(this.r)+this._dec2hex(this.g)+this._dec2hex(this.b);var hsl = new Array(this.h, this.s, this.v);return ["#"+rgb_hex,rgb_dec,hsl];};dhtmlXColorPicker.prototype.linkTo = function(obj1,obj2,obj3){if (typeof(obj1)!="object")
 obj1=document.getElementById(obj1);if (typeof(obj2)!="object")
 obj2=document.getElementById(obj2);if (typeof(obj3)!="object")
 obj3=document.getElementById(obj3);this.linkToObjects = arguments;var self=this;obj2.onclick=function(){var z=self._getOffset(obj1);var s=self._getScrollers();var x=z[1]+s[0];var y=z[0]+s[1];self.setPosition(x+obj1.offsetWidth,y);self.isVisible() ? self.hide() : self.show();};this.setOnSelectHandler(function(color){obj1.style.backgroundColor=color;if (obj3)obj3.value=color;});this.close=this.hide;this.hide();};dhtmlXColorPicker.prototype.hideOnSelect = function(value) {this.hideSelfOnSelect = value;};dhtmlXColorPicker.prototype.setImagePath = function(path){this.imgURL = path;};dhtmlXColorPicker.prototype.init = function(){if (!this.language)this.loadUserLanguage ("en-us");this.generate();this.ready = true;if (this._cc)this._reinitCustomColors();if (this.linkToObjects.length>0)this.linkTo(this.linkToObjects[0],this.linkToObjects[1],this.linkToObjects[2]);if (!this.hideOnInit)this.show();};dhtmlXColorPicker.prototype.loadUserLanguage = function(lang) {if (!window.dhtmlxColorPickerLangModules [lang])return;this.language = window.dhtmlxColorPickerLangModules [lang];if (this.ready){this.generate();this.show();}};dhtmlXColorPicker.prototype.setSkin = function (skin) {this.skinName = skin;if (this.elements['cs_Content'])this.elements['cs_Content'].className = 'dhtmlxcolorpicker' + (skin ? '_' + skin : skin);};dhtmlXColorPicker.prototype.isVisible = function () {return !(this.elements['cs_Content'].style.display == 'none');};dhtmlXColorPicker.prototype.hoverButton = function () {this.className += '_Hover';};dhtmlXColorPicker.prototype.normalButton = function () {this.className = this.className.substr(0, this.className.length-6)
};(function(){dhtmlx.extend_api("dhtmlXColorPicker",{_init:function(obj){return [obj.parent, obj.click, obj.colors, obj.hide, obj.full ];},
 show:"showA",
 link:"linkTo",
 image_path:"setImagePath",
 color:"setColor"
 },{showA:function(){this.init();this.show();}});})();function dhtmlXComboFromSelect(parent,size){if (typeof(parent)=="string")
 parent=document.getElementById(parent);size=size||parent.getAttribute("width")||(window.getComputedStyle?window.getComputedStyle(parent,null)["width"]:(parent.currentStyle?parent.currentStyle["width"]:0));if ((!size)||(size=="auto"))
 size=parent.offsetWidth||100;var z=document.createElement("SPAN");parent.parentNode.insertBefore(z,parent);parent.style.display='none';var s_type = parent.getAttribute('opt_type');var w= new dhtmlXCombo(z,parent.name,size,s_type,parent.tabIndex);var x=new Array();var sel=0;for (var i=0;i<parent.options.length;i++){if (parent.options[i].selected)sel=i;var label=parent.options[i].innerHTML;var val=parent.options[i].getAttribute("value");if ((typeof(val)=="undefined")||(val===null)) val=label;x[i]={value:val,text:label,img_src:parent.options[i].getAttribute("img_src")}};if(x.length)w.addOption(x);parent.parentNode.removeChild(parent);w.selectOption(sel,null,true);if (parent.onchange)w.attachEvent("onChange",parent.onchange);if(parent.style.direction=="rtl" && w.setRTL)w.setRTL(true);return w;};var dhtmlXCombo_optionTypes = [];function dhtmlXCombo(parent,name,width,optionType,tabIndex){if (typeof(parent)=="string")
 parent=document.getElementById(parent);this.dhx_Event();this.optionType = (optionType != window.undefined && dhtmlXCombo_optionTypes[optionType]) ? optionType : 'default';this._optionObject = dhtmlXCombo_optionTypes[this.optionType];this._disabled = false;if (!window.dhx_glbSelectAr){window.dhx_glbSelectAr=new Array();window.dhx_openedSelect=null;window.dhx_SelectId=1;dhtmlxEvent(document.body,"click",this.closeAll);dhtmlxEvent(document.body,"keydown",function(e){try {if ((e||event).keyCode==9) window.dhx_glbSelectAr[0].closeAll();}catch(e) {};return true;});};if (parent.tagName=="SELECT")return dhtmlXComboFromSelect(parent);else
 this._createSelf(parent,name,width,tabIndex);dhx_glbSelectAr.push(this);};dhtmlXCombo.prototype.setSize = function(new_size){this.DOMlist.style.width=new_size+"px";if (this.DOMlistF)this.DOMlistF.style.width=new_size+"px";this.DOMelem.style.width=new_size+"px";this.DOMelem_input.style.width = Math.max(0,(new_size-19))+'px';};dhtmlXCombo.prototype.enableFilteringMode = function(mode,url,cache,autosubload){this._filter=convertStringToBoolean(mode);if (url){this._xml=url;this._autoxml=convertStringToBoolean(autosubload);};if (convertStringToBoolean(cache)) this._xmlCache=[];};dhtmlXCombo.prototype.setFilteringParam=function(name,value){if (!this._prs)this._prs=[];this._prs.push([name,value]);};dhtmlXCombo.prototype.disable = function(mode){var z=convertStringToBoolean(mode);if (this._disabled==z)return;this.DOMelem_input.disabled=z;this._disabled=z;};dhtmlXCombo.prototype.readonly = function(mode,autosearch){this.DOMelem_input.readOnly=mode ? true : false;if(autosearch===false || mode===false){this.DOMelem.onkeyup=function(ev){}}else {var that = this;this.DOMelem.onkeyup=function(ev){ev=ev||window.event;if (ev.keyCode!=9)ev.cancelBubble=true;if((ev.keyCode >= 48 && ev.keyCode <= 57)||(ev.keyCode >= 65 && ev.keyCode <= 90)){for(var i=0;i<that.optionsArr.length;i++){var text = that.optionsArr[i].text;if(text.toString().toUpperCase().indexOf(String.fromCharCode(ev.keyCode)) == 0){that.selectOption(i);break;}};ev.cancelBubble=true;}}}};dhtmlXCombo.prototype.getOption = function(value)
 {for(var i=0;i<this.optionsArr.length;i++)if(this.optionsArr[i].value==value)return this.optionsArr[i];return null;};dhtmlXCombo.prototype.getOptionByLabel = function(value)
 {for(var i=0;i<this.optionsArr.length;i++)if(this.optionsArr[i].text==value || this.optionsArr[i]._ctext==value)return this.optionsArr[i];return null;};dhtmlXCombo.prototype.getOptionByIndex = function(ind){return this.optionsArr[ind];};dhtmlXCombo.prototype.clearAll = function(all)
 {if (all)this.setComboText("");this.optionsArr=new Array();this.redrawOptions();if (all)this._confirmSelection();};dhtmlXCombo.prototype.deleteOption = function(value)
 {var ind=this.getIndexByValue(value);if(ind<0)return;if (this.optionsArr[ind]==this._selOption)this._selOption=null;this.optionsArr.splice(ind, 1);this.redrawOptions();};dhtmlXCombo.prototype.render=function(mode){this._skiprender=(!convertStringToBoolean(mode));this.redrawOptions();};dhtmlXCombo.prototype.updateOption = function(oldvalue, avalue, atext, acss)
 {var dOpt=this.getOption(oldvalue);if (typeof(avalue)!="object") avalue={text:atext,value:avalue,css:acss};dOpt.setValue(avalue);this.redrawOptions();};dhtmlXCombo.prototype.addOption = function(options)
 {if (!arguments[0].length || typeof(arguments[0])!="object")
 args = [arguments];else
 args = options;this.render(false);for (var i=0;i<args.length;i++){var attr = args[i];if (attr.length){attr.value = attr[0]||"";attr.text = attr[1]||"";attr.css = attr[2]||"";};this._addOption(attr);};this.render(true);};dhtmlXCombo.prototype._addOption = function(attr)
 {dOpt = new this._optionObject();this.optionsArr.push(dOpt);dOpt.setValue.apply(dOpt,[attr]);this.redrawOptions();};dhtmlXCombo.prototype.getIndexByValue = function(val){for(var i=0;i<this.optionsArr.length;i++)if(this.optionsArr[i].value == val)return i;return -1;};dhtmlXCombo.prototype.getSelectedValue = function(){return (this._selOption?this._selOption.value:null);};dhtmlXCombo.prototype.getComboText = function(){return this.DOMelem_input.value;};dhtmlXCombo.prototype.setComboText = function(text){this.DOMelem_input.value=text;};dhtmlXCombo.prototype.setComboValue = function(text){this.setComboText(text);for(var i=0;i<this.optionsArr.length;i++)if (this.optionsArr[i].data()[0]==text)
 return this.selectOption(i,null,true);this.DOMelem_hidden_input.value=text;};dhtmlXCombo.prototype.getActualValue = function(){return this.DOMelem_hidden_input.value;};dhtmlXCombo.prototype.getSelectedText = function(){return (this._selOption?this._selOption.text:"");};dhtmlXCombo.prototype.getSelectedIndex = function(){for(var i=0;i<this.optionsArr.length;i++)if(this.optionsArr[i] == this._selOption)return i;return -1;};dhtmlXCombo.prototype.setName = function(name){this.DOMelem_hidden_input.name = name;this.DOMelem_hidden_input2 = name.replace(/(\]?)$/, "_new_value$1");this.name = name;};dhtmlXCombo.prototype.show = function(mode){if (convertStringToBoolean(mode))
 this.DOMelem.style.display = "";else
 this.DOMelem.style.display = "none";};dhtmlXCombo.prototype.destructor = function()
 {this.DOMParent.removeChild(this.DOMelem);this.DOMlist.parentNode.removeChild(this.DOMlist);var s=dhx_glbSelectAr;this.DOMParent=this.DOMlist=this.DOMelem=0;this.DOMlist.combo=this.DOMelem.combo=0;for(var i=0;i<s.length;i++){if(s[i] == this){s[i] = null;s.splice(i,1);return;}}};dhtmlXCombo.prototype._createSelf = function(selParent, name, width, tab)
 {if (width.toString().indexOf("%")!=-1){var self = this;var resWidht=parseInt(width)/100;window.setInterval(function(){if (!selParent.parentNode)return;var ts=selParent.parentNode.offsetWidth*resWidht-2;if (ts<0)return;if (ts==self._lastTs)return;self.setSize(self._lastTs=ts);},500);var width=parseInt(selParent.offsetWidth);};var width=parseInt(width||100);this.ListPosition = "Bottom";this.DOMParent = selParent;this._inID = null;this.name = name;this._selOption = null;this.optionsArr = Array();var opt = new this._optionObject();opt.DrawHeader(this,name, width,tab);this.DOMlist = document.createElement("DIV");this.DOMlist.className = 'dhx_combo_list '+(dhtmlx.skin?dhtmlx.skin+"_list":"");this.DOMlist.style.width=width-(_isIE?0:0)+"px";if (_isOpera || _isKHTML )this.DOMlist.style.overflow="auto";this.DOMlist.style.display = "none";document.body.insertBefore(this.DOMlist,document.body.firstChild);if (_isIE){this.DOMlistF = document.createElement("IFRAME");this.DOMlistF.style.border="0px";this.DOMlistF.className = 'dhx_combo_list';this.DOMlistF.style.width=width-(_isIE?0:0)+"px";this.DOMlistF.style.display = "none";this.DOMlistF.src="javascript:false;";document.body.insertBefore(this.DOMlistF,document.body.firstChild);};this.DOMlist.combo=this.DOMelem.combo=this;this.DOMelem_input.onkeydown = this._onKey;this.DOMelem_input.onkeypress = this._onKeyF;this.DOMelem_input.onblur = this._onBlur;this.DOMelem.onclick = this._toggleSelect;this.DOMlist.onclick = this._selectOption;this.DOMlist.onmousedown = function(){this._skipBlur=true;};this.DOMlist.onkeydown = function(e){this.combo.DOMelem_input.focus();(e||event).cancelBubble=true;this.combo.DOMelem_input.onkeydown(e)
 };this.DOMlist.onmouseover = this._listOver;};dhtmlXCombo.prototype._listOver = function(e)
 {e = e||event;e.cancelBubble = true;var node = (_isIE?event.srcElement:e.target);var that = this.combo;if ( node.parentNode == that.DOMlist ){if(that._selOption)that._selOption.deselect();if(that._tempSel)that._tempSel.deselect();var i=0;for (i;i<that.DOMlist.childNodes.length;i++){if (that.DOMlist.childNodes[i]==node)break;};var z=that.optionsArr[i];that._tempSel=z;that._tempSel.select();if ((that._autoxml)&&((i+1)==that._lastLength)){that._fetchOptions(i+1,that._lasttext||"");}}};dhtmlXCombo.prototype._positList = function()
 {var pos=this.getPosition(this.DOMelem);if(this.ListPosition == 'Bottom'){this.DOMlist.style.top = pos[1]+this.DOMelem.offsetHeight-1+"px";this.DOMlist.style.left = pos[0]+"px";}else if(this.ListPosition == 'Top'){this.DOMlist.style.top = pos[1] - this.DOMlist.offsetHeight+"px";this.DOMlist.style.left = pos[0]+"px";}else{this.DOMlist.style.top = pos[1]+"px";this.DOMlist.style.left = pos[0]+this.DOMelem.offsetWidth+"px";}};dhtmlXCombo.prototype.getPosition = function(oNode,pNode){if (_isChrome){if(!pNode)var 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 && _isIE<8){if (document.documentElement.scrollTop)iTop+=document.documentElement.scrollTop;if (document.documentElement.scrollLeft)iLeft+=document.documentElement.scrollLeft;}else
 if (!_isFF){iLeft+=document.body.offsetLeft;iTop+=document.body.offsetTop;}};return new Array(iLeft,iTop);};var pos = getOffset(oNode);return [pos.left, pos.top];};dhtmlXCombo.prototype._correctSelection = function(){if (this.getComboText()!="")
 for (var i=0;i<this.optionsArr.length;i++)if (!this.optionsArr[i].isHidden()){return this.selectOption(i,true,false);};this.unSelectOption();};dhtmlXCombo.prototype.selectNext = function(step){var z=this.getSelectedIndex()+step;while (this.optionsArr[z]){if (!this.optionsArr[z].isHidden())
 return this.selectOption(z,false,false);z+=step;}};dhtmlXCombo.prototype._onKeyF = function(e){var that=this.parentNode.combo;var ev=e||event;ev.cancelBubble=true;if (ev.keyCode=="13" || ev.keyCode=="9" ){that._confirmSelection();that.closeAll();}else
 if (ev.keyCode=="27" ){that._resetSelection();that.closeAll();}else that._activeMode=true;if (ev.keyCode=="13" || ev.keyCode=="27" ){that.callEvent("onKeyPressed",[ev.keyCode])
 return false;};return true;};dhtmlXCombo.prototype._onKey = function(e){var that=this.parentNode.combo;(e||event).cancelBubble=true;var ev=(e||event).keyCode;if (ev>15 && ev<19)return true;if (ev==27)return;if ((that.DOMlist.style.display!="block")&&(ev!="13")&&(ev!="9")&&((!that._filter)||(that._filterAny)))
 that.DOMelem.onclick(e||event);if ((ev!="13")&&(ev!="9")){window.setTimeout(function(){that._onKeyB(ev);},1);if (ev=="40" || ev=="38")return false;}else if (ev==9){that.closeAll();(e||event).cancelBubble=false;}};dhtmlXCombo.prototype._onKeyB = function(ev)
 {if (ev=="40"){var z=this.selectNext(1);}else if (ev=="38"){this.selectNext(-1);}else{this.callEvent("onKeyPressed",[ev])
 if (this._filter)return this.filterSelf((ev==8)||(ev==46));for(var i=0;i<this.optionsArr.length;i++)if (this.optionsArr[i].data()[1]==this.DOMelem_input.value){this.selectOption(i,false,false);return false;};this.unSelectOption();};return true;};dhtmlXCombo.prototype._onBlur = function()
 {var self = this.parentNode._self;window.setTimeout(function(){if (self.DOMlist._skipBlur)return !(self.DOMlist._skipBlur=false);self._confirmSelection();self.callEvent("onBlur",[]);},100)
 
 };dhtmlXCombo.prototype.redrawOptions = function(){if (this._skiprender)return;for(var i=this.DOMlist.childNodes.length-1;i>=0;i--)this.DOMlist.removeChild(this.DOMlist.childNodes[i]);for(var i=0;i<this.optionsArr.length;i++)this.DOMlist.appendChild(this.optionsArr[i].render());};dhtmlXCombo.prototype.loadXML = function(url,afterCall){this._load=true;this.callEvent("onXLS",[]);if (this._prs)for (var i=0;i<this._prs.length;i++)url+=[getUrlSymbol(url),escape(this._prs[i][0]),"=",escape(this._prs[i][1])].join("");if ((this._xmlCache)&&(this._xmlCache[url])){this._fillFromXML(this,null,null,null,this._xmlCache[url]);if (afterCall)afterCall();}else{var xml=(new dtmlXMLLoaderObject(this._fillFromXML,this,true,true));if (afterCall)xml.waitCall=afterCall;xml._cPath=url;xml.loadXML(url);}};dhtmlXCombo.prototype.loadXMLString = function(astring){var xml=(new dtmlXMLLoaderObject(this._fillFromXML,this,true,true));xml.loadXMLString(astring);};dhtmlXCombo.prototype._fillFromXML = function(obj,b,c,d,xml){if (obj._xmlCache)obj._xmlCache[xml._cPath]=xml;var toptag=xml.getXMLTopNode("complete");if (toptag.tagName!="complete")return;var top=xml.doXPath("//complete");var options=xml.doXPath("//option");var add = false;obj.render(false);if ((!top[0])||(!top[0].getAttribute("add"))){obj.clearAll();obj._lastLength=options.length;if (obj._xml){if ((!options)|| (!options.length)) 
 obj.closeAll();else {if (obj._activeMode){obj._positList();obj.DOMlist.style.display="block";if (_isIE)obj._IEFix(true);}}}}else {obj._lastLength+=options.length||Infinity;add = true;};for (var i=0;i<options.length;i++){var attr = new Object();attr.text = options[i].firstChild?options[i].firstChild.nodeValue:"";for (var j=0;j<options[i].attributes.length;j++){var a = options[i].attributes[j];if (a)attr[a.nodeName] = a.nodeValue;};obj._addOption(attr);};obj.render(add!=true || (!!options.length));if ((obj._load)&&(obj._load!==true))
 obj.loadXML(obj._load);else{obj._load=false;if ((!obj._lkmode)&&(obj._filter))
 obj._correctSelection();};var selected=xml.doXPath("//option[@selected]");if (selected.length)obj.selectOption(obj.getIndexByValue(selected[0].getAttribute("value")),false,true);obj.callEvent("onXLE",[]);};dhtmlXCombo.prototype.unSelectOption = function(){if (this._selOption)this._selOption.deselect();if(this._tempSel)this._tempSel.deselect();this._tempSel=this._selOption=null;};dhtmlXCombo.prototype.confirmValue = function(){this._confirmSelection();};dhtmlXCombo.prototype._confirmSelection = function(data,status){if(arguments.length==0){var z=this.getOptionByLabel(this.DOMelem_input.value);data = z?z.value:this.DOMelem_input.value;status = (z==null);if (data==this.getActualValue()) return;};this.DOMelem_hidden_input.value=data;this.DOMelem_hidden_input2.value = (status?"true":"false");this.callEvent("onChange",[]);this._activeMode=false;};dhtmlXCombo.prototype._resetSelection = function(data,status){var z=this.getOption(this.DOMelem_hidden_input.value);this.setComboValue(z?z.data()[0]:this.DOMelem_hidden_input.value)
 this.setComboText(z?z.data()[1]:this.DOMelem_hidden_input.value)
 };dhtmlXCombo.prototype.selectOption = function(ind,filter,conf){if (arguments.length<3)conf=true;this.unSelectOption();var z=this.optionsArr[ind];if (!z)return;this._selOption=z;this._selOption.select();var corr=this._selOption.content.offsetTop+this._selOption.content.offsetHeight-this.DOMlist.scrollTop-this.DOMlist.offsetHeight;if (corr>0)this.DOMlist.scrollTop+=corr;corr=this.DOMlist.scrollTop-this._selOption.content.offsetTop;if (corr>0)this.DOMlist.scrollTop-=corr;var data=this._selOption.data();if (conf){this.setComboText(data[1]);this._confirmSelection(data[0],false);if ((this._autoxml)&&((ind+1)==this._lastLength))
 this._fetchOptions(ind+1,this._lasttext||"");};if (filter){var text=this.getComboText();if (text!=data[1]){this.setComboText(data[1]);dhtmlXRange(this.DOMelem_input,text.length+1,data[1].length);}}else
 this.setComboText(data[1]);this._selOption.RedrawHeader(this);this.callEvent("onSelectionChange",[]);};dhtmlXCombo.prototype._selectOption = function(e)
 {(e||event).cancelBubble = true;var node=(_isIE?event.srcElement:e.target);var that=this.combo;while (!node._self){node = node.parentNode;if (!node)return;};var i=0;for (i;i<that.DOMlist.childNodes.length;i++){if (that.DOMlist.childNodes[i]==node)break;};that.selectOption(i,false,true);that.closeAll();that.callEvent("onBlur",[])
 that._activeMode=false;};dhtmlXCombo.prototype.openSelect = function(){if (this._disabled)return;this.closeAll();this._positList();this.DOMlist.style.display="block";this.callEvent("onOpen",[]);if(this._tempSel)this._tempSel.deselect();if(this._selOption)this._selOption.select();if(this._selOption){var corr=this._selOption.content.offsetTop+this._selOption.content.offsetHeight-this.DOMlist.scrollTop-this.DOMlist.offsetHeight;if (corr>0)this.DOMlist.scrollTop+=corr;corr=this.DOMlist.scrollTop-this._selOption.content.offsetTop;if (corr>0)this.DOMlist.scrollTop-=corr;};if (_isIE)this._IEFix(true);this.DOMelem_input.focus();if (this._filter)this.filterSelf();};dhtmlXCombo.prototype._toggleSelect = function(e)
 {var that=this.combo;if ( that.DOMlist.style.display == "block" ){that.closeAll();}else {that.openSelect();};(e||event).cancelBubble = true;};dhtmlXCombo.prototype._fetchOptions=function(ind,text){if (text==""){this.closeAll();return this.clearAll();};var url=this._xml+((this._xml.indexOf("?")!=-1)?"&":"?")+"pos="+ind+"&mask="+encodeURIComponent(text);this._lasttext=text;if (this._load)this._load=url;else {if (!this.callEvent("onDynXLS",[text,ind])) return;this.loadXML(url);}};dhtmlXCombo.prototype.filterSelf = function(mode)
 {var text=this.getComboText();if (this._xml){this._lkmode=mode;this._fetchOptions(0,text);};try{var filter=new RegExp("^"+text,"i");}catch (e){var filter=new RegExp("^"+text.replace(/([\[\]\{\}\(\)\+\*\\])/g,"\\$1"));};this.filterAny=false;for(var i=0;i<this.optionsArr.length;i++){var z=filter.test(this.optionsArr[i].text);this.filterAny|=z;this.optionsArr[i].hide(!z);};if (!this.filterAny){this.closeAll();this._activeMode=true;}else {if (this.DOMlist.style.display!="block")this.openSelect();if (_isIE)this._IEFix(true);};if (!mode)this._correctSelection();else this.unSelectOption();};dhtmlXCombo.prototype._IEFix = function(mode){this.DOMlistF.style.display=(mode?"block":"none");this.DOMlistF.style.top=this.DOMlist.style.top;this.DOMlistF.style.left=this.DOMlist.style.left;};dhtmlXCombo.prototype.closeAll = function()
 {if(window.dhx_glbSelectAr)for (var i=0;i<dhx_glbSelectAr.length;i++){if (dhx_glbSelectAr[i].DOMlist.style.display=="block"){dhx_glbSelectAr[i].DOMlist.style.display = "none";if (_isIE)dhx_glbSelectAr[i]._IEFix(false);};dhx_glbSelectAr[i]._activeMode=false;}};function dhtmlXRange(InputId, Start, End)
{var Input = typeof(InputId)=='object' ? InputId : document.getElementById(InputId);try{Input.focus();}catch(e){};var Length = Input.value.length;Start--;if (Start < 0 || Start > End || Start > Length)Start = 0;if (End > Length)End = Length;if (Start==End)return;if (Input.setSelectionRange){Input.setSelectionRange(Start, End);}else if (Input.createTextRange){var range = Input.createTextRange();range.moveStart('character', Start);range.moveEnd('character', End-Length);try{range.select();}catch(e){}}};dhtmlXCombo_defaultOption = function(){this.init();};dhtmlXCombo_defaultOption.prototype.init = function(){this.value = null;this.text = "";this.selected = false;this.css = "";};dhtmlXCombo_defaultOption.prototype.select = function(){if (this.content){this.content.className="dhx_selected_option"+(dhtmlx.skin?" combo_"+dhtmlx.skin+"_sel":"");}};dhtmlXCombo_defaultOption.prototype.hide = function(mode){this.render().style.display=mode?"none":"";};dhtmlXCombo_defaultOption.prototype.isHidden = function(){return (this.render().style.display=="none");};dhtmlXCombo_defaultOption.prototype.deselect = function(){if (this.content)this.render();this.content.className="";};dhtmlXCombo_defaultOption.prototype.setValue = function(attr){this.value = attr.value||"";this.text = attr.text||"";this.css = attr.css||"";this.content=null;};dhtmlXCombo_defaultOption.prototype.render = function(){if (!this.content){this.content=document.createElement("DIV");this.content._self = this;this.content.style.cssText='width:100%;overflow:hidden;'+this.css;if (_isOpera || _isKHTML )this.content.style.padding="2px 0px 2px 0px";this.content.innerHTML=this.text;this._ctext=_isIE?this.content.innerText:this.content.textContent;};return this.content;};dhtmlXCombo_defaultOption.prototype.data = function(){if (this.content)return [this.value,this._ctext ? this._ctext : this.text];};dhtmlXCombo_defaultOption.prototype.DrawHeader = function(self, name, width, tab)
{var z=document.createElement("DIV");z.style.width = width+"px";z.className = 'dhx_combo_box '+(dhtmlx.skin||"");z._self = self;self.DOMelem = z;this._DrawHeaderInput(self, name, width,tab);this._DrawHeaderButton(self, name, width);self.DOMParent.appendChild(self.DOMelem);};dhtmlXCombo_defaultOption.prototype._DrawHeaderInput = function(self, name, width,tab)
{var z=document.createElement('input');z.setAttribute("autocomplete","off");z.type = 'text';z.className = 'dhx_combo_input';if (tab)z.tabIndex=tab;z.style.width = width-19-(document.compatMode=="BackCompat"?0:3)+'px';self.DOMelem.appendChild(z);self.DOMelem_input = z;z = document.createElement('input');z.type = 'hidden';z.name = name;self.DOMelem.appendChild(z);self.DOMelem_hidden_input = z;z = document.createElement('input');z.type = 'hidden';z.name = (name||"").replace(/(\]?)$/, "_new_value$1");z.value="true";self.DOMelem.appendChild(z);self.DOMelem_hidden_input2 = z;};dhtmlXCombo_defaultOption.prototype._DrawHeaderButton = function(self, name, width)
{var z=document.createElement('img');z.className = 'dhx_combo_img';if(dhtmlx.image_path)dhx_globalImgPath = dhtmlx.image_path;z.src = (window.dhx_globalImgPath?dhx_globalImgPath:"")+'combo_select'+(dhtmlx.skin?"_"+dhtmlx.skin:"")+'.gif';self.DOMelem.appendChild(z);self.DOMelem_button=z;};dhtmlXCombo_defaultOption.prototype.RedrawHeader = function(self)
{};dhtmlXCombo_optionTypes['default'] = dhtmlXCombo_defaultOption;dhtmlXCombo.prototype.dhx_Event=function()
{this.dhx_SeverCatcherPath="";this.attachEvent = function(original, catcher, CallObj)
 {CallObj = CallObj||this;original = 'ev_'+original;if ( ( !this[original] )|| ( !this[original].addEvent ) ) {var z = new this.eventCatcher(CallObj);z.addEvent( this[original] );this[original] = z;};return ( original + ':' + this[original].addEvent(catcher) );};this.callEvent=function(name,arg0){if (this["ev_"+name])return this["ev_"+name].apply(this,arg0);return true;};this.checkEvent=function(name){if (this["ev_"+name])return true;return false;};this.eventCatcher = function(obj)
 {var dhx_catch = new Array();var m_obj = obj;var func_server = function(catcher,rpc)
 {catcher = catcher.split(":");var postVar="";var postVar2="";var target=catcher[1];if (catcher[1]=="rpc"){postVar='<?xml version="1.0"?><methodCall><methodName>'+catcher[2]+'</methodName><params>';postVar2="</params></methodCall>";target=rpc;};var z = function() {};return z;};var z = function()
 {if (dhx_catch)var res=true;for (var i=0;i<dhx_catch.length;i++){if (dhx_catch[i] != null){var zr = dhx_catch[i].apply( m_obj, arguments );res = res && zr;}};return res;};z.addEvent = function(ev)
 {if ( typeof(ev)!= "function" )
 if (ev && ev.indexOf && ev.indexOf("server:")== 0)
 ev = new func_server(ev,m_obj.rpcServer);else
 ev = eval(ev);if (ev)return dhx_catch.push( ev ) - 1;return false;};z.removeEvent = function(id)
 {dhx_catch[id] = null;};return z;};this.detachEvent = function(id)
 {if (id != false){var list = id.split(':');this[ list[0] ].removeEvent( list[1] );}}};(function(){dhtmlx.extend_api("dhtmlXCombo",{_init:function(obj){if (obj.image_path)dhx_globalImgPath=obj.image_path;return [obj.parent, obj.name, (obj.width||"100%"), obj.type, obj.index ];},
 filter:"filter_command",
 auto_height:"enableOptionAutoHeight",
 auto_position:"enableOptionAutoPositioning",
 auto_width:"enableOptionAutoWidth",
 xml:"loadXML",
 readonly:"readonly",
 items:"addOption"
 },{filter_command:function(data){if (typeof data == "string")this.enableFilteringMode(true,data);else
 this.enableFilteringMode(data);}});})();dhtmlXCombo_imageOption = function(){this.init();};dhtmlXCombo_imageOption.prototype = new dhtmlXCombo_defaultOption;dhtmlXCombo_imageOption.prototype.setValue = function(attr){this.value = attr.value||"";this.text = attr.text||"";this.css = attr.css||"";this.img_src = attr.img_src||this.getDefImage();};dhtmlXCombo_imageOption.prototype.render = function(){if (!this.content){this.content=document.createElement("DIV");this.content._self = this;this.content.style.cssText='width:100%;overflow:hidden;'+this.css;var html = '';if (this.img_src != '')html += '<img style="float:left;" src="'+this.img_src+'" />';html += '<div style="float:left">'+this.text+'</div>';this.content.innerHTML=html;};return this.content;};dhtmlXCombo_imageOption.prototype.data = function(){return [this.value,this.text,this.img_src];};dhtmlXCombo_imageOption.prototype.DrawHeader = function(self, name, width)
{var z=document.createElement("DIV");z.style.width = width+"px";z.className = 'dhx_combo_box';z._self = self;self.DOMelem = z;this._DrawHeaderImage(self, name, width);this._DrawHeaderInput(self, name, width-19);this._DrawHeaderButton(self, name, width);self.DOMParent.appendChild(self.DOMelem);};dhtmlXCombo_imageOption.prototype._DrawHeaderImage = function(self, name, width)
{var z= document.createElement('img');z.className = 'dhx_combo_option_img';z.style.visibility = 'hidden';self.DOMelem.appendChild(z);self.DOMelem_image=z;};dhtmlXCombo_imageOption.prototype.RedrawHeader = function(self)
{self.DOMelem_image.style.visibility = 'visible';self.DOMelem_image.src = this.img_src;};dhtmlXCombo_imageOption.prototype.getDefImage = function(self){return "";};dhtmlXCombo.prototype.setDefaultImage=function(url){dhtmlXCombo_imageOption.prototype.getDefImage=function(){return url;}};dhtmlXCombo_optionTypes['image'] = dhtmlXCombo_imageOption;dhtmlXCombo_checkboxOption = function(){this.init();};dhtmlXCombo_checkboxOption.prototype = new dhtmlXCombo_defaultOption;dhtmlXCombo_checkboxOption.prototype.setValue = function(attr){this.value = attr.value||"";this.text = attr.text||"";this.css = attr.css||"";this.checked = attr.checked||0;};dhtmlXCombo_checkboxOption.prototype.render = function(){if (!this.content){this.content=document.createElement("DIV");this.content._self = this;this.content.style.cssText='width:100%;overflow:hidden;'+this.css;var html = '';if(this.checked)html += '<input style="float:left;" type="checkbox" checked />';else html += '<input style="float:left;" type="checkbox" />';html += '<div style="float:left">'+this.text+'</div>';this.content.innerHTML=html;this.content.firstChild.onclick = function(e) {this.parentNode.parentNode.combo.DOMelem_input.focus();(e||event).cancelBubble=true;if(!this.parentNode.parentNode.combo.callEvent("onCheck",[this.parentNode._self.value,this.checked])){this.checked=!this.checked;return false;}}};return this.content;};dhtmlXCombo_checkboxOption.prototype.data = function(){return [this.value,this.text,this.render().firstChild.checked];};dhtmlXCombo_checkboxOption.prototype.DrawHeader = function(self, name, width)
{self.DOMelem = document.createElement("DIV");self.DOMelem.style.width = width+"px";self.DOMelem.className = 'dhx_combo_box';self.DOMelem._self = self;this._DrawHeaderCheckbox(self, name, width);this._DrawHeaderInput(self, name, width-19);this._DrawHeaderButton(self, name, width);self.DOMParent.appendChild(self.DOMelem);};dhtmlXCombo_checkboxOption.prototype._DrawHeaderCheckbox = function(self, name, width)
{var z= document.createElement('input');z.type='checkbox';z.className = 'dhx_combo_option_img';z.style.visibility = 'hidden';z.onclick = function(e) {var index = self.getIndexByValue(self.getActualValue());if(index!=-1)self.setChecked(index,z.checked);(e||event).cancelBubble=true;};self.DOMelem.appendChild(z);self.DOMelem_checkbox = z;};dhtmlXCombo_checkboxOption.prototype.RedrawHeader = function(self)
{self.DOMelem_checkbox.style.visibility = '';self.DOMelem_checkbox.checked = this.content.firstChild.checked;};dhtmlXCombo_optionTypes['checkbox'] = dhtmlXCombo_checkboxOption;dhtmlXCombo.prototype.getChecked=function(){var res=[];for(var i=0;i<this.optionsArr.length;i++)if(this.optionsArr[i].data()[2])
 res.push(this.optionsArr[i].value)
 return res;};dhtmlXCombo.prototype.setChecked=function(index,mode){this.optionsArr[index].content.firstChild.checked=(!(mode===false));};dhtmlXCombo.prototype.setCheckedByValue=function(value,mode){return this.setChecked(this.getIndexByValue(value),mode);};dhtmlXCombo.prototype.enableOptionAutoPositioning = function(fl){if(!this.ListAutoPosit)this.ListAutoPosit = 1;this.attachEvent("onOpen",function(){this._setOptionAutoPositioning(fl);})
 this.attachEvent("onXLE",function(){this._setOptionAutoPositioning(fl);})
 
};dhtmlXCombo.prototype._setOptionAutoPositioning = function(fl){if((typeof(fl)!="undefined")&&(!convertStringToBoolean(fl))){this.ListPosition = "Bottom";this.ListAutoPosit = 0;return true
 };var pos = this.getPosition(this.DOMelem);var bottom = this._getClientHeight() - pos[1] - this.DOMelem.offsetHeight;var height = (this.autoHeight)?(this.DOMlist.scrollHeight):parseInt(this.DOMlist.offsetHeight);if((bottom < height)&&(pos[1] > height)){this.ListPosition = "Top";}else this.ListPosition = "Bottom";this._positList();};dhtmlXCombo.prototype._getClientHeight = function(){return ((document.compatMode=='CSS1Compat') &&(!window.opera))?document.documentElement.clientHeight:document.body.clientHeight;};dhtmlXCombo.prototype.setOptionWidth = function(width){if(arguments.length > 0){this.DOMlist.style.width = width+"px";if (this.DOMlistF)this.DOMlistF.style.width = width+"px";}};dhtmlXCombo.prototype.setOptionHeight = function(height){if(arguments.length>0){if(_isIE)this.DOMlist.style.height = this.DOMlistF.style.height = height+"px";else
 this.DOMlist.style.height = height+"px";if(this.DOMlistF)this.DOMlistF.style.height = this.DOMlist.style.height;this._positList();}};dhtmlXCombo.prototype.enableOptionAutoWidth = function(fl){if(!this._listWidthConf)this._listWidthConf = parseInt(this.DOMlist.style.width);if(arguments.length == 0){var fl = 1;};if(convertStringToBoolean(fl)) {this.autoOptionWidth = 1;this.awOnOpen = this.attachEvent("onOpen",function(){this._setOptionAutoWidth()});this.awOnXLE = this.attachEvent("onXLE",function(){this._setOptionAutoWidth()});}else {if(typeof(this.awOnOpen)!= "undefined"){this.autoOptionWidth = 0;this.detachEvent(this.awOnOpen);this.detachEvent(this.awOnXLE);this.setOptionWidth(this._listWidthConf);}}};dhtmlXCombo.prototype._setOptionAutoWidth = function(){var isScroll = !this.ahOnOpen&&this.DOMlist.scrollHeight>this.DOMlist.offsetHeight;this.setOptionWidth(1);var x = this.DOMlist.offsetWidth;for ( var i=0;i<this.optionsArr.length;i++){var optWidth = (_isFF)?(this.DOMlist.childNodes[i].scrollWidth - 2):this.DOMlist.childNodes[i].scrollWidth;if (optWidth > x){x = this.DOMlist.childNodes[i].scrollWidth;}};x += isScroll?18:0;this.setOptionWidth(x);};dhtmlXCombo.prototype.enableOptionAutoHeight = function(fl,maxHeight){if(!this._listHeightConf)this._listHeightConf = (this.DOMlist.style.height=="")?100:parseInt(this.DOMlist.style.height);if(arguments.length==0)var fl = 1;this.autoHeight = convertStringToBoolean(fl);if(this.autoHeight){this.ahOnOpen = this.attachEvent("onOpen",function(){this._setOptionAutoHeight(fl,maxHeight);if(_isIE)this._setOptionAutoHeight(fl,maxHeight);})
 if(!this.awOnOpen)this.ahOnXLE = this.attachEvent("onXLE",function(){var that = this;window.setTimeout(function(){that.callEvent("onOpen",[]);},1);})
 }else {if(typeof(this.ahOnOpen)!= "undefined"){this.detachEvent(this.ahOnOpen);this.detachEvent(this.ahOnXLE);this.setOptionHeight(this._listHeightConf);}}};dhtmlXCombo.prototype._setOptionAutoHeight = function(fl,maxHeight){if(convertStringToBoolean(fl)){this.setOptionHeight(1);var height = 0;if (this.optionsArr.length > 0){if(this.DOMlist.scrollHeight > this.DOMlist.offsetHeight){height= this.DOMlist.scrollHeight + 2;}else height= this.DOMlist.offsetHeight;if((arguments.length > 1)&&(maxHeight)){var maxHeight = parseInt(maxHeight);height = (height>maxHeight)?maxHeight:height;};this.setOptionHeight(height)
 }else this.DOMlist.style.display="none";}};dhtmlXCombo.prototype.attachChildCombo = function(_chcombo,xml){if(!this._child_combos){this._child_combos = [];};this._has_childen = 1;this._child_combos[this._child_combos.length] = _chcombo;_chcombo.show(0);var that = this;var _arg_length = arguments.length;this.attachEvent("onChange",function(){for(var i = 0;i < that._child_combos.length;i++){if(that._child_combos[i]==_chcombo){_chcombo.show(1);_chcombo.callEvent("onMasterChange",[that.getActualValue(),that]);}};if(that.getActualValue()=="") {that.showSubCombo(that,0);return;};if(_chcombo._xml){if(_arg_length ==1)xml = _chcombo._xml;_chcombo._xml = that.deleteParentVariable(xml);_chcombo._xml += ((_chcombo._xml.indexOf("?")!=-1)?"&":"?")+"parent="+that.getActualValue();}else{if(xml){_chcombo.clearAll(true);_chcombo.loadXML(xml+((xml.indexOf("?")!=-1)?"&":"?")+"parent="+that.getActualValue());}}})
};dhtmlXCombo.prototype.setAutoSubCombo = function(xml,name){if(arguments.length == 1)name = "subcombo";if(!this._parentCombo){var z = new dhtmlXCombo(this.DOMParent,name,this.DOMelem.style.width)
 z._parentCombo = this;}else {var z = new dhtmlXCombo(this._parentCombo.DOMParent,name,this._parentCombo.DOMelem.style.width)
 z._parentCombo = this._parentCombo;};if(this._filter)z._filter = 1;if(this._xml){if(arguments.length > 0)z._xml = xml;else 
 z._xml = this._xml;xml = z._xml;z._autoxml = this._autoxml;if(this._xmlCache)z._xmlCache=[];};this.attachChildCombo(z,xml) 
 return z;};dhtmlXCombo.prototype.detachChildCombo = function(_chcombo){for(var i = 0;i < this._child_combos.length;i++){this._child_combos[i] == _chcombo;this._child_combos.splice(i,1);};_chcombo.show(1);};dhtmlXCombo.prototype.showSubCombo = function(combo,state){if(combo._child_combos){for(var i = 0;i < combo._child_combos.length;i++){combo._child_combos[i].show(state);combo.showSubCombo(combo._child_combos[i],0);}}};dhtmlXCombo.prototype.deleteParentVariable = function(str){str = str.replace(/parent\=[^&]*/g,"").replace(/\?\&/,"?");return str;};function dataProcessor(serverProcessorURL){this.serverProcessor = serverProcessorURL;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(mode,total){this._tMode=mode;this._tSend=total;},
 escape:function(data){if (this._utf)return encodeURIComponent(data);else
 return escape(data);},
 
 enableUTFencoding:function(mode){this._utf=convertStringToBoolean(mode);},
 
 setDataColumns:function(val){this._columns=(typeof val == "string")?val.split(","):val;},
 
 getSyncState:function(){return !this.updatedRows.length;},
 
 enableDataNames:function(mode){this._endnm=convertStringToBoolean(mode);},
 
 enablePartialDataSend:function(mode){this._changed=convertStringToBoolean(mode);},
 
 setUpdateMode:function(mode,dnd){this.autoUpdate = (mode=="cell");this.updateMode = mode;this.dnd=dnd;},
 ignore:function(code,master){this._silent_mode=true;code.call(master||window);this._silent_mode=false;},
 
 setUpdated:function(rowId,state,mode){if (this._silent_mode)return;var ind=this.findRow(rowId);mode=mode||"updated";var existing = this.obj.getUserData(rowId,this.action_param);if (existing && mode == "updated")mode=existing;if (state){this.set_invalid(rowId,false);this.updatedRows[ind]=rowId;this.obj.setUserData(rowId,this.action_param,mode);if (this._in_progress[rowId])this._in_progress[rowId]="wait";}else{if (!this.is_invalid(rowId)){this.updatedRows.splice(ind,1);this.obj.setUserData(rowId,this.action_param,"");}};if (!state)this._clearUpdateFlag(rowId);this.markRow(rowId,state,mode);if (state && this.autoUpdate)this.sendData(rowId);},
 _clearUpdateFlag:function(id){},
 markRow:function(id,state,mode){var str="";var invalid=this.is_invalid(id);if (invalid){str=this.styles[invalid];state=true;};if (this.callEvent("onRowMark",[id,state,mode,invalid])){str=this.styles[state?mode:"clear"]+str;this.obj[this._methods[0]](id,str);if (invalid && invalid.details){str+=this.styles[invalid+"_cell"];for (var i=0;i < invalid.details.length;i++)if (invalid.details[i])this.obj[this._methods[1]](id,i,str);}}},
 getState:function(id){return this.obj.getUserData(id,this.action_param);},
 is_invalid:function(id){return this._invalid[id];},
 set_invalid:function(id,mode,details){if (details)mode={value:mode, details:details, toString:function(){return this.value.toString();}};this._invalid[id]=mode;},
 
 checkBeforeUpdate:function(rowId){return true;},
 
 sendData:function(rowId){if (this._waitMode && (this.obj.mytype=="tree" || this.obj._h2)) return;if (this.obj.editStop)this.obj.editStop();if(typeof rowId == "undefined" || this._tSend)return this.sendAllData();if (this._in_progress[rowId])return false;this.messages=[];if (!this.checkBeforeUpdate(rowId)&& this.callEvent("onValidatationError",[rowId,this.messages])) return false;this._beforeSendData(this._getRowData(rowId),rowId);},
 _beforeSendData:function(data,rowId){if (!this.callEvent("onBeforeUpdate",[rowId,this.getState(rowId),data])) return false;this._sendData(data,rowId);},
 serialize:function(data, id){if (typeof id != "undefined")return this.serialize_one(data,"");else{var stack = [];var keys = [];for (var key in data)if (data.hasOwnProperty(key)){stack.push(this.serialize_one(data[key],key+this.post_delim));keys.push(key);};stack.push("ids="+this.escape(keys.join(",")));return stack.join("&");}},
 serialize_one:function(data, pref){if (typeof data == "string")return data;var stack = [];for (var key in data)if (data.hasOwnProperty(key))
 stack.push(this.escape((pref||"")+key)+"="+this.escape(data[key]));return stack.join("&");},
 _sendData:function(a1,rowId){if (!a1)return;if (!this.callEvent("onBeforeDataSending",rowId?[rowId,this.getState(rowId),a1]:[null, null, a1])) return false;if (rowId)this._in_progress[rowId]=(new Date()).valueOf();var a2=new dtmlXMLLoaderObject(this.afterUpdate,this,true);var a3 = this.serverProcessor+(this._user?(getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&")):"");if (this._tMode!="POST")a2.loadXML(a3+((a3.indexOf("?")!=-1)?"&":"?")+this.serialize(a1,rowId));else
 a2.loadXML(a3,true,this.serialize(a1));this._waitMode++;},
 sendAllData:function(){if (!this.updatedRows.length)return;this.messages=[];var valid=true;for (var i=0;i<this.updatedRows.length;i++)valid&=this.checkBeforeUpdate(this.updatedRows[i]);if (!valid && !this.callEvent("onValidatationError",["",this.messages])) return false;if (this._tSend)this._sendData(this._getAllData());else
 for (var i=0;i<this.updatedRows.length;i++)if (!this._in_progress[this.updatedRows[i]]){if (this.is_invalid(this.updatedRows[i])) continue;this._beforeSendData(this._getRowData(this.updatedRows[i]),this.updatedRows[i]);if (this._waitMode && (this.obj.mytype=="tree" || this.obj._h2)) return;}},
 
 
 
 
 
 
 
 
 _getAllData:function(rowId){var out={};var has_one = false;for(var i=0;i<this.updatedRows.length;i++){var id=this.updatedRows[i];if (this._in_progress[id] || this.is_invalid(id)) continue;if (!this.callEvent("onBeforeUpdate",[id,this.getState(id)])) continue;out[id]=this._getRowData(id,id+this.post_delim);has_one = true;this._in_progress[id]=(new Date()).valueOf();};return has_one?out:null;},
 
 
 
 setVerificator:function(ind,verifFunction){this.mandatoryFields[ind] = verifFunction||(function(value){return (value!="");});},
 
 clearVerificator:function(ind){this.mandatoryFields[ind] = false;},
 
 
 
 
 
 findRow:function(pattern){var i=0;for(i=0;i<this.updatedRows.length;i++)if(pattern==this.updatedRows[i])break;return i;},

 
 


 





 
 defineAction:function(name,handler){if (!this._uActions)this._uActions=[];this._uActions[name]=handler;},




 
 afterUpdateCallback:function(sid, tid, action, btag) {var correct=(action!="error" && action!="invalid");if (!correct)this.set_invalid(sid,action);if ((this._uActions)&&(this._uActions[action])&&(!this._uActions[action](btag))) 
 return (delete this._in_progress[sid]);if (this._in_progress[sid]!="wait")this.setUpdated(sid, false);var soid = sid;switch (action) {case "inserted":
 case "insert":
 if (tid != sid){this.obj[this._methods[2]](sid, tid);sid = tid;};break;case "delete":
 case "deleted":
 this.obj.setUserData(sid, this.action_param, "true_deleted");this.obj[this._methods[3]](sid);return this.callEvent("onAfterUpdate", [sid, action, tid, btag]);break;};if (this._in_progress[sid]!="wait"){if (correct)this.obj.setUserData(sid, this.action_param,'');delete this._in_progress[sid];}else {delete this._in_progress[sid];this.setUpdated(tid,true,this.obj.getUserData(sid,this.action_param));};this.callEvent("onAfterUpdate", [sid, action, tid, btag]);},

 
 afterUpdate:function(that,b,c,d,xml){xml.getXMLTopNode("data");if (!xml.xmlDoc.responseXML)return;var atag=xml.doXPath("//data/action");for (var i=0;i<atag.length;i++){var btag=atag[i];var action = btag.getAttribute("type");var sid = btag.getAttribute("sid");var tid = btag.getAttribute("tid");that.afterUpdateCallback(sid,tid,action,btag);};that.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(anObj){this.obj = anObj;if (this.obj._dp_init)this.obj._dp_init(this);},
 
 
 setOnAfterUpdate:function(ev){this.attachEvent("onAfterUpdate",ev);},
 enableDebug:function(mode){},
 setOnBeforeUpdateHandler:function(func){this.attachEvent("onBeforeDataSending",func);},



 
 setAutoUpdate: function(interval, user) {interval = interval || 2000;this._user = user || (new Date()).valueOf();this._need_update = false;this._loader = null;this._update_busy = false;this.attachEvent("onAfterUpdate",function(sid,action,tid,xml_node){this.afterAutoUpdate(sid, action, tid, xml_node);});this.attachEvent("onFullSync",function(){this.fullSync();});var self = this;window.setInterval(function(){self.loadUpdate();}, interval);},


 
 afterAutoUpdate: function(sid, action, tid, xml_node) {if (action == '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(url,callback){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=callback;this._loader.loadXML(url);},


 
 _v: function(node) {if (node.firstChild)return node.firstChild.nodeValue;return "";},


 
 _a: function(arr) {var res = [];for (var i=0;i < arr.length;i++){res[i]=this._v(arr[i]);};return res;},


 
 loadUpdate: function(){var self = this;var version = this.obj.getUserData(0,"version");var url = this.serverProcessor+getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+version].join("&");url = url.replace("editing=true&","");this.getUpdates(url, function(){var vers = self._loader.doXPath("//userdata");self.obj.setUserData(0,"version",self._v(vers[0]));var upds = self._loader.doXPath("//update");if (upds.length){self._silent_mode = true;for (var i=0;i<upds.length;i++){var status = upds[i].getAttribute('status');var id = upds[i].getAttribute('id');var parent = upds[i].getAttribute('parent');switch (status) {case 'inserted':
 self.callEvent("insertCallback",[upds[i], id, parent]);break;case 'updated':
 self.callEvent("updateCallback",[upds[i], id, parent]);break;case 'deleted':
 self.callEvent("deleteCallback",[upds[i], id, parent]);break;}};self._silent_mode = false;};self._update_busy = false;self = null;});}};function dhtmlXEditor(base, skin) {var that = this;this.skin = (skin||dhtmlx.skin||"dhx_skyblue");this.iconsPath = dhtmlx.image_path||"../../codebase/imgs/";if (typeof(base)== "string") base = document.getElementById(base);this.base = base;while (this.base.childNodes.length > 0)this.base.removeChild(this.base.childNodes[0]);this._isToolbar = (this.initDhtmlxToolbar!=null&&window.dhtmlXToolbarObject!=null?true:false);if (!this._isToolbar){this.tbData = "<div class='dhxeditor_"+this.skin+"_btns'>"+
 "<a href='javascript:void(0);' onclick='return false;' nomousedown='return false;'><div cmd='applyBold' class='dhxeditor_"+this.skin+"_tbbtn btn_bold'></div></a>"+
 "<a href='javascript:void(0);' onclick='return false;' nomousedown='return false;'><div cmd='applyItalic' class='dhxeditor_"+this.skin+"_tbbtn btn_italic'></div></a>"+
 "<a href='javascript:void(0);' onclick='return false;' nomousedown='return false;'><div cmd='applyUnderscore' class='dhxeditor_"+this.skin+"_tbbtn btn_underline'></div></a>"+
 "<a href='javascript:void(0);' onclick='return false;' nomousedown='return false;'><div cmd='clearFormatting' class='dhxeditor_"+this.skin+"_tbbtn btn_clearformat'></div></a>"+
 "<div class='verline_l'></div><div class='verline_r'></div>"+
 "</div>";}else {this.tbData = "";};var pos = (_isIE?this.base.currentStyle["position"]:window.getComputedStyle(this.base, null).getPropertyValue("position"));if (!(pos == "relative" || pos == "absolute")) this.base.style.position = "relative";this.base.innerHTML = this.tbData+"<div style='position:absolute;width: 100%;overflow: hidden;'></div>";var dhxCont = new dhtmlXContainerLite(this.base);dhxCont.skin = this.skin;dhxCont.setContent(this.base.childNodes[(this._isToolbar?0:1)]);var ofs = (this._isToolbar?0:this.base.childNodes[0].offsetHeight);this.base.adjustContent(this.base, ofs);this.editor = document.createElement("IFRAME");this.editor.className = "dhxeditor_mainiframe_"+this.skin;this.editor.frameBorder = 0;if (_isOpera)this.editor.scrolling = "yes";this.base.attachObject(this.editor);this.edWin = this.editor.contentWindow;this.edDoc = this.edWin.document;this._prepareContent = function(saveContent) {var storedContent = "";if (saveContent === true && this.getContent != null)storedContent = this.getContent();var content = this.edDoc;content.open("text/html", "replace");if (_isOpera){content.write("<html><head><style> html, body {overflow:auto;padding:0px;padding-left:1px !important;height:100%;margin:0px;font-family:Tahoma;font-size:10pt;background-color:#ffffff;};</style></head><body contenteditable='true'></body></html>");}else {if (window._KHTMLrv){content.write("<html><head><style> html {overflow-x: auto;overflow-y: auto;};body {overflow: auto;overflow-y: scroll;};html,body {padding:0px;padding-left:1px !important;height:100%;margin:0px;font-family:Tahoma;font-size:10pt;background-color:#ffffff;};</style></head><body contenteditable='true'></body></html>");}else {content.write("<html><head><style> html,body {overflow-x: auto;overflow-y: scroll;padding:0px;padding-left:1px !important;height:100%;margin:0px;font-family:Tahoma;font-size:10pt;background-color:#ffffff;};</style></head><body contenteditable='true'></body></html>");}};content.close();this.edDoc.designMode='On';if (_isFF)try {this.edDoc.execCommand("useCSS", false, true);}catch(e) {};if (saveContent === true && this.setContent != null)this.setContent(storedContent);};this._prepareContent();this.setIconsPath = function() {};this.init = function(){};this.setSizes = function() {var ofs = (this._isToolbar?0:this.base.childNodes[0].offsetHeight);this.base.adjustContent(this.base, ofs);};this._resizeTM = null;this._resizeTMTime = 100;this._doOnResize = function() {window.clearTimeout(that._resizeTM);that._resizeTM = window.setTimeout(function(){if(that.setSizes)that.setSizes();}, that._resizeTMTime);};this._doOnUnload = function() {window.detachEvent("onresize", this._doOnResize);window.removeEventListener("resize", this._doOnResize, false);};dhtmlxEvent(window, "resize", this._doOnResize);this.base.childNodes[0].onselectstart = function(e) {e = e||event;e.cancelBubble = true;e.returnValue = false;if (e.preventDefault)e.preventDefault();return false;};for (var q=0;q<this.base.childNodes[0].childNodes.length-2;q++){this.base.childNodes[0].childNodes[q].childNodes[0].onmousedown = function(e) {that[this.getAttribute("cmd")]();return false;};this.base.childNodes[0].childNodes[q].childNodes[0].onclick = function(e) {return false;}};this.runCommand = function(name,param){if(arguments.length < 2)param = null;if(_isIE)this.edWin.focus();this.edDoc.execCommand(name,false,param);if(_isIE){this.edWin.focus();var self = this;window.setTimeout(function(){self.edWin.focus();},1);}};this.applyBold = function() {this.runCommand("Bold");};this.applyItalic = function() {this.runCommand("Italic");};this.applyUnderscore = function() {this.runCommand("Underline");};this.clearFormatting = function() {this.runCommand("RemoveFormat");};if (this._isToolbar)this.initDhtmlxToolbar();dhtmlxEventable(this);dhtmlxEvent(this.edDoc, "click", function(e){var ev = e||window.event;var el = ev.target||ev.srcElement;that.showInfo(el);});if (_isOpera){dhtmlxEvent(this.edDoc, "mousedown", function(e){var ev = e||window.event;var el = ev.target||ev.srcElement;that.showInfo(el);});};dhtmlxEvent(this.edDoc, "keyup", function(e){var ev = e||window.event;var key = ev.keyCode;var el = ev.target||ev.srcElement;if((key==37)||(key==38)||(key==39)||(key==40)||(key==13))
 that.showInfo(el);});this.attachEvent("onFocusChanged", function(state){if(that._doOnFocusChanged)that._doOnFocusChanged(state);});this.showInfo = function(el){var el = (this.getSelectionBounds().end)?this.getSelectionBounds().end : el;if(!el)return
 try{if(this.edWin.getComputedStyle){var st = this.edWin.getComputedStyle(el, null);var fw = ((st.getPropertyValue("font-weight")==401)?700:st.getPropertyValue("font-weight"));this.style = {fontStyle : st.getPropertyValue("font-style"),
 fontSize : st.getPropertyValue("font-size"),
 textDecoration : st.getPropertyValue("text-decoration"),
 fontWeight : fw,
 fontFamily : st.getPropertyValue("font-family"),
 textAlign : st.getPropertyValue("text-align")
 };if(window._KHTMLrv){this.style.fontStyle = st.getPropertyValue("font-style");this.style.vAlign = st.getPropertyValue("vertical-align");this.style.del = this.isStyleProperty(el,"span","textDecoration","line-through");this.style.u = this.isStyleProperty(el,"span","textDecoration","underline");}}else{var st = el.currentStyle;this.style = {fontStyle : st.fontStyle,
 fontSize : st.fontSize,
 textDecoration : st.textDecoration,
 fontWeight : st.fontWeight,
 fontFamily : st.fontFamily,
 textAlign : st.textAlign
 }};this.setStyleProperty(el,"h1");this.setStyleProperty(el,"h2");this.setStyleProperty(el,"h3");this.setStyleProperty(el,"h4");if(!window._KHTMLrv){this.setStyleProperty(el,"del");this.setStyleProperty(el,"sub");this.setStyleProperty(el,"sup");this.setStyleProperty(el,"u");};this.callEvent("onFocusChanged",[this.style, st])
 }catch(e){return null}};this.getSelectionBounds = function(){var range, root, start, end;if(this.edWin.getSelection){var selection = this.edWin.getSelection();range = selection.getRangeAt(selection.rangeCount-1);start = range.startContainer;end = range.endContainer;root = range.commonAncestorContainer;if(start.nodeName == "#text")root = root.parentNode;if(start.nodeName == "#text")start = start.parentNode;if (start.nodeName.toLowerCase()== "body") start = start.firstChild;if(end.nodeName == "#text")end = end.parentNode;if (end.nodeName.toLowerCase()== "body") end = end.lastChild;if(start == end)root = start;return {root: root,
 start: start,
 end: end
 }}else if(this.edWin.document.selection){range = this.edDoc.selection.createRange()
 if(!range.duplicate)return null;root = range.parentElement();var r1 = range.duplicate();var r2 = range.duplicate();r1.collapse(true);r2.moveToElementText(r1.parentElement());r2.setEndPoint("EndToStart",r1);start = r1.parentElement();r1 = range.duplicate();r2 = range.duplicate();r2.collapse(false);r1.moveToElementText(r2.parentElement());r1.setEndPoint("StartToEnd", r2);end = r2.parentElement();if (start.nodeName.toLowerCase()== "body") start = start.firstChild;if (end.nodeName.toLowerCase()== "body") end = end.lastChild;if(start == end)root = start;return {root: root,
 start: start,
 end: end
 }};return null 
 };this.getContent = function(){if(!this.edDoc.body)return "";else{if(_isFF){return this.edDoc.body.innerHTML.replace(/<br>$/,"")
 };return this.edDoc.body.innerHTML;}};this.setContent = function(str){if(this.edDoc.body){this.edDoc.body.innerHTML = str;this.callEvent("onContentSet",[]);if(_isFF){this.runCommand('InsertHTML',' ');}}else{dhtmlxEvent(this.edWin, "load", function(e){that.setContent(str);})
 }};this.setContentHTML = function(url){(new dtmlXMLLoaderObject(this._ajaxOnLoad,this,false,true)).loadXML(url);};this._ajaxOnLoad = function(obj,a,b,c,loader){if(loader.xmlDoc.responseText)obj.setContent(loader.xmlDoc.responseText);}};function dhtmlXContainerLite(obj) {var that = this;this.obj = obj;this.dhxcont = null;this.setContent = function(data) {this.dhxcont = data;this.dhxcont.innerHTML = "<div id='dhxMainCont' style='position: relative;left: 0px;top: 0px;overflow: hidden;'></div>"+
 "<div id='dhxContBlocker' class='dhxcont_content_blocker' style='display: none;'></div>";this.dhxcont.mainCont = this.dhxcont.childNodes[0];this.obj.dhxcont = this.dhxcont;};this.obj._genStr = function(w) {var s = "";var z = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for (var q=0;q<w;q++)s += z.charAt(Math.round(Math.random() * (z.length-1)));return s;};this.obj.adjustContent = function(parentObj, offsetTop, marginTop, notCalcWidth, offsetBottom) {this.dhxcont.style.left = (this._offsetLeft||0)+"px";this.dhxcont.style.top = (this._offsetTop||0)+offsetTop+"px";var cw = parentObj.clientWidth+(this._offsetWidth||0);if (notCalcWidth !== true)this.dhxcont.style.width = Math.max(0, cw)+"px";if (notCalcWidth !== true)if (this.dhxcont.offsetWidth > cw)this.dhxcont.style.width = Math.max(0, cw*2-this.dhxcont.offsetWidth)+"px";var ch = parentObj.clientHeight+(this._offsetHeight||0);this.dhxcont.style.height = Math.max(0, ch-offsetTop)+(marginTop!=null?marginTop:0)+"px";if (this.dhxcont.offsetHeight > ch - offsetTop)this.dhxcont.style.height = Math.max(0, (ch-offsetTop)*2-this.dhxcont.offsetHeight)+"px";if (offsetBottom)if (!isNaN(offsetBottom)) this.dhxcont.style.height = Math.max(0, parseInt(this.dhxcont.style.height)-offsetBottom)+"px";if (this._minDataSizeH != null){if (parseInt(this.dhxcont.style.height)< this._minDataSizeH) this.dhxcont.style.height = this._minDataSizeH+"px";};if (this._minDataSizeW != null){if (parseInt(this.dhxcont.style.width)< this._minDataSizeW) this.dhxcont.style.width = this._minDataSizeW+"px";};if (notCalcWidth !== true){this.dhxcont.mainCont.style.width = this.dhxcont.clientWidth+"px";if (this.dhxcont.mainCont.offsetWidth > this.dhxcont.clientWidth)this.dhxcont.mainCont.style.width = Math.max(0, this.dhxcont.clientWidth*2-this.dhxcont.mainCont.offsetWidth)+"px";};var menuOffset = (this.menu!=null?(!this.menuHidden?this.menuHeight:0):0);var toolbarOffset = (this.toolbar!=null?(!this.toolbarHidden?this.toolbarHeight:0):0);var statusOffset = (this.sb!=null?(!this.sbHidden?this.sbHeight:0):0);this.dhxcont.mainCont.style.height = this.dhxcont.clientHeight+"px";if (this.dhxcont.mainCont.offsetHeight > this.dhxcont.clientHeight)this.dhxcont.mainCont.style.height = Math.max(0, this.dhxcont.clientHeight*2-this.dhxcont.mainCont.offsetHeight)+"px";this.dhxcont.mainCont.style.height = Math.max(0, parseInt(this.dhxcont.mainCont.style.height)-menuOffset-toolbarOffset-statusOffset)+"px";};this.obj.attachToolbar = function() {var toolbarObj = document.createElement("DIV");toolbarObj.style.position = "relative";toolbarObj.style.overflow = "hidden";toolbarObj.id = "dhxtoolbar_"+this._genStr(12);this.dhxcont.insertBefore(toolbarObj, this.dhxcont.childNodes[(this.menu!=null?1:0)]);this.toolbar = new dhtmlXToolbarObject(toolbarObj.id, this.skin);if (that.skin == "dhx_web"){this.toolbarHeight = 32;this.dhxcont.className = "dhtmlx_editor_extended_"+that.skin;}else {this.toolbarHeight = toolbarObj.offsetHeight+(this._isLayout&&this.skin=="dhx_skyblue"?2:0);};this.toolbarId = toolbarObj.id;if (this._doOnAttachToolbar)this._doOnAttachToolbar("init");this.adjust();return this.toolbar;};this.obj.attachObject = function(obj, autoSize) {if (typeof(obj)== "string") obj = document.getElementById(obj);if (autoSize){obj.style.visibility = "hidden";obj.style.display = "";var objW = obj.offsetWidth;var objH = obj.offsetHeight;};this._attachContent("obj", obj);if (autoSize && this._isWindow){obj.style.visibility = "visible";this._adjustToContent(objW, objH);}};this.obj.adjust = function() {if (this.skin == "dhx_skyblue"){if (this.toolbar){if (this._isWindow || this._isLayout){document.getElementById(this.toolbarId).style.height = "29px";this.toolbarHeight = document.getElementById(this.toolbarId).offsetHeight;if (this._doOnAttachToolbar)this._doOnAttachToolbar("show");};if (this._isCell){document.getElementById(this.toolbarId).className += " in_layoutcell";};if (this._isAcc){document.getElementById(this.toolbarId).className += " in_acccell";}}}};this.obj._attachContent = function(type, obj, append) {while (that.dhxcont.mainCont.childNodes.length > 0){that.dhxcont.mainCont.removeChild(that.dhxcont.mainCont.childNodes[0]);};if (type == "obj"){if (this._isWindow && obj.cmp == null && this.skin == "dhx_skyblue"){this.dhxcont.mainCont.style.border = "#a4bed4 1px solid";this.dhxcont.mainCont.style.backgroundColor = "#FFFFFF";this._redraw();};that.dhxcont._frame = null;that.dhxcont.mainCont.appendChild(obj);that.dhxcont.mainCont.style.overflow = (append===true?"auto":"hidden");obj.style.display = "";}};this.obj._dhxContDestruct = function() {this._genStr = null;this.moveContentTo = null;this.adjustContent = null;this.attachToolbar = null;while (this.dhxcont.mainCont.childNodes.length > 0)this.dhxcont.mainCont.removeChild(this.dhxcont.mainCont.childNodes[0]);this.dhxcont.mainCont.innerHTML = "";this.dhxcont.mainCont = null;try {delete this.dhxcont["mainCont"];}catch(e){};while (this.dhxcont.childNodes.length > 0)this.dhxcont.removeChild(this.dhxcont.childNodes[0]);this.dhxcont.innerHTML = "";this.dhxcont = null;try {delete this["dhxcont"];}catch(e){}}};(function(){dhtmlx.extend_api("dhtmlXEditor",{_init:function(obj){return [obj.parent, obj.skin ];},
 content:"setContent"
 },{});})();dhtmlXEditor.prototype.initDhtmlxToolbar = function() {this.tb = this.base.attachToolbar();this.tb.setSkin(this.skin);if (this.skin == "dhx_skyblue"){this.tb.base.style.borderLeft = "none";this.tb.base.style.borderRight = "none";this.tb.base.style.top = "-1px";};this.setSizes();this.tb.setIconsPath(this.iconsPath+"dhxeditor_"+this.skin+"/");this._availFonts = new Array("Arial", "Arial Narrow", "Comic Sans MS", "Courier", "Georgia", "Impact", "Tahoma", "Times New Roman", "Verdana");this._initFont = this._availFonts[0];this._xmlFonts = "";for (var q=0;q<this._availFonts.length;q++){var fnt = String(this._availFonts[q]).replace(/\s/g,"_");this._xmlFonts += '<item type="button" id="applyFontFamily:'+fnt+'"><itemText><![CDATA[<img src="'+this.tb.imagePath+'font_'+String(fnt).toLowerCase()+'.gif" border="0" style="width:110px;height:16px;">]]></itemText></item>';};this._availSizes = {"1":"8pt", "2":"10pt", "3":"12pt", "4":"14pt", "5":"18pt", "6":"24pt", "7":"36pt"};this._xmlSizes = "";for (var a in this._availSizes){this._xmlSizes += '<item type="button" id="applyFontSize:'+a+':'+this._availSizes[a]+'" text="'+this._availSizes[a]+'"/>';};this.tbXML = '<toolbar>'+
 
 '<item id="applyH1" type="buttonTwoState" img="h1.gif" imgdis="h4_dis.gif" title="H1"/>'+
 '<item id="applyH2" type="buttonTwoState" img="h2.gif" imgdis="h4_dis.gif" title="H2"/>'+
 '<item id="applyH3" type="buttonTwoState" img="h3.gif" imgdis="h4_dis.gif" title="H3"/>'+
 '<item id="applyH4" type="buttonTwoState" img="h4.gif" imgdis="h4_dis.gif" title="H4"/>'+
 '<item id="separ01" type="separator"/>'+
 
 '<item id="applyBold" type="buttonTwoState" img="bold.gif" imgdis="bold_dis.gif" title="Bold Text"/>'+
 '<item id="applyItalic" type="buttonTwoState" img="italic.gif" imgdis="italic_dis.gif" title="Italic Text"/>'+
 '<item id="applyUnderscore" type="buttonTwoState" img="underline.gif" imgdis="underline_dis.gif" title="Underscore Text"/>'+
 '<item id="applyStrikethrough" type="buttonTwoState" img="strike.gif" imgdis="strike_dis.gif" title="Strikethrough Text"/>'+
 '<item id="separ02" type="separator"/>'+
 
 '<item id="alignLeft" type="buttonTwoState" img="align_left.gif" imgdis="align_left_dis.gif" title="Left Alignment"/>'+
 '<item id="alignCenter" type="buttonTwoState" img="align_center.gif" imgdis="align_center_dis.gif" title="Center Alignment"/>'+
 '<item id="alignRight" type="buttonTwoState" img="align_right.gif" imgdis="align_right_dis.gif" title="Right Alignment"/>'+
 '<item id="alignJustify" type="buttonTwoState" img="align_justify.gif" title="Justified Alignment"/>'+
 '<item id="separ03" type="separator"/>'+
 
 '<item id="applySub" type="buttonTwoState" img="script_sub.gif" imgdis="script_sub.gif" title="Subscript"/>'+
 '<item id="applySuper" type="buttonTwoState" img="script_super.gif" imgdis="script_super_dis.gif" title="Superscript"/>'+
 '<item id="separ04" type="separator"/>'+
 
 '<item id="createNumList" type="button" img="list_number.gif" imgdis="list_number_dis.gif" title="Number List"/>'+
 '<item id="createBulList" type="button" img="list_bullet.gif" imgdis="list_bullet_dis.gif" title="Bullet List"/>'+
 '<item id="separ05" type="separator"/>'+
 
 '<item id="increaseIndent" type="button" img="indent_inc.gif" imgdis="indent_inc_dis.gif" title="Increase Indent"/>'+
 '<item id="decreaseIndent" type="button" img="indent_dec.gif" imgdis="indent_dec_dis.gif" title="Decrease Indent"/>'+
 '<item id="separ06" type="separator"/>'+
 '<item id="clearFormatting" type="button" img="clear.gif" title="Clear Formatting"/>'+
 '</toolbar>';this.tb.loadXMLString(this.tbXML);this._checkAlign = function(alignSelected) {this.tb.setItemState("alignCenter", false);this.tb.setItemState("alignRight", false);this.tb.setItemState("alignJustify", false);this.tb.setItemState("alignLeft", false);if (alignSelected)this.tb.setItemState(alignSelected, true);};this._checkH = function(h) {this.tb.setItemState("applyH1", false);this.tb.setItemState("applyH2", false);this.tb.setItemState("applyH3", false);this.tb.setItemState("applyH4", false);if (h)this.tb.setItemState(h, true);};this._doOnFocusChanged = function(state) {if(!state.h1&&!state.h2&&!state.h3&&!state.h4){var bold = (String(state.fontWeight).search(/bold/i) != -1) || (Number(state.fontWeight) >= 700);this.tb.setItemState("applyBold", bold);}else this.tb.setItemState("applyBold", false);var alignId = "alignLeft";if (String(state.textAlign).search(/center/) != -1) {alignId = "alignCenter";};if (String(state.textAlign).search(/right/) != -1) {alignId = "alignRight";};if (String(state.textAlign).search(/justify/) != -1) {alignId = "alignJustify";};this.tb.setItemState(alignId, true);this._checkAlign(alignId);this.tb.setItemState("applyH1", state.h1);this.tb.setItemState("applyH2", state.h2);this.tb.setItemState("applyH3", state.h3);this.tb.setItemState("applyH4", state.h4);if (window._KHTMLrv){state.sub = (state.vAlign == "sub");state.sup = (state.vAlign == "super");};this.tb.setItemState("applyItalic", (state.fontStyle == "italic"));this.tb.setItemState("applyStrikethrough", state.del);this.tb.setItemState("applySub", state.sub);this.tb.setItemState("applySuper", state.sup);this.tb.setItemState("applyUnderscore", state.u);};this._doOnToolbarClick = function(id) {var action = String(id).split(":");if (this[action[0]] != null){if (typeof(this[action[0]])== "function") {this[action[0]](action[1]);}}};this._doOnStateChange = function(itemId, state) {this[itemId]();switch (itemId) {case "alignLeft":
 case "alignCenter":
 case "alignRight":
 case "alignJustify":
 this._checkAlign(itemId);break;case "applyH1":
 case "applyH2":
 case "applyH3":
 case "applyH4":
 this._checkH(itemId);break;}};this._doOnBeforeStateChange = function(itemId, state) {if ((itemId == "alignLeft" || itemId == "alignCenter" || itemId == "alignRight" || itemId == "alignJustify")&& state == true) {return false;};return true;};var that = this;this.tb.attachEvent("onClick", function(id){that._doOnToolbarClick(id);});this.tb.attachEvent("onStateChange", function(id,st){that._doOnStateChange(id,st);});this.tb.attachEvent("onBeforeStateChange", function(id,st){return that._doOnBeforeStateChange(id,st);});this.applyBold = function(){this.runCommand("Bold");};this.applyItalic = function(){this.runCommand("Italic");};this.applyUnderscore = function(){this.runCommand("Underline");};this.applyStrikethrough = function(){this.runCommand("StrikeThrough");};this.alignLeft = function(){this.runCommand("JustifyLeft");};this.alignRight = function(){this.runCommand("JustifyRight");};this.alignCenter = function(){this.runCommand("JustifyCenter");};this.alignJustify = function(){this.runCommand("JustifyFull");};this.applySub = function(){this.runCommand("Subscript");};this.applySuper = function(){this.runCommand("Superscript");};this.applyH1 = function(){this.runCommand("FormatBlock","<H1>");};this.applyH2 = function(){this.runCommand("FormatBlock","<H2>");};this.applyH3 = function(){this.runCommand("FormatBlock","<H3>");};this.applyH4 = function(){this.runCommand("FormatBlock","<H4>");};this.createNumList = function(){this.runCommand("InsertOrderedList");};this.createBulList = function(){this.runCommand("InsertUnorderedList");};this.increaseIndent = function(){this.runCommand("Indent");};this.decreaseIndent = function(){this.runCommand("Outdent");};this.clearFormatting = function() {this.runCommand("RemoveFormat");this.tb.setItemState("applyBold", false);this.tb.setItemState("applyItalic", false);this.tb.setItemState("applyStrikethrough", false);this.tb.setItemState("applySub", false);this.tb.setItemState("applySuper", false);this.tb.setItemState("applyUnderscore", false);};this.getParentByTag = function(node, tag_name){tag_name = tag_name.toLowerCase()
 var p = node
 do{if(tag_name == '' || p.nodeName.toLowerCase()== tag_name) return p
 }while(p = p.parentNode)return node
 };this.isStyleProperty = function(node, tag_name, name, value){tag_name = tag_name.toLowerCase();var n = node;do{if((n.nodeName.toLowerCase()== tag_name)&&(n.style[name]==value)) return true
 }while(n = n.parentNode)return false
 };this.setStyleProperty = function(el,prop){this.style[prop] = false;var n = this.getParentByTag(el,prop);if(n&&(n.tagName.toLowerCase()==prop)) this.style[prop] = true;if(prop == "del")if(this.getParentByTag(el,"strike")&&(this.getParentByTag(el,"strike").tagName.toLowerCase()=="strike")) this.style.del = true;}};function dhtmlXForm(parentObj, data) {this.loadedCollection = {};this.inputs = [];this.commands = [];this.validators = [];this.formId;this.i18n = {};this.i18n.confirm_delete = 'Are you sure that you want to delete information from this form?';this.xmlLoader = new dtmlXMLLoaderObject(this.doLoadDetails, this, true, this.no_cashe);this.commandsCollection = {load: 'load',
 save: 'save',
 remove: 'remove',
 reset: 'reset',
 validate: 'validate'
 };var that = this;this.skin = "dhx_skyblue";this.setSkin = function(skin) {this.skin = skin;this.cont.className = "dhxlist_obj_"+this.skin;this.cont.style.fontSize = (this.skin == "dhx_web"?"12px":"11px");};this._type = "checkbox";this._rGroup = "default";this.cont = (typeof(parentObj)=="object"?parentObj:document.getElementById(parentObj));if (!parentObj._isNestedForm){this._parentForm = true;this.cont.style.fontSize = (this.skin == "dhx_web"?"12px":"11px");this.cont.className = "dhxlist_obj_"+this.skin;this.setFontSize = function(fs) {this.cont.style.fontSize = fs;}};this.base = document.createElement("DIV");this.base.className = "dhxlist_base";this.cont.appendChild(this.base);this.setSizes = function() {this.base.style.height = this.cont.offsetHeight+"px";this.base.style.overflow = "auto";};this._parseInputs();this.t = document.createElement("TABLE");this.t.className = "dhxlist_items_set";this.t.border = 0;this.t.cellSpacing = 1;this.t.cellPadding = 0;this.tb = document.createElement("TBODY");this.t.appendChild(this.tb);this.base.appendChild(this.t);var tr = document.createElement("TR");tr._type = "dhxlist_hdr";tr.className = "dhxlist_tbl_head";this.tb.appendChild(tr);var th1 = document.createElement("TH");var th2 = document.createElement("TH");th1.className = "dhxlist_img_cell dhxlist_tbl_head";th2.className = "dhxlist_tbl_head";tr.appendChild(th1);tr.appendChild(th2);tr.onselectstart = function(e){e=e||event;e.returnValue=false;return false;};th1.onselectstart = function(e){e=e||event;e.returnValue=false;return false;};th2.onselectstart = function(e){e=e||event;e.returnValue=false;return false;};this._genStr = function(w) {var s = "";var z = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for (var q=0;q<w;q++)s += z.charAt(Math.round(Math.random() * (z.length-1)));return s;};this.idPrefix = "dhxList_"+this._genStr(12)+"_";this.objPull = {};this.itemPull = {};this._ic = 0;this._addItem = function(type, id, data, sId, lp) {if (!type)type = this._type;var tr = document.createElement("TR");tr._idd = id;if (type == "list"){if (sId != null)tr._sId = sId;if (this.getItemType(lp)=="fieldset") {tr._fs = true;data._fsText = this.getItemText(lp);data._fsWidth = this.getItemWidth(lp);this.itemPull[this.idPrefix+id]._fs = tr;};this.tb.appendChild(tr);var listData = this.items[type].render(tr, data);this.tb.appendChild(tr);if (!this.itemPull[this.idPrefix+id]._listObj)this.itemPull[this.idPrefix+id]._listObj = [];if (!this.itemPull[this.idPrefix+id]._list)this.itemPull[this.idPrefix+id]._list = [];(this.itemPull[this.idPrefix+id]._listObj).push(listData[0]);(this.itemPull[this.idPrefix+id]._list).push(listData[1]);listData[1].checkEvent = function(evName) {return that.checkEvent(evName);};listData[1].callEvent = function(evName, evData) {return that.callEvent(evName, evData);};return listData[1];}else {this.tb.appendChild(tr);if (type != "input")tr.onselectstart = function(e){e=e||event;e.returnValue=false;return false;};if (type == "label" && this._ic == 0)data._isTopmost = true;this.objPull[this.idPrefix+id] = this.items[type].render(tr, data);this.itemPull[this.idPrefix+id] = tr;tr.checkEvent = function(evName) {return that.checkEvent(evName);};tr.callEvent = function(evName, evData) {return that.callEvent(evName, evData);};tr._autoCheck = function() {that._autoCheck();}};this._ic++;};this._initObj = function(data) {for (var q=0;q<data.length;q++){var type = (data[q].type||"checkbox");var id = data[q].name||this._genStr(12);if (this.objPull[this.idPrefix+id] != null || type=="radio")id = this._genStr(12);var obj = data[q];obj.label = obj.label||"";obj.value = obj.value||"";obj.checked = !!obj.checked;obj.disabled = !!obj.disabled;obj.name = obj.name||this._genStr(12);obj.options = obj.options||[];obj.rows = obj.rows||"none";obj.uid = this._genStr(12);this._addItem(type, id, obj);if (this._parentEnabled === false)this._disableItem(id);for (var w=0;w<obj.options.length;w++){if (obj.options[w].list != null){if (!obj.options[w].value)obj.options[w].value = this._genStr();var subList = this._addItem("list", id, obj.options[w].list, obj.options[w].value);subList._subSelect = true;subList._subSelectId = obj.options[w].value;};this._autoCheck();};if (data[q].list != null){if (!data[q].listParent)data[q].listParent = data[q].name;var subList = this._addItem("list", id, data[q].list, null, data[q].listParent);this._autoCheck();}};this._parseInputs();};this._attrs = ["type", "name", "value", "label", "check", "checked", "disabled", "text", "rows", "select", "selected", "validate", "bind", "command", "width"];this._xmlToObject = function(xmlData, itemTag) {var obj = [];for (var q=0;q<xmlData.childNodes.length;q++){if (String(xmlData.childNodes[q].tagName||"").toLowerCase() == itemTag) {var p = {};var t = xmlData.childNodes[q];for (var w=0;w<this._attrs.length;w++)if (t.getAttribute(this._attrs[w])!= null) p[this._attrs[w]] = t.getAttribute(this._attrs[w]);if (!p.text && itemTag == "option")try {p.text = t.firstChild.nodeValue;}catch(e){};if (itemTag != "option" && t.childNodes.length > 0)p[(p.type=="select"?"options":"list")] = this._xmlToObject(t, (p.type=="select"?"option":itemTag));if (itemTag == "option" && xmlData.childNodes[q].getElementsByTagName("item").length > 0) p["list"] = this._xmlToObject(t, "item");if (p.list)p.listParent = p.name;obj[obj.length] = p;}};return obj;};this._xmlParser = function() {that._initObj(that._xmlToObject(this.getXMLTopNode("items"), "item"));that.callEvent("onXLE",[]);if (typeof(that._doOnLoad)== "function") that._doOnLoad();};this._doOnLoad = null;this._xmlLoader = new dtmlXMLLoaderObject(this._xmlParser, window);this.loadStruct = function(xmlFile, onLoadFunction) {this._doOnLoad = (onLoadFunction||null);this.callEvent("onXLS", []);this._xmlLoader.loadXML(xmlFile);};this.loadStructString = function(xmlString, onLoadFunction) {this._doOnLoad = (onLoadFunction||null);this._xmlLoader.loadXMLString(xmlString);};this._autoCheck = function(enabled) {for (var a in this.itemPull){var isEnabled = (typeof(enabled)=="undefined"?true:enabled)&&this.itemPull[a]._checked;if (this.itemPull[a]._list){for (var q=0;q<this.itemPull[a]._list.length;q++){var list = this.itemPull[a]._list[q];list._parentEnabled = isEnabled&&(typeof(this._parentEnabled)=="undefined"?true:this._parentEnabled);for (var b in list.itemPull){var idd = list.itemPull[b]._idd;if (list._subSelect === true){var sVal = this.getItemValue(this.itemPull[a]._idd);isEnabled = (list._subSelectId == sVal && this.itemPull[a]._enabled);for (var w=0;w<this.tb.childNodes.length;w++){var p = this.tb.childNodes[w];if (p._sId != null)p.style.display = (sVal==p._sId?"":"none");}};if (isEnabled)list._enableItem(idd);else list._disableItem(idd);if (list.itemPull[b]._list)list._autoCheck(isEnabled);}}}}};this.doWithItem = function(id, method, a, b, c, d) {if (typeof(id)== "object") {var group = id[0];var value = id[1];var item = null;var res = null;for (var k in this.itemPull){if ((this.itemPull[k]._value == value || value === null)&& this.itemPull[k]._group == group) return this.objPull[k][method](this.itemPull[k], a, b, c, d);if (this.itemPull[k]._list != null && !res){for (var q=0;q<this.itemPull[k]._list.length;q++){res = this.itemPull[k]._list[q].doWithItem(id, method, a, b, c);}}};return res;}else {if (!this.itemPull[this.idPrefix+id]){var res = null;for (var k in this.itemPull){if (this.itemPull[k]._list && !res){for (var q=0;q<this.itemPull[k]._list.length;q++){res = this.itemPull[k]._list[q].doWithItem(id, method, a, b, c, d);}}};return res;}else {return this.objPull[this.idPrefix+id][method](this.itemPull[this.idPrefix+id], a, b, c, d);}}};this.removeItem = function(id, value) {if (value != null)id = this.doWithItem([id, value], "destruct");else this.doWithItem(id, "destruct");this._clearItemData(id);};this._clearItemData = function(id) {if (this.itemPull[this.idPrefix+id]){id = this.idPrefix+id;try {this.objPull[id] = null;this.itemPull[id] = null;delete this.objPull[id];delete this.itemPull[id];}catch(e) {}}else {for (var k in this.itemPull){if (this.itemPull[k]._list){for (var q=0;q<this.itemPull[k]._list.length;q++)this.itemPull[k]._list[q]._clearItemData(id);}}}};this.isItem = function(id, value) {if (value != null)id = [id, value];return this.doWithItem(id, "isExist");};this.getItemType = function(id, value) {if (value != null)id = [id, value];return this.doWithItem(id, "getType");};this.forEachItem = function(handler) {for (var a in this.objPull){handler(String(a).replace(this.idPrefix,""));if (this.itemPull[a]._list){for (var q=0;q<this.itemPull[a]._list.length;q++)this.itemPull[a]._list[q].forEachItem(handler);}}};this.setItemLabel = function(id, value, text) {if (text != null)id = [id, value];else text = value;this.doWithItem(id, "setText", text);};this.getItemText = function(id, value) {if (value != null)id = [id, value];return this.doWithItem(id, "getText");};this._enableItem = function(id) {this.doWithItem(id, "enable");};this._disableItem = function(id) {this.doWithItem(id, "disable");};this._isItemEnabled = function(id) {return this.doWithItem(id, "isEnabled");};this.checkItem = function(id, value) {if (value != null)id = [id, value];this.doWithItem(id, "check");this._autoCheck();};this.uncheckItem = function(id, value) {if (value != null)id = [id, value];this.doWithItem(id, "unCheck");this._autoCheck();};this.isItemChecked = function(id, value) {if (value != null)id = [id, value];return this.doWithItem(id, "isChecked");};this.getCheckedValue = function(id) {return this.doWithItem([id, null], "getChecked");};this.setItemValue = function(id, value) {return this.doWithItem(id, "setValue", value);};this.getItemValue = function(id) {return this.doWithItem(id, "getValue");};this.showItem = function(id) {this.doWithItem(id, "show");};this.hideItem = function(id) {this.doWithItem(id, "hide");};this.isItemHidden = function(id) {return this.doWithItem(id, "isHidden");};this.getOptions = function(id) {return this.doWithItem(id, "getOptions");};this.setItemWidth = function(id, width) {this.doWithItem(id, "setWidth", width);};this.getItemWidth = function(id) {return this.doWithItem(id, "getWidth");};this.setItemHeight = function(id, height) {this.doWithItem(id, "setHeight", height);};this.clear = function() {var usedRAs = {};this.formId = (new Date()).valueOf();this.resetDataProcessor("inserted");for (var a in this.itemPull){var t = this.itemPull[a]._idd;if (this.itemPull[a]._type == "ch")this.uncheckItem(t);if (this.itemPull[a]._type == "ta")this.setItemValue(t, "");if (this.itemPull[a]._type == "se"){var opts = this.getOptions(t);if (opts.length > 0)opts[0].selected = true;};if (this.itemPull[a]._type == "ra"){var g = this.itemPull[a]._group;if (!usedRAs[g]){this.checkItem(g, this.doWithItem(t, "_getFirstValue"));usedRAs[g] = true;}};if (this.itemPull[a]._list)for (var q=0;q<this.itemPull[a]._list.length;q++)this.itemPull[a]._list[q].clear();};usedRAs = null;if (this._parentForm)this._autoCheck();};this.unload = function() {for (var a in this.objPull)this.removeItem(String(a).replace(this.idPrefix,""));this._attrs = null;this._xmlLoader.destructor();this._xmlLoader = null;this._xmlParser = null;this._xmlToObject = null;this.loadXML = null;this.loadXMLString = null;this.items = null;this.objPull = null;this.itemPull = null;this._addItem = null;this._genStr = null;this._initObj = null;this._autoCheck = null;this._clearItemData = null;this._enableItem = null;this._disableItem = null;this._isItemEnabled = null;this.forEachItem = null;this.isItem = null;this.clear = null;this.doWithItem = null;this.getItemType = null;this.removeItem = null;this.unload = null;this.attachEvent = null;this.callEvent = null;this.checkEvent = null;this.detachEvent = null;this.eventCatcher = null;this.setItemPosition = null;this.getItemPosition = null;this._setPosition = null;this._getPosition = null;this.setItemLabel = null;this.getItemText = null;this.setItemValue = null;this.getItemValue = null;this.showItem = null;this.hideItem = null;this.isItemHidden = null;this.checkItem = null;this.uncheckItem = null;this.isItemChecked = null;this.getOptions = null;this.xmlLoader.destructor();this.xmlLoader = null;this._ic = null;this._add_css_ = null;this._createBlock = null;this._createHash = null;this._createList = null;this._createQuery = null;this._del_css_ = null;this._getElementValue = null;this._is_css_ = null;this._loadOptions = null;this._loadToForm = null;this._parseInputs = null;this._parseXML = null;this._processObj = null;this._setDefaultValues = null;this._setElementValue = null;this._ulToObject = null;this.commandsCollection = null;this.loadedCollection = null;this.i18n = null;this.inputs = null;this.bindCommand = null;this.bindField = null;this.bindValidator = null;this.load = null;this.loadStruct = null;this.loadStructString = null;this.remove = null;this.reset = null;this.save = null;this.setFontSize = null;this.setItemHeight = null;this.setItemWidth = null;this.setSkin = null;this.validate = null;this.commands = null;this.validators = null;var tr = this.tb.childNodes[0];tr.childNodes[0].onselectstart = null;tr.childNodes[1].onselectstart = null;while (tr.childNodes.length > 0)tr.removeChild(tr.childNodes[0]);tr.onselectstart = null;tr.parentNode.removeChild(tr);tr = null;this.tb.parentNode.removeChild(this.tb);this.tb = null;this.t.parentNode.removeChild(this.t);this.t = null;this._rGroup = null;this._type = null;this.skin = null;this.idPrefix = null;while (this.base.childNodes.length > 0)this.base.removeChild(this.base.childNodes[0]);if (this.base.parentNode)this.base.parentNode.removeChild(this.base);this.base = null;this.cont.className = "";this.cont = null;};for (var a in this.items){this.items[a].t = a;if (!this.items[a].show){this.items[a].show = function(item) {item.style.display = "";}};if (!this.items[a].hide){this.items[a].hide = function(item) {item.style.display = "none";}};if (!this.items[a].isHidden){this.items[a].isHidden = function(item) {return (item.style.display == "none");}};this.items[a].getType = function() {return this.t;};this.items[a].isExist = function() {return true;}};dhtmlxEventable(this);this.attachEvent("_onButtonClick", function(name, cmd){var i = {"save":true, "validate":true, "reset":true};if (i[cmd])this[cmd]();else this.callEvent("onButtonClick", [name, cmd]);});if (data != null && typeof data == "object"){this._initObj(data);}};dhtmlXForm.prototype = {load: function(url, callback){var that = this;var params = '';var dirty = false;for (var i in this.inputs)if (this._getElementValue(this.inputs[i])!= this.inputs[i].defaultValue)
 dirty = true;if (dirty && !this.callEvent("onDirty", [that.formId]))
 return false;this.callEvent("onXLS", [this.formId]);this.xmlLoader.onloadAction = function(that, b, c, d, xml){that._parseXML(xml);that.callEvent("onXLE", [that.formId]);that._loadToForm();if (callback)callback(that.formId, xml);};var id = url.match(/(\?|\&)id\=([a-z0-9_]*)/i);if (id && id[0])this.formId = id[0].split("=")[1];this.xmlLoader.loadXML(url);},
 _parseXML: function(xml){var root = xml.getXMLTopNode("data");var inputs = root.childNodes;if (inputs.length == 0){this.formId = (new Date()).valueOf();this.resetDataProcessor("inserted");return false;};this.resetDataProcessor("updated");for (var i = 0;i < inputs.length;i++){if (inputs[i].nodeType == 1)this.loadedCollection[inputs[i].nodeName] = inputs[i].childNodes[0].nodeValue;};return true;},
 _parseInputs: function(){var that = this;var els = this.cont.getElementsByTagName("*");var bind;var command;var validate;var connector;for (var i = 0;i < els.length;i++){bind = els[i].getAttribute("bind");if (bind !== null){var obj = this._processObj(els[i]);obj.defaultValue = this._getElementValue(obj);this.inputs[bind] = obj;};command = els[i].getAttribute("command");if (!els[i]._dhx_bind){this.bindCommand(els[i], command);els[i]._dhx_bind=true;};validate = els[i].getAttribute("validate");this.bindValidator(els[i], validate);connector = els[i].getAttribute("connector");if (connector !== null){this._loadOptions(connector, els[i]);}}},
 _loadOptions: function(connector, el){var that = this;dhtmlxAjax.get(connector, function(xml){that._createList(el, xml);that = null;});},
 _createList: function(el, xml){var root = xml.getXMLTopNode("data");var inputs = root.childNodes;var bind = el.getAttribute("bind");var text = '';for (var i = 0;i < inputs.length;i++){var value = inputs[i].getAttribute("value");var label = inputs[i].getAttribute("label");switch (el.tagName.toLowerCase()){case 'select':
 el.options[el.options.length] = new Option(label, value);break;case 'input':
 var type = el.getAttribute("type");if (type == 'radio'){var id = "id_" + Math.round(Math.random() * 2000);if (value){var checked = 'checked';}else{var checked = '';};var option = document.createElement("DIV");option.innerHTML = '<input id="' + id + '" type="radio" value="' + value + '" name="' + el.name
 + '" bind="' + el.getAttribute('bind') + '" ' + checked + ' /><label for="' + id + '">'
 + value + '</label>';el.parentNode.appendChild(option);option.className = "dhx_autocreated_radio";if (bind){this.inputs[bind].raArray.push(document.getElementById(id));}};break;}};if ((bind !== null)&& (this.inputs[bind] !== undefined)){this._setElementValue(this.inputs[bind], this.loadedCollection[bind]);}},
 _loadToForm: function(){if (this.callEvent("onBeforeDataLoad",
 [
 this.formId,
 this.loadedCollection
 ])== false){return false;};for (var i in this.loadedCollection)if (this.inputs[i] !== undefined)this._setElementValue(this.inputs[i], this.loadedCollection[i]);for (var a in this.itemPull){var el = this.itemPull[a];if ((el._group || el._type == "ch" )&& el._bind){var val = this.loadedCollection[el._bind];if (val)this.checkItem(el._group, val );else
 this.uncheckItem(el._group, el._value );}};this._setDefaultValues();},
 _processObj: function(obj){var objectArray = [];if ((obj.tagName == 'INPUT')&& (obj.getAttribute("type").toLowerCase() == 'radio')){var radios = document.getElementsByName(obj.name);var raArray = [];for (var i = 0;i < radios.length;i++){raArray[i] = radios[i];};objectArray['raArray'] = raArray;};objectArray['object'] = obj;return objectArray;},
 bindField: function(id, name){if (typeof (id)!= 'object'){id = document.getElementById(id);};if ((id !== null)&& (this.inputs[name] === undefined)){var obj = this._processObj(id);obj.defaultValue = this._getElementValue(obj);this.inputs[name] = obj;return true;}else{return false;}},
 bindCommand: function(id, command){var that = this;if (typeof (id)!= 'object'){id = document.getElementById(id);};if ((id !== null)&& (this.commandsCollection[command] !== undefined)){dhtmlxEvent(id, "click", function(){that[command]();});return true;}else{return false;}},
 bindValidator: function(id, validator){var valid = [];if (typeof (id)!= 'object'){var el = document.getElementById(id);}else{var el = id;};if ((el !== null)&& (validator !== null)){var obj = this._processObj(el);valid['id'] = id;}else{if (this.inputs[id] !== undefined){var obj = this.inputs[id];valid['id'] = id;}else{return false;}};valid['obj'] = obj;if (window.dhtmlxValidation && dhtmlxValidation["is"+validator] !== undefined){valid['type'] = 'built_in';}else{if (window[validator] !== undefined){valid['type'] = 'custom';}else{valid['type'] = 'regexp';}};valid['validator'] = validator;valid['class'] = '';this.validators.push(valid);return true;},
 _createQuery: function(pref){pref = pref || "";var query = [];var els = this.cont.getElementsByTagName("*");for (var i = 0;i < els.length;i++){var name = els[i].getAttribute("bind")||els[i].getAttribute("name");if (name)query.push(pref+name+"="+encodeURIComponent(this._getElementValue({object:els[i]})));};for (var a in this.itemPull){var el = this.itemPull[a];if ((el._type == "ch" || el._type == "ra")&& el._bind){if (this.isItemChecked((el._group || el._name), el._value))
 query.push(pref+el._bind+"="+(encodeURIComponent(el._value)||"true"));}};if (this._userdata && this._userdata[this.formId])for (var key in this._userdata[this.formId])query.push(pref+key+"="+encodeURIComponent(this._userdata[this.formId][key]));return query.join("&");},
 _createBlock: function(){var block = document.createElement('div');block.className = "dhx_form_cover";document.body.appendChild(block);this.block = block;},
 _createHash: function(){var hash = {};for (var i in this.inputs){hash[i] = this._getElementValue(this.inputs[i]);};return hash;},
 save:function(){if (this.dp)this.dp.sendData();},
 send:function(url, mode, callback){if (!this.validate()) return;var that = this;this.savingFlag = true;if (!this.block)this._createBlock();this.block.style.display = 'block';var query = this._createQuery();if (!this.callEvent("onBeforeSave",[this.formId,this._createHash()])){this.block.style.display = 'none';return false;};var cback = function(){that.savingFlag = false;that.block.style.display = 'none';if (callback)callback(xml);};if (mode=="post")dhtmlxAjax.post(url,query,cback);else
 dhtmlxAjax.get(url+((url.indexOf("?")==-1)?"?":"&")+query,cback);}, 
 _setDefaultValues: function(){for (var i in this.inputs){this.inputs[i].defaultValue = this._getElementValue(this.inputs[i]);}},
 reset: function(all){if (this.callEvent("onBeforeReset",
 [
 this.formId,
 this._createHash()]) == false){return false;};if (all == true){for (var i in this.inputs){this._setElementValue(this.inputs[i], this.inputs[i].defaultValue);}}else{this._loadToForm();};this.callEvent("onAfterReset", [this.formId]);},
 _is_css_: function(node,css){return (node.className.indexOf(css)!=-1)
 },
 _add_css_: function(node,css){node.className+=" "+css;},
 _del_css_: function(node,css){node.className=node.className.replace(new RegExp(css,"g"),"");},
 validate: function(){var invalid = [];var flag = true;if (this.callEvent("onBeforeValidate", [this.formId])== false){return false;};var mark = (new Date()).valueOf();for (var i = 0;i < this.validators.length;i++){var func = this.validators[i]['validator'];var value = this._getElementValue(this.validators[i]['obj']);var res = true;switch (this.validators[i]['type']){case 'built_in':
 res = dhtmlxValidation["is"+func](value);break;case 'custom':
 res = window[func](value);break;case 'regexp':
 patt = new RegExp(this.validators[i]['validator']);res = patt.test(value);};var check_field = this.validators[i]['obj']['object'];if (check_field._invalid != mark)check_field._invalid=false;if (res !== true){this._add_css_(check_field,'dhtmlx_validation_error');check_field._invalid = mark;flag = false;this.callEvent("onValidateError",[
 check_field,
 value,
 res
 ]);}else{if (this._is_css_(check_field,'dhtmlx_validation_error')&& (!check_field._invalid)){this._del_css_(check_field,"dhtmlx_validation_error");this.callEvent("onValidateSuccess",[
 check_field,
 value,
 res
 ]);}}};this.callEvent("onAfterValidate", [this.formId,flag]);return flag;},
 _getElementValue: function(elem){var value = '';switch (elem['object'].tagName){case 'INPUT':
 case 'BUTTON':
 var elType = elem['object'].getAttribute('type');switch (elType.toLowerCase()){case undefined:
 case 'button':
 case 'hidden':
 case 'password':
 case 'reset':
 case 'submit':
 case 'text':
 value = elem['object'].value;break;case 'image':
 value = elem['object'].src;break;case 'checkbox':
 if (elem['object'].checked == true){value = 1;}else{value = 0;};case 'radio':
 for (var i in elem['raArray']){if (elem['raArray'][i].checked == true){value = elem['raArray'][i].value;}};break;case 'file': break;};break;case 'TEXTAREA':
 value = elem['object'].value;break;case 'SELECT':
 value = (elem['object'].options[elem['object'].selectedIndex]||{}).value;break;default:
 value = elem['object'].innerHTML;break;};return value;},
 _setElementValue: function(elem, value){switch (elem['object'].tagName){case 'INPUT':
 case 'BUTTON':
 var elType = elem['object'].getAttribute('type');switch (elType.toLowerCase()){case undefined:
 case 'button':
 case 'hidden':
 case 'password':
 case 'reset':
 case 'submit':
 case 'text':
 elem['object'].value = value;break;case 'img':
 case 'image':
 elem['object'].src = value;break;case 'checkbox':
 if (value == '1'){elem['object'].checked = true;}else{elem['object'].checked = false;};case 'radio':
 for (var i in elem['raArray']){if (elem['raArray'][i].value == value){elem['raArray'][i].checked = true;}};break;case 'file': break;};break;case 'TEXTAREA':
 elem['object'].value = value;break;case 'SELECT':
 for (var i = 0;i < elem['object'].options.length;i++){if (elem['object'].options[i].value == value){elem['object'].options[i].selected = true;}};break;default:
 elem['object'].innerHTML = value;break;}}};dhtmlXForm.prototype.items = {};dhtmlXForm.prototype.items.checkbox = {render: function(item, data) {var td1 = document.createElement("TD");var td2 = document.createElement("TD");td1.className = "dhxlist_img_cell";td2.className = "dhxlist_txt_cell";td1.onselectstart = function(e){e=e||event;e.returnValue=false;return false;};td2.onselectstart = function(e){e=e||event;e.returnValue=false;return false;};item._type = "ch";item._enabled = true;item._checked = false;item._value = String(data.value);item._bind = data.bind;var p = document.createElement("DIV");p.className = "dhxlist_img chbx0";p.innerHTML = "&nbsp;";td1.appendChild(p);var t = document.createElement("DIV");t.className = "dhxlist_txt";t.innerHTML = "<span class='nav_link' onkeypress='e=event||window.arguments[0];if(e.keyCode==32||e.charCode==32){e.cancelBubble=true;e.returnValue=false;_dhxForm_doClick(this,\"click\");return false;}' role='link' tabindex='0'>"+data.label+'</span>';td2.appendChild(t);var k = document.createElement("INPUT");k.type = "HIDDEN";k.value = String(data.value);item.appendChild(td1);item.appendChild(td2);item.appendChild(k);if (data.checked == true)this.check(item);if (data.disabled == true)this.disable(item);var that = this;item.onclick = function() {if (!this._enabled)return;var args = [this._idd, this._value, this._checked];if (this.checkEvent("onBeforeChange")) if (this.callEvent("onBeforeChange", args)!== true) return;that.setChecked(this, !this._checked);this._autoCheck();this.callEvent("onChange", args);};return this;},
 
 destruct: function(item) {var td1 = item.childNodes[0];var td2 = item.childNodes[1];td1.onselectstart = null;td2.onselectstart = null;while (td1.childNodes.length > 0)td1.removeChild(td1.childNodes[0]);while (td2.childNodes.length > 0)td2.removeChild(td2.childNodes[0]);while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);td1 = null;td2 = null;if (item._list){for (var q=0;q<item._list.length;q++){item._list[q].unload();var tb = item.parentNode;for (var w=0;w<tb.childNodes.length;w++)if (tb.childNodes[w]._type == "list" && tb.childNodes[w]._idd == item._idd)item._listObj[q].destruct(tb.childNodes[w]);item._listObj[q] = null;item._list[q] = null;}};item.onclick = null;item.onselectstart = null;item._autoCheck = null;item.callEvent = null;item.checkEvent = null;item.parentNode.removeChild(item);item = null;},
 
 doCheckValue: function(item) {if (item._checked && item._enabled){item.childNodes[2].setAttribute("name", String(item._idd));}else {item.childNodes[2].removeAttribute("name");}},
 
 setChecked: function(item, state) {item._checked = (state===true?true:false);item.childNodes[0].childNodes[0].className = "dhxlist_img "+(item._checked?"chbx1":"chbx0");item.childNodes[1].childNodes[0].className = "dhxlist_txt "+(item._checked?"checked":"");this.doCheckValue(item);},
 
 check: function(item) {this.setChecked(item, true);},
 
 unCheck: function(item) {this.setChecked(item, false);},
 
 isChecked: function(item) {return item._checked;},
 
 enable: function(item) {item.className = "";item._enabled = true;item.childNodes[1].childNodes[0].childNodes[0].tabIndex = null;item.childNodes[1].childNodes[0].childNodes[0].removeAttribute("disabled");this.doCheckValue(item);},
 
 disable: function(item) {item.className = "disabled";item._enabled = false;item.childNodes[1].childNodes[0].childNodes[0].tabIndex = -1;item.childNodes[1].childNodes[0].childNodes[0].setAttribute("disabled", "true");this.doCheckValue(item);},
 
 isEnabled: function(item) {return item._enabled;},
 
 setText: function(item, text) {item.childNodes[1].childNodes[0].childNodes[0].innerHTML = text;},
 
 getText: function(item) {return item.childNodes[1].childNodes[0].childNodes[0].innerHTML;}};dhtmlXForm.prototype.items.radio = {input: {},
 
 firstValue: {},
 
 render: function(item, data,uid) {var td1 = document.createElement("TD");var td2 = document.createElement("TD");td1.className = "dhxlist_img_cell";td2.className = "dhxlist_txt_cell";td1.onselectstart = function(e){e=e||event;e.returnValue=false;return false;};td2.onselectstart = function(e){e=e||event;e.returnValue=false;return false;};item._type = "ra";item._enabled = true;item._checked = false;item._group = data.name;item._value = String(data.value);item._uid = uid;item._bind = data.bind;var p = document.createElement("DIV");p.className = "dhxlist_img rdbt0";td1.appendChild(p);var t = document.createElement("DIV");t.className = "dhxlist_txt";t.innerHTML = "<span class='nav_link' onkeypress='e=event||window.arguments[0];if(e.keyCode==32||e.charCode==32){e.cancelBubble=true;e.returnValue=false;_dhxForm_doClick(this,\"click\");return false;}' role='link' tabindex='0'>"+data.label+'</span>';td2.appendChild(t);item.appendChild(td1);item.appendChild(td2);if (this.input[data.name] == null){var k = document.createElement("INPUT");k.type = "HIDDEN";k.name = data.name;k.firstValue = item._value;item.appendChild(k);this.input[data.name] = k;};if (!this.firstValue[data.name])this.firstValue[data.name] = String(data.value);if (data.checked == true)this.check(item);if (data.disabled == true)this.disable(item);var that = this;item.onclick = function() {if (!(item._enabled && !item._checked)) return;var args = [this._group, this._value, true];if (this.checkEvent("onBeforeChange")) if (this.callEvent("onBeforeChange", args)!== true) return;that.setChecked(this, true);this._autoCheck();this.callEvent("onChange", args);};return this;},
 
 destruct: function(item, value) {if (item.childNodes[item.childNodes.length-1] == this.input[item._group]){var tb = item.parentNode;var done = false;for (var q=0;q<tb.childNodes.length;q++){var it = tb.childNodes[q];if (it._idd != item._idd && it._group == item._group && it._type == "ra" && !done){it.appendChild(this.input[item._group]);done = true;};it = null;};if (done == false){this.input[item._group] = null;}};var id = item._idd;var td1 = item.childNodes[0];var td2 = item.childNodes[1];td1.onselectstart = null;td2.onselectstart = null;while (td1.childNodes.length > 0)td1.removeChild(td1.childNodes[0]);while (td2.childNodes.length > 0)td2.removeChild(td2.childNodes[0]);while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);td1 = null;td2 = null;if (item._list){for (var q=0;q<item._list.length;q++){item._list[q].unload();var tb = item.parentNode;for (var w=0;w<tb.childNodes.length;w++)if (tb.childNodes[w]._type == "list" && tb.childNodes[w]._idd == item._idd)item._listObj[q].destruct(tb.childNodes[w]);item._listObj[q] = null;item._list[q] = null;}};item.onclick = null;item.onselectstart = null;item._autoCheck = null;item.callEvent = null;item.checkEvent = null;item.parentNode.removeChild(item);item = null;return id;},
 
 doCheckValue: function(item) {var tb = item.parentNode;var value = null;for (var q=0;q<tb.childNodes.length;q++){var ra = tb.childNodes[q];if (ra._type == "ra" && ra._group == item._group && ra._checked && ra._enabled)value = ra._value;};if (value != null){this.input[item._group].setAttribute("name", String(item._group));this.input[item._group].value = value;}else {this.input[item._group].removeAttribute("name");}},
 
 setChecked: function(item, state) {state = (state===true?true:false);var tb = item.parentNode;var group = item._group;for (var q=0;q<tb.childNodes.length;q++){if (tb.childNodes[q]._group == group && tb.childNodes[q]._type == "ra"){var needCheck = false;var it = tb.childNodes[q];if (it._idd == item._idd){if (it._checked != state){it._checked = state;needCheck = true;}}else {if (it._checked){it._checked = false;needCheck = true;}};if (needCheck){it.childNodes[0].childNodes[0].className = "dhxlist_img "+(it._checked?"rdbt1":"rdbt0");it.childNodes[1].childNodes[0].className = "dhxlist_txt "+(it._checked?"checked":"");};it = null;}};this.doCheckValue(item);},
 
 getChecked: function(item) {return this.input[item._group].value;},
 
 _getFirstValue: function(item) {return this.firstValue[item._group];},
 
 check: function(item) {this.setChecked(item, true);},
 
 unCheck: function(item) {this.setChecked(item, false);},
 
 isChecked: function(item) {return item._checked;},
 
 enable: function(item) {item.className = "";item._enabled = true;item.childNodes[1].childNodes[0].childNodes[0].tabIndex = 0;item.childNodes[1].childNodes[0].childNodes[0].removeAttribute("disabled");this.doCheckValue(item);},
 
 disable: function(item) {item.className = "disabled";item._enabled = false;item.childNodes[1].childNodes[0].childNodes[0].tabIndex = -1;item.childNodes[1].childNodes[0].childNodes[0].setAttribute("disabled", "true");this.doCheckValue(item);},
 
 isEnabled: function(item) {return item._enabled;},
 
 setText: function(item, text) {item.childNodes[1].childNodes[0].childNodes[0].innerHTML = text;},
 
 getText: function(item) {return item.childNodes[1].childNodes[0].childNodes[0].innerHTML;}};dhtmlXForm.prototype.items.select = {render: function(item, data) {var td1 = document.createElement("TD");td1.colSpan = "2";td1.className = "dhxlist_txt_cell";td1.onselectstart = function(e){e=e||event;e.returnValue=false;return false;};item._type = "se";item._enabled = true;item._value = null;item._newValue = null;var j = document.createElement("DIV");j.className = "dhxlist_txt_label";j.innerHTML = data.label;td1.appendChild(j);if (data.label.length == 0)j.style.display = "none";var p = document.createElement("DIV");p.className = "dhxlist_cont";td1.appendChild(p);var t = document.createElement("SELECT");t.className = "dhxlist_txt_select";t.name = item._idd;p.appendChild(t);if (data.validate)t.setAttribute("validate",data.validate);if (data.bind)t.setAttribute("bind",data.bind);if (data.connector)t.setAttribute("connector",data.connector);if (data.width)t.style.width = parseInt(data.width)+"px";var that = this;t.onclick = function() {that.doOnChange(this);};t.onkeydown = function() {that.doOnChange(this);};t.onchange = function() {that.doOnChange(this);};var opts = data.options;for (var q=0;q<opts.length;q++){var opt = new Option(opts[q].text||opts[q].label, opts[q].value);t.options.add(opt);if (opts[q].selected == true || opts[q].selected == "true"){opt.selected = true;item._value = opts[q].value;}};item.appendChild(td1);return this;},
 
 destruct: function(item) {var sel = item.childNodes[0].childNodes[1].childNodes[0];sel.onclick = null;sel.onkeydown = null;sel.parentNode.removeChild(sel);sel = null;var td1 = item.childNodes[0];td1.onselectstart = null;while (td1.childNodes.length > 0)td1.removeChild(td1.childNodes[0]);while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);td1 = null;if (item._list){for (var q=0;q<item._list.length;q++){item._list[q].unload();var tb = item.parentNode;for (var w=0;w<tb.childNodes.length;w++)if (tb.childNodes[w]._type == "list" && tb.childNodes[w]._idd == item._idd)item._listObj[q].destruct(tb.childNodes[w]);item._listObj[q] = null;item._list[q] = null;}};item.onselectstart = null;item._autoCheck = null;item.callEvent = null;item.checkEvent = null;item.parentNode.removeChild(item);item = null;},
 
 doOnChange: function(sel) {var item = sel.parentNode.parentNode.parentNode;item._newValue = sel.options[sel.selectedIndex].value;if (item._newValue != item._value){if (item.checkEvent("onBeforeChange")) {if (item.callEvent("onBeforeChange", [item._idd, item._value, item._newValue])!== true) {for (var q=0;q<sel.options.length;q++)if (sel.options[q].value == item._value)sel.options[q].selected = true;return;}};item._value = item._newValue;item.callEvent("onChange", [item._idd, item._value]);};item._autoCheck();},
 
 setText: function(item, text) {if (!text)text = "";item.childNodes[0].childNodes[0].innerHTML = text;item.childNodes[0].childNodes[0].style.display = (text.length==0||text==null?"none":"");},
 
 getText: function(item) {return item.childNodes[0].childNodes[0].innerHTML;},
 
 enable: function(item) {item.className = "";item._enabled = true;item.childNodes[0].childNodes[1].childNodes[0].removeAttribute("disabled");},
 
 disable: function(item) {item.className = "disabled";item._enabled = false;item.childNodes[0].childNodes[1].childNodes[0].setAttribute("disabled", true);},
 
 getOptions: function(item) {return item.childNodes[0].childNodes[1].childNodes[0].options;},
 
 setValue: function(item, val) {var opts = this.getOptions(item);for (var q=0;q<opts.length;q++)if (opts[q].value == val)opts[q].selected = true;},
 
 getValue: function(item) {var k = -1;var opts = this.getOptions(item);for (var q=0;q<opts.length;q++)if (opts[q].selected)k = opts[q].value;return k;},
 
 setWidth: function(item, width) {item.childNodes[0].childNodes[1].childNodes[0].style.width = width+"px";}};dhtmlXForm.prototype.items.input = {render: function(item, data) {var td1 = document.createElement("TD");td1.colSpan = "2";td1.className = "dhxlist_txt_cell";item._type = "ta";item._enabled = true;var j = document.createElement("DIV");j.className = "dhxlist_txt_label";j.innerHTML = data.label;td1.appendChild(j);if (data.label.length == 0)j.style.display = "none";var p = document.createElement("DIV");p.className = "dhxlist_cont";td1.appendChild(p);if (isNaN(data.rows)) {var t = document.createElement("INPUT");t.type = "TEXT";}else {var t = document.createElement("TEXTAREA");t.style.height = 14*(data.rows||1)+"px"
 };if (data.validate)t.setAttribute("validate",data.validate);if (data.bind)t.setAttribute("bind",data.bind);if (data.width)t.style.width = parseInt(data.width)+"px";t.name = item._idd;t._idd = item._idd;t.className = "dhxlist_txt_textarea";p.appendChild(t);t.value = (data.value||"");item._value = t.value;item.appendChild(td1);t.onblur = function() {if (item.checkEvent("onBeforeChange")) if (item.callEvent("onBeforeChange",[this._idd, item._value, this.value])!== true) {this.value = item._value;return;};item._value = this.value;item.callEvent("onChange",[this._idd, this.value]);};return this;},
 
 destruct: function(item) {var inp = item.childNodes[0].childNodes[1].childNodes[0];inp.onblur = null;inp.parentNode.removeChild(inp);inp = null;var td1 = item.childNodes[0];td1.onselectstart = null;while (td1.childNodes.length > 0)td1.removeChild(td1.childNodes[0]);while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);td1 = null;if (item._list){for (var q=0;q<item._list.length;q++){item._list[q].unload();var tb = item.parentNode;for (var w=0;w<tb.childNodes.length;w++)if (tb.childNodes[w]._type == "list" && tb.childNodes[w]._idd == item._idd)item._listObj[q].destruct(tb.childNodes[w]);item._listObj[q] = null;item._list[q] = null;}};item.onselectstart = null;item._autoCheck = null;item.callEvent = null;item.checkEvent = null;item.parentNode.removeChild(item);item = null;},
 
 setText: function(item, text) {if (!text)text = "";item.childNodes[0].childNodes[0].innerHTML = text;item.childNodes[0].childNodes[0].style.display = (text.length==0||text==null?"none":"");},
 
 getText: function(item) {return item.childNodes[0].childNodes[0].innerHTML;},
 
 setValue: function(item, value) {item.childNodes[0].childNodes[1].childNodes[0].value = value;},
 
 getValue: function(item) {return item.childNodes[0].childNodes[1].childNodes[0].value;},
 
 enable: function(item) {item.className = "";item._enabled = true;item.childNodes[0].childNodes[1].childNodes[0].removeAttribute("disabled");},
 
 disable: function(item) {item.className = "disabled";item._enabled = false;item.childNodes[0].childNodes[1].childNodes[0].setAttribute("disabled", true);},
 
 setWidth: function(item, width) {item.childNodes[0].childNodes[1].childNodes[0].style.width = width+"px";}};dhtmlXForm.prototype.items.password = {render: function(item, data) {var td1 = document.createElement("TD");td1.colSpan = "2";td1.className = "dhxlist_txt_cell";item._type = "pw";item._enabled = true;var j = document.createElement("DIV");j.className = "dhxlist_txt_label";j.innerHTML = data.label;td1.appendChild(j);if (data.label.length == 0)j.style.display = "none";var p = document.createElement("DIV");p.className = "dhxlist_cont";td1.appendChild(p);var t = document.createElement("INPUT");t.type = "PASSWORD";if (data.validate)t.setAttribute("validate",data.validate);if (data.bind)t.setAttribute("bind",data.bind);if (data.width)t.style.width = parseInt(data.width)+"px";t.name = item._idd;t._idd = item._idd;t.className = "dhxlist_txt_textarea";p.appendChild(t);t.value = (data.value||"");item._value = t.value;item.appendChild(td1);t.onblur = function() {if (item.checkEvent("onBeforeChange")) if (item.callEvent("onBeforeChange",[this._idd, item._value, this.value])!== true) {this.value = item._value;return;};item._value = this.value;item.callEvent("onChange",[this._idd, this.value]);};return this;},
 
 destruct: function(item) {var inp = item.childNodes[0].childNodes[1].childNodes[0];inp.onblur = null;inp.parentNode.removeChild(inp);inp = null;var td1 = item.childNodes[0];td1.onselectstart = null;while (td1.childNodes.length > 0)td1.removeChild(td1.childNodes[0]);while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);td1 = null;if (item._list){for (var q=0;q<item._list.length;q++){item._list[q].unload();var tb = item.parentNode;for (var w=0;w<tb.childNodes.length;w++)if (tb.childNodes[w]._type == "list" && tb.childNodes[w]._idd == item._idd)item._listObj[q].destruct(tb.childNodes[w]);item._listObj[q] = null;item._list[q] = null;}};item.onselectstart = null;item._autoCheck = null;item.callEvent = null;item.checkEvent = null;item.parentNode.removeChild(item);item = null;},
 
 setText: function(item, text) {if (!text)text = "";item.childNodes[0].childNodes[0].innerHTML = text;item.childNodes[0].childNodes[0].style.display = (text.length==0||text==null?"none":"");},
 
 getText: function(item) {return item.childNodes[0].childNodes[0].innerHTML;},
 
 setValue: function(item, value) {item.childNodes[0].childNodes[1].childNodes[0].value = value;},
 
 getValue: function(item) {return item.childNodes[0].childNodes[1].childNodes[0].value;},
 
 enable: function(item) {item.className = "";item._enabled = true;item.childNodes[0].childNodes[1].childNodes[0].removeAttribute("disabled");},
 
 disable: function(item) {item.className = "disabled";item._enabled = false;item.childNodes[0].childNodes[1].childNodes[0].setAttribute("disabled", true);},
 
 setWidth: function(item, width) {item.childNodes[0].childNodes[1].childNodes[0].style.width = width+"px";}};dhtmlXForm.prototype.items.file = {render: function(item, data) {var td1 = document.createElement("TD");td1.colSpan = "2";td1.className = "dhxlist_txt_cell";item._type = "fl";item._enabled = true;var j = document.createElement("DIV");j.className = "dhxlist_txt_label";j.innerHTML = data.label;td1.appendChild(j);if (data.label.length == 0)j.style.display = "none";var p = document.createElement("DIV");p.className = "dhxlist_cont";td1.appendChild(p);var t = document.createElement("INPUT");t.type = "FILE";if (data.validate)t.setAttribute("validate",data.validate);if (data.bind)t.setAttribute("bind",data.bind);if (data.width)t.style.width = parseInt(data.width)+"px";t.name = item._idd;t._idd = item._idd;t.className = "dhxlist_txt_textarea";p.appendChild(t);t.value = (data.value||"");item._value = t.value;item.appendChild(td1);return this;},
 
 destruct: function(item) {var inp = item.childNodes[0].childNodes[1].childNodes[0];inp.onblur = null;inp.parentNode.removeChild(inp);inp = null;var td1 = item.childNodes[0];td1.onselectstart = null;while (td1.childNodes.length > 0)td1.removeChild(td1.childNodes[0]);while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);td1 = null;if (item._list){for (var q=0;q<item._list.length;q++){item._list[q].unload();var tb = item.parentNode;for (var w=0;w<tb.childNodes.length;w++)if (tb.childNodes[w]._type == "list" && tb.childNodes[w]._idd == item._idd)item._listObj[q].destruct(tb.childNodes[w]);item._listObj[q] = null;item._list[q] = null;}};item.onselectstart = null;item._autoCheck = null;item.callEvent = null;item.checkEvent = null;item.parentNode.removeChild(item);item = null;},
 
 setText: function(item, text) {if (!text)text = "";item.childNodes[0].childNodes[0].innerHTML = text;item.childNodes[0].childNodes[0].style.display = (text.length==0||text==null?"none":"");},
 
 getText: function(item) {return item.childNodes[0].childNodes[0].innerHTML;},
 
 enable: function(item) {item.className = "";item._enabled = true;item.childNodes[0].childNodes[1].childNodes[0].removeAttribute("disabled");},
 
 disable: function(item) {item.className = "disabled";item._enabled = false;item.childNodes[0].childNodes[1].childNodes[0].setAttribute("disabled", true);},
 
 setWidth: function(item, width) {item.childNodes[0].childNodes[1].childNodes[0].style.width = width+"px";}};dhtmlXForm.prototype.items.label = {render: function(item, data) {var td1 = document.createElement("TD");td1.colSpan = "2";td1.className = "dhxlist_txt_label2";td1.onselectstart = function(e){e=e||event;e.returnValue=false;return false;};item.appendChild(td1);item._type = "lb";item._enabled = true;item._checked = true;var t = document.createElement("DIV");t.className = "dhxlist_txt_label2"+(data._isTopmost?" topmost":"");t.innerHTML = data.label;td1.appendChild(t);return this;},
 
 destruct: function(item) {var td1 = item.childNodes[0];td1.onselectstart = null;while (td1.childNodes.length > 0)td1.removeChild(td1.childNodes[0]);while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);td1 = null;if (item._list){for (var q=0;q<item._list.length;q++){item._list[q].unload();var tb = item.parentNode;for (var w=0;w<tb.childNodes.length;w++)if (tb.childNodes[w]._type == "list" && tb.childNodes[w]._idd == item._idd)item._listObj[q].destruct(tb.childNodes[w]);item._listObj[q] = null;item._list[q] = null;}};item.onselectstart = null;item._autoCheck = null;item.callEvent = null;item.checkEvent = null;item.parentNode.removeChild(item);item = null;},
 
 enable: function(item) {item.className = "";item._enabled = true;},
 
 disable: function(item) {item.className = "disabled";item._enabled = false;},
 
 isEnabled: function(item) {return item._enabled;},
 
 setText: function(item, text) {item.childNodes[0].childNodes[0].innerHTML = text;},

 getText: function(item) {return item.childNodes[0].childNodes[0].innerHTML;}};dhtmlXForm.prototype.items.button = {render: function(item, data) {var td1 = document.createElement("TD");td1.colSpan = "2";td1.innerHTML = '<div class="dhx_list_btn" role="link" tabindex="0" dir="ltr" '+
 'onkeypress="e=event||window.arguments[0];if((e.keyCode==32||e.charCode==32)&&!this.parentNode._busy){this.parentNode._busy=true;e.cancelBubble=true;e.returnValue=false;_dhxForm_doClick(this.childNodes[0],[\'mousedown\',\'mouseup\']);return false;}" '+
 'onblur="_dhxForm_doClick(this.childNodes[0],\'mouseout\');" >'+
 '<table cellspacing="0" cellpadding="0" border="0" align="left">'+
 '<tr>'+
 '<td class="btn_l">&nbsp;</td>'+
 '<td class="btn_m"><div class="btn_txt">'+data.value+'</div></td>'+
 '<td class="btn_r">&nbsp;</td>'+
 '</tr>'+
 '</table>'+
 "</div>";td1._type = "bt";td1._enabled = true;td1._cmd = data.command;td1._name = data.name;item.type = "bt";item.appendChild(td1);td1.onselectstart = function(e){e=e||event;e.cancelBubble=true;e.returnValue=false;return false;};td1.childNodes[0].childNodes[0].onmouseover = function(){var td1 = this.parentNode.parentNode;if (!td1._enabled)return;this._isOver = true;this.className = "dhx_list_btn_over";td1 = null;};td1.childNodes[0].childNodes[0].onmouseout = function(){var td1 = this.parentNode.parentNode;if (!td1._enabled)return;this.className = "";this._allowClick = false;this._pressed = false;this._isOver = false;td1 = null;};td1.childNodes[0].childNodes[0].onmousedown = function(){if (this._pressed)return;var td1 = this.parentNode.parentNode;if (!td1._enabled)return;this.className = "dhx_list_btn_pressed";this._allowClick = true;this._pressed = true;td1 = null;};td1.childNodes[0].childNodes[0].onmouseup = function(){if (!this._pressed)return;var td1 = this.parentNode.parentNode;if (!td1._enabled)return;td1._busy = false;this.className = (this._isOver?"dhx_list_btn_over":"");if (this._pressed && this._allowClick)item.callEvent("_onButtonClick", [td1._name, td1._cmd]);this._allowClick = false;this._pressed = false;td1 = null;};return this;},
 
 destruct: function(item) {var t = item.childNodes[0].childNodes[0].childNodes[0];t.onmouseover = null;t.onmouseout = null;t.onmousedown = null;t.onmouseup = null;t = null;while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);if (item._list){for (var q=0;q<item._list.length;q++){item._list[q].unload();var tb = item.parentNode;for (var w=0;w<tb.childNodes.length;w++)if (tb.childNodes[w]._type == "list" && tb.childNodes[w]._idd == item._idd)item._listObj[q].destruct(tb.childNodes[w]);item._listObj[q] = null;item._list[q] = null;}};item.onselectstart = null;item._autoCheck = null;item.callEvent = null;item.checkEvent = null;item.parentNode.removeChild(item);item = null;},
 
 enable: function(item) {item.className = "";item._enabled = true;item.childNodes[0]._enabled = true;item.childNodes[0].childNodes[0].tabIndex = 0;item.childNodes[0].childNodes[0].removeAttribute("disabled");},
 
 disable: function(item) {item.className = "disabled";item._enabled = false;item.childNodes[0]._enabled = false;item.childNodes[0].childNodes[0].tabIndex = -1;item.childNodes[0].childNodes[0].setAttribute("disabled", "true");},
 
 isEnabled: function(item) {return item._enabled;},
 
 setText: function(item, text) {item.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].innerHTML = text;},

 getText: function(item) {return item.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].innerHTML;}};dhtmlXForm.prototype.items.hidden = {render: function(item, data) {item.style.display = "none";var td = document.createElement("TD");td.colspan = 2;td.innerHTML = '<input type="HIDDEN" name="'+data.name+'" value="'+data.value+'">';item.appendChild(td);item._name = data.name;item._type = "hd";item._enabled = true;return this;},
 
 destruct: function(item) {while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);if (item._list){for (var q=0;q<item._list.length;q++){item._list[q].unload();var tb = item.parentNode;for (var w=0;w<tb.childNodes.length;w++)if (tb.childNodes[w]._type == "list" && tb.childNodes[w]._idd == item._idd)item._listObj[q].destruct(tb.childNodes[w]);item._listObj[q] = null;item._list[q] = null;}};item.onselectstart = null;item._autoCheck = null;item.callEvent = null;item.checkEvent = null;item.parentNode.removeChild(item);item = null;},
 
 enable: function(item) {item._enabled = true;item.childNodes[0].childNodes[0].setAttribute("name", item._name);},
 
 disable: function(item) {item._enabled = false;item.childNodes[0].childNodes[0].removeAttribute("name");},
 
 isEnabled: function(item) {return this._enabled;},
 
 show: function() {},
 
 hide: function() {},
 
 isHidden: function() {return true;},
 
 setValue: function(item, val) {item.childNodes[0].childNodes[0].value = val;},
 
 getValue: function(item) {return item.childNodes[0].childNodes[0].value;}};dhtmlXForm.prototype.items.list = {render: function(item, type) {var td2 = document.createElement("TD");td2.className = "dhxlist_txt_cell";item._type = "list";item._enabled = true;var t = document.createElement("DIV");t._isNestedForm = true;t.style.width = "100%";if (item._fs === true){td2.colSpan = "2";item.appendChild(td2);var t2 = document.createElement("FIELDSET");t2.className = "dhxlist_fs";t2.style.width = type._fsWidth;td2.appendChild(t2);t2.innerHTML = "<legend class='fs_legend'>"+type._fsText+"</legend>";t2.appendChild(t)
 }else {var td1 = document.createElement("TD");td1.className = "dhxlist_img_cell";td1.onselectstart = function(e){e=e||event;e.returnValue=false;return false;};td1.innerHTML = "&nbsp;";item.appendChild(td1);item.appendChild(td2);td2.appendChild(t);};var listData = [this, new dhtmlXForm(t, type)];return listData;},
 
 destruct: function(item) {var td1 = item.childNodes[0];var td2 = item.childNodes[1];td1.onselectstart = null;while (td1.childNodes.length > 0)td1.removeChild(td1.childNodes[0]);while (td2.childNodes.length > 0)td2.removeChild(td2.childNodes[0]);while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);td1 = null;td2 = null;item.parentNode.removeChild(item);item = null;}};dhtmlXForm.prototype.items.fieldset = {render: function(item, data) {var td1 = document.createElement("TD");var td2 = document.createElement("TD");item.appendChild(td1);item.appendChild(td2);td2.innerHTML = data.label;item.style.display = "none";item._enabled = true;item._checked = true;item._width = (data.width||"100%");return this;},
 
 destruct: function(item) {},
 
 setText: function(item, text) {item.childNodes[1].innerHTML = text;},
 
 getText: function(item) {return item.childNodes[1].innerHTML;},
 
 enable: function(item) {item._enabled = true;item._fs.className = "";},
 
 disable: function(item) {item._enabled = false;item._fs.className = "disabled";},
 
 isEnabled: function(item) {return item._enabled;},
 
 setWidth: function(item, width) {item._fs.childNodes[0].childNodes[0].style.width = width;item._width = width;},
 
 getWidth: function(item) {return item._width;}};dhtmlXForm.prototype._ulToObject = function(ulData, a) {var obj = [];for (var q=0;q<ulData.childNodes.length;q++){if (String(ulData.childNodes[q].tagName||"").toLowerCase() == "li") {var p = {};var t = ulData.childNodes[q];for (var w=0;w<a.length;w++)if (t.getAttribute(a[w])!= null) p[String(a[w]).replace("ftype","type")] = t.getAttribute(a[w]);if (!p.label)try {p.label = t.firstChild.nodeValue;}catch(e){};var n = t.getElementsByTagName("UL");if (n[0] != null)p[(p.type=="select"?"options":"list")] = dhtmlXForm.prototype._ulToObject(n[0], a);obj[obj.length] = p;};if (String(ulData.childNodes[q].tagName||"").toLowerCase() == "div") {var p = {};p.type = "label";try {p.label = ulData.childNodes[q].firstChild.nodeValue;}catch(e){};obj[obj.length] = p;}};return obj;};dhtmlxEvent(window, "load", function(){var a = ["ftype", "name", "value", "label", "check", "checked", "disabled", "text", "rows", "select", "selected", "command"];var k = document.getElementsByTagName("UL");var u = [];for (var q=0;q<k.length;q++){if (k[q].className == "dhtmlxForm"){var listNode = document.createElement("DIV");u[u.length] = [k[q], listNode, dhtmlXForm.prototype._ulToObject(k[q], a)];}};for (var q=0;q<u.length;q++){u[q][0].parentNode.insertBefore(u[q][1], u[q][0]);var listObj = new dhtmlXForm(u[q][1], u[q][2]);u[q][0].parentNode.removeChild(u[q][0]);u[q][0] = null;u[q][1] = null;u[q][2] = null;u[q] = null;}});dhtmlxValidation=function(){};dhtmlxValidation.prototype={trackInput:function(el,rule,callback_error,callback_correct){dhtmlxEvent(el,"keyup",function(e){if (!dhtmlxValidation.checkInput(el,rule)){if(!callback_error || callback_error(el,el.value,rule))
 el.className+=" dhtmlx_live_validation_error";}else {el.className=el.className.replace(/[ ]*dhtmlx_live_validation_error/g,"");if (callback_correct)callback_correct(el,el.value,rule);}});},
 checkInput:function(input,rule){return this.checkValue(input.value,rule);},
 checkValue:function(value,rule){if (!rule)return;if (typeof rule!="string" && rule.length){var final_res=true;for (var i=0;i<rule.length;i++){var res=this.checkValue(value,rule[i]);final_res=final_res&&res;};return final_res;};if (!this["is"+rule])alert("Incorrect validation rule: "+rule);return this["is"+rule](value);},
 
 isEmpty: function(value) {return value == '';},
 isNotEmpty: function(value) {return !value == '';},
 isValidBoolean: function(value) {return !!value.match(/^(0|1|true|false)$/);},
 isValidEmail: function(value) {return !!value.match(/(^[a-z]([a-z0-9_\.]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@([a-z_\-\.]*)(\.[a-z]{2,3})$)/i);},
 isValidInteger: function(value) {return !!value.match(/(^-?\d+$)/);},
 isValidNumeric: function(value) {return !!value.match(/(^-?\d\d*[\.|,]\d*$)|(^-?\d\d*$)|(^-?[\.|,]\d\d*$)/);},
 isValidAplhaNumeric: function(value) {return !!value.match(/^[_\-a-z0-9]+$/gi);},
 
 isValidDatetime: function(value) {var dt = value.match(/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/);return dt && !!(dt[1]<=9999 && dt[2]<=12 && dt[3]<=31 && dt[4]<=59 && dt[5]<=59 && dt[6]<=59) || false;},
 
 isValidDate: function(value) {var d = value.match(/^(\d{4})-(\d{2})-(\d{2})$/);return d && !!(d[1]<=9999 && d[2]<=12 && d[3]<=31) || false;},
 
 isValidTime: function(value) {var t = value.match(/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/);return t && !!(t[1]<=24 && t[2]<=59 && t[3]<=59) || false;},
 
 isValidIPv4: function(value) {var ip = value.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);return ip && !!(ip[1]<=255 && ip[2]<=255 && ip[3]<=255 && ip[4]<=255) || false;},
 isValidCurrency: function(value) {return value.match(/^\$?\s?\d+?[\.,\,]?\d+?\s?\$?$/) && true || false;},
 
 isValidSSN: function(value) {return value.match(/^\d{3}\-?\d{2}\-?\d{4}$/) && true || false;},
 
 isValidSIN: function(value) {return value.match(/^\d{9}$/) && true || false;}};dhtmlxValidation=new dhtmlxValidation();if (window.dhtmlXContainer){if (!dhtmlx.attaches)dhtmlx.attaches = {};if (!dhtmlx.attaches["attachForm"]){dhtmlx.attaches["attachForm"] = function(data) {var obj = document.createElement("DIV");obj.id = "dhxFormObj_"+this._genStr(12);obj.style.position = "relative";obj.style.width = "100%";obj.style.height = "100%";obj.cmp = "form";this.attachObject(obj);this.vs[this.av].form = new dhtmlXForm(obj, data);this.vs[this.av].form.setSkin(this.skin);this.vs[this.av].form.setSizes();this.vs[this.av].formObj = obj;return this.vs[this.av].form;}};if (!dhtmlx.detaches)dhtmlx.detaches = {};if (!dhtmlx.detaches["detachForm"]){dhtmlx.detaches["detachForm"] = function(contObj) {if (!contObj.form)return;contObj.form.unload();contObj.form = null;contObj.formObj = null;contObj.attachForm = null;}}};dhtmlXForm.prototype.dummy = function(){};dhtmlXForm.prototype._changeFormId = function(oldid, newid){this.formId = newid;};dhtmlXForm.prototype._dp_init=function(dp){dp._methods=["dummy","","_changeFormId","dummy"];dp._getRowData=function(id,pref){return this.obj._createQuery(pref);};dp._clearUpdateFlag=function(){};dp.attachEvent("onAfterUpdate",function(sid, action, tid){if (action == "inserted" || action == "updated")dp.setUpdated(this.obj.formId, true, "updated");return true;});dp.autoUpdate = false;this.dp = dp;this.formId = (new Date()).valueOf();this.resetDataProcessor("inserted");};dhtmlXForm.prototype.setUserData=function(id,name,value){if (!this._userdata)this._userdata={};this._userdata[id] = (this._userdata[id]||{});this._userdata[id][name] = value;};dhtmlXForm.prototype.getUserData=function(id,name){if (this._userdata)return ((this._userdata[id]||{})[name])||"";return "";};dhtmlXForm.prototype.resetDataProcessor=function(mode){if (!this.dp)return;this.dp.updatedRows = [];this.dp._in_progress = [];this.dp.setUpdated(this.formId,true,mode);};dhtmlXForm.prototype.setRTL = function(state) {this._rtl = (state===true?true:false);this.base.className = (this._rtl?"dhxform_rtl":"");};_dhxForm_doClick = function(obj, evType) {if (typeof(evType)== "object") {var t = evType[1];evType = evType[0];};if (document.createEvent){var e = document.createEvent("MouseEvents");e.initEvent(evType, true, false);obj.dispatchEvent(e);}else if (document.createEventObject){var e = document.createEventObject();e.button = 1;obj.fireEvent("on"+evType, e);};if (t)window.setTimeout(function(){_dhxForm_doClick(obj,t);},100);};var globalActiveDHTMLGridObject;String.prototype._dhx_trim=function(){return this.replace(/&nbsp;/g, " ").replace(/(^[ \t]*)|([ \t]*$)/g, "");};function dhtmlxArray(ar){return dhtmlXHeir((ar||new Array()), dhtmlxArray._master);};dhtmlxArray._master={_dhx_find:function(pattern){for (var i = 0;i < this.length;i++){if (pattern == this[i])return i;};return -1;},
 _dhx_insertAt:function(ind, value){this[this.length]=null;for (var i = this.length-1;i >= ind;i--)this[i]=this[i-1]
 this[ind]=value
 },
 _dhx_removeAt:function(ind){this.splice(ind,1)
 },
 _dhx_swapItems:function(ind1, ind2){var tmp = this[ind1];this[ind1]=this[ind2]
 this[ind2]=tmp;}};function dhtmlXGridObject(id){if (_isIE)try{document.execCommand("BackgroundImageCache", false, true);}catch (e){};if (id){if (typeof (id)== 'object'){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.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";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("IMG")
 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") ? 24 : 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;this.entBox.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);this.entBox.style.position="relative";this.skin_h_correction=20;break;case "dhx_skyblue":
 case "dhx_web":
 case "glassy_blue":
 case "dhx_black":
 case "dhx_blue":
 case "modern":
 case "light":
 this._srdh=20;this.forceDivInHeader=true;break;case "xp":
 this.forceDivInHeader=true;if ((_isIE)&&(document.compatMode != "BackCompat"))
 this._srdh=25;else this._srdh=22;break;case "mt":
 if ((_isIE)&&(document.compatMode != "BackCompat"))
 this._srdh=25;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;this.editStop()
 
 this.lastClicked=null;this.resized=null;this.fldSorted=this.r_fldSorted=null;this.cellWidthPX=[];this.cellWidthPC=[];if (this.hdr.rows.length > 0){this.clearAll(true);};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)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(){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)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.src=this.imgURL+"sort_desc.gif";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 = [];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];this.cellWidthPX[i]=Math.floor(gridWidth*this.cellWidthPC[i]/100)||0;}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),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.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.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(){self.setSizes()
 }, 250);return;};var border_x = (((this.entBox.cmp||this._delta_x) && (this.skin_name||"").indexOf("dhx")==0 && !quirks)?2:0);var border_y = (((this.entBox.cmp||this._delta_y) && (this.skin_name||"").indexOf("dhx")==0 && !quirks)?2:0);var isVScroll = this.parentGrid?false:(this.objBox.scrollHeight > this.objBox.offsetHeight);var scrfix = _isFF?18: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));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);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);}};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]);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;this.entBox.style.width=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.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(){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.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=null;return;};if (order == "asc")this.sortImg.src=this.imgURL+"sort_asc.gif";else
 this.sortImg.src=this.imgURL+"sort_desc.gif";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=this;this.isActive=true;}else {this.isActive=false;}};this._doClick=function(ev){var selMethod = 0;var el = this.getFirstParentOfType(_isIE ? ev.srcElement : ev.target, "TD");if (!el)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){selMethod=1;};if (ev.ctrlKey||ev.metaKey){selMethod=2;}};this.doClick(el, fl, selMethod)
 };this._doContClick=function(ev){var el = this.getFirstParentOfType(_isIE ? ev.srcElement : ev.target, "TD");if ((!el)||( typeof (el.parentNode.idd) == "undefined"))
 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.callEvent("onBeforeSelect", [
 this.rowsCol[i].idd,
 psid
 ])){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;}};this.editStop()
 if (typeof (el.parentNode.idd)== "undefined")
 return true;if ((!skipRowSelection)&&(!el.parentNode._sRow)){if (this.callEvent("onBeforeSelect", [
 el.parentNode.idd,
 psid
 ])){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.cell && _isIE && _isIE == 8 ){var next = this.cell.nextSibling;var parent = this.cell.parentNode;parent.removeChild(this.cell)
 parent.insertBefore(this.cell,next);};if (this.selectedRows._dhx_find(this.row)== -1)
 this.selectedRows[this.selectedRows.length]=this.row;}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(){self.callEvent("onRowSelect", [
 rid,
 cid._cellIndex
 ]);}, 100);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 (preserve)this.doClick(c, fl, 3, show)
 else
 this.doClick(c, fl, 0, show)

 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);};if (!cell_obj.offsetHeight && this._srnd){var mask=this._realfake?this._fake.rowsAr[cell_obj.parentNode.idd]:cell_obj.parentNode;var h=this.rowsBuffer._dhx_find(mask)*this._srdh;return this.objBox.scrollTop=h;};try{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-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;var distance = cell_obj.offsetTop+cell_obj.offsetHeight+20;if (distance > (this.objBox.offsetHeight+this.objBox.scrollTop)){var scrollTop = distance-this.objBox.offsetHeight;}else if (cell_obj.offsetTop < this.objBox.scrollTop){var scrollTop = cell_obj.offsetTop-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;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);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;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
 ]);}};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.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])+((_isFF) ? 2 : 0);};this.setColWidth=function(ind, value){if (this._hrrar[ind])return;if (this.cellWidthType == 'px')this.cellWidthPX[ind]=parseInt(value)-+((_isFF) ? 2 : 0);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.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='"+this.imgURL+""+label+"' onerror='this.src = \""+this.imgURL
 +"imageloaderror.gif\"'>";var a = new Image();a.src=this.imgURL+""+label.replace(/(\.[a-z]+)/, ".des$1");this.preloadImagesAr[this.preloadImagesAr.length]=a;var b = new Image();b.src=this.imgURL+""+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.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.src=this.imgURL+"sort_"+(sortType == "asc" ? "asc" : "desc")+".gif";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)


 for (var i = 0;i < this.fldSort.length;i++)if (((this.fldSort[i]).length > 4)&&( 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"];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[0].insertRule(prefs[i]+(" {"+this.ssModifier[i]+" };"), document.styleSheets[0].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];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]){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 && !_isChrome){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();};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.obj.onclick=function(e){this.grid._doClick(e||window.event);if (this.grid._sclE)this.grid.editCell(e||window.event);(e||event).cancelBubble=true;};if (_isMacOS){this.entBox.oncontextmenu=function(e){e.cancelBubble=true;e.returnValue=false;return this.grid._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, _isOpera?"keypress":"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();});this.entBox.onbeforeactivate=function(){this._still_active=null;this.grid.setActive();event.cancelBubble=true;};this.entBox.onbeforedeactivate=function(){if (this.grid._still_active)this.grid._still_active=null;else 
 this.grid.isActive=false;event.cancelBubble=true;};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(id, name){return this.getRowById(id)._attrs[name];},
 setRowAttribute: function(id, name, value){this.getRowById(id)._attrs[name]=value;},
 
 isTreeGrid:function(){return (this.cellType._dhx_find("tree") != -1);},
 

 
 setRowHidden:function(id, state){var f = convertStringToBoolean(state);var row = this.getRowById(id) 
 
 if (!row)return;if (row.expand === "")this.collapseKids(row);if ((state)&&(row.style.display != "none")){row.style.display="none";var z = this.selectedRows._dhx_find(row);if (z != -1){row.className=row.className.replace("rowselected", "");for (var i = 0;i < row.childNodes.length;i++)row.childNodes[i].className=row.childNodes[i].className.replace(/cellselected/g, "");this.selectedRows._dhx_removeAt(z);};this.callEvent("onGridReconstructed", []);};if ((!state)&&(row.style.display == "none")){row.style.display="";this.callEvent("onGridReconstructed", []);};this.setSizes();},
 

 
 setColumnHidden:function(ind, state){if (!this.hdr.rows.length){if (!this._ivizcol)this._ivizcol=[];return this._ivizcol[ind]=state;};if ((this.fldSorted)&&(this.fldSorted.cellIndex == ind)&&(state))
 this.sortImg.style.display="none";var f = convertStringToBoolean(state);if (f){if (!this._hrrar)this._hrrar=new Array();else if (this._hrrar[ind])return;this._hrrar[ind]="display:none;";this._hideShowColumn(ind, "none");}else {if ((!this._hrrar)||(!this._hrrar[ind]))
 return;this._hrrar[ind]="";this._hideShowColumn(ind, "");};if ((this.fldSorted)&&(this.fldSorted.cellIndex == ind)&&(!state))
 this.sortImg.style.display="inline";this.setSortImgPos();this.callEvent("onColumnHidden",[ind,state])
 },
 
 
 
 isColumnHidden:function(ind){if ((this._hrrar)&&(this._hrrar[ind]))
 return true;return false;},
 
 setColumnsVisibility:function(list){if (list)this._ivizcol=list.split(this.delim);if (this.hdr.rows.length&&this._ivizcol)for (var i = 0;i < this._ivizcol.length;i++)this.setColumnHidden(i, this._ivizcol[i]);},
 
 _fixHiddenRowsAll:function(pb, ind, prop, state, index){index=index||"_cellIndex";var z = pb.rows.length;for (var i = 0;i < z;i++){var x = pb.rows[i].childNodes;if (x.length != this._cCount){for (var j = 0;j < x.length;j++)if (x[j][index] == ind){x[j].style[prop]=state;break;}}else
 x[ind].style[prop]=state;}},
 
 _hideShowColumn:function(ind, state){var hind = ind;if ((this.hdr.rows[1]._childIndexes)&&(this.hdr.rows[1]._childIndexes[ind] != ind))
 hind=this.hdr.rows[1]._childIndexes[ind];if (state == "none"){this.hdr.rows[0].cells[ind]._oldWidth=this.hdr.rows[0].cells[ind].style.width||(this.initCellWidth[ind]+"px");this.hdr.rows[0].cells[ind]._oldWidthP=this.cellWidthPC[ind];this.obj.rows[0].cells[ind].style.width="0px";var t={rows:[this.obj.rows[0]]};this.forEachRow(function(id){if (this.rowsAr[id].tagName=="TR")t.rows.push(this.rowsAr[id])
 })
 this._fixHiddenRowsAll(t, ind, "display", "none");if (this.isTreeGrid())
 this._fixHiddenRowsAllTG(ind, "none");if ((_isOpera&&_OperaRv < 9)||_isKHTML||(_isFF)){this._fixHiddenRowsAll(this.hdr, ind, "display", "none","_cellIndexS");};if (this.ftr)this._fixHiddenRowsAll(this.ftr.childNodes[0], ind, "display", "none");this._fixHiddenRowsAll(this.hdr, ind, "whiteSpace", "nowrap","_cellIndexS");if (!this.cellWidthPX.length&&!this.cellWidthPC.length)this.cellWidthPX=[].concat(this.initCellWidth);if (this.cellWidthPX[ind])this.cellWidthPX[ind]=0;if (this.cellWidthPC[ind])this.cellWidthPC[ind]=0;}else {if (this.hdr.rows[0].cells[ind]._oldWidth){var zrow = this.hdr.rows[0].cells[ind];if (_isOpera||_isKHTML||(_isFF))
 this._fixHiddenRowsAll(this.hdr, ind, "display", "","_cellIndexS");if (this.ftr)this._fixHiddenRowsAll(this.ftr.childNodes[0], ind, "display", "");var t={rows:[this.obj.rows[0]]};this.forEachRow(function(id){if (this.rowsAr[id].tagName=="TR")t.rows.push(this.rowsAr[id])
 })
 this._fixHiddenRowsAll(t, ind, "display", "");if (this.isTreeGrid())
 this._fixHiddenRowsAllTG(ind, "");this._fixHiddenRowsAll(this.hdr, ind, "whiteSpace", "normal","_cellIndexS");if (zrow._oldWidthP)this.cellWidthPC[ind]=zrow._oldWidthP;if (zrow._oldWidth)this.cellWidthPX[ind]=parseInt(zrow._oldWidth);}};this.setSizes();if ((!_isIE)&&(!_isFF)){this.obj.border=1;this.obj.border=0;}},




 
 enableColSpan:function(mode){this._ecspn=convertStringToBoolean(mode);},



 
 enableRowsHover:function(mode, cssClass){this._unsetRowHover(false,true);this._hvrCss=cssClass;if (convertStringToBoolean(mode)){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(click, dblclick, f2Key){this._sclE=convertStringToBoolean(click);this._dclE=convertStringToBoolean(dblclick);this._f2kE=convertStringToBoolean(f2Key);},
 

 
 enableLightMouseNavigation:function(mode){if (convertStringToBoolean(mode)){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(e){var c = this.grid.getFirstParentOfType(e ? e.target : event.srcElement, 'TD');if (!c)return;this.grid.editStop();this.grid.doClick(c);this.grid.editCell();(e||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(e, c){if (c)that=this;else
 that=this.grid;if ((that._lahRw)&&(that._lahRw != c)){for (var i = 0;i < that._lahRw.childNodes.length;i++)that._lahRw.childNodes[i].className=that._lahRw.childNodes[i].className.replace(that._hvrCss, "");that._lahRw=null;}},
 
 
 _setRowHover:function(e){var c = this.grid.getFirstParentOfType(e ? e.target : event.srcElement, 'TD');if (c && c.parentNode!=this.grid._lahRw){this.grid._unsetRowHover(0, c);c=c.parentNode;if (!c.idd || c.idd=="__filler__")return;for (var i = 0;i < c.childNodes.length;i++)c.childNodes[i].className+=" "+this.grid._hvrCss;this.grid._lahRw=c;};this._honmousemove(e);},
 
 
 _autoMoveSelect:function(e){if (!this.grid.editor){var c = this.grid.getFirstParentOfType(e ? e.target : event.srcElement, 'TD');if (c.parentNode.idd)this.grid.doClick(c, true, 0);};this._onmousemove(e);},



 
 enableDistributedParsing:function(mode, count, time){if (convertStringToBoolean(mode)){this._ads_count=count||10;this._ads_time=time||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 i = 0;i < this.formInputs.length;i++)this.parentForm.removeChild(this.formInputs[i]);var a;this.xmlLoader=this.xmlLoader.destructor();for (var i = 0;i < this.rowsCol.length;i++)if (this.rowsCol[i])this.rowsCol[i].grid=null;for (i in this.rowsAr)if (this.rowsAr[i])this.rowsAr[i]=null;this.rowsCol=new dhtmlxArray();this.rowsAr=new Array();this.entBox.innerHTML="";var dummy=function(){};this.entBox.onclick = this.entBox.onmousedown = this.entBox.onbeforeactivate = this.entBox.onbeforedeactivate = this.entBox.onbeforedeactivate = this.entBox.onselectstart = dummy;this.setSizes = this._update_srnd_view = this.callEvent = dummy;this.entBox.grid=this.objBox.grid=this.hdrBox.grid=this.obj.grid=this.hdr.grid=null;for (a in this){if ((this[a])&&(this[a].m_obj))
 this[a].m_obj=null;this[a]=null;};if (this == globalActiveDHTMLGridObject)globalActiveDHTMLGridObject=null;return null;},
 

 
 getSortingState:function(){var z = new Array();if (this.fldSorted){z[0]=this.fldSorted._cellIndex;z[1]=(this.sortImg.src.indexOf("sort_desc.gif") != -1) ? "des" : "asc";};return z;},

 
 
 enableAutoHeight:function(mode, maxHeight, countFullHeight){this._ahgr=convertStringToBoolean(mode);this._ahgrF=convertStringToBoolean(countFullHeight);this._ahgrM=maxHeight||null;if (arguments.length == 1){this.objBox.style.overflowY=mode?"hidden":"auto";};if (maxHeight == "auto"){this._ahgrM=null;this._ahgrMA=true;this._setAutoResize();}},

 enableStableSorting:function(mode){this._sst=convertStringToBoolean(mode);this.rowsCol.stablesort=function(cmp){var size = this.length-1;for (var i = 0;i < this.length-1;i++){for (var j = 0;j < size;j++)if (cmp(this[j], this[j+1])> 0){var temp = this[j];this[j]=this[j+1];this[j+1]=temp;};size--;}}},

 
 
 enableKeyboardSupport:function(mode){this._htkebl=!convertStringToBoolean(mode);},
 

 
 enableContextMenu:function(menu){this._ctmndx=menu;},

 
 
 setScrollbarWidthCorrection:function(width){},

 
 enableTooltips:function(list){this._enbTts=list.split(",");for (var i = 0;i < this._enbTts.length;i++)this._enbTts[i]=convertStringToBoolean(this._enbTts[i]);},

 

 
 enableResizing:function(list){this._drsclmn=list.split(",");for (var i = 0;i < this._drsclmn.length;i++)this._drsclmn[i]=convertStringToBoolean(this._drsclmn[i]);},
 
 
 setColumnMinWidth:function(width, ind){if (arguments.length == 2){if (!this._drsclmW)this._drsclmW=new Array();this._drsclmW[ind]=width;}else
 this._drsclmW=width.split(",");},

 
 
 enableCellIds:function(mode){this._enbCid=convertStringToBoolean(mode);},
 
 

 
 lockRow:function(rowId, mode){var z = this.getRowById(rowId);if (z){z._locked=convertStringToBoolean(mode);if ((this.cell)&&(this.cell.parentNode.idd == rowId))
 this.editStop();}},

 
 
 _getRowArray:function(row){var text = new Array();for (var ii = 0;ii < row.childNodes.length;ii++){var a = this.cells3(row, ii);text[ii]=a.getValue();};return text;},


 
 setDateFormat:function(mask,incoming){this._dtmask=mask;this._dtmask_inc=incoming;},
 
 
 setNumberFormat:function(mask, cInd, p_sep, d_sep){var nmask = mask.replace(/[^0\,\.]*/g, "");var pfix = nmask.indexOf(".");if (pfix > -1)pfix=nmask.length-pfix-1;var dfix = nmask.indexOf(",");if (dfix > -1)dfix=nmask.length-pfix-2-dfix;if (typeof p_sep != "string")p_sep=this.i18n.decimal_separator;if (typeof d_sep != "string")d_sep=this.i18n.group_separator;var pref = mask.split(nmask)[0];var postf = mask.split(nmask)[1];this._maskArr[cInd]=[
 pfix,
 dfix,
 pref,
 postf,
 p_sep,
 d_sep
 ];},
 
 _aplNFb:function(data, ind){var a = this._maskArr[ind];if (!a)return data;var ndata = parseFloat(data.toString().replace(/[^0-9]*/g, ""));if (data.toString().substr(0, 1) == "-")
 ndata=ndata*-1;if (a[0] > 0)ndata=ndata / Math.pow(10, a[0]);return ndata;},
 
 
 _aplNF:function(data, ind){var a = this._maskArr[ind];if (!a)return data;var c = (parseFloat(data) < 0 ? "-" : "")+a[2];data=Math.abs(Math.round(parseFloat(data)*Math.pow(10, a[0] > 0 ? a[0] : 0))).toString();data=(data.length
 < a[0]
 ? Math.pow(10, a[0]+1-data.length).toString().substr(1, a[0]+1)+data.toString()
 : data).split("").reverse();data[a[0]]=(data[a[0]]||"0")+a[4];if (a[1] > 0)for (var j = (a[0] > 0 ? 0 : 1)+a[0]+a[1];j < data.length;j+=a[1])data[j]+=a[5];return c+data.reverse().join("")+a[3];},


 

 
 
 _launchCommands:function(arr){for (var i = 0;i < arr.length;i++){var args = new Array();for (var j = 0;j < arr[i].childNodes.length;j++)if (arr[i].childNodes[j].nodeType == 1)args[args.length]=arr[i].childNodes[j].firstChild.data;this[arr[i].getAttribute("command")].apply(this, args);}},
 
 
 
 _parseHead:function(xmlDoc){var hheadCol = this.xmlLoader.doXPath("./head", xmlDoc);if (hheadCol.length){var headCol = this.xmlLoader.doXPath("./column", hheadCol[0]);var asettings = this.xmlLoader.doXPath("./settings", hheadCol[0]);var awidthmet = "setInitWidths";var split = false;if (asettings[0]){for (var s = 0;s < asettings[0].childNodes.length;s++)switch (asettings[0].childNodes[s].tagName){case "colwidth":
 if (asettings[0].childNodes[s].firstChild&&asettings[0].childNodes[s].firstChild.data == "%")awidthmet="setInitWidthsP";break;case "splitat":
 split=(asettings[0].childNodes[s].firstChild ? asettings[0].childNodes[s].firstChild.data : false);break;}};this._launchCommands(this.xmlLoader.doXPath("./beforeInit/call", hheadCol[0]));if (headCol.length > 0){if (this.hdr.rows.length > 0)this.clearAll(true);var sets = [
 [],
 [],
 [],
 [],
 [],
 [],
 [],
 [],
 []
 ];var attrs = ["", "width", "type", "align", "sort", "color", "format", "hidden", "id"];var calls = ["", awidthmet, "setColTypes", "setColAlign", "setColSorting", "setColumnColor", "",
 "", "setColumnIds"];for (var i = 0;i < headCol.length;i++){for (var j = 1;j < attrs.length;j++)sets[j].push(headCol[i].getAttribute(attrs[j]));sets[0].push((headCol[i].firstChild
 ? headCol[i].firstChild.data
 : "").replace(/^\s*((\s\S)*.+)\s*$/gi, "$1"));};this.setHeader(sets[0]);for (var i = 0;i < calls.length;i++)if (calls[i])this[calls[i]](sets[i].join(this.delim))
 
 for (var i = 0;i < headCol.length;i++){if ((this.cellType[i].indexOf('co')== 0)||(this.cellType[i] == "clist")){var optCol = this.xmlLoader.doXPath("./option", headCol[i]);if (optCol.length){var resAr = new Array();if (this.cellType[i] == "clist"){for (var j = 0;j < optCol.length;j++)resAr[resAr.length]=optCol[j].firstChild
 ? optCol[j].firstChild.data
 : "";this.registerCList(i, resAr);}else {var combo = this.getCombo(i);for (var j = 0;j < optCol.length;j++)combo.put(optCol[j].getAttribute("value"),
 optCol[j].firstChild
 ? optCol[j].firstChild.data
 : "");}}}else if (sets[6][i])if ((this.cellType[i].toLowerCase().indexOf("calendar")!=-1)||(this.fldSort[i] == "date"))
 this.setDateFormat(sets[6][i]);else
 this.setNumberFormat(sets[6][i], i);};this.init();var param=sets[7].join(this.delim);if (this.setColHidden && param.replace(/,/g,"")!="")
 this.setColHidden(param);if ((split)&&(this.splitAt))
 this.splitAt(split);};this._launchCommands(this.xmlLoader.doXPath("./afterInit/call", hheadCol[0]));};var gudCol = this.xmlLoader.doXPath("//rows/userdata", xmlDoc);if (gudCol.length > 0){if (!this.UserData["gridglobaluserdata"])this.UserData["gridglobaluserdata"]=new Hashtable();for (var j = 0;j < gudCol.length;j++){this.UserData["gridglobaluserdata"].put(gudCol[j].getAttribute("name"),
 gudCol[j].firstChild
 ? gudCol[j].firstChild.data
 : "");}}},
 
 

 
 
 
 getCheckedRows:function(col_ind){var d = new Array();this.forEachRowA(function(id){if (this.cells(id, col_ind).getValue() != 0)
 d.push(id);},true)
 return d.join(",");},
 
 checkAll:function(){var mode=arguments.length?arguments[0]:1;for (var cInd=0;cInd<this.getColumnsNum();cInd++){if(this.getColType(cInd)=="ch")this.setCheckedRows(cInd,mode)}},
 
 uncheckAll:function(){this.checkAll(0);},
 
 setCheckedRows:function(cInd,v){this.forEachRowA(function(id){if(this.cells(id,cInd).isCheckbox())this.cells(id,cInd).setValue(v)})},

 
 _drawTooltip:function(e){var c = this.grid.getFirstParentOfType(e ? e.target : event.srcElement, 'TD');if (!c || ((this.grid.editor)&&(this.grid.editor.cell == c)))
 return true;var r = c.parentNode;if (!r.idd||r.idd == "__filler__")return;var el = (e ? e.target : event.srcElement);if (r.idd == window.unknown)return true;if (!this.grid.callEvent("onMouseOver", [
 r.idd,
 c._cellIndex,
 (e||window.event)]))
 return true;if ((this.grid._enbTts)&&(!this.grid._enbTts[c._cellIndex])){if (el.title)el.title='';return true;};if (c._cellIndex >= this.grid._cCount)return;var ced = this.grid.cells3(r, c._cellIndex);if (!ced || !ced.cell || !ced.cell._attrs)return;if (el._title)ced.cell.title="";if (!ced.cell._attrs['title'])el._title=true;if (ced)el.title=ced.cell._attrs['title']
 ||(ced.getTitle
 ? ced.getTitle()
 : (ced.getValue()||"").toString().replace(/<[^>]*>/gi, ""));return true;},

 
 enableCellWidthCorrection:function(size){if (_isFF)this._wcorr=parseInt(size);},
 
 
 
 getAllRowIds:function(separator){var ar = [];for (var i = 0;i < this.rowsBuffer.length;i++)if (this.rowsBuffer[i])ar.push(this.rowsBuffer[i].idd);return ar.join(separator||this.delim)
 },
 getAllItemIds:function(){return this.getAllRowIds();},
 


 
 
 setColspan:function(row_id, col_ind, colspan){if (!this._ecspn)return;var r = this.getRowById(row_id);if ((r._childIndexes)&&(r.childNodes[r._childIndexes[col_ind]])){var j = r._childIndexes[col_ind];var n = r.childNodes[j];var m = n.colSpan;n.colSpan=1;if ((m)&&(m != 1))
 for (var i = 1;i < m;i++){var c = document.createElement("TD");if (n.nextSibling)r.insertBefore(c, n.nextSibling);else
 r.appendChild(c);r._childIndexes[col_ind+i]=j+i;c._cellIndex=col_ind+i;c.style.textAlign=this.cellAlign[i];c.style.verticalAlign=this.cellVAlign[i];n=c;this.cells3(r, col_ind+i).setValue("");};for (var z = col_ind*1+1*m;z < r._childIndexes.length;z++){r._childIndexes[z]+=(m-1)*1;}};if ((colspan)&&(colspan > 1)){if (r._childIndexes)var j = r._childIndexes[col_ind];else {var j = col_ind;r._childIndexes=new Array();for (var z = 0;z < r.childNodes.length;z++)r._childIndexes[z]=z;};r.childNodes[j].colSpan=colspan;for (var z = 1;z < colspan;z++){r._childIndexes[r.childNodes[j+1]._cellIndex]=j;r.removeChild(r.childNodes[j+1]);};var c1 = r.childNodes[r._childIndexes[col_ind]]._cellIndex;for (var z = c1*1+1*colspan;z < r._childIndexes.length;z++)r._childIndexes[z]-=(colspan-1);}},
 


 
 
 preventIECaching:function(mode){this.no_cashe=convertStringToBoolean(mode);this.xmlLoader.rSeed=this.no_cashe;},
 enableColumnAutoSize:function(mode){this._eCAS=convertStringToBoolean(mode);},
 
 _onHeaderDblClick:function(e){var that = this.grid;var el = that.getFirstParentOfType(_isIE ? event.srcElement : e.target, "TD");if (!that._eCAS)return false;that.adjustColumnSize(el._cellIndexS)
 },
 
 
 adjustColumnSize:function(cInd, complex){if (this._hrrar && this._hrrar[cInd])return;this._notresize=true;var m = 0;this._setColumnSizeR(cInd, 20);for (var j = 1;j < this.hdr.rows.length;j++){var a = this.hdr.rows[j];a=a.childNodes[(a._childIndexes) ? a._childIndexes[cInd] : cInd];if ((a)&&((!a.colSpan)||(a.colSpan < 2)) && a._cellIndex==cInd){if ((a.childNodes[0])&&(a.childNodes[0].className == "hdrcell"))
 a=a.childNodes[0];m=Math.max(m, ((_isFF||_isOpera) ? (a.textContent.length*7) : a.scrollWidth));}};var l = this.obj.rows.length;for (var i = 1;i < l;i++){var z = this.obj.rows[i];if (!this.rowsAr[z.idd])continue;if (z._childIndexes&&z._childIndexes[cInd] != cInd || !z.childNodes[cInd])continue;if (_isFF||_isOpera||complex)z=z.childNodes[cInd].textContent.length*7;else
 z=z.childNodes[cInd].scrollWidth;if (z > m)m=z;};m+=20+(complex||0);this._setColumnSizeR(cInd, m);this._notresize=false;this.setSizes();},
 

 
 detachHeader:function(index, hdr){hdr=hdr||this.hdr;var row = hdr.rows[index+1];if (row)row.parentNode.removeChild(row);this.setSizes();},
 
 
 detachFooter:function(index){this.detachHeader(index, this.ftr);},
 
 
 attachHeader:function(values, style, _type){if (typeof (values)== "string")
 values=this._eSplit(values);if (typeof (style)== "string")
 style=style.split(this.delim);_type=_type||"_aHead";if (this.hdr.rows.length){if (values)this._createHRow([
 values,
 style
 ], this[(_type == "_aHead") ? "hdr" : "ftr"]);else if (this[_type])for (var i = 0;i < this[_type].length;i++)this.attachHeader.apply(this, this[_type][i]);}else {if (!this[_type])this[_type]=new Array();this[_type][this[_type].length]=[
 values,
 style,
 _type
 ];}},
 
 _createHRow:function(data, parent){if (!parent){if (this.entBox.style.position!="absolute")this.entBox.style.position="relative";var z = document.createElement("DIV");z.className="c_ftr".substr(2);this.entBox.appendChild(z);var t = document.createElement("TABLE");t.cellPadding=t.cellSpacing=0;if (!_isIE){t.width="100%";t.style.paddingRight="20px";};t.style.marginRight="20px";t.style.tableLayout="fixed";z.appendChild(t);t.appendChild(document.createElement("TBODY"));this.ftr=parent=t;var hdrRow = t.insertRow(0);var thl = ((this.hdrLabels.length <= 1) ? data[0].length : this.hdrLabels.length);for (var i = 0;i < thl;i++){hdrRow.appendChild(document.createElement("TH"));hdrRow.childNodes[i]._cellIndex=i;};if (_isIE && _isIE<8)hdrRow.style.position="absolute";else
 hdrRow.style.height='auto';};var st1 = data[1];var z = document.createElement("TR");parent.rows[0].parentNode.appendChild(z);for (var i = 0;i < data[0].length;i++){if (data[0][i] == "#cspan"){var pz = z.cells[z.cells.length-1];pz.colSpan=(pz.colSpan||1)+1;continue;};if ((data[0][i] == "#rspan")&&(parent.rows.length > 1)){var pind = parent.rows.length-2;var found = false;var pz = null;while (!found){var pz = parent.rows[pind];for (var j = 0;j < pz.cells.length;j++)if (pz.cells[j]._cellIndex == i){found=j+1;break;};pind--;};pz=pz.cells[found-1];pz.rowSpan=(pz.rowSpan||1)+1;continue;};var w = document.createElement("TD");w._cellIndex=w._cellIndexS=i;if (this._hrrar && this._hrrar[i] && !_isIE)w.style.display='none';if (typeof data[0][i] == "object")w.appendChild(data[0][i]);else {if (this.forceDivInHeader)w.innerHTML="<div class='hdrcell'>"+(data[0][i]||"&nbsp;")+"</div>";else
 w.innerHTML=(data[0][i]||"&nbsp;");if ((data[0][i]||"").indexOf("#") != -1){var t = data[0][i].match(/(^|{)#([^}]+)(}|$)/);if (t){var tn = "_in_header_"+t[2];if (this[tn])this[tn]((this.forceDivInHeader ? w.firstChild : w), i, data[0][i].split(t[0]));}}};if (st1)w.style.cssText=st1[i];z.appendChild(w);};var self = parent;if (_isKHTML){if (parent._kTimer)window.clearTimeout(parent._kTimer);parent._kTimer=window.setTimeout(function(){parent.rows[1].style.display='none';window.setTimeout(function(){parent.rows[1].style.display='';}, 1);}, 500);}},

 
 attachFooter:function(values, style){this.attachHeader(values, style, "_aFoot");},




 
 setCellExcellType:function(rowId, cellIndex, type){this.changeCellType(this.getRowById(rowId), cellIndex, type);},
 
 changeCellType:function(r, ind, type){type=type||this.cellType[ind];var z = this.cells3(r, ind);var v = z.getValue();z.cell._cellType=type;var z = this.cells3(r, ind);z.setValue(v);},
 
 setRowExcellType:function(rowId, type){var z = this.rowsAr[rowId];for (var i = 0;i < z.childNodes.length;i++)this.changeCellType(z, i, type);},
 
 setColumnExcellType:function(colIndex, type){for (var i = 0;i < this.rowsBuffer.length;i++)if (this.rowsBuffer[i] && this.rowsBuffer[i].tagName=="TR")this.changeCellType(this.rowsBuffer[i], colIndex, type);if (this.cellType[colIndex]=="math")this._strangeParams[i]=type;else
 this.cellType[colIndex]=type;},
 



 
 forEachRow:function(custom_code){for (var a in this.rowsAr)if (this.rowsAr[a]&&this.rowsAr[a].idd)custom_code.apply(this, [this.rowsAr[a].idd]);},
 forEachRowA:function(custom_code){for (var a =0;a<this.rowsBuffer.length;a++){if (this.rowsBuffer[a])custom_code.call(this, this.render_row(a).idd);}},
 
 forEachCell:function(rowId, custom_code){var z = this.getRowById(rowId);if (!z)return;for (var i = 0;i < this._cCount;i++)custom_code(this.cells3(z, i),i);},
 
 enableAutoWidth:function(mode, max_limit, min_limit){this._awdth=[
 convertStringToBoolean(mode),
 parseInt(max_limit||99999),
 parseInt(min_limit||0)
 ];if (arguments.length == 1)this.objBox.style.overflowX=mode?"hidden":"auto";},

 
 
 updateFromXML:function(url, insert_new, del_missed, afterCall){if (typeof insert_new == "undefined")insert_new=true;this._refresh_mode=[
 true,
 insert_new,
 del_missed
 ];this.load(url,afterCall)
 },
 _refreshFromXML:function(xml){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(content){var r=this.grid._h2.get[this.cell.parentNode.idd]
 if (r && this.cell.parentNode.valTag){this.setLabel(content);}else
 this.setValueX(content);}};var tree = this.cellType._dhx_find("tree");xml.getXMLTopNode("rows");var pid = xml.doXPath("//rows")[0].getAttribute("parent")||0;var del = {};if (this._refresh_mode[2]){if (tree != -1)this._h2.forEachChild(pid, function(obj){del[obj.id]=true;}, this);else
 this.forEachRow(function(id){del[id]=true;});};var rows = xml.doXPath("//row");for (var i = 0;i < rows.length;i++){var row = rows[i];var id = row.getAttribute("id");del[id]=false;var pid = row.parentNode.getAttribute("id")||pid;if (this.rowsAr[id] && this.rowsAr[id].tagName!="TR"){if (this._h2)this._h2.get[id].buff.data=row;else
 this.rowsBuffer[this.getRowIndex(id)].data=row;this.rowsAr[id]=row;}else if (this.rowsAr[id]){this._process_xml_row(this.rowsAr[id], row, -1);this._postRowProcessing(this.rowsAr[id],true)
 }else if (this._refresh_mode[1]){var dadd={idd: id,
 data: row,
 _parser: this._process_xml_row,
 _locator: this._get_xml_data
 };if (this._refresh_mode[1]=="top")this.rowsBuffer.unshift(dadd);else
 this.rowsBuffer.push(dadd);if (this._h2){reset=true;(this._h2.add(id,(row.parentNode.getAttribute("id")||row.parentNode.getAttribute("parent")))).buff=this.rowsBuffer[this.rowsBuffer.length-1];};this.rowsAr[id]=row;row=this.render_row(this.rowsBuffer.length-1);this._insertRowAt(row,-1)
 }};if (this._refresh_mode[2])for (id in del){if (del[id]&&this.rowsAr[id])this.deleteRow(id);};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(id, ind){var cell = this.cells(id, ind).cell;if (!cell._combo)cell._combo=new dhtmlXGridComboObject();return cell._combo;},

 
 setTabOrder:function(order){var t = order.split(this.delim);this._tabOrder=[];var max=this._cCount||order.length;for (var i = 0;i < max;i++)t[i]={c: parseInt(t[i]),
 ind: i
 };t.sort(function(a, b){return (a.c > b.c ? 1 : -1);});for (var i = 0;i < max;i++)if (!t[i+1]||( typeof t[i].c == "undefined"))
 this._tabOrder[t[i].ind]=(t[0].ind+1)*-1;else
 this._tabOrder[t[i].ind]=t[i+1].ind;},
 
 i18n:{loading: "Loading",
 decimal_separator:".",
 group_separator:","
 },
 
 
 _key_events:{k13_1_0: function(){var rowInd = this.rowsCol._dhx_find(this.row)
 this.selectCell(this.rowsCol[rowInd+1], this.cell._cellIndex, true);},
 k13_0_1: function(){var rowInd = this.rowsCol._dhx_find(this.row)
 this.selectCell(this.rowsCol[rowInd-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 z = this._getNextCell(null, 1);if (z){this.selectCell(z.parentNode, z._cellIndex, (this.row != z.parentNode), false, true);this._still_active=true;}},
 k9_0_1: function(){this.editStop();if (!this.callEvent("onTab",[false])) return false;var z = this._getNextCell(null, -1);if (z){this.selectCell(z.parentNode, z._cellIndex, (this.row != z.parentNode), false, true);this._still_active=true;}},
 k113_0_0: function(){if (this._f2kE)this.editCell();},
 k32_0_0: function(){var c = this.cells4(this.cell);if (!c.changeState||(c.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 master = this._realfake?this._fake:this;if (this.editor&&this.editor.combo)this.editor.shiftNext();else {if (!this.row.idd)return;var rowInd = Math.max((master._r_select||0),this.getRowIndex(this.row.idd))+1;if (this.rowsBuffer[rowInd]){master._r_select=null;this.selectCell(rowInd, this.cell._cellIndex, true);if (master.pagingOn)master.showRow(master.getRowId(rowInd));}else {this._key_events.k34_0_0.apply(this, []);if (this.pagingOn && this.rowsCol[rowInd])this.selectCell(rowInd, 0, true);}};this._still_active=true;},
 k38_0_0: function(){var master = this._realfake?this._fake:this;if (this.editor&&this.editor.combo)this.editor.shiftPrev();else {if (!this.row.idd)return;var rowInd = this.getRowIndex(this.row.idd)+1;if (rowInd != -1 && (!this.pagingOn || (rowInd!=1))){var nrow = this._nextRow(rowInd-1, -1);this.selectCell(nrow, this.cell._cellIndex, true);if (master.pagingOn && nrow)master.showRow(nrow.idd);}else {this._key_events.k33_0_0.apply(this, []);}};this._still_active=true;}},
 
 
 
 _build_master_row:function(){var t = document.createElement("DIV");var html = ["<table><tr>"];for (var i = 0;i < this._cCount;i++)html.push("<td></td>");html.push("</tr></table>");t.innerHTML=html.join("");this._master_row=t.firstChild.rows[0];},
 
 _prepareRow:function(new_id){if (!this._master_row)this._build_master_row();var r = this._master_row.cloneNode(true);for (var i = 0;i < r.childNodes.length;i++){r.childNodes[i]._cellIndex=i;if (this._enbCid)r.childNodes[i].id="c_"+new_id+"_"+i;if (this.dragAndDropOff)this.dragger.addDraggableItem(r.childNodes[i], this);};r.idd=new_id;r.grid=this;return r;},
 

 _process_jsarray_row:function(r, data){r._attrs={};for (var j = 0;j < r.childNodes.length;j++)r.childNodes[j]._attrs={};this._fillRow(r, (this._c_order ? this._swapColumns(data) : data));return r;},
 _get_jsarray_data:function(data, ind){return data[ind];},
 _process_json_row:function(r, data){r._attrs={};for (var j = 0;j < r.childNodes.length;j++)r.childNodes[j]._attrs={};this._fillRow(r, (this._c_order ? this._swapColumns(data.data) : data.data));return r;},
 _get_json_data:function(data, ind){return data.data[ind];},
 
 _process_csv_row:function(r, data){r._attrs={};for (var j = 0;j < r.childNodes.length;j++)r.childNodes[j]._attrs={};this._fillRow(r, (this._c_order ? this._swapColumns(data.split(this.csv.cell)) : data.split(this.csv.cell)));return r;},
 _get_csv_data:function(data, ind){return data.split(this.csv.cell)[ind];},


 _process_xml_row:function(r, xml){var cellsCol = this.xmlLoader.doXPath(this.xml.cell, xml);var strAr = [];r._attrs=this._xml_attrs(xml);if (this._ud_enabled){var udCol = this.xmlLoader.doXPath("./userdata", xml);for (var i = udCol.length-1;i >= 0;i--)this.setUserData(r.idd,udCol[i].getAttribute("name"), udCol[i].firstChild
 ? udCol[i].firstChild.data
 : "");};for (var j = 0;j < cellsCol.length;j++){var cellVal = cellsCol[this._c_order?this._c_order[j]:j];if (!cellVal)continue;var cind = r._childIndexes?r._childIndexes[j]:j;var exc = cellVal.getAttribute("type");if (r.childNodes[cind]){if (exc)r.childNodes[cind]._cellType=exc;r.childNodes[cind]._attrs=this._xml_attrs(cellVal);};if (!cellVal.getAttribute("xmlcontent")){if (cellVal.firstChild)cellVal=cellVal.firstChild.data;else
 cellVal="";};strAr.push(cellVal);};for (j < cellsCol.length;j < r.childNodes.length;j++)r.childNodes[j]._attrs={};if (r.parentNode&&r.parentNode.tagName == "row")r._attrs["parent"]=r.parentNode.getAttribute("idd");this._fillRow(r, strAr);return r;},
 _get_xml_data:function(data, ind){data=data.firstChild;while (true){if (!data)return "";if (data.tagName == "cell")ind--;if (ind < 0)break;data=data.nextSibling;};return (data.firstChild ? data.firstChild.data : "");},

 _fillRow:function(r, text){if (this.editor)this.editStop();for (var i = 0;i < r.childNodes.length;i++){if ((i < text.length)||(this.defVal[i])){var ii=r.childNodes[i]._cellIndex;var val = text[ii];var aeditor = this.cells4(r.childNodes[i]);if ((this.defVal[ii])&&((val == "")||( typeof (val) == "undefined")))
 val=this.defVal[ii];if (aeditor)aeditor.setValue(val)
 }else {r.childNodes[i].innerHTML="&nbsp;";r.childNodes[i]._clearCell=true;}};return r;},
 
 _postRowProcessing:function(r,donly){if (r._attrs["class"])r._css=r.className=r._attrs["class"];if (r._attrs.locked)r._locked=true;if (r._attrs.bgColor)r.bgColor=r._attrs.bgColor;var cor=0;for (var i = 0;i < r.childNodes.length;i++){var c=r.childNodes[i];var ii=c._cellIndex;var s = c._attrs.style||r._attrs.style;if (s)c.style.cssText+=";"+s;if (c._attrs["class"])c.className=c._attrs["class"];s=c._attrs.align||this.cellAlign[ii];if (s)c.align=s;c.vAlign=c._attrs.valign||this.cellVAlign[ii];var color = c._attrs.bgColor||this.columnColor[ii];if (color)c.bgColor=color;if (c._attrs["colspan"] && !donly){this.setColspan(r.idd, i+cor, c._attrs["colspan"]);cor+=(c._attrs["colspan"]-1);};if (this._hrrar&&this._hrrar[ii]&&!donly){c.style.display="none";}};this.callEvent("onRowCreated", [
 r.idd,
 r,
 null
 ]);},
 
 load:function(url, call, type){this.callEvent("onXLS", [this]);if (arguments.length == 2 && typeof call != "function"){type=call;call=null;};type=type||"xml";if (!this.xmlFileUrl)this.xmlFileUrl=url;this._data_type=type;this.xmlLoader.onloadAction=function(that, b, c, d, xml){if (!that.callEvent)return;xml=that["_process_"+type](xml);if (!that._contextCallTimer)that.callEvent("onXLE", [that,0,0,xml]);if (call){call();call=null;}};this.xmlLoader.loadXML(url);},

 loadXMLString:function(str, afterCall){var t = new dtmlXMLLoaderObject(function(){});t.loadXMLString(str);this.parse(t, afterCall, "xml")
 },

 loadXML:function(url, afterCall){this.load(url, afterCall, "xml")
 },
 
 parse:function(data, call, type){if (arguments.length == 2 && typeof call != "function"){type=call;call=null;};type=type||"xml";this._data_type=type;data=this["_process_"+type](data);if (!this._contextCallTimer)this.callEvent("onXLE", [this,0,0,data]);if (call)call();},
 
 xml:{top: "rows",
 row: "./row",
 cell: "./cell",
 s_row: "row",
 s_cell: "cell",
 row_attrs: [],
 cell_attrs: []
 },
 
 csv:{row: "\n",
 cell: ","
 },
 
 _xml_attrs:function(node){var data = {};if (node.attributes.length){for (var i = 0;i < node.attributes.length;i++)data[node.attributes[i].name]=node.attributes[i].value;};return data;},

 _process_xml:function(xml){if (!xml.doXPath){var t = new dtmlXMLLoaderObject(function(){});if (typeof xml == "string")t.loadXMLString(xml);else {if (xml.responseXML)t.xmlDoc=xml;else
 t.xmlDoc={};t.xmlDoc.responseXML=xml;};xml=t;};if (this._refresh_mode)return this._refreshFromXML(xml);this._parsing=true;var top = xml.getXMLTopNode(this.xml.top)
 if (top.tagName.toLowerCase()!=this.xml.top) return;this._parseHead(top);var rows = xml.doXPath(this.xml.row, top)
 var cr = parseInt(xml.doXPath("//"+this.xml.top)[0].getAttribute("pos")||0);var total = parseInt(xml.doXPath("//"+this.xml.top)[0].getAttribute("total_count")||0);if (total&&!this.rowsBuffer[total-1])this.rowsBuffer[total-1]=null;if (this.isTreeGrid())
 return this._process_tree_xml(xml);for (var i = 0;i < rows.length;i++){if (this.rowsBuffer[i+cr])continue;var id = rows[i].getAttribute("id")||(i+cr+1);this.rowsBuffer[i+cr]={idd: id,
 data: rows[i],
 _parser: this._process_xml_row,
 _locator: this._get_xml_data
 };this.rowsAr[id]=rows[i];};this.render_dataset();this._parsing=false;return xml.xmlDoc.responseXML?xml.xmlDoc.responseXML:xml.xmlDoc;},


 _process_jsarray:function(data){this._parsing=true;if (data&&data.xmlDoc)eval("data="+data.xmlDoc.responseText+";");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(data){this._parsing=true;if (data.xmlDoc)data=data.xmlDoc.responseText;data=data.replace(/\r/g,"");data=data.split(this.csv.row);if (this._csvHdr){this.clearAll();var thead=data.splice(0,1)[0].split(this.csv.cell);if (!this._csvAID)thead.splice(0,1);this.setHeader(thead.join(this.delim));this.init();};for (var i = 0;i < data.length;i++){if (!data[i] && i==data.length-1)continue;if (this._csvAID){var id = i+1;this.rowsBuffer.push({idd: id,
 data: data[i],
 _parser: this._process_csv_row,
 _locator: this._get_csv_data
 });}else {var temp = data[i].split(this.csv.cell);var id = temp.splice(0,1)[0];this.rowsBuffer.push({idd: id,
 data: temp,
 _parser: this._process_jsarray_row,
 _locator: this._get_jsarray_data
 });};this.rowsAr[id]=data[i];};this.render_dataset();this._parsing=false;},
 
 _process_json:function(data){this._parsing=true;if (data&&data.xmlDoc)eval("data="+data.xmlDoc.responseText+";");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[i];};this.render_dataset();this._parsing=false;},

 render_dataset:function(min, max){if (this._srnd){if (this._fillers)return this._update_srnd_view();max=Math.min((this._get_view_size()+(this._srnd_pr||0)), this.rowsBuffer.length);};if (this.pagingOn){min=Math.max((min||0),(this.currentPage-1)*this.rowsBufferOutSize);max=Math.min(this.currentPage*this.rowsBufferOutSize, this.rowsBuffer.length)
 }else {min=min||0;max=max||this.rowsBuffer.length;};for (var i = min;i < max;i++){var r = this.render_row(i)
 
 if (r == -1){if (this.xmlFileUrl){if (this.callEvent("onDynXLS",[i,(this._dpref?this._dpref:(max-i))]))
 this.load(this.xmlFileUrl+getUrlSymbol(this.xmlFileUrl)+"posStart="+i+"&count="+(this._dpref?this._dpref:(max-i)), this._data_type);};max=i;break;};if (!r.parentNode||!r.parentNode.tagName){this._insertRowAt(r, i);if (r._attrs["selected"] || r._attrs["select"]){this.selectRow(r,r._attrs["call"]?true:false,true);r._attrs["selected"]=r._attrs["select"]=null;}};if (this._ads_count && i-min==this._ads_count){var that=this;this._context_parsing=this._context_parsing||this._parsing;return this._contextCallTimer=window.setTimeout(function(){that._contextCallTimer=null;that.render_dataset(i,max);if (!that._contextCallTimer){if(that._context_parsing)that.callEvent("onXLE",[])
 else 
 that._fixAlterCss();that.callEvent("onDistributedEnd",[]);that._context_parsing=false;}},this._ads_time)
 }};if (this._srnd&&!this._fillers)this._fillers=[this._add_filler(max, this.rowsBuffer.length-max)];this.setSizes();},
 
 render_row:function(ind){if (!this.rowsBuffer[ind])return -1;if (this.rowsBuffer[ind]._parser){var r = this.rowsBuffer[ind];if (this.rowsAr[r.idd] && this.rowsAr[r.idd].tagName=="TR")return this.rowsBuffer[ind]=this.rowsAr[r.idd];var row = this._prepareRow(r.idd);this.rowsBuffer[ind]=row;this.rowsAr[r.idd]=row;r._parser.call(this, row, r.data);this._postRowProcessing(row);return row;};return this.rowsBuffer[ind];},
 
 
 _get_cell_value:function(row, ind, method){if (row._locator){if (this._c_order)ind=this._c_order[ind];return row._locator.call(this, row.data, ind);};return this.cells3(row, ind)[method ? method : "getValue"]();},

 
 sortRows:function(col, type, order){order=(order||"asc").toLowerCase();type=(type||this.fldSort[col]);col=col||0;if (this.isTreeGrid())
 this.sortTreeRows(col, type, order);else{var arrTS = {};var atype = this.cellType[col];var amet = "getValue";if (atype == "link")amet="getContent";if (atype == "dhxCalendar"||atype == "dhxCalendarA")amet="getDate";for (var i = 0;i < this.rowsBuffer.length;i++)arrTS[this.rowsBuffer[i].idd]=this._get_cell_value(this.rowsBuffer[i], col, amet);this._sortRows(col, type, order, arrTS);};this.callEvent("onAfterSorting", [col,type,order]);},
 
 _sortCore:function(col, type, order, arrTS, s){var sort = "sort";if (this._sst){s["stablesort"]=this.rowsCol.stablesort;sort="stablesort";};if (type.length > 4)type=window[type];if (type == 'cus'){var cstr=this._customSorts[col];s[sort](function(a, b){return cstr(arrTS[a.idd], arrTS[b.idd], order, a.idd, b.idd);});}else if (typeof (type)== 'function'){s[sort](function(a, b){return type(arrTS[a.idd], arrTS[b.idd], order, a.idd, b.idd);});}else


 if (type == 'str'){s[sort](function(a, b){if (order == "asc")return arrTS[a.idd] > arrTS[b.idd] ? 1 : -1
 else
 return arrTS[a.idd] < arrTS[b.idd] ? 1 : -1
 });}else if (type == 'int'){s[sort](function(a, b){var aVal = parseFloat(arrTS[a.idd]);aVal=isNaN(aVal) ? -99999999999999 : aVal;var bVal = parseFloat(arrTS[b.idd]);bVal=isNaN(bVal) ? -99999999999999 : bVal;if (order == "asc")return aVal-bVal;else
 return bVal-aVal;});}else if (type == 'date'){s[sort](function(a, b){var aVal = Date.parse(arrTS[a.idd])||(Date.parse("01/01/1900"));var bVal = Date.parse(arrTS[b.idd])||(Date.parse("01/01/1900"));if (order == "asc")return aVal-bVal
 else
 return bVal-aVal
 });}},
 
 _sortRows:function(col, type, order, arrTS){this._sortCore(col, type, order, arrTS, this.rowsBuffer);this._reset_view();this.callEvent("onGridReconstructed", []);},

 _reset_view:function(skip){if (!this.obj.rows[0])return;var tb = this.obj.rows[0].parentNode;var tr = tb.removeChild(tb.childNodes[0], true)
 if (_isKHTML)for (var i = tb.parentNode.childNodes.length-1;i >= 0;i--){if (tb.parentNode.childNodes[i].tagName=="TR")tb.parentNode.removeChild(tb.parentNode.childNodes[i],true);}else if (_isIE)for (var i = tb.childNodes.length-1;i >= 0;i--)tb.childNodes[i].removeNode(true);else
 tb.innerHTML="";tb.appendChild(tr)
 this.rowsCol=dhtmlxArray();if (this._sst)this.enableStableSorting(true);this._fillers=this.undefined;if (!skip){if (_isIE && this._srnd){this.render_dataset();}else
 this.render_dataset();}},
 
 
 deleteRow:function(row_id, node){if (!node)node=this.getRowById(row_id)
 
 if (!node)return;this.editStop();if (!this._realfake)if (this.callEvent("onBeforeRowDeleted", [row_id])== false)
 return false;var pid=0;if (this.cellType._dhx_find("tree")!= -1 && !this._realfake){pid=this._h2.get[row_id].parent.id;this._removeTrGrRow(node);}else {if (node.parentNode)node.parentNode.removeChild(node);var ind = this.rowsCol._dhx_find(node);if (ind != -1)this.rowsCol._dhx_removeAt(ind);for (var i = 0;i < this.rowsBuffer.length;i++)if (this.rowsBuffer[i]&&this.rowsBuffer[i].idd == row_id){this.rowsBuffer._dhx_removeAt(i);ind=i;break;}};this.rowsAr[row_id]=null;for (var i = 0;i < this.selectedRows.length;i++)if (this.selectedRows[i].idd == row_id)this.selectedRows._dhx_removeAt(i);if (this._srnd){for (var i = 0;i < this._fillers.length;i++){var f = this._fillers[i]
 if (!f)continue;if (f[0] >= ind)f[0]=f[0]-1;else if (f[1] >= ind)f[1]=f[1]-1;};this._update_srnd_view();};if (this.pagingOn)this.changePage();if (!this._realfake)this.callEvent("onAfterRowDeleted", [row_id,pid]);this.callEvent("onGridReconstructed", []);if (this._ahgr)this.setSizes();return true;},
 
 _addRow:function(new_id, text, ind){if (ind == -1|| typeof ind == "undefined")ind=this.rowsBuffer.length;if (typeof text == "string")text=text.split(this.delim);var row = this._prepareRow(new_id);row._attrs={};for (var j = 0;j < row.childNodes.length;j++)row.childNodes[j]._attrs={};this.rowsAr[row.idd]=row;if (this._h2)this._h2.get[row.idd].buff=row;this._fillRow(row, text)
 this._postRowProcessing(row)
 if (this._skipInsert){this._skipInsert=false;return this.rowsAr[row.idd]=row;};if (this.pagingOn){this.rowsBuffer._dhx_insertAt(ind,row);this.rowsAr[row.idd]=row;return row;};if (this._fillers){this.rowsCol._dhx_insertAt(ind, null);this.rowsBuffer._dhx_insertAt(ind,row);if (this._fake)this._fake.rowsCol._dhx_insertAt(ind, null);this.rowsAr[row.idd]=row;var found = false;for (var i = 0;i < this._fillers.length;i++){var f = this._fillers[i];if (f&&f[0] <= ind&&(f[0]+f[1])>= ind){f[1]=f[1]+1;f[2].firstChild.style.height=parseInt(f[2].firstChild.style.height)+this._srdh+"px";found=true;if (this._fake)this._fake._fillers[i][1]++;};if (f&&f[0] > ind){f[0]=f[0]+1
 if (this._fake)this._fake._fillers[i][0]++;}};if (!found)this._fillers.push(this._add_filler(ind, 1, (ind == 0 ? {parentNode: this.obj.rows[0].parentNode,
 nextSibling: (this.rowsCol[1])
 }: this.rowsCol[ind-1])));return row;};this.rowsBuffer._dhx_insertAt(ind,row);return this._insertRowAt(row, ind);},
 
 
 addRow:function(new_id, text, ind){var r = this._addRow(new_id, text, ind);if (!this.dragContext)this.callEvent("onRowAdded", [new_id]);if (this.pagingOn)this.changePage(this.currentPage)
 
 if (this._srnd)this._update_srnd_view();r._added=true;if (this._ahgr)this.setSizes();this.callEvent("onGridReconstructed", []);return r;},
 
 _insertRowAt:function(r, ind, skip){this.rowsAr[r.idd]=r;if (this._skipInsert){this._skipInsert=false;return r;};if ((ind < 0)||((!ind)&&(parseInt(ind) !== 0)))
 ind=this.rowsCol.length;else {if (ind > this.rowsCol.length)ind=this.rowsCol.length;};if (this._cssEven){if ((this._cssSP ? this.getLevel(r.idd): ind)%2 == 1)
 r.className+=" "+this._cssUnEven+(this._cssSU ? (" "+this._cssUnEven+"_"+this.getLevel(r.idd)) : "");else
 r.className+=" "+this._cssEven+(this._cssSU ? (" "+this._cssEven+"_"+this.getLevel(r.idd)) : "");};if (!skip)if ((ind == (this.obj.rows.length-1))||(!this.rowsCol[ind]))
 if (_isKHTML)this.obj.appendChild(r);else {this.obj.firstChild.appendChild(r);}else {this.rowsCol[ind].parentNode.insertBefore(r, this.rowsCol[ind]);};this.rowsCol._dhx_insertAt(ind, r);return r;},
 
 getRowById:function(id){var row = this.rowsAr[id];if (row){if (row.tagName != "TR"){for (var i = 0;i < this.rowsBuffer.length;i++)if (this.rowsBuffer[i] && this.rowsBuffer[i].idd == id)return this.render_row(i);if (this._h2)return this.render_row(null,row.idd);};return row;};return null;},
 

 cellById:function(row_id, col){return this.cells(row_id, col);},

 cells:function(row_id, col){if (arguments.length == 0)return this.cells4(this.cell);else
 var c = this.getRowById(row_id);var cell = (c._childIndexes ? c.childNodes[c._childIndexes[col]] : c.childNodes[col]);return this.cells4(cell);},
 
 cellByIndex:function(row_index, col){return this.cells2(row_index, col);},
 
 cells2:function(row_index, col){var c = this.render_row(row_index);var cell = (c._childIndexes ? c.childNodes[c._childIndexes[col]] : c.childNodes[col]);return this.cells4(cell);},
 
 cells3:function(row, col){var cell = (row._childIndexes ? row.childNodes[row._childIndexes[col]] : row.childNodes[col]);return this.cells4(cell);},
 
 cells4:function(cell){var type = window["eXcell_"+(cell._cellType||this.cellType[cell._cellIndex])];if (type)return new type(cell);}, 
 cells5:function(cell, type){var type = type||(cell._cellType||this.cellType[cell._cellIndex]);if (!this._ecache[type]){if (!window["eXcell_"+type])var tex = eXcell_ro;else
 var tex = window["eXcell_"+type];this._ecache[type]=new tex(cell);};this._ecache[type].cell=cell;return this._ecache[type];},
 dma:function(mode){if (!this._ecache)this._ecache={};if (mode&&!this._dma){this._dma=this.cells4;this.cells4=this.cells5;}else if (!mode&&this._dma){this.cells4=this._dma;this._dma=null;}},
 
 
 getRowsNum:function(){return this.rowsBuffer.length;},
 
 
 
 enableEditTabOnly:function(mode){if (arguments.length > 0)this.smartTabOrder=convertStringToBoolean(mode);else
 this.smartTabOrder=true;},
 
 setExternalTabOrder:function(start, end){var grid = this;this.tabStart=( typeof (start) == "object") ? start : document.getElementById(start);this.tabStart.onkeydown=function(e){var ev = (e||window.event);if (ev.keyCode == 9){ev.cancelBubble=true;grid.selectCell(0, 0, 0, 0, 1);if (grid.smartTabOrder && grid.cells2(0, 0).isDisabled()){grid._key_events["k9_0_0"].call(grid);};this.blur();return false;}};if(_isOpera)this.tabStart.onkeypress = this.tabStart.onkeydown;this.tabEnd=( typeof (end) == "object") ? end : document.getElementById(end);this.tabEnd.onkeydown=this.tabEnd.onkeypress=function(e){var ev = (e||window.event);if ((ev.keyCode == 9)&&ev.shiftKey){ev.cancelBubble=true;grid.selectCell((grid.getRowsNum()-1), (grid.getColumnCount()-1), 0, 0, 1);if (grid.smartTabOrder && grid.cells2((grid.getRowsNum()-1), (grid.getColumnCount()-1)).isDisabled()){grid._key_events["k9_0_1"].call(grid);};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 t=this._pgn_skin;this._pgn_skin=null;this.clearAll();this._pgn_skin=t;this.load.apply(this,arguments);},
 
 getStateOfView:function(){if (this.pagingOn){var start = (this.currentPage-1)*this.rowsBufferOutSize;return [this.currentPage, start, Math.min(start+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 direct_set(name,value){this[name]=value;};function direct_call(name,value){this[name].call(this,value);};function joined_call(name,value){this[name].call(this,value.join(this.delim));};function set_options(name,value){for (var i=0;i < value.length;i++)if (typeof value[i] == "object"){var combo = this.getCombo(i);for (var key in value[i])combo.put(key, value[i][key]);}};function header_set(name,value,obj){var rows = 1;var header = [];function add(i,j,value){if (!header[j])header[j]=[];if (typeof value == "object")value.toString=function(){return this.text;};header[j][i]=value;};for (var i=0;i<value.length;i++){if (typeof(value[i])=="object" && value[i].length){for (var j=0;j < value[i].length;j++)add(i,j,value[i][j]);}else
 add(i,0,value[i]);};for (var i=0;i<header.length;i++)for (var j=0;j<header[0].length;j++){var h=header[i][j];header[i][j]=(h||"").toString()||"&nbsp;";if (h&&h.colspan)for (var k=1;k < h.colspan;k++)add(j+k,i,"#cspan");if (h&&h.rowspan)for (var k=1;k < h.rowspan;k++)add(j,i+k,"#rspan");};this.setHeader(header[0]);for (var i=1;i < header.length;i++)this.attachHeader(header[i]);};var columns_map=[
 {name:"label", def:"&nbsp;", operation:"setHeader", type:header_set },
 {name:"id", def:"", operation:"columnIds", type:direct_set },
 {name:"width", def:"*", operation:"setInitWidths", type:joined_call },
 {name:"align", def:"left", operation:"cellAlign", type:direct_set },
 {name:"valign", def:"middle", operation:"cellVAlign", type:direct_set },
 {name:"sort", def:"na", operation:"fldSort", type:direct_set },
 {name:"type", def:"ro", operation:"setColTypes", type:joined_call },
 {name:"options",def:"", operation:"", type:set_options }];dhtmlx.extend_api("dhtmlXGridObject",{_init:function(obj){return [obj.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(obj){for (var j=0;j<columns_map.length;j++){var settings = [];for (var i=0;i<obj.length;i++)settings[i]=obj[i][columns_map[j].name]||columns_map[j].def;var type=columns_map[j].type||direct_call;type.call(this,columns_map[j].operation,settings,obj);};this.init();},
 rows:function(obj){},
 headers:function(obj){for (var i=0;i < obj.length;i++)this.attachHeader(obj[i]);}});})();dhtmlXGridObject.prototype._dp_init=function(dp){dp.attachEvent("insertCallback", function(upd, id) {if (this.obj._h2)this.obj.addRow(id, row, null, parent);else
 this.obj.addRow(id, [], 0);var row = this.obj.getRowById(id);if (row){this.obj._process_xml_row(row, upd.firstChild);this.obj._postRowProcessing(row);}});dp.attachEvent("updateCallback", function(upd, id) {var row = this.obj.getRowById(id);if (row){this.obj._process_xml_row(row, upd.firstChild);this.obj._postRowProcessing(row);}});dp.attachEvent("deleteCallback", function(upd, id) {this.obj.setUserData(id, this.action_param, "true_deleted");this.obj.deleteRow(id);});dp._methods=["setRowTextStyle","setCellTextStyle","changeRowId","deleteRow"];this.attachEvent("onEditCell",function(state,id,index){if (dp._columns && !dp._columns[index])return true;var cell = this.cells(id,index)
 if (state==1){if(cell.isCheckbox()){dp.setUpdated(id,true)
 }}else if (state==2){if(cell.wasChanged()){dp.setUpdated(id,true)
 }};return true;});this.attachEvent("onRowPaste",function(id){dp.setUpdated(id,true)
 });this.attachEvent("onRowIdChange",function(id,newid){var ind=dp.findRow(id);if (ind<dp.updatedRows.length)dp.updatedRows[ind]=newid;});this.attachEvent("onSelectStateChanged",function(rowId){if(dp.updateMode=="row")dp.sendData();return true;});this.attachEvent("onEnter",function(rowId,celInd){if(dp.updateMode=="row")dp.sendData();return true;});this.attachEvent("onBeforeRowDeleted",function(rowId){if (!this.rowsAr[rowId])return true;if (this.dragContext && dp.dnd){window.setTimeout(function(){dp.setUpdated(rowId,true);},1);return true;};var z=dp.getState(rowId);if (this._h2){this._h2.forEachChild(rowId,function(el){dp.setUpdated(el.id,false);dp.markRow(el.id,true,"deleted");},this);};if (z=="inserted"){dp.set_invalid(rowId,false);dp.setUpdated(rowId,false);return true;};if (z=="deleted")return false;if (z=="true_deleted"){dp.setUpdated(rowId,false);return true;};dp.setUpdated(rowId,true,"deleted");return false;});this.attachEvent("onRowAdded",function(rowId){if (this.dragContext && dp.dnd)return true;dp.setUpdated(rowId,true,"inserted")
 return true;});dp._getRowData=function(rowId,pref){var data = [];data["gr_id"]=rowId;if (this.obj.isTreeGrid())
 data["gr_pid"]=this.obj.getParentId(rowId);var r=this.obj.getRowById(rowId);for (var i=0;i<this.obj._cCount;i++){if (this.obj._c_order)var i_c=this.obj._c_order[i];else
 var i_c=i;var c=this.obj.cells(r.idd,i);if (this._changed && !c.wasChanged()) continue;if (this._endnm)data[this.obj.getColumnId(i)]=c.getValue();else
 data["c"+i_c]=c.getValue();};var udata=this.obj.UserData[rowId];if (udata){for (var j=0;j<udata.keys.length;j++)if (udata.keys[j].indexOf("__")!=0)
 data[udata.keys[j]]=udata.values[j];};var udata=this.obj.UserData["gridglobaluserdata"];if (udata){for (var j=0;j<udata.keys.length;j++)data[udata.keys[j]]=udata.values[j];};return data;};dp._clearUpdateFlag=function(rowId){var row=this.obj.getRowById(rowId);if (row)for (var j=0;j<this.obj._cCount;j++)this.obj.cells(rowId,j).cell.wasChanged=false;};dp.checkBeforeUpdate=function(rowId){var valid=true;var c_invalid=[];for (var i=0;i<this.obj._cCount;i++)if (this.mandatoryFields[i]){var res=this.mandatoryFields[i].call(this.obj,this.obj.cells(rowId,i).getValue(),rowId,i);if (typeof res == "string"){this.messages.push(res);valid = false;}else {valid&=res;c_invalid[i]=!res;}};if (!valid){this.set_invalid(rowId,"invalid",c_invalid);this.setUpdated(rowId,false);};return valid;}};function dhtmlXGridCellObject(obj){this.destructor=function(){this.cell.obj=null;this.cell=null;this.grid=null;this.base=null;return null;};this.cell=obj;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(val){fntAr=val.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(val){this.cell.style.color=val;};this.setBgColor=function(val){if (val == "")val=null;this.cell.bgColor=val;};this.setHorAlign=function(val){if (val.length == 1){if (val == 'c')this.cell.style.textAlign='center'

 else if (val == 'l')this.cell.style.textAlign='left';else
 this.cell.style.textAlign='right';}else
 this.cell.style.textAlign=val
 };this.wasChanged=function(){if (this.cell.wasChanged)return true;else
 return false;};this.isCheckbox=function(){var ch = this.cell.firstChild;if (ch&&ch.tagName == 'INPUT'){type=ch.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(fl){if (this.isCheckbox()){if (fl != 'true'&&fl != 1)fl=false;this.cell.firstChild.checked=fl;}};this.setDisabled=function(fl){if (fl != 'true'&&fl != 1)fl=false;if (this.isCheckbox()){this.cell.firstChild.disabled=fl;if (this.disabledF)this.disabledF(fl);};this.cell._disabled=fl;}};dhtmlXGridCellObject.prototype={getAttribute: function(name){return this.cell._attrs[name];},
 setAttribute: function(name, value){this.cell._attrs[name]=value;},
 getInput:function(){if (this.obj && (this.obj.tagName=="INPUT" || this.obj.tagName=="TEXTAREA")) return this.obj;var inps=(this.obj||this.cell).getElementsByTagName("TEXTAREA");if (!inps.length)inps=(this.obj||this.cell).getElementsByTagName("INPUT");return inps[0];}};dhtmlXGridCellObject.prototype.setValue=function(val){if (( typeof (val)!= "number")&&(!val||val.toString()._dhx_trim() == "")){val="&nbsp;"
 this.cell._clearCell=true;}else
 this.cell._clearCell=false;this.setCValue(val);};dhtmlXGridCellObject.prototype.getTitle=function(){return (_isIE ? this.cell.innerText : this.cell.textContent);};dhtmlXGridCellObject.prototype.setCValue=function(val, val2){this.cell.innerHTML=val;this.grid.callEvent("onCellChanged", [
 this.cell.parentNode.idd,
 this.cell._cellIndex,
 (arguments.length > 1 ? val2 : val)
 ]);};dhtmlXGridCellObject.prototype.setCTxtValue=function(val){this.cell.innerHTML="";this.cell.appendChild(document.createTextNode(val));this.grid.callEvent("onCellChanged", [
 this.cell.parentNode.idd,
 this.cell._cellIndex,
 val
 ]);};dhtmlXGridCellObject.prototype.setLabel=function(val){this.cell.innerHTML=val;};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(oNode){var oCurrentNode = oNode;var iLeft = 0;var iTop = 0;while (oCurrentNode.tagName != "BODY"){iLeft+=oCurrentNode.offsetLeft;iTop+=oCurrentNode.offsetTop;oCurrentNode=oCurrentNode.offsetParent;};return new Array(iLeft, iTop);}};eXcell.prototype=new dhtmlXGridCellObject;function eXcell_ed(cell){if (cell){this.cell=cell;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(e){(e||event).cancelBubble=true
 };this.obj.onmousedown=function(e){(e||event).cancelBubble=true
 };this.obj.value=this.val
 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(e){if (!e)e=event;e.cancelBubble=true;return true;};if (_isIE)this.obj.focus();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(cell){if (cell){this.cell=cell;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(val){if (!val||val.toString()._dhx_trim() == ""){val=" ";this.cell._clearCell=true;}else
 this.cell._clearCell=false;this.setCTxtValue(val);}};eXcell_edtxt.prototype=new eXcell_ed;function eXcell_edn(cell){if (cell){this.cell=cell;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.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(), this.cell._cellIndex);};this.detach=function(){var tv = this.obj.value;this.setValue(tv);return this.val != this.getValue();}};eXcell_edn.prototype=new eXcell_ed;eXcell_edn.prototype.setValue=function(val){if (!val||val.toString()._dhx_trim() == ""){this.cell._clearCell=true;return this.setCValue("&nbsp;",0);}else
 this.cell._clearCell=false;this.setCValue(this.grid._aplNF(val, this.cell._cellIndex));};function eXcell_ch(cell){if (cell){this.cell=cell;this.grid=this.cell.parentNode.grid;};this.disabledF=function(fl){if ((fl == true)||(fl == 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(){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(fl){this.setValue(fl.toString())
 };this.detach=function(){return this.val != this.getValue();};this.edit=null;};eXcell_ch.prototype=new eXcell;eXcell_ch.prototype.setValue=function(val){this.cell.style.verticalAlign="middle";if (val){val=val.toString()._dhx_trim();if ((val == "false")||(val == "0"))
 val="";};if (val){val="1";this.cell.chstate="1";}else {val="0";this.cell.chstate="0"
 };var obj = this;this.setCValue("<img src='"+this.grid.imgURL+"item_chk"+val
 +".gif' onclick='new eXcell_ch(this.parentNode).changeState();(arguments[0]||event).cancelBubble=true;'>",
 this.cell.chstate);};function eXcell_ra(cell){this.base=eXcell_ch;this.base(cell)
 this.grid=cell.parentNode.grid;this.disabledF=function(fl){if ((fl == true)||(fl == 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(mode){if (mode===false && this.getValue()==1) return;if ((!this.grid.isEditable)||(this.cell.parentNode._locked))
 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(val){this.cell.style.verticalAlign="middle";if (val){val=val.toString()._dhx_trim();if ((val == "false")||(val == "0"))
 val="";};if (val){if (!this.grid._RaSeCol)this.grid._RaSeCol=[];if (this.grid._RaSeCol[this.cell._cellIndex]){var z = this.grid.cells4(this.grid._RaSeCol[this.cell._cellIndex]);z.setValue("0")
 if (this.grid.rowsAr[z.cell.parentNode.idd])this.grid.callEvent("onEditCell", [
 1,
 z.cell.parentNode.idd,
 z.cell._cellIndex
 ]);};this.grid._RaSeCol[this.cell._cellIndex]=this.cell;val="1";this.cell.chstate="1";}else {val="0";this.cell.chstate="0"
 };this.setCValue("<img src='"+this.grid.imgURL+"radio_chk"+val+".gif' onclick='new eXcell_ra(this.parentNode).changeState(false);'>",
 this.cell.chstate);};function eXcell_txt(cell){if (cell){this.cell=cell;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(e){(e||event).cancelBubble=true
 };var arPos = 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 z_ff = document.createElement("DIV");z_ff.appendChild(this.obj);z_ff.style.overflow="auto";z_ff.className="dhx_textarea";this.obj.style.margin="0px 0px 0px 0px";this.obj.style.border="0px";this.obj=z_ff;};document.body.appendChild(this.obj);if(_isOpera)this.obj.onkeypress=function(ev){if (ev.keyCode == 9)return false;};this.obj.onkeydown=function(e){var ev = (e||event);if (ev.keyCode == 9){globalActiveDHTMLGridObject.entBox.focus();globalActiveDHTMLGridObject.doKey({keyCode: ev.keyCode,
 shiftKey: ev.shiftKey,
 srcElement: "0"
 });return false;}};this.obj.style.left=arPos[0]+"px";this.obj.style.top=arPos[1]+this.cell.offsetHeight+"px";if (this.cell.offsetWidth < 200)var pw = 200;else
 var pw = this.cell.offsetWidth;this.obj.style.width=pw+(_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 a_val = "";if (_isFF)a_val=this.obj.firstChild.value;else
 a_val=this.obj.value;if (a_val == ""){this.cell._clearCell=true;}else
 this.cell._clearCell=false;this.setValue(a_val);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 ((!this.grid.multiLine))
 return this.cell._brval||this.cell.innerHTML;else
 return this.cell.innerHTML.replace(/<br[^>]*>/gi, "\n")._dhx_trim();}};eXcell_txt.prototype=new eXcell;function eXcell_txttxt(cell){if (cell){this.cell=cell;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(val){this.cell._brval=val;if (!val||val.toString()._dhx_trim() == "")
 val=" ";this.setCTxtValue(val);}};eXcell_txttxt.prototype=new eXcell_txt;eXcell_txt.prototype.setValue=function(val){if (!val||val.toString()._dhx_trim() == ""){val="&nbsp;"
 this.cell._clearCell=true;}else
 this.cell._clearCell=false;this.cell._brval=val;if ((!this.grid.multiLine))
 this.setCValue(val, val);else
 this.setCValue(val.replace(/\n/g, "<br/>"), val);};function eXcell_co(cell){if (cell){this.cell=cell;this.grid=this.cell.parentNode.grid;this.combo=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex));this.editable=true
 };this.shiftNext=function(){var z = this.list.options[this.list.selectedIndex+1];if (z)z.selected=true;this.obj.value=this.list.options[this.list.selectedIndex].text;return true;};this.shiftPrev=function(){if (this.list.selectedIndex != 0){var z = this.list.options[this.list.selectedIndex-1];if (z)z.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 arPos = 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(e){(e||event).cancelBubble=true
 };this.obj.value=this.text
 this.obj.onselectstart=function(e){if (!e)e=event;e.cancelBubble=true;return true;};var editor_obj = this;this.obj.onkeyup=function(e){var key=(e||event).keyCode;if (key==38 || key==40 || key==9)return;var val = this.readonly ? String.fromCharCode(key) : this.value;var c = editor_obj.list.options;for (var i = 0;i < c.length;i++)if (c[i].text.indexOf(val)== 0)
 return c[i].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=arPos[0]+"px";this.list.style.top=arPos[1]+this.cell.offsetHeight+"px";this.list.onclick=function(e){var ev = e||window.event;var cell = ev.target||ev.srcElement

 
 if (cell.tagName == "OPTION")cell=cell.parentNode;editor_obj.editable=false;editor_obj.grid.editStop();};var comboKeys = this.combo.getKeys();var fl = false
 var selOptId = 0;for (var i = 0;i < comboKeys.length;i++){var val = this.combo.get(comboKeys[i])
 this.list.options[this.list.options.length]=new Option(val, comboKeys[i]);if (comboKeys[i] == this.val){selOptId=this.list.options.length-1;fl=true;}};if (fl == false){this.list.options[this.list.options.length]=new Option(this.text, this.val === null ? "" : this.val);selOptId=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[selOptId].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(e){e=e||window.event;editor_obj.grid.setActive(true)

 if (e.keyCode < 30)return editor_obj.grid.doKey({target: editor_obj.cell,
 keyCode: e.keyCode,
 shiftKey: e.shiftKey,
 ctrlKey: e.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 ind = this.list.options[this.list.selectedIndex]
 if (ind&&ind.text == this.obj.value)this.setValue(this.list.value)
 else{var combo=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex));var val=combo.values._dhx_find(this.obj.value);if (val!=-1)this.setValue(combo.keys[val]);else this.setCValue(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(val){if (typeof (val)== "object"){var optCol = this.grid.xmlLoader.doXPath("./option", val);if (optCol.length)this.cell._combo=new dhtmlXGridComboObject();for (var j = 0;j < optCol.length;j++)this.cell._combo.put(optCol[j].getAttribute("value"),
 optCol[j].firstChild
 ? optCol[j].firstChild.data
 : "");val=val.firstChild.data;};if ((val||"").toString()._dhx_trim() == "")
 val=null
 this.cell.combo_value=val;if (val !== null){var label = (this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(val);this.setCValue(label===null?val:label, val);}else
 this.setCValue("&nbsp;", val);};function eXcell_coro(cell){this.base=eXcell_co;this.base(cell)
 this.editable=false;};eXcell_coro.prototype=new eXcell_co;function eXcell_cotxt(cell){this.base=eXcell_co;this.base(cell)
};eXcell_cotxt.prototype=new eXcell_co;eXcell_cotxt.prototype.getText=function(){return (_isIE ? this.cell.innerText : this.cell.textContent);};eXcell_cotxt.prototype.setValue=function(val){if (typeof (val)== "object"){var optCol = this.grid.xmlLoader.doXPath("./option", val);if (optCol.length)this.cell._combo=new dhtmlXGridComboObject();for (var j = 0;j < optCol.length;j++)this.cell._combo.put(optCol[j].getAttribute("value"),
 optCol[j].firstChild
 ? optCol[j].firstChild.data
 : "");val=val.firstChild.data;};if ((val||"").toString()._dhx_trim() == "")
 val=null

 if (val !== null)this.setCTxtValue((this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(val)||val, val);else
 this.setCTxtValue(" ", val);this.cell.combo_value=val;};function eXcell_corotxt(cell){this.base=eXcell_co;this.base(cell)
 this.editable=false;};eXcell_corotxt.prototype=new eXcell_cotxt;function eXcell_cp(cell){try{this.cell=cell;this.grid=this.cell.parentNode.grid;}catch (er){};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 arPos = this.grid.getPosition(this.cell);this.colorPanel(4, this.obj)
 document.body.appendChild(this.obj);this.obj.style.left=arPos[0]+"px";this.obj.style.top=arPos[1]+this.cell.offsetHeight+"px";};this.toolDNum=function(value){if (value.length == 1)value='0'+value;return value;};this.colorPanel=function(index, parent){var tbl = document.createElement("TABLE");parent.appendChild(tbl)
 tbl.cellSpacing=0;tbl.editor_obj=this;tbl.style.cursor="default";tbl.onclick=function(e){var ev = e||window.event
 var cell = ev.target||ev.srcElement;var ed = cell.parentNode.parentNode.parentNode.editor_obj
 ed.setValue(cell._bg)
 ed.grid.editStop();};var cnt = 256 / index;for (var j = 0;j <= (256 / cnt);j++){var r = tbl.insertRow(j);for (var i = 0;i <= (256 / cnt);i++){for (var n = 0;n <= (256 / cnt);n++){R=new Number(cnt*j)-(j == 0 ? 0 : 1)
 G=new Number(cnt*i)-(i == 0 ? 0 : 1)
 B=new Number(cnt*n)-(n == 0 ? 0 : 1)
 var rgb =
 this.toolDNum(R.toString(16))+""+this.toolDNum(G.toString(16))+""+this.toolDNum(B.toString(16));var c = r.insertCell(i);c.width="10px";c.innerHTML="&nbsp;";c.title=rgb.toUpperCase()
 c.style.backgroundColor="#"+rgb
 c._bg="#"+rgb;if (this.val != null&&"#"+rgb.toUpperCase()== this.val.toUpperCase()){c.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(val){this.setCValue("<div style='width:100%;height:"+((this.grid.multiLine?this.cell.offsetHeight-2:16))+";background-color:"+(val||"")
 +";border:0px;'>&nbsp;</div>",
 val);this.cell.firstChild._bg=val;};function eXcell_img(cell){try{this.cell=cell;this.grid=this.cell.parentNode.grid;}catch (er){};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 out = this.cell.firstChild.firstChild.src+(this.cell.titFl != null ? "^"+this.cell._brval : "");out+="^"+this.cell.lnk;if (this.cell.trg)out+="^"+this.cell.trg
 return out;}};this.isDisabled=function(){return true;}};eXcell_img.prototype=new eXcell;eXcell_img.prototype.getTitle=function(){return this.cell._brval
};eXcell_img.prototype.setValue=function(val){var title = val;if (val.indexOf("^")!= -1){var ar = val.split("^");val=ar[0]
 title=this.cell._attrs.title||ar[1];if (ar.length > 2){this.cell.lnk=ar[2]

 if (ar[3])this.cell.trg=ar[3]
 };this.cell.titFl="1";};this.setCValue("<img src='"+this.grid.iconURL+(val||"")._dhx_trim()+"' border='0'>", val);if (this.cell.lnk){this.cell.innerHTML="<a href='"+this.cell.lnk+"' target='"+this.cell.trg+"'>"+this.cell.innerHTML+"</a>"
 };this.cell._brval=title;};function eXcell_price(cell){this.base=eXcell_ed;this.base(cell)
 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(val){if (isNaN(parseFloat(val))){val=this.val||0;};var color = "green";if (val < 0)color="red";this.setCValue("<span>$</span><span style='padding-right:2px;color:"+color+";'>"+val+"</span>", val);};function eXcell_dyn(cell){this.base=eXcell_ed;this.base(cell)
 this.getValue=function(){return this.cell.firstChild.childNodes[1].innerHTML.toString()._dhx_trim()
 }};eXcell_dyn.prototype=new eXcell_ed;eXcell_dyn.prototype.setValue=function(val){if (!val||isNaN(Number(val))){if (val!=="")val=0;};if (val > 0){var color = "green";var img = "dyn_up.gif";}else if (val == 0){var color = "black";var img = "dyn_.gif";}else {var color = "red";var img = "dyn_down.gif";};this.setCValue("<div style='position:relative;padding-right:2px;width:100%;overflow:hidden;white-space:nowrap;'><img src='"+this.grid.imgURL+""+img
 +"' height='15' style='position:absolute;top:0px;left:0px;'><span style=' padding-left:20px;width:100%;color:"+color+";'>"+val
 +"</span></div>",
 val);};function eXcell_ro(cell){if (cell){this.cell=cell;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(cell){this.cell=cell;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);}};eXcell_ron.prototype=new eXcell;eXcell_ron.prototype.setValue=function(val){if (val === 0){}else if (!val||val.toString()._dhx_trim() == ""){this.setCValue("&nbsp;");return this.cell._clearCell=true;};this.cell._clearCell=false;this.setCValue(val?this.grid._aplNF(val, this.cell._cellIndex):"0");};function eXcell_rotxt(cell){this.cell=cell;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return true;};this.setValue=function(val){if (!val||val.toString()._dhx_trim() == ""){val=" ";this.cell._clearCell = true;}else
 this.cell._clearCell = false;this.setCTxtValue(val);};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(key, value){for (var i = 0;i < this.keys.length;i++){if (this.keys[i] == key){this.values[i]=value;return true;}};this.values[this.values.length]=value;this.keys[this.keys.length]=key;};this.get=function(key){for (var i = 0;i < this.keys.length;i++){if (this.keys[i] == key){return this.values[i];}};return null;};this.clear=function(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray();};this.remove=function(key){for (var i = 0;i < this.keys.length;i++){if (this.keys[i] == key){this.keys._dhx_removeAt(i);this.values._dhx_removeAt(i);return true;}}};this.size=function(){var j = 0;for (var i = 0;i < this.keys.length;i++){if (this.keys[i] != null)j++;};return j;};this.getKeys=function(){var keyAr = new Array(0);for (var i = 0;i < this.keys.length;i++){if (this.keys[i] != null)keyAr[keyAr.length]=this.keys[i];};return keyAr;};this.save=function(){this._save=new Array();for (var i = 0;i < this.keys.length;i++)this._save[i]=[
 this.keys[i],
 this.values[i]
 ];};this.restore=function(){if (this._save){this.keys[i]=new Array();this.values[i]=new Array();for (var i = 0;i < this._save.length;i++){this.keys[i]=this._save[i][0];this.values[i]=this._save[i][1];}}};return this;};function Hashtable(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray();return this;};Hashtable.prototype=new dhtmlXGridComboObject;dhtmlXGridObject.prototype._process_json_row=function(r, data){r._attrs=data;for (var j = 0;j < r.childNodes.length;j++)r.childNodes[j]._attrs={};if (data.userdata)for (var a in data.userdata)this.setUserData(r.idd,a,data.userdata[a])
 
 for (var i=0;i<data.data.length;i++)if (typeof data.data[i] == "object"){r.childNodes[i]._attrs=data.data[i];if (data.data[i].type)r.childNodes[i]._cellType=data.data[i].type;data.data[i]=data.data[i].value;};this._fillRow(r, (this._c_order ? this._swapColumns(data.data) : data.data));return r;};dhtmlXGridObject.prototype._process_json=function(data){this._parsing=true;try {if (data&&data.xmlDoc)eval("data="+data.xmlDoc.responseText+";");else if (typeof data == "string")eval("data="+data+";");}catch(e){dhtmlxError.throwError("LoadXML", "Incorrect JSON", [
 (data.xmlDoc||data),
 this
 ]);data = {rows:[]}};var cr = parseInt(data.pos||0);var total = parseInt(data.total_count||0);if (total&&!this.rowsBuffer[total-1])this.rowsBuffer[total-1]=null;if (this.isTreeGrid())
 return this._process_tree_json(data);for (var i = 0;i < data.rows.length;i++){if (this.rowsBuffer[i+cr])continue;var id = data.rows[i].id;this.rowsBuffer[i+cr]={idd: id,
 data: data.rows[i],
 _parser: this._process_json_row,
 _locator: this._get_json_data
 };this.rowsAr[id]=data[i];};this.render_dataset();this._parsing=false;};dhtmlXGridObject.prototype._process_tree_json=function(data,top,pid){this._parsing=true;var main=false;if (!top){this.render_row=this.render_row_tree;main=true;top=data;pid=top.parent||0;if (pid=="0")pid=0;if (!this._h2)this._h2=new dhtmlxHierarchy();if (this._fake)this._fake._h2=this._h2;};if (top.rows)for (var i = 0;i < top.rows.length;i++){var id = top.rows[i].id;var row=this._h2.add(id,pid);row.buff={idd:id, data:top.rows[i], _parser: this._process_json_row, _locator:this._get_json_data };if (top.rows[i].open)row.state="minus";this.rowsAr[id]=row.buff;this._process_tree_json(top.rows[i],top.rows[i],id);};if (main){if (pid!=0)this._h2.change(pid,"state","minus")
 this._updateTGRState(this._h2.get[pid]);this._h2_to_buff();this.render_dataset();if (this._slowParse===false){this.forEachRow(function(id){this.render_row_tree(0,id)
 })
 };this._parsing=false;}};dhtmlXGridObject.prototype.filterBy=function(column, value, preserve){if (this.isTreeGrid()) return this.filterTreeBy(column, value, preserve);if (this._f_rowsBuffer){if (!preserve){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 d=true;this.dma(true)
 if (typeof(column)=="object")
 for (var j=0;j<value.length;j++)this._filterA(column[j],value[j]);else
 this._filterA(column,value);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(column,value){if (value=="")return;var d=true;if (typeof(value)=="function") d=false;else value=(value||"").toString().toLowerCase();if (!this.rowsBuffer.length)return;for (var i=this.rowsBuffer.length-1;i>=0;i--)if (d?(this._get_cell_value(this.rowsBuffer[i],column).toString().toLowerCase().indexOf(value)==-1):(!value(this._get_cell_value(this.rowsBuffer[i],column),this.rowsBuffer[i].idd)))
 this.rowsBuffer.splice(i,1);};dhtmlXGridObject.prototype.getFilterElement=function(index){if (!this.filters)return;for (var i=0;i < this.filters.length;i++){if (this.filters[i][1]==index)return (this.filters[i][0].combo||this.filters[i][0]);};return null;};dhtmlXGridObject.prototype.collectValues=function(column){var value=this.callEvent("onCollectValues",[column]);if (value!==true)return value;if (this.isTreeGrid()) return this.collectTreeValues(column);this.dma(true)
 column=this._m_order?this._m_order[column]:column;var c={};var f=[];this._build_m_order();var col=this._f_rowsBuffer||this.rowsBuffer;for (var i=0;i<col.length;i++){var val=this._get_cell_value(col[i],column);if (val && (!col[i]._childIndexes || col[i]._childIndexes[column]!=col[i]._childIndexes[column-1])) c[val]=true;};this.dma(false)
 
 var vals=this.combos[column];for (d in c)if (c[d]===true)f.push(vals?(vals.get(d)||d):d);return f.sort();};dhtmlXGridObject.prototype._build_m_order=function(){if (this._c_order){this._m_order=[]
 for (var i=0;i < this._c_order.length;i++){this._m_order[this._c_order[i]]=i;}}};dhtmlXGridObject.prototype.filterByAll=function(){var a=[];var b=[];this._build_m_order();for (var i=0;i<this.filters.length;i++){var ind=this._m_order?this._m_order[this.filters[i][1]]:this.filters[i][1];b.push(ind);var val=this.filters[i][0]._filter?this.filters[i][0]._filter():this.filters[i][0].value;var vals;if (typeof val != "function" && (vals=this.combos[ind])){ind=vals.values._dhx_find(val);val=(ind==-1)?val:vals.keys[ind];};a.push(val);};if (!this.callEvent("onFilterStart",[b,a])) return;this.filterBy(b,a);if (this._cssEven)this._fixAlterCss();this.callEvent("onFilterEnd",[this.filters]);};dhtmlXGridObject.prototype.makeFilter=function(id,column,preserve){if (!this.filters)this.filters=[];if (typeof(id)!="object")
 id=document.getElementById(id);if(!id)return;var self=this;if (!id.style.width)id.style.width = "90%";if (id.tagName=='SELECT'){this.filters.push([id,column]);this._loadSelectOptins(id,column);id.onchange=function(){self.filterByAll();};if(_isIE)id.style.marginTop="1px";this.attachEvent("onEditCell",function(stage,a,ind){this._build_m_order();if (stage==2 && this.filters && ( this._m_order?(ind==this._m_order[column]):(ind==column) ))
 this._loadSelectOptins(id,column);return true;});}else if (id.tagName=='INPUT'){this.filters.push([id,column]);id.value='';id.onkeydown=function(){if (this._timer)window.clearTimeout(this._timer);this._timer=window.setTimeout(function(){if (id.value != id.old_value){self.filterByAll();id.old_value=id.value;}},500);}}else if (id.tagName=='DIV' && id.className=="combo"){this.filters.push([id,column]);id.style.padding="0px";id.style.margin="0px";if (!window.dhx_globalImgPath)window.dhx_globalImgPath=this.imgURL;var z=new dhtmlXCombo(id,"_filter","90%");z.filterSelfA=z.filterSelf;z.filterSelf=function(){if (this.getSelectedIndex()==0) this.setComboText("");this.filterSelfA.apply(this,arguments);this.optionsArr[0].hide(false);};z.enableFilteringMode(true);id.combo=z;id.value="";this._loadComboOptins(id,column);z.attachEvent("onChange",function(){id.value=z.getSelectedValue();self.filterByAll();});};if (id.parentNode)id.parentNode.className+=" filter";this._filters_ready();};dhtmlXGridObject.prototype.findCell=function(value, c_ind, count){var res = new Array();value=value.toString().toLowerCase();if (typeof count != "number")count = count?1:0;if (!this.rowsBuffer.length)return res;for (var i = (c_ind||0);i < this._cCount;i++){if (this._h2)this._h2.forEachChild(0,function(el){if (count && res.length==count)return res;if (this._get_cell_value(el.buff,i).toString().toLowerCase().indexOf(value) != -1){res.push([el.id,i]);}},this)
 else
 for (var j=0;j < this.rowsBuffer.length;j++)if (this._get_cell_value(this.rowsBuffer[j],i).toString().toLowerCase().indexOf(value) != -1){res.push([this.rowsBuffer[j].idd,i]);if (count && res.length==count)return res;};if (typeof (c_ind)!= "undefined")
 return res;};return res;};dhtmlXGridObject.prototype.makeSearch=function(id,column){if (typeof(id)!="object")
 id=document.getElementById(id);if(!id)return;var self=this;if (id.tagName=='INPUT'){id.onkeypress=function(){if (this._timer)window.clearTimeout(this._timer);this._timer=window.setTimeout(function(){if (id.value=="")return;var z=self.findCell(id.value,column,true);if (z.length){if (self._h2)self.openItem(z[0][0]);self.selectCell(self.getRowIndex(z[0][0]),(column||0))
 }},500);}};if (id.parentNode)id.parentNode.className+=" filter";};dhtmlXGridObject.prototype._loadSelectOptins=function(t,c){var l=this.collectValues(c);var v=t.value;t.innerHTML="";t.options[0]=new Option("","");var f=this._filter_tr?this._filter_tr[c]:null;for (var i=0;i<l.length;i++)t.options[t.options.length]=new Option(f?f(l[i]):l[i],l[i]);t.value=v;};dhtmlXGridObject.prototype.setSelectFilterLabel=function(ind,fun){if (!this._filter_tr)this._filter_tr=[];this._filter_tr[ind]=fun;};dhtmlXGridObject.prototype._loadComboOptins=function(t,c){var l=this.collectValues(c);t.combo.clearAll();t.combo.render(false);t.combo.addOption("","&nbsp;");for (var i=0;i<l.length;i++)t.combo.addOption(l[i],l[i]);t.combo.render(true);};dhtmlXGridObject.prototype.refreshFilters=function(){if(!this.filters)return;for (var i=0;i<this.filters.length;i++){switch(this.filters[i][0].tagName.toLowerCase()){case "input":
 break;case "select":
 this._loadSelectOptins.apply(this,this.filters[i]);break;case "div":
 this._loadComboOptins.apply(this,this.filters[i]);break;}}};dhtmlXGridObject.prototype._filters_ready=function(fl,code){this.attachEvent("onXLE",this.refreshFilters);this.attachEvent("onRowCreated",function(id,r){if (this._f_rowsBuffer)for (var i=0;i<this._f_rowsBuffer.length;i++)if (this._f_rowsBuffer[i].idd == id)return this._f_rowsBuffer[i]=r;})
 this.attachEvent("onClearAll",function(){this._f_rowsBuffer=null;if (!this.hdr.rows.length)this.filters=[];});if (window.dhtmlXCombo)this.attachEvent("onScroll",dhtmlXCombo.prototype.closeAll);this._filters_ready=function(){}};dhtmlXGridObject.prototype._in_header_text_filter=function(t,i){t.innerHTML="<input type='text' style='width:90%;font-size:8pt;font-family:Tahoma;-moz-user-select:text;'>";t.onclick=t.onmousedown = function(e){(e||event).cancelBubble=true;return true;};t.onselectstart=function(){return (event.cancelBubble=true);};this.makeFilter(t.firstChild,i);};dhtmlXGridObject.prototype._in_header_text_filter_inc=function(t,i){t.innerHTML="<input type='text' style='width:90%;font-size:8pt;font-family:Tahoma;-moz-user-select:text;'>";t.onclick=t.onmousedown = function(e){(e||event).cancelBubble=true;return true;};t.onselectstart=function(){return (event.cancelBubble=true);};this.makeFilter(t.firstChild,i);t.firstChild._filter=function(){return function(val){return (val.toString().toLowerCase().indexOf(t.firstChild.value.toLowerCase())==0);}};this._filters_ready();};dhtmlXGridObject.prototype._in_header_select_filter=function(t,i){t.innerHTML="<select style='width:90%;font-size:8pt;font-family:Tahoma;'></select>";t.onclick=function(e){(e||event).cancelBubble=true;return false;};this.makeFilter(t.firstChild,i);};dhtmlXGridObject.prototype._in_header_select_filter_strict=function(t,i){t.innerHTML="<select style='width:90%;font-size:8pt;font-family:Tahoma;'></select>";t.onclick=function(e){(e||event).cancelBubble=true;return false;};this.makeFilter(t.firstChild,i);t.firstChild._filter=function(){return function(val){if (t.firstChild.value.toLowerCase()== "") return true;return (val.toString().toLowerCase()==t.firstChild.value.toLowerCase());}};this._filters_ready();};dhtmlXGridObject.prototype._in_header_combo_filter=function(t,i){t.innerHTML="<div style='width:100%;padding-left:2px;overflow:hidden;font-size:8pt;font-family:Tahoma;-moz-user-select:text;' class='combo'></div>";t.onselectstart=function(){return (event.cancelBubble=true);};t.onclick=t.onmousedown=function(e){(e||event).cancelBubble=true;return true;};this.makeFilter(t.firstChild,i);};dhtmlXGridObject.prototype._in_header_text_search=function(t,i){t.innerHTML="<input type='text' style='width:90%;font-size:8pt;font-family:Tahoma;-moz-user-select:text;'>";t.onclick= t.onmousedown = function(e){(e||event).cancelBubble=true;return true;};t.onselectstart=function(){return (event.cancelBubble=true);};this.makeSearch(t.firstChild,i);};dhtmlXGridObject.prototype._in_header_numeric_filter=function(t,i){this._in_header_text_filter.call(this,t,i);t.firstChild._filter=function(){var v=this.value;var r;var op="==";var num=parseFloat(v.replace("=",""));var num2=null;if (v){if (v.indexOf("..")!=-1){v=v.split("..");num=parseFloat(v[0]);num2=parseFloat(v[1]);return function(v){if (v>=num && v<=num2)return true;return false;}};r=v.match(/>|>=|<=|</)
 if (r){op=r[0];num=parseFloat(v.replace(op,""));};return Function("v"," if (v "+op+" "+num+" )return true;return false;");}}};dhtmlXGridObject.prototype._in_header_master_checkbox=function(t,i,c){t.innerHTML=c[0]+"<input type='checkbox' />"+c[1];var self=this;t.getElementsByTagName("input")[0].onclick=function(e){self._build_m_order();var j=self._m_order?self._m_order[i]:i;var val=this.checked?1:0;self.forEachRowA(function(id){var c=this.cells(id,j);if (c.isCheckbox()) c.setValue(val);this.callEvent("onEditCell",[1,id,j,val]);});(e||event).cancelBubble=true;}};dhtmlXGridObject.prototype._in_header_stat_total=function(t,i,c){var calck=function(){var summ=0;var ii = this._c_order?this._c_order[i]:i;for (var j=0;j<this.rowsBuffer.length;j++){var v=parseFloat(this._get_cell_value(this.rowsBuffer[j],ii));summ+=isNaN(v)?0:v;};return this._maskArr[ii]?this._aplNF(summ,ii):(Math.round(summ*100)/100);};this._stat_in_header(t,calck,i,c,c);};dhtmlXGridObject.prototype._in_header_stat_multi_total=function(t,i,c){var cols=c[1].split(":");c[1]="";for(var k = 0;k < cols.length;k++){cols[k]=parseInt(cols[k]);};var calck=function(){var summ=0;for (var j=0;j<this.rowsBuffer.length;j++){var v = 1;for(var k = 0;k < cols.length;k++){v *= parseFloat(this._get_cell_value(this.rowsBuffer[j],cols[k]))
 };summ+=isNaN(v)?0:v;};return this._maskArr[i]?this._aplNF(summ,i):(Math.round(summ*100)/100);};var track=[];for(var i = 0;i < cols.length;i++){track[cols[i]]=true;};this._stat_in_header(t,calck,track,c,c);};dhtmlXGridObject.prototype._in_header_stat_max=function(t,i,c){var calck=function(){var summ=-999999999;if (this.getRowsNum()==0) return "&nbsp;";for (var j=0;j<this.rowsBuffer.length;j++)summ=Math.max(summ,parseFloat(this._get_cell_value(this.rowsBuffer[j],i)));return this._maskArr[i]?this._aplNF(summ,i):summ;};this._stat_in_header(t,calck,i,c);};dhtmlXGridObject.prototype._in_header_stat_min=function(t,i,c){var calck=function(){var summ=999999999;if (this.getRowsNum()==0) return "&nbsp;";for (var j=0;j<this.rowsBuffer.length;j++)summ=Math.min(summ,parseFloat(this._get_cell_value(this.rowsBuffer[j],i)));return this._maskArr[i]?this._aplNF(summ,i):summ;};this._stat_in_header(t,calck,i,c);};dhtmlXGridObject.prototype._in_header_stat_average=function(t,i,c){var calck=function(){var summ=0;var count=0;if (this.getRowsNum()==0) return "&nbsp;";for (var j=0;j<this.rowsBuffer.length;j++){var v=parseFloat(this._get_cell_value(this.rowsBuffer[j],i));summ+=isNaN(v)?0:v;count++;};return this._maskArr[i]?this._aplNF(summ/count,i):(Math.round(summ/count*100)/100);};this._stat_in_header(t,calck,i,c);};dhtmlXGridObject.prototype._in_header_stat_count=function(t,i,c){var calck=function(){return this.getRowsNum();};this._stat_in_header(t,calck,i,c);};dhtmlXGridObject.prototype._stat_in_header=function(t,calck,i,c){var that=this;var f=function(){this.dma(true)
 t.innerHTML=(c[0]?c[0]:"")+calck.call(this)+(c[1]?c[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 i=0;i<this._stat_events.length;i++)for (var j=0;j < 4;j++)this.detachEvent(this._stat_events[i][j]);this._stat_events=[];}})
 };this._stat_events.push([
 this.attachEvent("onGridReconstructed",f),
 this.attachEvent("onXLE",f),
 this.attachEvent("onFilterEnd",f),
 this.attachEvent("onEditCell",function(stage,id,ind){if (stage==2 && ( ind==i || ( i && i[ind])) ) f.call(this);return true;})]);t.innerHTML="";};dhtmlXGridObject.prototype.unGroup=function(){if (!this._groups)return;this._dndProblematic=false;delete this._groups;delete this._gIndex;if (this._fake)this._mirror_rowsCol();this.forEachRow(function(id){this.rowsAr[id].style.display='';})
 this._reset_view();this.callEvent("onGridReconstructed",[])
 this.callEvent("onUnGroup",[]);};dhtmlXGridObject.prototype._mirror_rowsCol=function(){this._fake._groups=this._groups;this._fake._gIndex=this._gIndex;this.rowsBuffer=dhtmlxArray();for (var i=0;i<this.rowsCol.length;i++)if (!this.rowsCol[i]._cntr)this.rowsBuffer.push(this.rowsCol[i]);this._fake.rowsBuffer=dhtmlxArray();for (var i=0;i<this._fake.rowsCol.length;i++)if (!this._fake.rowsCol[i]._cntr)this._fake.rowsBuffer.push(this._fake.rowsCol[i]);};dhtmlXGridObject.prototype.groupBy=function(ind,mask){if (this._groups)this.unGroup();this._dndProblematic=true;this._groups={};if (!mask){mask=["#title"];for (var i=1;i<this._cCount;i++)mask.push("#cspan");};this._gmask=document.createElement("TR");this._gmask.origin = mask;var ltd,rindex=0;for (var i=0;i<mask.length;i++){if (mask[i]=="#cspan")ltd.colSpan=(parseInt(ltd.colSpan)||1)+1
 else {ltd=document.createElement("TD");ltd._cellIndex=i;if (this._hrrar[i])ltd.style.display="none";ltd.className="group_row";ltd.innerHTML="&nbsp;";if (mask[i]=="#title")this._gmask._title=rindex;else ltd.align=this.cellAlign[i]||"left";this._gmask.appendChild(ltd);if (mask[i].indexOf("#stat")==0){this._gmask._math=true;ltd._counter=[this["_g_"+mask[i].replace("#","")],i,rindex];};rindex++;}};for (var a in this._groups)this._groups[a]=this.undefined;this._gIndex=ind;if (this._fake &&!this._realfake){this._fake._groups=[];this._fake._gIndex=this._gIndex;};this._nextRow=function(ind,dir){var r=this.rowsCol[ind+dir];if (r && ( r.style.display=="none" || r._cntr)) return this._nextRow(ind+dir,dir);return r;};if (!this.__sortRowsBG){this._key_events=dhtmlXHeir({},this._key_events)
 this._key_events.k38_0_0=function(){if (this.editor && this.editor.combo)this.editor.shiftPrev();else{var rowInd = this.row.rowIndex;if (!rowInd)return;var nrow=this._nextRow(rowInd-1,-1);if (nrow)this.selectCell(nrow,this.cell._cellIndex,true);}};this._key_events.k13_1_0=this._key_events.k13_0_1=function(){};this._key_events.k40_0_0=function(){if (this.editor && this.editor.combo)this.editor.shiftNext();else{var rowInd = this.row.rowIndex;if (!rowInd)return;var nrow=this._nextRow(rowInd-1,1);if (nrow)this.selectCell(nrow,this.cell._cellIndex,true);}};this.attachEvent("onFilterStart",function(){if (this._groups)this._groups=this.undefined;return true;});this.attachEvent("onFilterEnd",function(){if (typeof this._gIndex != "undefined")this.groupBy(this._gIndex,this._gmask.origin);});this.sortRows_bg=this.sortRows;this.sortRows=function(ind,type,dir){if (typeof(this._groups)=="undefined") return this.sortRows_bg.apply(this,arguments);this.callEvent("onBeforeSorting",[ind,(type||"str"),(dir||"asc")]);};this.attachEvent("onBeforeSorting",function(ind,type,dir){if (typeof(this._groups)=="undefined") return true;if (ind==this._gIndex)this._sortByGroup(ind,type,dir);else this._sortInGroup(ind,type,dir);this.setSortImgState(true,ind,dir)
 if (this._fake){this._mirror_rowsCol();this._fake._groups=[];this._fake._reset_view();};this.setSortImgState(true,ind,dir);this.callEvent("onAfterSorting",[ind,type,dir]);return false;});this.attachEvent("onClearAll",function(){this.unGroup();});this.attachEvent("onBeforeRowDeleted",function(id){if (!this._groups)return true;if (!this.rowsAr[id])return true;var val=this.cells(id,this._gIndex).getValue();if (val==="")val=" ";var z=this._groups[val];this._dec_group(z);return true;});this.attachEvent("onAfterRowDeleted",function(id){this.updateGroups();});this.attachEvent("onCheckbox",function(id,index,value){this.callEvent("onEditCell",[2,id,index,(value?1:0),(value?0:1)]);});this.attachEvent("onXLE",this.updateGroups);this.attachEvent("onColumnHidden",this.hideGroupColumn);this.attachEvent("onEditCell",function(stage,id,ind,val,oldval){if (!this._groups)return true;if (stage==2 && val!=oldval && ind==this._gIndex){if (oldval==="")oldval=" ";this._dec_group(this._groups[oldval]);var r=this.rowsAr[id];var i=this.rowsCol._dhx_find(r)
 var ni=this._inc_group(val);var n=this.rowsCol[ni];if (r==n)n=n.nextSibling;var p=r.parentNode;var o=r.rowIndex;p.removeChild(r);if (n)p.insertBefore(r,n);else
 p.appendChild(r);this.rowsCol._dhx_insertAt(ni,r);if (ni<i)i++;this.rowsCol._dhx_removeAt(i,r);this._fixAlterCss();}else if (stage==2 && val!=oldval){this.updateGroups();this._updateGroupView(this._groups[this.cells(id,this._gIndex).getValue()||" "]);};return true;})
 this.__sortRowsBG=true;};this._groupExisting();if (this._hrrar)for (var i=0;i<this._hrrar.length;i++)if (this._hrrar[i])this.hideGroupColumn(i,true);this.callEvent("onGroup",[]);if (this._ahgr || this._awdth)this.setSizes();};dhtmlXGridObject.prototype._sortInGroup=function(col,type,order){var b=this._groups_get();b.reverse();for (var i=0;i<b.length;i++){var c=b[i]._cntr._childs;var a={};for (var j=0;j<c.length;j++){var cell = this.cells3(c[j],col);a[c[j].idd]=cell.getDate?cell.getDate():cell.getValue();};this._sortCore(col,type,order,a,c);};this._groups_put(b);this.setSizes();this.callEvent("onGridReconstructed",[])
};dhtmlXGridObject.prototype._sortByGroup=function(col,type,order){var b=this._groups_get();var a=[];for (var i=0;i<b.length;i++){b[i].idd="_sort_"+i;a["_sort_"+i]=b[i]._cntr.text;};this._sortCore(col,type,order,a,b);this._groups_put(b);this.callEvent("onGridReconstructed",[])
 this.setSizes();};dhtmlXGridObject.prototype._inc_group=function(val,hidden,skip){if (val==="")val=" ";if (!this._groups[val]){this._groups[val]={text:val,row:this._addPseudoRow(),count:0,state:hidden?"plus":"minus"}};var z=this._groups[val];z.row._cntr=z;var ind=this.rowsCol._dhx_find(z.row)+z.count+1;z.count++;if (!skip){this._updateGroupView(z);this.updateGroups();};return ind;};dhtmlXGridObject.prototype._dec_group=function(z){if (!z)return;z.count--;if (z.count==0){z.row.parentNode.removeChild(z.row);this.rowsCol._dhx_removeAt(this.rowsCol._dhx_find(z.row));delete this._groups[z.text];}else
 this._updateGroupView(z);if (this._fake && !this._realfake)this._fake._dec_group(this._fake._groups[z.text]);this.updateGroups();return true;};dhtmlXGridObject.prototype._insertRowAt_gA=dhtmlXGridObject.prototype._insertRowAt;dhtmlXGridObject.prototype._insertRowAt=function(r,ind,skip){if (typeof(this._groups)!="undefined"){if (this._realfake)var val=this._fake._bfs_cells(r.idd,this._gIndex).getValue();else
 if (this._bfs_cells3)var val=this._bfs_cells3(r,this._gIndex).getValue();else
 var val=this.cells3(r,this._gIndex).getValue();if (!val)val=" ";ind=this._inc_group(val,r.style.display=="none");};var res=this._insertRowAt_gA(r,ind,skip);if (typeof(this._groups)!="undefined"){this.expandGroup(val);this._updateGroupView(this._groups[val]);this.updateGroups();};return res;};dhtmlXGridObject.prototype._updateGroupView=function(z){if (this._fake && !this._realfake)return z.row.firstChild.innerHTML="&nbsp;";var mask = this._gmask||this._fake._gmask;var html="<img style='margin-bottom:-4px' src='"+this.imgURL+z.state+".gif'> ";if (this.customGroupFormat)html+=this.customGroupFormat(z.text,z.count);else html+=z.text+" ( "+z.count+" ) ";z.row.childNodes[mask._title].innerHTML=html;};dhtmlXGridObject.prototype._addPseudoRow=function(skip){var mask = this._gmask||this._fake._gmask;var r=mask.cloneNode(true)
 
 for (var i=0;i<r.childNodes.length;i++){r.childNodes[i]._cellIndex=mask.childNodes[i]._cellIndex;if (this._realfake)r.childNodes[i].style.display="";};var that=this;r.onclick=function(e){if (that._fake && that._realfake)that._fake._switchGroupState(that._fake._groups[this._cntr.text].row);else
 that._switchGroupState(this);(e||event).cancelBubble="true";};r.ondblclick=function(e){(e||event).cancelBubble="true";};if (!skip){if (_isKHTML)this.obj.appendChild(r)
 else
 this.obj.firstChild.appendChild(r)
 this.rowsCol.push(r);};return r;};dhtmlXGridObject.prototype._groups_get=function(){var b=[];this._temp_par=this.obj.parentNode;this._temp_par.removeChild(this.obj);var a=[];for (var i=this.rowsCol.length-1;i>=0;i--){if (this.rowsCol[i]._cntr){this.rowsCol[i]._cntr._childs=a;a=[];b.push(this.rowsCol[i]);}else a.push(this.rowsCol[i]);this.rowsCol[i].parentNode.removeChild(this.rowsCol[i]);};return b;};dhtmlXGridObject.prototype._groups_put=function(b){this.rowsCol=new dhtmlxArray(0);for (var i=0;i<b.length;i++){var gr=b[i]._cntr;this.obj.firstChild.appendChild(gr.row);this.rowsCol.push(gr.row)
 gr.row.idd=null;for (var j=0;j<gr._childs.length;j++){this.obj.firstChild.appendChild(gr._childs[j]);this.rowsCol.push(gr._childs[j])
 };delete gr._childs;};this._temp_par.appendChild(this.obj);};dhtmlXGridObject.prototype._groupExisting=function(b){if (!this.getRowsNum()) return;var b=[];this._temp_par=this.obj.parentNode;this._temp_par.removeChild(this.obj);var a=[];var mlen=this.rowsCol.length;for (var i=0;i<mlen;i++){var val=this.cells4(this.rowsCol[i].childNodes[this._gIndex]).getValue();this.rowsCol[i].style.display = "";if (!val)val=" ";if (!this._groups[val]){this._groups[val]={text:val,row:this._addPseudoRow(true),count:0,state:"minus"};var z=this._groups[val];z.row._cntr=z;this._groups[val]._childs=[];b.push(z.row)
 };this._groups[val].count++;this._groups[val]._childs.push(this.rowsCol[i]);this.rowsCol[i].parentNode.removeChild(this.rowsCol[i]);};for (var i=0;i<b.length;i++)this._updateGroupView(b[i]._cntr)
 this._groups_put(b);if (this._fake && !this._realfake){this._mirror_rowsCol();this._fake._groups=[];this._fake._reset_view();};this.callEvent("onGridReconstructed",[])
 this.updateGroups();};dhtmlXGridObject.prototype._switchGroupState=function(row){var z=row._cntr;if (this._fake && !this._realfake){z.state=this._fake._groups[row._cntr.text].row._cntr.state;this._fake._switchGroupState(this._fake._groups[row._cntr.text].row)
 };var ind=this.rowsCol._dhx_find(z.row)+1;z.state=z.state=="minus"?"plus":"minus";var st=z.state=="plus"?"none":"";while(this.rowsCol[ind] && !this.rowsCol[ind]._cntr){this.rowsCol[ind].style.display=st;ind++;};this._updateGroupView(z);this.callEvent("onGroupStateChanged",[z.text, (z.state=="minus")]);this.setSizes();};dhtmlXGridObject.prototype.expandGroup=function(val){if (this._groups[val].state=="plus")this._switchGroupState(this._groups[val].row);};dhtmlXGridObject.prototype.collapseGroup=function(val){if (this._groups[val].state=="minus")this._switchGroupState(this._groups[val].row);};dhtmlXGridObject.prototype.expandAllGroups=function(){for(var i in this._groups)if (this._groups[i] && this._groups[i].state=="plus")this._switchGroupState(this._groups[i].row);};dhtmlXGridObject.prototype.collapseAllGroups=function(){for(var i in this._groups)if (this._groups[i] && this._groups[i].state=="minus")this._switchGroupState(this._groups[i].row);};dhtmlXGridObject.prototype.hideGroupColumn=function(ind,state){if (this._fake)return;var rind=-1;var row = this._gmask.childNodes;for (var i=0;i<row.length;i++)if (row[i]._cellIndex==ind){rind = i;break;};if (rind == -1)return;for (var a in this._groups)this._groups[a].row.childNodes[rind].style.display=state?"none":"";};dhtmlXGridObject.prototype.groupStat=function(name,ind,math){math = this["_g_"+(math||"stat_total")];var summ=0;var index=0;this.forEachRowInGroup(name,function(id){summ=math(summ,this.cells(id,ind).getValue()*1,index)
 index++;})
 return summ;};dhtmlXGridObject.prototype.forEachRowInGroup=function(name,code){var row=this._groups[name].row.nextSibling;if (row){while (row && !row._cntr){code.call(this,row.idd);row=row.nextSibling;}}else {var cs=this._groups[name]._childs;if (cs)for (var i=0;i<cs.length;i++)code.call(this,cs[i].idd);}};dhtmlXGridObject.prototype.updateGroups=function(){if (!this._gmask || !this._gmask._math || this._parsing)return;var r=this._gmask.childNodes;for (var i=0;i<r.length;i++)if (r[i]._counter)this._b_processing.apply(this,r[i]._counter)
};dhtmlXGridObject.prototype._b_processing=function(a,ind,rind){var c=0,j=0;if (!this._ecache[this.cellType[ind]])this.cells5({parentNode:{grid:this}},this.cellType[ind]);for (var i=this.rowsCol.length-1;i>=0;i--){if (!this.rowsCol[i]._cntr){c=a(c,this.cells3(this.rowsCol[i],ind).getValue()*1,j);j++;}else {this.cells5(this.rowsCol[i].childNodes[rind],this.cellType[ind]).setValue(c);j=c=0;}}};dhtmlXGridObject.prototype._g_stat_total=function(c,n,i){return c+n;};dhtmlXGridObject.prototype._g_stat_min=function(c,n,i){if (!i)c=Infinity;return Math.min(c,n);};dhtmlXGridObject.prototype._g_stat_max=function(c,n,i){if (!i)c=-Infinity;return Math.max(c,n);};dhtmlXGridObject.prototype._g_stat_average=function(c,n,i){return (c*i+n)/(i+1);};dhtmlXGridObject.prototype._g_stat_count=function(c,n,i){return c++;};dhtmlXGridObject.prototype.enableDragAndDrop=function(mode){if (mode=="temporary_disabled"){this.dADTempOff=false;mode=true;}else
 this.dADTempOff=true;this.dragAndDropOff=convertStringToBoolean(mode);this._drag_validate=true;};dhtmlXGridObject.prototype.setDragBehavior=function(mode){this.dadmodec=this.dadmodefix=0;switch (mode) {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(mode){this._dndorder=convertStringToBoolean(mode);};dhtmlXGridObject.prototype._checkParent=function(row,ids){var z=this._h2.get[row.idd].parent;if (!z.parent)return;for (var i=0;i<ids.length;i++)if (ids[i]==z.id)return true;return this._checkParent(this.rowsAr[z.id],ids);};dhtmlXGridObject.prototype._createDragNode=function(htmlObject,e){this.editStop();if (window.dhtmlDragAndDrop.dragNode)return null;if (!this.dADTempOff)return null;htmlObject.parentObject=new Object();htmlObject.parentObject.treeNod=this;var text=this.callEvent("onBeforeDrag",[htmlObject.parentNode.idd,htmlObject._cellIndex]);if (!text)return null;var z=new Array();z=this.getSelectedId();z=(((z)&&(z!=""))?z.split(this.delim):[]);var exst=false;for (var i=0;i<z.length;i++)if (z[i]==htmlObject.parentNode.idd)exst=true;if (!exst){this.selectRow(this.rowsAr[htmlObject.parentNode.idd],false,e.ctrlKey,false);if (!e.ctrlKey){z=[];};z[this.selMultiRows?z.length:0]=htmlObject.parentNode.idd;};if (this.isTreeGrid()){for (var i=z.length-1;i>=0;i--)if (this._checkParent(this.rowsAr[z[i]],z)) z.splice(i,1);};var self=this;if (z.length && this._dndorder)z.sort(function(a,b){return (self.rowsAr[a].rowIndex>self.rowsAr[b].rowIndex?1:-1);});var el = this.getFirstParentOfType(_isIE?e.srcElement:e.target,"TD");if (el)this._dndExtra=el._cellIndex;this._dragged=new Array();for (var i=0;i<z.length;i++)if (this.rowsAr[z[i]]){this._dragged[this._dragged.length]=this.rowsAr[z[i]];this.rowsAr[z[i]].treeNod=this;};htmlObject.parentObject.parentNode=htmlObject.parentNode;var dragSpan=document.createElement('div');dragSpan.innerHTML=(text!==true?text:this.rowToDragElement(htmlObject.parentNode.idd));dragSpan.style.position="absolute";dragSpan.className="dragSpanDiv";return dragSpan;};dhtmlXGridObject.prototype._createSdrgc=function(){this._sdrgc=document.createElement("DIV");this._sdrgc.innerHTML="&nbsp;";this._sdrgc.className="gridDragLine";this.objBox.appendChild(this._sdrgc);};function dragContext(a,b,c,d,e,f,j,h,k,l){this.source=a||"grid";this.target=b||"grid";this.mode=c||"move";this.dropmode=d||"child";this.sid=e||0;this.tid=f;this.sobj=j||null;this.tobj=h||null;this.sExtra=k||null;this.tExtra=l||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 z=this.tid
 while (z = this.tobj.getParentId(z)){if (this.sid==z)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(a,b){this[a]=b;return this;};dragContext.prototype.uid=function(a,b){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.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 z=this.tobj.rowsAr[this.tid];var apid=this.tobj._h2.get[z.idd].parent.id;if ((this.alfa)&&(this.tobj._sbmod)&&(z.nextSibling)){var zpid=this.tobj._h2.get[z.nextSibling.idd].parent.id;if (zpid==this.tid)return this.tid;if (zpid!=apid)return zpid;};return apid;}};dragContext.prototype.ind=function(){if (this.tid==window.unknown)return 0;if (this.target=="treeGrid"){if (this.dropmode=="child")this.tobj.openItem(this.tid);else
 this.tobj.openItem(this.tobj.getParentId(this.tid));};var ind=this.tobj.rowsBuffer._dhx_find(this.tobj.rowsAr[this.tid]);if ((this.alfa)&&(this.tobj._sbmod)&&(this.dropmode=="sibling")){var z=this.tobj.rowsAr[this.tid];if ((z.nextSibling)&&(this._h2.get[z.nextSibling.idd].parent.id==this.tid))
 return ind+1;};return (ind+1+((this.target=="treeGrid" && ind>=0 && this.tobj._h2.get[this.tobj.rowsBuffer[ind].idd].state=="minus")?this.tobj._getOpenLenght(this.tobj.rowsBuffer[ind].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 res=new Array();for (var i=0;i<this.sid.length;i++)res[res.length]=this.sid[i][(this.source=="tree")?"id":"idd"];return res.join(",");};dhtmlXGridObject.prototype._drag=function(sourceHtmlObject,dhtmlObject,targetHtmlObject,lastLanding){if (this._realfake)return this._fake._drag() 
 
 var z=(this.lastLanding)
 
 if (this._autoOpenTimer)window.clearTimeout(this._autoOpenTimer);var r1=targetHtmlObject.parentNode;var r2=sourceHtmlObject.parentObject;if (!r1.idd){r1.grid=this;this.dadmodefix=0;};var c=new dragContext(0,0,0,(r1.grid.dadmodec?"sibling":"child"));if (r2 && r2.childNodes)c.set("source","tree").set("sobj",r2.treeNod).set("sid",c.sobj._dragged);else{if (r2.treeNod.isTreeGrid && r2.treeNod.isTreeGrid()) c.set("source","treeGrid");c.set("sobj",r2.treeNod).set("sid",c.sobj._dragged);};if (r1.grid.isTreeGrid())
 c.set("target","treeGrid");else
 c.set("dropmode","sibling");c.set("tobj",r1.grid).set("tid",r1.idd);if (((c.tobj.dadmode==2)&&(c.tobj.dadmodec==1))&&(c.tobj.dadmodefix<0))
 if (c.tobj.obj.rows[1].idd!=c.tid)c.tid=r1.previousSibling.idd;else c.tid=0;var el = this.getFirstParentOfType(lastLanding,"TD")
 if (el)c.set("tExtra",el._cellIndex);if (el)c.set("sExtra",c.sobj._dndExtra);if (c.sobj.dpcpy)c.set("mode","copy");if (c.tobj._realfake)c.tobj=c.tobj._fake;if (c.sobj._realfake)c.sobj=c.sobj._fake;c.tobj._clearMove();if (r2 && r2.treeNod && r2.treeNod._nonTrivialRow)r2.treeNod._nonTrivialRow(this,c.tid,c.dropmode,r2);else {c.tobj.dragContext=c;if (!c.tobj.callEvent("onDrag",[c.slist(),c.tid,c.sobj,c.tobj,c.sExtra,c.tExtra])) return c.tobj.dragContext=null;var result=new Array();if (typeof(c.sid)=="object"){var nc=c.copy();for (var i=0;i<c.sid.length;i++){if (!nc.set("alfa",(!i)).set("sid",c.sid[i][(c.source=="tree"?"id":"idd")]).valid()) continue;nc.tobj._dragRoutine(nc);if (nc.target=="treeGrid" && nc.dropmode == "child")nc.tobj.openItem(nc.tid);result[result.length]=nc.nid;nc.set("dropmode","sibling").set("tid",nc.nid);};nc.close();}else
 c.tobj._dragRoutine(c);if (c.tobj.laterLink)c.tobj.laterLink();c.tobj.callEvent("onDrop",[c.slist(),c.tid,result.join(","),c.sobj,c.tobj,c.sExtra,c.tExtra]);};c.tobj.dragContext=null;c.close();};dhtmlXGridObject.prototype._dragRoutine=function(c){if ((c.sobj==c.tobj)&&(c.source=="grid")&&(c.mode=="move")&&!this._fake){if (c.sobj._dndProblematic)return;var fr=c.sobj.rowsAr[c.sid];var bind=c.sobj.rowsCol._dhx_find(fr);c.sobj.rowsCol._dhx_removeAt(c.sobj.rowsCol._dhx_find(fr));c.sobj.rowsBuffer._dhx_removeAt(c.sobj.rowsBuffer._dhx_find(fr));c.sobj.rowsBuffer._dhx_insertAt(c.ind(),fr);if (c.tobj._fake){c.tobj._fake.rowsCol._dhx_removeAt(bind);var tr=c.tobj._fake.rowsAr[c.sid];tr.parentNode.removeChild(tr);};c.sobj._insertRowAt(fr,c.ind());c.nid=c.sid;c.sobj.callEvent("onGridReconstructed",[]);return;};var new_row;if (this._h2 && typeof c.tid !="undefined" && c.dropmode=="sibling" && (this._sbmod || c.tid)){if (c.alfa && this._sbmod && this._h2.get[c.tid].childs.length){this.openItem(c.tid)
 new_row=c.uid().tobj.addRowBefore(c.nid,c.data(),this._h2.get[c.tid].childs[0].id,c.img(),c.childs());}else
 new_row=c.uid().tobj.addRowAfter(c.nid,c.data(),c.tid,c.img(),c.childs());}else
 new_row=c.uid().tobj.addRow(c.nid,c.data(),c.ind(),c.pid(),c.img(),c.childs());if (c.source=="tree"){this.callEvent("onRowAdded",[c.nid]);var sn=c.sobj._globalIdStorageFind(c.sid);if (sn.childsCount){var nc=c.copy().set("tid",c.nid).set("dropmode",c.target=="grid"?"sibling":"child");for(var j=0;j<sn.childsCount;j++){c.tobj._dragRoutine(nc.set("sid",sn.childNodes[j].id));if (c.mode=="move")j--;};nc.close();}}else{c.tobj._copyUserData(c);this.callEvent("onRowAdded",[c.nid]);if ((c.source=="treeGrid")){if (c.sobj==c.tobj)new_row._xml=c.sobj.rowsAr[c.sid]._xml;var snc=c.sobj._h2.get[c.sid];if ((snc)&&(snc.childs.length)){var nc=c.copy().set("tid",c.nid);if(c.target=="grid")nc.set("dropmode","sibling");else {nc.tobj.openItem(c.tid);nc.set("dropmode","child");};var l=snc.childs.length;for(var j=0;j<l;j++){c.sobj.render_row_tree(null,snc.childs[j].id);c.tobj._dragRoutine(nc.set("sid",snc.childs[j].id));if (l!=snc.childs.length){j--;l=snc.childs.length;}};nc.close();}}};if (c.mode=="move"){c.sobj[(c.source=="tree")?"deleteItem":"deleteRow"](c.sid);if ((c.sobj==c.tobj)&&(!c.tobj.rowsAr[c.sid])) {c.tobj.changeRowId(c.nid,c.sid);c.nid=c.sid;}}};dhtmlXGridObject.prototype.gridToGrid = function(rowId,sgrid,tgrid){var z=new Array();for (var i=0;i<sgrid.hdr.rows[0].cells.length;i++)z[i]=sgrid.cells(rowId,i).getValue();return z;};dhtmlXGridObject.prototype.checkParentLine=function(node,id){if ((!this._h2)||(!id)||(!node)) return false;if (node.id==id)return true;else return this.checkParentLine(node.parent,id);};dhtmlXGridObject.prototype._dragIn=function(htmlObject,shtmlObject,x,y){if (!this.dADTempOff)return 0;var tree=this.isTreeGrid();var obj=shtmlObject.parentNode.idd?shtmlObject.parentNode:shtmlObject.parentObject;if (this._drag_validate){if(htmlObject.parentNode==shtmlObject.parentNode)return 0;if ((tree)&&(this==obj.grid)&&((this.checkParentLine(this._h2.get[htmlObject.parentNode.idd],shtmlObject.parentNode.idd))))
 return 0;};if (!this.callEvent("onDragIn",[obj.idd||obj.id,htmlObject.parentNode.idd,obj.grid||obj.treeNod,htmlObject.parentNode.grid]))
 return this._setMove(htmlObject,x,y,true);this._setMove(htmlObject,x,y);if ((tree)&&(htmlObject.parentNode.expand!="")){this._autoOpenTimer=window.setTimeout(new callerFunction(this._autoOpenItem,this),1000);this._autoOpenId=htmlObject.parentNode.idd;}else
 if (this._autoOpenTimer)window.clearTimeout(this._autoOpenTimer);return htmlObject;};dhtmlXGridObject.prototype._autoOpenItem=function(e,gridObject){gridObject.openItem(gridObject._autoOpenId);};dhtmlXGridObject.prototype._dragOut=function(htmlObject){this._clearMove();var obj=htmlObject.parentNode.parentObject?htmlObject.parentObject.id:htmlObject.parentNode.idd;this.callEvent("onDragOut",[obj]);if (this._autoOpenTimer)window.clearTimeout(this._autoOpenTimer);};dhtmlXGridObject.prototype._setMove=function(htmlObject,x,y,skip){if (!htmlObject.parentNode.idd)return;var a1=getAbsoluteTop(htmlObject);var a2=getAbsoluteTop(this.objBox);if ( (a1-a2)>(parseInt(this.objBox.offsetHeight)-50) )
 this.objBox.scrollTop=parseInt(this.objBox.scrollTop)+20;if ( (a1-a2+parseInt(this.objBox.scrollTop))<(parseInt(this.objBox.scrollTop)+30) )
 this.objBox.scrollTop=parseInt(this.objBox.scrollTop)-20;if (skip)return 0;if (this.dadmode==2){var z=y-a1+this.objBox.scrollTop+(document.body.scrollTop||document.documentElement.scrollTop)-2-htmlObject.offsetHeight/2;if ((Math.abs(z)-htmlObject.offsetHeight/6)>0)
 {this.dadmodec=1;if (z<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=a1-a2+parseInt(this.objBox.scrollTop)+((this.dadmodefix>=0)?htmlObject.offsetHeight:0)+"px";}else{this._llSelD=htmlObject;if (htmlObject.parentNode.tagName=="TR")for (var i=0;i<htmlObject.parentNode.childNodes.length;i++){var z= htmlObject.parentNode.childNodes[i];z._bgCol=z.style.backgroundColor;z.style.backgroundColor="#FFCCCC";}}};dhtmlXGridObject.prototype._clearMove=function(){if (this._sdrgc)this._sdrgc.style.display="none";if ((this._llSelD)&&(this._llSelD.parentNode.tagName=="TR"))
 for (var i=0;i<this._llSelD.parentNode.childNodes.length;i++)this._llSelD.parentNode.childNodes[i].style.backgroundColor=this._llSelD._bgCol;this._llSelD=null;};dhtmlXGridObject.prototype.rowToDragElement=function(gridRowId){var out=this.cells(gridRowId,0).getValue();return out;};dhtmlXGridObject.prototype._copyUserData = function(c){if(!c.tobj.UserData[c.nid] || c.tobj!=c.sobj)c.tobj.UserData[c.nid] = new Hashtable();else return;var z1 = c.sobj.UserData[c.sid];var z2 = c.tobj.UserData[c.nid];if (z1){z2.keys = z2.keys.concat(z1.keys);z2.values = z2.values.concat(z1.values);}};dhtmlXGridObject.prototype.moveRow=function(rowId,mode,targetId,targetGrid){switch(mode){case "row_sibling":
 this.moveRowTo(rowId,targetId,"move","sibling",this,targetGrid);break;case "up":
 this.moveRowUp(rowId);break;case "down":
 this.moveRowDown(rowId);break;}};dhtmlXGridObject.prototype._nonTrivialNode=function(tree,targetObject,beforeNode,itemObject,z2)
{if ((tree.callEvent)&&(!z2))
 if (!tree.callEvent("onDrag",[itemObject.idd,targetObject.id,(beforeNode?beforeNode.id:null),this,tree])) return false;var gridRowId = itemObject.idd;var treeNodeId = gridRowId;while (tree._idpull[treeNodeId])treeNodeId+=(new Date()).getMilliseconds().toString();var img=(this.isTreeGrid()?this.getItemImage(gridRowId):"")
 if (beforeNode){for (i=0;i<targetObject.childsCount;i++)if (targetObject.childNodes[i]==beforeNode)break;if (i!=0)beforeNode=targetObject.childNodes[i-1];else{st="TOP";beforeNode="";}};var newone=tree._attachChildNode(targetObject,treeNodeId,this.gridToTreeElement(tree,treeNodeId,gridRowId),"",img,img,img,"","",beforeNode);if (this._h2){var akids=this._h2.get[gridRowId];if (akids.childs.length)for (var i=0;i<akids.childs.length;i++){this._nonTrivialNode(tree,newone,0,this.rowsAr[akids.childs[i].id],1);if (!this.dpcpy)i--;}};if (!this.dpcpy)this.deleteRow(gridRowId);if ((tree.callEvent)&&(!z2))
 tree.callEvent("onDrop",[treeNodeId,targetObject.id,(beforeNode?beforeNode.id:null),this,tree]);};dhtmlXGridObject.prototype.gridToTreeElement = function(treeObj,treeNodeId,gridRowId){return this.cells(gridRowId,0).getValue();};dhtmlXGridObject.prototype.treeToGridElement = function(treeObj,treeNodeId,gridRowId){var w=new Array();var z=this.cellType._dhx_find("tree");if (z==-1)z=0;for(var i=0;i<this.getColumnCount();i++)
 w[w.length]=(i!=z)?(treeObj.getUserData(treeNodeId,this.getColumnId(i))||""):treeObj.getItemText(treeNodeId);return w;};dhtmlXGridObject.prototype.moveRowTo=function(srowId,trowId,mode,dropmode,sourceGrid,targetGrid){var c=new dragContext((sourceGrid||this).isTreeGrid()?"treeGrid":"grid",(targetGrid||this).isTreeGrid()?"treeGrid":"grid",mode,dropmode||"sibling",srowId,trowId,sourceGrid||this,targetGrid||this);c.tobj._dragRoutine(c);c.close();return c.nid;};dhtmlXGridObject.prototype.enableMercyDrag=function(mode){this.dpcpy=convertStringToBoolean(mode);};dhtmlXGridObject.prototype._process_xmlA=function(xml){if (!xml.doXPath){var t = new dtmlXMLLoaderObject(function(){});if (typeof xml == "string")t.loadXMLString(xml);else {if (xml.responseXML)t.xmlDoc=xml;else
 t.xmlDoc={};t.xmlDoc.responseXML=xml;};xml=t;};this._parsing=true;var top=xml.getXMLTopNode(this.xml.top)
 
 this._parseHead(top);var rows=xml.doXPath(this.xml.row,top)
 var cr=parseInt(xml.doXPath("//"+this.xml.top)[0].getAttribute("pos")||0);var total=parseInt(xml.doXPath("//"+this.xml.top)[0].getAttribute("total_count")||0);if (total && !this.rowsBuffer[total-1])this.rowsBuffer[total-1]=null;if (this.isTreeGrid()){this._get_xml_data = this._get_xml_dataA;this._process_xml_row = this._process_xml_rowA;return this._process_tree_xml(xml);};for (var i=0;i < rows.length;i++){if (this.rowsBuffer[i+cr])continue;var id=rows[i].getAttribute("id")||this.uid();this.rowsBuffer[i+cr]={idd:id, data:rows[i], _parser: this._process_xml_rowA, _locator:this._get_xml_dataA };this.rowsAr[id]=rows[i];};this.render_dataset();this._parsing=false;return xml.xmlDoc.responseXML?xml.xmlDoc.responseXML:xml.xmlDoc;};dhtmlXGridObject.prototype._process_xmlB=function(xml){if (!xml.doXPath){var t = new dtmlXMLLoaderObject(function(){});if (typeof xml == "string")t.loadXMLString(xml);else {if (xml.responseXML)t.xmlDoc=xml;else
 t.xmlDoc={};t.xmlDoc.responseXML=xml;};xml=t;};this._parsing=true;var top=xml.getXMLTopNode(this.xml.top)
 
 this._parseHead(top);var rows=xml.doXPath(this.xml.row,top)
 var cr=parseInt(xml.doXPath("//"+this.xml.top)[0].getAttribute("pos")||0);var total=parseInt(xml.doXPath("//"+this.xml.top)[0].getAttribute("total_count")||0);if (total && !this.rowsBuffer[total-1])this.rowsBuffer[total-1]=null;if (this.isTreeGrid()){this._get_xml_data = this._get_xml_dataB;this._process_xml_row = this._process_xml_rowB;return this._process_tree_xml(xml);};for (var i=0;i < rows.length;i++){if (this.rowsBuffer[i+cr])continue;var id=rows[i].getAttribute("id")||this.uid();this.rowsBuffer[i+cr]={idd:id, data:rows[i], _parser: this._process_xml_rowB, _locator:this._get_xml_dataB };this.rowsAr[id]=rows[i];};this.render_dataset();this._parsing=false;return xml.xmlDoc.responseXML?xml.xmlDoc.responseXML:xml.xmlDoc;};dhtmlXGridObject.prototype._process_xml_rowA=function(r,xml){var strAr = [];r._attrs=this._xml_attrs(xml);for(var j=0;j<this.columnIds.length;j++){var cid=this.columnIds[j];var cellVal=r._attrs[cid]||"";if (r.childNodes[j])r.childNodes[j]._attrs={};strAr.push(cellVal);};this._fillRow(r,(this._c_order?this._swapColumns(strAr):strAr));return r;};dhtmlXGridObject.prototype._get_xml_dataA=function(data,ind){return data.getAttribute(this.getColumnId(ind));};dhtmlXGridObject.prototype._process_xml_rowB=function(r,xml){var strAr = [];r._attrs=this._xml_attrs(xml);if (this._ud_enabled){var udCol = this.xmlLoader.doXPath("./userdata",xml);for (var i = udCol.length - 1;i >= 0;i--)this.setUserData(udCol[i].getAttribute("name"),udCol[i].firstChild?udCol[i].firstChild.data:"");};for (var jx=0;jx < xml.childNodes.length;jx++){var cellVal=xml.childNodes[jx];if (!cellVal.tagName)continue;var j=this.getColIndexById(cellVal.tagName);if (isNaN(j)) continue;var exc=cellVal.getAttribute("type");if (exc)r.childNodes[j]._cellType=exc;r.childNodes[j]._attrs=this._xml_attrs(cellVal);if (cellVal.getAttribute("xmlcontent"))
 {}else if (cellVal.firstChild)cellVal=cellVal.firstChild.data;else cellVal="";strAr[j]=cellVal;};for (var i=0;i < r.childNodes.length;i++){if (!r.childNodes[i]._attrs)r.childNodes[i]._attrs={}};this._fillRow(r,(this._c_order?this._swapColumns(strAr):strAr));return r;};dhtmlXGridObject.prototype._get_xml_dataB=function(data,ind){var id=this.getColumnId(ind);data=data.firstChild;while (true){if (!data)return "";if (data.tagName==id)return (data.firstChild?data.firstChild.data:"")
 data=data.nextSibling;};return "";};dhtmlXGridObject.prototype.attachHeaderA=dhtmlXGridObject.prototype.attachHeader;dhtmlXGridObject.prototype.attachHeader=function()
{this.attachHeaderA.apply(this,arguments);if (this._realfake)return true;this.formAutoSubmit();if (typeof(this.FormSubmitOnlyChanged)=="undefined")
 this.submitOnlyChanged(true);if (typeof(this._submitAR)=="undefined")
 this.submitAddedRows(true);var that=this;this._added_rows=[];this._deleted_rows=[];this.attachEvent("onRowAdded",function(id){that._added_rows.push(id);that.forEachCell(id,function(a){a.cell.wasChanged=true;})
 return true;});this.attachEvent("onBeforeRowDeleted",function(id){that._deleted_rows.push(id);return true;});this.attachHeader=this.attachHeaderA;};dhtmlXGridObject.prototype.formAutoSubmit = function()
{this.parentForm = this.detectParentFormPresent();if (this.parentForm === false){return false;};if (this.formEventAttached)return;this.formInputs = new Array();var self = this;dhtmlxEvent(this.parentForm, 'submit', function() {if (self.entBox)self.parentFormOnSubmit();});this.formEventAttached = true;};dhtmlXGridObject.prototype.parentFormOnSubmit = function()
{this.formCreateInputCollection();if (!this.callEvent("onBeforeFormSubmit",[])) return false;};dhtmlXGridObject.prototype.submitOnlyChanged = function(mode)
{this.FormSubmitOnlyChanged = convertStringToBoolean(mode);};dhtmlXGridObject.prototype.submitColumns=function(names){if (typeof names == "string")names=names.split(this.delim);this._submit_cols=names;};dhtmlXGridObject.prototype.setFieldName=function(mask){mask=mask.replace(/\{GRID_ID\}/g,"'+a1+'");mask=mask.replace(/\{ROW_ID\}/g,"'+a2+'");mask=mask.replace(/\{ROW_INDEX\}/g,"'+this.getRowIndex(a2)+'");mask=mask.replace(/\{COLUMN_INDEX\}/g,"'+a3+'");mask=mask.replace(/\{COLUMN_ID\}/g,"'+this.getColumnId(a3)+'");this._input_mask=Function("a1","a2","a3","return '"+mask+"';");};dhtmlXGridObject.prototype.submitSerialization = function(mode)
{this.FormSubmitSerialization = convertStringToBoolean(mode);};dhtmlXGridObject.prototype.submitAddedRows = function(mode)
{this._submitAR = convertStringToBoolean(mode);};dhtmlXGridObject.prototype.submitOnlySelected = function(mode)
{this.FormSubmitOnlySelected = convertStringToBoolean(mode);};dhtmlXGridObject.prototype.submitOnlyRowID = function(mode)
{this.FormSubmitOnlyRowID = convertStringToBoolean(mode);};dhtmlXGridObject.prototype.createFormInput = function(name,value){var input = document.createElement('input');input.type = 'hidden';if (this._input_mask)input.name=this._input_mask.apply(this,name);else
 input.name =((this.globalBox||this.entBox).id||'dhtmlXGrid')+'_'+name;input.value = value;this.parentForm.appendChild(input);this.formInputs.push(input);};dhtmlXGridObject.prototype.createFormInputRow = function(r){var id=(this.globalBox||this.entBox).id;for (var j=0;j<this._cCount;j++){var foo_cell = this.cells3(r, j);if (((!this.FormSubmitOnlyChanged)|| foo_cell.wasChanged()) && (!this._submit_cols || this._submit_cols[j]))
 this.createFormInput(this._input_mask?[id,r.idd,j]:(r.idd+'_'+j),foo_cell.getValue());}};dhtmlXGridObject.prototype.formCreateInputCollection = function()
{if (this.parentForm == false){return false;};for (var i=0;i<this.formInputs.length;i++){this.parentForm.removeChild(this.formInputs[i]);};this.formInputs = new Array();if (this.FormSubmitSerialization){this.createFormInput("serialized",this.serialize());}else if (this.FormSubmitOnlySelected){if (this.FormSubmitOnlyRowID)this.createFormInput("selected",this.getSelectedId());else
 for(var i=0;i<this.selectedRows.length;i++)this.createFormInputRow(this.selectedRows[i]);}else{if (this._submitAR){if (this._added_rows.length)this.createFormInput("rowsadded",this._added_rows.join(","));if (this._deleted_rows.length)this.createFormInput("rowsdeleted",this._deleted_rows.join(","));};this.forEachRow(function(id){this.getRowById(id);this.createFormInputRow(this.rowsAr[id]);})
 
 }};dhtmlXGridObject.prototype.detectParentFormPresent = function()
{var parentForm = false;var parent = this.entBox;while(parent && parent.tagName && parent != document.body){if (parent.tagName.toLowerCase()== 'form') {parentForm = parent;break;}else {parent = parent.parentNode;}};return parentForm;};dhtmlXGridObject.prototype.enableHeaderMenu=function()
{var that=this;this.attachEvent("onInit",function(){this.hdr.oncontextmenu = function(e){return that._doHContClick(e||window.event);};{
 this.startColResizeA=this.startColResize;this.startColResize=function(e){if (e.button==2 || (_isMacOS&&e.ctrlKey))
 return this._doHContClick(e)
 return this.startColResizeA(e);}};this._chm_ooc=this.obj.onclick;this._chm_hoc=this.hdr.onclick;this.hdr.onclick=function(e){if (e && ( e.button==2 || (_isMacOS&&e.ctrlKey))) return false;that._showHContext(false);return that._chm_hoc.apply(this,arguments)
 };this.obj.onclick=function(){that._showHContext(false);return that._chm_ooc.apply(this,arguments)
 }});dhtmlxEvent(document.body,"click",function(){if (that._hContext)that._showHContext(false);})
 if (this.hdr.rows.length)this.callEvent("onInit",[]);this.enableHeaderMenu=function(){}};dhtmlXGridObject.prototype._doHContClick=function(ev)
{function mouseCoords(ev){if(ev.pageX || ev.pageY){return {x:ev.pageX, y:ev.pageY}};var d = ((_isIE)&&(document.compatMode != "BackCompat"))?document.documentElement:document.body;return {x:ev.clientX + d.scrollLeft - d.clientLeft,
 y:ev.clientY + d.scrollTop - d.clientTop
 }};this._createHContext();var coords = mouseCoords(ev);this._showHContext(true,coords.x,coords.y);ev[_isIE?"srcElement":"target"].oncontextmenu = function(e){(e||event).cancelBubble=true;return false;};ev.cancelBubble=true;if (ev.preventDefault)ev.preventDefault();return false;};dhtmlXGridObject.prototype._createHContext=function()
{if (this._hContext)return this._hContext;var d = document.createElement("DIV");d.oncontextmenu = function(e){(e||event).cancelBubble=true;return false;};d.onclick=function(e){(e||event).cancelBubble=true;return true;};d.className="dhx_header_cmenu";d.style.width=d.style.height="5px";d.style.display="none";var a=[];var i=0;if (this._fake)i=this._fake._cCount;var true_ind=i;for (var i;i<this.hdr.rows[1].cells.length;i++){var c=this.hdr.rows[1].cells[i];if (c.firstChild && c.firstChild.tagName=="DIV")var val=c.firstChild.innerHTML;else var val = c.innerHTML;a.push("<div class='dhx_header_cmenu_item'><input type='checkbox' column='"+true_ind+"' len='"+(c.colSpan||1)+"' checked='true' />"+val+"</div>");true_ind+=(c.colSpan||1);};d.innerHTML=a.join("");var that=this;var f=function(){var c=this.getAttribute("column");if (!this.checked && !that._checkLast(c)) return this.checked=true;if (that._realfake)that=that._fake;for (var i=0;i<this.getAttribute("len");i++)
 that.setColumnHidden((c*1+i*1),!this.checked);if(this.checked && that.getColWidth(c)==0) 
 that.adjustColumnSize(c);};for (var i=0;i<d.childNodes.length;i++)d.childNodes[i].firstChild.onclick=f;document.body.insertBefore(d,document.body.firstChild);this._hContext=d;d.style.position="absolute";d.style.zIndex=999;d.style.width='auto'
 d.style.height='auto'
 d.style.display='block';};dhtmlXGridObject.prototype._checkLast=function(ind){for (var i=0;i < this._cCount;i++)if ((!this._hrrar || !this._hrrar[i])&&(i!=ind))
 return true;return false;};dhtmlXGridObject.prototype._updateHContext=function()
{for (var i=0;i<this._hContext.childNodes.length;i++){var c=this._hContext.childNodes[i].firstChild;var col=c.getAttribute("column");if (this.isColumnHidden(col)|| (this.getColWidth(col)==0))
 c.checked=false;}};dhtmlXGridObject.prototype._showHContext=function(mode,x,y)
{if (mode && this.enableColumnMove){this._hContext.parentNode.removeChild(this._hContext);this._hContext=null;};this._createHContext();this._hContext.style.display=(mode?'block':'none');if (mode){this._updateHContext(true);this._hContext.style.left=x+"px";this._hContext.style.top=y+"px";}};function eXcell_math(cell){if (cell){this.cell = cell;this.grid = this.cell.parentNode.grid;};this.edit = function(){this.grid.editor = new eXcell_ed(this.cell);this.grid.editor.fix_self=true;this.grid.editor.getValue=this.cell.original?(function(){return this.cell.original}):this.getValue;this.grid.editor.setValue=this.setValue;this.grid.editor.edit();};this.isDisabled = function(){return !this.grid._mathEdit;};this.setValue = function(val){val=this.grid._compileSCL(val,this.cell,this.fix_self);if (this.grid._strangeParams[this.cell._cellIndex])this.grid.cells5(this.cell,this.grid._strangeParams[this.cell._cellIndex]).setValue(val);else{this.setCValue(val);this.cell._clearCell=false;}};this.getValue = function(){if (this.grid._strangeParams[this.cell._cellIndex])return this.grid.cells5(this.cell,this.grid._strangeParams[this.cell._cellIndex]).getValue();return this.cell.innerHTML;}};eXcell_math.prototype = new eXcell;dhtmlXGridObject.prototype._init_point_bm=dhtmlXGridObject.prototype._init_point;dhtmlXGridObject.prototype._init_point = function(){this._mat_links={};this._aggregators=[];this.attachEvent("onClearAll",function(){this._mat_links={};this._aggregators=[];})
 this.attachEvent("onCellChanged",function(id,ind){if (this._mat_links[id]){var cell=this._mat_links[id][ind];if (cell){for (var i=0;i<cell.length;i++)this.cells5(cell[i]).setValue(this._calcSCL(cell[i]));}};if (!this._parsing && this._aggregators[ind]){var pid=this._h2.get[id].parent.id;if (pid!=0){var ed=this.cells(pid,ind);ed.setValue(this._calcSCL(ed.cell));}}})
 this.attachEvent("onAfterRowDeleted",function(id,pid){if (pid!=0)if (!this._parsing && this._aggregators.length){for (var ind=0;ind < this._aggregators.length;ind++){if (this._aggregators[ind]){var ed=this.cells(pid,ind);ed.setValue(this._calcSCL(ed.cell));}}};return true;})
 this.attachEvent("onXLE",function(){for (var i=0;i < this._aggregators.length;i++){if (this._aggregators[i])this._h2.forEachChild(0,function(el){if (el.childs.length!=0){var ed=this.cells(el.id,i);ed.setValue(this._calcSCL(ed.cell));}},this);}})
 this._init_point=this._init_point_bm;if (this._init_point)this._init_point();};dhtmlXGridObject.prototype.enableMathSerialization=function(status){this._mathSerialization=convertStringToBoolean(status);};dhtmlXGridObject.prototype.setMathRound=function(digits){this._roundDl=digits;this._roundD=Math.pow(10,digits);};dhtmlXGridObject.prototype.enableMathEditing=function(status){this._mathEdit=convertStringToBoolean(status);};dhtmlXGridObject.prototype._calcSCL=function(cell){if (!cell._code)return this.cells5(cell).getValue();try{var agrid=this;var z=eval(cell._code);}catch(e){return ("#SCL");};if (this._roundD){var pre=Math.abs(z)<1?"0":"";z=Math.round(z*this._roundD).toString();if (z==0)return 0;if (this._roundDl>0){var n=z.length-this._roundDl;if (n<0){z=("000000000"+z).substring(9+n);n=0;};return (pre+z.substring(0,n)+"."+z.substring(n,z.length));}};return z;};dhtmlXGridObject.prototype._countTotal=function(row,cell){var b=0;var z=this._h2.get[row];for (var i=0;i<z.childs.length;i++){if (!z.childs[i].buff)return b;if (z.childs[i].buff._parser){this._h2.forEachChild(row,function(el){if (el.childs.length==0)b+=this._get_cell_value(el.buff,cell)*1;},this)
 return b;};b+=this._get_cell_value(z.childs[i].buff,cell)*1;};return b;};dhtmlXGridObject.prototype._compileSCL=function(code,cell,fix){if (code === null || code === window.undefined)return code;code=code.toString();if (code.indexOf("=")!=0) {this._reLink([],cell);if (fix)cell._code = cell.original = null;return code;};cell.original=code;var linked=null;code=code.replace("=","");if (code.indexOf("sum")!=-1){code=code.replace("sum","(agrid._countTotal('"+cell.parentNode.idd+"',"+cell._cellIndex+"))");if (!this._aggregators)this._aggregators=[];this._aggregators[cell._cellIndex]="sum";cell._code=code;return this._parsing?"":this._calcSCL(cell);};if (code.indexOf("[[")!=-1){var test = /(\[\[([^\,]*)\,([^\]]*)]\])/g;var agrid=this;linked=linked||(new Array());code=code.replace(test,
 function ($0,$1,$2,$3){if ($2=="-")$2=cell.parentNode.idd;if ($2.indexOf("#")==0)
 $2=agrid.getRowId($2.replace("#",""));linked[linked.length]=[$2,$3];return "(agrid.cells(\""+$2+"\","+$3+").getValue()*1)";});};if (code.indexOf(":")!=-1){var test = /:(\w+)/g;var agrid=this;var id=cell.parentNode.idd;linked=linked||(new Array());code=code.replace(test,
 function ($0,$1,$2,$3){linked[linked.length]=[id,agrid.getColIndexById($1)];return '(agrid.cells("'+id+'",agrid.getColIndexById("'+$1+'")).getValue()*1)';});}else{var test = /c([0-9]+)/g;var agrid=this;var id=cell.parentNode.idd;linked=linked||(new Array());code=code.replace(test,
 function ($0,$1,$2,$3){linked[linked.length]=[id,$1];return "(agrid.cells(\""+id+"\","+$1+").getValue()*1)";});};this._reLink(linked,cell);cell._code=code;return this._calcSCL(cell);};dhtmlXGridObject.prototype._reLink=function(ar,cell){if (!ar.length)return;for (var i=0;i<ar.length;i++){if (!this._mat_links[ar[i][0]])this._mat_links[ar[i][0]]={};var t=this._mat_links[ar[i][0]];if (!t[ar[i][1]])t[ar[i][1]]=[];t[ar[i][1]].push(cell);}};if (_isKHTML){(function(){var default_replace = String.prototype.replace;String.prototype.replace = function(search,replace){if(typeof replace != "function"){return default_replace.apply(this,arguments)
 };var str = "" + this;var callback = replace;if(!(search instanceof RegExp)){var idx = str.indexOf(search);return (
 idx == -1 ? str :
 default_replace.apply(str,[search,callback(search, idx, str)])
 )
 };var reg = search;var result = [];var lastidx = reg.lastIndex;var re;while((re = reg.exec(str)) != null){var idx = re.index;var args = re.concat(idx, str);result.push(
 str.slice(lastidx,idx),
 callback.apply(null,args).toString()
 );if(!reg.global){lastidx += RegExp.lastMatch.length;break
 }else{lastidx = reg.lastIndex;}};result.push(str.slice(lastidx));return result.join("")
 }})();};dhtmlXGridObject.prototype.insertColumn=function(ind,header,type,width,sort,align,valign,reserved,columnColor){ind=parseInt(ind);if (ind>this._cCount)ind=this._cCount;if (!this._cMod)this._cMod=this._cCount;this._processAllArrays(this._cCount,ind-1,[(header||"&nbsp;"),(width||100),(type||"ed"),(align||"left"),(valign||""),(sort||"na"),(columnColor||""),"",this._cMod,(width||100)]);this._processAllRows("_addColInRow",ind);if (typeof(header)=="object")
 for (var i=1;i < this.hdr.rows.length;i++){if (header[i-1]=="#rspan"){var pind=i-1;var found=false;var pz=null;while(!found){var pz=this.hdr.rows[pind];for (var j=0;j<pz.cells.length;j++)if (pz.cells[j]._cellIndex==ind){found=j;break;};pind--;};this.hdr.rows[pind+1].cells[j].rowSpan=(this.hdr.rows[pind].cells[j].rowSpan||1)+1;}else 
 this.setHeaderCol(ind,(header[i-1]||"&nbsp;"),i);}else
 this.setHeaderCol(ind,(header||"&nbsp;"));this.hdr.rows[0].cells[ind]
 this._cCount++;this._cMod++;this._master_row=null;this.setSizes();};dhtmlXGridObject.prototype.deleteColumn=function(ind){ind=parseInt(ind);if (this._cCount==0)return;if (!this._cMod)this._cMod=this._cCount;if (ind>=this._cCount)return;this._processAllArrays(ind,this._cCount-1,[null,null,null,null,null,null,null,null,null,null,null]);this._processAllRows("_deleteColInRow",ind);this._cCount--;this._master_row=null;this.setSizes();};dhtmlXGridObject.prototype._processAllRows = function(method,oldInd,newInd){this[method](this.obj.rows[0],oldInd,newInd,0);var z=this.hdr.rows.length;for (var i=0;i<z;i++)this[method](this.hdr.rows[i],oldInd,newInd,i);if (this.ftr){var z=this.ftr.firstChild.rows.length;for (var i=0;i<z;i++)this[method](this.ftr.firstChild.rows[i],oldInd,newInd,i);};this.forEachRow(function(id){if (this.rowsAr[id] && this.rowsAr[id].tagName=="TR")this[method](this.rowsAr[id],oldInd,newInd,-1);});};dhtmlXGridObject.prototype._processAllArrays = function(oldInd,newInd,vals){var ars=["hdrLabels","initCellWidth","cellType","cellAlign","cellVAlign","fldSort","columnColor","_hrrar","_c_order"];if (this.cellWidthPX.length)ars.push("cellWidthPX");if (this.cellWidthPC.length)ars.push("cellWidthPC");if (this._col_combos)ars.push("_col_combos");if (this._mCols)ars[ars.length]="_mCols";if (this.columnIds)ars[ars.length]="columnIds";if (this._maskArr)ars.push("_maskArr");if (this._drsclmW)ars.push("_drsclmW");if (this.clists)ars.push("clists");if (this._validators && this._validators.data)ars.push(this._validators.data);ars.push("combos");if (this._customSorts)ars.push("_customSorts");if (this._aggregators)ars.push("_aggregators");var mode=(oldInd<=newInd);if (!this._c_order){this._c_order=new Array();var l=this._cCount;for (var i=0;i<l;i++)this._c_order[i]=i;};for (var i=0;i<ars.length;i++){var t=this[ars[i]]||ars[i];if (t){if (mode){var val=t[oldInd];for (var j=oldInd;j<newInd;j++)t[j]=t[j+1];t[newInd]=val;}else {var val=t[oldInd];for (var j=oldInd;j>(newInd+1);j--)
 t[j]=t[j-1];t[newInd+1]=val;};if (vals)t[newInd+(mode?0:1)]=vals[i];}}};dhtmlXGridObject.prototype.moveColumn = function(oldInd,newInd){newInd--;oldInd=parseInt(oldInd);newInd=parseInt(newInd);if (newInd<oldInd)var tInd=newInd+1;else var tInd=newInd;if (!this.callEvent("onBeforeCMove",[oldInd,tInd])) return false;if (oldInd==tInd)return;this.editStop();this._processAllRows("_moveColInRow",oldInd,newInd);this._processAllArrays(oldInd,newInd);if (this.fldSorted)this.setSortImgPos(this.fldSorted._cellIndex);this.callEvent("onAfterCMove",[oldInd,tInd]);};dhtmlXGridObject.prototype._swapColumns = function(cols){var z=new Array();for (var i=0;i<this._cCount;i++){var n=cols[this._c_order[i]];if (typeof(n)=="undefined") n="";z[i]=n;};return z;};dhtmlXGridObject.prototype._moveColInRow = function(row,oldInd,newInd){var c=row.childNodes[oldInd];var ci=row.childNodes[newInd+1];if (!c)return;if (ci)row.insertBefore(c,ci);else
 row.appendChild(c);for (var i=0;i<row.childNodes.length;i++)row.childNodes[i]._cellIndex=row.childNodes[i]._cellIndexS=i;};dhtmlXGridObject.prototype._addColInRow = function(row,ind,old,mod){var cind=ind;if (row._childIndexes){if (row._childIndexes[ind-1]==row._childIndexes[ind] || !row.childNodes[row._childIndexes[ind-1]]){for (var i=row._childIndexes.length;i>=ind;i--)row._childIndexes[i]=i?(row._childIndexes[i-1]+1):0;row._childIndexes[ind]--;}else
 for (var i = row._childIndexes.length;i >= ind;i--)row._childIndexes[i]=i?(row._childIndexes[i-1]+1):0;var cind=row._childIndexes[ind];};var c=row.childNodes[cind];var z=document.createElement((mod)?"TD":"TH");if (mod){z._attrs={}}else z.style.width=(parseInt(this.cellWidthPX[ind])||"100")+"px";if (c)row.insertBefore(z,c);else
 row.appendChild(z);if (this.dragAndDropOff && row.idd)this.dragger.addDraggableItem(row.childNodes[cind],this);for (var i=cind+1;i<row.childNodes.length;i++){row.childNodes[i]._cellIndex=row.childNodes[i]._cellIndexS=row.childNodes[i]._cellIndex+1;};if (row.childNodes[cind])row.childNodes[cind]._cellIndex=row.childNodes[cind]._cellIndexS=ind;if (row.idd || typeof(row.idd)!="undefined"){this.cells3(row,ind).setValue("");z.align=this.cellAlign[ind];z.style.verticalAlign=this.cellVAlign[ind];z.bgColor=this.columnColor[ind];}else if (z.tagName=="TD"){if (!row.idd && this.forceDivInHeader)z.innerHTML="<div class='hdrcell'>&nbsp;</div>";else z.innerHTML="&nbsp;";}};dhtmlXGridObject.prototype._deleteColInRow = function(row,ind){if (row._childIndexes)ind=row._childIndexes[ind];var c=row.childNodes[ind];if (!c)return;if (c.colSpan && c.colSpan>1 && c.parentNode.idd){var t=c.colSpan-1;var v=this.cells4(c).getValue();this.setColspan(c.parentNode.idd,c._cellIndex,1)
 if (t>1){var cind=c._cellIndex*1;this.setColspan(c.parentNode.idd,cind+1,t)
 this.cells(c.parentNode.idd,c._cellIndex*1+1).setValue(v)
 row._childIndexes.splice(cind,1)
 for (var i=cind;i < row._childIndexes.length;i++)row._childIndexes[i]-=1;}}else if (row._childIndexes){row._childIndexes.splice(ind,1);for (var i=ind;i<row._childIndexes.length;i++)row._childIndexes[i]--;};if (c)row.removeChild(c);for (var i=ind;i<row.childNodes.length;i++)row.childNodes[i]._cellIndex=row.childNodes[i]._cellIndexS=row.childNodes[i]._cellIndex-1;};dhtmlXGridObject.prototype.enableColumnMove = function(mode,columns){this._mCol=convertStringToBoolean(mode);if (typeof(columns)!="undefined")
 this._mCols=columns.split(",");if (!this._mmevTrue){dhtmlxEvent(this.hdr,"mousedown",this._startColumnMove);dhtmlxEvent(document.body,"mousemove",this._onColumnMove);dhtmlxEvent(document.body,"mouseup",this._stopColumnMove);this._mmevTrue=true;}};dhtmlXGridObject.prototype._startColumnMove = function(e){e=e||event;var el = e.target||e.srcElement;var zel=el;while(zel.tagName!="TABLE")zel=zel.parentNode;var grid=zel.grid;if (!grid)return;grid.setActive();if (!grid._mCol || e.button==2)return;el = grid.getFirstParentOfType(el,"TD")
 if(el.style.cursor!="default")return true;if ((grid)&&(!grid._colInMove)){grid.resized = null;if ((!grid._mCols)||(grid._mCols[el._cellIndex]=="true"))
 grid._colInMove=el._cellIndex+1;};return true;};dhtmlXGridObject.prototype._onColumnMove = function(e){e=e||event;var grid=window.globalActiveDHTMLGridObject;if ((grid)&&(grid._colInMove)){if (grid._showHContext)grid._showHContext(false)
 if (typeof(grid._colInMove)!="object"){var z=document.createElement("DIV");z._aIndex=(grid._colInMove-1);z._bIndex=null;z.innerHTML=grid.getHeaderCol(z._aIndex);z.className="dhx_dragColDiv";z.style.position="absolute";document.body.appendChild(z);grid._colInMove=z;};var cor=[];cor[0]=(document.body.scrollLeft||document.documentElement.scrollLeft);cor[1]=(document.body.scrollTop||document.documentElement.scrollTop);grid._colInMove.style.left=e.clientX+cor[0]+8+"px";grid._colInMove.style.top=e.clientY+cor[1]+8+"px";var el = e.target||e.srcElement;while ((el)&&(typeof(el._cellIndexS)=="undefined"))
 el=el.parentNode;if (grid._colInMove._oldHe){grid._colInMove._oldHe.className=grid._colInMove._oldHe.className.replace(/columnTarget(L|R)/g,"");grid._colInMove._oldHe=null;grid._colInMove._bIndex=null;};if (el){if (grid.hdr.rows[1]._childIndexes)var he=grid.hdr.rows[1].cells[grid.hdr.rows[1]._childIndexes[el._cellIndexS]];else
 var he=grid.hdr.rows[1].cells[el._cellIndexS];var z=e.clientX-(getAbsoluteLeft(he)-grid.hdrBox.scrollLeft);if (z/he.offsetWidth>0.5){he.className+=" columnTargetR";grid._colInMove._bIndex=el._cellIndexS;}else {he.className+=" columnTargetL";grid._colInMove._bIndex=el._cellIndexS-1;};if (he.offsetLeft<(grid.objBox.scrollLeft+20))
 grid.objBox.scrollLeft=Math.max(0,he.offsetLeft-20);if ((he.offsetLeft+he.offsetWidth-grid.objBox.scrollLeft)>(grid.objBox.offsetWidth-20))
 grid.objBox.scrollLeft=Math.min(grid.objBox.scrollLeft+he.offsetWidth+20,grid.objBox.scrollWidth-grid.objBox.offsetWidth);grid._colInMove._oldHe=he;};e.cancelBubble = true;return false;};return true;};dhtmlXGridObject.prototype._stopColumnMove = function(e){e=e||event;var grid=window.globalActiveDHTMLGridObject;if ((grid)&&(grid._colInMove)){if (typeof(grid._colInMove)=="object"){grid._colInMove.parentNode.removeChild(grid._colInMove);if (grid._colInMove._bIndex!=null)grid.moveColumn(grid._colInMove._aIndex,grid._colInMove._bIndex+1);if (grid._colInMove._oldHe)grid._colInMove._oldHe.className=grid._colInMove._oldHe.className.replace(/columnTarget(L|R)/g,"");grid._colInMove._oldHe=null;grid._colInMove.grid=null;grid.resized = true;};grid._colInMove=0;};return true;};dhtmlXGridObject.prototype.loadCSVFile = function(path,afterCall){this.load(path,afterCall,"csv")
};dhtmlXGridObject.prototype.enableCSVAutoID = function(mode){this._csvAID=convertStringToBoolean(mode);};dhtmlXGridObject.prototype.enableCSVHeader = function(mode){this._csvHdr=convertStringToBoolean(mode);};dhtmlXGridObject.prototype.setCSVDelimiter = function(str){this.csv.cell=str;};dhtmlXGridObject.prototype._csvAID = true;dhtmlXGridObject.prototype.loadCSVString = function(str){this.parse(str,"csv")
};dhtmlXGridObject.prototype.serializeToCSV = function(textmode){this.editStop()
 if (this._mathSerialization)this._agetm="getMathValue";else if (this._strictText || textmode)this._agetm="getTitle";else this._agetm="getValue";var out=[];if (this._csvHdr){for (var j=1;j < this.hdr.rows.length;j++){var a=[];for (var i=0;i<this._cCount;i++)if ((!this._srClmn)||(this._srClmn[i]))
 a.push(this.getColumnLabel(i,j-1));out.push(a.join(this.csv.cell));}};var i=0;var leni=this.rowsBuffer.length;for(i;i<leni;i++){var temp=this._serializeRowToCVS(null,i) 
 if (temp!="")out.push(temp);};return out.join(this.csv.row);};dhtmlXGridObject.prototype._serializeRowToCVS = function(r,i,start,end){var out = new Array();if (!r){r=this.render_row(i)
 if (this._fake && !this._fake.rowsAr[r.idd])this._fake.render_row(i);};if (!this._csvAID)out[out.length]=r.idd;start = start||0;end = end||this._cCount;var changeFl=false;var ind=start;while (r.childNodes[start]._cellIndex>ind && start)start--;for(var jj=start;ind<end;jj++){if (!r.childNodes[jj])break;var real_ind=r.childNodes[jj]._cellIndex;if ((!this._srClmn)||(this._srClmn[real_ind])){var cvx=r.childNodes[jj];var zx=this.cells(r.idd,real_ind);while (ind!=real_ind){ind++;out.push("")
 if (ind>=end)break;};if (ind>=end)break;ind++;if (zx.cell)zxVal=zx[this._agetm]();else zxVal="";if ((this._chAttr)&&(zx.wasChanged()))
 changeFl=true;out[out.length]=((zxVal===null)?"":zxVal)

 if ( this._ecspn && cvx.colSpan && cvx.colSpan >1 ){cvx=cvx.colSpan-1;for (var u=0;u<cvx;u++){out[out.length] = "";ind++;}}}else ind++;};if ((this._onlChAttr)&&(!changeFl)) return "";return out.join(this.csv.cell);};dhtmlXGridObject.prototype.toClipBoard=function(val){if (window.clipboardData)window.clipboardData.setData("Text",val);else
 (new Clipboard()).copy(val);};dhtmlXGridObject.prototype.fromClipBoard=function(){if (window.clipboardData)return window.clipboardData.getData("Text");else
 return (new Clipboard()).paste();};dhtmlXGridObject.prototype.cellToClipboard = function(rowId,cellInd){if ((!rowId)||(!cellInd)){if (!this.selectedRows[0])return;rowId=this.selectedRows[0].idd;cellInd=this.cell._cellIndex;};var ed=this.cells(rowId,cellInd);this.toClipBoard(((ed.getLabel?ed.getLabel():ed.getValue())||"").toString());};dhtmlXGridObject.prototype.updateCellFromClipboard = function(rowId,cellInd){if ((!rowId)||(!cellInd)){if (!this.selectedRows[0])return;rowId=this.selectedRows[0].idd;cellInd=this.cell._cellIndex;};var ed=this.cells(rowId,cellInd);ed[ed.setImage?"setLabel":"setValue"](this.fromClipBoard());};dhtmlXGridObject.prototype.rowToClipboard = function(rowId){var out="";if (this._mathSerialization)this._agetm="getMathValue";else if (this._strictText)this._agetm="getTitle";else this._agetm="getValue";if (rowId)out=this._serializeRowToCVS(this.getRowById(rowId));else
 for (var i=0;i<this.selectedRows.length;i++){if (out)out+=this.csv.row;out+=this._serializeRowToCVS(this.selectedRows[i]);};this.toClipBoard(out);};dhtmlXGridObject.prototype.updateRowFromClipboard = function(rowId){var csv=this.fromClipBoard();if (!csv)return;if (rowId)var r=this.getRowById(rowId);else
 var r=this.selectedRows[0];if (!r)return;csv=(csv.split(this.csv.row)[0]).split(this.csv.cell);if (!this._csvAID)csv.splice(0,1);for (var i=0;i<csv.length;i++){var ed=this.cells3(r,i);ed[ed.setImage?"setLabel":"setValue"](csv[i]);}};dhtmlXGridObject.prototype.addRowFromClipboard = function(){var csv=this.fromClipBoard();if (!csv)return;var z=csv.split(this.csv.row);for (var i=0;i<z.length;i++)if (z[i]){csv=z[i].split(this.csv.cell);if (this._csvAID)this.addRow(this.getRowsNum()+2,csv);else{if (this.rowsAr[csv[0]])csv[0]=this.uid();this.addRow(csv[0],csv.slice(1));}}};dhtmlXGridObject.prototype.gridToClipboard = function(){this.toClipBoard(this.serializeToCSV());};dhtmlXGridObject.prototype.gridFromClipboard = function(){var csv=this.fromClipBoard();if (!csv)return;this.loadCSVString(csv);};dhtmlXGridObject.prototype.getXLS = function(path){if (!this.xslform){this.xslform=document.createElement("FORM");this.xslform.action=(path||"")+"xls.php";this.xslform.method="post";this.xslform.target=(_isIE?"_blank":"");document.body.appendChild(this.xslform);var i1=document.createElement("INPUT");i1.type="hidden";i1.name="csv";this.xslform.appendChild(i1);var i2=document.createElement("INPUT");i2.type="hidden";i2.name="csv_header";this.xslform.appendChild(i2);};var cvs = this.serializeToCSV();this.xslform.childNodes[0].value = cvs;var cvs_header = [];var l = this._cCount;for (var i=0;i<l;i++){cvs_header.push(this.getHeaderCol(i));};cvs_header = cvs_header.join(',');this.xslform.childNodes[1].value = cvs_header;this.xslform.submit();};dhtmlXGridObject.prototype.printView = function(before,after){var html="<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 st_hr=null;if (this._fake){st_hr=[].concat(this._hrrar);for (var i=0;i<this._fake._cCount;i++)this._hrrar[i]=null;};html+="<base href='"+document.location.href+"'></base>";if (!this.parentGrid)html+=(before||"");html += '<table width="100%" border="2px" cellpadding="0" cellspacing="0">';var row_length = Math.max(this.rowsBuffer.length,this.rowsCol.length);var col_length = this._cCount;var width = this._printWidth();html += '<tr class="header_row_1">';for (var i=0;i<col_length;i++){if (this._hrrar && this._hrrar[i])continue;var hcell=this.hdr.rows[1].cells[this.hdr.rows[1]._childIndexes?this.hdr.rows[1]._childIndexes[parseInt(i)]:i];var colspan=(hcell.colSpan||1);var rowspan=(hcell.rowSpan||1);for (var j=1;j<colspan;j++)width[i]+=width[j];html += '<td rowspan="'+rowspan+'" width="'+width[i]+'%" style="background-color:lightgrey;" colspan="'+colspan+'">'+this.getHeaderCol(i)+'</td>';i+=colspan-1;};html += '</tr>';for (var i=2;i<this.hdr.rows.length;i++){if (_isIE){html+="<tr style='background-color:lightgrey' class='header_row_"+i+"'>";var cells=this.hdr.rows[i].childNodes;for (var j=0;j < cells.length;j++)if (!this._hrrar || !this._hrrar[cells[j]._cellIndex]){html+=cells[j].outerHTML;};html+="</tr>";}else
 html+="<tr class='header_row_"+i+"' style='background-color:lightgrey'>"+(this._fake?this._fake.hdr.rows[i].innerHTML:"")+this.hdr.rows[i].innerHTML+"</tr>";};for (var i=0;i<row_length;i++){html += '<tr>';if (this.rowsCol[i] && this.rowsCol[i]._cntr){html+=this.rowsCol[i].innerHTML.replace(/<img[^>]*>/gi,"")+'</tr>';continue;};if (this.rowsCol[i] && this.rowsCol[i].style.display=="none")continue;var row_id
 if (this.rowsCol[i])row_id=this.rowsCol[i].idd;else if (this.rowsBuffer[i])row_id=this.rowsBuffer[i].idd;else continue;for (var j=0;j<col_length;j++){if (this._hrrar && this._hrrar[j])continue;if(this.rowsAr[row_id] && this.rowsAr[row_id].tagName=="TR"){var c=this.cells(row_id, j);if (c._setState)var value="";else if (c.getContent)value = c.getContent();else if (c.getImage || c.combo)var value=c.cell.innerHTML;else var value = c.getValue();}else 
 var value=this._get_cell_value(this.rowsBuffer[i],j);var color = this.columnColor[j]?'background-color:'+this.columnColor[j]+';':'';var align = this.cellAlign[j]?'text-align:'+this.cellAlign[j]+';':'';var cspan = c.getAttribute("colspan");html += '<td style="'+color+align+'" '+(cspan?'colSpan="'+cspan+'"':'')+'>'+(value===""?"&nbsp;":value)+'</td>';if (cspan)j+=cspan-1;};html += '</tr>';if (this.rowsCol[i] && this.rowsCol[i]._expanded){var sub=this.cells4(this.rowsCol[i]._expanded.ctrl);if (sub.getSubGrid)html += '<tr><td colspan="'+col_length+'">'+sub.getSubGrid().printView()+'</td></tr>';else
 html += '<tr><td colspan="'+col_length+'">'+this.rowsCol[i]._expanded.innerHTML+'</td></tr>';}};if (this.ftr)for (var i=1;i<this.ftr.childNodes[0].rows.length;i++)html+="<tr style='background-color:lightgrey'>"+((this._fake)?this._fake.ftr.childNodes[0].rows[i].innerHTML:"")+this.ftr.childNodes[0].rows[i].innerHTML+"</tr>";html += '</table>';if (this.parentGrid)return html;html+=(after||"");var d = window.open('', '_blank');d.document.write(html);d.document.write("<script>window.onerror=function(){return true;}</script>");d.document.close();if (this._fake){this._hrrar=st_hr;}};dhtmlXGridObject.prototype._printWidth=function(){var width = [];var total_width = 0;for (var i=0;i<this._cCount;i++){var w = this.getColWidth(i);width.push(w);total_width += w;};var percent_width = [];var total_percent_width = 0;for (var i=0;i<width.length;i++){var p = Math.floor((width[i]/total_width)*100);total_percent_width += p;percent_width.push(p);};percent_width[percent_width.length-1] += 100-total_percent_width;return percent_width;};dhtmlXGridObject.prototype.loadObject = function(obj){};dhtmlXGridObject.prototype.loadJSONFile = function(path){};dhtmlXGridObject.prototype.serializeToObject = function(){};dhtmlXGridObject.prototype.serializeToJSON = function(){};if (!window.clipboardData)window.clipboardData={_make:function(){var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);if (!clip)return null;var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);if (!trans)return null;trans.addDataFlavor('text/unicode');var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);this._p=[clip,trans,str];return true;},
 setData:function(type,text){try{netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');}catch(e){dhtmlxError.throwError("Clipboard","Access to clipboard denied",[type,text]);return "";};if (!this._make()) return false;this._p[2].data=text;this._p[1].setTransferData("text/unicode",this._p[2],text.length*2);var clipid=Components.interfaces.nsIClipboard;this._p[0].setData(this._p[1],null,clipid.kGlobalClipboard);},
 getData:function(type){try{netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');}catch(e){dhtmlxError.throwError("Clipboard","Access to clipboard denied",[type]);return "";};if (!this._make()) return false;this._p[0].getData(this._p[1],this._p[0].kGlobalClipboard);var strLength = new Object();var str = new Object();try{this._p[1].getTransferData("text/unicode",str,strLength);}catch(e){return "";};if (str)str = str.value.QueryInterface(Components.interfaces.nsISupportsString);if (str)return str.data.substring(0,strLength.value / 2);return "";}};dhtmlXGridObject.prototype.enableBlockSelection = function(mode)
{if (typeof this._bs_mode == "undefined"){var self = this;this.obj.onmousedown = function(e) {if (self._bs_mode)self._OnSelectionStart((e||event),this);return true;};this._CSVRowDelimiter = this.csv.row;this.attachEvent("onResize", function() {self._HideSelection();return true;});this.attachEvent("onFilterEnd",this._HideSelection);};if (mode===false){this._bs_mode=false;return this._HideSelection();}else this._bs_mode=true;};dhtmlXGridObject.prototype.forceLabelSelection = function(mode)
{this._strictText = convertStringToBoolean(mode)
};dhtmlXGridObject.prototype.disableBlockSelection = function()
{this.obj.onmousedown = null;};dhtmlXGridObject.prototype._OnSelectionStart = function(event, obj)
{var self = this;if (event.button == 2)return;var src = event.srcElement || event.target;if (this.editor){if (src.tagName && (src.tagName=="INPUT" || src.tagName=="TEXTAREA")) return;this.editStop();};if (!self.isActive)self.setActive(true);var pos = this.getPosition(this.obj);var x = event.clientX - pos[0] +document.body.scrollLeft;var y = event.clientY - pos[1] +document.body.scrollTop;this._CreateSelection(x-4, y-4);if (src == this._selectionObj){this._HideSelection();this._startSelectionCell = null;}else {while (src.tagName.toLowerCase()!= 'td')
 src = src.parentNode;this._startSelectionCell = src;};this.obj.onmousedown = null;this.obj[_isIE?"onmouseleave":"onmouseout"] = function(e){if (self._blsTimer)window.clearTimeout(self._blsTimer);};this.obj.onmmold=this.obj.onmousemove;this._init_pos=[x,y];this._selectionObj.onmousemove = this.obj.onmousemove = function(e) {e = e||event;e.returnValue = false;self._OnSelectionMove(e);};this._oldDMP=document.body.onmouseup;document.body.onmouseup = function(e) {e = e||event;self._OnSelectionStop(e, this);return true;};document.body.onselectstart = function(){return false}};dhtmlXGridObject.prototype._getCellByPos = function(x,y){x=x;y=y;var _x=0;for (var i=0;i < this.obj.rows.length;i++){y-=this.obj.rows[i].offsetHeight;if (y<=0){_x=this.obj.rows[i];break;}};if (!_x || !_x.idd)return null;for (var i=0;i < this._cCount;i++){x-=this.obj.rows[0].childNodes[i].offsetWidth;if (x<=0){while(true){if (_x._childIndexes && _x._childIndexes[i+1]==_x._childIndexes[i])_x=_x.previousSibling;else 
 return this.cells(_x.idd,i).cell;}}};return null;};dhtmlXGridObject.prototype._OnSelectionMove = function(event)
{var self=this;this._ShowSelection();var pos = this.getPosition(this.obj);var X = event.clientX - pos[0]+document.body.scrollLeft;var Y = event.clientY - pos[1]+document.body.scrollTop;if ((Math.abs(this._init_pos[0]-X)<5) && (Math.abs(this._init_pos[1]-Y)<5)) return this._HideSelection();if(this._startSelectionCell==null)this._endSelectionCell = this._startSelectionCell = this.getFirstParentOfType(event.srcElement || event.target,"TD");else
 if (event.srcElement || event.target){if ((event.srcElement || event.target).className == "dhtmlxGrid_selection")
 this._endSelectionCell=(this._getCellByPos(X,Y)||this._endSelectionCell);else {var t = this.getFirstParentOfType(event.srcElement || event.target,"TD");if (t.parentNode.idd)this._endSelectionCell = t;}};var BottomRightX = this.objBox.scrollLeft + this.objBox.clientWidth;var BottomRightY = this.objBox.scrollTop + this.objBox.clientHeight;var TopLeftX = this.objBox.scrollLeft;var TopLeftY = this.objBox.scrollTop;var nextCall=false;if (this._blsTimer)window.clearTimeout(this._blsTimer);if (X+20 >= BottomRightX){this.objBox.scrollLeft = this.objBox.scrollLeft+20;nextCall=true;}else if (X-20 < TopLeftX){this.objBox.scrollLeft = this.objBox.scrollLeft-20;nextCall=true;};if (Y+20 >= BottomRightY && !this._realfake){this.objBox.scrollTop = this.objBox.scrollTop+20;nextCall=true;}else if (Y-20 < TopLeftY && !this._realfake){this.objBox.scrollTop = this.objBox.scrollTop-20;nextCall=true;};this._selectionArea = this._RedrawSelectionPos(this._startSelectionCell, this._endSelectionCell);if (nextCall){var a=event.clientX;var b=event.clientY;this._blsTimer=window.setTimeout(function(){self._OnSelectionMove({clientX:a,clientY:b})},100);}};dhtmlXGridObject.prototype._OnSelectionStop = function(event)
{var self = this;if (this._blsTimer)window.clearTimeout(this._blsTimer);this.obj.onmousedown = function(e) {if (self._bs_mode)self._OnSelectionStart((e||event), 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 src = this.getFirstParentOfType(event.srcElement || event.target,"TD");if ((!src)|| (!src.parentNode.idd)){src=this._endSelectionCell;};if (!src)return this._HideSelection();while (src.tagName.toLowerCase()!= 'td')
 src = src.parentNode;this._stopSelectionCell = src;this._selectionArea = this._RedrawSelectionPos(this._startSelectionCell, this._stopSelectionCell);this.callEvent("onBlockSelected",[]);};document.body.onselectstart = function(){}};dhtmlXGridObject.prototype._RedrawSelectionPos = function(LeftTop, RightBottom)
{var pos = {};pos.LeftTopCol = LeftTop._cellIndex;pos.LeftTopRow = this.getRowIndex( LeftTop.parentNode.idd );pos.RightBottomCol = RightBottom._cellIndex;pos.RightBottomRow = this.getRowIndex( RightBottom.parentNode.idd );var LeftTop_width = LeftTop.offsetWidth;var LeftTop_height = LeftTop.offsetHeight;LeftTop = this.getPosition(LeftTop, this.obj);var RightBottom_width = RightBottom.offsetWidth;var RightBottom_height = RightBottom.offsetHeight;RightBottom = this.getPosition(RightBottom, this.obj);if (LeftTop[0] < RightBottom[0]){var Left = LeftTop[0];var Right = RightBottom[0] + RightBottom_width;}else {var foo = pos.RightBottomCol;pos.RightBottomCol = pos.LeftTopCol;pos.LeftTopCol = foo;var Left = RightBottom[0];var Right = LeftTop[0] + LeftTop_width;};if (LeftTop[1] < RightBottom[1]){var Top = LeftTop[1];var Bottom = RightBottom[1] + RightBottom_height;}else {var foo = pos.RightBottomRow;pos.RightBottomRow = pos.LeftTopRow;pos.LeftTopRow = foo;var Top = RightBottom[1];var Bottom = LeftTop[1] + LeftTop_height;};var Width = Right - Left;var Height = Bottom - Top;this._selectionObj.style.left = Left + 'px';this._selectionObj.style.top = Top + 'px';this._selectionObj.style.width = Width + 'px';this._selectionObj.style.height = Height + 'px';return pos;};dhtmlXGridObject.prototype._CreateSelection = function(x, y)
{if (this._selectionObj == null){var div = document.createElement('div');div.style.position = 'absolute';div.style.display = 'none';div.className = 'dhtmlxGrid_selection';this._selectionObj = div;this._selectionObj.onmousedown = function(e){e=e||event;if (e.button==2 || (_isMacOS&&e.ctrlKey))
 return this.parentNode.grid.callEvent("onBlockRightClick", ["BLOCK",e]);};this._selectionObj.oncontextmenu=function(e){(e||event).cancelBubble=true;return false;};this.objBox.appendChild(this._selectionObj);};this._selectionObj.style.width = '0px';this._selectionObj.style.height = '0px';this._selectionObj.style.left = x + 'px';this._selectionObj.style.top = y + 'px';this._selectionObj.startX = x;this._selectionObj.startY = y;};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;};dhtmlXGridObject.prototype.copyBlockToClipboard = function()
{if ( this._selectionArea != null ){var serialized = new Array();if (this._mathSerialization)this._agetm="getMathValue";else if (this._strictText)this._agetm="getTitle";else this._agetm="getValue";for (var i=this._selectionArea.LeftTopRow;i<=this._selectionArea.RightBottomRow;i++){var data = this._serializeRowToCVS(this.rowsBuffer[i], null, this._selectionArea.LeftTopCol, this._selectionArea.RightBottomCol+1);if (!this._csvAID)serialized[serialized.length] = data.substr( data.indexOf( this.csv.cell ) + 1 );else
 serialized[serialized.length] = data;};serialized = serialized.join(this._CSVRowDelimiter);this.toClipBoard(serialized);}};dhtmlXGridObject.prototype.pasteBlockFromClipboard = function()
{var serialized = this.fromClipBoard();if (this._selectionArea != null){var startRow = this._selectionArea.LeftTopRow;var startCol = this._selectionArea.LeftTopCol;}else if (this.cell != null && !this.editor){var startRow = this.getRowIndex( this.cell.parentNode.idd );var startCol = this.cell._cellIndex;}else {return false;};serialized = serialized.split(this._CSVRowDelimiter);if ((serialized.length >1)&&(serialized[serialized.length-1]==""))
 serialized.splice(serialized.length-1,1);for (var i=0;i<serialized.length;i++){serialized[i] = serialized[i].split(this.csv.cell);};var endRow = startRow+serialized.length;var endCol = startCol+serialized[0].length;if (endCol > this._cCount)endCol = this._cCount;var k = 0;for (var i=startRow;i<endRow;i++){var row = this.render_row(i);if (row==-1)continue;var l = 0;for (var j=startCol;j<endCol;j++){var ed = this.cells3(row, j);if (ed.isDisabled()) {l++;continue;};if (this._onEditUndoRedo)this._onEditUndoRedo(2, row.idd, j, serialized[ k ][ l ], ed.getValue());if (ed.combo){var comboVa = ed.combo.values;for(var n=0;n<comboVa.length;n++)if (serialized[ k ][ l ] == comboVa[n]){ed.setValue( ed.combo.keys[ n ]);comboVa=null;break;};if (comboVa!=null)ed.setValue( serialized[ k ][ l++ ] );else l++;}else
 ed[ ed.setImage ? "setLabel" : "setValue" ]( serialized[ k ][ l++ ] );ed.cell.wasChanged=true;};this.callEvent("onRowPaste",[row.idd])
 k++;}};dhtmlXGridObject.prototype.enablePaging = function(fl,pageSize,pagesInGrp,parentObj,showRecInfo,recInfoParentObj){this._pgn_parentObj = typeof(parentObj)=="string" ? document.getElementById(parentObj) : parentObj;this._pgn_recInfoParentObj = typeof(recInfoParentObj)=="string" ? document.getElementById(recInfoParentObj) : recInfoParentObj;this.pagingOn = fl;this.showRecInfo = showRecInfo;this.rowsBufferOutSize = parseInt(pageSize);this.currentPage = 1;this.pagesInGroup = parseInt(pagesInGrp);this._init_pgn_events()
 this.setPagingSkin("default");};dhtmlXGridObject.prototype.setXMLAutoLoading = function(filePath,bufferSize){this.xmlFileUrl = filePath;this._dpref = bufferSize;};dhtmlXGridObject.prototype.changePageRelative = function(ind){this.changePage(this.currentPage+ind);};dhtmlXGridObject.prototype.changePage = function(pageNum){if (arguments.length==0)pageNum=this.currentPage||0;pageNum=parseInt(pageNum);pageNum=Math.max(1,Math.min(pageNum,Math.ceil(this.rowsBuffer.length/this.rowsBufferOutSize)));if(!this.callEvent("onBeforePageChanged",[this.currentPage,pageNum]))
 return;this.currentPage = parseInt(pageNum);this._reset_view();this._fixAlterCss();this.callEvent("onPageChanged",this.getStateOfView());};dhtmlXGridObject.prototype.setPagingSkin = function(name){this._pgn_skin=this["_pgn_"+name];if (name=="toolbar")this._pgn_skin_tlb=arguments[1];};dhtmlXGridObject.prototype.setPagingTemplates = function(a,b){this._pgn_templateA=this._pgn_template_compile(a);this._pgn_templateB=this._pgn_template_compile(b);this._page_skin_update();};dhtmlXGridObject.prototype._page_skin_update = function(name){if (!this.pagesInGroup)this.pagesInGroup=Math.ceil(Math.min(5,this.rowsBuffer.length/this.rowsBufferOutSize));var totalPages=Math.ceil(this.rowsBuffer.length/this.rowsBufferOutSize);if (totalPages && totalPages<this.currentPage)return this.changePage(totalPages);if (this.pagingOn && this._pgn_skin)this._pgn_skin.apply(this,this.getStateOfView());};dhtmlXGridObject.prototype._init_pgn_events = function(name){this.attachEvent("onXLE",this._page_skin_update)
 this.attachEvent("onClearAll",this._page_skin_update)
 this.attachEvent("onPageChanged",this._page_skin_update)
 this.attachEvent("onGridReconstructed",this._page_skin_update)
 
 this._init_pgn_events=function(){}};dhtmlXGridObject.prototype._pgn_default=function(page,start,end){if (!this.pagingBlock){this.pagingBlock = document.createElement("DIV");this.pagingBlock.className = "pagingBlock";this.recordInfoBlock = document.createElement("SPAN");this.recordInfoBlock.className = "recordsInfoBlock";if (!this._pgn_parentObj)return;this._pgn_parentObj.appendChild(this.pagingBlock)
 if(this._pgn_recInfoParentObj && this.showRecInfo)this._pgn_recInfoParentObj.appendChild(this.recordInfoBlock)
 
 
 if (!this._pgn_templateA){this._pgn_templateA=this._pgn_template_compile("[prevpages:&lt:&nbsp;] [currentpages:,&nbsp;] [nextpages:&gt:&nbsp;]");this._pgn_templateB=this._pgn_template_compile("Results <b>[from]-[to]</b> of <b>[total]</b>");}};var details=this.getStateOfView();this.pagingBlock.innerHTML = this._pgn_templateA.apply(this,details);this.recordInfoBlock.innerHTML = this._pgn_templateB.apply(this,details);this._pgn_template_active(this.pagingBlock);this._pgn_template_active(this.recordInfoBlock);this.callEvent("onPaging",[]);};dhtmlXGridObject.prototype._pgn_block=function(sep){var start=Math.floor((this.currentPage-1)/this.pagesInGroup)*this.pagesInGroup;var max=Math.min(Math.ceil(this.rowsBuffer.length/this.rowsBufferOutSize),start+this.pagesInGroup);var str=[];for (var i=start+1;i<=max;i++)if (i==this.currentPage)str.push("<a class='dhx_not_active'><b>"+i+"</b></a>");else
 str.push("<a onclick='this.grid.changePage("+i+");return false;'>"+i+"</a>");return str.join(sep);};dhtmlXGridObject.prototype._pgn_link=function(mode,ac,ds){if (mode=="prevpages" || mode=="prev"){if (this.currentPage==1)return ds;return '<a onclick=\'this.grid.changePageRelative(-1*'+(mode=="prev"?'1':'this.grid.pagesInGroup')+');return false;\'>'+ac+'</a>'
 };if (mode=="nextpages" || mode=="next"){if (this.rowsBuffer.length/this.rowsBufferOutSize <= this.currentPage )return ds;if (this.rowsBuffer.length/(this.rowsBufferOutSize*(mode=="next"?'1':this.pagesInGroup)) <= 1 ) return ds;return '<a onclick=\'this.grid.changePageRelative('+(mode=="next"?'1':'this.grid.pagesInGroup')+');return false;\'>'+ac+'</a>'
 };if (mode=="current"){var i=this.currentPage+(ac?parseInt(ac):0);if (i<1 || Math.ceil(this.rowsBuffer.length/this.rowsBufferOutSize)< i ) return ds;return '<a '+(i==this.currentPage?"class='dhx_active_page_link' ":"")+'onclick=\'this.grid.changePage('+i+');return false;\'>'+i+'</a>'
 };return ac;};dhtmlXGridObject.prototype._pgn_template_active=function(block){var tags=block.getElementsByTagName("A");if (tags)for (var i=0;i < tags.length;i++){tags[i].grid=this;}};dhtmlXGridObject.prototype._pgn_template_compile=function(template){template=template.replace(/\[([^\]]*)\]/g,function(a,b){b=b.split(":");switch (b[0]){case "from": 
 return '"+(arguments[1]*1+(arguments[2]*1?1:0))+"';case "total":
 return '"+arguments[3]+"';case "to":
 return '"+arguments[2]+"';case "current":
 case "prev":
 case "next":
 case "prevpages":
 case "nextpages":
 return '"+this._pgn_link(\''+b[0]+'\',\''+b[1]+'\',\''+b[2]+'\')+"'
 case "currentpages":
 return '"+this._pgn_block(\''+b[1]+'\')+"'
 }})
 return new Function('return "'+template+'";')
};dhtmlXGridObject.prototype.i18n.paging={results:"Results",
 records:"Records from ",
 to:" to ",
 page:"Page ",
 perpage:"rows per page",
 first:"To first Page",
 previous:"Previous Page",
 found:"Found records",
 next:"Next Page",
 last:"To last Page",
 of:" of ",
 notfound:"No Records Found"
};dhtmlXGridObject.prototype.setPagingWTMode = function(navButtons,navLabel,pageSelect,perPageSelect){this._WTDef=[navButtons,navLabel,pageSelect,perPageSelect];};dhtmlXGridObject.prototype._pgn_bricks = function(page, start, end){var tmp = (this.skin_name||"").split("_")[1];var sfx="";if(tmp=="light" || tmp=="modern" || tmp=="skyblue")sfx = "_"+tmp;this.pagerElAr = new Array();this.pagerElAr["pagerCont"] = document.createElement("DIV");this.pagerElAr["pagerBord"] = document.createElement("DIV");this.pagerElAr["pagerLine"] = document.createElement("DIV");this.pagerElAr["pagerBox"] = document.createElement("DIV");this.pagerElAr["pagerInfo"] = document.createElement("DIV");this.pagerElAr["pagerInfoBox"] = document.createElement("DIV");var se = (this.globalBox||this.objBox);this.pagerElAr["pagerCont"].style.width = se.clientWidth+"px";this.pagerElAr["pagerCont"].style.overflow = "hidden";this.pagerElAr["pagerCont"].style.clear = "both";this.pagerElAr["pagerBord"].className = "dhx_pbox"+sfx;this.pagerElAr["pagerLine"].className = "dhx_pline"+sfx;this.pagerElAr["pagerBox"].style.clear = "both";this.pagerElAr["pagerInfo"].className = "dhx_pager_info"+sfx;this.pagerElAr["pagerCont"].appendChild(this.pagerElAr["pagerBord"]);this.pagerElAr["pagerCont"].appendChild(this.pagerElAr["pagerLine"]);this.pagerElAr["pagerCont"].appendChild(this.pagerElAr["pagerInfo"]);this.pagerElAr["pagerLine"].appendChild(this.pagerElAr["pagerBox"]);this.pagerElAr["pagerInfo"].appendChild(this.pagerElAr["pagerInfoBox"]);this._pgn_parentObj.innerHTML = "";this._pgn_parentObj.appendChild(this.pagerElAr["pagerCont"]);if(this.rowsBuffer.length>0){var lineWidth = 20;var lineWidthInc = 22;if(page>this.pagesInGroup){var pageCont = document.createElement("DIV");var pageBox = document.createElement("DIV");pageCont.className = "dhx_page"+sfx;pageBox.innerHTML = "&larr;";pageCont.appendChild(pageBox);this.pagerElAr["pagerBox"].appendChild(pageCont);var self = this;pageCont.pgnum = (Math.ceil(page/this.pagesInGroup)-1)*this.pagesInGroup;pageCont.onclick = function(){self.changePage(this.pgnum);};lineWidth +=lineWidthInc;};for(var i=1;i<=this.pagesInGroup;i++){var pageCont = document.createElement("DIV");var pageBox = document.createElement("DIV");pageCont.className = "dhx_page"+sfx;pageNumber = ((Math.ceil(page/this.pagesInGroup)-1)*this.pagesInGroup)+i;if(pageNumber>Math.ceil(this.rowsBuffer.length/this.rowsBufferOutSize))
 break;pageBox.innerHTML = pageNumber;pageCont.appendChild(pageBox);if(page==pageNumber){pageCont.className += " dhx_page_active"+sfx;pageBox.className = "dhx_page_active"+sfx;}else{var self = this;pageCont.pgnum = pageNumber;pageCont.onclick = function(){self.changePage(this.pgnum);}};lineWidth +=(parseInt(lineWidthInc/3)*pageNumber.toString().length)+15;pageBox.style.width = (parseInt(lineWidthInc/3)*pageNumber.toString().length)+8+"px";this.pagerElAr["pagerBox"].appendChild(pageCont);};if(Math.ceil(page/this.pagesInGroup)*this.pagesInGroup<Math.ceil(this.rowsBuffer.length/this.rowsBufferOutSize)){var pageCont = document.createElement("DIV");var pageBox = document.createElement("DIV");pageCont.className = "dhx_page"+sfx;pageBox.innerHTML = "&rarr;";pageCont.appendChild(pageBox);this.pagerElAr["pagerBox"].appendChild(pageCont);var self = this;pageCont.pgnum = (Math.ceil(page/this.pagesInGroup)*this.pagesInGroup)+1;pageCont.onclick = function(){self.changePage(this.pgnum);};lineWidth +=lineWidthInc;};this.pagerElAr["pagerLine"].style.width = lineWidth+"px";};if(this.rowsBuffer.length>0 && this.showRecInfo)this.pagerElAr["pagerInfoBox"].innerHTML = this.i18n.paging.records+(start+1)+this.i18n.paging.to+end+this.i18n.paging.of+this.rowsBuffer.length;else if(this.rowsBuffer.length==0){this.pagerElAr["pagerLine"].parentNode.removeChild(this.pagerElAr["pagerLine"]);this.pagerElAr["pagerInfoBox"].innerHTML = this.i18n.paging.notfound;};this.pagerElAr["pagerBox"].appendChild(document.createElement("SPAN")).innerHTML = "&nbsp;";this.pagerElAr["pagerBord"].appendChild(document.createElement("SPAN")).innerHTML = "&nbsp;";this.pagerElAr["pagerCont"].appendChild(document.createElement("SPAN")).innerHTML = "&nbsp;";this.callEvent("onPaging",[]);};dhtmlXGridObject.prototype._pgn_toolbar = function(page, start, end){if (!this.aToolBar)this.aToolBar=this._pgn_createToolBar();var totalPages=Math.ceil(this.rowsBuffer.length/this.rowsBufferOutSize);if (this._WTDef[0]){this.aToolBar.enableItem("right");this.aToolBar.enableItem("rightabs");this.aToolBar.enableItem("left");this.aToolBar.enableItem("leftabs");if(this.currentPage>=totalPages){this.aToolBar.disableItem("right");this.aToolBar.disableItem("rightabs");};if(this.currentPage==1){this.aToolBar.disableItem("left");this.aToolBar.disableItem("leftabs");}};if (this._WTDef[2]){var that=this;this.aToolBar.forEachListOption("pages", function(id){that.aToolBar.removeListOption("pages",id);});for(var i=0;i<totalPages;i++){this.aToolBar.addListOption('pages', 'pages_'+(i+1), NaN, "button", this.i18n.paging.page+(i+1));};this.aToolBar.setItemText("pages","<div style='width:100%;text-align:right'>"+this.i18n.paging.page+page+"</div>");};if (this._WTDef[1]){if (!this.getRowsNum())
 this.aToolBar.setItemText('results',this.i18n.paging.notfound);else
 this.aToolBar.setItemText('results',"<div style='width:100%;text-align:center'>"+this.i18n.paging.records+(start+1)+this.i18n.paging.to+end+"</div>");};if (this._WTDef[3])this.aToolBar.setItemText("perpagenum","<div style='width:100%;text-align:right'>"+this.rowsBufferOutSize.toString()+" "+this.i18n.paging.perpage+"</div>");this.callEvent("onPaging",[]);};dhtmlXGridObject.prototype._pgn_createToolBar = function(){this.aToolBar = new dhtmlXToolbarObject(this._pgn_parentObj,(this._pgn_skin_tlb||"dhx_blue"));if (!this._WTDef)this.setPagingWTMode(true,true,true,true);var self=this;this.aToolBar.attachEvent("onClick",function(val){val=val.split("_")
 switch (val[0]){case "leftabs":
 self.changePage(1);break;case "left":
 self.changePage(self.currentPage-1);break;case "rightabs":
 self.changePage(99999);break;case "right":
 self.changePage(self.currentPage+1);break;case "perpagenum":
 if (val[1]===this.undefined)return;self.rowsBufferOutSize = parseInt(val[1]);self.changePage();self.aToolBar.setItemText("perpagenum","<div style='width:100%;text-align:right'>"+val[1]+" "+self.i18n.paging.perpage+"</div>");break;case "pages":
 if (val[1]===this.undefined)return;self.changePage(val[1]);self.aToolBar.setItemText("pages","<div style='width:100%;text-align:right'>"+self.i18n.paging.page+val[1]+"</div>");break;}})
 
 if (this._WTDef[0]){this.aToolBar.addButton("leftabs", NaN, "", this.imgURL+'ar_left_abs.gif', this.imgURL+'ar_left_abs_dis.gif');this.aToolBar.setWidth("leftabs","20")
 this.aToolBar.addButton("left", NaN, "", this.imgURL+'ar_left.gif', this.imgURL+'ar_left_dis.gif');this.aToolBar.setWidth("left","20")
 };if (this._WTDef[1]){this.aToolBar.addText("results",NaN,this.i18n.paging.results)
 this.aToolBar.setWidth("results","150")
 };if (this._WTDef[0]){this.aToolBar.addButton("right", NaN, "", this.imgURL+'ar_right.gif', this.imgURL+'ar_right_dis.gif');this.aToolBar.setWidth("right","20")
 this.aToolBar.addButton("rightabs", NaN, "", this.imgURL+'ar_right_abs.gif', this.imgURL+'ar_right_abs_dis.gif');this.aToolBar.setWidth("rightabs","20")
 };if (this._WTDef[2]){this.aToolBar.addButtonSelect("pages", NaN, "select page",[]);this.aToolBar.setWidth("pages","75")
 };var arr;if (arr = this._WTDef[3]){this.aToolBar.addButtonSelect("perpagenum", NaN, "select size",[]);if(typeof arr != "object")arr = [5,10,15,20,25,30];for (var k=0;k<arr.length;k++)this.aToolBar.addListOption('perpagenum', 'perpagenum_'+arr[k], NaN, "button", arr[k]+" "+this.i18n.paging.perpage);this.aToolBar.setWidth("perpagenum","135");};this.aToolBar.disableItem("results");return this.aToolBar;};dhtmlXGridObject.prototype.hidePivot=function(cont){if (this._pgridCont){if (this._pgrid)this._pgrid.destructor();var c=this._pgridCont.parentNode;c.innerHTML="";if (c.parentNode==this.entBox)this.entBox.removeChild(c);this._pgrid=this._pgridSelect=this._pUNI=this._pgridCont=null;}};dhtmlXGridObject.prototype.makePivot=function(cont,details){details=details||{};this.hidePivot();if (!cont){var cont=document.createElement("DIV");cont.style.cssText="position:absolute;top:0px;left:0px;background-color:white;";cont.style.height=this.entBox.offsetHeight+"px";cont.style.width=this.entBox.offsetWidth+"px";if (this.entBox.style.position!="absolute")this.entBox.style.position="relative";this.entBox.appendChild(cont);};if (typeof(cont)!="object") cont=document.getElementById(cont)
 
 if (details.column_list)this._column_list=details.column_list;else{this._column_list=[];for (var i=0;i<this.hdr.rows[1].cells.length;i++)this._column_list.push(this.hdr.rows[1].cells[i][_isIE?"innerText":"textContent"])
 };var that = this;cont.innerHTML="<table cellspacing='0' cellpadding='0'><tr><td style='width:160px' align='center'></td><td>&nbsp;&nbsp;&nbsp;</td><td></td></tr></table><div></div>";var z1=this.makePivotSelect(this._column_list);z1.style.width="80px";z1.onchange=function(){if (this.value!=-1)that._pivotS.value=this.value;else that._pivotS.value="";that._reFillPivotLists();that._renderPivot2();};var z2=this.makePivotSelect(this._column_list);z2.onchange=function(){if (this.value!=-1)that._pivotS.x=this.value;else that._pivotS.x="";that._reFillPivotLists();that._renderPivot()
 };var z3=this.makePivotSelect(this._column_list);z3.onchange=function(){if (this.value!=-1)that._pivotS.y=this.value;else that._pivotS.y="";that._reFillPivotLists();that._renderPivot()
 };var z4=this.makePivotSelect(["Sum","Min","Max","Average","Count"],-1);z4.style.width="70px";z4.onchange=function(){if (this.value!=-1)that._pivotS.action=this.value;else that._pivotS.action=null;that._renderPivot2();};if (details.readonly)z1.disabled=z2.disabled=z3.disabled=z4.disabled=true;cont.firstChild.rows[0].cells[0].appendChild(z4);cont.firstChild.rows[0].cells[0].appendChild(z1);cont.firstChild.rows[0].cells[2].appendChild(z2);var gr=cont.childNodes[1];gr.style.width=cont.offsetWidth+"px";gr.style.height=cont.offsetHeight-20+"px";gr.style.overflow="hidden";this._pgridCont=gr;this._pgridSelect=[z1,z2,z3,z4];this._pData=this._fetchPivotData();this._pUNI=[];this._pivotS={action:(details.action||"0"), value:(typeof details.value != "undefined" ? (details.value||"0") : null), x:(typeof details.x != "undefined" ? (details.x||"0") : null), y:(typeof details.y != "undefined" ? (details.y||"0") : null) };z1.value=this._pivotS.value;z2.value=this._pivotS.x;z3.value=this._pivotS.y;z4.value=this._pivotS.action;that._reFillPivotLists();this._renderPivot();};dhtmlXGridObject.prototype._fetchPivotData=function(){var z=[];for (var i=0;i<this._cCount;i++){var d=[];for (var j=0;j<this.rowsCol.length;j++){if (this.rowsCol[j]._cntr)continue;d.push(this.cells2(j,i).getValue());};z.push(d)
 };return z;};dhtmlXGridObject.prototype._renderPivot=function(){if (_isIE)this._pgridSelect[2].removeNode(true)
 if (this._pgrid)this._pgrid.destructor();this._pgrid=new dhtmlXGridObject(this._pgridCont);this._pgrid.attachEvent("onBeforeSelect",function(){return false;});if (this._pivotS.x){var l=this._getUniList(this._pivotS.x);var s=[160];for (var i=0;i < l.length;i++)s.push(100);l=[""].concat(l)
 this._pgrid.setHeader(l);this._pgrid.setInitWidths(s.join(","));}else {this._pgrid.setHeader("");this._pgrid.setInitWidths("160");};this._pgrid.init();this._pgrid.setEditable(false);this._pgrid.setSkin(this.entBox.className.replace("gridbox gridbox_",""));var t=this._pgrid.hdr.rows[1].cells[0];if (t.firstChild && t.firstChild.tagName=="DIV")t=t.firstChild;t.appendChild(this._pgridSelect[2]);this._pgrid.setSizes();if (this._pivotS.y){var l=this._getUniList(this._pivotS.y);for (var i=0;i < l.length;i++){this._pgrid.addRow(this._pgrid.uid(),[l[i]],-1);}}else {this._pgrid.addRow(1,"not ready",1);};this._renderPivot2();};dhtmlXGridObject.prototype._pivot_action_0=function(a,b,c,av,bv,data){var ret=0;var resA=data[a];var resB=data[b];var resC=data[c];for (var i = resA.length - 1;i >= 0;i--)if (resA[i]==av && resB[i]==bv)ret+=parseFloat(resC[i]);return ret;};dhtmlXGridObject.prototype._pivot_action_1=function(a,b,c,av,bv,data){ret=9999999999;var resA=data[a];var resB=data[b];var resC=data[c];for (var i = resA.length - 1;i >= 0;i--)if (resA[i]==av && resB[i]==bv)ret=Math.min(parseFloat(resC[i]),ret);if (ret==9999999999)ret="";return ret;};dhtmlXGridObject.prototype._pivot_action_2=function(a,b,c,av,bv,data){ret=-9999999999;var resA=data[a];var resB=data[b];var resC=data[c];for (var i = resA.length - 1;i >= 0;i--)if (resA[i]==av && resB[i]==bv)ret=Math.max(parseFloat(resC[i]),ret);if (ret==-9999999999)ret="";return ret;};dhtmlXGridObject.prototype._pivot_action_3=function(a,b,c,av,bv,data){var ret=0;var count=0;var resA=data[a];var resB=data[b];var resC=data[c];for (var i = resA.length - 1;i >= 0;i--)if (resA[i]==av && resB[i]==bv){ret+=parseFloat(resC[i]);count++;};return count?ret/count:"";};dhtmlXGridObject.prototype._pivot_action_4=function(a,b,c,av,bv,data){var ret=0;var count=0;var resA=data[a];var resB=data[b];var resC=data[c];for (var i = resA.length - 1;i >= 0;i--)if (resA[i]==av && resB[i]==bv){ret++;};return ret;};dhtmlXGridObject.prototype._renderPivot2=function(){if (!(this._pivotS.x && this._pivotS.y && this._pivotS.value && this._pivotS.action)) return;var action=this["_pivot_action_"+this._pivotS.action];var x=this._getUniList(this._pivotS.x);var y=this._getUniList(this._pivotS.y);for (var i=0;i < x.length;i++){for (var j=0;j < y.length;j++){this._pgrid.cells2(j,i+1).setValue(Math.round(action(this._pivotS.x,this._pivotS.y,this._pivotS.value,x[i],y[j],this._pData)*100)/100);}}};dhtmlXGridObject.prototype._getUniList=function(col){if (!this._pUNI[col]){var t={};var a=[];for (var i = this._pData[col].length - 1;i >= 0;i--){t[this._pData[col][i]]=true;};for (var n in t)if (t[n]===true)a.push(n);this._pUNI[col]=a.sort();};return this._pUNI[col];};dhtmlXGridObject.prototype._fillPivotList=function(z,list,miss,v){if (!miss){miss={};v=-1;};z.innerHTML="";z.options[z.options.length]=new Option("-select-",-1);for (var i=0;i<list.length;i++){if (miss[i] || list[i]===null)continue;z.options[z.options.length]=new Option(list[i],i);};z.value=parseInt(v);};dhtmlXGridObject.prototype._reFillPivotLists=function(){var s=[];var v=[];for (var i=0;i<3;i++){s.push(this._pgridSelect[i]);v.push(s[i].value);};var t=this._reFfillPivotLists;var m={};m[v[1]]=m[v[2]]=true;this._fillPivotList(s[0],this._column_list,m,v[0]);m={};m[v[0]]=m[v[2]]=true;this._fillPivotList(s[1],this._column_list,m,v[1]);m={};m[v[1]]=m[v[0]]=true;this._fillPivotList(s[2],this._column_list,m,v[2]);this._reFfillPivotLists=t;};dhtmlXGridObject.prototype.makePivotSelect=function(list,miss){var z=document.createElement("SELECT");this._fillPivotList(z,list,miss);z.style.cssText="width:150px;height:20px;font-family:Tahoma;font-size:8pt;font-weight:normal;";return z;};dhtmlXGridObject.prototype.setRowspan=function(rowID,colInd,length){var c=this[this._bfs_cells?"_bfs_cells":"cells"](rowID,colInd).cell;var r=this.rowsAr[rowID];if (c.rowSpan && c.rowSpan!=1){var ur=r.nextSibling;for (var i=1;i<c.rowSpan;i++){var tc=ur.childNodes[ur._childIndexes[c._cellIndex+1]]
 var ti=document.createElement("TD");ti.innerHTML="&nbsp;";ti._cellIndex=c._cellIndex;ti._clearCell=true;if (tc)tc.parentNode.insertBefore(ti,tc);else
 ur.parentNode.appendChild(ti);this._shiftIndexes(ur,c._cellIndex,-1);ur=ur.nextSibling;}};c.rowSpan=length;if (!this._h2)r=r.nextSibling||this.rowsCol[this.rowsCol._dhx_find(r)+1];else
 r=this.rowsAr[ this._h2.get[r.idd].parent.childs[this._h2.get[r.idd].index+1].id ];var kids=[];for (var i=1;i<length;i++){var ct=null;if (this._fake && !this._realfake)ct=this._bfs_cells3(r,colInd).cell;else
 ct=this.cells3(r,colInd).cell;this._shiftIndexes(r,c._cellIndex,1);if (ct)ct.parentNode.removeChild(ct);kids.push(r);if (!this._h2)r=r.nextSibling||this.rowsCol[this.rowsCol._dhx_find(r)+1];else {var r=this._h2.get[r.idd].parent.childs[this._h2.get[r.idd].index+1];if (r)r=this.rowsAr[ r.id ];}};this.rowsAr[rowID]._rowSpan=this.rowsAr[rowID]._rowSpan||{};this.rowsAr[rowID]._rowSpan[colInd]=kids;if (this._fake && !this._realfake && colInd<this._fake._cCount)this._fake.setRowspan(rowID,colInd,length)
};dhtmlXGridObject.prototype._shiftIndexes=function(r,pos,ind){if (!r._childIndexes){r._childIndexes=new Array();for (var z=0;z<r.childNodes.length;z++)r._childIndexes[z]=z;};for (var z=0;z<r._childIndexes.length;z++)if (z>pos)r._childIndexes[z]=r._childIndexes[z]-ind;};dhtmlXGridObject.prototype.enableRowspan=function(){this._erspan=true;this.enableRowspan=function(){};this.attachEvent("onAfterSorting",function(){if (this._dload)return;for (var i=1;i<this.obj.rows.length;i++)if (this.obj.rows[i]._rowSpan){var master=this.obj.rows[i];for (var kname in master._rowSpan){var row=master;var kids=row._rowSpan[kname];for (var j=0;j < kids.length;j++){if(row.nextSibling)row.parentNode.insertBefore(kids[j],row.nextSibling);else 
 row.parentNode.appendChild(kids[j]);if (this._fake){var frow=this._fake.rowsAr[row.idd];var fkid=this._fake.rowsAr[kids[j].idd];if(frow.nextSibling)frow.parentNode.insertBefore(fkid,frow.nextSibling);else 
 frow.parentNode.appendChild(fkid);this._correctRowHeight(row.idd);};row=row.nextSibling;}}};var t = this.rowsCol.stablesort;this.rowsCol=new dhtmlxArray();this.rowsCol.stablesort=t;for (var i=1;i<this.obj.rows.length;i++)this.rowsCol.push(this.obj.rows[i]);}) 
 
 this.attachEvent("onXLE",function(a,b,c,xml){var spans=this.xmlLoader.doXPath("//cell[@rowspan]",xml);for (var i=0;i<spans.length;i++){var p=spans[i].parentNode;var rid=p.getAttribute("id");var len=spans[i].getAttribute("rowspan");var ind=0;for (var j=0;j < p.childNodes.length;j++){if (p.childNodes[j].tagName=="cell"){if (p.childNodes[j] == spans[i])break;else
 ind++;}};this.setRowspan(rid,ind,len) 
 }})
};dhtmlXGridObject.prototype._init_point_bspl=dhtmlXGridObject.prototype._init_point;dhtmlXGridObject.prototype._init_point = function(){if (this._split_later)this.splitAt(this._split_later);this._init_point=this._init_point_bspl;if (this._init_point)this._init_point();};dhtmlXGridObject.prototype.splitAt=function(ind){if (!this.obj.rows[0])return this._split_later=ind;ind=parseInt(ind);var leftBox=document.createElement("DIV");this.entBox.appendChild(leftBox);var rightBox=document.createElement("DIV");this.entBox.appendChild(rightBox);for (var i=this.entBox.childNodes.length-3;i>=0;i--)rightBox.insertBefore(this.entBox.childNodes[i],rightBox.firstChild);this.entBox.style.position="relative";this.globalBox=this.entBox;this.entBox=rightBox;rightBox.grid=this;leftBox.style.cssText+="border:0px solid red !important;";rightBox.style.cssText+="border:0px solid red !important;";rightBox.style.top="0px";rightBox.style.position="absolute";leftBox.style.position="absolute";leftBox.style.top="0px";leftBox.style.left="0px";leftBox.style.zIndex=11;rightBox.style.height=leftBox.style.height=this.globalBox.clientHeight;this._fake=new dhtmlXGridObject(leftBox);this._fake.setSkin("not_existing_skin");this.globalBox=this._fake.globalBox=this.globalBox;this._fake._fake=this;this._fake._realfake=true;this._treeC=this.cellType._dhx_find("tree");this._fake.delim=this.delim;this._fake.customGroupFormat=this.customGroupFormat;this._fake.imgURL=this.imgURL;this._fake._customSorts=this._customSorts;this._fake.noHeader=this.noHeader;this._fake._enbTts=this._enbTts;this._fake.clists = this.clists;this._fake.fldSort=new Array();this._fake.selMultiRows=this.selMultiRows;this._fake.multiLine=this.multiLine;if (this.multiLine || this._erspan){this.attachEvent("onCellChanged",this._correctRowHeight);var corrector=function(){this.forEachRow(function(id){this._correctRowHeight(id);})
 };this.attachEvent("onPageChanged",corrector);this.attachEvent("onXLE",corrector);this.attachEvent("onResizeEnd",corrector);if (!this._ads_count)this.attachEvent("onAfterSorting",corrector);this.attachEvent("onDistributedEnd",corrector);};this.attachEvent("onGridReconstructed",function(){this._fake.objBox.scrollTop = this.objBox.scrollTop;})
 
 this._fake.loadedKidsHash=this.loadedKidsHash;if (this._h2)this._fake._h2=this._h2;this._fake._dInc=this._dInc;var b_ha=[[],[],[],[],[],[],[]];var b_ar=["hdrLabels","initCellWidth","cellType","cellAlign","cellVAlign","fldSort","columnColor"];var b_fu=["setHeader","setInitWidths","setColTypes","setColAlign","setColVAlign","setColSorting","setColumnColor"];this._fake.callEvent=function(){this._fake._split_event=true;if (arguments[0]=="onGridReconstructed")this._fake.callEvent.apply(this,arguments);return this._fake.callEvent.apply(this._fake,arguments);this._fake._split_event=false;};if (this._elmn)this._fake.enableLightMouseNavigation(true);if (this.__cssEven||this._cssUnEven)this._fake.attachEvent("onGridReconstructed",function(){this._fixAlterCss();});this._fake._cssEven=this._cssEven;this._fake._cssUnEven=this._cssUnEven;this._fake._cssSP=this._cssSP;this._fake.isEditable=this.isEditable;this._fake._edtc=this._edtc;if (this._sst)this._fake.enableStableSorting(true);this._fake._sclE=this._sclE;this._fake._dclE=this._dclE;this._fake._f2kE=this._f2kE;this._fake._maskArr=this._maskArr;this._fake._dtmask=this._dtmask;this._fake.combos=this.combos;var width=0;var m_w=this.globalBox.offsetWidth;for (var i=0;i<ind;i++){for (var j=0;j<b_ar.length;j++){if (this[b_ar[j]])b_ha[j][i]=this[b_ar[j]][i];if (typeof b_ha[j][i] == "string")b_ha[j][i]=b_ha[j][i].replace(new RegExp("\\"+this.delim,"g"),"\\"+this.delim);};if (_isFF)b_ha[1][i]=b_ha[1][i]*1+2;if ( this.cellWidthType == "%"){b_ha[1][i]=Math.round(parseInt(this[b_ar[1]][i])*m_w/100);width+=b_ha[1][i];}else
 width+=parseInt(this[b_ar[1]][i]);this.setColumnHidden(i,true);};for (var j=0;j<b_ar.length;j++){var str=b_ha[j].join(this.delim);if (b_fu[j]!="setHeader"){if (str!="")this._fake[b_fu[j]](str);}else
 this._fake[b_fu[j]](str,null,this._hstyles);};this._fake._strangeParams=this._strangeParams;this._fake._drsclmn=this._drsclmn;rightBox.style.left=width+"px";leftBox.style.width=width+"px";rightBox.style.width=Math.max(this.globalBox.offsetWidth-width,0);if (this._ecspn)this._fake._ecspn=true;this._fake.init();if (this.dragAndDropOff)this.dragger.addDragLanding(this._fake.entBox, this);this._fake.objBox.style.overflow="hidden";this._fake.objBox.style.overflowX="scroll";this._fake._srdh=this._srdh||20;this._fake._srnd=this._srnd;function change_td(a,b){b.style.whiteSpace="";var c=b.nextSibling;var cp=b.parentNode;a.parentNode.insertBefore(b,a);if (!c)cp.appendChild(a);else
 cp.insertBefore(a,c);var z=a.style.display;a.style.display=b.style.display;b.style.display=z;};function proc_hf(i,rows,mode,frows){var temp_header=(new Array(ind)).join(this.delim);var temp_rspan=[];if (i==2)for (var k=0;k<ind;k++){var r=rows[i-1].cells[rows[i-1]._childIndexes?rows[i-1]._childIndexes[k]:k];if (r.rowSpan && r.rowSpan>1){temp_rspan[r._cellIndex]=r.rowSpan-1;frows[i-1].cells[frows[i-1]._childIndexes?frows[i-1]._childIndexes[k]:k].rowSpan=r.rowSpan;r.rowSpan=1;}};for (i;i<rows.length;i++){this._fake.attachHeader(temp_header,null,mode);frows=frows||this._fake.ftr.childNodes[0].rows;var max_ind=ind;var r_cor=0;for (var j=0;j<max_ind;j++){if (temp_rspan[j]){temp_rspan[j]=temp_rspan[j]-1;if (_isIE || (_isFF && _FFrv >= 1.9 )|| _isOpera) {var td=document.createElement("TD");if (_isFF)td.style.display="none";rows[i].insertBefore(td,rows[i].cells[0])
 };r_cor++;continue;};var a=frows[i].cells[j-r_cor];var b=rows[i].cells[j-(_isIE?0:r_cor)];var t=b.rowSpan;change_td(a,b);if (t>1){temp_rspan[j]=t-1;b.rowSpan=t;};if (frows[i].cells[j].colSpan>1){rows[i].cells[j].colSpan=frows[i].cells[j].colSpan;max_ind-=frows[i].cells[j].colSpan-1;for (var k=1;k < frows[i].cells[j].colSpan;k++)frows[i].removeChild(frows[i].cells[j+1]);}}}};if (this.hdr.rows.length>2)proc_hf.call(this,2,this.hdr.rows,"_aHead",this._fake.hdr.rows);if (this.ftr){proc_hf.call(this,1,this.ftr.childNodes[0].rows,"_aFoot");this._fake.ftr.parentNode.style.bottom=(_isFF?2:1)+"px";};if (this.saveSizeToCookie){this.saveSizeToCookie=function(name,cookie_param){if (this._realfake)return this._fake.saveSizeToCookie.apply(this._fake,arguments);if (!name)name=this.entBox.id;var z=new Array();var n="cellWidthPX";for (var i=0;i<this[n].length;i++)if (i<ind)z[i]=this._fake[n][i];else
 z[i]=this[n][i];z=z.join(",")
 this.setCookie(name,cookie_param,0,z);var z=(this.initCellWidth||(new Array)).join(",");this.setCookie(name,cookie_param,1,z);return true;};this.loadSizeFromCookie=function(name){if (!name)name=this.entBox.id;var z=this._getCookie(name,1);if (!z)return
 this.initCellWidth=z.split(",");var z=this._getCookie(name,0);var n="cellWidthPX";this.cellWidthType="px";var summ2=0;if ((z)&&(z.length)){z=z.split(",");for (var i=0;i<z.length;i++)if (i<ind){this._fake[n][i]=z[i];summ2+=z[i]*1;}else
 this[n][i]=z[i];};this._fake.entBox.style.width=summ2+"px";this._fake.objBox.style.width=summ2+"px";var pa=this.globalBox.childNodes[1];pa.style.left=summ2-(_isFF?0:0)+"px";if (this.ftr)this.ftr.style.left=summ2-(_isFF?0:0)+"px";pa.style.width=this.globalBox.offsetWidth-summ2+"px";this.setSizes();return true;};this._fake.onRSE=this.onRSE;};this.setCellTextStyleA=this.setCellTextStyle;this.setCellTextStyle=function(row_id,i,styleString){if (i<ind)this._fake.setCellTextStyle(row_id,i,styleString);this.setCellTextStyleA(row_id,i,styleString);};this.setRowTextBoldA=this.setRowTextBold;this.setRowTextBold = function(row_id){this.setRowTextBoldA(row_id);this._fake.setRowTextBold(row_id);};this.setRowColorA=this.setRowColor;this.setRowColor = function(row_id,color){this.setRowColorA(row_id,color);this._fake.setRowColor(row_id,color);};this.setRowHiddenA=this.setRowHidden;this.setRowHidden = function(id,state){this.setRowHiddenA(id,state);this._fake.setRowHidden(id,state);};this.setRowTextNormalA=this.setRowTextNormal;this.setRowTextNormal = function(row_id){this.setRowTextNormalA(row_id);this._fake.setRowTextNormal(row_id);};this.getChangedRows = function(and_added){var res = new Array();function test(row){for (var j = 0;j < row.childNodes.length;j++)if (row.childNodes[j].wasChanged)return res[res.length]=row.idd;};this.forEachRow(function(id){var row = this.rowsAr[id];var frow = this._fake.rowsAr[id];if (row.tagName!="TR" || frow.tagName!="TR")return;if (and_added && row._added)res[res.length]=row.idd;else{if (!test(row)) test(frow);}});return res.join(this.delim);};this.setRowTextStyleA=this.setRowTextStyle;this.setRowTextStyle = function(row_id,styleString){this.setRowTextStyleA(row_id,styleString);if (this._fake.rowsAr[row_id])this._fake.setRowTextStyle(row_id,styleString);};this.lockRowA = this.lockRow;this.lockRow = function(id,mode){this.lockRowA(id,mode);this._fake.lockRow(id,mode);};this.getColWidth = function(i){if (i<ind)return parseInt(this._fake.cellWidthPX[i])+((_isFF)?2:0);else return parseInt(this.cellWidthPX[i])+((_isFF)?2:0);};this.setColWidthA=this._fake.setColWidthA=this.setColWidth;this.setColWidth = function(i,value){i=i*1;if (i<ind)this._fake.setColWidthA(i,value-((_isFF) ? 2 : 0));else this.setColWidthA(i,value-((_isFF) ? 2 : 0));if ((i+1)<=ind) this._fake._correctSplit(Math.min(this._fake.objBox.offsetWidth,this._fake.obj.offsetWidth));};this.adjustColumnSizeA=this.adjustColumnSize;this.setColumnLabelA=this.setColumnLabel;this.setColumnLabel=function(a,b,c,d){var that = this;if (a<ind)that = this._fake;return this.setColumnLabelA.apply(that,[a,b,c,d]);};this.adjustColumnSize=function(aind,c){if (aind<ind){if (_isIE)this._fake.obj.style.tableLayout="";this._fake.adjustColumnSize(aind,c);if (_isIE)this._fake.obj.style.tableLayout="fixed";this._fake._correctSplit();}else return this.adjustColumnSizeA(aind,c);};var zname="cells";this._bfs_cells=this[zname];this[zname]=function(){if (arguments[1]<ind){return this._fake.cells.apply(this._fake,arguments);}else
 return this._bfs_cells.apply(this,arguments);};this._bfs_setColumnHidden=this.setColumnHidden;this.setColumnHidden=function(){if (parseInt(arguments[0])<ind){this._fake.setColumnHidden.apply(this._fake,arguments);return this._fake._correctSplit();}else
 return this._bfs_setColumnHidden.apply(this,arguments);};var zname="cells2";this._bfs_cells2=this[zname];this[zname]=function(){if (arguments[1]<ind)return this._fake.cells2.apply(this._fake,arguments);else
 return this._bfs_cells2.apply(this,arguments);};var zname="cells3";this._bfs_cells3=this[zname];this[zname]=function(a,b){if (arguments[1]<ind && this._fake.rowsAr[arguments[0].idd]){if (this._fake.rowsAr[a.idd] && this._fake.rowsAr[a.idd].childNodes.length==0)return this._bfs_cells3.apply(this,arguments);arguments[0]=arguments[0].idd;return this._fake.cells.apply(this._fake,arguments);}else
 return this._bfs_cells3.apply(this,arguments);};var zname="changeRowId";this._bfs_changeRowId=this[zname];this[zname]=function(){this._bfs_changeRowId.apply(this,arguments);if (this._fake.rowsAr[arguments[0]])this._fake.changeRowId.apply(this._fake,arguments);};this._fake.getRowById=function(id){var row = this.rowsAr[id];if (!row && this._fake.rowsAr[id])row=this._fake.getRowById(id);if (row){if (row.tagName != "TR"){for (var i = 0;i < this.rowsBuffer.length;i++)if (this.rowsBuffer[i] && this.rowsBuffer[i].idd == id)return this.render_row(i);if (this._h2)return this.render_row(null,row.idd);};return row;};return null;};if (this.collapseKids){this._fake["_bfs_collapseKids"]=this.collapseKids;this._fake["collapseKids"]=function(){return this._fake["collapseKids"].apply(this._fake,[this._fake.rowsAr[arguments[0].idd]]);};this["_bfs_collapseKids"]=this.collapseKids;this["collapseKids"]=function(){var z=this["_bfs_collapseKids"].apply(this,arguments);this._fake._h2syncModel();if (!this._cssSP)this._fake._fixAlterCss();};this._fake["_bfs_expandKids"]=this.expandKids;this._fake["expandKids"]=function(){this._fake["expandKids"].apply(this._fake,[this._fake.rowsAr[arguments[0].idd]]);if (!this._cssSP)this._fake._fixAlterCss();};this["_bfs_expandAll"]=this.expandAll;this["expandAll"]=function(){this._bfs_expandAll();this._fake._h2syncModel();if (!this._cssSP)this._fake._fixAlterCss();};this["_bfs_collapseAll"]=this.collapseAll;this["collapseAll"]=function(){this._bfs_collapseAll();this._fake._h2syncModel();if (!this._cssSP)this._fake._fixAlterCss();};this["_bfs_expandKids"]=this.expandKids;this["expandKids"]=function(){var z=this["_bfs_expandKids"].apply(this,arguments);this._fake._h2syncModel();if (!this._cssSP)this._fake._fixAlterCss();};this._fake._h2syncModel=function(){if (this._fake.pagingOn)this._fake._renderSort();else this._renderSort();};this._updateTGRState=function(a){return this._fake._updateTGRState(a);}};if (this._elmnh){this._setRowHoverA=this._fake._setRowHoverA=this._setRowHover;this._unsetRowHoverA=this._fake._unsetRowHoverA=this._unsetRowHover;this._setRowHover=this._fake._setRowHover=function(){var that=this.grid;that._setRowHoverA.apply(this,arguments);var z=(_isIE?event.srcElement:arguments[0].target);z=that._fake.rowsAr[that.getFirstParentOfType(z,'TD').parentNode.idd];if (z){that._fake._setRowHoverA.apply(that._fake.obj,[{target:z.childNodes[0]},arguments[1]]);}};this._unsetRowHover=this._fake._unsetRowHover=function(){if (arguments[1])var that=this;else var that=this.grid;that._unsetRowHoverA.apply(this,arguments);that._fake._unsetRowHoverA.apply(that._fake.obj,arguments);};this._fake.enableRowsHover(true,this._hvrCss);this.enableRowsHover(false);this.enableRowsHover(true,this._fake._hvrCss);};this._updateTGRState=function(z){if (!z.update || z.id==0)return;if (this.rowsAr[z.id].imgTag)this.rowsAr[z.id].imgTag.src=this.imgURL+z.state+".gif";if (this._fake.rowsAr[z.id] && this._fake.rowsAr[z.id].imgTag)this._fake.rowsAr[z.id].imgTag.src=this.imgURL+z.state+".gif";z.update=false;};this.copy_row=function(row){var x=row.cloneNode(true);x._skipInsert=row._skipInsert;var r_ind=ind;x._attrs={};if (this._ecspn){r_ind=0;for (var i=0;(i<x.childNodes.length && i<ind);i+=(x.childNodes[i].colSpan||1))
 r_ind++;};while (x.childNodes.length>r_ind)x.removeChild(x.childNodes[x.childNodes.length-1]);var zm=r_ind;for (var i=0;i<zm;i++){if (this.dragAndDropOff)this.dragger.addDraggableItem(x.childNodes[i], this);x.childNodes[i].style.display=(this._fake._hrrar?(this._fake._hrrar[i]?"none":""):"");x.childNodes[i]._cellIndex=i;x.childNodes[i].combo_value=arguments[0].childNodes[i].combo_value;x.childNodes[i]._clearCell=arguments[0].childNodes[i]._clearCell;x.childNodes[i]._cellType=arguments[0].childNodes[i]._cellType;x.childNodes[i]._brval=arguments[0].childNodes[i]._brval;x.childNodes[i]._attrs=arguments[0].childNodes[i]._attrs;x.childNodes[i].chstate=arguments[0].childNodes[i].chstate;if (row._attrs['style'])x.childNodes[i].style.cssText+=";"+row._attrs['style'];if(x.childNodes[i].colSpan>1)this._childIndexes=this._fake._childIndexes;};if (this._h2 && this._treeC < ind){var trow=this._h2.get[arguments[0].idd];x.imgTag=x.childNodes[this._treeC].childNodes[0].childNodes[trow.level];x.valTag=x.childNodes[this._treeC].childNodes[0].childNodes[trow.level+2];};x.idd=row.idd;x.grid=this._fake;return x;};var zname="_insertRowAt";this._bfs_insertRowAt=this[zname];this[zname]=function(){var r=this["_bfs_insertRowAt"].apply(this,arguments);arguments[0]=this.copy_row(arguments[0]);var r2=this._fake["_insertRowAt"].apply(this._fake,arguments);if (r._fhd){r2.parentNode.removeChild(r2);this._fake.rowsCol._dhx_removeAt(this._fake.rowsCol._dhx_find(r2));r._fhd=false;};return r;};this._bfs_setSizes=this.setSizes;this.setSizes=function(){if (this._notresize)return;this._bfs_setSizes(this,arguments);this.sync_headers()
 if (this.sync_scroll()&& this._ahgr) this.setSizes();this._fake.entBox.style.height=this.entBox.style.height;this._fake.objBox.style.height=this.objBox.style.height;this._fake.hdrBox.style.height=this.hdrBox.style.height;this._fake.objBox.scrollTop=this.objBox.scrollTop;this._fake.setColumnSizes(this._fake.entBox.clientWidth);this.globalBox.style.width=parseInt(this.entBox.style.width)+parseInt(this._fake.entBox.style.width);this.globalBox.style.height=this.entBox.style.height;};this.sync_scroll=this._fake.sync_scroll=function(end){var old=this.objBox.style.overflowX;if (this.obj.offsetWidth<=this.objBox.offsetWidth){if (!end)return this._fake.sync_scroll(true);this.objBox.style.overflowX="hidden";this._fake.objBox.style.overflowX="hidden";}else{this.objBox.style.overflowX="scroll";this._fake.objBox.style.overflowX="scroll";};return old!=this.objBox.style.overflowX;};this.sync_headers=this._fake.sync_headers=function(){if (this.noHeader || (this._fake.hdr.scrollHeight==this.hdr.offsetHeight)) return;for (var i=1;i<this.hdr.rows.length;i++){var ha=this.hdr.rows[i].scrollHeight;var hb=this._fake.hdr.rows[i].scrollHeight;if (ha!=hb)this._fake.hdr.rows[i].style.height=this.hdr.rows[i].style.height=Math.max(ha,hb)+"px";if (window._KHTMLrv)this._fake.hdr.rows[i].childNodes[0].style.height=this.hdr.rows[i].childNodes[ind].style.height=Math.max(ha,hb)+"px";};this._fake.sync_headers;};this._fake._bfs_setSizes=this._fake.setSizes;this._fake.setSizes=function(){if (this._fake._notresize)return;this._fake.setSizes();};var zname="_doOnScroll";this._bfs__doOnScroll=this[zname];this[zname]=function(){this._bfs__doOnScroll.apply(this,arguments);this._fake.objBox.scrollTop=this.objBox.scrollTop;this._fake["_doOnScroll"].apply(this._fake,arguments);};var zname="selectAll";this._bfs__selectAll=this[zname];this[zname]=function(){this._bfs__selectAll.apply(this,arguments);this._bfs__selectAll.apply(this._fake,arguments);};var zname="doClick";this._bfs_doClick=this[zname];this[zname]=function(){this["_bfs_doClick"].apply(this,arguments);if (arguments[0].tagName=="TD"){var fl=(arguments[0]._cellIndex>=ind);if (!arguments[0].parentNode.idd)return;if (!fl)arguments[0].className=arguments[0].className.replace(/cellselected/g,"");if (!this._fake.rowsAr[arguments[0].parentNode.idd])this._fake.render_row(this.getRowIndex(arguments[0].parentNode.idd));arguments[0]=this._fake.cells(arguments[0].parentNode.idd,(fl?0:arguments[0]._cellIndex)).cell;if (fl)this._fake.cell=null;this._fake["_bfs_doClick"].apply(this._fake,arguments);if (fl)this._fake.cell=this.cell;else this.cell=this._fake.cell;if (this._fake.onRowSelectTime)clearTimeout(this._fake.onRowSelectTime)
 if (fl){arguments[0].className=arguments[0].className.replace(/cellselected/g,"");globalActiveDHTMLGridObject=this;this._fake.cell=this.cell;}else{this.objBox.scrollTop=this._fake.objBox.scrollTop;}}};this._fake._bfs_doClick=this._fake[zname];this._fake[zname]=function(){this["_bfs_doClick"].apply(this,arguments);if (arguments[0].tagName=="TD"){var fl=(arguments[0]._cellIndex<ind);if (!arguments[0].parentNode.idd)return;arguments[0]=this._fake._bfs_cells(arguments[0].parentNode.idd,(fl?ind:arguments[0]._cellIndex)).cell;this._fake.cell=null;this._fake["_bfs_doClick"].apply(this._fake,arguments);this._fake.cell=this.cell;if (this._fake.onRowSelectTime)clearTimeout(this._fake.onRowSelectTime)
 if (fl){arguments[0].className=arguments[0].className.replace(/cellselected/g,"");globalActiveDHTMLGridObject=this;this._fake.cell=this.cell;this._fake.objBox.scrollTop=this.objBox.scrollTop;}}};this.clearSelectionA = this.clearSelection;this.clearSelection = function(mode){if (mode)this._fake.clearSelection();this.clearSelectionA();};this.moveRowUpA = this.moveRowUp;this.moveRowUp = function(row_id){if (!this._h2)this._fake.moveRowUp(row_id);this.moveRowUpA(row_id);if (this._h2)this._fake._h2syncModel();};this.moveRowDownA = this.moveRowDown;this.moveRowDown = function(row_id){if (!this._h2)this._fake.moveRowDown(row_id);this.moveRowDownA(row_id);if (this._h2)this._fake._h2syncModel();};this._fake.getUserData=function(){return this._fake.getUserData.apply(this._fake,arguments);};this._fake.setUserData=function(){return this._fake.setUserData.apply(this._fake,arguments);};this.getSortingStateA=this.getSortingState;this.getSortingState = function(){var z=this.getSortingStateA();if (z.length!=0)return z;return this._fake.getSortingState();};this.setSortImgStateA=this._fake.setSortImgStateA=this.setSortImgState;this.setSortImgState = function(a,b,c,d){this.setSortImgStateA(a,b,c,d);if (b*1<ind){this._fake.setSortImgStateA(a,b,c,d);this.setSortImgStateA(false);}else 
 this._fake.setSortImgStateA(false);};this._fake.doColResizeA = this._fake.doColResize;this._fake.doColResize = function(ev,el,startW,x,tabW){a=-1;var z=0;if (arguments[1]._cellIndex==(ind-1)){a = this._initalSplR + (ev.clientX-x);if (!this._initalSplF)this._initalSplF=arguments[3]+this.objBox.scrollWidth-this.objBox.offsetWidth;if (this.objBox.scrollWidth==this.objBox.offsetWidth && (this._fake.alter_split_resize || (ev.clientX-x)>0 )){arguments[3]=(this._initalSplF||arguments[3]);z=this.doColResizeA.apply(this,arguments);}else
 z=this.doColResizeA.apply(this,arguments);}else{if (this.obj.offsetWidth<this.entBox.offsetWidth)a=this.obj.offsetWidth;z=this.doColResizeA.apply(this,arguments);};this._correctSplit(a);this.resized=this._fake.resized=1;return z;};this._fake.changeCursorState = function(ev){var el = ev.target||ev.srcElement;if(el.tagName!="TD")el = this.getFirstParentOfType(el,"TD")
 if ((el.tagName=="TD")&&(this._drsclmn)&&(!this._drsclmn[el._cellIndex])) return;var check = (ev.layerX||0)+(((!_isIE)&&(ev.target.tagName=="DIV"))?el.offsetLeft:0);var pos = parseInt(this.getPosition(el,this.hdrBox));if(((el.offsetWidth - (ev.offsetX||(pos-check)*-1))<(_isOpera?20:10))||((this.entBox.offsetWidth - (ev.offsetX?(ev.offsetX+el.offsetLeft):check) + this.objBox.scrollLeft - 0)<(_isOpera?20:10))){el.style.cursor = "E-resize";}else
 el.style.cursor = "default";if (_isOpera)this.hdrBox.scrollLeft = this.objBox.scrollLeft;};this._fake.startColResizeA = this._fake.startColResize;this._fake.startColResize = function(ev){var z=this.startColResizeA(ev);this._initalSplR=this.entBox.offsetWidth;this._initalSplF=null;if (this.entBox.onmousemove){var m=this.entBox.parentNode;if (m._aggrid)return z;m._aggrid=m.grid;m.grid=this;this.entBox.parentNode.onmousemove=this.entBox.onmousemove;this.entBox.onmousemove=null;};return z;};this._fake.stopColResizeA = this._fake.stopColResize;this._fake.stopColResize = function(ev){if (this.entBox.parentNode.onmousemove){var m=this.entBox.parentNode;m.grid=m._aggrid;m._aggrid=null;this.entBox.onmousemove=this.entBox.parentNode.onmousemove;this.entBox.parentNode.onmousemove=null;if (this.obj.offsetWidth<this.entBox.offsetWidth)this._correctSplit(this.obj.offsetWidth);};return this.stopColResizeA(ev);};this.doKeyA = this.doKey;this._fake.doKeyA = this._fake.doKey;this._fake.doKey=this.doKey=function(ev){if (!ev)return true;if (this._htkebl)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;};switch (ev.keyCode){case 9:
 if (!ev.shiftKey){if (this._realfake){if ((this.cell)&&(this.cell._cellIndex==(ind-1))){if (ev.preventDefault)ev.preventDefault();var ind_t=ind;while (this._fake._hrrar && this._fake._hrrar[ind_t])ind_t++;this._fake.selectCell(this._fake.getRowIndex(this.cell.parentNode.idd),ind_t,false,false,true);return false;}else
 var z=this.doKeyA(ev);globalActiveDHTMLGridObject=this;return z;}else{if (this.cell){var ind_t=this.cell._cellIndex+1;while (this.rowsCol[0].childNodes[ind_t] && this.rowsCol[0].childNodes[ind_t].style.display=="none")ind_t++;if (ind_t == this.rowsCol[0].childNodes.length){if (ev.preventDefault)ev.preventDefault();var z=this.rowsBuffer[this.getRowIndex(this.cell.parentNode.idd)+1];if (z){this.showRow(z.idd);this._fake.selectCell(this._fake.getRowIndex(z.idd),0,false,false,true);return false;}}};return this.doKeyA(ev);}}else{if (this._realfake){if ((this.cell)&&(this.cell._cellIndex==0)){if (ev.preventDefault)ev.preventDefault();var z=this._fake.rowsBuffer[this._fake.getRowIndex(this.cell.parentNode.idd)-1];if (z){this._fake.showRow(z.idd);var ind_t=this._fake._cCount-1;while (z.childNodes[ind_t].style.display=="none")ind_t--;this._fake.selectCell(this._fake.getRowIndex(z.idd),ind_t,false,false,true);};return false;}else
 return this.doKeyA(ev);}else{if ((this.cell)&&(this.cell._cellIndex==ind)){if (ev.preventDefault)ev.preventDefault();this._fake.selectCell(this.getRowIndex(this.cell.parentNode.idd),ind-1,false,false,true);return false;}else
 return this.doKeyA(ev);}};break;};return this.doKeyA(ev);};this.editCellA=this.editCell;this.editCell=function(){if (this.cell && this.cell.parentNode.grid != this)return this._fake.editCell();return this.editCellA();};this.deleteRowA = this.deleteRow;this.deleteRow=function(row_id,node){if (this.deleteRowA(row_id,node)===false) return false;if (this._fake.rowsAr[row_id])this._fake.deleteRow(row_id);};this.clearAllA = this.clearAll;this.clearAll=function(){this.clearAllA();this._fake.clearAll();};this.attachEvent("onAfterSorting",function(i,b,c){if (i>=ind)this._fake.setSortImgState(false)
}) 



this._fake.sortField = function(a,b,c){this._fake.sortField.call(this._fake,a,b,this._fake.hdr.rows[0].cells[a]);if (this.fldSort[a]!="na"){var mem = this._fake.getSortingState()[1];this._fake.setSortImgState(false);this.setSortImgState(true,arguments[0],mem)
 }};this.sortTreeRowsA = this.sortTreeRows;this._fake.sortTreeRowsA = this._fake.sortTreeRows;this.sortTreeRows=this._fake.sortTreeRows=function(col,type,order,ar){if (this._realfake)return this._fake.sortTreeRows(col,type,order,ar)

 this.sortTreeRowsA(col,type,order,ar);this._fake._h2syncModel();this._fake.setSortImgStateA(false);this._fake.fldSorted=null;};this._fake._fillers=[];this._fake.rowsBuffer=this.rowsBuffer;this.attachEvent("onClearAll",function(){this._fake.rowsBuffer=this.rowsBuffer;})
this._add_filler_s=this._add_filler;this._add_filler=function(a,b,c,e){if (!e){if (!this._fake._fillers)this._fake._fillers=[];var d;if (c){if (c.idd)d=this._fake.rowsAr[c.idd];else if (c.nextSibling){d = {};d.nextSibling=this._fake.rowsAr[c.nextSibling.idd];d.parentNode=d.nextSibling.parentNode;}};this._fake._fillers.push(this._fake._add_filler(a,b,d));};return this._add_filler_s.apply(this,arguments);};this._add_from_buffer_s=this._add_from_buffer;this._add_from_buffer=function() {var res=this._add_from_buffer_s.apply(this,arguments);if (res!=-1){this._fake._add_from_buffer.apply(this._fake,arguments);if (this.multiLine)this._correctRowHeight(this.rowsBuffer[arguments[0]].idd);};return res;};this._fake.render_row=function(ind){var row=this._fake.render_row(ind);if (row == -1)return -1;if (row){return this.rowsAr[row.idd]=this.rowsAr[row.idd]||this._fake.copy_row(row);};return null;};this._reset_view_s=this._reset_view;this._reset_view=function(){this._fake._reset_view(true);this._fake._fillers=[];this._reset_view_s();};this.moveColumn_s=this.moveColumn;this.moveColumn=function(a,b){if (b>=ind)return this.moveColumn_s(a,b);};this.attachEvent("onCellChanged",function(id,i,val){if (this._split_event && i<ind && this.rowsAr[id]){var cell=this._fake.rowsAr[id];if (!cell)return;if (cell._childIndexes)cell=cell.childNodes[cell._childIndexes[i]];else
 cell=cell.childNodes[i];var tcell = this.rowsAr[id].childNodes[i];if (tcell._treeCell && tcell.firstChild.lastChild)tcell.firstChild.lastChild.innerHTML = val;else
 tcell.innerHTML=cell.innerHTML;tcell._clearCell=false;tcell.chstate=cell.chstate;}})





 this._fake.combos=this.combos;this.setSizes();if (this.rowsBuffer[0])this._reset_view();this.attachEvent("onXLE",function(){this._fake._correctSplit()})
 this._fake._correctSplit();};dhtmlXGridObject.prototype._correctSplit=function(a){a=a||(this.obj.scrollWidth-this.objBox.scrollLeft);if (a>-1){this.entBox.style.width=a+"px";this.objBox.style.width=a+"px";var outerBorder=(this.globalBox.offsetWidth-this.globalBox.clientWidth)/2;this._fake.entBox.style.left=a+"px";this._fake.entBox.style.width=Math.max(0,this.globalBox.offsetWidth-a-(this.quirks?0:2)*outerBorder)+"px";if (this._fake.ftr)this._fake.ftr.parentNode.style.width=this._fake.entBox.style.width;if (_isIE){var quirks=_isIE && !window.xmlHttpRequest;var outerBorder=(this.globalBox.offsetWidth-this.globalBox.clientWidth);this._fake.hdrBox.style.width=this._fake.objBox.style.width=Math.max(0,this.globalBox.offsetWidth-(quirks?outerBorder:0)-a)+"px";}}};dhtmlXGridObject.prototype._correctRowHeight=function(id,ind){if (!this.rowsAr[id] || !this._fake.rowsAr[id])return;var h=this.rowsAr[id].offsetHeight;var h2=this._fake.rowsAr[id].offsetHeight;var max = Math.max(h,h2);if (!max)return;this.rowsAr[id].style.height=this._fake.rowsAr[id].style.height=max+"px";if (window._KHTMLrv)this.rowsAr[id].childNodes[this._fake._cCount].style.height=this._fake.rowsAr[id].firstChild.style.height=max+"px";};dhtmlXGridObject.prototype.enableSmartRendering=function(mode,buffer,reserved){if (arguments.length>2){if (buffer && !this.rowsBuffer[buffer-1])this.rowsBuffer[buffer-1]=0;buffer=reserved;};this._srnd=convertStringToBoolean(mode);this._srdh=this._srdh||20;this._dpref=buffer||0;};dhtmlXGridObject.prototype.enablePreRendering=function(buffer){this._srnd_pr=parseInt(buffer||50);};dhtmlXGridObject.prototype.forceFullLoading=function(buffer){buffer=buffer||50;for (var i=0;i<this.rowsBuffer.length;i++)if (!this.rowsBuffer[i]){if (this.callEvent("onDynXLS",[i,buffer])){var self=this;this.load(this.xmlFileUrl+getUrlSymbol(this.xmlFileUrl)+"posStart="+i+"&count="+buffer, function(){window.setTimeout(function(){self.forceFullLoading(buffer);},100);}, this._data_type);};return;}};dhtmlXGridObject.prototype.setAwaitedRowHeight = function(height) {this._srdh=parseInt(height);};dhtmlXGridObject.prototype._get_view_size=function(){return Math.floor(parseInt(this.entBox.offsetHeight)/this._srdh)+2;};dhtmlXGridObject.prototype._add_filler=function(pos,len,fil){if (!len)return null;var id="__filler__";var row=this._prepareRow(id);row.firstChild.style.width="1px";for (var i=1;i<row.childNodes.length;i++)row.childNodes[i].style.display='none';row.firstChild.style.height=len*this._srdh+"px";fil=fil||this.rowsCol[pos];if (fil && fil.nextSibling)fil.parentNode.insertBefore(row,fil.nextSibling);else
 if (_isKHTML)this.obj.appendChild(row);else
 this.obj.rows[0].parentNode.appendChild(row);return [pos,len,row];};dhtmlXGridObject.prototype._update_srnd_view=function(){var min=Math.floor(this.objBox.scrollTop/this._srdh);var max=min+this._get_view_size();if (this.multiLine){var pxHeight = this.objBox.scrollTop;min = 0;while(pxHeight > 0){pxHeight-=this.rowsCol[min]?this.rowsCol[min].offsetHeight:this._srdh;min++;};max=min+this._get_view_size();if (min>0)min--;};max+=(this._srnd_pr||0);if (max>this.rowsBuffer.length)max=this.rowsBuffer.length;for (var j=min;j<max;j++){if (!this.rowsCol[j]){var res=this._add_from_buffer(j);if (res==-1){if (this.xmlFileUrl){this._current_load=[j,(this._dpref?this._dpref:(max-j))];if (this.callEvent("onDynXLS",[j,this._current_load[1]]))
 this.load(this.xmlFileUrl+getUrlSymbol(this.xmlFileUrl)+"posStart="+j+"&count="+this._current_load[1], this._data_type);};return;}else {if (this._tgle){this._updateLine(this._h2.get[this.rowsBuffer[j].idd],this.rowsBuffer[j]);this._updateParentLine(this._h2.get[this.rowsBuffer[j].idd],this.rowsBuffer[j]);};if (j && j==(this._realfake?this._fake:this)["_r_select"]){this.selectCell(j, 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(ind){var row=this.render_row(ind);if (row==-1)return -1;if (row._attrs["selected"] || row._attrs["select"]){this.selectRow(row,false,true);row._attrs["selected"]=row._attrs["select"]=null;};if (!this._cssSP){if (this._cssEven && ind%2 == 0 )row.className=this._cssEven+((row.className.indexOf("rowselected") != -1)?" rowselected ":" ")+(row._css||"");else if (this._cssUnEven && ind%2 == 1 )row.className=this._cssUnEven+((row.className.indexOf("rowselected") != -1)?" rowselected ":" ")+(row._css||"");}else if (this._h2){var x=this._h2.get[row.idd];row.className+=" "+((x.level%2)?(this._cssUnEven+" "+this._cssUnEven):(this._cssEven+" "+this._cssEven))+"_"+x.level+(this.rowsAr[x.id]._css||"");};for (var i=0;i<this._fillers.length;i++){var f=this._fillers[i];if (f && f[0]<=ind && (f[0]+f[1])>ind ){var pos=ind-f[0];if (pos==0){this._insert_before(ind,row,f[2]);this._update_fillers(i,-1,1);}else if (pos == f[1]-1){this._insert_after(ind,row,f[2]);this._update_fillers(i,-1,0);}else {this._fillers.push(this._add_filler(ind+1,f[1]-pos-1,f[2],1));this._insert_after(ind,row,f[2]);this._update_fillers(i,-f[1]+pos,0);};return;}}};dhtmlXGridObject.prototype._update_fillers=function(ind,right,left){var f=this._fillers[ind];f[1]=f[1]+right;f[0]=f[0]+left;if (!f[1]){f[2].parentNode.removeChild(f[2]);this._fillers.splice(ind,1);}else 
 f[2].firstChild.style.height=parseFloat(f[2].firstChild.style.height)+right*this._srdh+"px";};dhtmlXGridObject.prototype._insert_before=function(ind,row,fil){fil.parentNode.insertBefore(row,fil);this.rowsCol[ind]=row;};dhtmlXGridObject.prototype._insert_after=function(ind,row,fil){if (fil.nextSibling)fil.parentNode.insertBefore(row,fil.nextSibling);else
 fil.parentNode.appendChild(row);this.rowsCol[ind]=row;};dhtmlXGridObject.prototype.enableAutoSizeSaving = function(name,cookie_param){this.attachEvent("onResizeEnd",function(){this.saveSizeToCookie(name,cookie_param) });};dhtmlXGridObject.prototype.saveOpenStates = function(name,cookie_param){if (!name)name=this.entBox.id;var t=[];this._h2.forEachChild(0,function(el){if (el.state=="minus")t.push(el.id);});var str = "gridOpen"+(name||"") + "=" + t.join("|") + (cookie_param?(";"+cookie_param):"");document.cookie = str;};dhtmlXGridObject.prototype.loadOpenStates = function(name,cookie_param){var val=this.getCookie(name,"gridOpen");if (!val)return;val=val.split("|");for (var i=0;i < val.length;i++)this.openItem(val[i]);};dhtmlXGridObject.prototype.enableAutoHiddenColumnsSaving = function(name,cookie_param){this.attachEvent("onColumnHidden",function(){this.saveHiddenColumnsToCookie(name,cookie_param);});};dhtmlXGridObject.prototype.enableSortingSaving = function(name,cookie_param){this.attachEvent("onBeforeSorting",function(){var that=this;window.setTimeout(function(){that.saveSortingToCookie(name,cookie_param);},1);return true;});};dhtmlXGridObject.prototype.enableOrderSaving = function(name,cookie_param){this.attachEvent("onAfterCMove",function(){this.saveOrderToCookie(name,cookie_param);this.saveSizeToCookie(name,cookie_param);});};dhtmlXGridObject.prototype.enableAutoSaving = function(name,cookie_param){this.enableOrderSaving(name,cookie_param);this.enableAutoSizeSaving(name,cookie_param);this.enableSortingSaving(name,cookie_param);};dhtmlXGridObject.prototype.saveSizeToCookie=function(name,cookie_param){if (this.cellWidthType=='px')var z=this.cellWidthPX.join(",");else
 var z=this.cellWidthPC.join(",");var z2=(this.initCellWidth||(new Array)).join(",");this.setCookie(name,cookie_param,0,z);this.setCookie(name,cookie_param,1,z2);};dhtmlXGridObject.prototype.saveHiddenColumnsToCookie=function(name,cookie_param){var hs=[].concat(this._hrrar||[]);if (this._fake && this._fake._hrrar)for (var i=0;i < this._fake._cCount;i++)hs[i]=this._fake._hrrar[i]?"1":"";this.setCookie(name,cookie_param,4,hs.join(",").replace(/display:none;/g,"1"));};dhtmlXGridObject.prototype.loadHiddenColumnsFromCookie=function(name){var z=this._getCookie(name,4);var ar=(z||"").split(",");if (ar.length>this._cCount || !z)return;for (var i=0;i < ar.length;i++)this.setColumnHidden(i,(ar[i]?true:false));};dhtmlXGridObject.prototype.saveSortingToCookie=function(name,cookie_param){this.setCookie(name,cookie_param,2,(this.getSortingState()||[]).join(","));};dhtmlXGridObject.prototype.loadSortingFromCookie=function(name){var z=this._getCookie(name,2);z=(z||"").split(",");if (z.length>1 && z[0]<this._cCount){this.sortRows(z[0],null,z[1]);this.setSortImgState(true,z[0],z[1]);}};dhtmlXGridObject.prototype.saveOrderToCookie=function(name,cookie_param){if (!this._c_order){this._c_order=[];var l=this._cCount;for (var i=0;i<l;i++)this._c_order[i]=i;};this.setCookie(name,cookie_param,3,((this._c_order||[]).slice(0,this._cCount)).join(","));};dhtmlXGridObject.prototype.loadOrderFromCookie=function(name){var z=this._getCookie(name,3);z=(z||"").split(",");if (z.length>1 && z.length<=this._cCount){for (var i=0;i<z.length;i++)if ((!this._c_order && z[i]!=i)||(this._c_order && z[i]!=this._c_order[i])){var t=z[i];if (this._c_order)for (var j=0;j<this._c_order.length;j++){if (this._c_order[j]==z[i]){t=j;break;}};this.moveColumn(t*1,i);}}};dhtmlXGridObject.prototype.loadSizeFromCookie=function(name){var z=this._getCookie(name,1);if (z)this.initCellWidth=z.split(",");var z=this._getCookie(name,0);if ((z)&&(z.length)){if (!this._fake && this._hrrar)for (var i=0;i<z.length;i++)if ( this._hrrar[i])z[i]=0;if (this.cellWidthType=='px')this.cellWidthPX=z.split(",");else
 this.cellWidthPC=z.split(",");};this.setSizes();return true;};dhtmlXGridObject.prototype.clearConfigCookie=function(name){if (!name)name=this.entBox.id;var str = "gridSettings"+name + "=||||";document.cookie = str;};dhtmlXGridObject.prototype.clearSizeCookie=dhtmlXGridObject.prototype.clearConfigCookie;dhtmlXGridObject.prototype.setCookie=function(name,cookie_param,pos,value) {if (!name)name=this.entBox.id;var t=this.getCookie(name);t=(t||"||||").split("|");t[pos]=value;var str = "gridSettings"+name + "=" + t.join("|") + (cookie_param?(";"+cookie_param):"");document.cookie = str;};dhtmlXGridObject.prototype.getCookie=function(name,surname) {if (!name)name=this.entBox.id;name=(surname||"gridSettings")+name;var search = name + "=";if (document.cookie.length > 0){var offset = document.cookie.indexOf(search);if (offset != -1){offset += search.length;var end = document.cookie.indexOf(";", offset);if (end == -1)end = document.cookie.length;return document.cookie.substring(offset, end);}}};dhtmlXGridObject.prototype._getCookie=function(name,pos) {return ((this.getCookie(name)||"||||").split("|"))[pos];};function dhtmlXGridFromTable(obj,init){if(typeof(obj)!='object')
 obj = document.getElementById(obj);obj.className="";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)));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(mr.getAttribute("imgpath")||"");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(xml){if (xml.tagName && xml.tagName == "TABLE")return this._process_inner_html(xml,0);var temp=document.createElement("DIV");temp.innerHTML=xml.xmlDoc.responseText;var mr = temp.getElementsByTagName("TABLE")[0];this._process_inner_html(mr,0);};dhtmlXGridObject.prototype._process_inner_html=function(mr,start){var n_l=mr.rows.length;for (var j=start;j<n_l;j++){var id=mr.rows[j].getAttribute("id")||j;this.rowsBuffer.push({idd:id, data:mr.rows[j], _parser: this._process_html_row, _locator:this._get_html_data });};this.render_dataset();this.setSizes();};dhtmlXGridObject.prototype._process_html_row=function(r,xml){var cellsCol = xml.getElementsByTagName('TD');var strAr = [];r._attrs=this._xml_attrs(xml);for(var j=0;j<cellsCol.length;j++){var cellVal=cellsCol[j];var exc=cellVal.getAttribute("type");if (r.childNodes[j]){if (exc)r.childNodes[j]._cellType=exc;r.childNodes[j]._attrs=this._xml_attrs(cellsCol[j]);};if (cellVal.firstChild)strAr.push(cellVal.innerHTML);else strAr.push("");if (cellVal.colSpan>1){r.childNodes[j]._attrs["colspan"]=cellVal.colSpan;for (var k=1;k<cellVal.colSpan;k++){strAr.push("")
 }}};for(j<cellsCol.length;j<r.childNodes.length;j++)r.childNodes[j]._attrs={};this._fillRow(r,(this._c_order?this._swapColumns(strAr):strAr));return r;};dhtmlXGridObject.prototype._get_html_data=function(data,ind){data=data.firstChild;while (true){if (!data)return "";if (data.tagName=="TD")ind--;if (ind<0)break;data=data.nextSibling;};return (data.firstChild?data.firstChild.data:"");};dhtmlxEvent(window,"load",function(){var z=document.getElementsByTagName("table");for (var a=0;a<z.length;a++)if (z[a].className=="dhtmlxGrid"){dhtmlXGridFromTable(z[a]);}});dhtmlXGridObject.prototype.enableUndoRedo = function()
{var self = this;var func = function() {return self._onEditUndoRedo.apply(self,arguments);};this.attachEvent("onEditCell", func);var func2 = function(a,b,c) {return self._onEditUndoRedo.apply(self,[2,a,b,(c?1:0),(c?0:1)]);};this.attachEvent("onCheckbox", func2);this._IsUndoRedoEnabled = true;this._UndoRedoData = [];this._UndoRedoPos = -1;};dhtmlXGridObject.prototype.disableUndoRedo = function()
{this._IsUndoRedoEnabled = false;this._UndoRedoData = [];this._UndoRedoPos = -1;};dhtmlXGridObject.prototype._onEditUndoRedo = function(stage, row_id, cell_index, new_value, old_value)
{if (this._IsUndoRedoEnabled && stage == 2 && old_value != new_value){if (this._UndoRedoPos !== -1 && this._UndoRedoPos != ( this._UndoRedoData.length-1 )) {this._UndoRedoData = this._UndoRedoData.slice(0, this._UndoRedoPos+1);}else if (this._UndoRedoPos === -1 && this._UndoRedoData.length > 0){this._UndoRedoData = [];};var obj = {old_value:old_value,
 new_value:new_value,
 row_id:row_id,
 cell_index:cell_index
 };this._UndoRedoData.push(obj);this._UndoRedoPos++;};return true;};dhtmlXGridObject.prototype.doUndo = function()
{if (this._UndoRedoPos === -1)return false;var obj = this._UndoRedoData[this._UndoRedoPos--];var c=this.cells(obj.row_id, obj.cell_index);if (this.getColType(obj.cell_index)=="tree")
 c.setLabel(obj.old_value);else
 c.setValue(obj.old_value);};dhtmlXGridObject.prototype.doRedo = function()
{if (this._UndoRedoPos == this._UndoRedoData.length-1)return false;var obj = this._UndoRedoData[++this._UndoRedoPos];this.cells(obj.row_id, obj.cell_index).setValue(obj.new_value);};dhtmlXGridObject.prototype.getRedo = function()
{if (this._UndoRedoPos == this._UndoRedoData.length-1)return [];return this._UndoRedoData.slice(this._UndoRedoPos+1);};dhtmlXGridObject.prototype.getUndo = function()
{if (this._UndoRedoPos == -1)return [];return this._UndoRedoData.slice(0, this._UndoRedoPos+1);};function eXcell_sub_row(cell){if (cell){this.cell = cell;this.grid = this.cell.parentNode.grid;};this.getValue = function(){return this.grid.getUserData(this.cell.parentNode.idd,"__sub_row");};this._setState = function(m,v){(v||this.cell).innerHTML="<img src='"+this.grid.imgURL+m+"' width='18' height='18' />";(v||this.cell).firstChild.onclick=this.grid._expandMonolite;};this.open = function (){this.cell.firstChild.onclick(null,true)
 };this.close = function (){this.cell.firstChild.onclick(null,false,true)
 };this.setValue = function(val){if (val)this.grid.setUserData(this.cell.parentNode.idd,"__sub_row",val);this._setState(val?"plus.gif":"blanc.gif");};this.setContent = function(val){if (this.cell.parentNode._expanded){this.cell.parentNode._expanded.innerHTML=val;this.grid._detectHeight(this.cell.parentNode._expanded,this.cell,this.cell.parentNode._expanded.scrollHeight)
 }else{this.cell._previous_content=null;this.setValue(val);this.cell._sub_row_type=null
 }};this.isDisabled = function(){return true;};this.getTitle = function(){return this.grid.getUserData(this.cell.parentNode.idd,"__sub_row")?"click to expand|collapse":"";}};eXcell_sub_row.prototype = new eXcell;function eXcell_sub_row_ajax(cell){this.base=eXcell_sub_row;this.base(cell);this.setValue = function(val){if (val)this.grid.setUserData(this.cell.parentNode.idd,"__sub_row",val);this.cell._sub_row_type="ajax";this._setState(val?"plus.gif":"blanc.gif");}};eXcell_sub_row_ajax.prototype = new eXcell_sub_row;function eXcell_sub_row_grid(cell){this.base=eXcell_sub_row;this.base(cell);this.setValue = function(val){if (val)this.grid.setUserData(this.cell.parentNode.idd,"__sub_row",val);this.cell._sub_row_type="grid";this._setState(val?"plus.gif":"blanc.gif");};this.getSubGrid = function(){if (!cell._sub_grid)return null;return cell._sub_grid;}};eXcell_sub_row_grid.prototype = new eXcell_sub_row;dhtmlXGridObject.prototype._expandMonolite=function(n,show,hide){var td=this.parentNode;var row=td.parentNode;var that=row.grid;var c=that.getUserData(row.idd,"__sub_row");if (!that._sub_row_editor)that._sub_row_editor=new eXcell_sub_row(td);if (!c)return;if (row._expanded && !show){that._sub_row_editor._setState("plus.gif",td);td._previous_content=row._expanded;that.objBox.removeChild(row._expanded);row._expanded=false;row.style.height=(row.oldHeight||20)+"px";td.style.height=(row.oldHeight||20)+"px";if (that._fake)that._fake.rowsAr[row.idd].style.height=(row.oldHeight||20)+"px";for (var i=0;i<row.cells.length;i++){row.cells[i].style.verticalAlign="middle";row.cells[i].style.paddingTop="0px";};delete that._flow[row.idd];that._correctMonolite();row._expanded.ctrl=null;}else if (!row._expanded && !hide){that._sub_row_editor._setState("minus.gif",td);row.oldHeight=td.offsetHeight;if (td._previous_content){var d=td._previous_content;d.ctrl=td;that.objBox.appendChild(d);that._detectHeight(d,td,parseInt(d.style.height)) 
 }else {var d=document.createElement("DIV");d.ctrl=td;if (td._sub_row_type)that._sub_row_render[td._sub_row_type](that,d,td,c);else
 d.innerHTML=c;d.style.cssText="position:absolute;left:0px;top:0px;overflow:auto;font-family:Tahoma;font-size:8pt;margin-top:2px;margin-left:4px;";d.className="dhx_sub_row";that.objBox.appendChild(d);that._detectHeight(d,td) 
 };if (!that._flow){that.attachEvent("onGridReconstructed",function(){if (this.pagingOn || this._srnd)this._collapsMonolite();else this._correctMonolite();});that.attachEvent("onResizeEnd",function(){this._correctMonolite(true);});that.attachEvent("onAfterCMove",function(){this._correctMonolite(true);});that.attachEvent("onDrop",function(){this._correctMonolite(true);});that.attachEvent("onBeforePageChanged",function(){this._collapsMonolite();return true;});that.attachEvent("onGroupStateChanged",function(){this._correctMonolite();return true;});that.attachEvent("onFilterEnd",function(){this._collapsMonolite();});that.attachEvent("onUnGroup",function(){this._collapsMonolite();});that.attachEvent("onPageChanged",function(){this._collapsMonolite();});that.attachEvent("onXLE",function(){this._collapsMonolite();});that.attachEvent("onClearAll",function(){for (var i in this._flow){if (this._flow[i] && this._flow[i].parentNode)this._flow[i].parentNode.removeChild(this._flow[i]);};this._flow=[];});that.attachEvent("onEditCell",function(a,b,c){if ((a!==2)&& this._flow[b] && this.cellType[c]!="ch" && this.cellType[c]!="ra") this._expandMonolite.apply(this._flow[b].ctrl.firstChild,[0,false,true]);return true;});that.attachEvent("onCellChanged",function(id,ind){if (!this._flow[id])return;var c=this.cells(id,ind).cell;c.style.verticalAlign="top";c.style.paddingTop="3px";});that._flow=[];};that._flow[row.idd]=d;that._correctMonolite();for (var i=0;i<row.cells.length;i++){row.cells[i].style.verticalAlign="top";row.cells[i].style.paddingTop="3px";};if (that._fake){var frow=that._fake.rowsAr[row.idd];for (var i=0;i<frow.cells.length;i++){frow.cells[i].style.verticalAlign="top";frow.cells[i].style.paddingTop="3px";}};td.style.paddingTop="1px";row._expanded=d;};if (that._ahgr)that.setSizes()
 if (that.parentGrid)that.callEvent("onGridReconstructed",[]);that.callEvent("onSubRowOpen",[row.idd,(!!row._expanded)]);};dhtmlXGridObject.prototype._sub_row_render={"ajax":function(that,d,td,c){d.innerHTML="Loading...";var xml=new dtmlXMLLoaderObject(function(){d.innerHTML=xml.xmlDoc.responseText;var z=xml.xmlDoc.responseText.match(/<script[^>]*>([^<]+)<\/script>/g);if (z)for (var i=0;i<z.length;i++)eval(z[i].replace(/<([\/]{0,1})s[^>]*>/g,""));that._detectHeight(d,td)
 that._correctMonolite();that.setUserData(td.parentNode.idd,"__sub_row",xml.xmlDoc.responseText);td._sub_row_type=null;if (that._ahgr)that.setSizes()
 that.callEvent("onSubAjaxLoad",[td.parentNode.idd,xml.xmlDoc.responseText]);}, this,true,true);xml.loadXML(c);},
 "grid":function(that,d,td,c){td._sub_grid= new dhtmlXGridObject(d);if (that.skin_name)td._sub_grid.setSkin(that.skin_name);td._sub_grid.parentGrid=that;td._sub_grid.setImagePath(that.imgURL);td._sub_grid.enableAutoHeight(true);td._sub_grid.attachEvent("onGridReconstructed",function(){that._detectHeight(d,td,td._sub_grid.objBox.scrollHeight+td._sub_grid.hdr.offsetHeight+(this.ftr?this.ftr.offsetHeight:0));that._correctMonolite();this.setSizes();if (that.parentGrid)that.callEvent("onGridReconstructed",[]);})
 if (!that.callEvent("onSubGridCreated",[td._sub_grid,td.parentNode.idd,td._cellIndex,c])) return;td._sub_grid.loadXML(c,function(){that._detectHeight(d,td,td._sub_grid.objBox.scrollHeight+td._sub_grid.hdr.offsetHeight+(td._sub_grid.ftr?td._sub_grid.ftr.offsetHeight:0));td._sub_grid.objBox.style.overflow="hidden";that._correctMonolite();td._sub_row_type=null;if (!that.callEvent("onSubGridLoaded",[td._sub_grid,td.parentNode.idd,td._cellIndex,c])) return;if (that._ahgr)that.setSizes();});}};dhtmlXGridObject.prototype._detectHeight=function(d,td,h){var l=td.offsetLeft+td.offsetWidth;d.style.left=l+"px";d.style.width=Math.max(0,td.parentNode.offsetWidth-l-4)+"px"
 var h=h||d.scrollHeight;d.style.overflow="hidden";d.style.height=h+"px";var row=td.parentNode;td.parentNode.style.height=(row.oldHeight||20)+3+h*1+"px";td.style.height=(row.oldHeight||20)+3+h*1+"px";if (this._fake){var tr=this._fake.rowsAr[td.parentNode.idd];tr.style.height=(row.oldHeight||20)+3+h*1+"px";}};dhtmlXGridObject.prototype._correctMonolite=function(mode){if (this._in_correction)return;this._in_correction=true;for (var a in this._flow)if (this._flow[a] && this._flow[a].tagName=="DIV")if (this.rowsAr[a]){if (this.rowsAr[a].style.display=="none"){this.cells4(this._flow[a].ctrl).close();continue;};this._flow[a].style.top=this.rowsAr[a].offsetTop+(this.rowsAr[a].oldHeight||20)+"px";if (mode){var l=this._flow[a].ctrl.offsetLeft+this._flow[a].ctrl.offsetWidth;this._flow[a].style.left=l+"px";this._flow[a].style.width=this.rowsAr[a].offsetWidth-l-4+"px"
 }}else{this._flow[a].ctrl=null;this.objBox.removeChild(this._flow[a]);delete this._flow[a];};this._in_correction=false;};dhtmlXGridObject.prototype._collapsMonolite=function(){for (var a in this._flow)if (this._flow[a] && this._flow[a].tagName=="DIV")if (this.rowsAr[a])this.cells4(this._flow[a].ctrl).close();};dhtmlxValidation=function(){};dhtmlxValidation.prototype={trackInput:function(el,rule,callback_error,callback_correct){dhtmlxEvent(el,"keyup",function(e){if (!dhtmlxValidation.checkInput(el,rule)){if(!callback_error || callback_error(el,el.value,rule))
 el.className+=" dhtmlx_live_validation_error";}else {el.className=el.className.replace(/[ ]*dhtmlx_live_validation_error/g,"");if (callback_correct)callback_correct(el,el.value,rule);}});},
 checkInput:function(input,rule){return this.checkValue(input.value,rule);},
 checkValue:function(value,rule){if (!rule)return;if (typeof rule!="string" && rule.length){var final_res=true;for (var i=0;i<rule.length;i++){var res=this.checkValue(value,rule[i]);final_res=final_res&&res;};return final_res;};if (!this["is"+rule])alert("Incorrect validation rule: "+rule);return this["is"+rule](value);},
 
 isEmpty: function(value) {return value == '';},
 isNotEmpty: function(value) {return !value == '';},
 isValidBoolean: function(value) {return !!value.match(/^(0|1|true|false)$/);},
 isValidEmail: function(value) {return !!value.match(/(^[a-z]([a-z_\.]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@([a-z_\-\.]*)(\.[a-z]{2,4})$)/i);},
 isValidInteger: function(value) {return !!value.match(/(^-?\d+$)/);},
 isValidNumeric: function(value) {return !!value.match(/(^-?\d\d*[\.|,]\d*$)|(^-?\d\d*$)|(^-?[\.|,]\d\d*$)/);},
 isValidAplhaNumeric: function(value) {return !!value.match(/^[_\-a-z0-9]+$/gi);},
 
 isValidDatetime: function(value) {var dt = value.match(/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/);return dt && !!(dt[1]<=9999 && dt[2]<=12 && dt[3]<=31 && dt[4]<=59 && dt[5]<=59 && dt[6]<=59) || false;},
 
 isValidDate: function(value) {var d = value.match(/^(\d{4})-(\d{2})-(\d{2})$/);return d && !!(d[1]<=9999 && d[2]<=12 && d[3]<=31) || false;},
 
 isValidTime: function(value) {var t = value.match(/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/);return t && !!(t[1]<=24 && t[2]<=59 && t[3]<=59) || false;},
 
 isValidIPv4: function(value) {var ip = value.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);return ip && !!(ip[1]<=255 && ip[2]<=255 && ip[3]<=255 && ip[4]<=255) || false;},
 isValidCurrency: function(value) {return value.match(/^\$?\s?\d+?[\.,\,]?\d+?\s?\$?$/) && true || false;},
 
 isValidSSN: function(value) {return value.match(/^\d{3}\-?\d{2}\-?\d{4}$/) && true || false;},
 
 isValidSIN: function(value) {return value.match(/^\d{9}$/) && true || false;}};dhtmlxValidation=new dhtmlxValidation();dhtmlXGridObject.prototype.enableValidation=function(mode,live){mode=convertStringToBoolean(mode);if (mode){this._validators={data:[] }}else
 this._validators=false;if (arguments.length>1)this._validators._live=live;if (!this._validators._event)this._validators._event=this.attachEvent("onEditCell",this.validationEvent);};dhtmlXGridObject.prototype.setColValidators=function(vals){if (!this._validators)this.enableValidation(true);if (typeof vals == "string")vals=vals.split(this.delim)
 this._validators.data=vals;};dhtmlXGridObject.prototype.validationEvent=function(stage,id,ind,newval,oldval){var v=this._validators;if (!v)return true;var rule=(v.data[ind]||this.cells(id,ind).getAttribute("validate"))||"";if (stage==1 && rule){var ed = this.editor||this._fake.editor;ed.cell.className=ed.cell.className.replace(/[ ]*dhtmlx_validation_error/g,"");if (v._live){var grid=this;dhtmlxValidation.trackInput(ed.getInput(),rule,function(element,value,rule){return grid.callEvent("onLiveValidationError",[id,ind,value,element,rule]);},function(element,value,rule){return grid.callEvent("onLiveValidationCorrect",[id,ind,value,element,rule]);});}};if (stage==2)this.validateCell(id,ind,rule,newval)
 
 return true;};dhtmlXGridObject.prototype.validateCell=function(id,ind,rule,value){rule=rule||(this._validators.data[ind]||this.cells(id,ind).getAttribute("validate"));value=value||this.cells(id,ind).getValue();if (!rule)return;var cell = this.cells(id,ind).cell;if (!dhtmlxValidation.checkValue(value,rule.split(","))){if (this.callEvent("onValidationError",[id,ind,value,rule])){cell.className+=" dhtmlx_validation_error";};return false;}else {this.callEvent("onValidationCorrect",[id,ind,value,rule]);cell.className=cell.className.replace(/[ ]*dhtmlx_validation_error/g,"");};return true;};function eXcell_dhxCalendar(cell){if (cell){this.cell = cell;this.grid = this.cell.parentNode.grid;if (!this.grid._grid_calendarA){var z=document.createElement("div");if (_isIE){z.style.position="absolute"
 z.style.top="0px"
 };document.body.insertBefore(z,document.body.firstChild);var cal=this.grid._grid_calendarA=new dhtmlxCalendarObject(z,false, {isYearEditable :true});cal.loadUserLanguage('en-us');if (cal.setYearsRange)cal.setYearsRange(1900, 2100);cal.draw();cal.hide();cal.setSkin("yahoolike");this.grid.callEvent("onDhxCalendarCreated",[cal]);var sgrid=this.grid;cal.attachEvent("onClick",function(){this._last_operation_calendar=true;window.setTimeout(function(){sgrid.editStop()},1);return true;});var zFunc=function(e){(e||event).cancelBubble=true;};dhtmlxEvent(cal.entObj,"click",zFunc);cal=null;}}};eXcell_dhxCalendar.prototype = new eXcell;eXcell_dhxCalendar.prototype.edit = function(){var arPos = this.grid.getPosition(this.cell);this.grid._grid_calendarA.setPosition(arPos[1],arPos[0]);this.grid._grid_calendarA._last_operation_calendar=false;this.grid._grid_calendarA.show();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 t=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=t;this.grid._grid_calendarA.draw();};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 "";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 z1=this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"));var z2=this.grid._grid_calendarA.getDate();this.cell.val=new Date(z2);this.setCValue(z1,z2);this.cell._clearCell=!z1;var t=this.val;this.val=this._val;return (this.cell.val.valueOf()!=t);};return false;};eXcell_dhxCalendar.prototype.setValue = function(val){if (typeof val == "object"){this.cell.val=val;this.cell._clearCell=false;this.setCValue(this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),val).toString(),this.cell.val);return;};if(!val || val.toString()._dhx_trim()==""){val="&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"),val.toString(),null,true));if (this.grid._dtmask_inc)val = 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((val||"").toString(),this.cell.val);};function eXcell_dhxCalendarA(cell){if (cell){this.cell = cell;this.grid = this.cell.parentNode.grid;if (!this.grid._grid_calendarA){var z=document.createElement("DIV");document.body.insertBefore(z,document.body.firstChild);this.grid._grid_calendarA=new dhtmlxCalendarObject(z,false, {isYearEditable :true});this.grid._grid_calendarA.loadUserLanguage('en-us');this.grid._grid_calendarA.setYearsRange(1900, 2100);this.grid._grid_calendarA.draw();this.grid._grid_calendarA.hide();this.grid._grid_calendarA.setSkin("yahoolike");this.grid.callEvent("onDhxCalendarCreated",[cal]);var sgrid=this.grid;this.grid._grid_calendarA.attachEvent("onClick",function(){this._last_operation_calendar=true;window.setTimeout(function(){sgrid.editStop()},1);return true;});var zFunc=function(e){(e||event).cancelBubble=true;};dhtmlxEvent(this.grid._grid_calendarA.entObj,"click",zFunc);}}};eXcell_dhxCalendarA.prototype = new eXcell;eXcell_dhxCalendarA.prototype.edit = function(){var arPos = this.grid.getPosition(this.cell);this.grid._grid_calendarA.setPosition(arPos[1],arPos[0]*1+this.cell.offsetWidth);this.grid._grid_calendarA.show();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 t=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=t;this.grid._grid_calendarA.draw();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(e){(e||event).cancelBubble = true};this.obj.onmousedown = function(e){(e||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(e){if (!e)e=event;e.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 "";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 z1=this.grid._grid_calendarA.getFormatedDate(this.grid._dtmask||"%d/%m/%Y");var z2=this.grid._grid_calendarA.getDate();this.cell.val=new Date(z2);this.setCValue(z1,z2);this.cell._clearCell = !z1;var t=this.val;this.val=this._val;return (this.cell.val.valueOf()!=(t|"").valueOf());};this.setValue(this.obj.value);var t=this.val;this.val=this._val;return (this.cell.val.valueOf()!=(t||"").valueOf());};eXcell_dhxCalendarA.prototype.setValue = function(val){if (typeof val == "object"){this.cell.val=val;this.cell._clearCell=false;this.setCValue(this.grid._grid_calendarA.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),val).toString(),this.cell.val);return;};if(!val || val.toString()._dhx_trim()==""){val="&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"),val.toString(),null,true));if (this.grid._dtmask_inc)val = 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((val||"").toString(),this.cell.val);};function eXcell_cntr(cell){this.cell = cell;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(id){this.resetCounter(cell._cellIndex);});this.grid.attachEvent("onBeforeSorting",function(){var that=this;window.setTimeout(function(){if (that._fake && !that._realfake && cell._cellIndex<that._fake._cCount)that._fake.resetCounter(cell._cellIndex);else
 that.resetCounter(cell._cellIndex);},1)
 return true;});};this.edit = function(){};this.getValue = function(){return this.cell.innerHTML;};this.setValue = function(val){this.cell.style.paddingRight = "2px";var cell=this.cell;window.setTimeout(function(){if (!cell.parentNode)return;var val=cell.parentNode.rowIndex;if (cell.parentNode.grid.currentPage || val<0 || cell.parentNode.grid._srnd)val=cell.parentNode.grid.rowsBuffer._dhx_find(cell.parentNode)+1;if (val<=0)return;cell.innerHTML = val;if (cell.parentNode.grid._fake && cell._cellIndex<cell.parentNode.grid._fake._cCount && cell.parentNode.grid._fake.rowsAr[cell.parentNode.idd])cell.parentNode.grid._fake.cells(cell.parentNode.idd,cell._cellIndex).setCValue(val);cell=null;},100);}};dhtmlXGridObject.prototype.resetCounter=function(ind){if (this._fake && !this._realfake && ind < this._fake._cCount)this._fake.resetCounter(ind,this.currentPage);var i=arguments[0]||0;if (this.currentPage)i=(this.currentPage-1)*this.rowsBufferOutSize;for (i=0;i<this.rowsBuffer.length;i++)if (this.rowsBuffer[i].tagName == "TR")this.rowsAr[this.rowsBuffer[i].idd].childNodes[ind].innerHTML=i+1;};eXcell_cntr.prototype = new eXcell;function eXcell_link(cell){this.cell = cell;this.grid = this.cell.parentNode.grid;this.isDisabled=function(){return true;};this.edit = function(){};this.getValue = function(){if(this.cell.firstChild.getAttribute)return this.cell.firstChild.innerHTML+"^"+this.cell.firstChild.getAttribute("href")
 else
 return "";};this.setValue = function(val){if((typeof(val)!="number") && (!val || val.toString()._dhx_trim()=="")){this.setCValue("&nbsp;",valsAr);return (this.cell._clearCell=true);};var valsAr = val.split("^");if(valsAr.length==1)valsAr[1] = "";else{if(valsAr.length>1){valsAr[1] = "href='"+valsAr[1]+"'";if(valsAr.length==3)valsAr[1]+= " target='"+valsAr[2]+"'";else
 valsAr[1]+= " target='_blank'";}};this.setCValue("<a "+valsAr[1]+" onclick='(_isIE?event:arguments[0]).cancelBubble = true;'>"+valsAr[0]+"</a>",valsAr);}};eXcell_link.prototype = new eXcell;eXcell_link.prototype.getTitle=function(){var z=this.cell.firstChild;return ((z&&z.tagName)?z.getAttribute("href"):"");};eXcell_link.prototype.getContent=function(){var z=this.cell.firstChild;return ((z&&z.tagName)?z.innerHTML:"");};function eXcell_clist(cell){try{this.cell = cell;this.grid = this.cell.parentNode.grid;}catch(er){};this.edit = function(){this.val = this.getValue();var a=(this.cell._combo||this.grid.clists[this.cell._cellIndex]);if (!a)return;this.obj = document.createElement("DIV");var b=this.val.split(",");var text="";for (var i=0;i<a.length;i++){var fl=false;for (var j=0;j<b.length;j++)if (a[i]==b[j])fl=true;if (fl)text+="<div><input type='checkbox' checked='true' /><label>"+a[i]+"</label></div>";else
 text+="<div><input type='checkbox' id='ch_lst_"+i+"'/><label>"+a[i]+"</label></div>";};text+="<div><input type='button' value='Apply' style='width:100px;font-size:8pt;' onclick='this.parentNode.parentNode.editor.grid.editStop();'/></div>"

 this.obj.editor=this;this.obj.innerHTML=text;document.body.appendChild(this.obj);this.obj.style.position="absolute";this.obj.className="dhx_clist";this.obj.onclick=function(e){(e||event).cancelBubble=true;return true;};var arPos = this.grid.getPosition(this.cell);this.obj.style.left=arPos[0]+"px";this.obj.style.top=arPos[1]+this.cell.offsetHeight+"px";this.obj.getValue=function(){var text="";for (var i=0;i<this.childNodes.length-1;i++)if (this.childNodes[i].childNodes[0].checked){if (text)text+=",";text+=this.childNodes[i].childNodes[1].innerHTML;};return text;}};this.getValue = function(){if (this.cell._clearCell)return "";return this.cell.innerHTML.toString()._dhx_trim()
 };this.detach = function(val){if (this.obj){this.setValue(this.obj.getValue());this.obj.editor=null;this.obj.parentNode.removeChild(this.obj);this.obj=null;};return this.val!=this.getValue();}};eXcell_clist.prototype = new eXcell;eXcell_clist.prototype.setValue = function(val){if (typeof(val)=="object"){var optCol=this.grid.xmlLoader.doXPath("./option",val);if (optCol.length)this.cell._combo=[];for (var j=0;j<optCol.length;j++)this.cell._combo.push(optCol[j].firstChild?optCol[j].firstChild.data:"");val=val.firstChild.data;};if (val==="" || val === this.undefined){this.setCTxtValue(" ",val);this.cell._clearCell=true;}else{this.setCValue(val);this.cell._clearCell=false;}};dhtmlXGridObject.prototype.registerCList=function(col,list){if (!this.clists)this.clists=new Array();if (typeof(list)!="object") list=list.split(",");this.clists[col]=list;};function dhtmlXLayoutPanel(){};function dhtmlXLayoutObject(base, view, skin) {if (!window.dhtmlXContainer){alert(this.i18n.dhxcontalert);return;};var that = this;this._autodetectSkin = function() {var t = document.createElement("DIV");t.className = "dhxlayout_skin_detect";if (document.body.childNodes.length > 0)document.body.insertBefore(t, document.body.childNodes[0]);else document.body.appendChild(t);var w = t.offsetWidth;document.body.removeChild(t);t = null;if (w == 199)return "dhx_skyblue";if (w == 299)return "dhx_blue";if (w == 399)return "dhx_black";if (w == 499)return "dhx_web";return "dhx_skyblue";};this.skin = (skin!=null?skin:this._autodetectSkin());this.setSkin = function(skin) {if (!this.skinParams[skin])return;this.skin = skin;this._CPanelHeight = this.skinParams[this.skin]["cpanel_height"];this._collapsedW = this.skinParams[this.skin]["cpanel_collapsed_width"];this._collapsedH = this.skinParams[this.skin]["cpanel_collapsed_height"];this.tpl.className = "dhtmlxLayoutPolyContainer_"+this.skin+(this._r?" dhxlayout_rtl":"");this.sizer.className = "dhxLayout_Sizer_"+this.skin;if (this.dhxWins)this.dhxWins.setSkin(this.skin);for (var a in this.polyObj)this.polyObj[a].skin = this.skin;this.base.skin = this.skin;this._fixIcons();this.setSizes();};this._dblClickTM = 200;this._mTop = 0;this._mBottom = 0;if (typeof(base)== "string") {base = document.getElementById(base);};if ((base._isWindow == true || base._isCell)&& !this.base) {if (base._isCell && base.attachLayout)return base.attachLayout(view, skin);if (base.isWindow)return base.attachLayout(view, skin);this.base = base;};if (base == document.body && !this.base){document.body.style.overflow = "hidden";};if ((typeof(base)== "object" || base == document.body) && !this.base) {var contObj = document.createElement("DIV");contObj.className = "dhxcont_global_layout_area";base.appendChild(contObj);base._isLayout = true;this.cont = new dhtmlXContainer(base);this.cont.setContent(contObj);if (base == document.body){if (this.skin == "dhx_skyblue"){this.cont.obj._offsetTop = 2;this.cont.obj._offsetLeft = 2;this.cont.obj._offsetHeight = -4;this.cont.obj._offsetWidth = -4;};if (this.skin == "dhx_web"){this.cont.obj._offsetTop = 9;this.cont.obj._offsetLeft = 9;this.cont.obj._offsetHeight = -18;this.cont.obj._offsetWidth = -18;};document.body.className += " dhxlayout_fullscreened";};base.adjustContent(base, this._mTop, null, null, this._mBottom);this.base = document.createElement("DIV");this.base.style.overflow = "hidden";this.base.style.position = "absolute";this.base.style.left = "0px";this.base.style.top = "0px";this.base.style.width = contObj.childNodes[0].style.width;this.base.style.height = contObj.childNodes[0].style.height;contObj.childNodes[0].appendChild(this.base);if (base == document.body){this._tmTime = null;this._lw = null;this._doOnResizeStart = function() {if (this._lw != document.documentElement.clientHeight){window.clearTimeout(this._tmTime);this._tmTime = window.setTimeout(function(){that._doOnResizeEnd();},200);};this._lw = document.documentElement.clientHeight;};this._doOnResizeEnd = function() {var dim = this._defineWindowMinDimension(this.base, true);document.body.setMinContentSize(dim[1], dim[2]);document.body.adjustContent(document.body, 0);this.setSizes(false);};if (_isIE){window.attachEvent("onresize", that._doOnResizeStart);}else {window.addEventListener("resize", that._doOnResizeStart, false);}}};this.items = new Array();this.cells = function(id) {if (this.polyObj[id] != null){return this.polyObj[id];};return null;};this.getIdByIndex = function(ind) {if (ind < 0)return null;if (ind >= this.items.length)return null;return this.items[ind]._idd;};this.getIndexById = function(id) {if (this.cells(id)!= null) return this.cells(id).getIndex();return null;};this.imagePath = dhtmlx.image_path||"codebase/imgs/";this.setImagePath = function(path) {this.imagePath = path;};this.polyObj = {};this.sepHor = new Array();this.sepVer = new Array();this._layoutView = (view!=null?String(view).toUpperCase():"3E");this._minWidth = 40;this._minHeight = 40;this._CPanelBtnsWidth = 32;this.skinParams = {"dhx_black" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 34, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
 "dhx_blue" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 34, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
 "dhx_skyblue" : {"hor_sep_height": 5, "ver_sep_width": 5, "cpanel_height": 26, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
 
 "dhx_web" : {"hor_sep_height": 9, "ver_sep_width": 9, "cpanel_height": 27, "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18, "cell_pading_max": 1, "cell_pading_min": 0}};this._CPanelHeight = this.skinParams[this.skin]["cpanel_height"];this._collapsedW = this.skinParams[this.skin]["cpanel_collapsed_width"];this._collapsedH = this.skinParams[this.skin]["cpanel_collapsed_height"];this.tpl = document.createElement("TABLE");this.tpl.dir = "ltr";this.tpl.className = "dhtmlxLayoutPolyContainer_"+this.skin;this.tpl.cellSpacing = 0;this.tpl.cellPadding = 0;var bd = document.createElement("TBODY");this.tpl.appendChild(bd);this.tpl.border = 0;this.tplSizes = {};this._effects = {"collapse": false, "resize": false, "highlight": true };this.sizer = document.createElement("DIV");this.sizer.className = "dhxLayout_Sizer_"+this.skin;this.sizer.style.display = "none";document.body.appendChild(this.sizer);this._attachSizer = function(obj) {that.sizer.style.left = getAbsoluteLeft(obj)+"px";that.sizer.style.top = getAbsoluteTop(obj)+"px";that.sizer.style.width = obj.offsetWidth+"px";that.sizer.style.height = obj.offsetHeight+"px";if (that._sizerML != null)that.sizer.style.marginLeft = that._sizerML+"px";if (that._sizerMT != null)that.sizer.style.marginTop = that._sizerMT+"px";that.sizer.style.display = "";that.sizer.className = "dhxLayout_Sizer_"+that.skin;if (obj._dir != null){that.sizer.className += " "+(obj._dir=="hor"?"dhxCursorNResize":"dhxCursorWResize");}};this.listViews = function() {var views = new Array();for (var a in this.tplData){views[views.length] = a;};return views;};this._init = function() {this.obj = document.createElement("DIV");this.obj.className = "dhtmlxLayoutObject";this.base.appendChild(this.obj);this.obj.appendChild(this.tpl);this.w = this.obj.offsetWidth;this.h = this.obj.offsetHeight;this._xmlLoader.loadXMLString(this.tplData[this._layoutView]!=null?this.tplData[this._layoutView]:this.tplData["3E"]);this._initWindows();};this._autoHor = new Array();this._autoVer = new Array();this._dimension = new Array(320, 200);this._rowsRatio = 100;this._colsRatio = 100;this._xmlParser = function() {var tableDataH = new Array();var tableDataV = new Array();var tableSeps = {};var root = this.getXMLTopNode("layout");for (var q=0;q<root.childNodes.length;q++){if (root.childNodes[q].tagName == "row"){var row = root.childNodes[q];var tr = document.createElement("TR");that.tpl.childNodes[0].appendChild(tr);for (var w=0;w<row.childNodes.length;w++){if (row.childNodes[w].tagName == "cell"){var cell = row.childNodes[w];var td = document.createElement("TD");td._dir = "null";if (cell.getAttribute("obj")!= null) {var obj = cell.getAttribute("obj");var wh = String(cell.getAttribute("wh")).split(",");var f = isNaN(wh[0]);var tdW = (isNaN(wh[0])?parseInt(that.polyObj[wh[0]].style.width):0);for (var q1=0;q1<tableDataH.length;q1++){for (var w1=0;w1<tableDataH[q1].length;w1++){if (tableDataH[q1][w1] == obj){if (!f){f = true;var mw = that.base.offsetWidth - tableSeps[obj][0]*that.skinParams[that.skin]["ver_sep_width"];for (var r=0;r<tableDataH[q1].length;r++){if (!isNaN(tableDataH[q1][r])) {mw -= tableDataH[q1][r];wh[0] -= 1;}};tdW = Math.ceil(mw/wh[0]);};tableDataH[q1][w1] = tdW;}}};td.style.width = tdW+"px";var f = isNaN(wh[1]);var tdH = (isNaN(wh[1])?parseInt(that.polyObj[wh[1]].style.height):0);for (var q1=0;q1<tableDataV.length;q1++){for (var w1=0;w1<tableDataV[q1].length;w1++){if (tableDataV[q1][w1] == obj){if (!f){f = true;var mh = that.base.offsetHeight - tableSeps[obj][1]*that.skinParams[that.skin]["hor_sep_height"];for (var r=0;r<tableDataV.length;r++){if (!isNaN(tableDataV[r][w1])) {mh -= tableDataV[r][w1];wh[1] -= 1;}};tdH = Math.ceil(mh/wh[1]);};tableDataV[q1][w1] = tdH;}}};td.style.height = tdH+"px";td.className = "dhtmlxLayoutSinglePoly";td.innerHTML = "";td._minW = (cell.getAttribute("minWidth") != null ? Number(cell.getAttribute("minWidth")):that._minWidth);td._minH = (cell.getAttribute("minHeight") != null ? Number(cell.getAttribute("minHeight")):that._minHeight);td._initCPanel = (cell.getAttribute("cpanel") != null ? (cell.getAttribute("cpanel")=="false"?false:true):true);td._resize = cell.getAttribute("resize");var rd = String(cell.getAttribute("neighbors")).split(";");for (var e=0;e<rd.length;e++){var p = String(rd[e]).split(",");if (p.length > 1){rd[e] = p;}};td._rowData = rd;that.polyObj[obj] = td;};if (cell.getAttribute("sep")!= null) {var sep = cell.getAttribute("sep");if (sep == "hor"){td.className = "dhtmlxLayoutPolySplitterHor";td._dir = "hor";var top = cell.getAttribute("top").split(";");for (var e=0;e<top.length;e++){var p = String(top[e]).split(",");if (p.length > 1){top[e] = p;}};td._top = top;var bottom = cell.getAttribute("bottom").split(";");for (var e=0;e<bottom.length;e++){var p = String(bottom[e]).split(",");if (p.length > 1){bottom[e] = p;}};td._bottom = bottom;that.sepHor[that.sepHor.length] = td;}else {td.className = "dhtmlxLayoutPolySplitterVer";td._dir = "ver";var left = cell.getAttribute("left").split(";");for (var e=0;e<left.length;e++){var p = String(left[e]).split(",");if (p.length > 1){left[e] = p;}};td._left = left;var right = cell.getAttribute("right").split(";");for (var e=0;e<right.length;e++){var p = String(right[e]).split(",");if (p.length > 1){right[e] = p;}};td._right = right;that.sepVer[that.sepVer.length] = td;};td._dblClick = cell.getAttribute("dblclick");td._isSep = true;td.innerHTML = "&nbsp;";};if (cell.getAttribute("colspan")!= null) {td.colSpan = cell.getAttribute("colspan");};if (cell.getAttribute("rowspan")!= null) {td.rowSpan = cell.getAttribute("rowspan");};tr.appendChild(td);}}};if (root.childNodes[q].tagName == "autosize"){that._autoHor = (root.childNodes[q].getAttribute("hor")).split(";");that._autoVer = (root.childNodes[q].getAttribute("ver")).split(";");that._totalCols = root.childNodes[q].getAttribute("cols");that._totalRows = root.childNodes[q].getAttribute("rows");that._dimension[0] = that._totalCols * that._colsRatio;that._dimension[1] = that._totalRows * that._rowsRatio;};if (root.childNodes[q].tagName == "table"){var data = root.childNodes[q].getAttribute("data");var r = String(data).split(";");for (var q1=0;q1<r.length;q1++){tableDataH[q1] = new Array();tableDataV[q1] = new Array();var c = String(r[q1]).split(",");for (var w1=0;w1<c.length;w1++){tableDataH[q1][w1] = c[w1];tableDataV[q1][w1] = c[w1];if (tableSeps[c[w1]] == null){tableSeps[c[w1]] = new Array(0, 0);}}};for (var a in tableSeps){var f = false;for (var q1=0;q1<tableDataH.length;q1++){for (var w1=0;w1<tableDataH[q1].length;w1++){if (tableDataH[q1][w1] == a && !f){f = true;for (var e1=0;e1<tableDataH[q1].length;e1++){if (tableDataH[q1][e1]!=a)tableSeps[a][0]++;};for (var e1=0;e1<tableDataH.length;e1++){if (tableDataH[e1][w1]!=a)tableSeps[a][1]++;}}}}}}};tableDataH = null;tableDataV = null;that._buildSurface();this.destructor();};this._xmlLoader = new dtmlXMLLoaderObject(this._xmlParser, window);this.listAutoSizes = function() {var hor = this._availAutoSize[this._layoutView+"_hor"];var ver = this._availAutoSize[this._layoutView+"_ver"];var currentHor = (this._autoHor).join(";");var currentVer = (this._autoVer).join(";");return new Array(currentHor, currentVer, hor, ver);};this.setAutoSize = function(hor, ver) {if (hor != null){var allow = false;var data = this._availAutoSize[this._layoutView+"_hor"];for (var q=0;q<data.length;q++){allow = allow || (data[q] == hor);};if (allow == true){this._autoHor = hor.split(";");}};if (ver != null){var allow = false;var data = this._availAutoSize[this._layoutView+"_ver"];for (var q=0;q<data.length;q++){allow = allow || (data[q] == ver);};if (allow == true){this._autoVer = ver.split(";");}}};this._buildSurface = function() {for (var r=0;r<this.tpl.childNodes[0].childNodes.length;r++){var tr = this.tpl.childNodes[0].childNodes[r];for (var c=0;c<tr.childNodes.length;c++){var td = tr.childNodes[c];var that = this;if (!td._isSep){td._isCell = true;td.skin = this.skin;td.getId = function() {return this._idd;};td.getIndex = function() {return this._ind;};td.showHeader = function() {that.showPanel(this._idd);};td.hideHeader = function() {that.hidePanel(this._idd);};td.isHeaderVisible = function() {return that.isPanelVisible(this._idd);};td.setText = function(text) {that.setText(this._idd, text);};td.getText = function() {return that.getText(this._idd);};td.expand = function() {if (!that._isCollapsed(this._idd)) return;that._expand(this._idd, "hide");};td.collapse = function() {if (that._isCollapsed(this._idd)) return;that._collapse(this._idd, "hide");};td.isCollapsed = function() {return that._isCollapsed(this._idd);};td.dock = function() {if (!that._isCollapsed(this._idd)) return;that._expand(this._idd, "dock");that.dockWindow(this._idd);};td.undock = function() {if (that._isCollapsed(this._idd)) return;that.unDockWindow(this._idd);that._collapse(this._idd, "dock");};td.setWidth = function(width) {if (!Number(width)) return;that._setWidth(this._idd, width);};td.getWidth = function() {return parseInt(this.style.width);};td.setHeight = function(height) {if (!Number(height)) return;that._setHeight(this._idd, height);};td.getHeight = function() {return parseInt(this.style.height);};td.fixSize = function(width, height) {that._fixSize(this._idd, width, height);};td.progressOn = function() {that._progressControl(this._idd, true);};td.progressOff = function() {that._progressControl(this._idd, false);};td._doOnAttachMenu = function() {this.adjustContent(this.childNodes[0], (this._noHeader?0:that.skinParams[that.skin]["cpanel_height"]));this.updateNestedObjects();};td._doOnAttachToolbar = function() {this.adjustContent(this.childNodes[0], (this._noHeader?0:that.skinParams[that.skin]["cpanel_height"]));this.updateNestedObjects();};td._doOnAttachStatusBar = function() {this.adjustContent(this.childNodes[0], (this._noHeader?0:that.skinParams[that.skin]["cpanel_height"]));this.updateNestedObjects();};td._doOnFrameContentLoaded = function(){that.callEvent("onContentLoaded", [this._idd]);};td._doOnResize = function() {this.adjustContent(this.childNodes[0], (this._noHeader?0:that.skinParams[that.skin]["cpanel_height"]));this.updateNestedObjects();};td._redraw = function() {};td.showArrow = function() {this.childNodes[0].childNodes[0].childNodes[4].style.display = "";};td.hideArrow = function() {this.childNodes[0].childNodes[0].childNodes[4].style.display = "none";};td.isArrowVisible = function() {return (this.childNodes[0].childNodes[0].childNodes[4].style.display!="none");}};if (td._dir == "ver"){td.onselectstart = function(e) {e = e||event;e.returnValue = false;};td.onmousedown = function(e) {e = e||event;if (!this._lastClick){this._lastClick = new Date().getTime();}else {var t = this._lastClick;this._lastClick = new Date().getTime();if (t + that._dblClickTM >= this._lastClick){if (that._doOnDoubleClick(this)=== true) return;}};var p = that._findDockCellsVer(this);that._resAreaData = new Array();if (p[0] != null && p[1] != null){if (String(document.body.className).search("dhxCursorWResize") == -1) {document.body.className += " dhxCursorWResize";};that._resObj = this;that._anyExpL = p[0];that._anyExpR = p[1];that._collectResAreaData(p);that._resX = e.clientX;if (that._effects["resize"] == false){that._attachSizer(this);that.sizer._leftXStart = parseInt(that.sizer.style.left);var objLeft = that.polyObj[that._anyExpL[0]];that._resXMaxWidthLeft = parseInt(objLeft.style.width)-that._minWidth;var objRight = that.polyObj[that._anyExpR[0]];that._resXMaxWidthRight = parseInt(objRight.style.width)-that._minWidth;if (that._alterSizes.length > 0){for (var q=0;q<that._alterSizes.length;q++){for (var w=0;w<that._anyExpL.length;w++){if (that._alterSizes[q][0] == that._anyExpL[w]){var newVal = that._resXMaxWidthLeft = parseInt(objLeft.style.width)-that._alterSizes[q][1];if (newVal < that._resXMaxWidthLeft){that._resXMaxWidthLeft = newVal;}}};for (var w=0;w<that._anyExpR.length;w++){if (that._alterSizes[q][0] == that._anyExpR[w]){newVal = parseInt(objRight.style.width)-that._alterSizes[q][1];if (newVal < that._resXMaxWidthRight){that._resXMaxWidthRight = newVal;}}}}};that._resXStart = that._resX;};that._resFunc = that._resizeVer;that._showCovers();}};td.onmouseup = function() {if (that._effects["resize"] == true){that._resizeStop();that._anyExpL = null;that._anyExpR = null;}}};if (td._dir == "hor"){td.onselectstart = function(e) {e = e||event;e.returnValue = false;};td.onmousedown = function(e) {e = e||event;if (!this._lastClick){this._lastClick = new Date().getTime();}else {var t = this._lastClick;this._lastClick = new Date().getTime();if (t + that._dblClickTM >= this._lastClick){if (that._doOnDoubleClick(this)=== true) return;}};var p = that._findDockCellsHor(this);that._resAreaData = new Array();if (p[0] != null && p[1] != null){if (String(document.body.className).search("dhxCursorNResize") == -1) {document.body.className += " dhxCursorNResize";};that._resObj = this;that._anyExpT = p[0];that._anyExpB = p[1];that._collectResAreaData(p);that._resY = e.clientY;if (that._effects["resize"] == false){that._attachSizer(this);that.sizer._topYStart = parseInt(that.sizer.style.top);var objTop = that.polyObj[that._anyExpT[0]];that._resYMaxHeightTop = parseInt(objTop.style.height)-that._minHeight;var objBottom = that.polyObj[that._anyExpB[0]];that._resYMaxHeightBottom = parseInt(objBottom.style.height)-that._minHeight;if (that._alterSizes.length > 0){for (var q=0;q<that._alterSizes.length;q++){for (var w=0;w<that._anyExpT.length;w++){if (that._alterSizes[q][0] == that._anyExpT[w]){var newVal = parseInt(objTop.style.height)-that._alterSizes[q][2]-(objTop.childNodes[0].style.display!="none"?that.skinParams[that.skin]["cpanel_height"]:0);if (newVal < that._resYMaxHeightTop){that._resYMaxHeightTop = newVal;}}};for (var w=0;w<that._anyExpB.length;w++){if (that._alterSizes[q][0] == that._anyExpB[w]){var newVal = parseInt(objBottom.style.height)-that._alterSizes[q][2]-(objBottom.childNodes[0].style.display!="none"?that.skinParams[that.skin]["cpanel_height"]:0);if (newVal < that._resYMaxHeightBottom){that._resYMaxHeightBottom = newVal;}}}}};that._resYStart = that._resY;};that._resFunc = that._resizeHor;that._showCovers();}};td.onmouseup = function() {if (that._effects["resize"] == true){that._resizeStop();that._anyExpT = null;that._anyExpB = null;}}}}};for (var a in this.polyObj){this.polyObj[a]._collapsed = false;this.polyObj[a]._idd = a;this.polyObj[a]._ind = this.items.length;this.items[this.items.length] = this.polyObj[a];var nod = document.createElement("DIV");nod.style.position = "relative";nod.style.left = "0px";nod.style.top = "0px";nod.style.width = this.polyObj[a].style.width;nod.style.height = this.polyObj[a].style.height;nod.style.overflow = "hidden";this.polyObj[a].appendChild(nod);var bar = document.createElement("DIV");bar._dockCell = a;bar._resize = this.polyObj[a]._resize;bar.className = "dhtmlxPolyInfoBar";bar.innerHTML = "<div class='dhtmlxInfoBarLabel'>"+a+"</div>"+
 "<div class='dhtmlxInfoBarButtonsFake'><div class='dhtmlxInfoBarButtonsFake2'></div></div>"+
 "<div class='dhtmlxInfoButtonDock' title='"+this.i18n.dock+"'></div>"+
 "<div class='dhtmlxInfoButtonUnDock' style='display: none;' title='"+this.i18n.undock+"'></div>"+
 "<div class='dhtmlxInfoButtonShowHide_"+bar._resize+"' title='"+this.i18n.collapse+"'></div>"+
 "<div class='dhtmlxLineL'></div>"+
 "<div class='dhtmlxLineR'></div>";if (this.polyObj[a]._initCPanel == true){bar._h = this._CPanelHeight;bar.style.display = "";}else {bar._h = 0;bar.style.display = "none";};this.polyObj[a].childNodes[0].appendChild(bar);bar.ondblclick = function() {that.callEvent("onDblClick", [this._dockCell]);};bar.childNodes[4].onclick = function() {var pId = this.parentNode._dockCell;if (that._isCollapsed(pId)) {that._expand(pId, "hide");}else {that._collapse(pId, "hide");}};for (var r=0;r<bar.childNodes.length;r++){bar.childNodes[r].onselectstart = function(e) {e = e||event;e.returnValue = false;}};var contObj = document.createElement("DIV");contObj.className = "dhxcont_global_content_area";this.polyObj[a].childNodes[0].appendChild(contObj);var cont = new dhtmlXContainer(this.polyObj[a]);cont.setContent(contObj);if (this.skin == "dhx_web")this.polyObj[a]._setPadding(this.skinParams[this.skin]["cell_pading_max"], "dhxcont_layout_dhx_web");this.polyObj[a].adjustContent(this.polyObj[a].childNodes[0], this.skinParams[this.skin]["cpanel_height"]);};this._fixIcons();};this._resX = null;this._resY = null;this._resObj = null;this._resFunc = null;this._anyExpL = null;this._anyExpR = null;this._anyExpT = null;this._anyExpB = null;this._expand = function(pId, mode) {this._doExpand(this.polyObj[pId]._resize, pId, this.polyObj[pId]._rowData, mode);};this._collapse = function(pId, mode) {if (this._isCollapsed(pId)) return;this.polyObj[pId]._savedW = parseInt(this.polyObj[pId].style.width);this.polyObj[pId]._savedH = parseInt(this.polyObj[pId].style.height);this._doCollapse(this.polyObj[pId]._resize, pId, this.polyObj[pId]._rowData, mode);};this._isCollapsed = function(pId) {return this.polyObj[pId]._collapsed;};this._checkAlterMinSize = function(data) {this._alterSizes = new Array();for (var q=0;q<data.length;q++){for (var w=0;w<data[q].length;w++){if (this.polyObj[data[q][w]].vs[this.polyObj[data[q][w]].av].layout != null){var dims = this.polyObj[data[q][w]].vs[this.polyObj[data[q][w]].av].layout._defineWindowMinDimension(this.polyObj[data[q][w]], true);dims[0] = data[q][w];this._alterSizes[this._alterSizes.length] = dims;}}}};this._findDockCellsVer = function(resObj) {var res = new Array(null, null);if (resObj == null){return res;};var anyExpL = null;for (var q=resObj._left.length-1;q>=0;q--){if (anyExpL == null){if (typeof(resObj._left[q])== "object") {var isBlocked = false;for (var w=0;w<resObj._left[q].length;w++){isBlocked = isBlocked || (this.polyObj[resObj._left[q][w]]._isBlockedWidth||false);};if (!isBlocked){anyExpL = resObj._left[q];}}else if(this.polyObj[resObj._left[q]]._collapsed == false){if (!this.polyObj[resObj._left[q]]._isBlockedWidth){anyExpL = resObj._left[q];}}}};var anyExpR = null;for (var q=0;q<resObj._right.length;q++){if (anyExpR == null){if (typeof(resObj._right[q])== "object") {var isBlocked = false;for (var w=0;w<resObj._right[q].length;w++){isBlocked = isBlocked || (this.polyObj[resObj._right[q][w]]._isBlockedWidth||false);};if (!isBlocked){anyExpR = resObj._right[q];}}else if(this.polyObj[resObj._right[q]]._collapsed == false){if (!this.polyObj[resObj._right[q]]._isBlockedWidth){anyExpR = resObj._right[q];}}}};if (anyExpL == null || anyExpR == null){return res;};if (typeof(anyExpL)== "string") {anyExpL = new Array(anyExpL);};if (typeof(anyExpR)== "string") {anyExpR = new Array(anyExpR);};res[0] = anyExpL;res[1] = anyExpR;this._checkAlterMinSize(res);this._minWLAlter = 0;this._minWRAlter = 0;if (this._alterSizes.length > 0 && this._effects["resize"] == true){var objL = new Array();var objR = new Array();for (var q=0;q<anyExpL.length;q++){objL[q] = this.polyObj[anyExpL[q]];};for (var q=0;q<anyExpR.length;q++){objR[q] = this.polyObj[anyExpR[q]];};for (var q=0;q<objL.length;q++){for (var w=0;w<this._alterSizes.length;w++){if (this._alterSizes[w][0] == objL[q]._idd && this._minWLAlter < this._alterSizes[w][1]){this._minWLAlter = this._alterSizes[w][1];}}};for (var q=0;q<objR.length;q++){for (var w=0;w<this._alterSizes.length;w++){if (this._alterSizes[w][0] == objR[q]._idd && this._maxWRAlter < this._alterSizes[w][1]){this._minWRAlter = this._alterSizes[w][1];}}}};return res;};this._findDockCellsHor = function(resObj) {var res = new Array(null, null);if (resObj == null){return res;};var anyExpT = null;for (var q=resObj._top.length-1;q>=0;q--){if (anyExpT == null){if (typeof(resObj._top[q])== "object") {var isBlocked = false;for (var w=0;w<resObj._top[q].length;w++){isBlocked = isBlocked || (this.polyObj[resObj._top[q][w]]._isBlockedHeight||false);};if (!isBlocked){anyExpT = resObj._top[q];}}else if(this.polyObj[resObj._top[q]]._collapsed == false){if (!this.polyObj[resObj._top[q]]._isBlockedHeight){anyExpT = resObj._top[q];}}}};var anyExpB = null;for (var q=0;q<resObj._bottom.length;q++){if (anyExpB == null){if (typeof(resObj._bottom[q])== "object") {var isBlocked = false;for (var w=0;w<resObj._bottom[q].length;w++){isBlocked = isBlocked || (this.polyObj[resObj._bottom[q][w]]._isBlockedHeight||false);};if (!isBlocked){anyExpB = resObj._bottom[q];}}else if(this.polyObj[resObj._bottom[q]]._collapsed == false){if (!this.polyObj[resObj._bottom[q]]._isBlockedHeight){anyExpB = resObj._bottom[q];}}}};if (anyExpT == null || anyExpB == null){return res;};if (typeof(anyExpT)== "string") {anyExpT = new Array(anyExpT);};if (typeof(anyExpB)== "string") {anyExpB = new Array(anyExpB);};res[0] = anyExpT;res[1] = anyExpB;this._checkAlterMinSize(res);this._minHTAlter = 0;this._minHBAlter = 0;if (this._alterSizes.length > 0 && this._effects["resize"] == true){var objT = new Array();var objB = new Array();for (var q=0;q<anyExpT.length;q++){objT[q] = this.polyObj[anyExpT[q]];};for (var q=0;q<anyExpB.length;q++){objB[q] = this.polyObj[anyExpB[q]];};for (var q=0;q<objT.length;q++){for (var w=0;w<this._alterSizes.length;w++){if (this._alterSizes[w][0] == objT[q]._idd && this._minHTAlter < this._alterSizes[w][2]){this._minHTAlter = this._alterSizes[w][2];}}};for (var q=0;q<objB.length;q++){for (var w=0;w<this._alterSizes.length;w++){if (this._alterSizes[w][0] == objB[q]._idd && this._minHBAlter < this._alterSizes[w][2]){this._minHBAlter = this._alterSizes[w][2];}}}};return res;};this._resizeVer = function(e) {if (this._resObj == null || this._anyExpL == null || this._anyExpR == null)return;if (this._effects["resize"] == false){this._resX = e.clientX;var offsetX = e.clientX - this._resXStart;if (-offsetX > this._resXMaxWidthLeft && offsetX < 0){offsetX = -this._resXMaxWidthLeft;this._resX = offsetX+this._resXStart;};if (offsetX > this._resXMaxWidthRight && offsetX > 0){offsetX = this._resXMaxWidthRight;this._resX = offsetX+this._resXStart;};this.sizer.style.left = this.sizer._leftXStart+offsetX+"px";return;};var anyExpL = this._anyExpL;var anyExpR = this._anyExpR;var newX = e.clientX;var offsetX = e.clientX - that._resX;var objL = new Array();var objR = new Array();for (var q=0;q<anyExpL.length;q++){objL[q] = this.polyObj[anyExpL[q]];};for (var q=0;q<anyExpR.length;q++){objR[q] = this.polyObj[anyExpR[q]];};var wL = parseInt(objL[0].style.width);var wR = parseInt(objR[0].style.width);if (offsetX < 0){var newWL = wL + offsetX;if (newWL > objL[0]._minW && newWL > this._minWLAlter){var newWR = wR + wL - newWL;for (var q=0;q<objL.length;q++)this._setW(objL[q], newWL);for (var q=0;q<objR.length;q++)this._setW(objR[q], newWR);this._resX = newX;}}else if (offsetX > 0){var newWR = wR - offsetX;if (newWR > objR[0]._minW && newWR > this._minWRAlter){var newWL = wL + wR - newWR;for (var q=0;q<objL.length;q++)this._setW(objL[q], newWL);for (var q=0;q<objR.length;q++)this._setW(objR[q], newWR);this._resX = newX;}}};this._resizeHor = function(e) {if (this._resObj == null || this._anyExpT == null || this._anyExpB == null)return;if (this._effects["resize"] == false){this._resY = e.clientY;var offsetY = e.clientY - this._resYStart;if (-offsetY > this._resYMaxHeightTop && offsetY < 0){offsetY = -this._resYMaxHeightTop;this._resY = offsetY + this._resYStart;};if (offsetY > this._resYMaxHeightBottom && offsetY > 0){offsetY = this._resYMaxHeightBottom;this._resY = offsetY + this._resYStart;};this.sizer.style.top = this.sizer._topYStart+offsetY+"px";return;};var anyExpT = this._anyExpT;var anyExpB = this._anyExpB;var newY = e.clientY;var offsetY = e.clientY - that._resY;var objT = new Array();var objB = new Array();for (var q=0;q<anyExpT.length;q++){objT[q] = this.polyObj[anyExpT[q]];};for (var q=0;q<anyExpB.length;q++){objB[q] = this.polyObj[anyExpB[q]];};var hT = parseInt(objT[0].style.height);var hB = parseInt(objB[0].style.height);if (offsetY < 0){var newHT = hT + offsetY;if (newHT > objT[0]._minH + this._minHTAlter){var newHB = hB + hT - newHT;for (var q=0;q<objT.length;q++)this._setH(objT[q], newHT);for (var q=0;q<objB.length;q++)this._setH(objB[q], newHB);this._resY = newY;}}else if (offsetY > 0){var newHB = hB - offsetY;if (newHB > objB[0]._minH + this._minHBAlter){var newHT = hT + hB - newHB;for (var q=0;q<objT.length;q++)this._setH(objT[q], newHT);for (var q=0;q<objB.length;q++)this._setH(objB[q], newHB);this._resY = newY;}}};this._resizeStop = function() {var p = document.body.className;if (p.search("dhxCursorWResize")!== -1 || p.search("dhxCursorNResize") !== -1) {document.body.className = String(document.body.className).replace(/dhxCursorWResize/g,"").replace(/dhxCursorNResize/g,"");};if (this._resObj == null)return;if (this._effects["resize"] == false){this.sizer.style.display = "none";if (this._resObj._dir == "hor"){var objTop = (typeof(this._anyExpT[0])=="object"?this._anyExpT[0][0]:this._anyExpT[0]);var offsetY = this._resY-this._resYStart;var newH = parseInt(this.polyObj[objTop].style.height)+offsetY;this._setHeight(objTop, newH);}else {var objLeft = (typeof(this._anyExpL[0])=="object"?this._anyExpL[0][0]:this._anyExpL[0]);var offsetX = this._resX-this._resXStart;var newW = parseInt(this.polyObj[objLeft].style.width)+offsetX;this._setWidth(objLeft, newW);};var objs = {};var parseData = function(data) {for (var a in data){if (typeof(data[a])=="object") {parseData(data[a]);};objs[data[a]] = true;}};parseData(this._anyExpT);parseData(this._anyExpB);parseData(this._anyExpL);parseData(this._anyExpR);var ids = new Array();for (var a in objs){ids[ids.length] = a;};if (typeof(this._anyExpT)== "object" && this._anyExpT != null) {this.updateNestedObjectsArray(this._anyExpT);this._anyExpT = null;};if (typeof(this._anyExpB)== "object" && this._anyExpB != null) {this.updateNestedObjectsArray(this._anyExpB);this._anyExpB = null;};if (typeof(this._anyExpL)== "object" && this._anyExpL != null) {this.updateNestedObjectsArray(this._anyExpL);this._anyExpL = null;};if (typeof(this._anyExpR)== "object" && this._anyExpR != null) {this.updateNestedObjectsArray(this._anyExpR);this._anyExpR = null;};this._resObj = null;this._resFunc = null;this._hideCovers();this.callEvent("onPanelResizeFinish", [ids]);return;};var poly = new Array();if (this._resObj._left != null){for (var q=0;q<this._resObj._left.length;q++){poly[poly.length] = this._resObj._left[q];}};if (this._resObj._right != null){for (var q=0;q<this._resObj._right.length;q++){poly[poly.length] = this._resObj._right[q];}};if (this._resObj._top != null){for (var q=0;q<this._resObj._top.length;q++){poly[poly.length] = this._resObj._top[q];}};if (this._resObj._bottom != null){for (var q=0;q<this._resObj._bottom.length;q++){poly[poly.length] = this._resObj._bottom[q];}};this._resFunc = null;this._resObj = null;this._hideCovers();var cells = new Array();for (var q=0;q<poly.length;q++){if (typeof(poly[q])== "object") {for (var w=0;w<poly[q].length;w++){cells[cells.length] = this.polyObj[poly[q][w]];}}else {cells[cells.length] = this.polyObj[poly[q]];}};for (var q=0;q<cells.length;q++)cells[q].updateNestedObjects();this.callEvent("onPanelResizeFinish", []);};this._showCovers = function() {for (var a in this.polyObj){if (this._effects["highlight"] && this._isResizable(a)) {this.polyObj[a].showCoverBlocker();}}};this._hideCovers = function() {for (var a in this.polyObj){this.polyObj[a].hideCoverBlocker();}};this._isResizable = function(pId) {var need = false;for (var q=0;q<this._resAreaData.length;q++){need = need || (this._resAreaData[q] == pId);};return need;};this._collectResAreaData = function(obj) {for (var q=0;q<obj.length;q++){if (typeof(obj[q])== "string") {this._resAreaData[this._resAreaData.length] = obj[q];}else if (typeof(obj[q])== "object") {this._collectResAreaData(obj[q]);}}};this._doOnDoubleClick = function(sep) {if (sep._dblClick == null)return;if (this.polyObj[sep._dblClick] == null)return;if (this.polyObj[sep._dblClick]._noHeader)return;var obj = this.polyObj[sep._dblClick];if (obj.childNodes[0].style.display == "none")return;if (obj._collapsed == true){this._doExpand(obj._resize, sep._dblClick, obj._rowData, "hide");}else {obj._savedW = parseInt(obj.style.width);obj._savedH = parseInt(obj.style.height);this._doCollapse(obj._resize, sep._dblClick, obj._rowData, "hide");};return true;};this._doOnSelectStart = function(e) {e = e||event;if (that._resObj != null)e.returnValue = false;};this._doOnMouseMove = function(e) {e = e||event;if (that._resObj != null && that._resFunc != null)that._resFunc(e);};this._doOnMouseUp = function() {that._resizeStop();};if (_isIE){document.body.attachEvent("onselectstart", that._doOnSelectStart);document.body.attachEvent("onmousemove", that._doOnMouseMove);document.body.attachEvent("onmouseup", that._doOnMouseUp);}else {document.body.addEventListener("mousemove", that._doOnMouseMove, false);document.body.addEventListener("mouseup", that._doOnMouseUp, false);};this._doExpand = function(dir, pId, rowData, mode) {if (rowData.length <= 1)return;var ind = -1;for (var q=0;q<rowData.length;q++){if (rowData[q] == pId){ind = q;}};if (ind == -1)return;var anyExp = null;for (var q=ind+1;q<rowData.length;q++){if (anyExp == null){if (typeof(rowData[q])== "string") {if (this.polyObj[rowData[q]]._collapsed == false){anyExp = rowData[q];}}else {anyExp = rowData[q];}}};if (anyExp == null){for (var q=ind-1;q>=0;q--){if (anyExp == null){if (typeof(rowData[q])== "string") {if (this.polyObj[rowData[q]]._collapsed == false){anyExp = rowData[q];}}else {anyExp = rowData[q];}}}};if (anyExp == null)return;if (typeof(anyExp)!= "object") {anyExp = new Array(anyExp);};if (dir == "hor"){var availSpace = 65536;for (var q=0;q<anyExp.length;q++){var newDim = (this.polyObj[anyExp[q]].vs[this.polyObj[anyExp[q]].av].layout!=null?this.polyObj[anyExp[q]].vs[this.polyObj[anyExp[q]].av].layout._defineWindowMinDimension(this.polyObj[anyExp[q]],true):[0,0]);var av2 = parseInt(this.polyObj[anyExp[q]].style.width) - this._minWidth - newDim[1];if (av2 < availSpace)availSpace = av2;};var maxSize = this.polyObj[pId]._savedW;if (maxSize > availSpace)maxSize = availSpace;if (maxSize < this._minWidth)return;var step = Math.round(maxSize/3);}else {var availSpace = 65536;for (var q=0;q<anyExp.length;q++){var newDim = (this.polyObj[anyExp[q]].vs[this.polyObj[anyExp[q]].av].layout!=null?this.polyObj[anyExp[q]].vs[this.polyObj[anyExp[q]].av].layout._defineWindowMinDimension(this.polyObj[anyExp[q]],true):[0,0,0]);var av2 = parseInt(this.polyObj[anyExp[q]].style.height) - this._minHeight - newDim[2];if (av2 < availSpace)availSpace = av2;};var maxSize = this.polyObj[pId]._savedH;if (maxSize > availSpace)maxSize = availSpace;if (maxSize < this._minHeight)return;var step = Math.round(maxSize/3);};this.polyObj[pId].childNodes[0].childNodes[1].style.display = "";this.polyObj[pId].childNodes[0].childNodes[0].className = "dhtmlxPolyInfoBar";this.polyObj[pId].childNodes[0].childNodes[0].childNodes[1].style.display = "";this.polyObj[pId].childNodes[0].childNodes[0].childNodes[2].style.display = "";this.polyObj[pId].childNodes[0].childNodes[0].childNodes[4].style.display = "";var obj2 = new Array();for (var q=0;q<anyExp.length;q++){obj2[q] = this.polyObj[anyExp[q]];};if (this.polyObj[pId].className == "dhtmlxLayoutSinglePolyTabbarCollapsed"){this.polyObj[pId].className = "dhtmlxLayoutSinglePolyTabbar";};this._expandEffect(this.polyObj[pId], obj2, maxSize, mode, (this._effects["collapse"]==true?step:1000000), dir);};this._doCollapse = function(dir, pId, rowData, mode) {if (rowData.length <= 1)return;var ind = -1;for (var q=0;q<rowData.length;q++){if (rowData[q] == pId){ind = q;}};if (ind == -1)return;var anyExp = null;for (var q=ind+1;q<rowData.length;q++){if (anyExp == null){if (typeof(rowData[q])== "string") {if (this.polyObj[rowData[q]]._collapsed == false){anyExp = rowData[q];}}else {anyExp = rowData[q];}}};if (anyExp == null){for (var q=ind-1;q>=0;q--){if (anyExp == null){if (typeof(rowData[q])== "string") {if (this.polyObj[rowData[q]]._collapsed == false){anyExp = rowData[q];}}else {anyExp = rowData[q];}}}};if (anyExp == null){if (rowData[ind+1] != null){anyExp = rowData[ind+1];}};if (anyExp == null){if (ind-1 >= 0){if (rowData[ind-1] != null){anyExp = rowData[ind-1];}}};if (anyExp != null){if (typeof(anyExp)!= "object") {if (this.polyObj[anyExp]._collapsed == true){this.polyObj[anyExp].childNodes[0].childNodes[1].style.display = "";this.polyObj[anyExp]._collapsed = false;this.polyObj[anyExp].childNodes[0].childNodes[0].className = "dhtmlxPolyInfoBar";this.polyObj[anyExp].childNodes[0].childNodes[0].childNodes[1].style.display = "";this.polyObj[anyExp].childNodes[0].childNodes[0].childNodes[4].title = this.i18n.collapse;this.polyObj[anyExp].childNodes[0].childNodes[0].childNodes[2].style.display = "";this.polyObj[anyExp].childNodes[0].childNodes[0].childNodes[3].style.display = "none";this.polyObj[anyExp].childNodes[0].childNodes[0].childNodes[4].style.display = "";if (this.polyObj[anyExp]._isUnDocked === true){this.dockWindow(anyExp);};if (this.polyObj[anyExp].className == "dhtmlxLayoutSinglePolyTabbarCollapsed"){this.polyObj[anyExp].className = "dhtmlxLayoutSinglePolyTabbar";};this._fixSplitters();this._fixIcons();this.polyObj[anyExp].title = null;this.callEvent("onExpand", [anyExp]);};anyExp = new Array(anyExp);};var obj2 = new Array();for (var q=0;q<anyExp.length;q++){obj2[q] = this.polyObj[anyExp[q]];};if (dir == "hor"){var step = Math.round(Math.max(this.polyObj[pId].offsetWidth, this.polyObj[anyExp[0]].offsetWidth)/3);}else {var step = Math.round(Math.max(this.polyObj[pId].offsetHeight, this.polyObj[anyExp[0]].offsetHeight)/3);};this.polyObj[pId].childNodes[0].childNodes[1].style.display = "none";this._collapseEffect(this.polyObj[pId], obj2, mode, (this._effects["collapse"]==true?step:1000000), dir);}};this.setEffect = function(efName, efValue) {if (this._effects[efName] != null && typeof(efValue)== "boolean") {this._effects[efName] = efValue;}};this.getEffect = function(efName) {if (this._effects[efName] != null){return this._effects[efName];};return null;};this._expandEffect = function(obj, obj2, maxSize, mode, step, dir) {if (dir == "hor"){var s = parseInt(obj.style.width);var s2 = parseInt(obj2[0].style.width);}else {var s = parseInt(obj.style.height);var s2 = parseInt(obj2[0].style.height);};var newS = s + step;if (newS > maxSize){newS = maxSize;};if (dir == "hor"){obj.style.width = newS+"px";obj.childNodes[0].style.width = obj.style.width;}else {obj.style.height = newS+"px";obj.childNodes[0].style.height = obj.style.height;};obj.adjustContent(obj.childNodes[0], (obj._noHeader?0:this.skinParams[this.skin]["cpanel_height"]));for (var q=0;q<obj2.length;q++){if (dir == "hor"){obj2[q].style.width = s2+s-newS+"px";obj2[q].childNodes[0].style.width = obj2[q].style.width;}else {obj2[q].style.height = s2+s-newS+"px";obj2[q].childNodes[0].style.height = obj2[q].style.height;};obj2[q].adjustContent(obj2[q].childNodes[0], (obj2[q]._noHeader?0:this.skinParams[this.skin]["cpanel_height"]));};if (newS != maxSize){window.setTimeout(function(){that._expandEffect(obj, obj2, maxSize, mode, step, dir);}, 4);}else {obj._collapsed = false;for (var q=0;q<obj2.length;q++){obj2[q].updateNestedObjects();};this.polyObj[obj._idd].updateNestedObjects();this.polyObj[obj._idd].childNodes[0].childNodes[0].childNodes[4].title = this.i18n.collapse;this._fixSplitters();this._fixIcons();obj.title = null;this.callEvent("onExpand", [obj._idd]);}};this._collapseEffect = function(obj, obj2, mode, step, dir) {if (dir == "hor"){var s = parseInt(obj.style.width);var s2 = parseInt(obj2[0].style.width);}else {var s = parseInt(obj.style.height);var s2 = parseInt(obj2[0].style.height);};var newS = s - step;if (dir == "hor"){if (newS < this._collapsedW){newS = this._collapsedW;};obj.style.width = newS+"px";obj.childNodes[0].style.width = obj.style.width;}else {if (newS < this._collapsedH){newS = this._collapsedH;};obj.style.height = newS+"px";obj.childNodes[0].style.height = obj.style.height;};for (var q=0;q<obj2.length;q++){if (dir == "hor"){obj2[q].style.width = s2+(s-newS)+"px";obj2[q].childNodes[0].style.width = obj2[q].style.width;}else {obj2[q].style.height = s2+(s-newS)+"px";obj2[q].childNodes[0].style.height = obj2[q].style.height;};obj2[q].adjustContent(obj2[q].childNodes[0], (obj2[q]._noHeader?0:this.skinParams[this.skin]["cpanel_height"]));};if ((newS > this._collapsedW && dir == "hor")|| (newS > this._collapsedH && dir == "ver")) {window.setTimeout(function(){that._collapseEffect(obj, obj2, mode, step, dir);}, 4);}else {for (var q=0;q<obj2.length;q++){if (dir == "hor"){obj2[q].style.width = s2+(s-newS)+"px";obj2[q].childNodes[0].style.width = obj2[q].style.width;}else {obj2[q].style.height = s2+(s-newS)+"px";obj2[q].childNodes[0].style.height = obj2[q].style.height;};obj2[q].adjustContent(obj2[q].childNodes[0], (obj2[q]._noHeader?0:this.skinParams[this.skin]["cpanel_height"]));};obj._collapsed = true;if (dir == "hor"){obj.childNodes[0].childNodes[0].className = "dhtmlxPolyInfoBarCollapsedVer";}else {obj.childNodes[0].childNodes[0].className = "dhtmlxPolyInfoBarCollapsedHor";};for (var q=0;q<obj2.length;q++){obj2[q].updateNestedObjects();};if (mode == "hide"){obj.childNodes[0].childNodes[0].childNodes[1].style.display = "";obj.childNodes[0].childNodes[0].childNodes[2].style.display = "none";obj.childNodes[0].childNodes[0].childNodes[3].style.display = "none";obj.childNodes[0].childNodes[0].childNodes[4].style.display = "";}else {obj.childNodes[0].childNodes[0].childNodes[1].style.display = "";obj.childNodes[0].childNodes[0].childNodes[2].style.display = "";obj.childNodes[0].childNodes[0].childNodes[3].style.display = "none";obj.childNodes[0].childNodes[0].childNodes[4].style.display = "none";};if (obj.className == "dhtmlxLayoutSinglePolyTabbar"){obj.className = "dhtmlxLayoutSinglePolyTabbarCollapsed";};this.polyObj[obj._idd].childNodes[0].childNodes[0].childNodes[4].title = this.i18n.expand;this._fixSplitters();this._fixIcons();obj.title = obj.getText();this.callEvent("onCollapse", [obj._idd]);}};this._setW = function(cellObj, w) {cellObj.style.width = w + "px";cellObj.childNodes[0].style.width = cellObj.style.width;cellObj.adjustContent(cellObj.childNodes[0], (cellObj._noHeader?0:this.skinParams[this.skin]["cpanel_height"]));};this._setH = function(cellObj, h) {cellObj.style.height = h + "px";cellObj.childNodes[0].style.height = cellObj.style.height;cellObj.adjustContent(cellObj.childNodes[0], (cellObj._noHeader?0:this.skinParams[this.skin]["cpanel_height"]));};this._setWidth = function(pId, width) {if (this.polyObj[pId] == null)return;if (!Number(width)) return;var sep = null;for (var q=0;q<this.sepVer.length;q++){var p = this.sepVer[q]._left;if (p[p.length-1] == pId){sep = new Array(this.sepVer[q], "left");}else if (typeof(p[p.length-1])== "object") {var k = p[p.length-1];for (var e=0;e<k.length;e++){if (k[e] == pId){sep = new Array(this.sepVer[q], "left");}}};var p = this.sepVer[q]._right;if (p[0] == pId){sep = new Array(this.sepVer[q], "right");}else if (typeof(p[0])== "object") {var k = p[0];for (var e=0;e<k.length;e++){if (k[e] == pId){sep = new Array(this.sepVer[q], "right");}}}};if (sep != null){var set = this._findDockCellsVer(sep[0]);var anyExpL = set[0];var anyExpR = set[1];if (anyExpL == null || anyExpR == null)return;var sumSize = parseInt(this.polyObj[anyExpL[0]].style.width) + parseInt(this.polyObj[anyExpR[0]].style.width);if (width < this._minWidth){width = this._minWidth;}else if (width > sumSize - this._minWidth){width = sumSize - this._minWidth;};var width2 = sumSize - width;for (var q=0;q<anyExpL.length;q++){this._setW(this.polyObj[anyExpL[q]],(sep[1]=="left"?width:width2));this.polyObj[anyExpL[q]].updateNestedObjects();};for (var q=0;q<anyExpR.length;q++){this._setW(this.polyObj[anyExpR[q]],(sep[1]=="right"?width:width2));this.polyObj[anyExpR[q]].updateNestedObjects();}}};this._setHeight = function(pId, height) {if (this.polyObj[pId] == null)return;if (!Number(height)) return;var sep = null;for (var q=0;q<this.sepHor.length;q++){var p = this.sepHor[q]._top;if (p[p.length-1] == pId){sep = new Array(this.sepHor[q], "top");}else if (typeof(p[p.length-1])== "object") {var k = p[p.length-1];for (var e=0;e<k.length;e++){if (k[e] == pId){sep = new Array(this.sepHor[q], "top");}}};var p = this.sepHor[q]._bottom;if (p[0] == pId){sep = new Array(this.sepHor[q], "bottom");}else if (typeof(p[0])== "object") {var k = p[0];for (var e=0;e<k.length;e++){if (k[e] == pId){sep = new Array(this.sepHor[q], "bottom");}}}};if (sep != null){var set = this._findDockCellsHor(sep[0]);var anyExpT = set[0];var anyExpB = set[1];if (anyExpT == null || anyExpB == null)return;var sumSize = parseInt(this.polyObj[anyExpT[0]].style.height) + parseInt(this.polyObj[anyExpB[0]].style.height);if (height < this._minHeight){height = this._minHeight;}else if (height > sumSize - this._minHeight){height = sumSize - this._minHeight;};var height2 = sumSize - height;for (var q=0;q<anyExpT.length;q++){this._setH(this.polyObj[anyExpT[q]],(sep[1]=="top"?height:height2));this.polyObj[anyExpT[q]].updateNestedObjects();};for (var q=0;q<anyExpB.length;q++){this._setH(this.polyObj[anyExpB[q]],(sep[1]=="bottom"?height:height2));this.polyObj[anyExpB[q]].updateNestedObjects();}}};this.updateNestedObjectsArray = function(obj) {for (var q=0;q<obj.length;q++){if (typeof(obj[q])=="object") {this.updateNestedObjectsArray(obj[q]);}else {this.polyObj[obj[q]].updateNestedObjects();}}};this.dockWindow = function(id) {if (!this.dhxWins)return;if (!this.dhxWins.window(this.dhxWinsIdPrefix+id)) return;this.dhxWins.window(this.dhxWinsIdPrefix+id).close();this.dhxWins.window(this.dhxWinsIdPrefix+id).moveContentTo(this.polyObj[id]);this.polyObj[id]._isUnDocked = false;this.callEvent("onDock", [id]);};this.unDockWindow = function(id) {this._initWindows(id);this.polyObj[id].moveContentTo(this.dhxWins.window(this.dhxWinsIdPrefix+id));this.polyObj[id]._isUnDocked = true;this.callEvent("onUnDock", [id]);};this._initWindows = function(id) {if (!window.dhtmlXWindows)return;if (!this.dhxWins){this.dhxWins = new dhtmlXWindows();this.dhxWins.setSkin(this.skin);this.dhxWins.setImagePath(this.imagePath);this.dhxWinsIdPrefix = "";if (!id)return;};var idd = this.dhxWinsIdPrefix+id;if (!this.dhxWins.window(idd)) {var self = this;var w1 = this.dhxWins.createWindow(idd, 20, 20, 320, 200);w1.setText(this.polyObj[id].getText());w1.button("close").hide();w1.attachEvent("onClose", function(win){win.hide();});w1.addUserButton("dock", 99, this.dhxWins.i18n.dock, "dock");w1.button("dock").attachEvent("onClick", function(win){self.polyObj[id].dock();});w1.dockedCell = this.polyObj[id];}else {this.dhxWins.window(idd).show();}};this.isPanelVisible = function(pId) {return (!this.polyObj[pId]._noHeader);};this.showPanel = function(pId) {if (this.polyObj[pId] == null)return;if (this.polyObj[pId]._collapsed == true)return;var bar = this.polyObj[pId].childNodes[0].childNodes[0];bar.style.display = "";this.polyObj[pId]._noHeader = false;if (this.skin == "dhx_web")this.polyObj[pId]._setPadding(this.skinParams[this.skin]["cell_pading_max"], "dhxcont_layout_dhx_web");this.polyObj[pId].adjustContent(this.polyObj[pId].childNodes[0], this.skinParams[this.skin]["cpanel_height"]);this.polyObj[pId].updateNestedObjects();};this.hidePanel = function(pId) {if (this.polyObj[pId] == null)return;if (this.polyObj[pId]._collapsed == true)return;var bar = this.polyObj[pId].childNodes[0].childNodes[0];bar.style.display = "none";this.polyObj[pId]._noHeader = true;if (this.skin == "dhx_web")this.polyObj[pId]._setPadding(this.skinParams[this.skin]["cell_pading_min"], "");this.polyObj[pId].adjustContent(this.polyObj[pId].childNodes[0], 0);this.polyObj[pId].updateNestedObjects();};this.setText = function(pId, text) {this._changeCPanelText(pId, text);};this.getText = function(pId) {return this.polyObj[pId].childNodes[0].childNodes[0].childNodes[0].innerHTML;};this._changeCPanelText = function(pId, text) {var layout = that;if (layout.polyObj[pId] == null)return;layout.polyObj[pId].childNodes[0].childNodes[0].childNodes[0].innerHTML = text;if (that.dhxWins != null){if (that.dhxWins.window(that.dhxWinsIdPrefix+pId)!= null) {that.dhxWins.window(that.dhxWinsIdPrefix+pId).setText(text);}}};this.forEachItem = function(handler) {for (var q=0;q<this.items.length;q++){handler(this.items[q]);}};this._fixPositionInWin = function(w, h) {this.base.style.width = w+"px";this.base.style.height = h+"px";};this.attachMenu = function() {if (this.base._isWindow){this.menu = this.base._window.attachMenu();}else {this.cont.obj.skin = this.skin;this.menu = this.cont.obj.attachMenu();this.cont.obj.adjustContent(this.cont.obj, 0);this.setSizes();};return this.menu;};this.detachMenu = function() {if (!this.menu)return;this.cont.obj.detachMenu();this.setSizes();this.menu = null;};this.showMenu = function() {if (!this.menu)return;this.cont.obj.showMenu();this.setSizes();};this.hideMenu = function() {if (!this.menu)return;this.cont.obj.hideMenu();this.setSizes();};this.attachToolbar = function() {if (this.base._isWindow){this.toolbar = this.base._window.attachToolbar();}else {this.cont.obj.skin = this.skin;this.toolbar = this.cont.obj.attachToolbar();this.cont.obj.adjustContent(this.cont.obj, 0);this.setSizes();};return this.toolbar;};this.detachToolbar = function() {if (!this.toolbar)return;this.cont.obj.detachToolbar();this.setSizes();this.toolbar = null;};this.showToolbar = function() {if (!this.toolbar)return;this.cont.obj.showToolbar();this.setSizes();};this.hideToolbar = function() {if (!this.toolbar)return;this.cont.obj.hideToolbar();this.setSizes();};this.attachStatusBar = function() {if (this.base._isWindow){this.statusbar = this.base._window.attachStatusBar();}else {this.statusbar = this.cont.obj.attachStatusBar();this.cont.obj.adjustContent(this.cont.obj, 0);this.setSizes();};return this.statusbar;};this.detachStatusBar = function() {if (!this.sb)return;this.cont.obj.detachStatusBar();this.setSizes();this.sb = null;};this.showStatusBar = function() {if (!this.sb)return;this.cont.obj.showStatusBar();this.setSizes();};this.hideStatusBar = function() {if (!this.sb)return;this.cont.obj.hideStatusBar();this.setSizes();};this.progressOn = function() {this._progressControlGlobal(true);};this.progressOff = function() {this._progressControlGlobal(false);};this._progressControl = function(id, state) {if (this.polyObj[id] == null)return;if (this.polyObj[id]._progressCover == null){var p1 = document.createElement("DIV");p1.className = "dhtmlxLayoutPolyProgress";this.polyObj[id].childNodes[0].appendChild(p1);var p2 = document.createElement("DIV");p2.className = "dhtmlxLayoutPolyProgressBGIMG";this.polyObj[id].childNodes[0].appendChild(p2);this.polyObj[id]._progressCover = new Array(p1,p2);};this.polyObj[id]._progressCover[0].style.display = (state==true?"":"none");this.polyObj[id]._progressCover[1].style.display = this.polyObj[id]._progressCover[0].style.display;};this._progressControlGlobal = function(state) {if (this._progressCover == null){var p1 = document.createElement("DIV");p1.className = "dhtmlxLayoutPolyProgressGlobal_"+this.skin;this.obj.appendChild(p1);var p2 = document.createElement("DIV");p2.className = "dhtmlxLayoutPolyProgressBGIMGGlobal_"+this.skin;this.obj.appendChild(p2);this._progressCover = new Array(p1,p2);};this._progressCover[0].style.display = (state==true?"":"none");this._progressCover[1].style.display = this._progressCover[0].style.display;};this._fixSize = function(pId, width, height) {if (this.polyObj[pId] == null)return;this.polyObj[pId]._isBlockedWidth = width;this.polyObj[pId]._isBlockedHeight = height;this._fixSplitters();};this._fixSplitters = function() {for (var q=0;q<this.sepVer.length;q++){var data = this._findDockCellsVer(this.sepVer[q]);if (data[0] == null || data[1] == null){if (this.sepVer[q].className != "dhtmlxLayoutPolySplitterVerInactive"){this.sepVer[q].className = "dhtmlxLayoutPolySplitterVerInactive";}}else {if (this.sepVer[q].className != "dhtmlxLayoutPolySplitterVer"){this.sepVer[q].className = "dhtmlxLayoutPolySplitterVer";}}};for (var q=0;q<this.sepHor.length;q++){var data = this._findDockCellsHor(this.sepHor[q]);if (data[0] == null || data[1] == null){if (this.sepHor[q].className != "dhtmlxLayoutPolySplitterHorInactive"){this.sepHor[q].className = "dhtmlxLayoutPolySplitterHorInactive";}}else {if (this.sepHor[q].className != "dhtmlxLayoutPolySplitterHor"){this.sepHor[q].className = "dhtmlxLayoutPolySplitterHor";}}}};this._fixIcons = function() {for (var a in this.polyObj){var data = this.polyObj[a]._rowData;var cps = this.polyObj[a]._collapsed;var idx = -1;for (var q=0;q<data.length;q++){if (typeof(data[q])== "object") {}else {if (data[q] == a){idx = q;}}};var newIcon = null;if (idx != -1){for (var q=idx+1;q<data.length;q++){if (typeof(data[q])== "object") {newIcon = (this.polyObj[a]._resize=="ver"?(cps?"b":"t"):(cps?"r":"l"));}else if (this.polyObj[data[q]]._collapsed == false){newIcon = (this.polyObj[a]._resize=="ver"?(cps?"b":"t"):(cps?"r":"l"));}};if (newIcon == null && idx >= 1){for (var q=idx-1;q>=0;q--){if (typeof(data[q])== "object") {newIcon = (this.polyObj[a]._resize=="ver"?(cps?"t":"b"):(cps?"l":"r"));}else if (this.polyObj[data[q]]._collapsed == false){newIcon = (this.polyObj[a]._resize=="ver"?(cps?"t":"b"):(cps?"l":"r"));}}}};if (newIcon != null){var dir = this.polyObj[a]._resize;this.polyObj[a].childNodes[0].childNodes[0].childNodes[4].className = "dhtmlxInfoButtonShowHide_"+dir+" dhxLayoutButton_"+this.skin+"_"+dir+(this.polyObj[a]._collapsed?"2":"1")+newIcon;}}};this._defineWindowMinDimension = function(win, inLayout) {if (inLayout == true){var dim = new Array();dim[0] = parseInt(win.style.width);dim[1] = parseInt(win.style.height);}else {var dim = win.getDimension();if (dim[0] == "100%"){dim[0] = win.offsetWidth;};if (dim[1] == "100%"){dim[1] = win.offsetHeight;}};var hor = that._getNearestParents("hor");var ver = that._getNearestParents("ver");if (!inLayout){var resH = new Array();var resV = new Array();for (var a in hor){resH[resH.length] = a;};for (var a in ver){resV[resV.length] = a;};that._checkAlterMinSize(new Array(resH, resV));var hor2 = {};var ver2 = {};for (var q=0;q<that._alterSizes.length;q++){var a = that._alterSizes[q][0];var w = that._alterSizes[q][1];var h = that._alterSizes[q][2];if (hor2[a] == null){hor2[a] = w;}else {if (w > hor2[a]){hor2[a] = w;}};if (ver2[a] == null){ver2[a] = h;}else {if (h > ver2[a]){ver2[a] = h;}}};for (var a in hor){if (hor2[a] != null){hor[a] = hor[a]-hor2[a]+that._minWidth;}};for (var a in ver){if (ver2[a] != null){ver[a] = ver[a]-ver2[a]+that._minHeight-(that.polyObj[a].childNodes[0].style.display!="none"?that.skinParams[that.skin]["cpanel_height"]:0);}}};var minWidth = 65536;for (var a in hor){if (hor[a] < minWidth){minWidth = hor[a];}};minWidth = minWidth - that._minWidth;minWidth = dim[0] - minWidth;if (minWidth < that._dimension[0] && !inLayout){minWidth = that._dimension[0];};var minHeight = 65536;for (var a in ver){if (ver[a] < minHeight){minHeight = ver[a];}};minHeight = minHeight - that._minHeight;minHeight = dim[1] - minHeight;if (minHeight < that._dimension[1] && !inLayout){minHeight = that._dimension[1];};if (inLayout == true)return ["",minWidth,minHeight];win.setMinDimension(minWidth, minHeight);};this._getNearestParents = function(resize) {var data = (resize=="hor"?this._autoHor:this._autoVer);var pool = {};for (var q=0;q<data.length;q++){var id = data[q];if (this.polyObj[id]._collapsed == true && this.polyObj[id]._resize == resize){var rowData = this.polyObj[id]._rowData;var e = -1;for (var w=0;w<rowData.length;w++){if (typeof(rowData[w])== "object") {e = w;}else {if (rowData[w] == id)e = w;}};var r = e;id = null;if (e > 0){for (var w=e-1;w>=0;w--){if (typeof(rowData[w])== "object") {id = rowData[w];}else {if (this.polyObj[rowData[w]]._collapsed == false && id == null){id = rowData[w];}}}};if (id == null){for (var w=r;w<rowData.length;w++){if (typeof(rowData[w])== "object") {id = rowData[w];}else {if (this.polyObj[rowData[w]]._collapsed == false && id == null){id = rowData[w];}}}}};if (id != null){if (typeof(id)== "string") {id = new Array(id);};for (var w=0;w<id.length;w++){pool[id[w]] = parseInt(resize=="hor"?this.polyObj[id[w]].style.width:this.polyObj[id[w]].style.height);}}};return pool;};this.setSizes = function(skipAdjust) {if (!this.base.offsetParent)return;if (this.cont && skipAdjust !== false)this.cont.obj.adjustContent(this.cont.obj, this._mTop, null, null, this._mBottom);var xw = this.base.offsetParent.offsetWidth-this.base.offsetWidth+(this._baseWFix!=null?this._baseWFix:0);var xh = this.base.offsetParent.offsetHeight-this.base.offsetHeight+(this._baseHFix!=null?this._baseHFix:0);this.base.style.width = parseInt(this.base.style.width)+xw+"px";this.base.style.height = parseInt(this.base.style.height)+xh+"px";var both = {};for (var a in this._getNearestParents("hor")) {this.polyObj[a].style.width = Math.max(0,parseInt(this.polyObj[a].style.width)+xw)+"px";this.polyObj[a].childNodes[0].style.width = this.polyObj[a].style.width;both[a] = 1;};for (var a in this._getNearestParents("ver")) {this.polyObj[a].style.height = Math.max(0,parseInt(this.polyObj[a].style.height)+xh)+"px";this.polyObj[a].childNodes[0].style.height = this.polyObj[a].style.height;both[a] = 1;};for (var a in both){this.polyObj[a].adjustContent(this.polyObj[a].childNodes[0], (this.polyObj[a]._noHeader?0:this.skinParams[this.skin]["cpanel_height"]));this.polyObj[a].updateNestedObjects();};this.callEvent("onResizeFinish", []);return;};dhtmlxEventable(this);this._init();};dhtmlXLayoutObject.prototype.unload = function(removeParent) {if (_isIE){document.body.detachEvent("onselectstart", this._doOnSelectStart);document.body.detachEvent("onmousemove", this._doOnMouseMove);document.body.detachEvent("onmouseup", this._doOnMouseUp);}else {document.body.removeEventListener("mousemove", this._doOnMouseMove, false);document.body.removeEventListener("mouseup", this._doOnMouseUp, false);};this._doOnSelectStart = null;this._doOnMouseMove = null;this._doOnMouseUp = null;for (var a in this.polyObj){var p = this.polyObj[a];p._isCell = null;p.skin = null;p.getId = null;p.getIndex = null;p.showHeader = null;p.hideHeader = null;p.isHeaderVisible = null;p.setText = null;p.getText = null;p.expand = null;p.collapse = null;p.isCollapsed = null;p.dock = null;p.undock = null;p.setWidth = null;p.getWidth = null;p.setHeight = null;p.getHeight = null;p.fixSize = null;p.progressOn = null;p.progressOff = null;p._doOnAttachMenu = null;p._doOnAttachToolbar = null;p._doOnAttachStatusBar = null;p._collapsed = null;p._idd = null;p._ind = null;p._rowData = null;p._dir = null;p._initCPanel = null;p._minW = null;p._minH = null;p._resize = null;p._savedH = null;p._savedW = null;p.ondblclick = null;var bar = p.childNodes[0].childNodes[0];bar.className = "";bar._dockCell = null;bar._resize = null;bar._h = null;bar.ondblclick = null;bar.childNodes[4].onclick = null;for (var r=0;r<bar.childNodes.length;r++)bar.childNodes[r].onselectstart = null;while (bar.childNodes.length > 0)bar.removeChild(bar.childNodes[0]);bar.parentNode.removeChild(bar);bar = null;p._dhxContDestruct();p._dhxContDestruct = null;p.removeChild(p.childNodes[0]);p.parentNode.removeChild(p);p = null;};for (var a in this.polyObj)this.polyObj[a] = null;for (var q=0;q<this.items.length;q++)this.items[q] = null;this.polyObj = null;this.items = null;var t = this.tpl.childNodes[0];while (t.childNodes.length > 0){while (t.childNodes[0].childNodes.length > 0){var r = t.childNodes[0].childNodes[0];r._top = null;r._bottom = null;r._left = null;r._right = null;r._dblClick = null;r._isSep = null;r._dir = null;r._lastClick = null;r.ondblclick = null;r.onmousedown = null;r.onmouseup = null;r.onselectstart = null;while (r.childNodes.length > 0)r.removeChild(r.childNodes[0]);r.parentNode.removeChild(r);r = null;};t.removeChild(t.childNodes[0]);};t.parentNode.removeChild(t);t = null;this.tpl.parentNode.removeChild(this.tpl);this.tpl = null;for (var a in this.sepHor)this.sepHor[a] = null;for (var a in this.sepVer)this.sepVer[a] = null;this.sepHor = null;this.sepVer = null;if (this._ha){this.detachEvent(this._haEv);this._haEv = null;while (this._ha.childNodes.length > 0)this._ha.removeChild(this._ha.childNodes[0]);this._ha.parentNode.removeChild(this._ha);this._ha = null;};if (this._fa){this.detachEvent(this._faEv);this._faEv = null;while (this._fa.childNodes.length > 0)this._fa.removeChild(this._fa.childNodes[0]);this._fa.parentNode.removeChild(this._fa);this._fa = null;};this.attachHeader = null;this.attachFooter = null;this._autoHor = null;this._autoVer = null;this._availAutoSize = null;this._dimension = null;this._effects = null;this._layoutView = null;this._mBottom = null;this._mTop = null;this._minWidth = null;this._minHeight = null;this._resFunc = null;this._resObj = null;this._resX = null;this._resY = null;this._colsRatio = null;this._rowsRatio = null;this._totalCols = null;this._totalRows = null;this._xmlLoader = null;this.w = null;this.h = null;this.imagePath = null;this.skin = null;this.skinParams = null;this.tplData = null;this.tplSizes = null;this._CPanelBtnsWidth = null;this._CPanelHeight = null;if (this.sizer.parentNode)this.sizer.parentNode.removeChild(this.sizer);this.sizer = null;this._alterSizes = null;this._attachSizer = null;this._buildSurface = null;this._changeCPanelText = null;this._checkAlterMinSize = null;this._collapse = null;this._collapseEffect = null;this._collectResAreaData = null;this._defineWindowMinDimension = null;this._doCollapse = null;this._doExpand = null;this._expand = null;this._expandEffect = null;this._findDockCellsHor = null;this._findDockCellsVer = null;this._fixIcons = null;this._fixPositionInWin = null;this._fixSize = null;this._fixSplitters = null;this._getNearestParents = null;this._hideCovers = null;this._init = null;this._initWindows = null;this._isCollapsed = null;this._isResizable = null;this._progressControl = null;this._progressControlGlobal = null;this._resizeHor = null;this._resizeStop = null;this._resizeVer = null;this._resAreaData = null;this._setH = null;this._setHeight = null;this._setW = null;this._setWidth = null;this._showCovers = null;this._xmlParser = null;this.attachEvent = null;this.attachMenu = null;this.attachStatusBar = null;this.attachToolbar = null;this.callEvent = null;this.cells = null;this.checkEvent = null;this.detachEvent = null;this.dockWindow = null;this.eventCatcher = null;this.forEachItem = null;this.getEffect = null;this.getIdByIndex = null;this.getIndexById = null;this.getText = null;this.hidePanel = null;this.isPanelVisible = null;this.listAutoSizes = null;this.listViews = null;this.progressOff = null;this.progressOn = null;this.setAutoSize = null;this.setEffect = null;this.setImagePath = null;this.setSizes = null;this.setSkin = null;this.setText = null;this.showPanel = null;this.unDockWindow = null;this.unload = null;this.updateNestedObjectsArray = null;this.setCollapsedText = null;this.attachMenu = null;this.attachToolbar = null;this.attachStatusBar = null;this.detachMenu = null;this.detachToolbar = null;this.detachStatusBar = null;this.showMenu = null;this.showToolbar = null;this.showStatusBar = null;this.hideMenu = null;this.hideToolbar = null;this.hideStatusBar = null;this._cells = null;this._autosize = null;this._effect = null;this.dhx_SeverCatcherPath = null;this._autodetectSkin = null;this._doOnDoubleClick = null;this._dblClickTM = null;this._collapsedH = null;this._collapsedW = null;this._minWLAlter = null;this._minWRAlter = null;this._minHBAlter = null;this._minHTAlter = null;this._resXStart = null;this._resYStart = null;this._resXMaxWidthLeft = null;this._resXMaxWidthRight = null;this._resYMaxHeightTop = null;this._resYMaxHeightBottom = null;if (this.obj){this.obj.parentNode.removeChild(this.obj);this.obj = null;};if (this.base){if (this.base == document.body){}else {this.base.parentNode.removeChild(this.base);this.base = null;}};if (this.dhxWins){this.dhxWins.unload();this.dhxWins = null;this.dhxWinsIdPrefix = null;};if (this._doOnResizeStart){if (_isIE){window.detachEvent("onresize", this._doOnResizeStart);}else {window.removeEventListener("resize", this._doOnResizeStart, false);};this._doOnResizeStart = null;this._doOnResizeEnd = null;this._tmTime = null;};this.detachAllEvents();this.detachAllEvents = null;};dhtmlXLayoutObject.prototype.tplData = {"1C": '<layout><autosize hor="a" ver="a" rows="1" cols="1"/><table data="a"/><row><cell obj="a" wh="1,1" resize="ver" neighbors="a"/></row></layout>',
 "2E": '<layout><autosize hor="a;b" ver="b" rows="2" cols="1"/><table data="a;b"/><row><cell obj="a" wh="1,2" resize="ver" neighbors="a;b"/></row><row sep="true"><cell sep="hor" top="a" bottom="b" dblclick="a"/></row><row><cell obj="b" wh="1,2" resize="ver" neighbors="a;b"/></row></layout>',
 "2U": '<layout><autosize hor="b" ver="a;b" rows="1" cols="2"/><table data="a,b"/><row><cell obj="a" wh="2,1" resize="hor" neighbors="a;b"/><cell sep="ver" left="a" right="b"/><cell obj="b" wh="2,1" resize="hor" neighbors="a;b"/></row></layout>',
 
 "3E": '<layout><autosize hor="a;b;c" ver="c" rows="3" cols="1"/><table data="a;b;c"/><row><cell obj="a" wh="1,3" resize="ver" neighbors="a;b;c"/></row><row sep="yes"><cell sep="hor" top="a" bottom="b;c" dblclick="a"/></row><row><cell obj="b" wh="1,3" resize="ver" neighbors="a;b;c"/></row><row sep="yes"><cell sep="hor" top="a;b" bottom="c" dblclick="b"/></row><row><cell obj="c" wh="1,3" resize="ver" neighbors="a;b;c"/></row></layout>',
 "3W": '<layout><autosize hor="c" ver="a;b;c" rows="1" cols="3"/><table data="a,b,c"/><row><cell obj="a" wh="3,1" resize="hor" neighbors="a;b;c"/><cell sep="ver" left="a" right="b;c" dblclick="a"/><cell obj="b" wh="3,1" resize="hor" neighbors="a;b;c"/><cell sep="ver" left="a;b" right="c" dblclick="b"/><cell obj="c" wh="3,1" resize="hor" neighbors="a;b;c"/></row></layout>',
 "3J": '<layout><autosize hor="b" ver="b;c" rows="2" cols="2"/><table data="a,b;c,b"/><row><cell obj="a" wh="2,2" resize="ver" neighbors="a;c"/><cell sep="ver" left="a,c" right="b" dblclick="b" rowspan="3"/><cell obj="b" wh="2,1" resize="hor" neighbors="a,c;b" rowspan="3"/></row><row sep="yes"><cell sep="hor" top="a" bottom="c" dblclick="a"/></row><row><cell obj="c" wh="2,2" resize="ver" neighbors="a;c"/></row></layout>',
 "3T": '<layout><autosize hor="a;c" ver="b;c" rows="2" cols="2"/><table data="a,a;b,c"/><row><cell obj="a" wh="1,2" resize="ver" neighbors="a;b,c" colspan="3"/></row><row sep="true"><cell sep="hor" top="a" bottom="b,c" dblclick="a" colspan="3"/></row><row><cell obj="b" wh="2,2" resize="hor" neighbors="b;c"/><cell sep="ver" left="b" right="c" dblclick="b"/><cell obj="c" wh="2,2" resize="hor" neighbors="b;c"/></row></layout>',
 "3L": '<layout><autosize hor="b;c" ver="a;c" rows="2" cols="2"/><table data="a,b;a,c"/><row><cell obj="a" wh="2,1" resize="hor" neighbors="a;b,c" rowspan="3"/><cell sep="ver" left="a" right="b,c" dblclick="a" rowspan="3"/><cell obj="b" wh="2,2" resize="ver" neighbors="b;c"/></row><row sep="true"><cell sep="hor" top="b" dblclick="b" bottom="c"/></row><row><cell obj="c" wh="b,2" resize="ver" neighbors="b;c"/></row></layout>',
 "3U": '<layout><autosize hor="b;c" ver="c" rows="2" cols="2"/><table data="a,b;c,c"/><row><cell obj="a" wh="2,2" resize="hor" neighbors="a;b"/><cell sep="ver" left="a" right="b" dblclick="a"/><cell obj="b" wh="2,2" resize="hor" neighbors="a;b"/></row><row sep="true"><cell sep="hor" top="a,b" bottom="c" dblclick="c" colspan="3"/></row><row><cell obj="c" wh="1,2" resize="ver" neighbors="a,b;c" colspan="3"/></row></layout>',
 
 "4H": '<layout><autosize hor="d" ver="a;c;d" rows="2" cols="3"/><table data="a,b,d;a,c,d"/><row><cell obj="a" wh="3,1" resize="hor" neighbors="a;b,c;d" rowspan="3"/><cell sep="ver" left="a" right="b,c;d" dblclick="a" rowspan="3"/><cell obj="b" wh="3,2" resize="ver" neighbors="b;c"/><cell sep="ver" left="a;b,c" right="d" dblclick="d" rowspan="3"/><cell obj="d" wh="3,1" resize="hor" neighbors="a;b,c;d" rowspan="3"/></row><row sep="true"><cell sep="hor" top="b" dblclick="b" bottom="c"/></row><row><cell obj="c" wh="3,2" resize="ver" neighbors="b;c"/></row></layout>',
 "4I": '<layout><autosize hor="a;c;d" ver="d" rows="3" cols="2"/><table data="a,a;b,c;d,d"/><row><cell obj="a" wh="1,3" resize="ver" neighbors="a;b,c;d" colspan="3"/></row><row sep="true"><cell sep="hor" top="a" bottom="b,c;d" dblclick="a" colspan="3"/></row><row><cell obj="b" wh="2,3" resize="hor" neighbors="b;c"/><cell sep="ver" left="b" dblclick="b" right="c"/><cell obj="c" wh="2,3" resize="hor" neighbors="b;c"/></row><row sep="true"><cell sep="hor" top="a;b,c" bottom="d" dblclick="d" colspan="3"/></row><row><cell obj="d" wh="1,3" resize="ver" neighbors="a;b,c;d" colspan="3"/></row></layout>',
 "4T": '<layout><autosize hor="a;d" ver="b;c;d" rows="2" cols="3"/><table data="a,a,a;b,c,d"/><row><cell obj="a" wh="1,2" resize="ver" neighbors="a;b,c,d" colspan="5"/></row><row sep="true"><cell sep="hor" top="a" bottom="b,c,d" dblclick="a" colspan="5"/></row><row><cell obj="b" wh="3,2" resize="hor" neighbors="b;c;d"/><cell sep="ver" left="b" right="c;d" dblclick="b"/><cell obj="c" wh="3,2" resize="hor" neighbors="b;c;d"/><cell sep="ver" left="b;c" right="d" dblclick="c"/><cell obj="d" wh="3,2" resize="hor" neighbors="b;c;d"/></row></layout>',
 "4U": '<layout><autosize hor="c;d" ver="d" rows="2" cols="3"/><table data="a,b,c;d,d,d"/><row><cell obj="a" wh="3,2" resize="hor" neighbors="a;b;c"/><cell sep="ver" left="a" right="b;c" dblclick="a"/><cell obj="b" wh="3,2" resize="hor" neighbors="a;b;c"/><cell sep="ver" left="a;b" right="c" dblclick="b"/><cell obj="c" wh="3,2" resize="hor" neighbors="a;b;c"/></row><row sep="true"><cell sep="hor" top="a,b,c" bottom="d" dblclick="d" colspan="5"/></row><row><cell obj="d" wh="1,2" resize="ver" neighbors="a,b,c;d" colspan="5"/></row></layout>',
 
 "5H": '<layout><autosize hor="b;c;d" ver="a;c;e" rows="3" cols="3"/><table data="a,b,e;a,c,e;a,d,e"/><row><cell obj="a" wh="3,1" resize="hor" neighbors="a;b,c,d" rowspan="5"/><cell sep="ver" left="a" right="b,c,d;e" dblclick="a" rowspan="5"/><cell obj="b" wh="3,3" resize="ver" neighbors="b;c;d"/><cell sep="ver" left="a;b,c,d" right="e" dblclick="e" rowspan="5"/><cell obj="e" wh="3,1" resize="hor" neighbors="b,c,d;e" rowspan="5"/></row><row sep="true"><cell sep="hor" top="b" dblclick="b" bottom="c;d"/></row><row><cell obj="c" wh="3,3" resize="ver" neighbors="b;c;d"/></row><row sep="true"><cell sep="hor" top="b;c" dblclick="c" bottom="d"/></row><row><cell obj="d" wh="3,3" resize="ver" neighbors="b;c;d"/></row></layout>',
 "5I": '<layout><autosize hor="a;d;e" ver="e" rows="3" cols="3"/><table data="a,a,a;b,c,d;e,e,e"/><row><cell obj="a" wh="1,3" resize="ver" neighbors="a;b,c,d;e" colspan="5"/></row><row sep="match"><cell sep="hor" top="a" bottom="b,c,d;e" dblclick="a" colspan="5"/></row><row><cell obj="b" wh="3,3" resize="hor" neighbors="b;c;d"/><cell sep="ver" left="b" right="c;d" dblclick="b"/><cell obj="c" wh="3,3" resize="hor" neighbors="b;c;d"/><cell sep="ver" left="b;c" right="d" dblclick="c"/><cell obj="d" wh="3,3" resize="hor" neighbors="b;c;d"/></row><row sep="match"><cell sep="hor" top="a;b,c,d" bottom="e" dblclick="e" colspan="5"/></row><row><cell obj="e" wh="1,3" resize="ver" neighbors="a;b,c,d;e" colspan="5"/></row></layout>',
 
 "6I": '<layout><autosize hor="a;e;f" ver="f" rows="3" cols="4"/><table data="a,a,a,a;b,c,d,e;f,f,f,f"/><row><cell obj="a" wh="1,3" resize="ver" neighbors="a;b,c,d,e;f" colspan="7"/></row><row sep="true"><cell sep="hor" top="a" bottom="b,c,d,e;f" dblclick="a" colspan="7"/></row><row><cell obj="b" wh="4,3" resize="hor" neighbors="b;c;d;e"/><cell sep="ver" left="b" right="c;d;e" dblclick="b"/><cell obj="c" wh="4,3" resize="hor" neighbors="b;c;d;e"/><cell sep="ver" left="b;c" right="d;e" dblclick="c"/><cell obj="d" wh="4,3" resize="hor" neighbors="b;c;d;e"/><cell sep="ver" left="b;c;d" right="e" dblclick="d"/><cell obj="e" wh="4,3" resize="hor" neighbors="b;c;d;e"/></row><row sep="true"><cell sep="hor" top="a;b,c,d,e" bottom="f" dblclick="f" colspan="7"/></row><row><cell obj="f" wh="1,3" resize="ver" neighbors="a;b,c,d,e;f" colspan="7"/></row></layout>'
};dhtmlXLayoutObject.prototype._availAutoSize = {"1C_hor": new Array("a"),
 "1C_ver": new Array("a"),
 "2E_hor": new Array("a;b"),
 "2E_ver": new Array("a", "b"),
 "2U_hor": new Array("a", "b"),
 "2U_ver": new Array("a;b"),
 "3E_hor": new Array("a;b;c"),
 "3E_ver": new Array("a", "b", "c"),
 "3W_hor": new Array("a", "b", "c"),
 "3W_ver": new Array("a;b;c"),
 "3J_hor": new Array("a;c", "b"),
 "3J_ver": new Array("a;b", "c;b"),
 "3T_hor": new Array("a;b", "a;c"),
 "3T_ver": new Array("a", "b;c"),
 "3L_hor": new Array("a", "b;c"),
 "3L_ver": new Array("a;b", "a;c"),
 "3U_hor": new Array("a;c", "b;c"),
 "3U_ver": new Array("a;b", "c"),
 "4H_hor": new Array("a", "b;c", "d"),
 "4H_ver": new Array("a;b;d", "a;c;d"),
 "4I_hor": new Array("a;b;d", "a;c;d"),
 "4I_ver": new Array("a", "b;c", "d"),
 "4T_hor": new Array("a;b", "a;c", "a;d"),
 "4T_ver": new Array("a", "b;c;d"),
 "4U_hor": new Array("a;d", "b;d", "c;d"),
 "4U_ver": new Array("a;b;c", "d"),
 "5H_hor": new Array("a", "b;c;d", "e"),
 "5H_ver": new Array("a;b;e", "a;c;e", "a;d;e"),
 "5I_hor": new Array("a;b;e", "a;c;e", "a;d;e"),
 "5I_ver": new Array("a", "b;c;d", "e"),
 "6I_hor": new Array("a;b;f", "a;c;f", "a;d;f", "a;e;f"),
 "6I_ver": new Array("a", "b;c;d;e", "f")
};dhtmlXLayoutObject.prototype.setCollapsedText = function(cell, text) {if (!this.polyObj[cell])return;var bar = this.polyObj[cell].childNodes[0].childNodes[0];if (bar.childNodes[bar.childNodes.length-1]._ct === true){var p = bar.childNodes[bar.childNodes.length-1];}else {var p = document.createElement("DIV");p._ct = true;p.className = "dhtmlxInfoBarLabel_collapsed_"+this.polyObj[cell]._resize;bar.appendChild(p);};p.innerHTML = text;bar = null;};dhtmlXLayoutObject.prototype.i18n = {dhxcontalert: "dhtmlxcontainer.js is missed on the page",
 collapse: "Collapse",
 expand: "Expand",
 dock: "Dock",
 undock: "UnDock"
};(function(){dhtmlx.extend_api("dhtmlXLayoutObject",{_init:function(obj){return [obj.parent, obj.pattern, obj.skin];},
 image_path:"setImagePath",
 effect:"_effect",
 cells:"_cells",
 autosize:"_autosize"
 },{_cells:function(arr){for (var q=0;q<arr.length;q++){var data = arr[q];var cell = this.cells(data.id);if (cell){if (data.height)cell.setHeight(data.height);if (data.width)cell.setWidth(data.width);if (data.text)cell.setText(data.text);if (data.collapse)cell.collapse();if (data.fix_size)cell.fixSize(data.fix_size[0], data.fix_size[1]);if (data.header === false)cell.hideHeader();}}},
 _autosize:function(arr){this.setAutoSize(arr[0],arr[1]);},
 _effect:function(data){if (data.collapse)this.setEffect("collapse", data.collapse);if (data.resize)this.setEffect("resize", data.resize);if (data.highlight)this.setEffect("highlight", data.highlight);}});})();dhtmlXLayoutObject.prototype.attachHeader = function(obj) {if (this._ha)return;if (typeof(obj)!= "object") obj = document.getElementById(obj);var ofsH = obj.offsetHeight+(this.skin=="dhx_web"?9:2)+2;this.cont.obj._offsetTop = ofsH;this.cont.obj._offsetHeight = this.cont.obj._offsetHeight-ofsH;this.setSizes();this._ha = document.createElement("DIV");this._ha.style.position = "absolute";this._ha.style.top = "2px";this._ha.style.left = this.cont.obj.vs[this.cont.obj.av].dhxcont.style.left;this._ha.style.width = this.cont.obj.vs[this.cont.obj.av].dhxcont.style.width;this._ha.style.height = obj.offsetHeight+"px";document.body.appendChild(this._ha);this._ha.appendChild(obj);this._haEv = this.attachEvent("onResizeFinish", function(){this._ha.style.width = this.cont.obj.vs[this.cont.obj.av].dhxcont.style.width;});};dhtmlXLayoutObject.prototype.attachFooter = function(obj) {if (this._fa)return;if (typeof(obj)!= "object") obj = document.getElementById(obj);var ofsH = obj.offsetHeight+(this.skin=="dhx_web"?9:2)-2;this.cont.obj._offsetHeight = this.cont.obj._offsetHeight-ofsH;this.setSizes();this._fa = document.createElement("DIV");this._fa.style.position = "absolute";this._fa.style.bottom = "2px";this._fa.style.left = this.cont.obj.vs[this.cont.obj.av].dhxcont.style.left;this._fa.style.width = this.cont.obj.vs[this.cont.obj.av].dhxcont.style.width;this._fa.style.height = obj.offsetHeight+"px";document.body.appendChild(this._fa);this._fa.appendChild(obj);this._faEv = this.attachEvent("onResizeFinish", function(){this._fa.style.width = this.cont.obj.vs[this.cont.obj.av].dhxcont.style.width;});};function dhtmlXMenuObject(baseId, skin) {var main_self = this;this.addBaseIdAsContextZone = null;this.isDhtmlxMenuObject = true;this.skin = (skin!=null?skin:"dhx_skyblue");this.imagePath = "";this._isIE6 = false;if (_isIE)this._isIE6 = (window.XMLHttpRequest==null?true:false);if (baseId == null){this.base = document.body;}else {if (document.getElementById(baseId)!= null) {this.base = document.getElementById(baseId);while (this.base.childNodes.length > 0){this.base.removeChild(this.base.childNodes[0]);};this.base.className += " dhtmlxMenu_"+this.skin+"_Middle dir_left";this.base._autoSkinUpdate = true;if (this.base.oncontextmenu)this.base._oldContextMenuHandler = this.base.oncontextmenu;this.addBaseIdAsContextZone = baseId;this.base.onselectstart = function(e) {e = e || event;e.returnValue = false;return false;};this.base.oncontextmenu = function(e) {e = e || event;e.returnValue = false;return false;}}else {this.base = document.body;}};this.topId = "dhxWebMenuTopId";if (!this.extendedModule){var t = function(){alert(this.i18n.dhxmenuextalert);};var extMethods = new Array("setItemEnabled", "setItemDisabled", "isItemEnabled", "_changeItemState", "getItemText", "setItemText",
 "loadFromHTML", "hideItem", "showItem", "isItemHidden", "_changeItemVisible", "setUserData", "getUserData",
 "setOpenMode", "setWebModeTimeout", "enableDynamicLoading", "_updateLoaderIcon", "getItemImage", "setItemImage",
 "clearItemImage", "setAutoShowMode", "setAutoHideMode", "setContextMenuHideAllMode", "getContextMenuHideAllMode",
 "setVisibleArea", "setTooltip", "getTooltip", "setHotKey", "getHotKey", "setItemSelected", "setTopText", "setRTL",
 "setAlign", "setHref", "clearHref", "getCircuit", "_clearAllSelectedSubItemsInPolygon", "_checkArrowsState",
 "_addUpArrow", "_addDownArrow", "_removeUpArrow", "_removeDownArrow", "_isArrowExists", "_doScrollUp", "_doScrollDown",
 "_countPolygonItems", "setOverflowHeight", "_getRadioImgObj", "_setRadioState", "_radioOnClickHandler",
 "getRadioChecked", "setRadioChecked", "addRadioButton", "_getCheckboxState", "_setCheckboxState", "_readLevel",
 "_updateCheckboxImage", "_checkboxOnClickHandler", "setCheckboxState", "getCheckboxState", "addCheckbox", "serialize");for (var q=0;q<extMethods.length;q++)if (!this[extMethods[q]])this[extMethods[q]] = t;extMethods = null;};this.fixedPosition = false;this.menuSelected = -1;this.menuLastClicked = -1;this.idPrefix = "";this.itemTagName = "item";this.itemTextTagName = "itemtext";this.userDataTagName = "userdata";this.itemTipTagName = "tooltip";this.itemHotKeyTagName = "hotkey";this.itemHrefTagName = "href";this.dirTopLevel = "bottom";this.dirSubLevel = "right";this.menuX1 = null;this.menuX2 = null;this.menuY1 = null;this.menuY2 = null;this.menuMode = "web";this.menuTimeoutMsec = 400;this.menuTimeoutHandler = null;this.idPull = {};this.itemPull = {};this.userData = {};this.radio = {};this._rtl = false;this._align = "left";this.menuTouched = false;this.zIndInit = 1200;this.zInd = this.zIndInit;this.zIndStep = 50;this.menuModeTopLevelTimeout = true;this.menuModeTopLevelTimeoutTime = 200;this._topLevelBottomMargin = 1;this._topLevelRightMargin = 0;this._topLevelOffsetLeft = 1;this._arrowFFFix = (_isIE?(document.compatMode=="BackCompat"?0:-4):-4);this.setSkin = function(skin) {var oldSkin = this.skin;this.skin = skin;switch (this.skin){case "dhx_black":
 case "dhx_blue":
 case "dhx_skyblue":
 case "dhx_web":
 this._topLevelBottomMargin = 2;this._topLevelRightMargin = 1;this._topLevelOffsetLeft = 1;this._arrowFFFix = (_isIE?(document.compatMode=="BackCompat"?0:-4):-4);break;case "dhx_web":
 this._arrowFFFix = 0;break;};if (this.base._autoSkinUpdate){this.base.className = this.base.className.replace("dhtmlxMenu_"+oldSkin+"_Middle", "")+" dhtmlxMenu_"+this.skin+"_Middle";};for (var a in this.idPull){this.idPull[a].className = String(this.idPull[a].className).replace(oldSkin, this.skin);}};this.setSkin(this.skin);this.dLoad = false;this.dLoadUrl = "";this.dLoadSign = "?";this.loaderIcon = false;this.limit = 0;this._scrollUpTM = null;this._scrollUpTMTime = 20;this._scrollUpTMStep = 3;this._scrollDownTM = null;this._scrollDownTMTime = 20;this._scrollDownTMStep = 3;this.context = false;this.contextZones = {};this.contextMenuZoneId = false;this.contextAutoShow = true;this.contextAutoHide = true;this.contextHideAllMode = true;this.sxDacProc = null;this.dacSpeed = 10;this.dacCycles = [];for (var q=0;q<10;q++){this.dacCycles[q] = q;};this.dacSpeedIE = 10;this.dacCyclesIE = [];for (var q=0;q<10;q++){this.dacCyclesIE[q] = q;};this._enableDacSupport = function(dac) {this.sxDacProc = dac;};this._selectedSubItems = new Array();this._openedPolygons = new Array();this._addSubItemToSelected = function(item, polygon) {var t = true;for (var q=0;q<this._selectedSubItems.length;q++){if ((this._selectedSubItems[q][0] == item)&& (this._selectedSubItems[q][1] == polygon)) {t = false;}};if (t == true){this._selectedSubItems.push(new Array(item, polygon));};return t;};this._removeSubItemFromSelected = function(item, polygon) {var m = new Array();var t = false;for (var q=0;q<this._selectedSubItems.length;q++){if ((this._selectedSubItems[q][0] == item)&& (this._selectedSubItems[q][1] == polygon)) {t = true;}else {m[m.length] = this._selectedSubItems[q];}};if (t == true){this._selectedSubItems = m;};return t;};this._getSubItemToDeselectByPolygon = function(polygon) {var m = new Array();for (var q=0;q<this._selectedSubItems.length;q++){if (this._selectedSubItems[q][1] == polygon){m[m.length] = this._selectedSubItems[q][0];m = m.concat(this._getSubItemToDeselectByPolygon(this._selectedSubItems[q][0]));var t = true;for (var w=0;w<this._openedPolygons.length;w++){if (this._openedPolygons[w] == this._selectedSubItems[q][0]){t = false;}};if (t == true){this._openedPolygons[this._openedPolygons.length] = this._selectedSubItems[q][0];};this._selectedSubItems[q][0] = -1;this._selectedSubItems[q][1] = -1;}};return m;};this._hidePolygon = function(id) {if (this.idPull["polygon_" + id] != null){if ((this.sxDacProc != null)&& (this.idPull["sxDac_" + id] != null)) {this.idPull["sxDac_"+id]._hide();}else {if (this.idPull["polygon_"+id].style.display == "none")return;this.idPull["polygon_"+id].style.display = "none";if (this.idPull["arrowup_"+id] != null){this.idPull["arrowup_"+id].style.display = "none";};if (this.idPull["arrowdown_"+id] != null){this.idPull["arrowdown_"+id].style.display = "none";};this._updateItemComplexState(id, true, false);if (this._isIE6){if (this.idPull["polygon_"+id+"_ie6cover"] != null){this.idPull["polygon_"+id+"_ie6cover"].style.display = "none";}};id = String(id).replace(this.idPrefix, "");if (id == this.topId)id = null;this.callEvent("onHide", [id]);}}};this._showPolygon = function(id, openType) {var itemCount = this._countVisiblePolygonItems(id);if (itemCount == 0)return;var pId = "polygon_"+id;if ((this.idPull[pId] != null)&& (this.idPull[id] != null)) {if (this.menuModeTopLevelTimeout && this.menuMode == "web" && !this.context){if (!this.idPull[id]._mouseOver && openType == this.dirTopLevel)return;};if (!this.fixedPosition)this._autoDetectVisibleArea();var arrUpH = 0;var arrDownH = 0;var arrowUp = null;var arrowDown = null;if (this.limit > 0 && this.limit < itemCount){var auId = "arrowup_"+id;var adId = "arrowdown_"+id;if (this.idPull["arrowup_"+id] == null)this._addUpArrow(String(id).replace(this.idPrefix,""));if (this.idPull["arrowdown_"+id] == null)this._addDownArrow(String(id).replace(this.idPrefix,""));arrowUp = this.idPull["arrowup_"+id];arrowUp.style.visibility = "hidden";arrowUp.style.display = "";arrowUp.style.zIndex = this.zInd;arrUpH = arrowUp.offsetHeight;arrowDown = this.idPull["arrowdown_"+id];arrowDown.style.visibility = "hidden";arrowDown.style.display = "";arrowDown.style.zIndex = this.zInd;arrDownH = arrowDown.offsetHeight;};this.idPull[pId].style.visibility = "hidden";this.idPull[pId].style.left = "0px";this.idPull[pId].style.top = "0px";this.idPull[pId].style.display = "";this.idPull[pId].style.zIndex = this.zInd;if (this.limit > 0){if (this.limit < itemCount){this.idPull[pId].style.height = 24*this.limit+"px";this.idPull[pId].scrollTop = 0;}else {this.idPull[pId].style.height = "";}};this.zInd += this.zIndStep;if (this.itemPull[id] != null){var parPoly = "polygon_"+this.itemPull[id]["parent"];}else if (this.context){var parPoly = this.idPull[this.idPrefix+this.topId];};var srcX = (this.idPull[id].tagName != null ? getAbsoluteLeft(this.idPull[id]) : this.idPull[id][0]);var srcY = (this.idPull[id].tagName != null ? getAbsoluteTop(this.idPull[id]) : this.idPull[id][1]);var srcW = (this.idPull[id].tagName != null ? this.idPull[id].offsetWidth : 0);var srcH = (this.idPull[id].tagName != null ? this.idPull[id].offsetHeight + arrUpH + arrDownH : 0);var x = 0;var y = 0;var w = this.idPull[pId].offsetWidth;var h = this.idPull[pId].offsetHeight;if (openType == "bottom"){if (this._rtl){x = srcX + (srcW!=null?srcW:0) - w;}else {if (this._align == "right"){x = srcX + srcW - w;}else {x = srcX - 1 + (openType==this.dirTopLevel?this._topLevelRightMargin:0);}};y = srcY - 1 + srcH - arrUpH - arrDownH + this._topLevelBottomMargin;};if (openType == "right"){x = srcX + srcW - 1;y = srcY + 2;};if (openType == "left"){x = srcX - this.idPull[pId].offsetWidth + 2;y = srcY + 2;};if (openType == "top"){x = srcX - 1;y = srcY - h + 2;};if (this.fixedPosition){var mx = 65536;var my = 65536;}else {var mx = (this.menuX2!=null?this.menuX2:0);var my = (this.menuY2!=null?this.menuY2:0);if (mx == 0){if (window.innerWidth){mx = window.innerWidth;my = window.innerHeight;}else {mx = document.body.offsetWidth;my = document.body.scrollHeight;}}};if (x+w > mx && !this._rtl){x = srcX - w + 2;};if (x < this.menuX1 && this._rtl){x = srcX + srcW - 2;};if (x < 0){x = 0;};if (y+h > my && this.menuY2 != null){y = srcY + srcH - h + 2;if (this.itemPull[id] != null && !this.context){if (this.itemPull[id]["parent"] == this.idPrefix+this.topId)y = y - this.base.offsetHeight;}};this.idPull[pId].style.left = x+"px";this.idPull[pId].style.top = y+arrUpH+"px";if ((this.sxDacProc != null)&& (this.idPull["sxDac_" + id] != null)) {this.idPull["sxDac_"+id]._show();}else {this.idPull[pId].style.visibility = "";if (this.limit > 0 && this.limit < itemCount){arrowUp.style.left = x+"px";arrowUp.style.top = y+"px";arrowUp.style.width = w+this._arrowFFFix+"px";arrowUp.style.visibility = "";arrowDown.style.left = x+"px";arrowDown.style.top = y+arrUpH+h+"px";arrowDown.style.width = w+this._arrowFFFix+"px";arrowDown.style.visibility = "";this._checkArrowsState(id);};if (this._isIE6){var pIdIE6 = pId+"_ie6cover";if (this.idPull[pIdIE6] == null){var ifr = document.createElement("IFRAME");ifr.className = "dhtmlxMenu_IE6CoverFix_"+this.skin;ifr.frameBorder = 0;ifr.setAttribute("src", "javascript:false;");document.body.insertBefore(ifr, document.body.firstChild);this.idPull[pIdIE6] = ifr;};this.idPull[pIdIE6].style.left = this.idPull[pId].style.left;this.idPull[pIdIE6].style.top = this.idPull[pId].style.top;this.idPull[pIdIE6].style.width = this.idPull[pId].offsetWidth+"px";this.idPull[pIdIE6].style.height = this.idPull[pId].offsetHeight+"px";this.idPull[pIdIE6].style.zIndex = this.idPull[pId].style.zIndex-1;this.idPull[pIdIE6].style.display = "";};id = String(id).replace(this.idPrefix, "");if (id == this.topId)id = null;this.callEvent("onShow", [id]);}}};this._redistribSubLevelSelection = function(id, parentId) {while (this._openedPolygons.length > 0)this._openedPolygons.pop();var i = this._getSubItemToDeselectByPolygon(parentId);this._removeSubItemFromSelected(-1, -1);for (var q=0;q<i.length;q++){if ((this.idPull[i[q]] != null)&& (i[q] != id)) {if (this.itemPull[i[q]]["state"] == "enabled"){this.idPull[i[q]].className = "sub_item";}}};for (var q=0;q<this._openedPolygons.length;q++){if (this._openedPolygons[q] != parentId){this._hidePolygon(this._openedPolygons[q]);}};if (this.itemPull[id]["state"] == "enabled"){this.idPull[id].className = "sub_item_selected";if (this.itemPull[id]["complex"] && this.dLoad && (this.itemPull[id]["loaded"]=="no")) {if (this.loaderIcon == true){this._updateLoaderIcon(id, true);};var xmlLoader = new dtmlXMLLoaderObject(this._xmlParser, window);this.itemPull[id]["loaded"] = "get";this.callEvent("onXLS", []);xmlLoader.loadXML(this.dLoadUrl+this.dLoadSign+"action=loadMenu&parentId="+id.replace(this.idPrefix,"")+"&etc="+new Date().getTime());};if (this.itemPull[id]["complex"] || (this.dLoad && (this.itemPull[id]["loaded"] == "yes"))) {if ((this.itemPull[id]["complex"])&& (this.idPull["polygon_" + id] != null)) {this._updateItemComplexState(id, true, true);this._showPolygon(id, this.dirSubLevel);}};this._addSubItemToSelected(id, parentId);this.menuSelected = id;}};this._doOnClick = function(id, type, casState) {this.menuLastClicked = id;if (this.itemPull[this.idPrefix+id]["href_link"] != null){var form = document.createElement("FORM");var k = String(this.itemPull[this.idPrefix+id]["href_link"]).split("?");form.action = k[0];if (k[1] != null){var p = String(k[1]).split("&");for (var q=0;q<p.length;q++){var j = String(p[q]).split("=");var m = document.createElement("INPUT");m.type = "hidden";m.name = (j[0]||"");m.value = (j[1]||"");form.appendChild(m);}};if (this.itemPull[this.idPrefix+id]["href_target"] != null){form.target = this.itemPull[this.idPrefix+id]["href_target"];};form.style.display = "none";document.body.appendChild(form);form.submit();if (form != null){document.body.removeChild(form);form = null;};return;};if (type.charAt(0)=="c") return;if (type.charAt(1)=="d") return;if (type.charAt(2)=="s") return;if (this.checkEvent("onClick")) {this._clearAndHide();if (this._isContextMenuVisible()&& this.contextAutoHide) this._hideContextMenu();this.callEvent("onClick", [id, this.contextMenuZoneId, casState]);}else {if ((type.charAt(1)== "d") || (this.menuMode == "win" && type.charAt(2) == "t")) return;this._clearAndHide();if (this._isContextMenuVisible()&& this.contextAutoHide) this._hideContextMenu();}};this._doOnTouchMenu = function(id) {if (this.menuTouched == false){this.menuTouched = true;if (this.checkEvent("onTouch")) {this.callEvent("onTouch", [id]);}}};this._searchMenuNode = function(node, menu) {var m = new Array();for (var q=0;q<menu.length;q++){if (typeof(menu[q])== "object") {if (menu[q].length == 5){if (typeof(menu[q][0])!= "object") {if ((menu[q][0].replace(this.idPrefix, "")== node) && (q == 0)) {m = menu;}}};var j = this._searchMenuNode(node, menu[q]);if (j.length > 0){m = j;}}};return m;};this._getMenuNodes = function(node) {var m = new Array;for (var a in this.itemPull){if (this.itemPull[a]["parent"] == node){m[m.length] = a;}};return m;};this._genStr = function(w) {var s = "";var z = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for (var q=0;q<w;q++)s += z.charAt(Math.round(Math.random() * (z.length-1)));return s;};this.getItemType = function(id) {id = this.idPrefix+id;if (this.itemPull[id] == null){return null;};return this.itemPull[id]["type"];};this.forEachItem = function(handler) {for (var a in this.itemPull){handler(String(a).replace(this.idPrefix, ""));}};this._clearAndHide = function() {main_self.menuSelected = -1;main_self.menuLastClicked = -1;while (main_self._openedPolygons.length > 0){main_self._openedPolygons.pop();};for (var q=0;q<main_self._selectedSubItems.length;q++){var id = main_self._selectedSubItems[q][0];if (main_self.idPull[id] != null){if (main_self.itemPull[id]["state"] == "enabled"){if (main_self.idPull[id].className == "sub_item_selected")main_self.idPull[id].className = "sub_item";if (main_self.idPull[id].className == "dhtmlxMenu_"+main_self.skin+"_TopLevel_Item_Selected"){if (main_self.itemPull[id]["cssNormal"] != null){main_self.idPull[id].className = main_self.itemPull[id]["cssNormal"];}else {main_self.idPull[id].className = "dhtmlxMenu_"+main_self.skin+"_TopLevel_Item_Normal";}}}};main_self._hidePolygon(id);};main_self.menuTouched = false;if (main_self.context){if (main_self.contextHideAllMode){main_self._hidePolygon(main_self.idPrefix+main_self.topId);main_self.zInd = main_self.zIndInit;}else {main_self.zInd = main_self.zIndInit+main_self.zIndStep;}}};this._doOnLoad = function() {};this.loadXML = function(xmlFile, onLoadFunction) {if (onLoadFunction)this._doOnLoad = function() {onLoadFunction();};this.callEvent("onXLS", []);this._xmlLoader.loadXML(xmlFile);};this.loadXMLString = function(xmlString, onLoadFunction) {if (onLoadFunction)this._doOnLoad = function() {onLoadFunction();};this._xmlLoader.loadXMLString(xmlString);};this._buildMenu = function(t, parentId) {var u = 0;for (var q=0;q<t.childNodes.length;q++){if (t.childNodes[q].tagName == this.itemTagName){var r = t.childNodes[q];var item = {};item["id"] = this.idPrefix+(r.getAttribute("id")||this._genStr(24));item["title"] = r.getAttribute("text")||"";item["imgen"] = r.getAttribute("img")||"";item["imgdis"] = r.getAttribute("imgdis")||"";item["tip"] = "";item["hotkey"] = "";if (r.getAttribute("cssNormal")!= null) {item["cssNormal"] = r.getAttribute("cssNormal");};item["type"] = r.getAttribute("type")||"item";if (item["type"] == "checkbox"){item["checked"] = (r.getAttribute("checked")!=null);item["imgen"] = "chbx_"+(item["checked"]?"1":"0");item["imgdis"] = item["imgen"];};if (item["type"] == "radio"){item["checked"] = (r.getAttribute("checked")!=null);item["imgen"] = "rdbt_"+(item["checked"]?"1":"0");item["imgdis"] = item["imgen"];item["group"] = r.getAttribute("group")||this._genStr(24);if (this.radio[item["group"]]==null){this.radio[item["group"]] = new Array();};this.radio[item["group"]][this.radio[item["group"]].length] = item["id"];};item["state"] = (r.getAttribute("enabled")!=null||r.getAttribute("disabled")!=null?(r.getAttribute("enabled")=="false"||r.getAttribute("disabled")=="true"?"disabled":"enabled"):"enabled");item["parent"] = (parentId!=null?parentId:this.idPrefix+this.topId);item["complex"] = (this.dLoad?(r.getAttribute("complex")!=null?true:false):(this._buildMenu(r,item["id"])>0));if (this.dLoad && item["complex"]){item["loaded"] = "no";};this.itemPull[item["id"]] = item;for (var w=0;w<r.childNodes.length;w++){var tagNm = r.childNodes[w].tagName;if (tagNm != null){tagNm = tagNm.toLowerCase();};if (tagNm == this.userDataTagName){var d = r.childNodes[w];if (d.getAttribute("name")!=null) {this.userData[item["id"]+"_"+d.getAttribute("name")] = (d.firstChild.nodeValue!=null?d.firstChild.nodeValue:"");}};if (tagNm == this.itemTextTagName){item["title"] = r.childNodes[w].firstChild.nodeValue;};if (tagNm == this.itemTipTagName){item["tip"] = r.childNodes[w].firstChild.nodeValue;};if (tagNm == this.itemHotKeyTagName){item["hotkey"] = r.childNodes[w].firstChild.nodeValue;};if (tagNm == this.itemHrefTagName && item["type"] == "item"){item["href_link"] = r.childNodes[w].firstChild.nodeValue;if (r.childNodes[w].getAttribute("target")!= null) {item["href_target"] = r.childNodes[w].getAttribute("target");}}};u++;}};return u;};this._xmlParser = function() {if (main_self.dLoad){var t = this.getXMLTopNode("menu");parentId = (t.getAttribute("parentId")!=null?t.getAttribute("parentId"):null);if (parentId == null){main_self._buildMenu(t, null);main_self._initTopLevelMenu();}else {main_self._buildMenu(t, main_self.idPrefix+parentId);main_self._addSubMenuPolygon(main_self.idPrefix+parentId, main_self.idPrefix+parentId);if (main_self.menuSelected == main_self.idPrefix+parentId){var pId = main_self.idPrefix+parentId;var isTop = main_self.itemPull[main_self.idPrefix+parentId]["parent"]==main_self.idPrefix+main_self.topId;var level = ((isTop&&(!main_self.context))?main_self.dirTopLevel:main_self.dirSubLevel);var isShow = false;if (isTop && main_self.menuModeTopLevelTimeout && main_self.menuMode == "web" && !main_self.context){var item = main_self.idPull[main_self.idPrefix+parentId];if (item._mouseOver == true){var delay = main_self.menuModeTopLevelTimeoutTime - (new Date().getTime()-item._dynLoadTM);if (delay > 1){item._menuOpenTM = window.setTimeout(function(){main_self._showPolygon(pId, level);}, delay);isShow = true;}}};if (!isShow){main_self._showPolygon(pId, level);}};main_self.itemPull[main_self.idPrefix+parentId]["loaded"] = "yes";if (main_self.loaderIcon == true){main_self._updateLoaderIcon(main_self.idPrefix+parentId, false);}};this.destructor();main_self.callEvent("onXLE",[]);}else {var t = this.getXMLTopNode("menu");main_self._buildMenu(t, null);main_self.init();main_self.callEvent("onXLE",[]);main_self._doOnLoad();}};this._xmlLoader = new dtmlXMLLoaderObject(this._xmlParser, window);this._showSubLevelItem = function(id,back) {if (document.getElementById("arrow_" + this.idPrefix + id)!= null) {document.getElementById("arrow_" + this.idPrefix + id).style.display = (back?"none":"");};if (document.getElementById("image_" + this.idPrefix + id)!= null) {document.getElementById("image_" + this.idPrefix + id).style.display = (back?"none":"");};if (document.getElementById(this.idPrefix + id)!= null) {document.getElementById(this.idPrefix + id).style.display = (back?"":"none");}};this._hideSubLevelItem = function(id) {this._showSubLevelItem(id,true)
 };this.idPrefix = this._genStr(12);this._bodyClick = function(e) {e = e||event;if (e.button == 2 || (_isOpera && e.ctrlKey == true)) return;if (main_self.context){if (main_self.contextAutoHide && (!_isOpera || (main_self._isContextMenuVisible()&& _isOpera))) main_self._hideContextMenu();}else {main_self._clearAndHide();}};this._bodyContext = function(e) {e = e||event;var t = (e.srcElement||e.target).className;if (t.search("dhtmlxMenu")!= -1 && t.search("SubLevelArea") != -1) return;var toHide = true;var testZone = e.target || e.srcElement;if (testZone.id != null)if (main_self.isContextZone(testZone.id)) toHide = false;if (testZone == document.body)toHide = false;if (toHide)main_self.hideContextMenu();};if (_isIE){document.body.attachEvent("onclick", this._bodyClick);document.body.attachEvent("oncontextmenu", this._bodyContext);}else {window.addEventListener("click", this._bodyClick, false);window.addEventListener("contextmenu", this._bodyContext, false);};this._UID = this._genStr(32);dhtmlxMenuObjectLiveInstances[this._UID] = this;dhtmlxEventable(this);return this;};dhtmlXMenuObject.prototype.init = function() {if (this._isInited == true)return;if (this.dLoad){this.callEvent("onXLS", []);this._xmlLoader.loadXML(this.dLoadUrl+this.dLoadSign+"action=loadMenu&etc="+new Date().getTime());}else {this._initTopLevelMenu();this._isInited = true;}};dhtmlXMenuObject.prototype._countVisiblePolygonItems = function(id) {var count = 0;for (var a in this.itemPull){var par = this.itemPull[a]["parent"];var tp = this.itemPull[a]["type"];if (this.idPull[a] != null){if (par == id && (tp == "item" || tp == "radio" || tp == "checkbox")&& this.idPull[a].style.display != "none") {count++;}}};return count;};dhtmlXMenuObject.prototype._redefineComplexState = function(id) {if (this.idPrefix+this.topId == id){return;};if ((this.idPull["polygon_"+id] != null)&& (this.idPull[id] != null)) {var u = this._countVisiblePolygonItems(id);if ((u > 0)&& (!this.itemPull[id]["complex"])) {this._updateItemComplexState(id, true, false);};if ((u == 0)&& (this.itemPull[id]["complex"])) {this._updateItemComplexState(id, false, false);}}};dhtmlXMenuObject.prototype._updateItemComplexState = function(id, state, over) {if ((!this.context)&& (this._getItemLevelType(id.replace(this.idPrefix,"")) == "TopLevel")) {this.itemPull[id]["complex"] = state;return;};if ((this.idPull[id] == null)|| (this.itemPull[id] == null)) {return;};this.itemPull[id]["complex"] = state;if (id == this.idPrefix+this.topId)return;var arrowObj = null;var item = this.idPull[id].childNodes[this._rtl?0:2];if (item.childNodes[0])if (String(item.childNodes[0].className).search("complex_arrow") === 0) arrowObj = item.childNodes[0];if (this.itemPull[id]["complex"]){if (arrowObj == null){arrowObj = document.createElement("DIV");arrowObj.className = "complex_arrow";arrowObj.id = "arrow_"+id;while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);item.appendChild(arrowObj);};if (this.dLoad && (this.itemPull[id]["loaded"] == "get")&& this.loaderIcon) {if (arrowObj.className != "complex_arrow_loading")arrowObj.className = "complex_arrow_loading";}else {arrowObj.className = "complex_arrow";};return;};if ((!this.itemPull[id]["complex"])&& (arrowObj!=null)) {item.removeChild(arrowObj);if (this.itemPull[id]["hotkey_backup"] != null && this.setHotKey){this.setHotKey(id.replace(this.idPrefix, ""), this.itemPull[id]["hotkey_backup"]);}}};dhtmlXMenuObject.prototype._getItemLevelType = function(id) {return (this.itemPull[this.idPrefix+id]["parent"]==this.idPrefix+this.topId?"TopLevel":"SubLevelArea");};dhtmlXMenuObject.prototype._redistribTopLevelSelection = function(id, parent) {var i = this._getSubItemToDeselectByPolygon("parent");this._removeSubItemFromSelected(-1, -1);for (var q=0;q<i.length;q++){if (i[q] != id){this._hidePolygon(i[q]);};if ((this.idPull[i[q]] != null)&& (i[q] != id)) {this.idPull[i[q]].className = this.idPull[i[q]].className.replace(/Selected/g, "Normal");}};if (this.itemPull[this.idPrefix+id]["state"] == "enabled"){this.idPull[this.idPrefix+id].className = "dhtmlxMenu_"+this.skin+"_TopLevel_Item_Selected";this._addSubItemToSelected(this.idPrefix+id, "parent");this.menuSelected = (this.menuMode=="win"?(this.menuSelected!=-1?id:this.menuSelected):id);if ((this.itemPull[this.idPrefix+id]["complex"])&& (this.menuSelected != -1)) {this._showPolygon(this.idPrefix+id, this.dirTopLevel);}}};dhtmlXMenuObject.prototype._initTopLevelMenu = function() {this.dirTopLevel = "bottom";this.dirSubLevel = (this._rtl?"left":"right");if (this.context){this.idPull[this.idPrefix+this.topId] = new Array(0,0);this._addSubMenuPolygon(this.idPrefix+this.topId, this.idPrefix+this.topId);}else {var m = this._getMenuNodes(this.idPrefix + this.topId);for (var q=0;q<m.length;q++){if (this.itemPull[m[q]]["type"] == "item")this._renderToplevelItem(m[q], null);if (this.itemPull[m[q]]["type"] == "separator")this._renderSeparator(m[q], null);}}};dhtmlXMenuObject.prototype._renderToplevelItem = function(id, pos) {var main_self = this;var m = document.createElement("DIV");m.id = id;if (this.itemPull[id]["state"] == "enabled" && this.itemPull[id]["cssNormal"] != null){m.className = this.itemPull[id]["cssNormal"];}else {m.className = "dhtmlxMenu_"+this.skin+"_TopLevel_Item_"+(this.itemPull[id]["state"]=="enabled"?"Normal":"Disabled");};if (this.itemPull[id]["title"] != ""){var t1 = document.createElement("DIV");t1.className = "top_level_text";t1.innerHTML = this.itemPull[id]["title"];m.appendChild(t1);};if (this.itemPull[id]["tip"].length > 0)m.title = this.itemPull[id]["tip"];if ((this.itemPull[id]["imgen"]!="")||(this.itemPull[id]["imgdis"]!="")) {var imgTop=this.itemPull[id][(this.itemPull[id]["state"]=="enabled")?"imgen":"imgdis"];if (imgTop){var img = document.createElement("IMG");img.border = "0";img.id = "image_"+id;img.src= this.imagePath+imgTop;img.className = "dhtmlxMenu_TopLevel_Item_Icon";if (m.childNodes.length > 0 && !this._rtl)m.insertBefore(img, m.childNodes[0]);else m.appendChild(img);}};m.onselectstart = function(e) {e = e || event;e.returnValue = false;return false;};m.oncontextmenu = function(e) {e = e || event;e.returnValue = false;return false;};if (!this.cont){this.cont = document.createElement("DIV");this.cont.dir = "ltr";this.cont.className = (this._align=="right"?"align_right":"align_left");this.base.appendChild(this.cont);};if (pos != null){pos++;if (pos < 0)pos = 0;if (pos > this.cont.childNodes.length - 1)pos = null;};if (pos != null)this.cont.insertBefore(m, this.cont.childNodes[pos]);else this.cont.appendChild(m);this.idPull[m.id] = m;if (this.itemPull[id]["complex"] && (!this.dLoad)) this._addSubMenuPolygon(this.itemPull[id]["id"], this.itemPull[id]["id"]);m.onmouseover = function() {if (main_self.menuMode == "web"){window.clearTimeout(main_self.menuTimeoutHandler);};var i = main_self._getSubItemToDeselectByPolygon("parent");main_self._removeSubItemFromSelected(-1, -1);for (var q=0;q<i.length;q++){if (i[q] != this.id){main_self._hidePolygon(i[q]);};if ((main_self.idPull[i[q]] != null)&& (i[q] != this.id)) {if (main_self.itemPull[i[q]]["cssNormal"] != null){main_self.idPull[i[q]].className = main_self.itemPull[i[q]]["cssNormal"];}else {if (main_self.idPull[i[q]].className == "sub_item_selected")main_self.idPull[i[q]].className = "sub_item";main_self.idPull[i[q]].className = main_self.idPull[i[q]].className.replace(/Selected/g, "Normal");}}};if (main_self.itemPull[this.id]["state"] == "enabled"){this.className = "dhtmlxMenu_"+main_self.skin+"_TopLevel_Item_Selected";main_self._addSubItemToSelected(this.id, "parent");main_self.menuSelected = (main_self.menuMode=="win"?(main_self.menuSelected!=-1?this.id:main_self.menuSelected):this.id);if (main_self.dLoad && (main_self.itemPull[this.id]["loaded"]=="no")) {if (main_self.menuModeTopLevelTimeout && main_self.menuMode == "web" && !main_self.context){this._mouseOver = true;this._dynLoadTM = new Date().getTime();};var xmlLoader = new dtmlXMLLoaderObject(main_self._xmlParser, window);main_self.itemPull[this.id]["loaded"] = "get";main_self.callEvent("onXLS", []);xmlLoader.loadXML(main_self.dLoadUrl+main_self.dLoadSign+"action=loadMenu&parentId="+this.id.replace(main_self.idPrefix,"")+"&etc="+new Date().getTime());};if ((!main_self.dLoad)|| (main_self.dLoad && (main_self.itemPull[this.id]["loaded"]=="yes"))) {if ((main_self.itemPull[this.id]["complex"])&& (main_self.menuSelected != -1)) {if (main_self.menuModeTopLevelTimeout && main_self.menuMode == "web" && !main_self.context){this._mouseOver = true;var showItemId = this.id;this._menuOpenTM = window.setTimeout(function(){main_self._showPolygon(showItemId, main_self.dirTopLevel);}, main_self.menuModeTopLevelTimeoutTime);}else {main_self._showPolygon(this.id, main_self.dirTopLevel);}}}};main_self._doOnTouchMenu(this.id.replace(main_self.idPrefix, ""));};m.onmouseout = function() {if (!((main_self.itemPull[this.id]["complex"])&& (main_self.menuSelected != -1)) && (main_self.itemPull[this.id]["state"]=="enabled")) {if (main_self.itemPull[this.id]["cssNormal"] != null){m.className = main_self.itemPull[this.id]["cssNormal"];}else {m.className = "dhtmlxMenu_"+main_self.skin+"_TopLevel_Item_Normal";}};if (main_self.menuMode == "web"){window.clearTimeout(main_self.menuTimeoutHandler);main_self.menuTimeoutHandler = window.setTimeout(function(){main_self._clearAndHide();}, main_self.menuTimeoutMsec, "JavaScript");};if (main_self.menuModeTopLevelTimeout && main_self.menuMode == "web" && !main_self.context){this._mouseOver = false;window.clearTimeout(this._menuOpenTM);}};m.onclick = function(e) {if (main_self.menuMode == "web"){window.clearTimeout(main_self.menuTimeoutHandler);};if (main_self.menuMode != "web" && main_self.itemPull[this.id]["state"] == "disabled"){return;};e = e || event;e.cancelBubble = true;e.returnValue = false;if (main_self.menuMode == "win"){if (main_self.itemPull[this.id]["complex"]){if (main_self.menuSelected == this.id){main_self.menuSelected = -1;var s = false;}else {main_self.menuSelected = this.id;var s = true;};if (s){main_self._showPolygon(this.id, main_self.dirTopLevel);}else {main_self._hidePolygon(this.id);}}};var tc = (main_self.itemPull[this.id]["complex"]?"c":"-");var td = (main_self.itemPull[this.id]["state"]!="enabled"?"d":"-");var cas = {"ctrl": e.ctrlKey, "alt": e.altKey, "shift": e.shiftKey};main_self._doOnClick(this.id.replace(main_self.idPrefix, ""), tc+td+"t", cas);return false;}};dhtmlXMenuObject.prototype.setImagePath = function() {};dhtmlXMenuObject.prototype.setIconsPath = function(path) {this.imagePath = path;};dhtmlXMenuObject.prototype.setIconPath = dhtmlXMenuObject.prototype.setIconsPath;dhtmlXMenuObject.prototype._updateItemImage = function(id, levelType) {id = this.idPrefix+id;var isTopLevel = (this.itemPull[id]["parent"] == this.idPrefix+this.topId && !this.context);var imgObj = null;if (isTopLevel){for (var q=0;q<this.idPull[id].childNodes.length;q++){try {if (this.idPull[id].childNodes[q].className == "dhtmlxMenu_TopLevel_Item_Icon")imgObj = this.idPull[id].childNodes[q];}catch(e) {}}}else {try {var imgObj = this.idPull[id].childNodes[this._rtl?2:0].childNodes[0];}catch(e) {}};if (this.itemPull[id]["type"] == "radio"){var imgSrc = this.itemPull[id][(this.itemPull[id]["state"]=="enabled"?"imgen":"imgdis")];}else {var imgSrc = this.itemPull[id][(this.itemPull[id]["state"]=="enabled"?"imgen":"imgdis")];};if (imgSrc.length > 0){if (imgObj != null){imgObj.src = this.imagePath+imgSrc;}else {if (isTopLevel){var imgObj = document.createElement("IMG");imgObj.className = "dhtmlxMenu_TopLevel_Item_Icon";imgObj.src = this.imagePath+imgSrc;imgObj.border = "0";imgObj.id = "image_"+id;if (!this._rtl && this.idPull[id].childNodes.length > 0)this.idPull[id].insertBefore(imgObj,this.idPull[id].childNodes[0]);else this.idPull[id].appendChild(imgObj);}else {var imgObj = document.createElement("IMG");imgObj.className = "sub_icon";imgObj.src = this.imagePath+imgSrc;imgObj.border = "0";imgObj.id = "image_"+id;var item = this.idPull[id].childNodes[this._rtl?2:0];while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);item.appendChild(imgObj);}}}else {if (imgObj != null)imgObj.parentNode.removeChild(imgObj);}};dhtmlXMenuObject.prototype.removeItem = function(id, _isTId, _recCall) {if (!_isTId)id = this.idPrefix + id;var pId = null;if (id != this.idPrefix+this.topId){if (this.itemPull[id] == null)return;var t = this.itemPull[id]["type"];if (t == "separator"){var item = this.idPull["separator_"+id];if (this.itemPull[id]["parent"] == this.idPrefix+this.topId){item.onclick = null;item.onselectstart = null;item.id = null;item.parentNode.removeChild(item);}else {item.childNodes[0].childNodes[0].onclick = null;item.childNodes[0].childNodes[0].onselectstart = null;item.childNodes[0].childNodes[0].id = null;item.childNodes[0].removeChild(item.childNodes[0].childNodes[0]);item.removeChild(item.childNodes[0]);item.parentNode.removeChild(item);};this.idPull["separator_"+id] = null;this.itemPull[id] = null;delete this.idPull["separator_"+id];delete this.itemPull[id];item = null;}else {pId = this.itemPull[id]["parent"];var item = this.idPull[id];item.onclick = null;item.oncontextmenu = null;item.onmouseover = null;item.onmouseout = null;item.onselectstart = null;item.id = null;while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);item.parentNode.removeChild(item);this.idPull[id] = null;this.itemPull[id] = null;delete this.idPull[id];delete this.itemPull[id];item = null;};t = null;};for (var a in this.itemPull)if (this.itemPull[a]["parent"] == id)this.removeItem(a, true, true);var p2 = new Array(id);if (pId != null && !_recCall){if (this.idPull["polygon_"+pId] != null){if (this.idPull["polygon_"+pId].tbd.childNodes.length == 0){p2.push(pId);this._updateItemComplexState(pId, false, false);}}};for (var q=0;q<p2.length;q++){if (this.idPull["polygon_"+p2[q]]){var p = this.idPull["polygon_"+p2[q]];p.onclick = null;p.oncontextmenu = null;p.tbl.removeChild(p.tbd);p.tbd = null;p.removeChild(p.tbl);p.tbl = null;p.id = null;p.parentNode.removeChild(p);p = null;if (this._isIE6){var pc = "polygon_"+p2[q]+"_ie6cover";if (this.idPull[pc] != null){document.body.removeChild(this.idPull[pc]);delete this.idPull[pc];}};if (this.idPull["arrowup_"+id] != null && this._removeArrow)this._removeArrow("arrowup_"+id);if (this.idPull["arrowdown_"+id] != null && this._removeArrow)this._removeArrow("arrowdown_"+id);this.idPull["polygon_"+p2[q]] = null;delete this.idPull["polygon_"+p2[q]];}};p2 = null;};dhtmlXMenuObject.prototype._getAllParents = function(id) {var parents = new Array();for (var a in this.itemPull){if (this.itemPull[a]["parent"] == id){parents[parents.length] = this.itemPull[a]["id"];if (this.itemPull[a]["complex"]){var t = this._getAllParents(this.itemPull[a]["id"]);for (var q=0;q<t.length;q++){parents[parents.length] = t[q];}}}};return parents;};dhtmlXMenuObject.prototype.renderAsContextMenu = function() {this.context = true;if (this.base._autoSkinUpdate == true){this.base.className = this.base.className.replace("dhtmlxMenu_"+this.skin+"_Middle","");this.base._autoSkinUpdate = false;};if (this.addBaseIdAsContextZone != null){this.addContextZone(this.addBaseIdAsContextZone);}};dhtmlXMenuObject.prototype.addContextZone = function(zoneId) {if (zoneId == document.body){zoneId = "document.body."+this.idPrefix;var zone = document.body;}else {var zone = document.getElementById(zoneId);};var zoneExists = false;for (var a in this.contextZones){zoneExists = zoneExists || (a == zoneId) || (this.contextZones[a] == zone);};if (zoneExists == true)return false;this.contextZones[zoneId] = zone;var main_self = this;if (_isOpera){this.operaContext = function(e){main_self._doOnContextMenuOpera(e, main_self);};zone.addEventListener("mouseup", this.operaContext, false);}else {if (zone.oncontextmenu != null && !zone._oldContextMenuHandler)zone._oldContextMenuHandler = zone.oncontextmenu;zone.oncontextmenu = function(e) {for (var q in dhtmlxMenuObjectLiveInstances){if (q != main_self._UID){if (dhtmlxMenuObjectLiveInstances[q].context){dhtmlxMenuObjectLiveInstances[q]._hideContextMenu();}}};e = e||event;e.cancelBubble = true;e.returnValue = false;main_self._doOnContextBeforeCall(e, this);return false;}}};dhtmlXMenuObject.prototype._doOnContextMenuOpera = function(e, main_self) {for (var q in dhtmlxMenuObjectLiveInstances){if (q != main_self._UID){if (dhtmlxMenuObjectLiveInstances[q].context){dhtmlxMenuObjectLiveInstances[q]._hideContextMenu();}}};e.cancelBubble = true;e.returnValue = false;if (e.button == 0 && e.ctrlKey == true){main_self._doOnContextBeforeCall(e, this);};return false;};dhtmlXMenuObject.prototype.removeContextZone = function(zoneId) {if (!this.isContextZone(zoneId)) return false;if (zoneId == document.body)zoneId = "document.body."+this.idPrefix;var zone = this.contextZones[zoneId];if (_isOpera){zone.removeEventListener("mouseup", this.operaContext, false);}else {zone.oncontextmenu = (zone._oldContextMenuHandler!=null?zone._oldContextMenuHandler:null);zone._oldContextMenuHandler = null;};try {this.contextZones[zoneId] = null;delete this.contextZones[zoneId];}catch(e){};return true;};dhtmlXMenuObject.prototype.isContextZone = function(zoneId) {if (zoneId == document.body && this.contextZones["document.body."+this.idPrefix] != null)return true;var isZone = false;if (this.contextZones[zoneId] != null){if (this.contextZones[zoneId] == document.getElementById(zoneId)) isZone = true;};return isZone;};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(x, y, zoneId) {this._clearAndHide();if (this.idPull["polygon_"+this.idPrefix+this.topId] == null)return false;window.clearTimeout(this.menuTimeoutHandler);this.idPull[this.idPrefix+this.topId] = new Array(x, y);this._showPolygon(this.idPrefix+this.topId, "bottom");this.callEvent("onContextMenu", [zoneId]);};dhtmlXMenuObject.prototype._hideContextMenu = function() {if (this.idPull["polygon_"+this.idPrefix+this.topId] == null)return false;this._clearAndHide();this._hidePolygon(this.idPrefix+this.topId);this.zInd = this.zIndInit;};dhtmlXMenuObject.prototype._doOnContextBeforeCall = function(e, cZone) {this.contextMenuZoneId = cZone.id;this._clearAndHide();this._hideContextMenu();var p = (e.srcElement||e.target);var px = (_isIE||_isOpera||_KHTMLrv?e.offsetX:e.layerX);var py = (_isIE||_isOpera||_KHTMLrv?e.offsetY:e.layerY);var mx = getAbsoluteLeft(p)+px;var my = getAbsoluteTop(p)+py;if (this.checkEvent("onBeforeContextMenu")) {if (this.callEvent("onBeforeContextMenu", [cZone.id])) {if (this.contextAutoShow){this._showContextMenu(mx, my);this.callEvent("onAfterContextMenu", [cZone.id]);}}}else {if (this.contextAutoShow){this._showContextMenu(mx, my);this.callEvent("onAfterContextMenu", [cZone.id]);}}};dhtmlXMenuObject.prototype.showContextMenu = function(x, y) {this._showContextMenu(x, y, false);};dhtmlXMenuObject.prototype.hideContextMenu = function() {this._hideContextMenu();};dhtmlXMenuObject.prototype._autoDetectVisibleArea = function() {if (this._isVisibleArea)return;this.menuX1 = document.body.scrollLeft;this.menuX2 = this.menuX1+(window.innerWidth||document.body.clientWidth);this.menuY1 = Math.max((_isIE?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop, document.body.scrollTop);this.menuY2 = this.menuY1+(_isIE?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0,document.body.clientHeight||0):window.innerHeight);};dhtmlXMenuObject.prototype.getItemPosition = function(id) {id = this.idPrefix+id;var pos = -1;if (this.itemPull[id] == null)return pos;var parent = this.itemPull[id]["parent"];var obj = (this.idPull["polygon_"+parent]!=null?this.idPull["polygon_"+parent].tbd:this.cont);for (var q=0;q<obj.childNodes.length;q++){if (obj.childNodes[q]==this.idPull["separator_"+id]||obj.childNodes[q]==this.idPull[id]){pos = q;}};return pos;};dhtmlXMenuObject.prototype.setItemPosition = function(id, pos) {id = this.idPrefix+id;if (this.idPull[id] == null){return;};var isOnTopLevel = (this.itemPull[id]["parent"] == this.idPrefix+this.topId);var itemData = this.idPull[id];var itemPos = this.getItemPosition(id.replace(this.idPrefix,""));var parent = this.itemPull[id]["parent"];var obj = (this.idPull["polygon_"+parent]!=null?this.idPull["polygon_"+parent].tbd:this.cont);obj.removeChild(obj.childNodes[itemPos]);if (pos < 0)pos = 0;if (isOnTopLevel && pos < 1){pos = 1;};if (pos < obj.childNodes.length){obj.insertBefore(itemData, obj.childNodes[pos]);}else {obj.appendChild(itemData);}};dhtmlXMenuObject.prototype.getParentId = function(id) {id = this.idPrefix+id;if (this.itemPull[id] == null){return null;};return ((this.itemPull[id]["parent"]!=null?this.itemPull[id]["parent"]:this.topId).replace(this.idPrefix,""));};dhtmlXMenuObject.prototype.addNewSibling = function(nextToId, itemId, itemText, disabled, imgEnabled, imgDisabled) {var id = this.idPrefix+(itemId!=null?itemId:this._genStr(24));var parentId = this.idPrefix+(nextToId!=null?this.getParentId(nextToId):this.topId);this._addItemIntoGlobalStrorage(id, parentId, itemText, "item", disabled, imgEnabled, imgDisabled);if ((parentId == this.idPrefix+this.topId)&& (!this.context)) {this._renderToplevelItem(id, this.getItemPosition(nextToId));}else {this._renderSublevelItem(id, this.getItemPosition(nextToId));}};dhtmlXMenuObject.prototype.addNewChild = function(parentId, pos, itemId, itemText, disabled, imgEnabled, imgDisabled) {if (parentId == null){if (this.context){parentId = this.topId;}else {this.addNewSibling(parentId, itemId, itemText, disabled, imgEnabled, imgDisabled);if (pos != null)this.setItemPosition(itemId, pos);return;}};itemId = this.idPrefix+(itemId!=null?itemId:this._genStr(24));if (this.setHotKey)this.setHotKey(parentId, "");parentId = this.idPrefix+parentId;this._addItemIntoGlobalStrorage(itemId, parentId, itemText, "item", disabled, imgEnabled, imgDisabled);if (this.idPull["polygon_"+parentId] == null){this._renderSublevelPolygon(parentId, parentId);};this._renderSublevelItem(itemId, pos-1);this._redefineComplexState(parentId);};dhtmlXMenuObject.prototype._addItemIntoGlobalStrorage = function(itemId, itemParentId, itemText, itemType, disabled, img, imgDis) {var item = {id: itemId,
 title: itemText,
 imgen: (img!=null?img:""),
 imgdis: (imgDis!=null?imgDis:""),
 type: itemType,
 state: (disabled==true?"disabled":"enabled"),
 parent: itemParentId,
 complex:false,
 hotkey: "",
 tip: ""};this.itemPull[item.id] = item;};dhtmlXMenuObject.prototype._addSubMenuPolygon = function(id, parentId) {var s = this._renderSublevelPolygon(id, parentId);var j = this._getMenuNodes(parentId);for (q=0;q<j.length;q++){if (this.itemPull[j[q]]["type"] == "separator"){this._renderSeparator(j[q], null);}else {this._renderSublevelItem(j[q], null);}};if (id == parentId){var level = "topLevel";}else {var level = "subLevel";};for (var q=0;q<j.length;q++){if (this.itemPull[j[q]]["complex"]){this._addSubMenuPolygon(id, this.itemPull[j[q]]["id"]);}}};dhtmlXMenuObject.prototype._renderSublevelPolygon = function(id, parentId) {var s = document.createElement("DIV");s.className = "dhtmlxMenu_"+this.skin+"_SubLevelArea_Polygon "+(this._rtl?"dir_right":"");s.dir = "ltr";s.oncontextmenu = function(e) {e = e||event;e.returnValue = false;e.cancelBubble = true;return false;};s.id = "polygon_" + parentId;s.onclick = function(e) {e = e || event;e.cancelBubble = true;};s.style.display = "none";document.body.insertBefore(s, document.body.firstChild);var tbl = document.createElement("TABLE");tbl.className = "dhtmlxMebu_SubLevelArea_Tbl";tbl.cellSpacing = 0;tbl.cellPadding = 0;tbl.border = 0;var tbd = document.createElement("TBODY");tbl.appendChild(tbd);s.appendChild(tbl);s.tbl = tbl;s.tbd = tbd;this.idPull[s.id] = s;if (this.sxDacProc != null){this.idPull["sxDac_" + parentId] = new this.sxDacProc(s, s.className);if (_isIE){this.idPull["sxDac_" + parentId]._setSpeed(this.dacSpeedIE);this.idPull["sxDac_" + parentId]._setCustomCycle(this.dacCyclesIE);}else {this.idPull["sxDac_" + parentId]._setSpeed(this.dacSpeed);this.idPull["sxDac_" + parentId]._setCustomCycle(this.dacCycles);}};return s;};dhtmlXMenuObject.prototype._renderSublevelItem = function(id, pos) {var main_self = this;var tr = document.createElement("TR");tr.className = (this.itemPull[id]["state"]=="enabled"?"sub_item":"sub_item_dis");var t1 = document.createElement("TD");t1.className = "sub_item_icon";var icon = this.itemPull[id][(this.itemPull[id]["state"]=="enabled"?"imgen":"imgdis")];if (icon != ""){var tp = this.itemPull[id]["type"];if (tp=="checkbox"||tp=="radio"){var img = document.createElement("DIV");img.id = "image_"+this.itemPull[id]["id"];img.className = "sub_icon "+icon;t1.appendChild(img);};if (!(tp=="checkbox"||tp=="radio")) {var img = document.createElement("IMG");img.id = "image_"+this.itemPull[id]["id"];img.className = "sub_icon";img.src = this.imagePath+icon;t1.appendChild(img);}};var t2 = document.createElement("TD");t2.className = "sub_item_text";if (this.itemPull[id]["title"] != ""){var t2t = document.createElement("DIV");t2t.className = "sub_item_text";t2t.innerHTML = this.itemPull[id]["title"];t2.appendChild(t2t);}else {t2.innerHTML = "&nbsp;";};var t3 = document.createElement("TD");t3.className = "sub_item_hk";if (this.itemPull[id]["complex"]){var arw = document.createElement("DIV");arw.className = "complex_arrow";arw.id = "arrow_"+this.itemPull[id]["id"];t3.appendChild(arw);}else {if (this.itemPull[id]["hotkey"].length > 0 && !this.itemPull[id]["complex"]){var t3t = document.createElement("DIV");t3t.className = "sub_item_hk";t3t.innerHTML = this.itemPull[id]["hotkey"];t3.appendChild(t3t);}else {t3.innerHTML = "&nbsp;";}};tr.appendChild(this._rtl?t3:t1);tr.appendChild(t2);tr.appendChild(this._rtl?t1:t3);tr.id = this.itemPull[id]["id"];tr.parent = this.itemPull[id]["parent"];if (this.itemPull[id]["tip"].length > 0)tr.title = this.itemPull[id]["tip"];tr.onselectstart = function(e) {e = e || event;e.returnValue = false;return false;};tr.onmouseover = function() {if (main_self.menuMode == "web")window.clearTimeout(main_self.menuTimeoutHandler);main_self._redistribSubLevelSelection(this.id, this.parent);};if (main_self.menuMode == "web"){tr.onmouseout = function() {window.clearTimeout(main_self.menuTimeoutHandler);main_self.menuTimeoutHandler = window.setTimeout(function(){main_self._clearAndHide();}, main_self.menuTimeoutMsec, "JavaScript");}};tr.onclick = function(e) {if (!main_self.checkEvent("onClick")&& main_self.itemPull[this.id]["complex"]) return;e = e || event;e.cancelBubble = true;e.returnValue = false;tc = (main_self.itemPull[this.id]["complex"]?"c":"-");td = (main_self.itemPull[this.id]["state"]=="enabled"?"-":"d");var cas = {"ctrl": e.ctrlKey, "alt": e.altKey, "shift": e.shiftKey};switch (main_self.itemPull[this.id]["type"]) {case "checkbox":
 main_self._checkboxOnClickHandler(this.id.replace(main_self.idPrefix, ""), tc+td+"n", cas);break;case "radio":
 main_self._radioOnClickHandler(this.id.replace(main_self.idPrefix, ""), tc+td+"n", cas);break;case "item":
 main_self._doOnClick(this.id.replace(main_self.idPrefix, ""), tc+td+"n", cas);break;};return false;};var polygon = this.idPull["polygon_"+this.itemPull[id]["parent"]];if (pos != null){pos++;if (pos < 0)pos = 0;if (pos > polygon.tbd.childNodes.length - 1)pos = null;};if (pos != null && polygon.tbd.childNodes[pos] != null)polygon.tbd.insertBefore(tr, polygon.tbd.childNodes[pos]);else polygon.tbd.appendChild(tr);this.idPull[tr.id] = tr;};dhtmlXMenuObject.prototype._renderSeparator = function(id, pos) {var level = (this.context?"SubLevelArea":(this.itemPull[id]["parent"]==this.idPrefix+this.topId?"TopLevel":"SubLevelArea"));if (level == "TopLevel" && this.context)return;var main_self = this;if (level != "TopLevel"){var tr = document.createElement("TR");tr.className = "sub_sep";var td = document.createElement("TD");td.colSpan = "3";tr.appendChild(td);};var k = document.createElement("DIV");k.id = "separator_"+id;k.className = (level=="TopLevel"?"top_sep":"sub_sep");k.onselectstart = function(e) {e = e || event;e.returnValue = false;};k.onclick = function(e) {e = e || event;e.cancelBubble = true;var cas = {"ctrl": e.ctrlKey, "alt": e.altKey, "shift": e.shiftKey};main_self._doOnClick(this.id.replace("separator_" + main_self.idPrefix, ""), "--s", cas);};if (level == "TopLevel"){if (pos != null){pos++;if (pos < 0){pos = 0;};if (this.cont.childNodes[pos] != null){this.cont.insertBefore(k, this.cont.childNodes[pos]);}else {this.cont.appendChild(k);}}else {var last = this.cont.childNodes[this.cont.childNodes.length-1];if (String(last).search("TopLevel_Text") == -1) {this.cont.appendChild(k);}else {this.cont.insertBefore(k, last);}};this.idPull[k.id] = k;}else {var polygon = this.idPull["polygon_"+this.itemPull[id]["parent"]];if (pos != null){pos++;if (pos < 0)pos = 0;if (pos > polygon.tbd.childNodes.length - 1)pos = null;};if (pos != null && polygon.tbd.childNodes[pos] != null)polygon.tbd.insertBefore(tr, polygon.tbd.childNodes[pos]);else polygon.tbd.appendChild(tr);td.appendChild(k);this.idPull[k.id] = tr;}};dhtmlXMenuObject.prototype.addNewSeparator = function(nextToId, itemId) {itemId = this.idPrefix+(itemId!=null?itemId:this._genStr(24));var parentId = this.idPrefix+this.getParentId(nextToId);this._addItemIntoGlobalStrorage(itemId, parentId, "", "separator", false, "", "");this._renderSeparator(itemId, this.getItemPosition(nextToId));};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);};dhtmlXMenuObject.prototype.unload = function() {if (_isIE){document.body.detachEvent("onclick", this._bodyClick);document.body.detachEvent("oncontextmenu", this._bodyContext);}else {window.removeEventListener("click", this._bodyClick, false);window.removeEventListener("contextmenu", this._bodyContext, false);};this._bodyClick = null;this._bodyContext = null;this.removeItem(this.idPrefix+this.topId, true);this.itemPull = null;this.idPull = null;if (this.context)for (var a in this.contextZones)this.removeContextZone(a);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.context)this.base.oncontextmenu = (this.base._oldContextMenuHandler||null);this.base.onselectstart = null;this.base = null;};this.setSkin = null;this.detachAllEvents();if (this._xmlLoader){this._xmlLoader.destructor();this._xmlLoader = null;};this._align = null;this._arrowFFFix = null;this._isIE6 = null;this._isInited = null;this._rtl = null;this._scrollDownTMStep = null;this._scrollDownTMTime = null;this._scrollUpTMStep = null;this._scrollUpTMTime = null;this._topLevelBottomMargin = null;this._topLevelOffsetLeft = null;this._topLevelBottomMargin = null;this._topLevelRightMargin = null;this.addBaseIdAsContextZone = null;this.context = null;this.contextAutoHide = null;this.contextAutoShow = null;this.contextHideAllMode = null;this.contextMenuZoneId = null;this.dLoad = null;this.dLoadSign = null;this.dLoadUrl = null;this.loaderIcon = null;this.fixedPosition = null;this.dirSubLevel = null;this.dirTopLevel = null;this.limit = null;this.menuSelected = null;this.menuLastClicked = null;this.idPrefix = null;this.imagePath = null;this.menuMode = null;this.menuModeTopLevelTimeout = null;this.menuModeTopLevelTimeoutTime = null;this.menuTimeoutHandler = null;this.menuTimeoutMsec = null;this.menuTouched = null;this.isDhtmlxMenuObject = null;this.itemHotKeyTagName = null;this.itemHrefTagName = null;this.itemTagName = null;this.itemTextTagName = null;this.itemTipTagName = null;this.userDataTagName = null;this.skin = null;this.topId = null;this.dacCycles = null;this.dacCyclesIE = null;this.dacSpeed = null;this.dacSpeedIE = null;this.zInd = null;this.zIndInit = null;this.zIndStep = null;this._enableDacSupport = null;this._selectedSubItems = null;this._openedPolygons = null;this._addSubItemToSelected = null;this._removeSubItemFromSelected = null;this._getSubItemToDeselectByPolygon = null;this._hidePolygon = null;this._showPolygon = null;this._redistribSubLevelSelection = null;this._doOnClick = null;this._doOnTouchMenu = null;this._searchMenuNode = null;this._getMenuNodes = null;this._genStr = null;this._clearAndHide = null;this._doOnLoad = null;this.getItemType = null;this.forEachItem = null;this.init = null;this.loadXML = null;this.loadXMLString = null;this._buildMenu = null;this._xmlParser = null;this._showSubLevelItem = null;this._hideSubLevelItem = null;this._countVisiblePolygonItems = null;this._redefineComplexState = null;this._updateItemComplexState = null;this._getItemLevelType = null;this._redistribTopLevelSelection = null;this._initTopLevelMenu = null;this._renderToplevelItem = null;this.setImagePath = null;this.setIconsPath = null;this.setIconPath = null;this._updateItemImage = null;this.removeItem = null;this._getAllParents = null;this.renderAsContextMenu = null;this.addContextZone = null;this.removeContextZone = null;this.isContextZone = null;this._isContextMenuVisible = null;this._showContextMenu = null;this._doOnContextBeforeCall = null;this._autoDetectVisibleArea = null;this._addItemIntoGlobalStrorage = null;this._addSubMenuPolygon = null;this._renderSublevelPolygon = null;this._renderSublevelItem = null;this._renderSeparator = null;this._hideContextMenu = null;this.clearAll = null;this.getItemPosition = null;this.setItemPosition = null;this.getParentId = null;this.addNewSibling = null;this.addNewChild = null;this.addNewSeparator = null;this.attachEvent = null;this.callEvent = null;this.checkEvent = null;this.eventCatcher = null;this.detachEvent = null;this.dhx_Event = null;this.unload = null;this.items = null;this.radio = null;this.detachAllEvents = null;this.hide = null;this.showContextMenu = null;this.hideContextMenu = null;this._changeItemState = null;this._changeItemVisible = null;this._updateLoaderIcon = null;this._clearAllSelectedSubItemsInPolygon = null;this._checkArrowsState = null;this._addUpArrow = null;this._addDownArrow = null;this._removeUpArrow = null;this._removeDownArrow = null;this._isArrowExists = null;this._doScrollUp = null;this._doScrollDown = null;this._countPolygonItems = null;this._getRadioImgObj = null;this._setRadioState = null;this._radioOnClickHandler = null;this._getCheckboxState = null;this._setCheckboxState = null;this._readLevel = null;this._updateCheckboxImage = null;this._checkboxOnClickHandler = null;this._removeArrow = null;this.setItemEnabled = null;this.setItemDisabled = null;this.isItemEnabled = null;this.getItemText = null;this.setItemText = null;this.loadFromHTML = null;this.hideItem = null;this.showItem = null;this.isItemHidden = null;this.setUserData = null;this.getUserData = null;this.setOpenMode = null;this.setWebModeTimeout = null;this.enableDynamicLoading = null;this.getItemImage = null;this.setItemImage = null;this.clearItemImage = null;this.setAutoShowMode = null;this.setAutoHideMode = null;this.setContextMenuHideAllMode = null;this.getContextMenuHideAllMode = null;this.setVisibleArea = null;this.setTooltip = null;this.getTooltip = null;this.setHotKey = null;this.getHotKey = null;this.setItemSelected = null;this.setTopText = null;this.setRTL = null;this.setAlign = null;this.setHref = null;this.clearHref = null;this.getCircuit = null;this.contextZones = null;this.setOverflowHeight = null;this.userData = null;this.getRadioChecked = null;this.setRadioChecked = null;this.addRadioButton = null;this.setCheckboxState = null;this.getCheckboxState = null;this.addCheckbox = null;this.serialize = null;this.extendedModule = null;dhtmlxMenuObjectLiveInstances[this._UID] = null;try {delete dhtmlxMenuObjectLiveInstances[this._UID];}catch(e) {};this._UID = null;};var dhtmlxMenuObjectLiveInstances = {};dhtmlXMenuObject.prototype.i18n = {dhxmenuextalert: "dhtmlxmenu_ext.js required"
};(function(){dhtmlx.extend_api("dhtmlXMenuObject",{_init:function(obj){return [obj.parent, obj.skin];},
 align:"setAlign",
 top_text:"setTopText",
 context:"renderAsContextMenu",
 icon_path:"setIconsPath",
 open_mode:"setOpenMode",
 rtl:"setRTL",
 skin:"setSkin",
 dynamic:"enableDynamicLoading",
 xml:"loadXML",
 items:"items",
 overflow:"setOverflowHeight"
 },{items:function(arr,parent){var pos = 100000;var lastItemId = null;for (var i=0;i < arr.length;i++){var item=arr[i];if (item.type == "separator"){this.addNewSeparator(lastItemId, pos, item.id);lastItemId = item.id;}else {this.addNewChild(parent, pos, item.id, item.text, item.disabled, item.img, item.img_disabled);lastItemId = item.id;if (item.items)this.items(item.items,item.id);}}}});})();dhtmlXMenuObject.prototype.extendedModule = "DHXMENUEXT";dhtmlXMenuObject.prototype.setItemEnabled = function(id) {this._changeItemState(id, "enabled", this._getItemLevelType(id));};dhtmlXMenuObject.prototype.setItemDisabled = function(id) {this._changeItemState(id, "disabled", this._getItemLevelType(id));};dhtmlXMenuObject.prototype.isItemEnabled = function(id) {return (this.itemPull[this.idPrefix+id]!=null?(this.itemPull[this.idPrefix+id]["state"]=="enabled"):false);};dhtmlXMenuObject.prototype._changeItemState = function(id, newState, levelType) {var t = false;var j = this.idPrefix + id;if ((this.itemPull[j] != null)&& (this.idPull[j] != null)) {if (this.itemPull[j]["state"] != newState){this.itemPull[j]["state"] = newState;if (this.itemPull[j]["parent"] == this.idPrefix+this.topId && !this.context){this.idPull[j].className = "dhtmlxMenu_"+this.skin+"_TopLevel_Item_"+(this.itemPull[j]["state"]=="enabled"?"Normal":"Disabled");}else {this.idPull[j].className = "sub_item"+(this.itemPull[j]["state"]=="enabled"?"":"_dis");};this._updateItemComplexState(this.idPrefix+id, this.itemPull[this.idPrefix+id]["complex"], false);this._updateItemImage(id, levelType);if ((this.idPrefix + this.menuLastClicked == j)&& (levelType != "TopLevel")) {this._redistribSubLevelSelection(j, this.itemPull[j]["parent"]);};if (levelType == "TopLevel" && !this.context){}}};return t;};dhtmlXMenuObject.prototype.getItemText = function(id) {return (this.itemPull[this.idPrefix+id]!=null?this.itemPull[this.idPrefix+id]["title"]:"");};dhtmlXMenuObject.prototype.setItemText = function(id, text) {id = this.idPrefix + id;if ((this.itemPull[id] != null)&& (this.idPull[id] != null)) {this._clearAndHide();this.itemPull[id]["title"] = text;if (this.itemPull[id]["parent"] == this.idPrefix+this.topId && !this.context){var tObj = null;for (var q=0;q<this.idPull[id].childNodes.length;q++){try {if (this.idPull[id].childNodes[q].className == "top_level_text")tObj = this.idPull[id].childNodes[q];}catch(e) {}};if (String(this.itemPull[id]["title"]).length == "" || this.itemPull[id]["title"] == null) {if (tObj != null)tObj.parentNode.removeChild(tObj);}else {if (!tObj){tObj = document.createElement("DIV");tObj.className = "top_level_text";if (this._rtl && this.idPull[id].childNodes.length > 0)this.idPull[id].insertBefore(tObj,this.idPull[id].childNodes[0]);else this.idPull[id].appendChild(tObj);};tObj.innerHTML = this.itemPull[id]["title"];}}else {var tObj = null;for (var q=0;q<this.idPull[id].childNodes[1].childNodes.length;q++){if (String(this.idPull[id].childNodes[1].childNodes[q].className||"")== "sub_item_text") tObj = this.idPull[id].childNodes[1].childNodes[q];};if (String(this.itemPull[id]["title"]).length == "" || this.itemPull[id]["title"] == null) {if (tObj){tObj.parentNode.removeChild(tObj);tObj = null;this.idPull[id].childNodes[1].innerHTML = "&nbsp;";}}else {if (!tObj){tObj = document.createElement("DIV");tObj.className = "sub_item_text";this.idPull[id].childNodes[1].innerHTML = "";this.idPull[id].childNodes[1].appendChild(tObj);};tObj.innerHTML = this.itemPull[id]["title"];}}}};dhtmlXMenuObject.prototype.loadFromHTML = function(objId, clearAfterAdd, onLoadFunction) {this.itemTagName = "DIV";if (typeof(objId)== "string") {objId = document.getElementById(objId);};this._buildMenu(objId, null);this.init();if (clearAfterAdd){objId.parentNode.removeChild(objId);};if (onLoadFunction != null){onLoadFunction();}};dhtmlXMenuObject.prototype.hideItem = function(id) {this._changeItemVisible(id, false);};dhtmlXMenuObject.prototype.showItem = function(id) {this._changeItemVisible(id, true);};dhtmlXMenuObject.prototype.isItemHidden = function(id) {var isHidden = null;if (this.idPull[this.idPrefix+id] != null){isHidden = (this.idPull[this.idPrefix+id].style.display == "none");};return isHidden;};dhtmlXMenuObject.prototype._changeItemVisible = function(id, visible) {itemId = this.idPrefix+id;if (this.itemPull[itemId] == null)return;if (this.itemPull[itemId]["type"] == "separator"){itemId = "separator_"+itemId;};if (this.idPull[itemId] == null)return;this.idPull[itemId].style.display = (visible?"":"none");this._redefineComplexState(this.itemPull[this.idPrefix+id]["parent"]);};dhtmlXMenuObject.prototype.setUserData = function(id, name, value) {this.userData[this.idPrefix+id+"_"+name] = value;};dhtmlXMenuObject.prototype.getUserData = function(id, name) {return (this.userData[this.idPrefix+id+"_"+name]!=null?this.userData[this.idPrefix+id+"_"+name]:null);};dhtmlXMenuObject.prototype.setOpenMode = function(mode) {if (mode == "win" || mode == "web")this.menuMode = mode;else this.menuMode == "web";};dhtmlXMenuObject.prototype.setWebModeTimeout = function(tm) {this.menuTimeoutMsec = (!isNaN(tm)?tm:400);};dhtmlXMenuObject.prototype.enableDynamicLoading = function(url, icon) {this.dLoad = true;this.dLoadUrl = url;this.dLoadSign = (String(this.dLoadUrl).search(/\?/)==-1?"?":"&");this.loaderIcon = icon;this.init();};dhtmlXMenuObject.prototype._updateLoaderIcon = function(id, state) {if (this.idPull[id] == null)return;if (String(this.idPull[id].className).search("TopLevel_Item") >= 0) return;var ind = (this._rtl?0:2);if (!this.idPull[id].childNodes[ind])return;if (!this.idPull[id].childNodes[ind].childNodes[0])return;var aNode = this.idPull[id].childNodes[ind].childNodes[0];if (String(aNode.className).search("complex_arrow") === 0) aNode.className = "complex_arrow"+(state?"_loading":"");};dhtmlXMenuObject.prototype.getItemImage = function(id) {var imgs = new Array(null, null);id = this.idPrefix+id;if (this.itemPull[id]["type"] == "item"){imgs[0] = this.itemPull[id]["imgen"];imgs[1] = this.itemPull[id]["imgdis"];};return imgs;};dhtmlXMenuObject.prototype.setItemImage = function(id, img, imgDis) {if (this.itemPull[this.idPrefix+id]["type"] != "item")return;this.itemPull[this.idPrefix+id]["imgen"] = img;this.itemPull[this.idPrefix+id]["imgdis"] = imgDis;this._updateItemImage(id, this._getItemLevelType(id));};dhtmlXMenuObject.prototype.clearItemImage = function(id) {this.setItemImage(id, "", "");};dhtmlXMenuObject.prototype.setAutoShowMode = function(mode) {this.contextAutoShow = (mode==true?true:false);};dhtmlXMenuObject.prototype.setAutoHideMode = function(mode) {this.contextAutoHide = (mode==true?true:false);};dhtmlXMenuObject.prototype.setContextMenuHideAllMode = function(mode) {this.contextHideAllMode = (mode==true?true:false);};dhtmlXMenuObject.prototype.getContextMenuHideAllMode = function() {return this.contextHideAllMode;};dhtmlXMenuObject.prototype.setVisibleArea = function(x1, x2, y1, y2) {this._isVisibleArea = true;this.menuX1 = x1;this.menuX2 = x2;this.menuY1 = y1;this.menuY2 = y2;};dhtmlXMenuObject.prototype.setTooltip = function(id, tip) {id = this.idPrefix+id;if (!(this.itemPull[id] != null && this.idPull[id] != null)) return;this.idPull[id].title = (tip.length > 0 ? tip : null);this.itemPull[id]["tip"] = tip;};dhtmlXMenuObject.prototype.getTooltip = function(id) {if (this.itemPull[this.idPrefix+id] == null)return null;return this.itemPull[this.idPrefix+id]["tip"];};dhtmlXMenuObject.prototype.setHotKey = function(id, hkey) {id = this.idPrefix+id;if (!(this.itemPull[id] != null && this.idPull[id] != null)) return;if (this.itemPull[id]["parent"] == this.idPrefix+this.topId && !this.context)return;if (this.itemPull[id]["complex"])return;if (this.itemPull[id]["type"] != "item")return;var hkObj = null;try {if (this.idPull[id].childNodes[this._rtl?0:2].childNodes[0].className == "sub_item_hk")hkObj = this.idPull[id].childNodes[this._rtl?0:2].childNodes[0];}catch(e){};if (hkey.length == 0){this.itemPull[id]["hotkey_backup"] = this.itemPull[id]["hotkey"];this.itemPull[id]["hotkey"] = "";if (hkObj != null)hkObj.parentNode.removeChild(hkObj);}else {this.itemPull[id]["hotkey"] = hkey;this.itemPull[id]["hotkey_backup"] = null;if (hkObj == null){hkObj = document.createElement("DIV");hkObj.className = "sub_item_hk";var item = this.idPull[id].childNodes[this._rtl?0:2];while (item.childNodes.length > 0)item.removeChild(item.childNodes[0]);item.appendChild(hkObj);};hkObj.innerHTML = hkey;}};dhtmlXMenuObject.prototype.getHotKey = function(id) {if (this.itemPull[this.idPrefix+id] == null)return null;return this.itemPull[this.idPrefix+id]["hotkey"];};dhtmlXMenuObject.prototype.setItemSelected = function(id) {if (this.itemPull[this.idPrefix+id] == null)return null;};dhtmlXMenuObject.prototype.setTopText = function(text) {if (this.context)return;if (this._topText == null){this._topText = document.createElement("DIV");this._topText.className = "dhtmlxMenu_TopLevel_Text_"+(this._rtl?"left":(this._align=="left"?"right":"left"));this.base.appendChild(this._topText);};this._topText.innerHTML = text;};dhtmlXMenuObject.prototype.setAlign = function(align) {if (this._align == align)return;if (align == "left" || align == "right"){this._align = align;if (this.cont)this.cont.className = (this._align=="right"?"align_right":"align_left");if (this._topText != null)this._topText.className = "dhtmlxMenu_TopLevel_Text_"+(this._align=="left"?"right":"left");}};dhtmlXMenuObject.prototype.setHref = function(itemId, href, target) {if (this.itemPull[this.idPrefix+itemId] == null)return;this.itemPull[this.idPrefix+itemId]["href_link"] = href;if (target != null)this.itemPull[this.idPrefix+itemId]["href_target"] = target;};dhtmlXMenuObject.prototype.clearHref = function(itemId) {if (this.itemPull[this.idPrefix+itemId] == null)return;delete this.itemPull[this.idPrefix+itemId]["href_link"];delete this.itemPull[this.idPrefix+itemId]["href_target"];};dhtmlXMenuObject.prototype.getCircuit = function(id) {var parents = new Array(id);while (this.getParentId(id)!= this.topId) {id = this.getParentId(id);parents[parents.length] = id;};return parents.reverse();};dhtmlXMenuObject.prototype._clearAllSelectedSubItemsInPolygon = function(polygon) {var subIds = this._getSubItemToDeselectByPolygon(polygon);for (var q=0;q<this._openedPolygons.length;q++){if (this._openedPolygons[q] != polygon){this._hidePolygon(this._openedPolygons[q]);}};for (var q=0;q<subIds.length;q++){if (this.idPull[subIds[q]] != null){if (this.itemPull[subIds[q]]["state"] == "enabled"){this.idPull[subIds[q]].className = "dhtmlxMenu_"+this.skin+"_SubLevelArea_Item_Normal";}}}};dhtmlXMenuObject.prototype._checkArrowsState = function(id) {var polygon = this.idPull["polygon_"+id];var arrowUp = this.idPull["arrowup_"+id];var arrowDown = this.idPull["arrowdown_"+id];if (polygon.scrollTop == 0){arrowUp.className = "dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowUp_Disabled";}else {arrowUp.className = "dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowUp" + (arrowUp.over ? "_Over" : "");};if (polygon.scrollTop + polygon.offsetHeight < polygon.scrollHeight){arrowDown.className = "dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowDown" + (arrowDown.over ? "_Over" : "");}else {arrowDown.className = "dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowDown_Disabled";}};dhtmlXMenuObject.prototype._addUpArrow = function(id) {var main_self = this;var arrow = document.createElement("DIV");arrow.pId = this.idPrefix+id;arrow.id = "arrowup_"+this.idPrefix+id;arrow.className = "dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowUp";arrow.innerHTML = "<div class='dhtmlxMenu_"+this.skin+"_SubLevelArea_Arrow'><div class='dhtmlxMenu_SubLevelArea_Arrow_Icon'></div></div>";arrow.style.display = "none";arrow.over = false;arrow.onselectstart = function(e) {e = e||event;e.returnValue = false;return false;};arrow.oncontextmenu = function(e) {e = e||event;e.returnValue = false;return false;};arrow.onmouseover = function() {if (main_self.menuMode == "web"){window.clearTimeout(main_self.menuTimeoutHandler);};main_self._clearAllSelectedSubItemsInPolygon(this.pId);if (this.className == "dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowUp_Disabled")return;this.className = "dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowUp_Over";this.over = true;main_self._canScrollUp = true;main_self._doScrollUp(this.pId, true);};arrow.onmouseout = function() {if (main_self.menuMode == "web"){window.clearTimeout(main_self.menuTimeoutHandler);main_self.menuTimeoutHandler = window.setTimeout(function(){main_self._clearAndHide();}, main_self.menuTimeoutMsec, "JavaScript");};this.over = false;main_self._canScrollUp = false;if (this.className == "dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowUp_Disabled")return;this.className = "dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowUp";window.clearTimeout(main_self._scrollUpTM);};arrow.onclick = function(e) {e = e||event;e.returnValue = false;e.cancelBubble = true;return false;};document.body.insertBefore(arrow, document.body.firstChild);this.idPull[arrow.id] = arrow;};dhtmlXMenuObject.prototype._addDownArrow = function(id) {var main_self = this;var arrow = document.createElement("DIV");arrow.pId = this.idPrefix+id;arrow.id = "arrowdown_"+this.idPrefix+id;arrow.className = "dhtmlxMenu_"+this.skin+"_SubLevelArea_ArrowDown";arrow.innerHTML = "<div class='dhtmlxMenu_"+this.skin+"_SubLevelArea_Arrow'><div class='dhtmlxMenu_SubLevelArea_Arrow_Icon'></div></div>";arrow.style.display = "none";arrow.over = false;arrow.onselectstart = function(e) {e = e||event;e.returnValue = false;return false;};arrow.oncontextmenu = function(e) {e = e||event;e.returnValue = false;return false;};arrow.onmouseover = function() {if (main_self.menuMode == "web"){window.clearTimeout(main_self.menuTimeoutHandler);};main_self._clearAllSelectedSubItemsInPolygon(this.pId);if (this.className == "dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowDown_Disabled")return;this.className = "dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowDown_Over";this.over = true;main_self._canScrollDown = true;main_self._doScrollDown(this.pId, true);};arrow.onmouseout = function() {if (main_self.menuMode == "web"){window.clearTimeout(main_self.menuTimeoutHandler);main_self.menuTimeoutHandler = window.setTimeout(function(){main_self._clearAndHide();}, main_self.menuTimeoutMsec, "JavaScript");};this.over = false;main_self._canScrollDown = false;if (this.className == "dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowDown_Disabled")return;this.className = "dhtmlxMenu_"+main_self.skin+"_SubLevelArea_ArrowDown";window.clearTimeout(main_self._scrollDownTM);};arrow.onclick = function(e) {e = e||event;e.returnValue = false;e.cancelBubble = true;return false;};document.body.insertBefore(arrow, document.body.firstChild);this.idPull[arrow.id] = arrow;};dhtmlXMenuObject.prototype._removeUpArrow = function(id) {var fullId = "arrowup_"+this.idPrefix+id;this._removeArrow(fullId);};dhtmlXMenuObject.prototype._removeDownArrow = function(id) {var fullId = "arrowdown_"+this.idPrefix+id;this._removeArrow(fullId);};dhtmlXMenuObject.prototype._removeArrow = function(fullId) {var arrow = this.idPull[fullId];arrow.onselectstart = null;arrow.oncontextmenu = null;arrow.onmouseover = null;arrow.onmouseout = null;arrow.onclick = null;if (arrow.parentNode)arrow.parentNode.removeChild(arrow);arrow = null;this.idPull[fullId] = null;try {delete this.idPull[fullId];}catch(e) {}};dhtmlXMenuObject.prototype._isArrowExists = function(id) {if (this.idPull["arrowup_"+id] != null && this.idPull["arrowdown_"+id] != null)return true;return false;};dhtmlXMenuObject.prototype._doScrollUp = function(id, checkArrows) {var polygon = this.idPull["polygon_"+id];if (this._canScrollUp && polygon.scrollTop > 0){var theEnd = false;var nextScrollTop = polygon.scrollTop - this._scrollUpTMStep;if (nextScrollTop < 0){theEnd = true;nextScrollTop = 0;};polygon.scrollTop = nextScrollTop;if (!theEnd){var that = this;this._scrollUpTM = window.setTimeout(function() {that._doScrollUp(id, false);}, this._scrollUpTMTime);}}else {this._canScrollUp = false;this._checkArrowsState(id);};if (checkArrows){this._checkArrowsState(id);}};dhtmlXMenuObject.prototype._doScrollDown = function(id, checkArrows) {var polygon = this.idPull["polygon_"+id];if (this._canScrollDown && polygon.scrollTop + polygon.offsetHeight <= polygon.scrollHeight){var theEnd = false;var nextScrollTop = polygon.scrollTop + this._scrollDownTMStep;if (nextScrollTop + polygon.offsetHeight > polygon.scollHeight){theEnd = true;nextScrollTop = polygon.scollHeight - polygon.offsetHeight;};polygon.scrollTop = nextScrollTop;if (!theEnd){var that = this;this._scrollDownTM = window.setTimeout(function() {that._doScrollDown(id, false);}, this._scrollDownTMTime);}}else {this._canScrollDown
 this._checkArrowsState(id);};if (checkArrows){this._checkArrowsState(id);}};dhtmlXMenuObject.prototype._countPolygonItems = function(id) {var count = 0;for (var a in this.itemPull){var par = this.itemPull[a]["parent"];var tp = this.itemPull[a]["type"];if (par == this.idPrefix+id && (tp == "item" || tp == "radio" || tp == "checkbox")) {count++;}};return count;};dhtmlXMenuObject.prototype.setOverflowHeight = function(itemsNum) {if (this.limit == 0 && itemsNum <= 0)return;this._clearAndHide();if (this.limit >= 0 && itemsNum > 0){this.limit = itemsNum;return;};if (this.limit > 0 && itemsNum <= 0){for (var a in this.itemPull){if (this._isArrowExists(a)) {var b = String(a).replace(this.idPrefix, "");this._removeUpArrow(b);this._removeDownArrow(b);this.idPull["polygon_"+a].style.height = "";}};this.limit = 0;return;}};dhtmlXMenuObject.prototype._getRadioImgObj = function(id) {try {var imgObj = this.idPull[this.idPrefix+id].childNodes[(this._rtl?2:0)].childNodes[0] }catch(e) {var imgObj = null;};return imgObj;};dhtmlXMenuObject.prototype._setRadioState = function(id, state) {var imgObj = this._getRadioImgObj(id);if (imgObj != null){var rObj = this.itemPull[this.idPrefix+id];rObj["checked"] = state;rObj["imgen"] = "rdbt_"+(rObj["checked"]?"1":"0");rObj["imgdis"] = rObj["imgen"];imgObj.className = "sub_icon "+rObj["imgen"];}};dhtmlXMenuObject.prototype._radioOnClickHandler = function(id, type, casState) {if (type.charAt(1)=="d" || this.itemPull[this.idPrefix+id]["group"]==null) return;var group = this.itemPull[this.idPrefix+id]["group"];if (this.checkEvent("onRadioClick")) {if (this.callEvent("onRadioClick", [group, this.getRadioChecked(group), id, this.contextMenuZoneId, casState])) {this.setRadioChecked(group, id);}}else {this.setRadioChecked(group, id);};if (this.checkEvent("onClick")) this.callEvent("onClick", [id]);};dhtmlXMenuObject.prototype.getRadioChecked = function(group) {var id = null;for (var q=0;q<this.radio[group].length;q++){var itemId = this.radio[group][q].replace(this.idPrefix, "");var imgObj = this._getRadioImgObj(itemId);if (imgObj != null){var checked = (imgObj.className).match(/rdbt_1$/gi);if (checked != null)id = itemId;}};return id;};dhtmlXMenuObject.prototype.setRadioChecked = function(group, id) {if (this.radio[group] == null)return;for (var q=0;q<this.radio[group].length;q++){var itemId = this.radio[group][q].replace(this.idPrefix, "");this._setRadioState(itemId, (itemId==id));}};dhtmlXMenuObject.prototype.addRadioButton = function(mode, nextToId, pos, itemId, itemText, group, state, disabled) {if (this.context && nextToId == this.topId){}else {if (this.itemPull[this.idPrefix+nextToId] == null)return;if (mode == "child" && this.itemPull[this.idPrefix+nextToId]["type"] != "item")return;};var id = this.idPrefix+(itemId!=null?itemId:this._genStr(24));var img = "rdbt_"+(state?"1":"0");var imgDis = img;if (mode == "sibling"){var parentId = this.idPrefix+this.getParentId(nextToId);this._addItemIntoGlobalStrorage(id, parentId, itemText, "radio", disabled, img, imgDis);this._renderSublevelItem(id, this.getItemPosition(nextToId));}else {var parentId = this.idPrefix+nextToId;this._addItemIntoGlobalStrorage(id, parentId, itemText, "radio", disabled, img, imgDis);if (this.idPull["polygon_"+parentId] == null){this._renderSublevelPolygon(parentId, parentId);};this._renderSublevelItem(id, pos-1);this._redefineComplexState(parentId);};var gr = (group!=null?group:this._genStr(24));this.itemPull[id]["group"] = gr;if (this.radio[gr]==null){this.radio[gr] = new Array();};this.radio[gr][this.radio[gr].length] = id;if (state == true)this.setRadioChecked(gr, String(id).replace(this.idPrefix, ""));};dhtmlXMenuObject.prototype._getCheckboxState = function(id) {if (this.itemPull[this.idPrefix+id] == null)return null;return this.itemPull[this.idPrefix+id]["checked"];};dhtmlXMenuObject.prototype._setCheckboxState = function(id, state) {if (this.itemPull[this.idPrefix+id] == null)return;this.itemPull[this.idPrefix+id]["checked"] = state;};dhtmlXMenuObject.prototype._updateCheckboxImage = function(id) {if (this.idPull[this.idPrefix+id] == null)return;this.itemPull[this.idPrefix+id]["imgen"] = "chbx_"+(this._getCheckboxState(id)?"1":"0");this.itemPull[this.idPrefix+id]["imgdis"] = this.itemPull[this.idPrefix+id]["imgen"];try {this.idPull[this.idPrefix+id].childNodes[(this._rtl?2:0)].childNodes[0].className = "sub_icon "+this.itemPull[this.idPrefix+id]["imgen"];}catch(e){}};dhtmlXMenuObject.prototype._checkboxOnClickHandler = function(id, type, casState) {if (type.charAt(1)=="d") return;if (this.itemPull[this.idPrefix+id] == null)return;var state = this._getCheckboxState(id);if (this.checkEvent("onCheckboxClick")) {if (this.callEvent("onCheckboxClick", [id, state, this.contextMenuZoneId, casState])) {this.setCheckboxState(id, !state);}}else {this.setCheckboxState(id, !state);};if (this.checkEvent("onClick")) this.callEvent("onClick", [id]);};dhtmlXMenuObject.prototype.setCheckboxState = function(id, state) {this._setCheckboxState(id, state);this._updateCheckboxImage(id);};dhtmlXMenuObject.prototype.getCheckboxState = function(id) {return this._getCheckboxState(id);};dhtmlXMenuObject.prototype.addCheckbox = function(mode, nextToId, pos, itemId, itemText, state, disabled) {if (this.context && nextToId == this.topId){}else {if (this.itemPull[this.idPrefix+nextToId] == null)return;if (mode == "child" && this.itemPull[this.idPrefix+nextToId]["type"] != "item")return;};var img = "chbx_"+(state?"1":"0");var imgDis = img;if (mode == "sibling"){var id = this.idPrefix+(itemId!=null?itemId:this._genStr(24));var parentId = this.idPrefix+this.getParentId(nextToId);this._addItemIntoGlobalStrorage(id, parentId, itemText, "checkbox", disabled, img, imgDis);this.itemPull[id]["checked"] = state;this._renderSublevelItem(id, this.getItemPosition(nextToId));}else {var id = this.idPrefix+(itemId!=null?itemId:this._genStr(24));var parentId = this.idPrefix+nextToId;this._addItemIntoGlobalStrorage(id, parentId, itemText, "checkbox", disabled, img, imgDis);this.itemPull[id]["checked"] = state;if (this.idPull["polygon_"+parentId] == null){this._renderSublevelPolygon(parentId, parentId);};this._renderSublevelItem(id, pos-1);this._redefineComplexState(parentId);}};dhtmlXMenuObject.prototype._readLevel = function(parentId) {var xml = "";for (var a in this.itemPull){if (this.itemPull[a]["parent"] == parentId){var imgEn = "";var imgDis = "";var hotKey = "";var itemId = String(this.itemPull[a]["id"]).replace(this.idPrefix,"");var itemType = "";var itemText = (this.itemPull[a]["title"]!=""?' text="'+this.itemPull[a]["title"]+'"':"");var itemState = "";if (this.itemPull[a]["type"] == "item"){if (this.itemPull[a]["imgen"] != "")imgEn = ' img="'+this.itemPull[a]["imgen"]+'"';if (this.itemPull[a]["imgdis"] != "")imgDis = ' imgdis="'+this.itemPull[a]["imgdis"]+'"';if (this.itemPull[a]["hotkey"] != "")hotKey = '<hotkey>'+this.itemPull[a]["hotkey"]+'</hotkey>';};if (this.itemPull[a]["type"] == "separator"){itemType = ' type="separator"';}else {if (this.itemPull[a]["state"] == "disabled")itemState = ' enabled="false"';};if (this.itemPull[a]["type"] == "checkbox"){itemType = ' type="checkbox"'+(this.itemPull[a]["checked"]?' checked="true"':"");};if (this.itemPull[a]["type"] == "radio"){itemType = ' type="radio" group="'+this.itemPull[a]["group"]+'" '+(this.itemPull[a]["checked"]?' checked="true"':"");};xml += "<item id='"+itemId+"'"+itemText+itemType+imgEn+imgDis+itemState+">";xml += hotKey;if (this.itemPull[a]["complex"])xml += this._readLevel(a);xml += "</item>";}};return xml;};dhtmlXMenuObject.prototype.serialize = function() {var xml = "<menu>"+this._readLevel(this.idPrefix+this.topId)+"</menu>";return xml;};function dhtmlxSlider(base,size,skin,vertical,min,max,value,step){if (_isIE)try {document.execCommand("BackgroundImageCache", false, true);}catch (e){};var parentNod;if (base && typeof(base)=="object" && !base.nodeName){parentNod=base.parent;skin=base.skin;min=base.min;max=base.max
 step=base.step
 vertical=base.vertical
 value=base.value;size=base.size;};if (!base){var z="slider_div_"+(new Date()).valueOf()+Math.random(1000);parentNod = document.createElement ("div");parentNod.setAttribute ("id", z);var child = document.body.lastChild;while (child.lastChild && child.lastChild.nodeType == 1)child=child.lastChild;child.parentNode.insertBefore(parentNod,child);}else if (typeof(base)!="object")
 parentNod=document.getElementById(base);else
 parentNod = base;if (typeof(size)=="object"){skin=size.skin;min=size.min;max=size.max
 step=size.step
 vertical=size.vertical
 value=size.value;size=size.size;};this.size = size;this.vMode=vertical||false;this.skin = dhtmlx.skin || skin || "default";this.parent = parentNod;this.isInit = false;this.disabled = false;this.value = value || min || 0;this.inputPriority = true;this.stepping = false;this.imgURL = window.dhx_globalImgPath||dhtmlx.image_path||"";this._skinsImgs = 
 {"default": {ls:1,lz:1,rz:1,rs:1},
 ball: {ls:1,lz:1,rz:1,rs:1},
 zipper: {bg:1,lz:1,rz:1},
 arrow: {bg:1,ls:1,rs:1},
 arrowgreen: {bg:1,ls:1,rs:1},
 simplesilver:{lz:1,ls:1,rs:1,rz:1},
 simplegray: {lz:1,ls:1,rs:1,rz:1},
 bar: {bg:1,ls:1,rs:1},
 dhx_skyblue: {bg:1,ls:1,rs:1}};this._def = [min-0||0,max-0||100,step-0||1,value-0||0,size-0];dhtmlxEventable(this);return this;};dhtmlxSlider.prototype.createStructure = function(){if (this.con){this.con.parentNode.removeChild(this.con);this.con = null;};if (this.vMode){this._sW="height";this._sH="width";this._sL="top";this._sT="left";var skinImgPath = this.imgURL+"skins/"+this.skin+"/vertical/";}else {this._sW="width";this._sH="height";this._sL="left";this._sT="top";var skinImgPath = this.imgURL+"skins/"+this.skin+"/";};this.con=document.createElement("DIV");this.con.onselectstart=function(){return false;};this.con._etype="slider";this.con.className = "dhtmlxSlider" + (this.skin!='default'?"_"+this.skin:"");if (this._skinsImgs[this.skin]['bg'])this.con.style.backgroundImage = "url("+skinImgPath+"bg.gif)";this.drag=document.createElement("DIV");this.drag._etype="drag";this.drag.className = "selector";this.drag.style.backgroundImage = "url("+skinImgPath+"selector.gif)";var leftSide = document.createElement("DIV");leftSide.className = "leftSide";if (this._skinsImgs[this.skin]['ls'])leftSide.style.background = "url("+skinImgPath+"leftside_bg.gif)";this.leftZone = document.createElement("DIV");this.leftZone.className = "leftZone";if (this._skinsImgs[this.skin]['lz'])this.leftZone.style.background = "url("+skinImgPath+"leftzone_bg.gif)";this.leftZone.style.width = this.value + 'px';var rightSide = document.createElement("DIV");rightSide.className = "rightSide";if (this._skinsImgs[this.skin]['rs'])rightSide.style.background = "url("+skinImgPath+"rightside_bg.gif)";this.rightZone = document.createElement("DIV");this.rightZone.className = "rightZone";if (this._skinsImgs[this.skin]['rz'])this.rightZone.style.background = "url("+skinImgPath+"rightzone_bg.gif)";this.con.appendChild(leftSide);this.con.appendChild(this.leftZone);this.con.appendChild(this.rightZone);this.con.appendChild(rightSide);this.con.appendChild(this.drag);this.parent.appendChild(this.con);if (!this.parent.parentNode || !this.parent.parentNode.tagName)document.body.appendChild(this.parent);if (this.vMode){this._sW="height";this._sH="width";this._sL="top";this._sT="left";this.con.style.width = this.con.offsetHeight + 'px';for (var i=0;i<this.con.childNodes.length;i++){this.con.childNodes[i].style.fontSize = "0";var tmp = this.con.childNodes[i].offsetWidth;this.con.childNodes[i].style.width = this.con.childNodes[i].offsetHeight + 'px';this.con.childNodes[i].style.height = tmp + 'px';tmp = this.con.childNodes[i].offsetLeft;this.con.childNodes[i].style.left = this.con.childNodes[i].offsetTop + 'px';this.con.childNodes[i].style.top = tmp + 'px';};rightSide.style.top = this.size - rightSide.offsetHeight + 'px';this.zoneSize = this.size - rightSide.offsetHeight;this.dragLeft = this.drag.offsetTop;this.dragWidth = this.drag.offsetHeight;this.rightZone.style.height = this.zoneSize + 'px';}else {this.zoneSize = this.size - rightSide.offsetWidth;this.dragLeft = this.drag.offsetLeft;this.dragWidth = this.drag.offsetWidth;this.rightZone.style.width = this.zoneSize + 'px';};this.con.style[this._sW] = this.size+"px";this.con.onmousedown=this._onMouseDown;this.con.onmouseup = this.con.onmouseout = function () {clearInterval (this.that._int)};this.con.that = this;this._aCalc(this._def);};dhtmlxSlider.prototype._aCalc=function(def){if (!this.isInit)return;this.shift=def[0];this.limit=def[1]-this.shift;this._mod=(def[4]-this.dragLeft*2-this.dragWidth)/this.limit;this._step=def[2];this.step=this._step*this._mod;this._xlimit=def[4]-this.dragLeft*2-this.dragWidth;if (!this.posX){this.posX=this._xlimit*(def[3]-this.shift)/this.limit;};this._applyPos(true);return this;};dhtmlxSlider.prototype.setMin=function(val){this._def[0] = val-0;this._aCalc(this._def);};dhtmlxSlider.prototype.setMax=function(val){this._def[1] = val-0;this._aCalc(this._def);};dhtmlxSlider.prototype.setStep=function(val){this._def[2] = val-0;this._aCalc(this._def);};dhtmlxSlider.prototype._applyPos=function(skip){if (!this.isInit)return;if (this.step!=1)this.posX=Math.round(this.posX/this.step)*this.step;if (this.posX<0)this.posX=0;if (this.value < (this._def[0] || 0))
 this.value = this._def[0] || 0;if (this.value > this._def[1])this.value = this._def[1];if (this.posX>this._xlimit)this.posX=this._xlimit;var a_old=this.drag.style[this._sL];this.drag.style[this._sL]=this.posX+this.dragLeft*1+"px";this.leftZone.style[this._sW]=this.posX+this.dragLeft*1+"px";this.rightZone.style[this._sL]=this.posX+this.dragLeft*1+1+"px";this.rightZone.style[this._sW]=this.zoneSize-(this.posX+this.dragLeft*1)+"px";var nw=this.getValue();if (this._link){if (this._linkBoth)this._link.value=nw;else
 this._link.innerHTML=nw;};if (!skip&&a_old!=this.drag.style[this._sL])this.callEvent("onChange",[nw,this]);this.value = this.getValue ();if(!this._dttp)this._setTooltip(nw);};dhtmlxSlider.prototype._setTooltip=function(nw){this.con.title=nw;};dhtmlxSlider.prototype.setSkin=function(skin) {this.skin = skin||"default";if (this.isInit)this.createStructure();};dhtmlxSlider.prototype.startDrag = function(e) {if (this._busy)return;if ((e.button === 0)|| (e.button === 1)) {this.drag_mx = e.clientX;this.drag_my = e.clientY;this.drag_cx = this.posX;this.d_b_move = document.body.onmousemove;this.d_b_up = document.body.onmouseup;var _c=this;document.body.onmouseup = function(e){_c.stopDrag(e||event);_c=null;};document.body.onmousemove = function (e) {_c.onDrag(e||event);};this._busy=true;}};dhtmlxSlider.prototype.onDrag = function(e) {if (this._busy){if (!this.vMode)this.posX = this.drag_cx + e.clientX - this.drag_mx;else
 this.posX = this.drag_cx + e.clientY - this.drag_my;this._applyPos();}};dhtmlxSlider.prototype.stopDrag = function(e) {document.body.onmousemove = this.d_b_move?this.d_b_move:null;document.body.onmouseup = this.d_b_up?this.d_b_up:null;this.d_b_move=this.d_b_up=null;this._busy=false;this.callEvent("onSlideEnd",[this.getValue()])
};dhtmlxSlider.prototype.getValue=function(){if ((!this._busy)&& (this.inputPriority))
 return (Math.round (this.value / this._step) * this._step).toFixed(6)-0;return Math.round((Math.round((this.posX/this._mod)/this._step)*this._step+this.shift*1)*10000)/10000;};dhtmlxSlider.prototype.setValue=function(val, skip){if (isNaN(val)) return;this._def[3] = this.value = val-0;this.posX=(Math.round(((val||0)-this.shift)*this._mod))
 this._applyPos(skip==null?true:skip);};dhtmlxSlider.prototype._getActionElement=function(nod){if (nod._etype)return nod;if (nod.parentNode)return this._getActionElement(nod.parentNode);return null;};dhtmlxSlider.prototype._onMouseDown=function(e){if(this.that.disabled)return;e=e||event;var that=this.that;var nod=that._getActionElement(_isIE?e.srcElement:e.target);switch (nod._etype){case "slider":
 if (that.vMode)var z=e.clientY-(getAbsoluteTop(that.con)-document.body.scrollTop);else
 var z=e.clientX-(getAbsoluteLeft(that.con)-document.body.scrollLeft);var posX = that.posX;that.posX = z-that.dragLeft-that.dragWidth/2;that.direction = that.posX > posX ? 1 : -1;if (that.stepping){clearInterval (that._int);that.setValue (that.value + that._step * that.direction, false);that._int = setInterval (function () {that.setValue (that.value + that._step * that.direction, false)}, 600);}else 
 {that._busy=true;that._applyPos();that._busy = false;};break;case "drag":
 that.startDrag(e||event);break;};return false;};dhtmlxSlider.prototype.setOnChangeHandler=function(func){this.attachEvent("onChange",func);};dhtmlxSlider.prototype._linkFrom=function(){if(this.disabled)return;this.setValue (parseFloat (this._link.value), false);};dhtmlxSlider.prototype.linkTo=function(obj){obj = (typeof(obj) != "object") ? document.getElementById(obj) : obj;this._link = obj;var name=obj.tagName.toString().toLowerCase();this._linkBoth=(((name=="input")||(name=="select")||(name=="textarea"))?1:0);if (this._linkBoth){var self=this;var f=function(){if (this._nextSlider)window.clearTimeout(this._nextSlider);this._nextSlider=window.setTimeout(function(){self._linkFrom()},500);};obj.onblur=obj.onkeypress=obj.onchange=f;};this._applyPos();};dhtmlxSlider.prototype.enableTooltip=function(mode){this._dttp=(!convertStringToBoolean(mode));this._setTooltip(this._dttp?"":this.getValue());};dhtmlxSlider.prototype.setImagePath = function(path){this.imgURL = path;};dhtmlxSlider.prototype.init = function() {this.isInit = true;this.createStructure();};dhtmlxSlider.prototype.setInputPriority = function (mode) {this.inputPriority = mode;};dhtmlxSlider.prototype.setSteppingMode = function (mode) {this.stepping = mode;};dhtmlxSlider.prototype.disable = function (mode) {this.disabled = mode;};(function(){dhtmlx.extend_api("dhtmlxSlider",{_init:function(obj){return [ obj.parent, obj.size, obj.skin, obj.vertical, obj.min, obj.max, obj.value, obj.step ];},
 link:"linkTo"
 },{});})();function dhtmlXTabBar(parentObject,mode,height){mode=mode||"top"
 dhtmlxEventable(this);this._hrefs = {};this._s={};this._c={};this._s.mode=mode;this._s.scrolls=true;this._s.line_height=(parseInt(height)||20)+3;this._s.skin_line = 1;this._s.tab_margin = 0;this._s.expand = 0;this._s.ext_border = 2;this._s._bMode=(mode=="right"||mode=="bottom")?1:0;this._s._vMode=(mode=="right"||mode=="left")?1:0;this._dx=this._s._vMode?"height":"width";this._dy=this._s._vMode?"width":"height";switch(mode){case "top":
 this._py="top";this._px="left";this._pxc="right";break;case "bottom":
 this._py="bottom";this._px="left";this._pxc="right";break;case "right":
 this._py="right";this._px="top";this._pxc="bottom";break;case "left":
 this._py="left";this._px="top";this._pxc="bottom";break;};this._active= null;this._tabs = {};this._content = {};this._href={};this._rows=[];this._s._tabSize=150;this._styles={"default":{left:3, right:3, select_shift:3, select_top:2, margin:1, offset:5, tab_color:"#F4F3EE", data_color:"#F0F8FF" },
 "winbiscarf":{left:18, right:18, select_shift:3, select_top:2, margin:1, offset:5},
 "winscarf":{left:18, right:4, select_shift:3, select_top:2, margin:5, offset:5},
 "modern":{left:5, right:5, select_shift:3, select_top:2, margin:1, offset:5, tab_color:"#F4F3EE", data_color:"#F0F8FF" },
 "silver":{left:7, right:7, select_shift:3, select_top:2, margin:1, offset:5, tab_color:"#F4F3EE", data_color:"#F0F8FF" },
 "dark_blue":{left:2, right:2, select_shift:3, select_top:2, margin:1, offset:5 },
 "glassy_blue":{left:2, right:3, select_shift:3, select_top:2, margin:1, offset:5 },
 
 "dhx_black":{left:2, right:2, select_shift:3, select_top:0, margin:1, offset:5},
 "dhx_blue":{left:2, right:2, select_shift:3, select_top:0, margin:1, offset:5, tab_color:"#F4F3EE", data_color:"#F0F8FF" },
 "dhx_skyblue":{left:3, right:3, select_shift:0, select_top:0, margin:-1, offset:5 , data_color:"white", hover:true },
 "dhx_web":{left:3, right:3, select_shift:1, select_top:0, margin:5, offset:15 , data_color:"white" }};if (typeof(parentObject)!="object")
 parentObject = document.getElementById(parentObject);this.entBox=parentObject;this.entBox.className+=" dhx_tabbar_zone_"+this._s.mode;if (dhtmlx.image_path)this.setImagePath(dhtmlx.image_path);this.setStyle("default");this.__skin = false;this._createSelf();if (_isIE)this.preventIECashing(true);return this;};dhtmlXTabBar.prototype={_get_size:function(name,alter){var size = this.entBox.getAttribute(name) || this.entBox.style[name] || (window.getComputedStyle?window.getComputedStyle(this.entBox,null)[name]:(this.entBox.currentStyle?this.entBox.currentStyle[name]:0))
 if ((size||"").indexOf("%")!=-1)
 this.enableAutoReSize(true,true);if (!size||size.indexOf("%")!=-1||size=="auto")
 size=alter+"px";return size;},
 
 setStyle:function(name){this.setSkin(name);},
 _getSkin:function(tab){return this._a;},
 
 setSkin:function(name){name=name.toLowerCase();if (!this._styles[name])name="default";this._a=this._styles[name];this.skin=name;if (this._tabAll)this._tabAll.className='dhx_tabbar_zone dhx_tabbar_zone_'+this.skin;var sky_mode = name.indexOf("dhx_sky")==0;var simple_mode = name.indexOf("dhx_web")==0;if (sky_mode)this._s.skin_line=0;if (simple_mode){this._s.line_height = 29;this._s.ext_border = -1;this._s.expand = true;};if (sky_mode){this._s.line_height=26;this._setRowSizes();if (this._s.expand)this._s.tab_margin = -1;this._s.skin_line_x=true;this._s.skin_line=-3;var r = this._s._rendered;if (r)for (var i=0;i < r.length;i++){r[i].parentNode.removeChild(r[i]);};var d1 = document.createElement("DIV");d1.className="dhx_tabbar_lineA";this._tabAll.appendChild(d1);var d2 = document.createElement("DIV");d2.className="dhx_tabbar_lineB";this._tabAll.appendChild(d2);var d3 = document.createElement("DIV");d3.className="dhx_tabbar_lineC";this._tabAll.appendChild(d3);var d4 = document.createElement("DIV");d4.className="dhx_tabbar_lineD";this._tabAll.appendChild(d4);this._getCoverLine();this._s._rendered = [d1,d2,d3,d4];if (this._s.expand){this._conZone.style.borderWidth="0px 0px 0px 0px";this._tabZone.firstChild.style.borderWidth="0px 0px 0px 0px";d3.style.borderWidth="0px 0px 0px 0px";d4.style.left="0px";d3.style.right="0px";d1.style.borderWidth="0px 0px 0px 0px";if (this._s.mode=="top")this._lineA.style.borderWidth="1px 0px 0px 0px";d2.style.left = "1px"
 };var f = function(){this._lineA.style[this._dx]="1px";var _quirks=(_isIE && document.compatMode == "BackCompat");var w = this._tabAll[this._s._vMode?"offsetHeight":"offsetWidth"]+(_quirks?2:0);if (this._lastActive)w=Math.max(w,this._lastActive.parentNode[this._s._vMode?"scrollHeight":"scrollWidth"]);if (w<6)return;d1.style[this._py]=parseInt(this._conZone.style[this._py])-3+"px";d1.style[this._dx]=w-2+"px";d2.style[this._py]=parseInt(this._conZone.style[this._py])-3+"px";d2.style[this._dx]=w-(_quirks?6:4)+(this._s.expand?2:0)+"px";d3.style[this._dy]=parseInt(this._tabZone.style[this._dy])-3+"px";this._lineA.style[this._dx]=w-2+"px";};f.call(this);var bf = this._checkScroll;this._checkScroll=function(){f.apply(this,arguments);bf.apply(this,arguments);};var bs = this._scrollTo;this._scrollTo=function(){bs.apply(this,arguments);f.apply(this,arguments);}};if (this._a.data_color && this._conZone)this._conZone.style.backgroundColor=this._a.data_color;this.__skin = true;},

 
 enableAutoReSize:function(){var self=this;dhtmlxEvent(window,"resize",function(){window.setTimeout(function(){if (self && self._setSizes)self._setSizes();},1) 
 })
 },
 _createSelf:function(){this._tabAll=document.createElement("DIV");this._tabZone=document.createElement("DIV");this._conZone=document.createElement("DIV");this.entBox.appendChild(this._tabAll);this._tabAll.appendChild(this._tabZone);this._tabAll.appendChild(this._conZone);this._tabAll.className='dhx_tabbar_zone dhx_tabbar_zone_'+this.skin;if (this._s._vMode)this._tabAll.className+='V';if (this._s._bMode)this._tabAll.className+='B';this._tabZone.className='dhx_tablist_zone';this._conZone.className='dhx_tabcontent_zone';if (this._a.data_color)this._conZone.style.backgroundColor=this._a.data_color;this._tabZone.onselectstart = function(){return false;};this._tabZone.onclick = this._onClickHandler;this._tabZone.onmouseover = this._onMouseOverHandler;this._tabZone[_isFF?"onmouseout":"onmouseleave"] = this._onMouseOutHandler;this._tabZone.tabbar=this;this._createRow();},
 _createRow:function(){var z=document.createElement("DIV");z.className='dhx_tabbar_row';z.tabCount=0;this._tabZone.appendChild(z);this._rows[this._rows.length]=z;this._setRowSizes();},
 _removeRow:function(row){row.parentNode.removeChild(row);var z=[];for (var i=0;i<this._rows.length;i++)if (this._rows[i]!=row)z[z.length]=this._rows[i];this._rows=z;},
 _setSizes:function(x,y){var dim=["clientHeight","clientWidth"];if (this._dx!="width")dim.reverse();var _quirks=(_isIE && document.compatMode == "BackCompat");var outerBorder=(this._conZone.offsetWidth-this._conZone.clientWidth);var _h=y||(this.entBox[dim[0]]+(_quirks?outerBorder:0));var _w=x||(this.entBox[dim[1]]+(_quirks?outerBorder:0));var _t=this._rows.length*(this._s.line_height-(this._s.skin_line_x?4:2))+(this._s.skin_line_x?2:0);this._tabZone.style[this._dy]=_t+"px";this._conZone.style[this._dy]=Math.max(0,_h-this._s.ext_border-_t-(this._s.skin_line_x?3:0)-this._s.tab_margin)+"px";this._conZone.style[this._dx]=Math.max(0,_w - (this._s.expand?0:2))+"px";this._tabZone.style[this._py]=this._s.tab_margin+"px";this._conZone.style[this._py]=_t+this._s.tab_margin-this._s.skin_line+"px";this._checkScroll();var id = this.getActiveTab();if (id)this.cells(id).activate();},
 _checkScroll:function(){if (this._s._vMode || !this._s.scrolls)return;for (var i=0;i<this._rows.length;i++)if ((this._rows[i].scrollWidth-this._rows[i].offsetWidth)>2)
 this._showScroll(i);else this._hideScroll(i);},

 _showScroll:function(i){if (this._rows[i]._scroll)return;var a=this._rows[i]._scroll=[];var top = Math.max(0,this._s.line_height-23);a[0]=document.createElement("DIV");a[0].style.cssText="background-image:url("+this.imgUrl+this.skin+"/"+this.skin+"_scroll_left.gif);width:20px;height:21px;position:absolute;left:0px;z-index:990;top:"+top+"px;";a[0].className="dhx_tab_scroll_left";this._rows[i].appendChild(a[0]);a[1]=document.createElement("DIV");a[1].style.cssText="background-image:url("+this.imgUrl+this.skin+"/"+this.skin+"_scroll_right.gif);width:20px;height:21px;position:absolute;right:0px;z-index:990;top:"+top+"px;";a[1].className="dhx_tab_scroll_right";this._rows[i].appendChild(a[1]);},
 _hideScroll:function(i){if (!this._rows[i]._scroll)return;this._rows[i].removeChild(this._rows[i]._scroll[0])
 this._rows[i].removeChild(this._rows[i]._scroll[1])
 this._rows[i]._scroll=null;},

 _setRowSizes:function(){for (var i=0;i<this._rows.length;i++){this._rows[i].style[this._dy]=this._s.line_height+"px";this._rows[i].style[this._py]=i*(this._s.line_height-(this._s.skin_line_x?4:2))-((_isIE && !window.postMessage && this._s._bMode)?0:0)+"px";this._rows[i].style.zIndex=10+i;};this._setSizes();},
 _setTabSizes:function(row){var pos=this._a.offset;var px = this._vMode?this._pxc:this._px;for (var i=0;i < row.tabCount;i++){var tab=row.childNodes[i];if (tab.style.display=="none")continue;tab.style[px]=pos-(this._lastActive==tab?this._a.select_shift:0)+"px";pos+=tab._size+this._a.margin;}},

 
 addTab:function(id, text, size, position, row){if (!this.__skin && dhtmlx.skin)this.setSkin(dhtmlx.skin);row=row||0;for (var i=this._rows.length;i<=row;i++)this._createRow();var z=this._rows[row].tabCount;if ((!position)&&(position!==0)) position=z;var tab=this._createTab(id, text, (size=="*"?10:size||this._s._tabSize));this._addTab(this._rows[row],tab,size,position);this._tabs[id]=tab;this.cells(id).hide();this._checkScroll();},

 
 removeTab:function(id,mode){var tab=this._tabs[id];if (!tab)return;this.cells(id)._dhxContDestruct();if (this._content[id] && this._content[id].parentNode){this._content[id].parentNode.removeChild(this._content[id]);this._content[id]=null;};this._goToAny(tab,mode);var row=tab.parentNode;row.removeChild(tab);row.tabCount--;if ((row.tabCount==0)&&(this._rows.length>1))
 this._removeRow(row);else
 this._setTabSizes(row);delete this._tabs[id];if (this._lastActive==tab)this._lastActive=null;this._setRowSizes();},
 _goToAny:function(tab,mode){if (this._lastActive==tab){if (mode && this.goToNextTab()==tab)
 this.goToPrevTab();if (this._lastActive==tab)this._lastActive=null;}},
 _createTab:function(id,text,size){var tab=document.createElement("DIV");tab.className='dhx_tab_element dhx_tab_element_inactive';var thml="<span>"+text+"</span><div></div><div></div><div></div>";if (this._close)thml+="<IMG style='"+this._pxc+":4px;"+this._py+":4px;position:absolute;z-index:11;' src='"+this.imgUrl+this.skin+"/close.png' >"
 tab.innerHTML=thml;tab.setAttribute("tab_id",id);tab._size=parseInt(size);tab.style[this._dx]=parseInt(size)+"px";tab.style[this._dy]=this._s.line_height+"px";tab.style[this._py]=this._a.select_top+"px";tab.skin=this.skin;if (this._a.tab_color)tab.style.backgroundColor=this._a.tab_color;if (this._c[id])tab.childNodes[0].style.cssText=this._c[id].color;this._img_all(tab);if (this._close){var self=this;tab.childNodes[4].onclick=function(e){var id=this.parentNode.getAttribute("tab_id");if (self.callEvent("onTabClose",[id])) self.removeTab(id,true);(e||event).cancelBubble=true;}};return tab;},
 _img_all:function(tab){var a=this._getSkin(tab);var pf=tab._active?1:4;this._img(tab.childNodes[1],pf,this._px,a.left);this._img(tab.childNodes[2],pf+2,this._pxc,a.right);this._img(tab.childNodes[3],pf+1,this._px,parseInt(tab.style[this._dx])-(a.left+a.right),a.left);},
 _get_img_pos:function(ind){if (this._s._bMode && ind<7)ind=Math.abs(ind-6);ind=-5-ind*45;if (this._s._vMode)return ind+"px 0px";else return "0px "+ind+"px";},
 _img:function(tag,y,pos,a,b){tag.style.backgroundImage="url("+this.imgUrl+this.skin+"/"+this.skin+"_"+this._s.mode+".gif)";tag.style.backgroundPosition=this._get_img_pos(y);tag.style[this._py]="0px";if (pos){tag.style[this._dx]=Math.max(a,0)+"px";tag.style[pos]=(b||0)+"px";}},
 _addTab:function(row,tab,size,position){var pos=this._a.offset;if (row.tabCount){var last=row.childNodes[row.tabCount-1];var pos=parseInt(last.style[this._s.align?this._pxc:this._px])+parseInt(last._size)+this._a.margin;};var next=row.childNodes[position];if (next)row.insertBefore(tab,next)
 else
 row.appendChild(tab);row.tabCount++;if (size=="*"){tab.style.whiteSpace="nowrap";this.adjustTabSize(tab);};tab.style[this._s.align?this._pxc:this._px]=pos+"px";if (position!=row.tabCount-1)this._setTabSizes(row);},
 adjustTabSize:function(tab,size){var a=this._getSkin(a);if (!size){tab.style.fontWeight="bold";tab.style.width="10px";size=tab.scrollWidth+10+(this._close?20:0);tab.style.fontWeight="";};tab.style[this._dx]=size+"px";tab._size=size;this._img_all(tab);},
 _onMouseOverHandler:function(e){var target = this.tabbar._getTabTarget(e?e.target:event.srcElement);this.tabbar._showHover(target);},
 _onMouseOutHandler:function(e){this.tabbar._showHover();},
 _showHover:function(tab){if (tab==this._lastHower)return;if (this._lastHower && this._lastHower != this._lastActive){var a=this._getSkin(this._lastHower);this._lastHower.className=this._lastHower.className.replace(/[ ]*dhx_tab_hover/gi,"");if (a.hover)this._img_all(this._lastHower);else
 this._img(this._lastHower.childNodes[3],5,this._px,parseInt(this._lastHower.style[this._dx])-(a.left+a.right),a.left);this._lastHower=null;};if (tab && ( tab == this._lastActive || tab._disabled)) return;this._lastHower=tab;if(tab){var a=this._getSkin(tab);tab.className+=" dhx_tab_hover";if (a.hover){this._img(tab.childNodes[1],7,this._px,a.left);this._img(tab.childNodes[2],8,this._pxc,a.right);};this._img(tab.childNodes[3],0,this._px,parseInt(tab.style[this._dx])-(a.left+a.right),a.left);}},
 _getTabTarget:function(t){if (!t)return null;while ((!t.className)||(t.className.indexOf("dhx_tab_element")==-1)){if ((t.className)&&(t.className.indexOf("dhx_tabbar_zone")!=-1)) return null;t=t.parentNode;if (!t)return null;};return t;},
 _onClickHandler:function(e){var src=e?e.target:event.srcElement;var target = this.tabbar._getTabTarget(src);if (target && !target._disabled)this.tabbar._setTabActive(target);else {var tag=null;if (src.className=="dhx_tab_scroll_left"){src.parentNode.scrollLeft=Math.max(0,src.parentNode.scrollLeft-src.parentNode.offsetWidth/2);tag=src;this.tabbar._setTabTop(this.tabbar._lastActive);}else if (src.className=="dhx_tab_scroll_right"){src.parentNode.scrollLeft+=src.parentNode.offsetWidth/2;tag=src.previousSibling;this.tabbar._setTabTop(this.tabbar._lastActive);};if (tag){tag.style.left=tag.parentNode.scrollLeft+"px";if (!_isIE || window.XMLHttpRequest)tag.nextSibling.style.right=tag.parentNode.scrollLeft*(-1)+"px";return false;}}},
 _deactivateTab:function(){this._setTabInActive(this._lastActive);this._lastActive=null;},
 _setTabInActive:function(tab,mode){if (!tab || tab!=this._lastActive)return true;var a = this._getSkin(tab);var id = tab.getAttribute("tab_id");var px = this._s.align?this._pxc:this._px;tab.className=tab.className.replace("_active","_inactive");tab.style[this._py]=a.select_top+"px";tab.style[px]=parseInt(tab.style[px])+a.select_shift+"px";tab.style[this._dx]=tab._size+"px";tab._active=false;if (a.tab_color)tab.style.backgroundColor=a.tab_color;if (this._c[id])tab.childNodes[0].style.cssText=this._c[id].color;this._img_all(tab);this.cells(id).hide();},
 _setTabActive:function(tab,mode){if (!tab || tab==this._lastActive)return true;var id = tab.getAttribute("tab_id");var last_id = this._lastActive?this._lastActive.getAttribute("tab_id"):null;var a = this._getSkin(tab);if (!mode)if (!this.callEvent("onSelect",[id,last_id])) return;var px = this._s.align?this._pxc:this._px;this._setTabInActive(this._lastActive);tab.className=tab.className.replace("_inactive","_active");tab.style[this._py]="0px";tab.style[px]=parseInt(tab.style[px])-a.select_shift+"px";tab.style[this._dx]=tab._size+a.select_shift*2+"px";tab._active=true;if (a.data_color)tab.style.backgroundColor=a.data_color;if (this._c[id])tab.childNodes[0].style.cssText=this._c[id].scolor;this._img_all(tab);this._setTabTop(tab);this._lastActive=tab;this.cells(id).show();this._scrollTo(tab);return true;},
 _scrollTo:function(tab){if (!this._s.scrolls)return;if (tab.offsetLeft<tab.parentNode.scrollLeft || (tab.offsetLeft+tab.offsetWidth)>(tab.parentNode.scrollLeft+tab.parentNode.offsetWidth)){tab.parentNode.scrollLeft = tab.offsetLeft;var tag = tab.parentNode._scroll;if (tag && tag[0]){tag[0].style.left=tag[0].parentNode.scrollLeft+"px";if (!_isIE || window.XMLHttpRequest)tag[1].style.right=tag[1].parentNode.scrollLeft*(-1)+"px";}}},
 _setTabTop:function(tab){var t = this._rows.length-1;for (var i=0;i<this._rows.length;i++)if (this._rows[i]==tab.parentNode){var row=this._rows[i];if (i!=t){this._rows[i]=this._rows[t]
 this._rows[t]=row;};var line=this._getCoverLine();row.appendChild(line);line.style[this._dx]="1px";var wh=(this._s._vMode?Math.max(this._tabZone.offsetHeight,row.scrollHeight):Math.max(this._tabZone.offsetWidth,row.scrollWidth));if (wh>0)line.style[this._dx]=wh+"px";tab.style.zIndex=(line._index++);break;};this._setRowSizes();},
 _getCoverLine:function(){if (!this._lineA){this._lineA=document.createElement("div");this._lineA.className="dhx_tablist_line";this._lineA.style[this._py]=this._s.line_height-3-(this._s.skin_line_x?1:0)+"px";this._lineA.style[this._dx]="100%";this._lineA._index=1;};this._lineA.style.zIndex=(this._lineA._index++);return this._lineA;},
 cells:function(id){if (!this._tabs[id])return null;if (!this._content[id]){var d=document.createElement("DIV");d.style.cssText="width:100%;height:100%;visibility:hidden;overflow:hidden;position:absolute;top:0px;left:0px;";d.setAttribute("tab_id",id);d.skin = this.skin;this._conZone.appendChild(d);(new dhtmlXContainer(d)).setContent(d);if (this.skin=="dhx_web" && d._setPadding)d._setPadding(1, "dhxcont_tabbar_dhx_web");this._content[id]=d;var self=this;d.show = function(){if (self._s.hide)this.style.display="";this.style.visibility="";this.style.zIndex="1";this.autoSize();this._activate();};d.hide = function(){if (self._s.hide){this.style.visibility="";this.style.display="none";}else
 this.style.visibility="hidden";this.style.zIndex=-1;if (self._hrfmode=="iframe")this.attachURL("javascript:false");};d.autoSize = function(){if (self._awdj || self._ahdj){if (!this.mainCont.offsetWidth)this.mainCont.style.width=Math.max(0,self.entBox.offsetWidth - 2)+"px";if (self._ahdj)this.mainCont.style.height="1px";var dim = this._getContentDim();if (self._awdj){self.entBox.style.width=dim[0]+2+"px";this.mainCont.style.width=dim[0]+"px";};if (self._ahdj){self._tabAll.style.height = self.entBox.style.height=dim[1]+self._rows.length*(self._s.line_height-2)+(self._s.expand?0:2)+2+"px";this.mainCont.style.height=dim[1]+"px";};self._setSizes();self._setTabTop(self._lastActive);}};d._activate=function(){if (this._delay)this._attachContent.apply(this,this._delay);this.activate();if (self._hrfmode!="iframe")this._delay=null;};d.activate=function(){this.adjustContent(this.parentNode,0,0,false,0);d.updateNestedObjects();};d._doOnAttachStatusBar = d.activate;d._doOnAttachMenu = d.activate;d._doOnAttachToolbar = d.activate;d._getContentDim=function(){return [this.mainCont.scrollWidth,this.mainCont.scrollHeight];};d._doOnAttachURL=function(){if (self._awdj || self._ahdj)self.cells(id).autoSize();self.callEvent("onXLE",[]);self.callEvent("onTabContentLoaded",[this.getAttribute("tab_id")]);};d._doOnBeforeAttachURL=function(){self.callEvent("onXLS",[]);};d.adjustContent(d.parentNode,0,0,false,0);};return this._content[id];},

 
 forceLoad:function(id,href){this.setContentHref(id,href||this._hrefs[id]);this.cells(id)._activate();},
 
 
 

 
 enableAutoSize:function(autoWidth,autoHeight){this._ahdj=convertStringToBoolean(autoHeight);this._awdj=convertStringToBoolean(autoWidth);},
 

 
 clearAll:function(){return;for (var id in this._tabs)this.removeTab(id,false);if (this._lineA){var line=this._getCoverLine();if (line.parentNode)line.parentNode.removeChild(line);}},

 
 enableTabCloseButton:function(mode){this._close = convertStringToBoolean(mode);}, 
 
 
 preventIECashing:function(mode){this.no_cashe = convertStringToBoolean(mode);if (this.XMLLoader)this.XMLLoader.rSeed=this.no_cashe;},

 
 setTabActive:function(id,mode){this._setTabActive(this._tabs[id],mode===false);},
 setTabInActive:function(){var tab = this._lastActive;if (tab){this._deactivateTab();this._setTabTop(tab);this._getCoverLine();}},

 
 loadXMLString:function(xmlString,call){this.XMLLoader=new dtmlXMLLoaderObject(this._parseXML,this,true,this.no_cashe);this.XMLLoader.waitCall=call||0;this.XMLLoader.loadXMLString(xmlString);},

 
 loadXML:function(url,call){this.callEvent("onXLS",[]);this.XMLLoader=new dtmlXMLLoaderObject(this._parseXML,this,true,this.no_cashe);this.XMLLoader.waitCall=call||0;this.XMLLoader.loadXML(url);},
 _parseXML:function(that,a,b,c,obj){that.clearAll();var selected="";if (!obj)obj=that.XMLLoader;var atop=obj.getXMLTopNode("tabbar");var arows = obj.doXPath("//row",atop);var acs=atop.getAttribute("tabstyle");if (acs)that.setStyle(acs);that._hrfmode=atop.getAttribute("hrefmode")||that._hrfmode;that._a.margin =parseInt((atop.getAttribute("margin")||that._a.margin),10);acs=atop.getAttribute("align");if (acs)that._s.align = (acs=="right"||acs=="bottom");that._a.offset = parseInt((atop.getAttribute("offset")||that._a.offset),10);acs=atop.getAttribute("skinColors");if (acs)that.setSkinColors(acs.split(",")[0],acs.split(",")[1]);for (var i=0;i<arows.length;i++){var atabs = obj.doXPath("./tab",arows[i]);for (var j=0;j<atabs.length;j++){var width=atabs[j].getAttribute("width");var name=that._getXMLContent(atabs[j]);var id=atabs[j].getAttribute("id");that.addTab(id,name,width,"",i);if (atabs[j].getAttribute("selected")) selected=id;if (that._hrfmode)that.setContentHref(id,atabs[j].getAttribute("href"));else
 for (var k=0;k<atabs[j].childNodes.length;k++){var cont=atabs[j].childNodes[k];if (cont.tagName=="content"){if (cont.getAttribute("id"))
 that.setContent(id,cont.getAttribute("id"));else
 that.setContentHTML(id,that._getXMLContent(cont));}}}};if (selected)that.setTabActive(selected);that.callEvent("onXLE",[]);},
 adjustOuterSize:function(){this._setSizes();},
 _getXMLContent:function(node){var text="";for (var i=0;i<node.childNodes.length;i++){var z=node.childNodes[i];text+=(z.nodeValue===null?"":z.nodeValue);};return text;},

 
 enableContentZone:function(mode){this._conZone.style.display=((convertStringToBoolean(mode))?"":"none");this._setSizes();},

 enableForceHiding:function(mode){this._s.hide=convertStringToBoolean(mode);},


 
 setSize:function(x,y){this.entBox.style.width=x+"px";this.entBox.style.height=y+"px";this._setSizes();},

 
 setSkinColors:function(a,b){if (a)this._a.tab_color=a;if (b)this._a.data_color=b;this._conZone.style.backgroundColor=b;},

 
 setCustomStyle:function(id,color,scolor,style){var str="";this._c[id]={color:(";"+(color?("color:"+color+";"):"")+(style||"")),
 scolor:(";"+(scolor?("color:"+scolor+";"):"")+(style||""))
 };if (this._tabs[id])this._tabs[id].childNodes[0].style.cssText=((this._tabs[id]==this._lastActive)?this._c[id].scolor:this._c[id].color);},

 
 setImagePath:function(url){this.imgUrl=url;},
 getNext:function(tab,alt){alt=alt||"nextSibling";var next=tab[alt];if (next && next.className.indexOf("dhx_tab_element")==-1) next=null;if (!next && tab.parentNode[alt])next=tab.parentNode[alt].childNodes[0];return next||tab;},

 
 goToNextTab:function(tab){do {tab=this.getNext(tab||this._lastActive)}while (!this._setTabActive(tab));return tab;},

 
 goToPrevTab:function(tab){do {tab=this.getNext((tab||this._lastActive),"previousSibling")}while (!this._setTabActive(tab));return tab;},

 
 disableTab:function(id){this._tabs[id]._disabled=true;this._tabs[id].style.color="silver";},

 
 enableTab:function(id){this._tabs[id]._disabled=false;this._tabs[id].style.color="";},

 
 showTab:function(id){var tab=this._tabs[id];tab.style.display="";this._setTabSizes(tab.parentNode);},

 
 hideTab:function(id, mode){var tab=this._tabs[id];tab.style.display="none";if (tab == this._lastActive && mode !== false)this.goToNextTab();this._setTabSizes(tab.parentNode);},

 
 getActiveTab:function(){if (!this._lastActive)return null;return this._lastActive.getAttribute("tab_id");},

 
 setLabel:function(id,text){var activeTab = this.getActiveTab();this._tabs[id].firstChild.innerHTML=text;this.adjustTabSize(this._tabs[id]);this._setTabSizes(this._tabs[id].parentNode);this._checkScroll();},

 getLabel:function(id){return this._tabs[id].firstChild.innerHTML;}, 

 
 setOffset:function(n){this._a.offset=n*1;},

 enableScroll:function(mode){this._s.scrolls=convertStringToBoolean(mode);},

 
 setMargin:function(n){this._a.margin=n*1;},

 
 setAlign:function(n){this._s.align=(n=="bottom"||n=="right");},

 tabWindow:function(tab_id){return (this._content[tab_id]?this._content[tab_id]._frame.contentWindow:null);},
 
 setContentHTML:function(id,value){this.cells(id).attachHTMLString(value);},

 
 setContent:function(id,value){this.cells(id).attachObject(value);this.cells(id).activate();},

 
 setHrefMode:function(mode){this._hrfmode=mode;}, 

 
 setContentHref:function(id,href){this._hrefs[id]=href;switch (this._hrfmode){case "iframes":
 this.cells(id).attachURL(href);break;case "iframe":
 case "iframes-on-demand":
 this.cells(id)._delay=["url",href,false];break;case "ajax":
 var cell=this.cells(id);var that=this;cell._delay=["urlajax",href,true];if (!cell.attachHTMLStringA){cell.attachHTMLStringA=cell.attachHTMLString;cell.attachHTMLString=function(str,xml){if (xml)str=that._getXMLContent(xml.doXPath("//content")[0]);return this.attachHTMLStringA(str);}};break;case "ajax-html":
 this.cells(id)._delay=["urlajax",href,true];break;};if (this._tabs[id]==this._lastActive)this.cells(id).show(true);},



 normalize:function(limit,full){limit=limit||this._tabZone.offsetWidth;function correct_size(tab,i){tabs[i]._size=tabs[i]._size+prev_size-size;tab.adjustTabSize(tabs[i],tabs[i]._size);};var tabs=[];for (var j=0;j<this._rows.length;j++)for (var i=0;i<this._rows[j].tabCount;i++)tabs.push(this._rows[j].removeChild(this._rows[j].childNodes[0]));this._tabZone.innerHTML="";this._rows=[];var t = this._lastActive;this._lastActive=null;this._createRow();var row=0;var size=this._a.offset;var prev_size=Infinity;var last_tab=null;var i=0;for (i;i<tabs.length;i++)if ((size + tabs[i]._size + this._a.margin)< limit){this._rows[row].appendChild(tabs[i]);this._rows[row].tabCount++;size+=tabs[i]._size + this._a.margin;}else {if (full && size<prev_size)correct_size(this,i-1);this._createRow();i--;row++;prev_size=size;size=this._a.offset;continue;};if (full && size<prev_size && prev_size!=Infinity)correct_size(this,i-1);for (var j=0;j < this._rows.length;j++)this._setTabSizes(this._rows[j]);this._setSizes();if (this._lastActive=t)this._setTabTop(this._lastActive);},

 showInnerScroll:function(){for (var i in this._tabs)this.cells(i).dhxcont.mainCont.style.overflow="auto";},
 
 
 getNumberOfTabs:function (){var tc = 0;for(var i=0;i<this._rows.length;i++)tc+=this._rows[i].tabCount;return tc;},
 
 destructor:function(){try{console.log("[warning] dhtmlXTabBar destructor needed")
 }catch(e){}}};if (!window.dhtmlXContainer){window.dhtmlXContainer=function(obj) {var that = this;this.obj = obj;this.dhxcont = null;this.setContent = function(data) {this.dhxcont = data;this.dhxcont.innerHTML = "<div id='dhxMainCont' class='dhxcont_main_content'></div>"+
 "<div id='dhxContBlocker' class='dhxcont_content_blocker' style='display: none;'></div>";this.dhxcont.mainCont = this.dhxcont.childNodes[0];this.obj.dhxcont = this.dhxcont;};this.obj._genStr = function(w) {var s = "";var z = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for (var q=0;q<w;q++){s = s + z.charAt(Math.round(Math.random() * z.length));};return s;};this.obj.setMinContentSize = function(w, h) {this._minDataSizeW = w;this._minDataSizeH = h;};this.obj.moveContentTo = function(cont) {cont.updateNestedObjects();};this.obj.adjustContent = function(parentObj, offsetTop, marginTop, notCalcWidth, offsetBottom) {this.dhxcont.style.top = offsetTop+"px";this.dhxcont.style.left = "0px";if (notCalcWidth == true){}else {this.dhxcont.style.width = parentObj.clientWidth+"px";};var px = parentObj.clientHeight-offsetTop;if (px < 0){px = 0;};this.dhxcont.style.height = px+(marginTop!=null?marginTop:0)+"px";if (notCalcWidth == true){}else {if (this.dhxcont.offsetWidth > parentObj.clientWidth){this.dhxcont.style.width = Math.max(0,parentObj.clientWidth*2-this.dhxcont.offsetWidth)+"px";}};if (this.dhxcont.offsetHeight > parentObj.clientHeight - offsetTop){var px = (parentObj.clientHeight-offsetTop)*2-this.dhxcont.offsetHeight;if (px < 0){px = 0;};this.dhxcont.style.height = px+"px";};if (offsetBottom){if (!isNaN(offsetBottom)) this.dhxcont.style.height = parseInt(this.dhxcont.style.height)-offsetBottom+"px";};if (this._minDataSizeH != null){if (parseInt(this.dhxcont.style.height)< this._minDataSizeH) {this.dhxcont.style.height = this._minDataSizeH+"px";}};if (this._minDataSizeW != null){if (parseInt(this.dhxcont.style.width)< this._minDataSizeW) {this.dhxcont.style.width = this._minDataSizeW+"px";}};if (notCalcWidth == true){}else {this.dhxcont.mainCont.style.width = this.dhxcont.clientWidth+"px";};var menuOffset = (this.menu!=null?(!this.menuHidden?this.menuHeight:0):0);var toolbarOffset = (this.toolbar!=null?(!this.toolbarHidden?this.toolbarHeight:0):0);var statusOffset = (this.sb!=null?(!this.sbHidden?this.sbHeight:0):0);this.dhxcont.mainCont.style.height = this.dhxcont.clientHeight-menuOffset-toolbarOffset-statusOffset+"px";};this.obj.updateNestedObjects = function() {};this.obj.attachObject = function(obj, autoSize) {if (typeof(obj)== "string") {obj = document.getElementById(obj);};if (autoSize){obj.style.visibility = "hidden";obj.style.display = "";var objW = obj.offsetWidth;var objH = obj.offsetHeight;};this._attachContent("obj", obj);if (autoSize && this._isWindow){obj.style.visibility = "";this._adjustToContent(objW, objH);}};this.obj.appendObject = function(obj) {if (typeof(obj)== "string") {obj = document.getElementById(obj);};this._attachContent("obj", obj, true);};this.obj.attachHTMLString = function(str) {this._attachContent("str", str);var z=str.match(/<script[^>]*>[^\f]*?<\/script>/g)||[];for (var i=0;i<z.length;i++){var s=z[i].replace(/<([\/]{0,1})script[^>]*>/g,"")
 if (window.execScript){var url = z[i].match(/src=("|')([^"']+)("|')/);if (url)var s = dhtmlxAjax.getSync(url[2]).xmlDoc.responseText;if (s)window.execScript(s);}else window.eval(s);}};this.obj.attachURL = function(url, ajax) {this._attachContent((ajax==true?"urlajax":"url"), url, false);};this.obj._attachContent = function(type, obj, append) {if (append !== true){while (that.dhxcont.mainCont.childNodes.length > 0){that.dhxcont.mainCont.removeChild(that.dhxcont.mainCont.childNodes[0]);}};if (type == "url"){var fr = document.createElement("IFRAME");fr.frameBorder = 0;fr.border = 0;fr.style.width = "100%";fr.style.height = "100%";that.dhxcont.mainCont.appendChild(fr);fr.src = obj;this._frame = fr;if (this._doOnAttachURL)this._doOnAttachURL(true);}else if (type == "urlajax"){var t = this;var xmlParser=function(){t.attachHTMLString(this.xmlDoc.responseText,this);if (t._doOnAttachURL)t._doOnAttachURL(false);this.destructor();};var xmlLoader = new dtmlXMLLoaderObject(xmlParser, window);xmlLoader.loadXML(obj);if (t._doOnBeforeAttachURL)t._doOnBeforeAttachURL(false);}else if (type == "obj"){that.dhxcont._frame = null;that.dhxcont.mainCont.appendChild(obj);that.dhxcont.mainCont.style.overflow = (append===true?"auto":"hidden");obj.style.display = "";}else if (type == "str"){that.dhxcont._frame = null;that.dhxcont.mainCont.innerHTML = obj;}};this.obj._dhxContDestruct = function() {}}};(function(){dhtmlx.extend_api("dhtmlXTabBar",{_init:function(obj){return [obj.parent,obj.mode,obj.height];},
 tabs:"tabs",
 skin:"setSkin",
 offset:"setOffset",
 margin:"setMargin",
 image_path:"setImagePath",
 href_mode:"setHrefMode",
 align:"setAlign",
 xml:"loadXML",
 close_button:"enableTabCloseButton",
 scroll:"enableScroll",
 forced:"enableForceHiding",
 content_zone:"enableContentZone",
 size_by_content:"enableAutoSize",
 auto_size:"enableAutoReSize"
 },{tabs:function(arr){for (var i=0;i<arr.length;i++){var t=arr[i];this.addTab(t.id,t.label, t.width, t.index, t.row);if (t.active)this.setTabActive(t.id);}}});})();function dhx_init_tabbars(){var z=document.getElementsByTagName("div");for (var i=0;i<z.length;i++)if(z[i].className.indexOf("dhtmlxTabBar")!=-1){var n=z[i];var id=n.id;n.className="";var k=new Array();for (var j=0;j<n.childNodes.length;j++)if (n.childNodes[j].tagName && n.childNodes[j].tagName!="!")k[k.length]=n.childNodes[j];var w=new dhtmlXTabBar(id,n.getAttribute("mode")||"top",n.getAttribute("tabheight")||20);window[id]=w;acs=n.getAttribute("onbeforeinit");if (acs)eval(acs);if (n.getAttribute("enableForceHiding")) w.enableForceHiding(true);w.setImagePath(n.getAttribute("imgpath"));var acs=n.getAttribute("margin");if (acs!=null)w._margin=acs;acs=n.getAttribute("align");if (acs)w._align=acs;acs=n.getAttribute("hrefmode");if (acs)w.setHrefMode(acs);acs=n.getAttribute("offset");if (acs!=null)w._offset=acs;acs=n.getAttribute("tabstyle");if (acs!=null)w.setStyle(acs);acs=n.getAttribute("select");var clrs=n.getAttribute("skinColors");if (clrs)w.setSkinColors(clrs.split(",")[0],clrs.split(",")[1]);for (var j=0;j<k.length;j++){var m=k[j];m.parentNode.removeChild(m)
 w.addTab(m.id,m.getAttribute("name"),m.getAttribute("width"),null,m.getAttribute("row"));var href=m.getAttribute("href");if (href)w.setContentHref(m.id,href);else w.setContent(m.id,m);if ((!w._dspN)&&(m.style.display=="none"))
 m.style.display="";};if (k.length)w.setTabActive(acs||k[0].id);acs=n.getAttribute("oninit");if (acs)eval(acs);}};dhtmlxEvent(window,"load",dhx_init_tabbars);function dhtmlXToolbarObject(baseId, skin) {var main_self = this;this.cont = (typeof(baseId)!="object")?document.getElementById(baseId):baseId;while (this.cont.childNodes.length > 0)this.cont.removeChild(this.cont.childNodes[0]);this.cont.dir = "ltr";this.cont.innerHTML += "<div class='dhxtoolbar_hdrline_ll'></div><div class='dhxtoolbar_hdrline_rr'></div>"+
 "<div class='dhxtoolbar_hdrline_l'></div><div class='dhxtoolbar_hdrline_r'></div>";this.base = document.createElement("DIV");this.base.className = "float_left";this.cont.appendChild(this.base);this.align = "left";this.setAlign = function(align) {this.align = (align=="right"?"right":"left");this.base.className = (align=="right"?"float_right":"float_left");if (this._spacer)this._spacer.className = "dhxtoolbar_spacer "+(align=="right"?" float_left":" float_right");};this._isIE6 = false;if (_isIE)this._isIE6 = (window.XMLHttpRequest==null?true:false);this.selectPolygonOffsetTop = 0;this.selectPolygonOffsetLeft = 0;this.setSkin = function(skin) {this.skin = skin;if (this.skin == "dhx_skyblue"){this.selectPolygonOffsetTop = 2;};if (this.skin == "dhx_web"){this.selectPolygonOffsetTop = 1;this.selectPolygonOffsetLeft = 1;};this.cont.className = "dhx_toolbar_base_"+this.skin+(this.rtl?" rtl":"");for (var a in this.objPull){var item = this.objPull[a];if (item["type"] == "slider"){item.pen._detectLimits();item.pen._definePos();item.label.className = "dhx_toolbar_slider_label_"+this.skin+(this.rtl?" rtl":"");};if (item["type"] == "buttonSelect"){item.polygon.className = "dhx_toolbar_poly_"+this.skin+(this.rtl?" rtl":"");}}};this.setSkin(skin==null?"dhx_skyblue":skin);this.objPull = {};this.anyUsed = "none";this.imagePath = "";this.setIconsPath = function(path) {this.imagePath = path;};this.setIconPath = this.setIconsPath;this._doOnLoad = function() {};this.loadXML = function(xmlFile, onLoadFunction) {if (onLoadFunction != null)this._doOnLoad = function() {onLoadFunction();};this.callEvent("onXLS", []);this._xmlLoader = new dtmlXMLLoaderObject(this._xmlParser, window);this._xmlLoader.loadXML(xmlFile);};this.loadXMLString = function(xmlString, onLoadFunction) {if (onLoadFunction != null){this._doOnLoad = function() {onLoadFunction();}};this._xmlLoader = new dtmlXMLLoaderObject(this._xmlParser, window);this._xmlLoader.loadXMLString(xmlString);};this._xmlParser = function() {var root = this.getXMLTopNode("toolbar");var t = ["id", "type", "hidden", "title", "text", "enabled", "img", "imgdis", "action", "openAll", "renderSelect", "width", "value", "selected", "length", "textMin", "textMax", "toolTip", "valueMin", "valueMax", "valueNow"];var p = ["id", "type", "enabled", "disabled", "action", "selected", "img", "text"];for (var q=0;q<root.childNodes.length;q++){if (root.childNodes[q].tagName == "item"){var itemData = {};for (var w=0;w<t.length;w++)itemData[t[w]] = root.childNodes[q].getAttribute(t[w]);itemData.items = [];itemData.userdata = [];for (var e=0;e<root.childNodes[q].childNodes.length;e++){if (root.childNodes[q].childNodes[e].tagName == "item" && itemData.type == "buttonSelect"){var u = {};for (var w=0;w<p.length;w++)u[p[w]] = root.childNodes[q].childNodes[e].getAttribute(p[w]);try {u.itemText = root.childNodes[q].childNodes[e].getElementsByTagName("itemText")[0].firstChild.nodeValue;}catch(k){};itemData.items[itemData.items.length] = u;};if (root.childNodes[q].childNodes[e].tagName == "userdata"){var u = {};try {u.name = root.childNodes[q].childNodes[e].getAttribute("name");}catch(k) {u.name = "";};try {u.value = root.childNodes[q].childNodes[e].firstChild.nodeValue;}catch(k) {u.value = "";};itemData.userdata[itemData.userdata.length] = u;}};main_self._addItemToStorage(itemData);}};main_self.callEvent("onXLE", []);main_self._doOnLoad();this.destructor();};this._addItemToStorage = function(itemData, pos) {var id = (itemData.id||this._genStr(24));var type = (itemData.type||"");if (type != ""){if (this["_"+type+"Object"] != null){this.objPull[this.idPrefix+id] = new this["_"+type+"Object"](this, id, itemData);this.objPull[this.idPrefix+id]["type"] = type;this.setPosition(id, pos);}};if (itemData.userdata){for (var q=0;q<itemData.userdata.length;q++)this.setUserData(id, itemData.userdata[q].name, itemData.userdata[q].value);}};this._genStr = function(w) {var s = "";var z = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for (var q=0;q<w;q++)s += z.charAt(Math.round(Math.random() * (z.length-1)));return s;};this.rootTypes = new Array("button", "buttonSelect", "buttonTwoState", "separator", "label", "slider", "text", "buttonInput");this.idPrefix = this._genStr(12);dhtmlxEventable(this);this._getObj = function(obj, tag) {var targ = null;for (var q=0;q<obj.childNodes.length;q++){if (obj.childNodes[q].tagName != null){if (String(obj.childNodes[q].tagName).toLowerCase() == String(tag).toLowerCase()) targ = obj.childNodes[q];}};return targ;};this._addImgObj = function(obj) {var imgObj = document.createElement("IMG");if (obj.childNodes.length > 0)obj.insertBefore(imgObj, obj.childNodes[0]);else obj.appendChild(imgObj);return imgObj;};this._setItemImage = function(item, url, dis) {if (dis == true)item.imgEn = url;else item.imgDis = url;if ((!item.state && dis == true)|| (item.state && dis == false)) return;var imgObj = this._getObj(item.obj, "img");if (imgObj == null)imgObj = this._addImgObj(item.obj);imgObj.src = this.imagePath+url;};this._clearItemImage = function(item, dis) {if (dis == true)item.imgEn = "";else item.imgDis = "";if ((!item.state && dis == true)|| (item.state && dis == false)) return;var imgObj = this._getObj(item.obj, "img");if (imgObj != null)imgObj.parentNode.removeChild(imgObj);};this._setItemText = function(item, text) {var txtObj = this._getObj(item.obj, "div");if (text == null || text.length == 0){if (txtObj != null)txtObj.parentNode.removeChild(txtObj);return;};if (txtObj == null){txtObj = document.createElement("DIV");item.obj.appendChild(txtObj);};txtObj.innerHTML = text;};this._getItemText = function(item) {var txtObj = this._getObj(item.obj, "div");if (txtObj != null)return txtObj.innerHTML;return "";};this._enableItem = function(item) {if (item.state)return;item.state = true;if (this.objPull[item.id]["type"] == "buttonTwoState" && this.objPull[item.id]["obj"]["pressed"] == true){item.obj.className = "dhx_toolbar_btn pres";item.obj.renderAs = "dhx_toolbar_btn over";}else {item.obj.className = "dhx_toolbar_btn def";item.obj.renderAs = item.obj.className;};if (item.arw)item.arw.className = String(item.obj.className).replace("btn","arw");var imgObj = this._getObj(item.obj, "img");if (item.imgEn != ""){if (imgObj == null)imgObj = this._addImgObj(item.obj);imgObj.src = this.imagePath+item.imgEn;}else {if (imgObj != null)imgObj.parentNode.removeChild(imgObj);}};this._disableItem = function(item) {if (!item.state)return;item.state = false;item.obj.className = "dhx_toolbar_btn dis";item.obj.renderAs = "dhx_toolbar_btn def";if (item.arw)item.arw.className = String(item.obj.className).replace("btn","arw");var imgObj = this._getObj(item.obj, "img");if (item.imgDis != ""){if (imgObj == null)imgObj = this._addImgObj(item.obj);imgObj.src = this.imagePath+item.imgDis;}else {if (imgObj != null)imgObj.parentNode.removeChild(imgObj);};if (item.polygon != null){if (item.polygon.style.display != "none"){item.polygon.style.display = "none";if (item.polygon._ie6cover)item.polygon._ie6cover.style.display = "none";}};this.anyUsed = "none";};this.clearAll = function() {for (var a in this.objPull)this._removeItem(String(a).replace(this.idPrefix,""));};this._isWebToolbar = true;this._doOnClick = function(e) {main_self.forEachItem(function(itemId){if (main_self.objPull[main_self.idPrefix+itemId]["type"] == "buttonSelect"){var item = main_self.objPull[main_self.idPrefix+itemId];if (item.polygon.style.display != "none"){item.obj.renderAs = "dhx_toolbar_btn def";item.obj.className = item.obj.renderAs;item.arw.className = String(item.obj.renderAs).replace("btn","arw");main_self.anyUsed = "none";item.polygon.style.display = "none";if (item.polygon._ie6cover)item.polygon._ie6cover.style.display = "none";}}});};if (_isIE)document.body.attachEvent("onclick", this._doOnClick);else window.addEventListener("click", this._doOnClick, false);return this;};dhtmlXToolbarObject.prototype.addSpacer = function(nextToId) {var nti = this.idPrefix+nextToId;if (this._spacer != null){if (this._spacer.idd == nextToId)return;if (this._spacer == this.objPull[nti].obj.parentNode){var doMove = true;while (doMove){var idd = this._spacer.childNodes[0].idd;this.base.appendChild(this._spacer.childNodes[0]);if (idd == nextToId || this._spacer.childNodes.length == 0){if (this.objPull[nti].arw != null)this.base.appendChild(this.objPull[nti].arw);doMove = false;}};this._spacer.idd = nextToId;return;};if (this.base == this.objPull[nti].obj.parentNode){var doMove = true;var chArw = (this.objPull[nti].arw!=null);while (doMove){var q = this.base.childNodes.length-1;if (chArw == true)if (this.base.childNodes[q] == this.objPull[nti].arw)doMove = false;if (this.base.childNodes[q].idd == nextToId)doMove = false;if (doMove){if (this._spacer.childNodes.length > 0)this._spacer.insertBefore(this.base.childNodes[q], this._spacer.childNodes[0]);else this._spacer.appendChild(this.base.childNodes[q]);}};this._spacer.idd = nextToId;return;}}else {var np = null;for (var q=0;q<this.base.childNodes.length;q++){if (this.base.childNodes[q] == this.objPull[this.idPrefix+nextToId].obj){np = q;if (this.objPull[this.idPrefix+nextToId].arw != null)np = q+1;}};if (np != null){this._spacer = document.createElement("DIV");this._spacer.className = "dhxtoolbar_spacer "+(this.align=="right"?" float_left":" float_right");this._spacer.dir = "rtl";this._spacer.idd = nextToId;while (this.base.childNodes.length > np+1)this._spacer.appendChild(this.base.childNodes[np+1]);this.cont.appendChild(this._spacer);}}};dhtmlXToolbarObject.prototype.removeSpacer = function() {if (!this._spacer)return;while (this._spacer.childNodes.length > 0)this.base.appendChild(this._spacer.childNodes[0]);this._spacer.parentNode.removeChild(this._spacer);this._spacer = null;};dhtmlXToolbarObject.prototype.getType = function(itemId) {var parentId = this.getParentId(itemId);if (parentId != null){var typeExt = null;var itemData = this.objPull[this.idPrefix+parentId]._listOptions[itemId];if (itemData != null)if (itemData.sep != null)typeExt = "buttonSelectSeparator";else typeExt = "buttonSelectButton";return typeExt;}else {if (this.objPull[this.idPrefix+itemId] == null)return null;return this.objPull[this.idPrefix+itemId]["type"];}};dhtmlXToolbarObject.prototype.getTypeExt = function(itemId) {var type = this.getType(itemId);if (type == "buttonSelectButton" || type == "buttonSelectSeparator"){if (type == "buttonSelectButton")type = "button";else type = "separator";return type;};return null;};dhtmlXToolbarObject.prototype.inArray = function(array, value) {for (var q=0;q<array.length;q++){if (array[q]==value)return true;};return false;};dhtmlXToolbarObject.prototype.getParentId = function(listId) {var parentId = null;for (var a in this.objPull)if (this.objPull[a]._listOptions)for (var b in this.objPull[a]._listOptions)if (b == listId)parentId = String(a).replace(this.idPrefix,"");return parentId;};dhtmlXToolbarObject.prototype._addItem = function(itemData, pos) {this._addItemToStorage(itemData, pos);};dhtmlXToolbarObject.prototype.addButton = function(id, pos, text, imgEnabled, imgDisabled) {this._addItem({id:id, type:"button", text:text, img:imgEnabled, imgdis:imgDisabled}, pos);};dhtmlXToolbarObject.prototype.addText = function(id, pos, text) {this._addItem({id:id,type:"text",text:text}, pos);};dhtmlXToolbarObject.prototype.addButtonSelect = function(id, pos, text, opts, imgEnabled, imgDisabled, renderSelect, openAll) {var items = [];for (var q=0;q<opts.length;q++){var u = {};if (opts[q].id && opts[q].type){u.id = opts[q].id;u.type = (opts[q].type=="obj"?"button":"separator");u.text = opts[q].text;u.img = opts[q].img;}else {u.id = opts[q][0];u.type = (opts[q][1]=="obj"?"button":"separator");u.text = (opts[q][2]||null);u.img = (opts[q][3]||null);};items[items.length] = u;};this._addItem({id:id, type:"buttonSelect", text:text, img:imgEnabled, imgdis:imgDisabled, renderSelect:renderSelect, openAll:openAll, items:items}, pos);};dhtmlXToolbarObject.prototype.addButtonTwoState = function(id, pos, text, imgEnabled, imgDisabled) {this._addItem({id:id, type:"buttonTwoState", img:imgEnabled, imgdis:imgDisabled, text:text}, pos);};dhtmlXToolbarObject.prototype.addSeparator = function(id, pos) {this._addItem({id:id,type:"separator"}, pos);};dhtmlXToolbarObject.prototype.addSlider = function(id, pos, len, valueMin, valueMax, valueNow, textMin, textMax, tip) {this._addItem({id:id, type:"slider", length:len, valueMin:valueMin, valueMax:valueMax, valueNow:valueNow, textMin:textMin, textMax:textMax, toolTip:tip}, pos);};dhtmlXToolbarObject.prototype.addInput = function(id, pos, value, width) {this._addItem({id:id,type:"buttonInput",value:value,width:width}, pos);};dhtmlXToolbarObject.prototype.forEachItem = function(handler) {for (var a in this.objPull){if (this.inArray(this.rootTypes, this.objPull[a]["type"])) {handler(this.objPull[a]["id"].replace(this.idPrefix,""));}}};(function(){var list="showItem,hideItem,isVisible,enableItem,disableItem,isEnabled,setItemText,getItemText,setItemToolTip,getItemToolTip,setItemImage,setItemImageDis,clearItemImage,clearItemImageDis,setItemState,getItemState,setItemToolTipTemplate,getItemToolTipTemplate,setValue,getValue,setMinValue,getMinValue,setMaxValue,getMaxValue,setWidth,getWidth".split(",")
 var ret=["","",false,"","",false,"","","","","","","","","",false,"","","",null,"",[null,null],"",[null,null],"",null]
 var functor=function(name,res){return function(itemId,a,b){itemId = this.idPrefix+itemId;if (this.objPull[itemId][name] != null)return this.objPull[itemId][name].call(this.objPull[itemId],a,b)
 else 
 return res;}};for (var i=0;i<list.length;i++){var name=list[i];var res=ret[i];dhtmlXToolbarObject.prototype[name] = functor(name,res);}})()























































dhtmlXToolbarObject.prototype.getPosition = function(itemId) {return this._getPosition(itemId);};dhtmlXToolbarObject.prototype._getPosition = function(id, getRealPosition) {if (this.objPull[this.idPrefix+id] == null)return null;var pos = null;var w = 0;for (var q=0;q<this.base.childNodes.length;q++){if (this.base.childNodes[q].idd != null){if (this.base.childNodes[q].idd == id)pos = w;w++;}};if (!pos && this._spacer != null){for (var q=0;q<this._spacer.childNodes.length;q++){if (this._spacer.childNodes[q].idd != null){if (this._spacer.childNodes[q].idd == id)pos = w;w++;}}};return pos;};dhtmlXToolbarObject.prototype.setPosition = function(itemId, pos) {this._setPosition(itemId, pos);};dhtmlXToolbarObject.prototype._setPosition = function(id, pos) {if (this.objPull[this.idPrefix+id] == null)return;if (isNaN(pos)) pos = this.base.childNodes.length;if (pos < 0)pos = 0;var spacerId = null;if (this._spacer){spacerId = this._spacer.idd;this.removeSpacer();};var item = this.objPull[this.idPrefix+id];this.base.removeChild(item.obj);if (item.arw)this.base.removeChild(item.arw);var newPos = this._getIdByPosition(pos, true);if (newPos[0] == null){this.base.appendChild(item.obj);if (item.arw)this.base.appendChild(item.arw);}else {this.base.insertBefore(item.obj, this.base.childNodes[newPos[1]]);if (item.arw)this.base.insertBefore(item.arw, this.base.childNodes[newPos[1]+1]);};if (spacerId != null)this.addSpacer(spacerId);};dhtmlXToolbarObject.prototype._getIdByPosition = function(pos, retRealPos) {var id = null;var w = 0;var realPos = 0;for (var q=0;q<this.base.childNodes.length;q++){if (this.base.childNodes[q]["idd"] != null && id == null){if ((w++)== pos) id = this.base.childNodes[q]["idd"];};if (id == null)realPos++;};realPos = (id==null?null:realPos);return (retRealPos==true?new Array(id, realPos):id);};dhtmlXToolbarObject.prototype.removeItem = function(itemId) {this._removeItem(itemId);};dhtmlXToolbarObject.prototype._removeItem = function(itemId) {var t = this.getType(itemId);itemId = this.idPrefix+itemId;var p = this.objPull[itemId];if (t == "button"){p.obj._doOnMouseOver = null;p.obj._doOnMouseOut = null;p.obj._doOnMouseUp = null;p.obj._doOnMouseUpOnceAnywhere = null;p.obj.onclick = null;p.obj.onmouseover = null;p.obj.onmouseout = null;p.obj.onmouseup = null;p.obj.onmousedown = null;p.obj.onselectstart = null;p.obj.renderAs = null;p.obj.idd = null;p.obj.parentNode.removeChild(p.obj);p.obj = null;p.id = null;p.state = null;p.img = null;p.imgEn = null;p.imgDis = null;p.type = null;p.enableItem = null;p.disableItem = null;p.isEnabled = null;p.showItem = null;p.hideItem = null;p.isVisible = null;p.setItemText = null;p.getItemText = null;p.setItemImage = null;p.clearItemImage = null;p.setItemImageDis = null;p.clearItemImageDis = null;p.setItemToolTip = null;p.getItemToolTip = null;};if (t == "buttonTwoState"){p.obj._doOnMouseOver = null;p.obj._doOnMouseOut = null;p.obj.onmouseover = null;p.obj.onmouseout = null;p.obj.onmousedown = null;p.obj.onselectstart = null;p.obj.renderAs = null;p.obj.idd = null;p.obj.parentNode.removeChild(p.obj);p.obj = null;p.id = null;p.state = null;p.img = null;p.imgEn = null;p.imgDis = null;p.type = null;p.enableItem = null;p.disableItem = null;p.isEnabled = null;p.showItem = null;p.hideItem = null;p.isVisible = null;p.setItemText = null;p.getItemText = null;p.setItemImage = null;p.clearItemImage = null;p.setItemImageDis = null;p.clearItemImageDis = null;p.setItemToolTip = null;p.getItemToolTip = null;p.setItemState = null;p.getItemState = null;};if (t == "buttonSelect"){for (var a in p._listOptions)this.removeListOption(itemId, a);p._listOptions = null;if (p.polygon._ie6cover){document.body.removeChild(p.polygon._ie6cover);p.polygon._ie6cover = null;};p.p_tbl.removeChild(p.p_tbody);p.polygon.removeChild(p.p_tbl);p.polygon.onselectstart = null;document.body.removeChild(p.polygon);p.p_tbody = null;p.p_tbl = null;p.polygon = null;p.obj.onclick = null;p.obj.onmouseover = null;p.obj.onmouseout = null;p.obj.onmouseup = null;p.obj.onmousedown = null;p.obj.onselectstart = null;p.obj.idd = null;p.obj.iddPrefix = null;p.obj.parentNode.removeChild(p.obj);p.obj = null;p.arw.onclick = null;p.arw.onmouseover = null;p.arw.onmouseout = null;p.arw.onmouseup = null;p.arw.onmousedown = null;p.arw.onselectstart = null;p.arw.parentNode.removeChild(p.arw);p.arw = null;p.renderSelect = null;p.state = null;p.type = null;p.id = null;p.img = null;p.imgEn = null;p.imgDis = null;p.openAll = null;p._isListButton = null;p._separatorButtonSelectObject = null;p._buttonButtonSelectObject = null;p.setWidth = null;p.enableItem = null;p.disableItem = null;p.isEnabled = null;p.showItem = null;p.hideItem = null;p.isVisible = null;p.setItemText = null;p.getItemText = null;p.setItemImage = null;p.clearItemImage = null;p.setItemImageDis = null;p.clearItemImageDis = null;p.setItemToolTip = null;p.getItemToolTip = null;p.addListOption = null;p.removeListOption = null;p.showListOption = null;p.hideListOption = null;p.isListOptionVisible = null;p.enableListOption = null;p.disableListOption = null;p.isListOptionEnabled = null;p.setListOptionPosition = null;p.getListOptionPosition = null;p.setListOptionImage = null;p.getListOptionImage = null;p.clearListOptionImage = null;p.setListOptionText = null;p.getListOptionText = null;p.setListOptionToolTip = null;p.getListOptionToolTip = null;p.forEachListOption = null;p.getAllListOptions = null;p.setListOptionSelected = null;p.getListOptionSelected = null;};if (t == "buttonInput"){p.obj.childNodes[0].onkeydown = null;p.obj.removeChild(p.obj.childNodes[0]);p.obj.w = null;p.obj.idd = null;p.obj.parentNode.removeChild(p.obj);p.obj = null;p.id = null;p.type = null;p.enableItem = null;p.disableItem = null;p.isEnabled = null;p.showItem = null;p.hideItem = null;p.isVisible = null;p.setItemToolTip = null;p.getItemToolTip = null;p.setWidth = null;p.getWidth = null;p.setValue = null;p.getValue = null;p.setItemText = null;p.getItemText = null;};if (t == "slider"){if (_isIE){document.body.detachEvent("onmousemove", p.pen._doOnMouseMoveStart);document.body.detachEvent("onmouseup", p.pen._doOnMouseMoveEnd);}else {window.removeEventListener("mousemove", p.pen._doOnMouseMoveStart, false);window.removeEventListener("mouseup", p.pen._doOnMouseMoveEnd, false);};p.pen.allowMove = null;p.pen.initXY = null;p.pen.maxX = null;p.pen.minX = null;p.pen.nowX = null;p.pen.newNowX = null;p.pen.valueMax = null;p.pen.valueMin = null;p.pen.valueNow = null;p.pen._definePos = null;p.pen._detectLimits = null;p.pen._doOnMouseMoveStart = null;p.pen._doOnMouseMoveEnd = null;p.pen.onmousedown = null;p.obj.removeChild(p.pen);p.pen = null;p.label.tip = null;document.body.removeChild(p.label);p.label = null;p.obj.onselectstart = null;p.obj.idd = null;while (p.obj.childNodes.length > 0)p.obj.removeChild(p.obj.childNodes[0]);p.obj.parentNode.removeChild(p.obj);p.obj = null;p.id = null;p.type = null;p.state = null;p.enableItem = null;p.disableItem = null;p.isEnabled = null;p.setItemToolTipTemplate = null;p.getItemToolTipTemplate = null;p.setMaxValue = null;p.setMinValue = null;p.getMaxValue = null;p.getMinValue = null;p.setValue = null;p.getValue = null;p.showItem = null;p.hideItem = null;p.isVisible = null;};if (t == "separator"){p.obj.onselectstart = null;p.obj.idd = null;p.obj.parentNode.removeChild(p.obj);p.obj = null;p.id = null;p.type = null;p.showItem = null;p.hideItem = null;p.isVisible = null;};if (t == "text"){p.obj.onselectstart = null;p.obj.idd = null;p.obj.parentNode.removeChild(p.obj);p.obj = null;p.id = null;p.type = null;p.showItem = null;p.hideItem = null;p.isVisible = null;p.setWidth = null;p.setItemText = null;p.getItemText = null;};t = null;p = null;this.objPull[this.idPrefix+itemId] = null;delete this.objPull[this.idPrefix+itemId];return
 
 obj.parentNode.removeChild(obj);if (el["type"] == "separator"){el.hideItem = null;el.isVisible = null;el.showItem = null;el.obj.onselectstart = null;if (el.obj.parentNode)el.obj.parentNode.removeChild(el.obj);el.obj = null;el.tr = null;};if (el["type"] == "button"){el.clearItemImage = null;el.clearItemImageDis = null;el.disableItem = null;el.enableItem = null;el.getItemText = null;el.getItemToolTip = null;el.hideItem = null;el.isEnabled = null;el.isVisible = null;el.setItemImage = null;el.setItemImageDis = null;el.setItemText = null;el.setItemToolTip = null;el.showItem = null;el.obj.onselectstart = null;el.obj.onmouseover = null;el.obj.onmouseout = null;el.obj._doOnMouseOver = null;el.obj._doOnMouseOut = null;el.obj.onclick = null;el.obj.onmousedown = null;el.obj.onmouseover = null;el.obj.onmouseout = null;el.obj.onmouseup = null;el.obj._doOnMouseUp = null;el.obj._doOnMouseUpOnceAnywhere = null;if (el.obj.parentNode)el.obj.parentNode.removeChild(el.obj);el.obj = null;el.tr = null;};if (el["type"] == "text"){el.getItemText = null;el.hideItem = null;el.isVisible = null;el.setItemText = null;el.setWidth = null;el.showItem = null;el.obj.onselectstart = null;if (el.obj.parentNode)el.obj.parentNode.removeChild(el.obj);el.obj = null;el.tr = null;};if (el["type"] == "buttonSelect"){el._buttonButtonSelectObject = null;el._separatorButtonSelectObject = null;el.addListOption = null;el.clearItemImage = null;el.clearItemImageDis = null;el.clearListOptionImage = null;el.disableItem = null;el.disableListOption = null;el.enableItem = null;el.enableListOption = null;el.forEachListOption = null;el.getAllListOptions = null;el.getItemText = null;el.getItemToolTip = null;el.getListOptionImage = null;el.getListOptionPosition = null;el.getListOptionSelected = null;el.getListOptionText = null;el.getListOptionToolTip = null;el.hideItem = null;el.hideListOption = null;el.isEnabled = null;el.isListOptionEnabled = null;el.isListOptionVisible = null;el.isVisible = null;el.removeListOption = null;el.setItemImage = null;el.setItemImageDis = null;el.setItemText = null;el.setItemToolTip = null;el.setListOptionImage = null;el.setListOptionPosition = null;el.setListOptionSelected = null;el.setListOptionText = null;el.setListOptionToolTip = null;el.setWidth = null;el.showItem = null;el.showListOption = null;for (var k in el._listOptions){var op = el._listOptions[k];op.onmouseover = null;op.onmouseout = null;op.onclick = null;op.onselectstart = null;if (op.parentNode)op.parentNode.removeChild(op);op = null;try {el._listOptions[k] = null;delete el._listOptions[k];}catch(e) {}};el._listOptions = null;if (el.polygon._ie6cover){if (el.polygon._ie6cover.parentNode)el.polygon._ie6cover.parentNode.removeChild(el.polygon._ie6cover);el.polygon._ie6cover = null;};if (el.polygon.parentNode)el.polygon.parentNode.removeChild(el.polygon);el.polygon = null;el.obj.onmouseover = null;el.obj.onmouseout = null;el.obj.onclick = null;el.obj.onmousedown = null;el.obj.onmouseup = null;if (el.obj.parentNode)el.obj.parentNode.removeChild(el.obj);el.obj = null;el.arw.onmouseover = null;el.arw.onmouseout = null;el.arw.onclick = null;el.arw.onmousedown = null;el.arw.onmouseup = null;if (el.arw.parentNode)el.arw.parentNode.removeChild(el.arw);el.arw = null;};if (el["type"] == "buttonInput"){el.disableItem = null;el.enableItem = null;el.getItemToolTip = null;el.getValue = null;el.getWidth = null;el.hideItem = null;el.isEnabled = null;el.isVisible = null;el.setItemToolTip = null;el.setValue = null;el.setWidth = null;el.showItem = null;el.obj.childNodes[0].onkeydown = null;if (el.obj.parentNode)el.obj.parentNode.removeChild(el.obj);el.obj = null;el.tr = null;};if (el["type"] == "buttonTwoState"){el.clearItemImage = null;el.clearItemImageDis = null;el.disableItem = null;el.enableItem = null;el.getItemState = null;el.getItemText = null;el.getItemToolTip = null;el.hideItem = null;el.isEnabled = null;el.isVisible = null;el.setItemImage = null;el.setItemImageDis = null;el.setItemState = null;el.setItemText = null;el.setItemToolTip = null;el.showItem = null;el.state = null;el.obj.onselectstart = null;el.obj.onmouseover = null;el.obj.onmouseout = null;el.obj.onmousedown = null;el.obj.onmouseup = null;el.obj._doOnMouseOver = null;el.obj._doOnMouseOut = null;if (el.obj.parentNode)el.obj.parentNode.removeChild(el.obj);el.obj = null;el.tr = null;};if (el["type"] == "slider"){el.disableItem = null;el.enableItem = null;el.getItemToolTipTemplate = null;el.getMaxValue = null;el.getMinValue = null;el.getValue = null;el.hideItem = null;el.isEnabled = null;el.isVisible = null;el.setItemToolTipTemplate = null;el.setMaxValue = null;el.setMinValue = null;el.setValue = null;el.showItem = null;el.obj.onselectstart = null;var pen = el.pen;if (_isIE){document.body.detachEvent("onmousemove", pen._doOnMouseMoveStart);document.body.detachEvent("onmouseup", pen._doOnMouseMoveEnd);}else {window.removeEventListener("mousemove", pen._doOnMouseMoveStart, false);window.removeEventListener("mouseup", pen._doOnMouseMoveEnd, false);};pen = null;el.pen.allowMove = null;el.pen.onmousedown = null;el.pen._detectLimits = null;el.pen._definePos = null;el.pen._doOnMouseMoveStart = null;el.pen._doOnMouseMoveEnd = null;el.pen.valueMin = null;el.pen.valueMax = null;el.pen.valueNow = null;el.label.tip = null;if (el.pen.parentNode)el.pen.parentNode.removeChild(el.pen);el.pen = null;if (el.label.parentNode)el.label.parentNode.removeChild(el.label);el.label = null;if (el.obj.parentNode)el.obj.parentNode.removeChild(el.obj);el.obj = null;};el["id"] = null;el["type"] = null;el = null;try {this.objPull[id] = null;delete this.objPull[id];}catch(e) {}};(function(){var list="addListOption,removeListOption,showListOption,hideListOption,isListOptionVisible,enableListOption,disableListOption,isListOptionEnabled,setListOptionPosition,getListOptionPosition,setListOptionText,getListOptionText,setListOptionToolTip,getListOptionToolTip,setListOptionImage,getListOptionImage,clearListOptionImage,forEachListOption,getAllListOptions,setListOptionSelected,getListOptionSelected".split(",")
 var functor = function(name){return function(parentId,a,b,c,d,e){parentId = this.idPrefix+parentId;if (this.objPull[parentId] == null)return;if (this.objPull[parentId]["type"] != "buttonSelect")return;return this.objPull[parentId][name].call(this.objPull[parentId],a,b,c,d,e);}};for (var i=0;i<list.length;i++){var name=list[i];dhtmlXToolbarObject.prototype[name]=functor(name)
 }})()











































dhtmlXToolbarObject.prototype._rtlParseBtn = function(t1, t2) {return t1+t2;};dhtmlXToolbarObject.prototype._separatorObject = function(that, id, data) {this.id = that.idPrefix+id;this.obj = document.createElement("DIV");this.obj.className = "dhx_toolbar_sep";this.obj.style.display = (data.hidden!=null?"none":"");this.obj.idd = String(id);this.obj.title = (data.title||"");this.obj.onselectstart = function(e) {e = e||event;e.returnValue = false;};that.base.appendChild(this.obj);this.showItem = function() {this.obj.style.display = "";};this.hideItem = function() {this.obj.style.display = "none";};this.isVisible = function() {return (this.obj.style.display == "");};return this;};dhtmlXToolbarObject.prototype._textObject = function(that, id, data) {this.id = that.idPrefix+id;this.obj = document.createElement("DIV");this.obj.className = "dhx_toolbar_text";this.obj.style.display = (data.hidden!=null?"none":"");this.obj.idd = String(id);this.obj.title = (data.title||"");this.obj.onselectstart = function(e) {e = e||event;e.returnValue = false;};this.obj.innerHTML = (data.text||"");that.base.appendChild(this.obj);this.showItem = function() {this.obj.style.display = "";};this.hideItem = function() {this.obj.style.display = "none";};this.isVisible = function() {return (this.obj.style.display == "");};this.setItemText = function(text) {this.obj.innerHTML = text;};this.getItemText = function() {return this.obj.innerHTML;};this.setWidth = function(width) {this.obj.style.width = width+"px";};return this;};dhtmlXToolbarObject.prototype._buttonObject = function(that, id, data) {this.id = that.idPrefix+id;this.state = (data.enabled!=null?false:true);this.imgEn = (data.img||"");this.imgDis = (data.imgdis||"");this.img = (this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.obj = document.createElement("DIV");this.obj.className = "dhx_toolbar_btn "+(this.state?"def":"dis");this.obj.style.display = (data.hidden!=null?"none":"");this.obj.allowClick = false;this.obj.extAction = (data.action||null);this.obj.renderAs = this.obj.className;this.obj.idd = String(id);this.obj.title = (data.title||"");this.obj.pressed = false;this.obj.innerHTML = that._rtlParseBtn((this.img!=""?"<img src='"+that.imagePath+this.img+"'>":""), (data.text!=null?"<div>"+data.text+"</div>":""));var obj = this;this.obj.onselectstart = function(e) {e = e||event;e.returnValue = false;};this.obj.onmouseover = function() {this._doOnMouseOver();};this.obj.onmouseout = function() {this._doOnMouseOut();};this.obj._doOnMouseOver = function() {this.allowClick = true;if (obj.state == false)return;if (that.anyUsed != "none")return;this.className = "dhx_toolbar_btn over";this.renderAs = this.className;};this.obj._doOnMouseOut = function() {this.allowClick = false;if (obj.state == false)return;if (that.anyUsed != "none")return;this.className = "dhx_toolbar_btn def";this.renderAs = this.renderAs;};this.obj.onclick = function(e) {if (obj.state == false)return;if (this.allowClick == false)return;e = e||event;var id = this.idd.replace(that.idPrefix,"");if (this.extAction)try {window[this.extAction](id);}catch(e){};that.callEvent("onClick", [id]);};this.obj.onmousedown = function(e) {if (obj.state == false)return;if (that.anyUsed != "none")return;that.anyUsed = this.idd;this.className = "dhx_toolbar_btn pres";this.pressed = true;this.onmouseover = function() {this._doOnMouseOver();};this.onmouseout = function() {that.anyUsed = "none";this._doOnMouseOut();};return false;};this.obj.onmouseup = function(e) {if (obj.state == false)return;if (that.anyUsed != "none"){if (that.anyUsed != this.idd)return;};this._doOnMouseUp();};this.obj._doOnMouseUp = function() {that.anyUsed = "none";this.className = this.renderAs;this.pressed = false;};this.obj._doOnMouseUpOnceAnywhere = function() {this._doOnMouseUp();this.onmouseover = function() {this._doOnMouseOver();};this.onmouseout = function() {this._doOnMouseOut();}};that.base.appendChild(this.obj);this.enableItem = function() {that._enableItem(this);};this.disableItem = function() {that._disableItem(this);};this.isEnabled = function() {return this.state;};this.showItem = function() {this.obj.style.display = "";};this.hideItem = function() {this.obj.style.display = "none";};this.isVisible = function() {return (this.obj.style.display == "");};this.setItemText = function(text) {that._setItemText(this, text);};this.getItemText = function() {return that._getItemText(this);};this.setItemImage = function(url) {that._setItemImage(this, url, true);};this.clearItemImage = function() {that._clearItemImage(this, true);};this.setItemImageDis = function(url) {that._setItemImage(this, url, false);};this.clearItemImageDis = function() {that._clearItemImage(this, false);};this.setItemToolTip = function(tip) {this.obj.title = tip;};this.getItemToolTip = function() {return this.obj.title;};return this;};dhtmlXToolbarObject.prototype._buttonSelectObject = function(that, id, data) {this.id = that.idPrefix+id;this.state = (data.enabled!=null?(data.enabled=="true"?true:false):true);this.imgEn = (data.img||"");this.imgDis = (data.imgdis||"");this.img = (this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.openAll = (data.openAll!=null);this.obj = document.createElement("DIV");this.obj.allowClick = false;this.obj.extAction = (data.action||null);this.obj.className = "dhx_toolbar_btn def";this.obj.style.display = (data.hidden!=null?"none":"");this.obj.renderAs = this.obj.className;this.obj.onselectstart = function(e) {e = e||event;e.returnValue = false;};this.obj.idd = String(id);this.obj.title = (data.title||"");this.obj.pressed = false;this.renderSelect = (data.renderSelect!=null?(data.renderSelect=="false"||data.renderSelect=="disabled"?false:true):true);this.obj.innerHTML = that._rtlParseBtn((this.img!=""?"<img src='"+that.imagePath+this.img+"'>":""),(data.text!=null?"<div>"+data.text+"</div>":""));that.base.appendChild(this.obj);this.arw = document.createElement("DIV");this.arw.className = "dhx_toolbar_arw def";this.arw.style.display = this.obj.style.display;this.arw.innerHTML = "<div class='arwimg'>&nbsp;</div>";this.arw.title = this.obj.title;this.arw.onselectstart = function(e) {e = e||event;e.returnValue = false;};that.base.appendChild(this.arw);var self = this;this.obj.onmouseover = function(e) {e = e||event;if (that.anyUsed != "none")return;if (!self.state)return;self.obj.renderAs = "dhx_toolbar_btn over";self.obj.className = self.obj.renderAs;self.arw.className = String(self.obj.renderAs).replace("btn","arw");};this.obj.onmouseout = function() {self.obj.allowClick = false;if (that.anyUsed != "none")return;if (!self.state)return;self.obj.renderAs = "dhx_toolbar_btn def";self.obj.className = self.obj.renderAs;self.arw.className = String(self.obj.renderAs).replace("btn","arw");};this.arw.onmouseover = this.obj.onmouseover;this.arw.onmouseout = this.obj.onmouseout;if (this.openAll == true){}else {this.obj.onclick = function(e) {e = e||event;if (!self.obj.allowClick)return;if (!self.state)return;if (that.anyUsed != "none")return;var id = self.obj.idd.replace(that.idPrefix,"");if (self.obj.extAction)try {window[self.obj.extAction](id);}catch(e){};that.callEvent("onClick", [id]);};this.obj.onmousedown = function(e) {e = e||event;if (that.anyUsed != "none")return;if (!self.state)return;self.obj.allowClick = true;self.obj.className = "dhx_toolbar_btn pres";self.arw.className = "dhx_toolbar_arw pres";};this.obj.onmouseup = function(e) {e = e||event;e.cancelBubble = true;if (that.anyUsed != "none")return;if (!self.state)return;self.obj.className = self.obj.renderAs;self.arw.className = String(self.obj.renderAs).replace("btn","arw");}};this.arw.onmousedown = function(e) {e = e||event;if (!self.state)return;if (that.anyUsed == self.obj.idd){self.obj.className = self.obj.renderAs;self.arw.className = String(self.obj.renderAs).replace("btn","arw");that.anyUsed = "none";self.polygon.style.display = "none";if (self.polygon._ie6cover)self.polygon._ie6cover.style.display = "none";}else {if (that.anyUsed != "none"){if (that.objPull[that.idPrefix+that.anyUsed]["type"] == "buttonSelect"){var item = that.objPull[that.idPrefix+that.anyUsed];if (item.polygon.style.display != "none"){item.obj.renderAs = "dhx_toolbar_btn def";item.obj.className = item.obj.renderAs;item.arw.className = String(self.obj.renderAs).replace("btn","arw");item.polygon.style.display = "none";if (item.polygon._ie6cover)item.polygon._ie6cover.style.display = "none";}}};self.obj.className = "dhx_toolbar_btn over";self.arw.className = "dhx_toolbar_arw pres";that.anyUsed = self.obj.idd;self.polygon.style.top = "0px";self.polygon.style.visibility = "hidden";self.polygon.style.display = "";that._autoDetectVisibleArea();var newTop = getAbsoluteTop(self.obj)+self.obj.offsetHeight+that.selectPolygonOffsetTop;var newH = self.polygon.offsetHeight;if (newTop + newH > that.tY2){newTop = getAbsoluteTop(self.obj)-newH-that.selectPolygonOffsetTop;if (newTop < 0)newTop = 0;};self.polygon.style.top = newTop+"px";if (that.rtl){self.polygon.style.left = getAbsoluteLeft(self.obj)+self.obj.offsetWidth-self.polygon.offsetWidth+that.selectPolygonOffsetLeft+"px";}else {self.polygon.style.left = getAbsoluteLeft(self.obj)+that.selectPolygonOffsetLeft+"px";};self.polygon.style.visibility = "visible";if (self.polygon._ie6cover){self.polygon._ie6cover.style.left = self.polygon.style.left;self.polygon._ie6cover.style.top = self.polygon.style.top;self.polygon._ie6cover.style.width = self.polygon.offsetWidth+"px";self.polygon._ie6cover.style.height = self.polygon.offsetHeight+"px";self.polygon._ie6cover.style.display = "";}};return false;};this.arw.onclick = function(e) {e = e||event;e.cancelBubble = true;};this.arw.onmouseup = function(e) {e = e||event;e.cancelBubble = true;};if (this.openAll === true){this.obj.onclick = this.arw.onclick;this.obj.onmousedown = this.arw.onmousedown;this.obj.onmouseup = this.arw.onmouseup;};this.obj.iddPrefix = that.idPrefix;this._listOptions = {};this._separatorButtonSelectObject = function(id, data, pos) {this.obj = {};this.obj.tr = document.createElement("TR");this.obj.tr.className = "tr_sep";this.obj.tr.onselectstart = function(e) {e = e||event;e.returnValue = false;return false;};this.obj.td = document.createElement("TD");this.obj.td.colSpan = "2";this.obj.td.className = "td_btn_sep";this.obj.td.onselectstart = function(e) {e = e||event;e.returnValue = false;return false;};if (isNaN(pos)) pos = self.p_tbody.childNodes.length+1;else if (pos < 1)pos = 1;if (pos > self.p_tbody.childNodes.length)self.p_tbody.appendChild(this.obj.tr);else self.p_tbody.insertBefore(this.obj.tr, self.p_tbody.childNodes[pos-1]);this.obj.tr.appendChild(this.obj.td);this.obj.sep = document.createElement("DIV");this.obj.sep.className = "btn_sep";this.obj.sep.onselectstart = function(e) {e = e||event;e.returnValue = false;return false;};this.obj.td.appendChild(this.obj.sep);self._listOptions[id] = this.obj;return this;};this._buttonButtonSelectObject = function(id, data, pos) {this.obj = {};this.obj.tr = document.createElement("TR");this.obj.tr.en = (data.enabled=="false"?false:(data.disabled=="true"?false:true));this.obj.tr.extAction = (data.action||null);this.obj.tr._selected = (data.selected!=null);this.obj.tr.className = "tr_btn"+(this.obj.tr.en?(this.obj.tr._selected&&self.renderSelect?" tr_btn_selected":""):" tr_btn_disabled");this.obj.tr.onselectstart = function(e) {e = e||event;e.returnValue = false;return false;};this.obj.tr.idd = String(id);if (isNaN(pos)) pos = self.p_tbody.childNodes.length+1;else if (pos < 1)pos = 1;if (pos > self.p_tbody.childNodes.length)self.p_tbody.appendChild(this.obj.tr);else self.p_tbody.insertBefore(this.obj.tr, self.p_tbody.childNodes[pos-1]);this.obj.td_a = document.createElement("TD");this.obj.td_a.className = "td_btn_img";this.obj.td_a.onselectstart = function(e) {e = e||event;e.returnValue = false;return false;};this.obj.td_b = document.createElement("TD");this.obj.td_b.className = "td_btn_txt";this.obj.td_b.onselectstart = function(e) {e = e||event;e.returnValue = false;return false;};if (that.rtl){this.obj.tr.appendChild(this.obj.td_b);this.obj.tr.appendChild(this.obj.td_a);}else {this.obj.tr.appendChild(this.obj.td_a);this.obj.tr.appendChild(this.obj.td_b);};if (data.img != null)this.obj.td_a.innerHTML = "<img class='btn_sel_img' src='"+that.imagePath+data.img+"' border='0'>";var itemText = (data.text!=null?data.text:(data.itemText||""));this.obj.td_b.innerHTML = "<div class='btn_sel_text'>"+itemText+"</div>";this.obj.tr.onmouseover = function() {if (!this.en || (this._selected && self.renderSelect)) return;this.className = "tr_btn tr_btn_over";};this.obj.tr.onmouseout = function() {if (!this.en)return;if (this._selected && self.renderSelect){if (String(this.className).search("tr_btn_selected") == -1) this.className = "tr_btn tr_btn_selected";}else {this.className = "tr_btn";}};this.obj.tr.onclick = function(e) {e = e||event;e.cancelBubble = true;if (!this.en)return;self.setListOptionSelected(this.idd.replace(that.idPrefix,""));self.obj.renderAs = "dhx_toolbar_btn def";self.obj.className = self.obj.renderAs;self.arw.className = String(self.obj.renderAs).replace("btn","arw");self.polygon.style.display = "none";if (self.polygon._ie6cover)self.polygon._ie6cover.style.display = "none";that.anyUsed = "none";var id = this.idd.replace(that.idPrefix,"");if (this.extAction)try {window[this.extAction](id);}catch(e){};that.callEvent("onClick", [id]);};self._listOptions[id] = this.obj;return this;};this.polygon = document.createElement("DIV");this.polygon.dir = "ltr";this.polygon.style.display = "none";this.polygon.style.zIndex = 101;this.polygon.className = "dhx_toolbar_poly_"+that.skin+(that.rtl?" rtl":"");this.polygon.onselectstart = function(e) {e = e||event;e.returnValue = false;};this.p_tbl = document.createElement("TABLE");this.p_tbl.className = "buttons_cont";this.p_tbl.cellSpacing = "0";this.p_tbl.cellPadding = "0";this.p_tbl.border = "0";this.polygon.appendChild(this.p_tbl);this.p_tbody = document.createElement("TBODY");this.p_tbl.appendChild(this.p_tbody);if (data.items){for (var q=0;q<data.items.length;q++){var t = "_"+(data.items[q].type||"")+"ButtonSelectObject";if (typeof(this[t])== "function") new this[t](data.items[q].id||that._genStr(24),data.items[q]);}};document.body.appendChild(this.polygon);if (that._isIE6){this.polygon._ie6cover = document.createElement("IFRAME");this.polygon._ie6cover.frameBorder = 0;this.polygon._ie6cover.style.position = "absolute";this.polygon._ie6cover.style.border = "none";this.polygon._ie6cover.style.backgroundColor = "#000000";this.polygon._ie6cover.style.filter = "alpha(opacity=100)";this.polygon._ie6cover.style.display = "none";this.polygon._ie6cover.setAttribute("src","javascript:false;");document.body.appendChild(this.polygon._ie6cover);};this.setWidth = function(width) {this.obj.style.width = width-this.arw.offsetWidth+"px";this.polygon.style.width = this.obj.offsetWidth+this.arw.offsetWidth-2+"px";this.p_tbl.style.width = this.polygon.style.width;};this.enableItem = function() {that._enableItem(this);};this.disableItem = function() {that._disableItem(this);};this.isEnabled = function() {return this.state;};this.showItem = function() {this.obj.style.display = "";this.arw.style.display = "";};this.hideItem = function() {this.obj.style.display = "none";this.arw.style.display = "none";};this.isVisible = function() {return (this.obj.style.display == "");};this.setItemText = function(text) {that._setItemText(this, text);};this.getItemText = function() {return that._getItemText(this);};this.setItemImage = function(url) {that._setItemImage(this, url, true);};this.clearItemImage = function() {that._clearItemImage(this, true);};this.setItemImageDis = function(url) {that._setItemImage(this, url, false);};this.clearItemImageDis = function() {that._clearItemImage(this, false);};this.setItemToolTip = function(tip) {this.obj.title = tip;this.arw.title = tip;};this.getItemToolTip = function() {return this.obj.title;};this.addListOption = function(id, pos, type, text, img) {if (!(type == "button" || type == "separator")) return;var dataItem = {id:id,type:type,text:text,img:img};new this["_"+type+"ButtonSelectObject"](id, dataItem, pos);};this.removeListOption = function(id) {if (!this._isListButton(id, true)) return;var item = this._listOptions[id];if (item.td_a != null && item.td_b != null){item.td_a.onselectstart = null;item.td_b.onselectstart = null;while (item.td_a.childNodes.length > 0)item.td_a.removeChild(item.td_a.childNodes[0]);while (item.td_b.childNodes.length > 0)item.td_b.removeChild(item.td_b.childNodes[0]);item.tr.onselectstart = null;item.tr.onmouseover = null;item.tr.onmouseout = null;item.tr.onclick = null;while (item.tr.childNodes.length > 0)item.tr.removeChild(item.tr.childNodes[0]);item.tr.parentNode.removeChild(item.tr);item.td_a = null;item.td_b = null;item.tr = null;}else {item.sep.onselectstart = null;item.td.onselectstart = null;item.tr.onselectstart = null;while (item.td.childNodes.length > 0)item.td.removeChild(item.td.childNodes[0]);while (item.tr.childNodes.length > 0)item.tr.removeChild(item.tr.childNodes[0]);item.tr.parentNode.removeChild(item.tr);item.sep = null;item.td = null;item.tr = null;};item = null;this._listOptions[id] = null;try {delete this._listOptions[id];}catch(e) {}};this.showListOption = function(id) {if (!this._isListButton(id, true)) return;this._listOptions[id].tr.style.display = "";};this.hideListOption = function(id) {if (!this._isListButton(id, true)) return;this._listOptions[id].tr.style.display = "none";};this.isListOptionVisible = function(id) {if (!this._isListButton(id, true)) return;return (this._listOptions[id].tr.style.display != "none");};this.enableListOption = function(id) {if (!this._isListButton(id)) return;this._listOptions[id].tr.en = true;this._listOptions[id].tr.className = "tr_btn"+(this._listOptions[id].tr._selected&&that.renderSelect?" tr_btn_selected":"");};this.disableListOption = function(id) {if (!this._isListButton(id)) return;this._listOptions[id].tr.en = false;this._listOptions[id].tr.className = "tr_btn tr_btn_disabled";};this.isListOptionEnabled = function(id) {if (!this._isListButton(id)) return;return this._listOptions[id].tr.en;};this.setListOptionPosition = function(id, pos) {if (!this._listOptions[id] || this.getListOptionPosition(id)== pos || isNaN(pos)) return;if (pos < 1)pos = 1;var tr = this._listOptions[id].tr;this.p_tbody.removeChild(tr);if (pos > this.p_tbody.childNodes.length)this.p_tbody.appendChild(tr);else this.p_tbody.insertBefore(tr, this.p_tbody.childNodes[pos-1]);tr = null;};this.getListOptionPosition = function(id) {var pos = -1;if (!this._listOptions[id])return pos;for (var q=0;q<this.p_tbody.childNodes.length;q++)if (this.p_tbody.childNodes[q] == this._listOptions[id].tr)pos=q+1;return pos;};this.setListOptionImage = function(id, img) {if (!this._isListButton(id)) return;var td = this._listOptions[id].tr.childNodes[(that.rtl?1:0)];if (td.childNodes.length > 0){td.childNodes[0].src = that.imagePath+img;}else {var imgObj = document.createElement("IMG");imgObj.className = "btn_sel_img";imgObj.src = that.imagePath+img;td.appendChild(imgObj);};td = null;};this.getListOptionImage = function(id) {if (!this._isListButton(id)) return;var td = this._listOptions[id].tr.childNodes[(that.rtl?1:0)];var src = null;if (td.childNodes.length > 0)src = td.childNodes[0].src;td = null;return src;};this.clearListOptionImage = function(id) {if (!this._isListButton(id)) return;var td = this._listOptions[id].tr.childNodes[(that.rtl?1:0)];while (td.childNodes.length > 0)td.removeChild(td.childNodes[0]);td = null;};this.setListOptionText = function(id, text) {if (!this._isListButton(id)) return;this._listOptions[id].tr.childNodes[(that.rtl?0:1)].childNodes[0].innerHTML = text;};this.getListOptionText = function(id) {if (!this._isListButton(id)) return;return this._listOptions[id].tr.childNodes[(that.rtl?0:1)].childNodes[0].innerHTML;};this.setListOptionToolTip = function(id, tip) {if (!this._isListButton(id)) return;this._listOptions[id].tr.title = tip;};this.getListOptionToolTip = function(id) {if (!this._isListButton(id)) return;return this._listOptions[id].tr.title;};this.forEachListOption = function(handler) {for (var a in this._listOptions)handler(a);};this.getAllListOptions = function() {var listData = new Array();for (var a in this._listOptions)listData[listData.length] = a;return listData;};this.setListOptionSelected = function(id) {for (var a in this._listOptions){var item = this._listOptions[a];if (item.td_a != null && item.td_b != null && item.tr.en){if (a == id){item.tr._selected = true;item.className = "tr_btn"+(this.renderSelect?" tr_btn_selected":"");}else {item.tr._selected = false;item.tr.className = "tr_btn";}};item = null;}};this.getListOptionSelected = function() {var id = null;for (var a in this._listOptions)if (this._listOptions[a].tr._selected == true)id = a;return id;};this._isListButton = function(id, allowSeparator) {if (this._listOptions[id] == null)return false;if (!allowSeparator && this._listOptions[id].tr.className == "tr_sep")return false;return true;};return this;};dhtmlXToolbarObject.prototype._buttonInputObject = function(that, id, data) {this.id = that.idPrefix+id;this.obj = document.createElement("DIV");this.obj.className = "dhx_toolbar_btn def";this.obj.style.display = (data.hidden!=null?"none":"");this.obj.idd = String(id);this.obj.w = (data.width!=null?data.width:100);this.obj.title = (data.title!=null?data.title:"");this.obj.innerHTML = "<input class='inp' type='text' style='-moz-user-select:text;width:"+this.obj.w+"px;'"+(data.value!=null?"' value='"+data.value+"'":"")+">";var th = that;var self = this;this.obj.childNodes[0].onkeydown = function(e) {e = e||event;if (e.keyCode == 13){th.callEvent("onEnter", [self.obj.idd, this.value]);}};that.base.appendChild(this.obj);this.enableItem = function() {this.obj.childNodes[0].disabled = false;};this.disableItem = function() {this.obj.childNodes[0].disabled = true;};this.isEnabled = function() {return (!this.obj.childNodes[0].disabled);};this.showItem = function() {this.obj.style.display = "";};this.hideItem = function() {this.obj.style.display = "none";};this.isVisible = function() {return (this.obj.style.display != "none");};this.setValue = function(value) {this.obj.childNodes[0].value = value;};this.getValue = function() {return this.obj.childNodes[0].value;};this.setWidth = function(width) {this.obj.w = width;this.obj.childNodes[0].style.width = this.obj.w+"px";};this.getWidth = function() {return this.obj.w;};this.setItemToolTip = function(tip) {this.obj.title = tip;};this.getItemToolTip = function() {return this.obj.title;};return this;};dhtmlXToolbarObject.prototype._buttonTwoStateObject = function(that, id, data) {this.id = that.idPrefix+id;this.state = (data.enabled!=null?false:true);this.imgEn = (data.img!=null?data.img:"");this.imgDis = (data.imgdis!=null?data.imgdis:"");this.img = (this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.obj = document.createElement("DIV");this.obj.pressed = (data.selected!=null);this.obj.extAction = (data.action||null);this.obj.className = "dhx_toolbar_btn "+(this.obj.pressed?(this.state?"pres":"dis"):(this.state?"def":"dis"));this.obj.style.display = (data.hidden!=null?"none":"");this.obj.renderAs = this.obj.className;this.obj.idd = String(id);this.obj.title = (data.title||"");if (this.obj.pressed){this.obj.renderAs = "dhx_toolbar_btn over";};this.obj.innerHTML = that._rtlParseBtn((this.img!=""?"<img src='"+that.imagePath+this.img+"'>":""),(data.text!=null?"<div>"+data.text+"</div>":""));that.base.appendChild(this.obj);var obj = this;this.obj.onselectstart = function(e) {e = e||event;e.returnValue = false;};this.obj.onmouseover = function() {this._doOnMouseOver();};this.obj.onmouseout = function() {this._doOnMouseOut();};this.obj._doOnMouseOver = function() {if (obj.state == false)return;if (that.anyUsed != "none")return;if (this.pressed)return;this.className = "dhx_toolbar_btn over";this.renderAs = this.className;};this.obj._doOnMouseOut = function() {if (obj.state == false)return;if (that.anyUsed != "none")return;if (this.pressed)return;this.className = "dhx_toolbar_btn def";this.renderAs = this.className;};this.obj.onmousedown = function(e) {if (that.checkEvent("onBeforeStateChange")) if (!that.callEvent("onBeforeStateChange", [this.idd.replace(that.idPrefix, ""), this.pressed])) return;if (obj.state == false)return;if (that.anyUsed != "none")return;this.pressed = !this.pressed;this.className = (this.pressed?"dhx_toolbar_btn pres":this.renderAs);var id = this.idd.replace(that.idPrefix, "");if (this.extAction)try {window[this.extAction](id, this.pressed);}catch(e){};that.callEvent("onStateChange", [id, this.pressed]);return false;};this.setItemState = function(state, callEvent) {if (this.obj.pressed != state){if (state == true){this.obj.pressed = true;this.obj.className = "dhx_toolbar_btn pres";this.obj.renderAs = "dhx_toolbar_btn over";}else {this.obj.pressed = false;this.obj.className = "dhx_toolbar_btn def";this.obj.renderAs = this.obj.className;};if (callEvent == true){var id = this.obj.idd.replace(that.idPrefix, "");if (this.obj.extAction)try {window[this.obj.extAction](id, this.obj.pressed);}catch(e){};that.callEvent("onStateChange", [id, this.obj.pressed]);}}};this.getItemState = function() {return this.obj.pressed;};this.enableItem = function() {that._enableItem(this);};this.disableItem = function() {that._disableItem(this);};this.isEnabled = function() {return this.state;};this.showItem = function() {this.obj.style.display = "";};this.hideItem = function() {this.obj.style.display = "none";};this.isVisible = function() {return (this.obj.style.display == "");};this.setItemText = function(text) {that._setItemText(this, text);};this.getItemText = function() {return that._getItemText(this);};this.setItemImage = function(url) {that._setItemImage(this, url, true);};this.clearItemImage = function() {that._clearItemImage(this, true);};this.setItemImageDis = function(url) {that._setItemImage(this, url, false);};this.clearItemImageDis = function() {that._clearItemImage(this, false);};this.setItemToolTip = function(tip) {this.obj.title = tip;};this.getItemToolTip = function() {return this.obj.title;};return this;};dhtmlXToolbarObject.prototype._sliderObject = function(that, id, data) {this.id = that.idPrefix+id;this.state = (data.enabled!=null?(data.enabled=="true"?true:false):true);this.obj = document.createElement("DIV");this.obj.className = "dhx_toolbar_btn "+(this.state?"def":"dis");this.obj.style.display = (data.hidden!=null?"none":"");this.obj.onselectstart = function(e) {e = e||event;e.returnValue = false;};this.obj.idd = String(id);this.obj.len = (data.length!=null?Number(data.length):50);this.obj.innerHTML = "<div>"+(data.textMin||"")+"</div>"+
 "<div class='sl_bg_l'></div>"+
 "<div class='sl_bg_m' style='width:"+this.obj.len+"px;'></div>"+
 "<div class='sl_bg_r'></div>"+
 "<div>"+(data.textMax||"")+"</div>";that.base.appendChild(this.obj);var self = this;this.pen = document.createElement("DIV");this.pen.className = "sl_pen";this.obj.appendChild(this.pen);var pen = this.pen;this.label = document.createElement("DIV");this.label.dir = "ltr";this.label.className = "dhx_toolbar_slider_label_"+that.skin+(that.rtl?"_rtl":"");this.label.style.display = "none";this.label.tip = (data.toolTip||"%v");document.body.appendChild(this.label);var label = this.label;this.pen.valueMin = (data.valueMin!=null?Number(data.valueMin):0);this.pen.valueMax = (data.valueMax!=null?Number(data.valueMax):100);if (this.pen.valueMin > this.pen.valueMax)this.pen.valueMin = this.pen.valueMax;this.pen.valueNow = (data.valueNow!=null?Number(data.valueNow):this.pen.valueMax);if (this.pen.valueNow > this.pen.valueMax)this.pen.valueNow = this.pen.valueMax;if (this.pen.valueNow < this.pen.valueMin)this.pen.valueNow = this.pen.valueMin;this.pen._detectLimits = function() {this.minX = self.obj.childNodes[1].offsetLeft-4;this.maxX = self.obj.childNodes[3].offsetLeft-this.offsetWidth+1;};this.pen._detectLimits();this.pen._definePos = function() {this.nowX = Math.round((this.valueNow-this.valueMin)*(this.maxX-this.minX)/(this.valueMax-this.valueMin)+this.minX);this.style.left = this.nowX+"px";this.newNowX = this.nowX;};this.pen._definePos();this.pen.initXY = 0;this.pen.allowMove = false;this.pen.onmousedown = function(e) {if (self.state == false)return;e = e||event;this.initXY = e.clientX;this.newValueNow = this.valueNow;this.allowMove = true;this.className = "sl_pen over";if (label.tip != ""){label.style.visibility = "hidden";label.style.display = "";label.innerHTML = label.tip.replace("%v", this.valueNow);label.style.left = Math.round(getAbsoluteLeft(this)+this.offsetWidth/2-label.offsetWidth/2)+"px";label.style.top = getAbsoluteTop(this)-label.offsetHeight-3+"px";label.style.visibility = "";}};this.pen._doOnMouseMoveStart = function(e) {e=e||event;if (!pen.allowMove)return;var ofst = e.clientX - pen.initXY;if (e.clientX < getAbsoluteLeft(pen)+Math.round(pen.offsetWidth/2) && pen.nowX == pen.minX) return;if (e.clientX > getAbsoluteLeft(pen)+Math.round(pen.offsetWidth/2) && pen.nowX == pen.maxX) return;pen.newNowX = pen.nowX + ofst;if (pen.newNowX < pen.minX)pen.newNowX = pen.minX;if (pen.newNowX > pen.maxX)pen.newNowX = pen.maxX;pen.nowX = pen.newNowX;pen.style.left = pen.nowX+"px";pen.initXY = e.clientX;pen.newValueNow = Math.round((pen.valueMax-pen.valueMin)*(pen.newNowX-pen.minX)/(pen.maxX-pen.minX)+pen.valueMin);if (label.tip != ""){label.innerHTML = label.tip.replace(/%v/gi, pen.newValueNow);label.style.left = Math.round(getAbsoluteLeft(pen)+pen.offsetWidth/2-label.offsetWidth/2)+"px";label.style.top = getAbsoluteTop(pen)-label.offsetHeight-3+"px";}};this.pen._doOnMouseMoveEnd = function() {if (!pen.allowMove)return;pen.className = "sl_pen";pen.allowMove = false;pen.nowX = pen.newNowX;pen.valueNow = pen.newValueNow;if (label.tip != "")label.style.display = "none";that.callEvent("onValueChange", [self.obj.idd.replace(that.idPrefix, ""), pen.valueNow]);};if (_isIE){document.body.attachEvent("onmousemove", pen._doOnMouseMoveStart);document.body.attachEvent("onmouseup", pen._doOnMouseMoveEnd);}else {window.addEventListener("mousemove", pen._doOnMouseMoveStart, false);window.addEventListener("mouseup", pen._doOnMouseMoveEnd, false);};this.enableItem = function() {if (this.state)return;this.state = true;this.obj.className = "dhx_toolbar_btn def";};this.disableItem = function() {if (!this.state)return;this.state = false;this.obj.className = "dhx_toolbar_btn dis";};this.isEnabled = function() {return this.state;};this.showItem = function() {this.obj.style.display = "";};this.hideItem = function() {this.obj.style.display = "none";};this.isVisible = function() {return (this.obj.style.display == "");};this.setValue = function(value, callEvent) {value = Number(value);if (value < this.pen.valueMin)value = this.pen.valueMin;if (value > this.pen.valueMax)value = this.pen.valueMax;this.pen.valueNow = value;this.pen._definePos();if (callEvent == true)that.callEvent("onValueChange", [this.obj.idd.replace(that.idPrefix, ""), this.pen.valueNow]);};this.getValue = function() {return this.pen.valueNow;};this.setMinValue = function(value, label) {value = Number(value);if (value > this.pen.valueMax)return;this.obj.childNodes[0].innerHTML = label;this.obj.childNodes[0].style.display = (label.length>0?"":"none");this.pen.valueMin = value;if (this.pen.valueNow < this.pen.valueMin)this.pen.valueNow = this.pen.valueMin;this.pen._detectLimits();this.pen._definePos();};this.setMaxValue = function(value, label) {value = Number(value);if (value < this.pen.valueMin)return;this.obj.childNodes[4].innerHTML = label;this.obj.childNodes[4].style.display = (label.length>0?"":"none");this.pen.valueMax = value;if (this.pen.valueNow > this.pen.valueMax)this.pen.valueNow = this.pen.valueMax;this.pen._detectLimits();this.pen._definePos();};this.getMinValue = function() {var label = this.obj.childNodes[0].innerHTML;var value = this.pen.valueMin;return new Array(value, label);};this.getMaxValue = function() {var label = this.obj.childNodes[4].innerHTML;var value = this.pen.valueMax;return new Array(value, label);};this.setItemToolTipTemplate = function(template) {this.label.tip = template;};this.getItemToolTipTemplate = function() {return this.label.tip;};return this;};dhtmlXToolbarObject.prototype.unload = function() {if (_isIE)document.body.detachEvent("onclick", this._doOnClick);else window.removeEventListener("click", this._doOnClick, false);this._doOnClick = null;this.clearAll();this.objPull = null;if (this._xmlLoader){this._xmlLoader.destructor();this._xmlLoader = null;};while (this.base.childNodes.length > 0)this.base.removeChild(this.base.childNodes[0]);this.cont.removeChild(this.base);this.base = null;while (this.cont.childNodes.length > 0)this.cont.removeChild(this.cont.childNodes[0]);this.cont.className = "";this.cont = null;this.detachAllEvents();this.tX1 = null;this.tX2 = null;this.tY1 = null;this.tY2 = null;this._isIE6 = null;this._isWebToolbar = null;this.align = null;this.anyUsed = null;this.idPrefix = null;this.imagePath = null;this.rootTypes = null;this.selectPolygonOffsetLeft = null;this.selectPolygonOffsetTop = null;this.skin = null;this._rtl = null;this._rtlParseBtn = null;this.setRTL = null;this._getObj = null;this._addImgObj = null;this._setItemImage = null;this._clearItemImage = null;this._setItemText = null;this._getItemText = null;this._enableItem = null;this._disableItem = null;this._xmlParser = null;this._doOnLoad = null;this._addItemToStorage = null;this._genStr = null;this._addItem = null;this._getPosition = null;this._setPosition = null;this._getIdByPosition = null;this._separatorObject = null;this._textObject = null;this._buttonObject = null;this._buttonSelectObject = null;this._buttonInputObject = null;this._buttonTwoStateObject = null;this._sliderObject = null;this._autoDetectVisibleArea = null;this.setAlign = null;this.setSkin = null;this.setIconsPath = null;this.setIconPath = null;this.loadXML = null;this.loadXMLString = null;this.attachEvent = null;this.callEvent = null;this.checkEvent = null;this.eventCatcher = null;this.detachEvent = null;this.detachAllEvents = null;this.clearAll = null;this.addSpacer = null;this.removeSpacer = null;this.getType = null;this.getTypeExt = null;this.inArray = null;this.getParentId = null;this.addButton = null;this.addText = null;this.addButtonSelect = null;this.addButtonTwoState = null;this.addSeparator = null;this.addSlider = null;this.addInput = null;this.forEachItem = null;this.showItem = null;this.hideItem = null;this.isVisible = null;this.enableItem = null;this.disableItem = null;this.isEnabled = null;this.setItemText = null;this.getItemText = null;this.setItemToolTip = null;this.getItemToolTip = null;this.setItemImage = null;this.setItemImageDis = null;this.clearItemImage = null;this.clearItemImageDis = null;this.setItemState = null;this.getItemState = null;this.setItemToolTipTemplate = null;this.getItemToolTipTemplate = null;this.setValue = null;this.getValue = null;this.setMinValue = null;this.getMinValue = null;this.setMaxValue = null;this.getMaxValue = null;this.setWidth = null;this.getWidth = null;this.getPosition = null;this.setPosition = null;this.removeItem = null;this.addListOption = null;this.removeListOption = null;this.showListOption = null;this.hideListOption = null;this.isListOptionVisible = null;this.enableListOption = null;this.disableListOption = null;this.isListOptionEnabled = null;this.setListOptionPosition = null;this.getListOptionPosition = null;this.setListOptionText = null;this.getListOptionText = null;this.setListOptionToolTip = null;this.getListOptionToolTip = null;this.setListOptionImage = null;this.getListOptionImage = null;this.clearListOptionImage = null;this.forEachListOption = null;this.getAllListOptions = null;this.setListOptionSelected = null;this.getListOptionSelected = null;this.unload = null;this.setUserData = null;this.getUserData = null;this.items = null;};dhtmlXToolbarObject.prototype._autoDetectVisibleArea = function() {this.tX1 = document.body.scrollLeft;this.tX2 = this.tX1+(window.innerWidth||document.body.clientWidth);this.tY1 = Math.max((_isIE?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop, document.body.scrollTop);this.tY2 = this.tY1+(_isIE?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0,document.body.clientHeight||0):window.innerHeight);};dhtmlXToolbarObject.prototype.setUserData = function(id, name, value) {if (this.objPull[this.idPrefix+id] == null)return;var item = this.objPull[this.idPrefix+id];if (item.userData == null)item.userData = {};item.userData[name] = value;};dhtmlXToolbarObject.prototype.getUserData = function(id, name) {if (this.objPull[this.idPrefix+id] == null)return null;if (this.objPull[this.idPrefix+id].userData == null)return null;if (this.objPull[this.idPrefix+id].userData[name] == null)return null;return this.objPull[this.idPrefix+id].userData[name];};(function(){dhtmlx.extend_api("dhtmlXToolbarObject",{_init:function(obj){return [obj.parent, obj.skin];},
 icon_path:"setIconsPath",
 xml:"loadXML",
 items:"items",
 align:"setAlign",
 rtl:"setRTL",
 skin:"setSkin"
 },{items:function(arr){for (var i=0;i < arr.length;i++){var item = arr[i];if (item.type == "button")this.addButton(item.id, null, item.text, item.img, item.img_disabled);if (item.type == "separator")this.addSeparator(item.id, null);if (item.type == "text")this.addText(item.id, null, item.text);if (item.type == "buttonSelect")this.addButtonSelect(item.id, null, item.text, item.options, item.img, item.img_disabled);if (item.type == "buttonTwoState")this.addButtonTwoState(item.id, null, item.text, item.img, item.img_disabled);if (item.type == "buttonInput")this.addInput(item.id, null, item.text);if (item.type == "slider")this.addSlider(item.id, null, item.length, item.value_min, item.value_max, item.value_now, item.text_min, item.text_max, item.tip_template);if (item.width)this.setWidth(item.id, item.width);if (item.disabled)this.disableItem(item.id);if (item.tooltip)this.setItemToolTip(item.id, item.tooltip);if (item.pressed === true)this.setItemState(item.id, true);}}});})();function xmlPointer(data){this.d=data;};xmlPointer.prototype={text:function(){if (!_isFF)return this.d.xml;var x = new XMLSerializer();return x.serializeToString(this.d);},
 get:function(name){return this.d.getAttribute(name);},
 exists:function(){return !!this.d },
 content:function(){return this.d.firstChild?this.d.firstChild.data:"";}, 
 each:function(name,f,t,i){var a=this.d.childNodes;var c=new xmlPointer();if (a.length)for (i=i||0;i<a.length;i++)if (a[i].tagName==name){c.d=a[i];if(f.apply(t,[c,i])==-1) return;}},
 get_all:function(){var a={};var b=this.d.attributes;for (var i=0;i<b.length;i++)a[b[i].name]=b[i].value;return a;},
 sub:function(name){var a=this.d.childNodes;var c=new xmlPointer();if (a.length)for (var i=0;i<a.length;i++)if (a[i].tagName==name){c.d=a[i];return c;}},
 up:function(name){return new xmlPointer(this.d.parentNode);},
 set:function(name,val){this.d.setAttribute(name,val);},
 clone:function(name){return new xmlPointer(this.d);},
 sub_exists:function(name){var a=this.d.childNodes;if (a.length)for (var i=0;i<a.length;i++)if (a[i].tagName==name)return true;return false;},
 through:function(name,rule,v,f,t){var a=this.d.childNodes;if (a.length)for (var i=0;i<a.length;i++){if (a[i].tagName==name && a[i].getAttribute(rule)!=null && a[i].getAttribute(rule)!="" && (!v || a[i].getAttribute(rule)==v )) {var c=new xmlPointer(a[i]);f.apply(t,[c,i]);};var w=this.d;this.d=a[i];this.through(name,rule,v,f,t);this.d=w;}}};function dhtmlXTreeObject(htmlObject, width, height, rootId){if (_isIE)try {document.execCommand("BackgroundImageCache", false, true);}catch (e){};if (typeof(htmlObject)!="object")
 this.parentObject=document.getElementById(htmlObject);else
 this.parentObject=htmlObject;this.parentObject.style.overflow="hidden";this._itim_dg=true;this.dlmtr=",";this.dropLower=false;this.enableIEImageFix();this.xmlstate=0;this.mytype="tree";this.smcheck=true;this.width=width;this.height=height;this.rootId=rootId;this.childCalc=null;this.def_img_x="18px";this.def_img_y="18px";this.def_line_img_x="18px";this.def_line_img_y="18px";this._dragged=new Array();this._selected=new Array();this.style_pointer="pointer";if (_isIE)this.style_pointer="hand";this._aimgs=true;this.htmlcA=" [";this.htmlcB="]";this.lWin=window;this.cMenu=0;this.mlitems=0;this.iconURL="";this.dadmode=0;this.slowParse=false;this.autoScroll=true;this.hfMode=0;this.nodeCut=new Array();this.XMLsource=0;this.XMLloadingWarning=0;this._idpull={};this._pullSize=0;this.treeLinesOn=true;this.tscheck=false;this.timgen=true;this.dpcpy=false;this._ld_id=null;this._oie_onXLE=[];this.imPath=window.dhx_globalImgPath||"";this.checkArray=new Array("iconUncheckAll.gif","iconCheckAll.gif","iconCheckGray.gif","iconUncheckDis.gif","iconCheckDis.gif","iconCheckDis.gif");this.radioArray=new Array("radio_off.gif","radio_on.gif","radio_on.gif","radio_off.gif","radio_on.gif","radio_on.gif");this.lineArray=new Array("line2.gif","line3.gif","line4.gif","blank.gif","blank.gif","line1.gif");this.minusArray=new Array("minus2.gif","minus3.gif","minus4.gif","minus.gif","minus5.gif");this.plusArray=new Array("plus2.gif","plus3.gif","plus4.gif","plus.gif","plus5.gif");this.imageArray=new Array("leaf.gif","folderOpen.gif","folderClosed.gif");this.cutImg= new Array(0,0,0);this.cutImage="but_cut.gif";dhtmlxEventable(this);this.dragger= new dhtmlDragAndDropObject();this.htmlNode=new dhtmlXTreeItemObject(this.rootId,"",0,this);this.htmlNode.htmlNode.childNodes[0].childNodes[0].style.display="none";this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[0].className="hiddenRow";this.allTree=this._createSelf();this.allTree.appendChild(this.htmlNode.htmlNode);if(_isFF){this.allTree.childNodes[0].width="100%";this.allTree.childNodes[0].style.overflow="hidden";};var self=this;this.allTree.onselectstart=new Function("return false;");if (_isMacOS)this.allTree.oncontextmenu = function(e){return self._doContClick(e||window.event);};this.allTree.onmousedown = function(e){return self._doContClick(e||window.event);};this.XMLLoader=new dtmlXMLLoaderObject(this._parseXMLTree,this,true,this.no_cashe);if (_isIE)this.preventIECashing(true);this.selectionBar=document.createElement("DIV");this.selectionBar.className="selectionBar";this.selectionBar.innerHTML="&nbsp;";this.selectionBar.style.display="none";this.allTree.appendChild(this.selectionBar);if (window.addEventListener)window.addEventListener("unload",function(){try{self.destructor();}catch(e){}},false);if (window.attachEvent)window.attachEvent("onunload",function(){try{self.destructor();}catch(e){}});this.setImagesPath=this.setImagePath;this.setIconsPath=this.setIconPath;if (dhtmlx.image_path)this.setImagePath(dhtmlx.image_path);if (dhtmlx.skin)this.setSkin(dhtmlx.skin);return this;};dhtmlXTreeObject.prototype.setDataMode=function(mode){this._datamode=mode;};dhtmlXTreeObject.prototype._doContClick=function(ev){if (ev.button!=2){if(this._acMenu){if (this._acMenu.hideContextMenu)this._acMenu.hideContextMenu()
 else
 this.cMenu._contextEnd();};return true;};var el=(_isIE?ev.srcElement:ev.target);while ((el)&&(el.tagName!="BODY")) {if (el.parentObject)break;el=el.parentNode;};if ((!el)||(!el.parentObject)) return true;var obj=el.parentObject;if (!this.callEvent("onRightClick",[obj.id,ev]))
 (ev.srcElement||ev.target).oncontextmenu = function(e){(e||event).cancelBubble=true;return false;};this._acMenu=(obj.cMenu||this.cMenu);if (this._acMenu){if (!(this.callEvent("onBeforeContextMenu", [
 obj.id
 ]))) return true;(ev.srcElement||ev.target).oncontextmenu = function(e){(e||event).cancelBubble=true;return false;};if (this._acMenu.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._acMenu.showContextMenu(x-1,y-1)
 this.contextID=obj.id;ev.cancelBubble=true;this._acMenu._skip_hide=true;}else {el.contextMenuId=obj.id;el.contextMenu=this._acMenu;el.a=this._acMenu._contextStart;el.a(el, ev);el.a=null;};return false;};return true;};dhtmlXTreeObject.prototype.enableIEImageFix=function(mode){if (!mode){this._getImg=function(id){return document.createElement((id==this.rootId)?"div":"img");};this._setSrc=function(a,b){a.src=b;};this._getSrc=function(a){return a.src;}}else {this._getImg=function(){var z=document.createElement("DIV");z.innerHTML="&nbsp;";z.className="dhx_bg_img_fix";return z;};this._setSrc=function(a,b){a.style.backgroundImage="url("+b+")";};this._getSrc=function(a){var z=a.style.backgroundImage;return z.substr(4,z.length-5);}}};dhtmlXTreeObject.prototype.destructor=function(){for (var a in this._idpull){var z=this._idpull[a];if (!z)continue;z.parentObject=null;z.treeNod=null;z.childNodes=null;z.span=null;z.tr.nodem=null;z.tr=null;z.htmlNode.objBelong=null;z.htmlNode=null;this._idpull[a]=null;};this.parentObject.innerHTML="";if(this.XMLLoader)this.XMLLoader.destructor();this.allTree.onselectstart = null;this.allTree.oncontextmenu = null;this.allTree.onmousedown = null;for(var a in this){this[a]=null;}};function cObject(){return this;};cObject.prototype= new Object;cObject.prototype.clone = function () {function _dummy(){};_dummy.prototype=this;return new _dummy();};function dhtmlXTreeItemObject(itemId,itemText,parentObject,treeObject,actionHandler,mode){this.htmlNode="";this.acolor="";this.scolor="";this.tr=0;this.childsCount=0;this.tempDOMM=0;this.tempDOMU=0;this.dragSpan=0;this.dragMove=0;this.span=0;this.closeble=1;this.childNodes=new Array();this.userData=new cObject();this.checkstate=0;this.treeNod=treeObject;this.label=itemText;this.parentObject=parentObject;this.actionHandler=actionHandler;this.images=new Array(treeObject.imageArray[0],treeObject.imageArray[1],treeObject.imageArray[2]);this.id=treeObject._globalIdStorageAdd(itemId,this);if (this.treeNod.checkBoxOff )this.htmlNode=this.treeNod._createItem(1,this,mode);else this.htmlNode=this.treeNod._createItem(0,this,mode);this.htmlNode.objBelong=this;return this;};dhtmlXTreeObject.prototype._globalIdStorageAdd=function(itemId,itemObject){if (this._globalIdStorageFind(itemId,1,1)) {itemId=itemId +"_"+(new Date()).valueOf();return this._globalIdStorageAdd(itemId,itemObject);};this._idpull[itemId]=itemObject;this._pullSize++;return itemId;};dhtmlXTreeObject.prototype._globalIdStorageSub=function(itemId){if (this._idpull[itemId]){this._unselectItem(this._idpull[itemId]);this._idpull[itemId]=null;this._pullSize--;};if ((this._locker)&&(this._locker[itemId])) this._locker[itemId]=false;};dhtmlXTreeObject.prototype._globalIdStorageFind=function(itemId,skipXMLSearch,skipParsing,isreparse){var z=this._idpull[itemId]
 if (z){if ((z.unParsed)&&(!skipParsing))
 {this.reParse(z,0);};if (this._srnd && !z.htmlNode)this._buildSRND(z,skipParsing);if ((isreparse)&&(this._edsbpsA)){for (var j=0;j<this._edsbpsA.length;j++)if (this._edsbpsA[j][2]==itemId){dhtmlxError.throwError("getItem","Requested item still in parsing process.",itemId);return null;}};return z;};if ((this.slowParse)&&(itemId!=0)&&(!skipXMLSearch)) return this.preParse(itemId);else


 return null;};dhtmlXTreeObject.prototype._getSubItemsXML=function(p){var z=[];p.each("item",function(c){z.push(c.get("id"));},this)
 return z.join(",");};dhtmlXTreeObject.prototype.enableSmartXMLParsing=function(mode) {this.slowParse=convertStringToBoolean(mode);};dhtmlXTreeObject.prototype.findXML=function(node,par,val){};dhtmlXTreeObject.prototype._getAllCheckedXML=function(p,list,mode){var z=[];if (mode==2)p.through("item","checked",mode,function(c){z.push(c.get("id"));},this);if (mode==1)p.through("item","id",null,function(c){if (c.get("checked")&& (c.get("checked") !=-1))
 z.push(c.get("id"));},this);if (mode==0)p.through("item","id",null,function(c){if (!c.get("checked")|| c.get("checked")==0 )
 z.push(c.get("id"));},this);return list+(list?",":"")+z.join(",");if (list)return list;else return "";};dhtmlXTreeObject.prototype._setSubCheckedXML=function(state,p){var val= state?"1":"";p.through("item","id",null,function(c){c.set("checked",val);},this);};dhtmlXTreeObject.prototype._getAllScraggyItemsXML=function(p,x){var z=[];var fff=function(c){if (!c.sub_exists("item"))
 z.push(c.get("id"));else
 c.each("item",fff,this);};fff(p);return z.join(",");};dhtmlXTreeObject.prototype._getAllFatItemsXML=function(p,x){var z=[];var fff=function(c){if (!c.sub_exists("item"))
 return;z.push(c.get("id"));c.each("item",fff,this);};fff(p);return z.join(",");};dhtmlXTreeObject.prototype._getAllSubItemsXML=function(itemId,z,p){var z=[];p.through("item","id",null,function(c){z.push(c.get("id"));},this)
 return z.join(",");};dhtmlXTreeObject.prototype.reParse=function(node){var that=this;if (!this.parsCount)that.callEvent("onXLS",[that,node.id]);this.xmlstate=1;var tmp=node.unParsed;node.unParsed=0;this.XMLloadingWarning=1;var oldpid=this.parsingOn;var oldmd=this.waitUpdateXML;var oldpa=this.parsedArray;this.parsedArray=new Array();this.waitUpdateXML=false;this.parsingOn=node.id;this.parsedArray=new Array();this.setCheckList="";this._parse(tmp,node.id,2);var chArr=this.setCheckList.split(this.dlmtr);for (var i=0;i<this.parsedArray.length;i++)node.htmlNode.childNodes[0].appendChild(this.parsedArray[i]);if (tmp.get("order")&& tmp.get("order")!="none")
 this._reorderBranch(node,tmp.get("order"),true);this.oldsmcheck=this.smcheck;this.smcheck=false;for (var n=0;n<chArr.length;n++)if (chArr[n])this.setCheck(chArr[n],1);this.smcheck=this.oldsmcheck;this.parsingOn=oldpid;this.waitUpdateXML=oldmd;this.parsedArray=oldpa;this.XMLloadingWarning=0;this._redrawFrom(this,node);if (this._srnd && !node._sready)this.prepareSR(node.id);this.xmlstate=0;return true;};dhtmlXTreeObject.prototype.preParse=function(itemId){if (!itemId || !this._p)return null;var result=false;this._p.clone().through("item","id",itemId,function(c){this._globalIdStorageFind(c.up().get("id"));return result=true;},this);if (result){var n=this._globalIdStorageFind(itemId,true,false);if (!n)dhtmlxError.throwError("getItem","The item "+itemId+" not operable. Seems you have non-unique|incorrect IDs in tree's XML.",itemId);};return n;};dhtmlXTreeObject.prototype._escape=function(str){switch(this.utfesc){case "none":
 return str;break;case "utf8":
 return encodeURIComponent(str);break;default:
 return escape(str);break;}};dhtmlXTreeObject.prototype._drawNewTr=function(htmlObject,node)
 {var tr =document.createElement('tr');var td1=document.createElement('td');var td2=document.createElement('td');td1.appendChild(document.createTextNode(" "));td2.colSpan=3;td2.appendChild(htmlObject);tr.appendChild(td1);tr.appendChild(td2);return tr;};dhtmlXTreeObject.prototype.loadXMLString=function(xmlString,afterCall){var that=this;if (!this.parsCount)this.callEvent("onXLS",[that,null]);this.xmlstate=1;if (afterCall)this.XMLLoader.waitCall=afterCall;this.XMLLoader.loadXMLString(xmlString);};dhtmlXTreeObject.prototype.loadXML=function(file,afterCall){if (this._datamode && this._datamode!="xml")return this["load"+this._datamode.toUpperCase()](file,afterCall);var that=this;if (!this.parsCount)this.callEvent("onXLS",[that,this._ld_id]);this._ld_id=null;this.xmlstate=1;this.XMLLoader=new dtmlXMLLoaderObject(this._parseXMLTree,this,true,this.no_cashe);if (afterCall)this.XMLLoader.waitCall=afterCall;this.XMLLoader.loadXML(file);};dhtmlXTreeObject.prototype._attachChildNode=function(parentObject,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,childs,beforeNode,afterNode){if (beforeNode && beforeNode.parentObject)parentObject=beforeNode.parentObject;if (((parentObject.XMLload==0)&&(this.XMLsource))&&(!this.XMLloadingWarning))
 {parentObject.XMLload=1;this._loadDynXML(parentObject.id);};var Count=parentObject.childsCount;var Nodes=parentObject.childNodes;if (afterNode && afterNode.tr.previousSibling){if (afterNode.tr.previousSibling.previousSibling){beforeNode=afterNode.tr.previousSibling.nodem;}else
 optionStr=optionStr.replace("TOP","")+",TOP";};if (beforeNode){var ik,jk;for (ik=0;ik<Count;ik++)if (Nodes[ik]==beforeNode){for (jk=Count;jk!=ik;jk--)Nodes[1+jk]=Nodes[jk];break;};ik++;Count=ik;};if (optionStr){var tempStr=optionStr.split(",");for (var i=0;i<tempStr.length;i++){switch(tempStr[i])
 {case "TOP": if (parentObject.childsCount>0){beforeNode=new Object;beforeNode.tr=parentObject.childNodes[0].tr.previousSibling;};parentObject._has_top=true;for (ik=Count;ik>0;ik--)Nodes[ik]=Nodes[ik-1];Count=0;break;}}};var n;if (!(n=this._idpull[itemId])|| n.span!=-1){n=Nodes[Count]=new dhtmlXTreeItemObject(itemId,itemText,parentObject,this,itemActionHandler,1);itemId = Nodes[Count].id;parentObject.childsCount++;};if(!n.htmlNode){n.label=itemText;n.htmlNode=this._createItem((this.checkBoxOff?1:0),n);n.htmlNode.objBelong=n;};if(image1)n.images[0]=image1;if(image2)n.images[1]=image2;if(image3)n.images[2]=image3;var tr=this._drawNewTr(n.htmlNode);if ((this.XMLloadingWarning)||(this._hAdI))
 n.htmlNode.parentNode.parentNode.style.display="none";if ((beforeNode)&&(beforeNode.tr.nextSibling))
 parentObject.htmlNode.childNodes[0].insertBefore(tr,beforeNode.tr.nextSibling);else
 if (this.parsingOn==parentObject.id){this.parsedArray[this.parsedArray.length]=tr;}else
 parentObject.htmlNode.childNodes[0].appendChild(tr);if ((beforeNode)&&(!beforeNode.span)) beforeNode=null;if (this.XMLsource)if ((childs)&&(childs!=0)) n.XMLload=0;else n.XMLload=1;n.tr=tr;tr.nodem=n;if (parentObject.itemId==0)tr.childNodes[0].className="hiddenRow";if ((parentObject._r_logic)||(this._frbtr))
 this._setSrc(n.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.imPath+this.radioArray[0]);if (optionStr){var tempStr=optionStr.split(",");for (var i=0;i<tempStr.length;i++){switch(tempStr[i])
 {case "SELECT": this.selectItem(itemId,false);break;case "CALL": this.selectItem(itemId,true);break;case "CHILD": n.XMLload=0;break;case "CHECKED":
 if (this.XMLloadingWarning)this.setCheckList+=this.dlmtr+itemId;else
 this.setCheck(itemId,1);break;case "HCHECKED":
 this._setCheck(n,"unsure");break;case "OPEN": n.openMe=1;break;}}};if (!this.XMLloadingWarning){if ((this._getOpenState(parentObject)<0)&&(!this._hAdI)) this.openItem(parentObject.id);if (beforeNode){this._correctPlus(beforeNode);this._correctLine(beforeNode);};this._correctPlus(parentObject);this._correctLine(parentObject);this._correctPlus(n);if (parentObject.childsCount>=2){this._correctPlus(Nodes[parentObject.childsCount-2]);this._correctLine(Nodes[parentObject.childsCount-2]);};if (parentObject.childsCount!=2)this._correctPlus(Nodes[0]);if (this.tscheck)this._correctCheckStates(parentObject);if (this._onradh){if (this.xmlstate==1){var old=this.onXLE;this.onXLE=function(id){this._onradh(itemId);if (old)old(id);}}else
 this._onradh(itemId);}};return n;};dhtmlXTreeObject.prototype.enableContextMenu=function(menu){if (menu)this.cMenu=menu;};dhtmlXTreeObject.prototype.setItemContextMenu=function(itemId,cMenu){var l=itemId.toString().split(this.dlmtr);for (var i=0;i<l.length;i++){var temp=this._globalIdStorageFind(l[i]);if (!temp)continue;temp.cMenu=cMenu;}};dhtmlXTreeObject.prototype.insertNewItem=function(parentId,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children){var parentObject=this._globalIdStorageFind(parentId);if (!parentObject)return (-1);var nodez=this._attachChildNode(parentObject,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children);if ((!this.XMLloadingWarning)&&(this.childCalc)) this._fixChildCountLabel(parentObject);return nodez;};dhtmlXTreeObject.prototype.insertNewChild=function(parentId,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children){return this.insertNewItem(parentId,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children);};dhtmlXTreeObject.prototype._parseXMLTree=function(a,b,c,d,xml){var p=new xmlPointer(xml.getXMLTopNode("tree"));a._parse(p);a._p=p;};dhtmlXTreeObject.prototype._parseItem=function(c,temp,preNode,befNode){var id;if (this._srnd && (!this._idpull[id=c.get("id")] || !this._idpull[id].span))
 {this._addItemSRND(temp.id,id,c);return;};var a=c.get_all();if ((typeof(this.waitUpdateXML)=="object")&&(!this.waitUpdateXML[a.id])){this._parse(c,a.id,1);return;};if ((a.text===null)||(typeof(a.text)=="undefined")){a.text=c.sub("itemtext");if (a.text)a.text=a.text.content();};var zST=[];if (a.select)zST.push("SELECT");if (a.top)zST.push("TOP");if (a.call)this.nodeAskingCall=a.id;if (a.checked==-1)zST.push("HCHECKED");else if (a.checked)zST.push("CHECKED");if (a.open)zST.push("OPEN");if (this.waitUpdateXML){if (this._globalIdStorageFind(a.id))
 var newNode=this.updateItem(a.id,a.text,a.im0,a.im1,a.im2,a.checked);else{if (this.npl==0)zST.push("TOP");else preNode=temp.childNodes[this.npl];var newNode=this._attachChildNode(temp,a.id,a.text,0,a.im0,a.im1,a.im2,zST.join(","),a.child,0,preNode);preNode=null;}}else
 var newNode=this._attachChildNode(temp,a.id,a.text,0,a.im0,a.im1,a.im2,zST.join(","),a.child,(befNode||0),preNode);if (a.tooltip)newNode.span.parentNode.parentNode.title=a.tooltip;if (a.style)if (newNode.span.style.cssText)newNode.span.style.cssText+=(";"+a.style);else
 newNode.span.setAttribute("style",newNode.span.getAttribute("style")+";"+a.style);if (a.radio)newNode._r_logic=true;if (a.nocheckbox){var check_node=newNode.span.parentNode.previousSibling.previousSibling;check_node.childNodes[0].style.display='none';if (window._KHTMLrv)check_node.style.display="none";newNode.nocheckbox=true;};if (a.disabled){if (a.checked!=null)this._setCheck(newNode,a.checked);this.disableCheckbox(newNode,1);};newNode._acc=a.child||0;if (this.parserExtension)this.parserExtension._parseExtension.call(this,c,a,(temp?temp.id:0));this.setItemColor(newNode,a.aCol,a.sCol);if (a.locked=="1")this.lockItem(newNode.id,true,true);if ((a.imwidth)||(a.imheight)) this.setIconSize(a.imwidth,a.imheight,newNode);if ((a.closeable=="0")||(a.closeable=="1")) this.setItemCloseable(newNode,a.closeable);var zcall="";if (a.topoffset)this.setItemTopOffset(newNode,a.topoffset);if ((!this.slowParse)||(typeof(this.waitUpdateXML)=="object")){if (c.sub_exists("item"))
 zcall=this._parse(c,a.id,1);}else {if ((!newNode.childsCount)&& c.sub_exists("item"))
 newNode.unParsed=c.clone();c.each("userdata",function(u){this.setUserData(a.id,u.get("name"),u.content());},this);};if (zcall!="")this.nodeAskingCall=zcall;c.each("userdata",function(u){this.setUserData(c.get("id"),u.get("name"),u.content());},this)
 
 
 };dhtmlXTreeObject.prototype._parse=function(p,parentId,level,start){if (this._srnd && !this.parentObject.offsetHeight){var self=this;return window.setTimeout(function(){self._parse(p,parentId,level,start);},100);};if (!p.exists()) return;this.skipLock=true;if (!parentId){parentId=p.get("id");if (p.get("radio"))
 this.htmlNode._r_logic=true;this.parsingOn=parentId;this.parsedArray=new Array();this.setCheckList="";this.nodeAskingCall="";};var temp=this._globalIdStorageFind(parentId);if (!temp)return dhtmlxError.throwError("DataStructure","XML refers to not existing parent");this.parsCount=this.parsCount?(this.parsCount+1):1;this.XMLloadingWarning=1;if ((temp.childsCount)&&(!start)&&(!this._edsbps)&&(!temp._has_top))
 var preNode=0;else
 var preNode=0;this.npl=0;p.each("item",function(c,i){temp.XMLload=1;if ((this._epgps)&&(this._epgpsC==this.npl)){this._setNextPageSign(temp,this.npl+1*(start||0),level,node);return -1;};this._parseItem(c,temp,0,preNode);if ((this._edsbps)&&(this.npl==this._edsbpsC)){this._distributedStart(p,i+1,parentId,level,temp.childsCount);return -1;};this.npl++;},this,start);if (!level){p.each("userdata",function(u){this.setUserData(p.get("id"),u.get("name"),u.content());},this);temp.XMLload=1;if (this.waitUpdateXML){this.waitUpdateXML=false;for (var i=temp.childsCount-1;i>=0;i--)if (temp.childNodes[i]._dmark)this.deleteItem(temp.childNodes[i].id);};var parsedNodeTop=this._globalIdStorageFind(this.parsingOn);for (var i=0;i<this.parsedArray.length;i++)temp.htmlNode.childNodes[0].appendChild(this.parsedArray[i]);this.parsedArray = [];this.lastLoadedXMLId=parentId;this.XMLloadingWarning=0;var chArr=this.setCheckList.split(this.dlmtr);for (var n=0;n<chArr.length;n++)if (chArr[n])this.setCheck(chArr[n],1);if ((this.XMLsource)&&(this.tscheck)&&(this.smcheck)&&(temp.id!=this.rootId)){if (temp.checkstate===0)this._setSubChecked(0,temp);else if (temp.checkstate===1)this._setSubChecked(1,temp);};this._redrawFrom(this,null,start)
 if (p.get("order")&& p.get("order")!="none")
 this._reorderBranch(temp,p.get("order"),true);if (this.nodeAskingCall!="")this.callEvent("onClick",[this.nodeAskingCall,this.getSelectedItemId()]);if (this._branchUpdate)this._branchUpdateNext(p);};if (this.parsCount==1){this.parsingOn=null;if (this._srnd && temp.id!=this.rootId){this.prepareSR(temp.id);if (this.XMLsource)this.openItem(temp.id)
 };p.through("item","open",null,function(c){this.openItem(c.get("id"));},this);if ((!this._edsbps)||(!this._edsbpsA.length)){var that=this;window.setTimeout( function(){that.callEvent("onXLE",[that,parentId]);},1);this.xmlstate=0;};this.skipLock=false;};this.parsCount--;var that=this;if (this._edsbps)window.setTimeout(function(){that._distributedStep(parentId);},this._edsbpsD);if ((this._epgps)&&(start))
 this._setPrevPageSign(temp,(start||0),level,node);if (!level && this.onXLE)this.onXLE(this,parentId);return this.nodeAskingCall;};dhtmlXTreeObject.prototype._branchUpdateNext=function(p){p.each("item",function(c){var nid=c.get("id");if (this._idpull[nid] && (!this._idpull[nid].XMLload)) return;this._branchUpdate++;this.smartRefreshItem(c.get("id"),c);},this)
 this._branchUpdate--;};dhtmlXTreeObject.prototype.checkUserData=function(node,parentId){if ((node.nodeType==1)&&(node.tagName == "userdata"))
 {var name=node.getAttribute("name");if ((name)&&(node.childNodes[0]))
 this.setUserData(parentId,name,node.childNodes[0].data);}};dhtmlXTreeObject.prototype._redrawFrom=function(dhtmlObject,itemObject,start,visMode){if (!itemObject){var tempx=dhtmlObject._globalIdStorageFind(dhtmlObject.lastLoadedXMLId);dhtmlObject.lastLoadedXMLId=-1;if (!tempx)return 0;}else tempx=itemObject;var acc=0;for (var i=(start?start-1:0);i<tempx.childsCount;i++)
 {if ((!this._branchUpdate)||(this._getOpenState(tempx)==1))
 if ((!itemObject)||(visMode==1)) tempx.childNodes[i].htmlNode.parentNode.parentNode.style.display="";if (tempx.childNodes[i].openMe==1){this._openItem(tempx.childNodes[i]);tempx.childNodes[i].openMe=0;};dhtmlObject._redrawFrom(dhtmlObject,tempx.childNodes[i]);if (this.childCalc!=null){if ((tempx.childNodes[i].unParsed)||((!tempx.childNodes[i].XMLload)&&(this.XMLsource)))
 {if (tempx.childNodes[i]._acc)tempx.childNodes[i].span.innerHTML=tempx.childNodes[i].label+this.htmlcA+tempx.childNodes[i]._acc+this.htmlcB;else
 tempx.childNodes[i].span.innerHTML=tempx.childNodes[i].label;};if ((tempx.childNodes[i].childNodes.length)&&(this.childCalc))
 {if (this.childCalc==1){tempx.childNodes[i].span.innerHTML=tempx.childNodes[i].label+this.htmlcA+tempx.childNodes[i].childsCount+this.htmlcB;};if (this.childCalc==2){var zCount=tempx.childNodes[i].childsCount-(tempx.childNodes[i].pureChilds||0);if (zCount)tempx.childNodes[i].span.innerHTML=tempx.childNodes[i].label+this.htmlcA+zCount+this.htmlcB;if (tempx.pureChilds)tempx.pureChilds++;else tempx.pureChilds=1;};if (this.childCalc==3){tempx.childNodes[i].span.innerHTML=tempx.childNodes[i].label+this.htmlcA+tempx.childNodes[i]._acc+this.htmlcB;};if (this.childCalc==4){var zCount=tempx.childNodes[i]._acc;if (zCount)tempx.childNodes[i].span.innerHTML=tempx.childNodes[i].label+this.htmlcA+zCount+this.htmlcB;}}else if (this.childCalc==4){acc++;};acc+=tempx.childNodes[i]._acc;if (this.childCalc==3){acc++;}}};if ((!tempx.unParsed)&&((tempx.XMLload)||(!this.XMLsource)))
 tempx._acc=acc;dhtmlObject._correctLine(tempx);dhtmlObject._correctPlus(tempx);if ((this.childCalc)&&(!itemObject)) dhtmlObject._fixChildCountLabel(tempx);};dhtmlXTreeObject.prototype._createSelf=function(){var div=document.createElement('div');div.className="containerTableStyle";div.style.width=this.width;div.style.height=this.height;this.parentObject.appendChild(div);return div;};dhtmlXTreeObject.prototype._xcloseAll=function(itemObject)
 {if (itemObject.unParsed)return;if (this.rootId!=itemObject.id){if (!itemObject.htmlNode)return;var Nodes=itemObject.htmlNode.childNodes[0].childNodes;var Count=Nodes.length;for (var i=1;i<Count;i++)Nodes[i].style.display="none";this._correctPlus(itemObject);};for (var i=0;i<itemObject.childsCount;i++)if (itemObject.childNodes[i].childsCount)this._xcloseAll(itemObject.childNodes[i]);};dhtmlXTreeObject.prototype._xopenAll=function(itemObject)
 {this._HideShow(itemObject,2);for (var i=0;i<itemObject.childsCount;i++)this._xopenAll(itemObject.childNodes[i]);};dhtmlXTreeObject.prototype._correctPlus=function(itemObject){if (!itemObject.htmlNode)return;var imsrc=itemObject.htmlNode.childNodes[0].childNodes[0].childNodes[0].lastChild;var imsrc2=itemObject.htmlNode.childNodes[0].childNodes[0].childNodes[2].childNodes[0];var workArray=this.lineArray;if ((this.XMLsource)&&(!itemObject.XMLload))
 {var workArray=this.plusArray;this._setSrc(imsrc2,this.iconURL+itemObject.images[2]);if (this._txtimg)return (imsrc.innerHTML="[+]");}else
 if ((itemObject.childsCount)||(itemObject.unParsed))
 {if ((itemObject.htmlNode.childNodes[0].childNodes[1])&&( itemObject.htmlNode.childNodes[0].childNodes[1].style.display!="none" ))
 {if (!itemObject.wsign)var workArray=this.minusArray;this._setSrc(imsrc2,this.iconURL+itemObject.images[1]);if (this._txtimg)return (imsrc.innerHTML="[-]");}else
 {if (!itemObject.wsign)var workArray=this.plusArray;this._setSrc(imsrc2,this.iconURL+itemObject.images[2]);if (this._txtimg)return (imsrc.innerHTML="[+]");}}else
 {this._setSrc(imsrc2,this.iconURL+itemObject.images[0]);};var tempNum=2;if (!itemObject.treeNod.treeLinesOn)this._setSrc(imsrc,this.imPath+workArray[3]);else {if (itemObject.parentObject)tempNum=this._getCountStatus(itemObject.id,itemObject.parentObject);this._setSrc(imsrc,this.imPath+workArray[tempNum]);}};dhtmlXTreeObject.prototype._correctLine=function(itemObject){if (!itemObject.htmlNode)return;var sNode=itemObject.parentObject;if (sNode)if ((this._getLineStatus(itemObject.id,sNode)==0)||(!this.treeLinesOn))
 for(var i=1;i<=itemObject.childsCount;i++){if (!itemObject.htmlNode.childNodes[0].childNodes[i])break;itemObject.htmlNode.childNodes[0].childNodes[i].childNodes[0].style.backgroundImage="";itemObject.htmlNode.childNodes[0].childNodes[i].childNodes[0].style.backgroundRepeat="";}else
 for(var i=1;i<=itemObject.childsCount;i++){if (!itemObject.htmlNode.childNodes[0].childNodes[i])break;itemObject.htmlNode.childNodes[0].childNodes[i].childNodes[0].style.backgroundImage="url("+this.imPath+this.lineArray[5]+")";itemObject.htmlNode.childNodes[0].childNodes[i].childNodes[0].style.backgroundRepeat="repeat-y";}};dhtmlXTreeObject.prototype._getCountStatus=function(itemId,itemObject){if (itemObject.childsCount<=1){if (itemObject.id==this.rootId)return 4;else return 0;};if (itemObject.childNodes[0].id==itemId)if (itemObject.id==this.rootId)return 2;else return 1;if (itemObject.childNodes[itemObject.childsCount-1].id==itemId)return 0;return 1;};dhtmlXTreeObject.prototype._getLineStatus =function(itemId,itemObject){if (itemObject.childNodes[itemObject.childsCount-1].id==itemId)return 0;return 1;};dhtmlXTreeObject.prototype._HideShow=function(itemObject,mode){if ((this.XMLsource)&&(!itemObject.XMLload)) {if (mode==1)return;itemObject.XMLload=1;this._loadDynXML(itemObject.id);return;};if (itemObject.unParsed)this.reParse(itemObject);var Nodes=itemObject.htmlNode.childNodes[0].childNodes;var Count=Nodes.length;if (Count>1){if ( ( (Nodes[1].style.display!="none")|| (mode==1) ) && (mode!=2) ) {this.allTree.childNodes[0].border = "1";this.allTree.childNodes[0].border = "0";nodestyle="none";}else nodestyle="";for (var i=1;i<Count;i++)Nodes[i].style.display=nodestyle;};this._correctPlus(itemObject);};dhtmlXTreeObject.prototype._getOpenState=function(itemObject){if (!itemObject.htmlNode)return 0;var z=itemObject.htmlNode.childNodes[0].childNodes;if (z.length<=1)return 0;if (z[1].style.display!="none")return 1;else return -1;};dhtmlXTreeObject.prototype.onRowClick2=function(){var that=this.parentObject.treeNod;if (!that.callEvent("onDblClick",[this.parentObject.id,that])) return false;if ((this.parentObject.closeble)&&(this.parentObject.closeble!="0"))
 that._HideShow(this.parentObject);else
 that._HideShow(this.parentObject,2);if (that.checkEvent("onOpenEnd"))
 if (!that.xmlstate)that.callEvent("onOpenEnd",[this.parentObject.id,that._getOpenState(this.parentObject)]);else{that._oie_onXLE.push(that.onXLE);that.onXLE=that._epnFHe;};return false;};dhtmlXTreeObject.prototype.onRowClick=function(){var that=this.parentObject.treeNod;if (!that.callEvent("onOpenStart",[this.parentObject.id,that._getOpenState(this.parentObject)])) return 0;if ((this.parentObject.closeble)&&(this.parentObject.closeble!="0"))
 that._HideShow(this.parentObject);else
 that._HideShow(this.parentObject,2);if (that.checkEvent("onOpenEnd"))
 if (!that.xmlstate)that.callEvent("onOpenEnd",[this.parentObject.id,that._getOpenState(this.parentObject)]);else{that._oie_onXLE.push(that.onXLE);that.onXLE=that._epnFHe;}};dhtmlXTreeObject.prototype._epnFHe=function(that,id,flag){if (id!=this.rootId)this.callEvent("onOpenEnd",[id,that.getOpenState(id)]);that.onXLE=that._oie_onXLE.pop();if (!flag && !that._oie_onXLE.length)if (that.onXLE)that.onXLE(that,id);};dhtmlXTreeObject.prototype.onRowClickDown=function(e){e=e||window.event;var that=this.parentObject.treeNod;that._selectItem(this.parentObject,e);};dhtmlXTreeObject.prototype.getSelectedItemId=function()
 {var str=new Array();for (var i=0;i<this._selected.length;i++)str[i]=this._selected[i].id;return (str.join(this.dlmtr));};dhtmlXTreeObject.prototype._selectItem=function(node,e){if (this.checkEvent("onSelect")) this._onSSCFold=this.getSelectedItemId();if ((!this._amsel)||(!e)||((!e.ctrlKey)&&(!e.metaKey)&&(!e.shiftKey)))


 this._unselectItems();if ((node.i_sel)&&(this._amsel)&&(e)&&(e.ctrlKey || e.metaKey))
 this._unselectItem(node);else
 if ((!node.i_sel)&&((!this._amselS)||(this._selected.length==0)||(this._selected[0].parentObject==node.parentObject)))
 if ((this._amsel)&&(e)&&(e.shiftKey)&&(this._selected.length!=0)&&(this._selected[this._selected.length-1].parentObject==node.parentObject)){var a=this._getIndex(this._selected[this._selected.length-1]);var b=this._getIndex(node);if (b<a){var c=a;a=b;b=c;};for (var i=a;i<=b;i++)if (!node.parentObject.childNodes[i].i_sel)this._markItem(node.parentObject.childNodes[i]);}else


 this._markItem(node);if (this.checkEvent("onSelect")) {var z=this.getSelectedItemId();if (z!=this._onSSCFold)this.callEvent("onSelect",[z]);}};dhtmlXTreeObject.prototype._markItem=function(node){if (node.scolor)node.span.style.color=node.scolor;node.span.className="selectedTreeRow";node.i_sel=true;this._selected[this._selected.length]=node;};dhtmlXTreeObject.prototype.getIndexById=function(itemId){var z=this._globalIdStorageFind(itemId);if (!z)return null;return this._getIndex(z);};dhtmlXTreeObject.prototype._getIndex=function(w){var z=w.parentObject;for (var i=0;i<z.childsCount;i++)if (z.childNodes[i]==w)return i;};dhtmlXTreeObject.prototype._unselectItem=function(node){if ((node)&&(node.i_sel))
 {node.span.className="standartTreeRow";if (node.acolor)node.span.style.color=node.acolor;node.i_sel=false;for (var i=0;i<this._selected.length;i++)if (!this._selected[i].i_sel){this._selected.splice(i,1);break;}}};dhtmlXTreeObject.prototype._unselectItems=function(){for (var i=0;i<this._selected.length;i++){var node=this._selected[i];node.span.className="standartTreeRow";if (node.acolor)node.span.style.color=node.acolor;node.i_sel=false;};this._selected=new Array();};dhtmlXTreeObject.prototype.onRowSelect=function(e,htmlObject,mode){e=e||window.event;var obj=this.parentObject;if (htmlObject)obj=htmlObject.parentObject;var that=obj.treeNod;var lastId=that.getSelectedItemId();if ((!e)||(!e.skipUnSel))
 that._selectItem(obj,e);if (!mode){if (obj.actionHandler)obj.actionHandler(obj.id,lastId);else that.callEvent("onClick",[obj.id,lastId]);}};dhtmlXTreeObject.prototype._correctCheckStates=function(dhtmlObject){if (!this.tscheck)return;if (!dhtmlObject)return;if (dhtmlObject.id==this.rootId)return;var act=dhtmlObject.childNodes;var flag1=0;var flag2=0;if (dhtmlObject.childsCount==0)return;for (var i=0;i<dhtmlObject.childsCount;i++){if (act[i].dscheck)continue;if (act[i].checkstate==0)flag1=1;else if (act[i].checkstate==1)flag2=1;else {flag1=1;flag2=1;break;}};if ((flag1)&&(flag2)) this._setCheck(dhtmlObject,"unsure");else if (flag1)this._setCheck(dhtmlObject,false);else this._setCheck(dhtmlObject,true);this._correctCheckStates(dhtmlObject.parentObject);};dhtmlXTreeObject.prototype.onCheckBoxClick=function(e){if (!this.treeNod.callEvent("onBeforeCheck",[this.parentObject.id,this.parentObject.checkstate]))
 return;if (this.parentObject.dscheck)return true;if (this.treeNod.tscheck)if (this.parentObject.checkstate==1)this.treeNod._setSubChecked(false,this.parentObject);else this.treeNod._setSubChecked(true,this.parentObject);else
 if (this.parentObject.checkstate==1)this.treeNod._setCheck(this.parentObject,false);else this.treeNod._setCheck(this.parentObject,true);this.treeNod._correctCheckStates(this.parentObject.parentObject);return this.treeNod.callEvent("onCheck",[this.parentObject.id,this.parentObject.checkstate]);};dhtmlXTreeObject.prototype._createItem=function(acheck,itemObject,mode){var table=document.createElement('table');table.cellSpacing=0;table.cellPadding=0;table.border=0;if(this.hfMode)table.style.tableLayout="fixed";table.style.margin=0;table.style.padding=0;var tbody=document.createElement('tbody');var tr=document.createElement('tr');var td1=document.createElement('td');td1.className="standartTreeImage";if(this._txtimg){var img0=document.createElement("div");td1.appendChild(img0);img0.className="dhx_tree_textSign";}else
 {var img0=this._getImg(itemObject.id);img0.border="0";if (img0.tagName=="IMG")img0.align="absmiddle";td1.appendChild(img0);img0.style.padding=0;img0.style.margin=0;img0.style.width=this.def_line_img_x;img0.style.height=this.def_line_img_y;};var td11=document.createElement('td');var inp=this._getImg(this.cBROf?this.rootId:itemObject.id);inp.checked=0;this._setSrc(inp,this.imPath+this.checkArray[0]);inp.style.width="16px";inp.style.height="16px";if (!acheck)((!_isIE)?td11:inp).style.display="none";td11.appendChild(inp);if ((!this.cBROf)&&(inp.tagName=="IMG")) inp.align="absmiddle";inp.onclick=this.onCheckBoxClick;inp.treeNod=this;inp.parentObject=itemObject;if (!window._KHTMLrv)td11.width="20px";else td11.width="16px";var td12=document.createElement('td');td12.className="standartTreeImage";var img=this._getImg(this.timgen?itemObject.id:this.rootId);img.onmousedown=this._preventNsDrag;img.ondragstart=this._preventNsDrag;img.border="0";if (this._aimgs){img.parentObject=itemObject;if (img.tagName=="IMG")img.align="absmiddle";img.onclick=this.onRowSelect;};if (!mode)this._setSrc(img,this.iconURL+this.imageArray[0]);td12.appendChild(img);img.style.padding=0;img.style.margin=0;if (this.timgen){td12.style.width=img.style.width=this.def_img_x;img.style.height=this.def_img_y;}else
 {img.style.width="0px";img.style.height="0px";if (_isOpera || window._KHTMLrv )td12.style.display="none";};var td2=document.createElement('td');td2.className="standartTreeRow";itemObject.span=document.createElement('span');itemObject.span.className="standartTreeRow";if (this.mlitems){itemObject.span.style.width=this.mlitems;itemObject.span.style.display="block";}else td2.noWrap=true;if (_isIE && _isIE>7)td2.style.width="999999px";else if (!window._KHTMLrv)td2.style.width="100%";itemObject.span.innerHTML=itemObject.label;td2.appendChild(itemObject.span);td2.parentObject=itemObject;td1.parentObject=itemObject;td2.onclick=this.onRowSelect;td1.onclick=this.onRowClick;td2.ondblclick=this.onRowClick2;if (this.ettip)tr.title=itemObject.label;if (this.dragAndDropOff){if (this._aimgs){this.dragger.addDraggableItem(td12,this);td12.parentObject=itemObject;};this.dragger.addDraggableItem(td2,this);};itemObject.span.style.paddingLeft="5px";itemObject.span.style.paddingRight="5px";td2.style.verticalAlign="";td2.style.fontSize="10pt";td2.style.cursor=this.style_pointer;tr.appendChild(td1);tr.appendChild(td11);tr.appendChild(td12);tr.appendChild(td2);tbody.appendChild(tr);table.appendChild(tbody);if (this.ehlt || this.checkEvent("onMouseIn")|| this.checkEvent("onMouseOut")){tr.onmousemove=this._itemMouseIn;tr[(_isIE)?"onmouseleave":"onmouseout"]=this._itemMouseOut;};return table;};dhtmlXTreeObject.prototype.setImagePath=function( newPath ){this.imPath=newPath;this.iconURL=newPath;};dhtmlXTreeObject.prototype.setIconPath=function(path){this.iconURL=path;};dhtmlXTreeObject.prototype._getLeafCount=function(itemNode){var a=0;for (var b=0;b<itemNode.childsCount;b++)if (itemNode.childNodes[b].childsCount==0)a++;return a;};dhtmlXTreeObject.prototype._getChildCounterValue=function(itemId){var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;if ((temp.unParsed)||((!temp.XMLload)&&(this.XMLsource)))
 return temp._acc
 switch(this.childCalc)
 {case 1: return temp.childsCount;break;case 2: return this._getLeafCount(temp);break;case 3: return temp._acc;break;case 4: return temp._acc;break;}};dhtmlXTreeObject.prototype._fixChildCountLabel=function(itemNode,index){if (this.childCalc==null)return;if ((itemNode.unParsed)||((!itemNode.XMLload)&&(this.XMLsource)))
 {if (itemNode._acc)itemNode.span.innerHTML=itemNode.label+this.htmlcA+itemNode._acc+this.htmlcB;else
 itemNode.span.innerHTML=itemNode.label;return;};switch(this.childCalc){case 1:
 if (itemNode.childsCount!=0)itemNode.span.innerHTML=itemNode.label+this.htmlcA+itemNode.childsCount+this.htmlcB;else itemNode.span.innerHTML=itemNode.label;break;case 2:
 var z=this._getLeafCount(itemNode);if (z!=0)itemNode.span.innerHTML=itemNode.label+this.htmlcA+z+this.htmlcB;else itemNode.span.innerHTML=itemNode.label;break;case 3:
 if (itemNode.childsCount!=0){var bcc=0;for (var a=0;a<itemNode.childsCount;a++){if (!itemNode.childNodes[a]._acc)itemNode.childNodes[a]._acc=0;bcc+=itemNode.childNodes[a]._acc*1;};bcc+=itemNode.childsCount*1;itemNode.span.innerHTML=itemNode.label+this.htmlcA+bcc+this.htmlcB;itemNode._acc=bcc;}else {itemNode.span.innerHTML=itemNode.label;itemNode._acc=0;};if ((itemNode.parentObject)&&(itemNode.parentObject!=this.htmlNode))
 this._fixChildCountLabel(itemNode.parentObject);break;case 4:
 if (itemNode.childsCount!=0){var bcc=0;for (var a=0;a<itemNode.childsCount;a++){if (!itemNode.childNodes[a]._acc)itemNode.childNodes[a]._acc=1;bcc+=itemNode.childNodes[a]._acc*1;};itemNode.span.innerHTML=itemNode.label+this.htmlcA+bcc+this.htmlcB;itemNode._acc=bcc;}else {itemNode.span.innerHTML=itemNode.label;itemNode._acc=1;};if ((itemNode.parentObject)&&(itemNode.parentObject!=this.htmlNode))
 this._fixChildCountLabel(itemNode.parentObject);break;}};dhtmlXTreeObject.prototype.setChildCalcMode=function( mode ){switch(mode){case "child": this.childCalc=1;break;case "leafs": this.childCalc=2;break;case "childrec": this.childCalc=3;break;case "leafsrec": this.childCalc=4;break;case "disabled": this.childCalc=null;break;default: this.childCalc=4;}};dhtmlXTreeObject.prototype.setChildCalcHTML=function( htmlA,htmlB ){this.htmlcA=htmlA;this.htmlcB=htmlB;};dhtmlXTreeObject.prototype.setOnRightClickHandler=function(func){this.attachEvent("onRightClick",func);};dhtmlXTreeObject.prototype.setOnClickHandler=function(func){this.attachEvent("onClick",func);};dhtmlXTreeObject.prototype.setOnSelectStateChange=function(func){this.attachEvent("onSelect",func);};dhtmlXTreeObject.prototype.setXMLAutoLoading=function(filePath){this.XMLsource=filePath;};dhtmlXTreeObject.prototype.setOnCheckHandler=function(func){this.attachEvent("onCheck",func);};dhtmlXTreeObject.prototype.setOnOpenHandler=function(func){this.attachEvent("onOpenStart",func);};dhtmlXTreeObject.prototype.setOnOpenStartHandler=function(func){this.attachEvent("onOpenStart",func);};dhtmlXTreeObject.prototype.setOnOpenEndHandler=function(func){this.attachEvent("onOpenEnd",func);};dhtmlXTreeObject.prototype.setOnDblClickHandler=function(func){this.attachEvent("onDblClick",func);};dhtmlXTreeObject.prototype.openAllItems=function(itemId)
 {var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;this._xopenAll(temp);};dhtmlXTreeObject.prototype.getOpenState=function(itemId){var temp=this._globalIdStorageFind(itemId);if (!temp)return "";return this._getOpenState(temp);};dhtmlXTreeObject.prototype.closeAllItems=function(itemId)
 {if (itemId===window.undefined)itemId=this.rootId;var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;this._xcloseAll(temp);this.allTree.childNodes[0].border = "1";this.allTree.childNodes[0].border = "0";};dhtmlXTreeObject.prototype.setUserData=function(itemId,name,value){var sNode=this._globalIdStorageFind(itemId,0,true);if (!sNode)return;if(name=="hint")sNode.htmlNode.childNodes[0].childNodes[0].title=value;if (typeof(sNode.userData["t_"+name])=="undefined"){if (!sNode._userdatalist)sNode._userdatalist=name;else sNode._userdatalist+=","+name;};sNode.userData["t_"+name]=value;};dhtmlXTreeObject.prototype.getUserData=function(itemId,name){var sNode=this._globalIdStorageFind(itemId,0,true);if (!sNode)return;return sNode.userData["t_"+name];};dhtmlXTreeObject.prototype.getItemColor=function(itemId)
 {var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;var res= new Object();if (temp.acolor)res.acolor=temp.acolor;if (temp.scolor)res.scolor=temp.scolor;return res;};dhtmlXTreeObject.prototype.setItemColor=function(itemId,defaultColor,selectedColor)
 {if ((itemId)&&(itemId.span))
 var temp=itemId;else
 var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;else {if (temp.i_sel){if (selectedColor)temp.span.style.color=selectedColor;}else
 {if (defaultColor)temp.span.style.color=defaultColor;};if (selectedColor)temp.scolor=selectedColor;if (defaultColor)temp.acolor=defaultColor;}};dhtmlXTreeObject.prototype.getItemText=function(itemId)
 {var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;return(temp.htmlNode.childNodes[0].childNodes[0].childNodes[3].childNodes[0].innerHTML);};dhtmlXTreeObject.prototype.getParentId=function(itemId)
 {var temp=this._globalIdStorageFind(itemId);if ((!temp)||(!temp.parentObject)) return "";return temp.parentObject.id;};dhtmlXTreeObject.prototype.changeItemId=function(itemId,newItemId)
 {if (itemId==newItemId)return;var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;temp.id=newItemId;temp.span.contextMenuId=newItemId;this._idpull[newItemId]=this._idpull[itemId];delete this._idpull[itemId];};dhtmlXTreeObject.prototype.doCut=function(){if (this.nodeCut)this.clearCut();this.nodeCut=(new Array()).concat(this._selected);for (var i=0;i<this.nodeCut.length;i++){var tempa=this.nodeCut[i];tempa._cimgs=new Array();tempa._cimgs[0]=tempa.images[0];tempa._cimgs[1]=tempa.images[1];tempa._cimgs[2]=tempa.images[2];tempa.images[0]=tempa.images[1]=tempa.images[2]=this.cutImage;this._correctPlus(tempa);}};dhtmlXTreeObject.prototype.doPaste=function(itemId){var tobj=this._globalIdStorageFind(itemId);if (!tobj)return 0;for (var i=0;i<this.nodeCut.length;i++){if (this._checkPNodes(tobj,this.nodeCut[i])) continue;this._moveNode(this.nodeCut[i],tobj);};this.clearCut();};dhtmlXTreeObject.prototype.clearCut=function(){for (var i=0;i<this.nodeCut.length;i++){var tempa=this.nodeCut[i];tempa.images[0]=tempa._cimgs[0];tempa.images[1]=tempa._cimgs[1];tempa.images[2]=tempa._cimgs[2];this._correctPlus(tempa);};this.nodeCut=new Array();};dhtmlXTreeObject.prototype._moveNode=function(itemObject,targetObject){var mode=this.dadmodec;if (mode==1){var z=targetObject;if (this.dadmodefix<0){while (true){z=this._getPrevNode(z);if ((z==-1)) {z=this.htmlNode;break;};if ((z.tr==0)||(z.tr.style.display=="")||(!z.parentObject)) break;};var nodeA=z;var nodeB=targetObject;}else
 {while (true){z=this._getNextNode(z);if ((z==-1)) {z=this.htmlNode;break;};if ((z.tr.style.display=="")||(!z.parentObject)) break;};var nodeB=z;var nodeA=targetObject;};if (this._getNodeLevel(nodeA,0)>this._getNodeLevel(nodeB,0))
 {if (!this.dropLower)return this._moveNodeTo(itemObject,nodeA.parentObject);else
 if (nodeB.id!=this.rootId)return this._moveNodeTo(itemObject,nodeB.parentObject,nodeB);else
 return this._moveNodeTo(itemObject,this.htmlNode,null);}else
 {return this._moveNodeTo(itemObject,nodeB.parentObject,nodeB);}}else


 return this._moveNodeTo(itemObject,targetObject);};dhtmlXTreeObject.prototype._fixNodesCollection=function(target,zParent){var flag=0;var icount=0;var Nodes=target.childNodes;var Count=target.childsCount-1;if (zParent==Nodes[Count])return;for (var i=0;i<Count;i++)if (Nodes[i]==Nodes[Count]){Nodes[i]=Nodes[i+1];Nodes[i+1]=Nodes[Count];};for (var i=0;i<Count+1;i++){if (flag){var temp=Nodes[i];Nodes[i]=flag;flag=temp;}else 
 if (Nodes[i]==zParent){flag=Nodes[i];Nodes[i]=Nodes[Count];}}};dhtmlXTreeObject.prototype._recreateBranch=function(itemObject,targetObject,beforeNode,level){var i;var st="";if (beforeNode){for (i=0;i<targetObject.childsCount;i++)if (targetObject.childNodes[i]==beforeNode)break;if (i!=0)beforeNode=targetObject.childNodes[i-1];else{st="TOP";beforeNode="";}};var t2=this._onradh;this._onradh=null;var newNode=this._attachChildNode(targetObject,itemObject.id,itemObject.label,0,itemObject.images[0],itemObject.images[1],itemObject.images[2],st,0,beforeNode);newNode._userdatalist=itemObject._userdatalist;newNode.userData=itemObject.userData.clone();newNode.XMLload=itemObject.XMLload;if (t2){this._onradh=t2;this._onradh(newNode.id);};if (itemObject.treeNod.dpcpy)itemObject.treeNod._globalIdStorageFind(itemObject.id);else newNode.unParsed=itemObject.unParsed;this._correctPlus(newNode);for (var i=0;i<itemObject.childsCount;i++)this._recreateBranch(itemObject.childNodes[i],newNode,0,1);if ((!level)&&(this.childCalc)) {this._redrawFrom(this,targetObject);};return newNode;};dhtmlXTreeObject.prototype._moveNodeTo=function(itemObject,targetObject,beforeNode){if (itemObject.treeNod._nonTrivialNode)return itemObject.treeNod._nonTrivialNode(this,targetObject,beforeNode,itemObject);if (targetObject.mytype)var framesMove=(itemObject.treeNod.lWin!=targetObject.lWin);else
 var framesMove=(itemObject.treeNod.lWin!=targetObject.treeNod.lWin);if (!this.callEvent("onDrag",[itemObject.id,targetObject.id,(beforeNode?beforeNode.id:null),itemObject.treeNod,targetObject.treeNod])) return false;if ((targetObject.XMLload==0)&&(this.XMLsource))
 {targetObject.XMLload=1;this._loadDynXML(targetObject.id);};this.openItem(targetObject.id);var oldTree=itemObject.treeNod;var c=itemObject.parentObject.childsCount;var z=itemObject.parentObject;if ((framesMove)||(oldTree.dpcpy)) {var _otiid=itemObject.id;itemObject=this._recreateBranch(itemObject,targetObject,beforeNode);if (!oldTree.dpcpy)oldTree.deleteItem(_otiid);}else
 {var Count=targetObject.childsCount;var Nodes=targetObject.childNodes;if (Count==0)targetObject._open=true;oldTree._unselectItem(itemObject);Nodes[Count]=itemObject;itemObject.treeNod=targetObject.treeNod;targetObject.childsCount++;var tr=this._drawNewTr(Nodes[Count].htmlNode);if (!beforeNode){targetObject.htmlNode.childNodes[0].appendChild(tr);if (this.dadmode==1)this._fixNodesCollection(targetObject,beforeNode);}else
 {targetObject.htmlNode.childNodes[0].insertBefore(tr,beforeNode.tr);this._fixNodesCollection(targetObject,beforeNode);Nodes=targetObject.childNodes;}};if ((!oldTree.dpcpy)&&(!framesMove)) {var zir=itemObject.tr;if ((document.all)&&(navigator.appVersion.search(/MSIE\ 5\.0/gi)!=-1))
 {window.setTimeout(function() {zir.parentNode.removeChild(zir);}, 250 );}else 

 itemObject.parentObject.htmlNode.childNodes[0].removeChild(itemObject.tr);if ((!beforeNode)||(targetObject!=itemObject.parentObject)){for (var i=0;i<z.childsCount;i++){if (z.childNodes[i].id==itemObject.id){z.childNodes[i]=0;break;}}}else z.childNodes[z.childsCount-1]=0;oldTree._compressChildList(z.childsCount,z.childNodes);z.childsCount--;};if ((!framesMove)&&(!oldTree.dpcpy)) {itemObject.tr=tr;tr.nodem=itemObject;itemObject.parentObject=targetObject;if (oldTree!=targetObject.treeNod){if(itemObject.treeNod._registerBranch(itemObject,oldTree)) return;this._clearStyles(itemObject);this._redrawFrom(this,itemObject.parentObject);};this._correctPlus(targetObject);this._correctLine(targetObject);this._correctLine(itemObject);this._correctPlus(itemObject);if (beforeNode){this._correctPlus(beforeNode);}else 
 if (targetObject.childsCount>=2){this._correctPlus(Nodes[targetObject.childsCount-2]);this._correctLine(Nodes[targetObject.childsCount-2]);};this._correctPlus(Nodes[targetObject.childsCount-1]);if (this.tscheck)this._correctCheckStates(targetObject);if (oldTree.tscheck)oldTree._correctCheckStates(z);};if (c>1){oldTree._correctPlus(z.childNodes[c-2]);oldTree._correctLine(z.childNodes[c-2]);};oldTree._correctPlus(z);oldTree._correctLine(z);this._fixChildCountLabel(targetObject);oldTree._fixChildCountLabel(z);this.callEvent("onDrop",[itemObject.id,targetObject.id,(beforeNode?beforeNode.id:null),oldTree,targetObject.treeNod]);return itemObject.id;};dhtmlXTreeObject.prototype._clearStyles=function(itemObject){if (!itemObject.htmlNode)return;var td1=itemObject.htmlNode.childNodes[0].childNodes[0].childNodes[1];var td3=td1.nextSibling.nextSibling;itemObject.span.innerHTML=itemObject.label;itemObject.i_sel=false;if (itemObject._aimgs)this.dragger.removeDraggableItem(td1.nextSibling);if (this.checkBoxOff){td1.childNodes[0].style.display="";td1.childNodes[0].onclick=this.onCheckBoxClick;this._setSrc(td1.childNodes[0],this.imPath+this.checkArray[itemObject.checkstate]);}else td1.childNodes[0].style.display="none";td1.childNodes[0].treeNod=this;this.dragger.removeDraggableItem(td3);if (this.dragAndDropOff)this.dragger.addDraggableItem(td3,this);if (this._aimgs)this.dragger.addDraggableItem(td1.nextSibling,this);td3.childNodes[0].className="standartTreeRow";td3.onclick=this.onRowSelect;td3.ondblclick=this.onRowClick2;td1.previousSibling.onclick=this.onRowClick;this._correctLine(itemObject);this._correctPlus(itemObject);for (var i=0;i<itemObject.childsCount;i++)this._clearStyles(itemObject.childNodes[i]);};dhtmlXTreeObject.prototype._registerBranch=function(itemObject,oldTree){if (oldTree)oldTree._globalIdStorageSub(itemObject.id);itemObject.id=this._globalIdStorageAdd(itemObject.id,itemObject);itemObject.treeNod=this;for (var i=0;i<itemObject.childsCount;i++)this._registerBranch(itemObject.childNodes[i],oldTree);return 0;};dhtmlXTreeObject.prototype.enableThreeStateCheckboxes=function(mode) {this.tscheck=convertStringToBoolean(mode);};dhtmlXTreeObject.prototype.setOnMouseInHandler=function(func){this.ehlt=true;this.attachEvent("onMouseIn",func);};dhtmlXTreeObject.prototype.setOnMouseOutHandler=function(func){this.ehlt=true;this.attachEvent("onMouseOut",func);};dhtmlXTreeObject.prototype.enableMercyDrag=function(mode){this.dpcpy=convertStringToBoolean(mode);};dhtmlXTreeObject.prototype.enableTreeImages=function(mode) {this.timgen=convertStringToBoolean(mode);};dhtmlXTreeObject.prototype.enableFixedMode=function(mode) {this.hfMode=convertStringToBoolean(mode);};dhtmlXTreeObject.prototype.enableCheckBoxes=function(mode, hidden){this.checkBoxOff=convertStringToBoolean(mode);this.cBROf=(!(this.checkBoxOff||convertStringToBoolean(hidden)));};dhtmlXTreeObject.prototype.setStdImages=function(image1,image2,image3){this.imageArray[0]=image1;this.imageArray[1]=image2;this.imageArray[2]=image3;};dhtmlXTreeObject.prototype.enableTreeLines=function(mode){this.treeLinesOn=convertStringToBoolean(mode);};dhtmlXTreeObject.prototype.setImageArrays=function(arrayName,image1,image2,image3,image4,image5){switch(arrayName){case "plus": this.plusArray[0]=image1;this.plusArray[1]=image2;this.plusArray[2]=image3;this.plusArray[3]=image4;this.plusArray[4]=image5;break;case "minus": this.minusArray[0]=image1;this.minusArray[1]=image2;this.minusArray[2]=image3;this.minusArray[3]=image4;this.minusArray[4]=image5;break;}};dhtmlXTreeObject.prototype.openItem=function(itemId){var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;else return this._openItem(temp);};dhtmlXTreeObject.prototype._openItem=function(item){var state=this._getOpenState(item);if ((state<0)||(((this.XMLsource)&&(!item.XMLload)))){if (!this.callEvent("onOpenStart",[item.id,state])) return 0;this._HideShow(item,2);if (this.checkEvent("onOpenEnd")){if (this.onXLE==this._epnFHe)this._epnFHe(this,item.id,true);if (!this.xmlstate || !this.XMLsource)this.callEvent("onOpenEnd",[item.id,this._getOpenState(item)]);else{this._oie_onXLE.push(this.onXLE);this.onXLE=this._epnFHe;}}}else if (this._srnd)this._HideShow(item,2);if (item.parentObject && !this._skip_open_parent)this._openItem(item.parentObject);};dhtmlXTreeObject.prototype.closeItem=function(itemId){if (this.rootId==itemId)return 0;var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;if (temp.closeble)this._HideShow(temp,1);};dhtmlXTreeObject.prototype.getLevel=function(itemId){var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;return this._getNodeLevel(temp,0);};dhtmlXTreeObject.prototype.setItemCloseable=function(itemId,flag)
 {flag=convertStringToBoolean(flag);if ((itemId)&&(itemId.span)) 
 var temp=itemId;else 
 var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;temp.closeble=flag;};dhtmlXTreeObject.prototype._getNodeLevel=function(itemObject,count){if (itemObject.parentObject)return this._getNodeLevel(itemObject.parentObject,count+1);return(count);};dhtmlXTreeObject.prototype.hasChildren=function(itemId){var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;else 
 {if ( (this.XMLsource)&&(!temp.XMLload) ) return true;else 
 return temp.childsCount;}};dhtmlXTreeObject.prototype._getLeafCount=function(itemNode){var a=0;for (var b=0;b<itemNode.childsCount;b++)if (itemNode.childNodes[b].childsCount==0)a++;return a;};dhtmlXTreeObject.prototype.setItemText=function(itemId,newLabel,newTooltip)
 {var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;temp.label=newLabel;temp.span.innerHTML=newLabel;if (this.childCalc)this._fixChildCountLabel(temp);temp.span.parentNode.parentNode.title=newTooltip||"";};dhtmlXTreeObject.prototype.getItemTooltip=function(itemId){var temp=this._globalIdStorageFind(itemId);if (!temp)return "";return (temp.span.parentNode.parentNode._dhx_title||temp.span.parentNode.parentNode.title||"");};dhtmlXTreeObject.prototype.refreshItem=function(itemId){if (!itemId)itemId=this.rootId;var temp=this._globalIdStorageFind(itemId);this.deleteChildItems(itemId);this._loadDynXML(itemId);};dhtmlXTreeObject.prototype.setItemImage2=function(itemId, image1,image2,image3){var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;temp.images[1]=image2;temp.images[2]=image3;temp.images[0]=image1;this._correctPlus(temp);};dhtmlXTreeObject.prototype.setItemImage=function(itemId,image1,image2)
 {var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;if (image2){temp.images[1]=image1;temp.images[2]=image2;}else temp.images[0]=image1;this._correctPlus(temp);};dhtmlXTreeObject.prototype.getSubItems =function(itemId)
 {var temp=this._globalIdStorageFind(itemId,0,1);if (!temp)return 0;if(temp.unParsed)return (this._getSubItemsXML(temp.unParsed));var z="";for (i=0;i<temp.childsCount;i++){if (!z)z=temp.childNodes[i].id;else z+=this.dlmtr+temp.childNodes[i].id;};return z;};dhtmlXTreeObject.prototype._getAllScraggyItems =function(node)
 {var z="";for (var i=0;i<node.childsCount;i++){if ((node.childNodes[i].unParsed)||(node.childNodes[i].childsCount>0))
 {if (node.childNodes[i].unParsed)var zb=this._getAllScraggyItemsXML(node.childNodes[i].unParsed,1);else
 var zb=this._getAllScraggyItems(node.childNodes[i])

 if (zb)if (z)z+=this.dlmtr+zb;else z=zb;}else
 if (!z)z=node.childNodes[i].id;else z+=this.dlmtr+node.childNodes[i].id;};return z;};dhtmlXTreeObject.prototype._getAllFatItems =function(node)
 {var z="";for (var i=0;i<node.childsCount;i++){if ((node.childNodes[i].unParsed)||(node.childNodes[i].childsCount>0))
 {if (!z)z=node.childNodes[i].id;else z+=this.dlmtr+node.childNodes[i].id;if (node.childNodes[i].unParsed)var zb=this._getAllFatItemsXML(node.childNodes[i].unParsed,1);else
 var zb=this._getAllFatItems(node.childNodes[i])

 if (zb)z+=this.dlmtr+zb;}};return z;};dhtmlXTreeObject.prototype._getAllSubItems =function(itemId,z,node)
 {if (node)temp=node;else {var temp=this._globalIdStorageFind(itemId);};if (!temp)return 0;z="";for (var i=0;i<temp.childsCount;i++){if (!z)z=temp.childNodes[i].id;else z+=this.dlmtr+temp.childNodes[i].id;var zb=this._getAllSubItems(0,z,temp.childNodes[i])

 if (zb)z+=this.dlmtr+zb;};if (temp.unParsed)z=this._getAllSubItemsXML(itemId,z,temp.unParsed);return z;};dhtmlXTreeObject.prototype.selectItem=function(itemId,mode,preserve){mode=convertStringToBoolean(mode);var temp=this._globalIdStorageFind(itemId);if ((!temp)||(!temp.parentObject)) return 0;if (this.XMLloadingWarning)temp.parentObject.openMe=1;else
 this._openItem(temp.parentObject);var ze=null;if (preserve){ze=new Object;ze.ctrlKey=true;if (temp.i_sel)ze.skipUnSel=true;};if (mode)this.onRowSelect(ze,temp.htmlNode.childNodes[0].childNodes[0].childNodes[3],false);else
 this.onRowSelect(ze,temp.htmlNode.childNodes[0].childNodes[0].childNodes[3],true);};dhtmlXTreeObject.prototype.getSelectedItemText=function()
 {var str=new Array();for (var i=0;i<this._selected.length;i++)str[i]=this._selected[i].span.innerHTML;return (str.join(this.dlmtr));};dhtmlXTreeObject.prototype._compressChildList=function(Count,Nodes)
 {Count--;for (var i=0;i<Count;i++){if (Nodes[i]==0){Nodes[i]=Nodes[i+1];Nodes[i+1]=0;}}};dhtmlXTreeObject.prototype._deleteNode=function(itemId,htmlObject,skip){if ((!htmlObject)||(!htmlObject.parentObject)) return 0;var tempos=0;var tempos2=0;if (htmlObject.tr.nextSibling)tempos=htmlObject.tr.nextSibling.nodem;if (htmlObject.tr.previousSibling)tempos2=htmlObject.tr.previousSibling.nodem;var sN=htmlObject.parentObject;var Count=sN.childsCount;var Nodes=sN.childNodes;for (var i=0;i<Count;i++){if (Nodes[i].id==itemId){if (!skip)sN.htmlNode.childNodes[0].removeChild(Nodes[i].tr);Nodes[i]=0;break;}};this._compressChildList(Count,Nodes);if (!skip){sN.childsCount--;};if (tempos){this._correctPlus(tempos);this._correctLine(tempos);};if (tempos2){this._correctPlus(tempos2);this._correctLine(tempos2);};if (this.tscheck)this._correctCheckStates(sN);if (!skip){this._globalIdStorageRecSub(htmlObject);}};dhtmlXTreeObject.prototype.setCheck=function(itemId,state){var sNode=this._globalIdStorageFind(itemId,0,1);if (!sNode)return;if (state==="unsure")this._setCheck(sNode,state);else
 {state=convertStringToBoolean(state);if ((this.tscheck)&&(this.smcheck)) this._setSubChecked(state,sNode);else this._setCheck(sNode,state);};if (this.smcheck)this._correctCheckStates(sNode.parentObject);};dhtmlXTreeObject.prototype._setCheck=function(sNode,state){if (!sNode)return;if (((sNode.parentObject._r_logic)||(this._frbtr))&&(state))
 if (this._frbtrs){if (this._frbtrL)this.setCheck(this._frbtrL.id,0);this._frbtrL=sNode;}else
 for (var i=0;i<sNode.parentObject.childsCount;i++)this._setCheck(sNode.parentObject.childNodes[i],0);var z=sNode.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];if (state=="unsure")sNode.checkstate=2;else if (state)sNode.checkstate=1;else sNode.checkstate=0;if (sNode.dscheck)sNode.checkstate=sNode.dscheck;this._setSrc(z,this.imPath+((sNode.parentObject._r_logic||this._frbtr)?this.radioArray:this.checkArray)[sNode.checkstate]);};dhtmlXTreeObject.prototype.setSubChecked=function(itemId,state){var sNode=this._globalIdStorageFind(itemId);this._setSubChecked(state,sNode);this._correctCheckStates(sNode.parentObject);};dhtmlXTreeObject.prototype._setSubChecked=function(state,sNode){state=convertStringToBoolean(state);if (!sNode)return;if (((sNode.parentObject._r_logic)||(this._frbtr))&&(state))
 for (var i=0;i<sNode.parentObject.childsCount;i++)this._setSubChecked(0,sNode.parentObject.childNodes[i]);if (sNode.unParsed)this._setSubCheckedXML(state,sNode.unParsed)


 if (sNode._r_logic||this._frbtr)this._setSubChecked(state,sNode.childNodes[0]);else
 for (var i=0;i<sNode.childsCount;i++){this._setSubChecked(state,sNode.childNodes[i]);};var z=sNode.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];if (state)sNode.checkstate=1;else sNode.checkstate=0;if (sNode.dscheck)sNode.checkstate=sNode.dscheck;this._setSrc(z,this.imPath+((sNode.parentObject._r_logic||this._frbtr)?this.radioArray:this.checkArray)[sNode.checkstate]);};dhtmlXTreeObject.prototype.isItemChecked=function(itemId){var sNode=this._globalIdStorageFind(itemId);if (!sNode)return;return sNode.checkstate;};dhtmlXTreeObject.prototype.deleteChildItems=function(itemId)
 {var sNode=this._globalIdStorageFind(itemId);if (!sNode)return;var j=sNode.childsCount;for (var i=0;i<j;i++){this._deleteNode(sNode.childNodes[0].id,sNode.childNodes[0]);}};dhtmlXTreeObject.prototype.deleteItem=function(itemId,selectParent){if ((!this._onrdlh)||(this._onrdlh(itemId))){var z=this._deleteItem(itemId,selectParent);this._fixChildCountLabel(z);};this.allTree.childNodes[0].border = "1";this.allTree.childNodes[0].border = "0";};dhtmlXTreeObject.prototype._deleteItem=function(itemId,selectParent,skip){selectParent=convertStringToBoolean(selectParent);var sNode=this._globalIdStorageFind(itemId);if (!sNode)return;var pid=this.getParentId(itemId);var zTemp=sNode.parentObject;this._deleteNode(itemId,sNode,skip);this._correctPlus(zTemp);this._correctLine(zTemp);if ((selectParent)&&(pid!=this.rootId)) this.selectItem(pid,1);return zTemp;};dhtmlXTreeObject.prototype._globalIdStorageRecSub=function(itemObject){for(var i=0;i<itemObject.childsCount;i++){this._globalIdStorageRecSub(itemObject.childNodes[i]);this._globalIdStorageSub(itemObject.childNodes[i].id);};this._globalIdStorageSub(itemObject.id);var z=itemObject;z.span=null;z.tr.nodem=null;z.tr=null;z.htmlNode=null;};dhtmlXTreeObject.prototype.insertNewNext=function(itemId,newItemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children){var sNode=this._globalIdStorageFind(itemId);if ((!sNode)||(!sNode.parentObject)) return (0);var nodez=this._attachChildNode(0,newItemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children,sNode);if ((!this.XMLloadingWarning)&&(this.childCalc)) this._fixChildCountLabel(sNode.parentObject);return nodez;};dhtmlXTreeObject.prototype.getItemIdByIndex=function(itemId,index){var z=this._globalIdStorageFind(itemId);if ((!z)||(index>=z.childsCount)) return null;return z.childNodes[index].id;};dhtmlXTreeObject.prototype.getChildItemIdByIndex=function(itemId,index){var z=this._globalIdStorageFind(itemId);if ((!z)||(index>=z.childsCount)) return null;return z.childNodes[index].id;};dhtmlXTreeObject.prototype.setDragHandler=function(func){this.attachEvent("onDrag",func);};dhtmlXTreeObject.prototype._clearMove=function(){if (this._lastMark){this._lastMark.className=this._lastMark.className.replace(/dragAndDropRow/g,"");this._lastMark=null;};this.selectionBar.style.display="none";this.allTree.className=this.allTree.className.replace(" selectionBox","");};dhtmlXTreeObject.prototype.enableDragAndDrop=function(mode,rmode){if (mode=="temporary_disabled"){this.dADTempOff=false;mode=true;}else
 this.dADTempOff=true;this.dragAndDropOff=convertStringToBoolean(mode);if (this.dragAndDropOff)this.dragger.addDragLanding(this.allTree,this);if (arguments.length>1)this._ddronr=(!convertStringToBoolean(rmode));};dhtmlXTreeObject.prototype._setMove=function(htmlNode,x,y){if (htmlNode.parentObject.span){var a1=getAbsoluteTop(htmlNode);var a2=getAbsoluteTop(this.allTree)-this.allTree.scrollTop;this.dadmodec=this.dadmode;this.dadmodefix=0;if (this.dadmode==2){var z=y-a1+(document.body.scrollTop||document.documentElement.scrollTop)-2-htmlNode.offsetHeight/2;if ((Math.abs(z)-htmlNode.offsetHeight/6)>0)
 {this.dadmodec=1;if (z<0)this.dadmodefix=0-htmlNode.offsetHeight;}else this.dadmodec=0;};if (this.dadmodec==0){var zN=htmlNode.parentObject.span;zN.className+=" dragAndDropRow";this._lastMark=zN;}else{this._clearMove();this.selectionBar.style.top=(a1-a2+((parseInt(htmlNode.parentObject.span.parentNode.previousSibling.childNodes[0].style.height)||18)-1)+this.dadmodefix)+"px";this.selectionBar.style.left="5px";if (this.allTree.offsetWidth>20)this.selectionBar.style.width=(this.allTree.offsetWidth-(_isFF?30:25))+"px";this.selectionBar.style.display="";};this._autoScroll(null,a1,a2);}};dhtmlXTreeObject.prototype._autoScroll=function(node,a1,a2){if (this.autoScroll){if (node){a1=getAbsoluteTop(node);a2=getAbsoluteTop(this.allTree);};if ( (a1-a2-parseInt(this.allTree.scrollTop))>(parseInt(this.allTree.offsetHeight)-50) )
 this.allTree.scrollTop=parseInt(this.allTree.scrollTop)+20;if ( (a1-a2)<(parseInt(this.allTree.scrollTop)+30) )
 this.allTree.scrollTop=parseInt(this.allTree.scrollTop)-20;}};dhtmlXTreeObject.prototype._createDragNode=function(htmlObject,e){if (!this.dADTempOff)return null;var obj=htmlObject.parentObject;if (!this.callEvent("onBeforeDrag",[obj.id])) return null;if (!obj.i_sel)this._selectItem(obj,e);this._checkMSelectionLogic();var dragSpan=document.createElement('div');var text=new Array();if (this._itim_dg)for (var i=0;i<this._selected.length;i++)text[i]="<table cellspacing='0' cellpadding='0'><tr><td><img width='18px' height='18px' src='"+this._getSrc(this._selected[i].span.parentNode.previousSibling.childNodes[0])+"'></td><td>"+this._selected[i].span.innerHTML+"</td></tr></table>";else
 text=this.getSelectedItemText().split(this.dlmtr);dragSpan.innerHTML=text.join("");dragSpan.style.position="absolute";dragSpan.className="dragSpanDiv";this._dragged=(new Array()).concat(this._selected);return dragSpan;};dhtmlXTreeObject.prototype._focusNode=function(item){var z=getAbsoluteTop(item.htmlNode)-getAbsoluteTop(this.allTree);if ((z>(this.allTree.offsetHeight-30))||(z<0))
 this.allTree.scrollTop=z+this.allTree.scrollTop;};dhtmlXTreeObject.prototype._preventNsDrag=function(e){if ((e)&&(e.preventDefault)) {e.preventDefault();return false;};return false;};dhtmlXTreeObject.prototype._drag=function(sourceHtmlObject,dhtmlObject,targetHtmlObject){if (this._autoOpenTimer)clearTimeout(this._autoOpenTimer);if (!targetHtmlObject.parentObject){targetHtmlObject=this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];this.dadmodec=0;};this._clearMove();var z=sourceHtmlObject.parentObject.treeNod;if ((z)&&(z._clearMove)) z._clearMove("");if ((!this.dragMove)||(this.dragMove()))
 {if ((!z)||(!z._clearMove)||(!z._dragged)) var col=new Array(sourceHtmlObject.parentObject);else var col=z._dragged;var trg=targetHtmlObject.parentObject;for (var i=0;i<col.length;i++){var newID=this._moveNode(col[i],trg);if ((this.dadmodec)&&(newID!==false)) trg=this._globalIdStorageFind(newID,true,true);if ((newID)&&(!this._sADnD)) this.selectItem(newID,0,1);}};if (z)z._dragged=new Array();};dhtmlXTreeObject.prototype._dragIn=function(htmlObject,shtmlObject,x,y){if (!this.dADTempOff)return 0;var fobj=shtmlObject.parentObject;var tobj=htmlObject.parentObject;if ((!tobj)&&(this._ddronr)) return;if (!this.callEvent("onDragIn",[fobj.id,tobj?tobj.id:null,fobj.treeNod,this])){if (tobj)this._autoScroll(htmlObject);return 0;};if (!tobj)this.allTree.className+=" selectionBox";else
 {if (fobj.childNodes==null){this._setMove(htmlObject,x,y);return htmlObject;};var stree=fobj.treeNod;for (var i=0;i<stree._dragged.length;i++)if (this._checkPNodes(tobj,stree._dragged[i])){this._autoScroll(htmlObject);return 0;};this.selectionBar.parentNode.removeChild(this.selectionBar);tobj.span.parentNode.appendChild(this.selectionBar);this._setMove(htmlObject,x,y);if (this._getOpenState(tobj)<=0){this._autoOpenId=tobj.id;this._autoOpenTimer=window.setTimeout(new callerFunction(this._autoOpenItem,this),1000);}};return htmlObject;};dhtmlXTreeObject.prototype._autoOpenItem=function(e,treeObject){treeObject.openItem(treeObject._autoOpenId);};dhtmlXTreeObject.prototype._dragOut=function(htmlObject){this._clearMove();if (this._autoOpenTimer)clearTimeout(this._autoOpenTimer);};dhtmlXTreeObject.prototype._getNextNode=function(item,mode){if ((!mode)&&(item.childsCount)) return item.childNodes[0];if (item==this.htmlNode)return -1;if ((item.tr)&&(item.tr.nextSibling)&&(item.tr.nextSibling.nodem))
 return item.tr.nextSibling.nodem;return this._getNextNode(item.parentObject,true);};dhtmlXTreeObject.prototype._lastChild=function(item){if (item.childsCount)return this._lastChild(item.childNodes[item.childsCount-1]);else return item;};dhtmlXTreeObject.prototype._getPrevNode=function(node,mode){if ((node.tr)&&(node.tr.previousSibling)&&(node.tr.previousSibling.nodem))
 return this._lastChild(node.tr.previousSibling.nodem);if (node.parentObject)return node.parentObject;else return -1;};dhtmlXTreeObject.prototype.findItem=function(searchStr,direction,top){var z=this._findNodeByLabel(searchStr,direction,(top?this.htmlNode:null));if (z){this.selectItem(z.id,true);this._focusNode(z);return z.id;}else return null;};dhtmlXTreeObject.prototype.findItemIdByLabel=function(searchStr,direction,top){var z=this._findNodeByLabel(searchStr,direction,(top?this.htmlNode:null));if (z)return z.id
 else return null;};dhtmlXTreeObject.prototype.findStrInXML=function(node,field,cvalue){if (!node.childNodes && node.item)return this.findStrInJSON(node,field,cvalue);for (var i=0;i<node.childNodes.length;i++){if (node.childNodes[i].nodeType==1){var z=node.childNodes[i].getAttribute(field);if (!z && node.childNodes[i].tagName=="itemtext")z=node.childNodes[i].firstChild.data;if ((z)&&(z.toLowerCase().search(cvalue)!=-1))
 return true;if (this.findStrInXML(node.childNodes[i],field,cvalue)) return true;}};return false;};dhtmlXTreeObject.prototype.findStrInJSON=function(node,field,cvalue){for (var i=0;i<node.item.length;i++){var z=node.item[i].text;if ((z)&&(z.toLowerCase().search(cvalue)!=-1))
 return true;if (node.item[i].item && this.findStrInJSON(node.item[i],field,cvalue)) return true;};return false;};dhtmlXTreeObject.prototype._findNodeByLabel=function(searchStr,direction,fromNode){var searchStr=searchStr.replace(new RegExp("^( )+"),"").replace(new RegExp("( )+$"),"");searchStr = new RegExp(searchStr.replace(/([\?\*\+\\\[\]\(\)]{1})/gi,"\\$1").replace(/ /gi,".*"),"gi");if (!fromNode){fromNode=this._selected[0];if (!fromNode)fromNode=this.htmlNode;};var startNode=fromNode;if (!direction){if ((fromNode.unParsed)&&(this.findStrInXML(fromNode.unParsed.d,"text",searchStr)))
 this.reParse(fromNode);fromNode=this._getNextNode(startNode);if (fromNode==-1)fromNode=this.htmlNode.childNodes[0];}else
 {var z2=this._getPrevNode(startNode);if (z2==-1)z2=this._lastChild(this.htmlNode);if ((z2.unParsed)&&(this.findStrInXML(z2.unParsed.d,"text",searchStr)))
 {this.reParse(z2);fromNode=this._getPrevNode(startNode);}else fromNode=z2;if (fromNode==-1)fromNode=this._lastChild(this.htmlNode);};while ((fromNode)&&(fromNode!=startNode)){if ((fromNode.label)&&(fromNode.label.search(searchStr)!=-1))
 return (fromNode);if (!direction){if (fromNode==-1){if (startNode==this.htmlNode)break;fromNode=this.htmlNode.childNodes[0];};if ((fromNode.unParsed)&&(this.findStrInXML(fromNode.unParsed.d,"text",searchStr)))
 this.reParse(fromNode);fromNode=this._getNextNode(fromNode);if (fromNode==-1)fromNode=this.htmlNode;}else
 {var z2=this._getPrevNode(fromNode);if (z2==-1)z2=this._lastChild(this.htmlNode);if ((z2.unParsed)&&(this.findStrInXML(z2.unParsed.d,"text",searchStr)))
 {this.reParse(z2);fromNode=this._getPrevNode(fromNode);}else fromNode=z2;if (fromNode==-1)fromNode=this._lastChild(this.htmlNode);}};return null;};dhtmlXTreeObject.prototype.moveItem=function(itemId,mode,targetId,targetTree)
{var sNode=this._globalIdStorageFind(itemId);if (!sNode)return (0);switch(mode){case "right": alert('Not supported yet');break;case "item_child":
 var tNode=(targetTree||this)._globalIdStorageFind(targetId);if (!tNode)return (0);(targetTree||this)._moveNodeTo(sNode,tNode,0);break;case "item_sibling":
 var tNode=(targetTree||this)._globalIdStorageFind(targetId);if (!tNode)return (0);(targetTree||this)._moveNodeTo(sNode,tNode.parentObject,tNode);break;case "item_sibling_next":
 var tNode=(targetTree||this)._globalIdStorageFind(targetId);if (!tNode)return (0);if ((tNode.tr)&&(tNode.tr.nextSibling)&&(tNode.tr.nextSibling.nodem))
 (targetTree||this)._moveNodeTo(sNode,tNode.parentObject,tNode.tr.nextSibling.nodem);else
 (targetTree||this)._moveNodeTo(sNode,tNode.parentObject);break;case "left": if (sNode.parentObject.parentObject)this._moveNodeTo(sNode,sNode.parentObject.parentObject,sNode.parentObject);break;case "up": var z=this._getPrevNode(sNode);if ((z==-1)||(!z.parentObject)) return;this._moveNodeTo(sNode,z.parentObject,z);break;case "up_strict": var z=this._getIndex(sNode);if (z!=0)this._moveNodeTo(sNode,sNode.parentObject,sNode.parentObject.childNodes[z-1]);break;case "down_strict": var z=this._getIndex(sNode);var count=sNode.parentObject.childsCount-2;if (z==count)this._moveNodeTo(sNode,sNode.parentObject);else if (z<count)this._moveNodeTo(sNode,sNode.parentObject,sNode.parentObject.childNodes[z+2]);break;case "down": var z=this._getNextNode(this._lastChild(sNode));if ((z==-1)||(!z.parentObject)) return;if (z.parentObject==sNode.parentObject)var z=this._getNextNode(z);if (z==-1){this._moveNodeTo(sNode,sNode.parentObject);}else
 {if ((z==-1)||(!z.parentObject)) return;this._moveNodeTo(sNode,z.parentObject,z);};break;};if (_isIE && _isIE<8){this.allTree.childNodes[0].border = "1";this.allTree.childNodes[0].border = "0";}};dhtmlXTreeObject.prototype.setDragBehavior=function(mode,select){this._sADnD=(!convertStringToBoolean(select));switch (mode) {case "child": this.dadmode=0;break;case "sibling": this.dadmode=1;break;case "complex": this.dadmode=2;break;}};dhtmlXTreeObject.prototype._loadDynXML=function(id,src) {src=src||this.XMLsource;var sn=(new Date()).valueOf();this._ld_id=id;if (this.xmlalb=="function"){if (src)src(this._escape(id));}else
 if (this.xmlalb=="name")this.loadXML(src+this._escape(id));else
 if (this.xmlalb=="xmlname")this.loadXML(src+this._escape(id)+".xml?uid="+sn);else

 this.loadXML(src+getUrlSymbol(src)+"uid="+sn+"&id="+this._escape(id));};dhtmlXTreeObject.prototype.enableMultiselection=function(mode,strict) {this._amsel=convertStringToBoolean(mode);this._amselS=convertStringToBoolean(strict);};dhtmlXTreeObject.prototype._checkMSelectionLogic=function() {var usl=new Array();for (var i=0;i<this._selected.length;i++)for (var j=0;j<this._selected.length;j++)if ((i!=j)&&(this._checkPNodes(this._selected[j],this._selected[i])))
 usl[usl.length]=this._selected[j];for (var i=0;i<usl.length;i++)this._unselectItem(usl[i]);};dhtmlXTreeObject.prototype._checkPNodes=function(item1,item2){if (item2==item1)return 1
 if (item1.parentObject)return this._checkPNodes(item1.parentObject,item2);else return 0;};dhtmlXTreeObject.prototype.enableDistributedParsing=function(mode,count,delay){this._edsbps=convertStringToBoolean(mode);this._edsbpsA=new Array();this._edsbpsC=count||10;this._edsbpsD=delay||250;};dhtmlXTreeObject.prototype.getDistributedParsingState=function(){return (!((!this._edsbpsA)||(!this._edsbpsA.length)));};dhtmlXTreeObject.prototype.getItemParsingState=function(itemId){var z=this._globalIdStorageFind(itemId,true,true)
 if (!z)return 0;if (this._edsbpsA)for (var i=0;i<this._edsbpsA.length;i++)if (this._edsbpsA[i][2]==itemId)return -1;return 1;};dhtmlXTreeObject.prototype._distributedStart=function(node,start,parentId,level,start2){if (!this._edsbpsA)this._edsbpsA=new Array();this._edsbpsA[this._edsbpsA.length]=[node,start,parentId,level,start2];};dhtmlXTreeObject.prototype._distributedStep=function(pId){var self=this;if ((!this._edsbpsA)||(!this._edsbpsA.length)) {self.XMLloadingWarning=0;return;};var z=this._edsbpsA[0];this.parsedArray=new Array();this._parse(z[0],z[2],z[3],z[1]);var zkx=this._globalIdStorageFind(z[2]);this._redrawFrom(this,zkx,z[4],this._getOpenState(zkx));var chArr=this.setCheckList.split(this.dlmtr);for (var n=0;n<chArr.length;n++)if (chArr[n])this.setCheck(chArr[n],1);this._edsbpsA=(new Array()).concat(this._edsbpsA.slice(1));if ((!this._edsbpsA.length)){window.setTimeout( function(){if (self.onXLE)self.onXLE(self,pId);self.callEvent("onXLE",[self,pId]);},1);self.xmlstate=0;}};dhtmlXTreeObject.prototype.enablePaging=function(mode,page_size){this._epgps=convertStringToBoolean(mode);this._epgpsC=page_size||50;};dhtmlXTreeObject.prototype._setPrevPageSign=function(node,pos,level,xmlnode){var z=document.createElement("DIV");z.innerHTML="Previous "+this._epgpsC+" items";z.className="dhx_next_button";var self=this;z.onclick=function(){self._prevPageCall(this);};z._pageData=[node,pos,level,xmlnode];var w=node.childNodes[0];var w2=w.span.parentNode.parentNode.parentNode.parentNode.parentNode;w2.insertBefore(z,w2.firstChild);};dhtmlXTreeObject.prototype._setNextPageSign=function(node,pos,level,xmlnode){var z=document.createElement("DIV");z.innerHTML="Next "+this._epgpsC+" items";z.className="dhx_next_button";var self=this;z.onclick=function(){self._nextPageCall(this);};z._pageData=[node,pos,level,xmlnode];var w=node.childNodes[node.childsCount-1];w.span.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(z);};dhtmlXTreeObject.prototype._nextPageCall=function(node){tree.deleteChildItems(node._pageData[0].id);node.parentNode.removeChild(node);var f=this._getOpenState(node._pageData[0]);this._parseXMLTree(this,node._pageData[3],node._pageData[0].id,node._pageData[2],null,node._pageData[1]);this._redrawFrom(this,node._pageData[0],0);if (f>-1)this._openItem(node._pageData[0]);node._pageData=null;};dhtmlXTreeObject.prototype._prevPageCall=function(node){tree.deleteChildItems(node._pageData[0].id);node.parentNode.removeChild(node);var f=this._getOpenState(node._pageData[0]);var xz=node._pageData[1]-this._epgpsC;if (xz<0)xz=0;this._parseXMLTree(this,node._pageData[3],node._pageData[0].id,node._pageData[2],null,xz);this._redrawFrom(this,node._pageData[0],0);if (f>-1)this._openItem(node._pageData[0]);node._pageData=null;};dhtmlXTreeObject.prototype.enableTextSigns=function(mode){this._txtimg=convertStringToBoolean(mode);};dhtmlXTreeObject.prototype.preventIECaching=function(mode){this.no_cashe = convertStringToBoolean(mode);this.XMLLoader.rSeed=this.no_cashe;};dhtmlXTreeObject.prototype.preventIECashing=dhtmlXTreeObject.prototype.preventIECaching;dhtmlXTreeObject.prototype.disableCheckbox=function(itemId,mode) {if (typeof(itemId)!="object")
 var sNode=this._globalIdStorageFind(itemId,0,1);else
 var sNode=itemId;if (!sNode)return;sNode.dscheck=convertStringToBoolean(mode)?(((sNode.checkstate||0)%3)+3):((sNode.checkstate>2)?(sNode.checkstate-3):sNode.checkstate);this._setCheck(sNode);if (sNode.dscheck<3)sNode.dscheck=false;};dhtmlXTreeObject.prototype.smartRefreshBranch=function(itemId,source){this._branchUpdate=1;this.smartRefreshItem(itemId,source);};dhtmlXTreeObject.prototype.smartRefreshItem=function(itemId,source){var sNode=this._globalIdStorageFind(itemId);for (var i=0;i<sNode.childsCount;i++)sNode.childNodes[i]._dmark=true;this.waitUpdateXML=true;if (source && source.exists)this._parse(source,itemId);else
 this._loadDynXML(itemId,source);};dhtmlXTreeObject.prototype.refreshItems=function(itemIdList,source){var z=itemIdList.toString().split(this.dlmtr);this.waitUpdateXML=new Array();for (var i=0;i<z.length;i++)this.waitUpdateXML[z[i]]=true;this.loadXML((source||this.XMLsource)+getUrlSymbol(source||this.XMLsource)+"ids="+this._escape(itemIdList));};dhtmlXTreeObject.prototype.updateItem=function(itemId,name,im0,im1,im2,achecked){var sNode=this._globalIdStorageFind(itemId);sNode.userData=new cObject();if (name)sNode.label=name;sNode.images=new Array(im0||this.imageArray[0],im1||this.imageArray[1],im2||this.imageArray[2]);this.setItemText(itemId,name);if (achecked)this._setCheck(sNode,true);this._correctPlus(sNode);sNode._dmark=false;return sNode;};dhtmlXTreeObject.prototype.setDropHandler=function(func){this.attachEvent("onDrop",func);};dhtmlXTreeObject.prototype.setOnLoadingStart=function(func){this.attachEvent("onXLS",func);};dhtmlXTreeObject.prototype.setOnLoadingEnd=function(func){this.attachEvent("onXLE",func);};dhtmlXTreeObject.prototype.setXMLAutoLoadingBehaviour=function(mode) {this.xmlalb=mode;};dhtmlXTreeObject.prototype.enableSmartCheckboxes=function(mode) {this.smcheck=convertStringToBoolean(mode);};dhtmlXTreeObject.prototype.getXMLState=function(){return (this.xmlstate==1);};dhtmlXTreeObject.prototype.setItemTopOffset=function(itemId,value){if (typeof(itemId)=="string")
 var node=this._globalIdStorageFind(itemId);else
 var node=itemId;var z=node.span.parentNode.parentNode;node.span.style.paddingBottom="1px";for (var i=0;i<z.childNodes.length;i++){if (i!=0){z.childNodes[i].style.height=18+parseInt(value)+"px";}else{var w=z.childNodes[i].firstChild;if (z.childNodes[i].firstChild.tagName!='DIV'){w=document.createElement("DIV");z.childNodes[i].insertBefore(w,z.childNodes[i].firstChild);};w.style.height=parseInt(value)+"px";if ((node.parentObject.id!=this.rootId || node.parentObject.childNodes[0]!=node)&& this.treeLinesOn)
 w.style.backgroundImage="url("+this.imPath+this.lineArray[5]+")";w.innerHTML="&nbsp;";w.style.overflow='hidden';if (parseInt(value)==0)
 z.childNodes[i].removeChild(w);};z.childNodes[i].style.verticalAlign="bottom";if (_isIE){this.allTree.childNodes[0].border = "1";this.allTree.childNodes[0].border = "0";}}};dhtmlXTreeObject.prototype.setIconSize=function(newWidth,newHeight,itemId)
{if (itemId){if ((itemId)&&(itemId.span))
 var sNode=itemId;else
 var sNode=this._globalIdStorageFind(itemId);if (!sNode)return (0);var img=sNode.span.parentNode.previousSibling.childNodes[0];if (newWidth){img.style.width=newWidth;if (window._KHTMLrv)img.parentNode.style.width=newWidth;};if (newHeight){img.style.height=newHeight;if (window._KHTMLrv)img.parentNode.style.height=newHeight;}}else{this.def_img_x=newWidth;this.def_img_y=newHeight;}};dhtmlXTreeObject.prototype.getItemImage=function(itemId,imageInd,fullPath){var node=this._globalIdStorageFind(itemId);if (!node)return "";var img=node.images[imageInd||0];if (fullPath)img=this.iconURL+img;return img;};dhtmlXTreeObject.prototype.enableRadioButtons=function(itemId,mode){if (arguments.length==1){this._frbtr=convertStringToBoolean(itemId);this.checkBoxOff=this.checkBoxOff||this._frbtr;return;};var node=this._globalIdStorageFind(itemId);if (!node)return "";mode=convertStringToBoolean(mode);if ((mode)&&(!node._r_logic)){node._r_logic=true;for (var i=0;i<node.childsCount;i++)this._setCheck(node.childNodes[i],node.childNodes[i].checkstate);};if ((!mode)&&(node._r_logic)){node._r_logic=false;for (var i=0;i<node.childsCount;i++)this._setCheck(node.childNodes[i],node.childNodes[i].checkstate);}};dhtmlXTreeObject.prototype.enableSingleRadioMode=function(mode){this._frbtrs=convertStringToBoolean(mode);};dhtmlXTreeObject.prototype.openOnItemAdded=function(mode){this._hAdI=!convertStringToBoolean(mode);};dhtmlXTreeObject.prototype.openOnItemAdding=function(mode){this._hAdI=!convertStringToBoolean(mode);};dhtmlXTreeObject.prototype.enableMultiLineItems=function(width) {if (width===true)this.mlitems="100%";else this.mlitems=width;};dhtmlXTreeObject.prototype.enableAutoTooltips=function(mode) {this.ettip=convertStringToBoolean(mode);};dhtmlXTreeObject.prototype.clearSelection=function(itemId){if (itemId)this._unselectItem(this._globalIdStorageFind(itemId));else
 this._unselectItems();};dhtmlXTreeObject.prototype.showItemSign=function(itemId,state){var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;var z=temp.span.parentNode.previousSibling.previousSibling.previousSibling;if (!convertStringToBoolean(state)){this._openItem(temp)
 temp.closeble=false;temp.wsign=true;}else
 {temp.closeble=true;temp.wsign=false;};this._correctPlus(temp);};dhtmlXTreeObject.prototype.showItemCheckbox=function(itemId,state){if (!itemId)for (var a in this._idpull)this.showItemCheckbox(this._idpull[a],state);if (typeof(itemId)!="object")
 itemId=this._globalIdStorageFind(itemId,0,0);if (!itemId)return 0;itemId.nocheckbox=!convertStringToBoolean(state);var t=itemId.span.parentNode.previousSibling.previousSibling.childNodes[0];t.style.display=(!itemId.nocheckbox)?"":"none";if (window._KHTMLrv)t.parentNode.style.display=(!itemId.nocheckbox)?"":"none";};dhtmlXTreeObject.prototype.setListDelimeter=function(separator){this.dlmtr=separator;};dhtmlXTreeObject.prototype.setEscapingMode=function(mode){this.utfesc=mode;};dhtmlXTreeObject.prototype.enableHighlighting=function(mode) {this.ehlt=true;this.ehlta=convertStringToBoolean(mode);};dhtmlXTreeObject.prototype._itemMouseOut=function(){var that=this.childNodes[3].parentObject;var tree=that.treeNod;tree.callEvent("onMouseOut",[that.id]);if (that.id==tree._l_onMSI)tree._l_onMSI=null;if (!tree.ehlta)return;that.span.className=that.span.className.replace("_lor","");};dhtmlXTreeObject.prototype._itemMouseIn=function(){var that=this.childNodes[3].parentObject;var tree=that.treeNod;if (tree._l_onMSI!=that.id)tree.callEvent("onMouseIn",[that.id]);tree._l_onMSI=that.id;if (!tree.ehlta)return;that.span.className=that.span.className.replace("_lor","");that.span.className=that.span.className.replace(/((standart|selected)TreeRow)/,"$1_lor");};dhtmlXTreeObject.prototype.enableActiveImages=function(mode){this._aimgs=convertStringToBoolean(mode);};dhtmlXTreeObject.prototype.focusItem=function(itemId){var sNode=this._globalIdStorageFind(itemId);if (!sNode)return (0);this._focusNode(sNode);};dhtmlXTreeObject.prototype.getAllSubItems =function(itemId){return this._getAllSubItems(itemId);};dhtmlXTreeObject.prototype.getAllChildless =function(){return this._getAllScraggyItems(this.htmlNode);};dhtmlXTreeObject.prototype.getAllLeafs=dhtmlXTreeObject.prototype.getAllChildless;dhtmlXTreeObject.prototype._getAllScraggyItems =function(node)
 {var z="";for (var i=0;i<node.childsCount;i++){if ((node.childNodes[i].unParsed)||(node.childNodes[i].childsCount>0))
 {if (node.childNodes[i].unParsed)var zb=this._getAllScraggyItemsXML(node.childNodes[i].unParsed,1);else
 var zb=this._getAllScraggyItems(node.childNodes[i])

 if (zb)if (z)z+=this.dlmtr+zb;else z=zb;}else
 if (!z)z=node.childNodes[i].id;else z+=this.dlmtr+node.childNodes[i].id;};return z;};dhtmlXTreeObject.prototype._getAllFatItems =function(node)
 {var z="";for (var i=0;i<node.childsCount;i++){if ((node.childNodes[i].unParsed)||(node.childNodes[i].childsCount>0))
 {if (!z)z=node.childNodes[i].id;else z+=this.dlmtr+node.childNodes[i].id;if (node.childNodes[i].unParsed)var zb=this._getAllFatItemsXML(node.childNodes[i].unParsed,1);else
 var zb=this._getAllFatItems(node.childNodes[i])

 if (zb)z+=this.dlmtr+zb;}};return z;};dhtmlXTreeObject.prototype.getAllItemsWithKids =function(){return this._getAllFatItems(this.htmlNode);};dhtmlXTreeObject.prototype.getAllFatItems=dhtmlXTreeObject.prototype.getAllItemsWithKids;dhtmlXTreeObject.prototype.getAllChecked=function(){return this._getAllChecked("","",1);};dhtmlXTreeObject.prototype.getAllUnchecked=function(itemId){if (itemId)itemId=this._globalIdStorageFind(itemId);return this._getAllChecked(itemId,"",0);};dhtmlXTreeObject.prototype.getAllPartiallyChecked=function(){return this._getAllChecked("","",2);};dhtmlXTreeObject.prototype.getAllCheckedBranches=function(){var temp= this._getAllChecked("","",1);if (temp!="")temp+=this.dlmtr;return temp+this._getAllChecked("","",2);};dhtmlXTreeObject.prototype._getAllChecked=function(htmlNode,list,mode){if (!htmlNode)htmlNode=this.htmlNode;if (htmlNode.checkstate==mode)if (!htmlNode.nocheckbox){if (list)list+=this.dlmtr+htmlNode.id;else list=htmlNode.id;};var j=htmlNode.childsCount;for (var i=0;i<j;i++){list=this._getAllChecked(htmlNode.childNodes[i],list,mode);};if (htmlNode.unParsed)list=this._getAllCheckedXML(htmlNode.unParsed,list,mode);if (list)return list;else return "";};dhtmlXTreeObject.prototype.setItemStyle=function(itemId,style_string,resetCss){var resetCss= resetCss|| false;var temp=this._globalIdStorageFind(itemId);if (!temp)return 0;if (!temp.span.style.cssText)temp.span.setAttribute("style",temp.span.getAttribute("style")+";"+style_string);else 
 temp.span.style.cssText = resetCss? style_string : temp.span.style.cssText+";"+style_string;};dhtmlXTreeObject.prototype.enableImageDrag=function(mode){this._itim_dg=convertStringToBoolean(mode);};dhtmlXTreeObject.prototype.setOnDragIn=function(func){this.attachEvent("onDragIn",func);};dhtmlXTreeObject.prototype.enableDragAndDropScrolling=function(mode){this.autoScroll=convertStringToBoolean(mode);};dhtmlXTreeObject.prototype.setSkin=function(name){var tmp = this.parentObject.className.replace(/dhxtree_[^ ]*/gi,"");this.parentObject.className= tmp+" dhxtree_"+name;};(function(){dhtmlx.extend_api("dhtmlXTreeObject",{_init:function(obj){return [obj.parent,(obj.width||"100%"),(obj.height||"100%"),(obj.root_id||0)];},
 auto_save_selection:"enableAutoSavingSelected",
 auto_tooltip:"enableAutoTooltips",
 checkbox:"enableCheckBoxes",
 checkbox_3_state:"enableThreeStateCheckboxes",
 checkbox_smart:"enableSmartCheckboxes",
 context_menu:"enableContextMenu",
 distributed_parsing:"enableDistributedParsing",
 drag:"enableDragAndDrop",
 drag_copy:"enableMercyDrag",
 drag_image:"enableImageDrag",
 drag_scroll:"enableDragAndDropScrolling",
 editor:"enableItemEditor",
 hover:"enableHighlighting",
 images:"enableTreeImages",
 image_fix:"enableIEImageFix",
 image_path:"setImagePath",
 lines:"enableTreeLines",
 loading_item:"enableLoadingItem",
 multiline:"enableMultiLineItems",
 multiselect:"enableMultiselection",
 navigation:"enableKeyboardNavigation",
 radio:"enableRadioButtons",
 radio_single:"enableSingleRadioMode",
 rtl:"enableRTL",
 search:"enableKeySearch",
 smart_parsing:"enableSmartXMLParsing",
 smart_rendering:"enableSmartRendering",
 text_icons:"enableTextSigns",
 xml:"loadXML",
 skin:"setSkin"
 },{});})();dhtmlXTreeObject.prototype._dp_init=function(dp){dp.attachEvent("insertCallback", function(upd, id, parent) {var data = this._loader.doXPath(".//item",upd);var text = data[0].getAttribute('text');this.obj.insertNewItem(parent, id, text, 0, 0, 0, 0, "CHILD");});dp.attachEvent("updateCallback", function(upd, id, parent) {var data = this._loader.doXPath(".//item",upd);var text = data[0].getAttribute('text');this.obj.setItemText(id, text);if (this.obj.getParentId(id)!= parent) {this.obj.moveItem(id, 'item_child', parent);};this.setUpdated(id, true, 'updated');});dp.attachEvent("deleteCallback", function(upd, id, parent) {this.obj.setUserData(id, this.action_param, "true_deleted");this.obj.deleteItem(id, false);});dp._methods=["setItemStyle","","changeItemId","deleteItem"];this.attachEvent("onEdit",function(state,id){if (state==3)dp.setUpdated(id,true)
 return true;});this.attachEvent("onDrop",function(id,id_2,id_3,tree_1,tree_2){if (tree_1==tree_2)dp.setUpdated(id,true);});this._onrdlh=function(rowId){var z=dp.getState(rowId);if (z=="inserted"){dp.set_invalid(rowId,false);dp.setUpdated(rowId,false);return true;};if (z=="true_deleted"){dp.setUpdated(rowId,false);return true;};dp.setUpdated(rowId,true,"deleted")
 return false;};this._onradh=function(rowId){dp.setUpdated(rowId,true,"inserted")
 };dp._getRowData=function(rowId){var data = {};var z=this.obj._globalIdStorageFind(rowId);var z2=z.parentObject;var i=0;for (i=0;i<z2.childsCount;i++)if (z2.childNodes[i]==z)break;data["tr_id"] = z.id;data["tr_pid"] = z2.id;data["tr_order"] = i;data["tr_text"] = z.span.innerHTML;z2=(z._userdatalist||"").split(",");for (i=0;i<z2.length;i++)data[z2[i]]=z.userData["t_"+z2[i]];return data;}};dhtmlXTreeObject.prototype.parserExtension={_parseExtension:function(p,a,pid) {this._idpull[a.id]._attrs=a;}};dhtmlXTreeObject.prototype.getAttribute=function(id,name){this._globalIdStorageFind(id)
 var t=this._idpull[id]._attrs;return t?t[name]:window.undefined;};dhtmlXTreeObject.prototype.setAttribute=function(id,name,value){this._globalIdStorageFind(id)
 var t=(this._idpull[id]._attrs)||{};t[name]=value;this._idpull[id]._attrs=t;};dhtmlXTreeObject.prototype.makeDraggable=function(obj,func){if (typeof(obj)!="object")
 obj=document.getElementById(obj);dragger=new dhtmlDragAndDropObject();dropper=new dhx_dragSomethingInTree();dragger.addDraggableItem(obj,dropper);obj.dragLanding=null;obj.ondragstart=dropper._preventNsDrag;obj.onselectstart=new Function("return false;");obj.parentObject=new Object;obj.parentObject.img=obj;obj.parentObject.treeNod=dropper;dropper._customDrop=func;};dhtmlXTreeObject.prototype.makeDragable=dhtmlXTreeObject.prototype.makeDraggable;dhtmlXTreeObject.prototype.makeAllDraggable=function(func){var z=document.getElementsByTagName("div");for (var i=0;i<z.length;i++)if (z[i].getAttribute("dragInDhtmlXTree"))
 this.makeDragable(z[i],func);};function dhx_dragSomethingInTree(){this.lWin=window;this._createDragNode=function(node){var dragSpan=document.createElement('div');dragSpan.style.position="absolute";dragSpan.innerHTML=node.innerHTML;dragSpan.className="dragSpanDiv";return dragSpan;};this._preventNsDrag=function(e){(e||window.event).cancelBubble=true;if ((e)&&(e.preventDefault)) {e.preventDefault();return false;};return false;};this._nonTrivialNode=function(tree,item,bitem,source){if (this._customDrop)return this._customDrop(tree,source.img.id,item.id,bitem?bitem.id:null);var image=(source.img.getAttribute("image")||"");var id=source.img.id||"new";var text=(source.img.getAttribute("text")||(_isIE?source.img.innerText:source.img.textContent));tree[bitem?"insertNewNext":"insertNewItem"](bitem?bitem.id:item.id,id,text,"",image,image,image);}};dhtmlXTreeObject.prototype.enableItemEditor=function(mode){this._eItEd=convertStringToBoolean(mode);if (!this._eItEdFlag){this._edn_click_IE=true;this._edn_dblclick=true;this._ie_aFunc=this.aFunc;this._ie_dblclickFuncHandler=this.dblclickFuncHandler;this.setOnDblClickHandler(function (a,b) {if (this._edn_dblclick)this._editItem(a,b);return true;});this.setOnClickHandler(function (a,b) {this._stopEditItem(a,b);if ((this.ed_hist_clcik==a)&&(this._edn_click_IE))
 this._editItem(a,b);this.ed_hist_clcik=a;return true;});this._eItEdFlag=true;}};dhtmlXTreeObject.prototype.setOnEditHandler=function(func){this.attachEvent("onEdit",func);};dhtmlXTreeObject.prototype.setEditStartAction=function(click_IE, dblclick){this._edn_click_IE=convertStringToBoolean(click_IE);this._edn_dblclick=convertStringToBoolean(dblclick);};dhtmlXTreeObject.prototype._stopEdit=function(a){if (this._editCell){this.dADTempOff=this.dADTempOffEd;if (this._editCell.id!=a){var editText=true;editText=this.callEvent("onEdit",[2,this._editCell.id,this,this._editCell.span.childNodes[0].value]);if (editText===true)editText=this._editCell.span.childNodes[0].value;else if (editText===false)editText=this._editCell._oldValue;var changed = (editText!=this._editCell._oldValue);this._editCell.span.innerHTML=editText;this._editCell.label=this._editCell.span.innerHTML;var cSS=this._editCell.i_sel?"selectedTreeRow":"standartTreeRow";this._editCell.span.className=cSS;this._editCell.span.parentNode.className="standartTreeRow";this._editCell.span.style.paddingRight=this._editCell.span.style.paddingLeft='5px';this._editCell.span.onclick=this._editCell.span.ondblclick=function(){};var id=this._editCell.id;if (this.childCalc)this._fixChildCountLabel(this._editCell);this._editCell=null;this.callEvent("onEdit",[3,id,this,changed]);if (this._enblkbrd){this.parentObject.lastChild.focus();this.parentObject.lastChild.focus();}}}};dhtmlXTreeObject.prototype._stopEditItem=function(id,tree){this._stopEdit(id);};dhtmlXTreeObject.prototype.stopEdit=function(){if (this._editCell)this._stopEdit(this._editCell.id+"_non");};dhtmlXTreeObject.prototype.editItem=function(id){this._editItem(id,this);};dhtmlXTreeObject.prototype._editItem=function(id,tree){if (this._eItEd){this._stopEdit();var temp=this._globalIdStorageFind(id);if (!temp)return;editText=this.callEvent("onEdit",[0,id,this,temp.span.innerHTML]);if (editText===true)editText=temp.label;else if (editText===false)return;this.dADTempOffEd=this.dADTempOff;this.dADTempOff=false;this._editCell=temp;temp._oldValue=editText;temp.span.innerHTML="<input type='text' class='intreeeditRow' />";temp.span.style.paddingRight=temp.span.style.paddingLeft='0px';temp.span.onclick = temp.span.ondblclick= function(e){(e||event).cancelBubble = true;};temp.span.childNodes[0].value=editText;temp.span.childNodes[0].onselectstart=function(e){(e||event).cancelBubble=true;return true;};temp.span.childNodes[0].onmousedown=function(e){(e||event).cancelBubble=true;return true;};temp.span.childNodes[0].focus();temp.span.childNodes[0].focus();temp.span.onclick=function (e){(e||event).cancelBubble=true;return false;};temp.span.className="";temp.span.parentNode.className="";var self=this;temp.span.childNodes[0].onkeydown=function(e){if (!e)e=window.event;if (e.keyCode==13){e.cancelBubble=true;self._stopEdit(window.undefined);}else if (e.keyCode==27){self._editCell.span.childNodes[0].value=self._editCell._oldValue;self._stopEdit(window.undefined);};(e||event).cancelBubble=true;};this.callEvent("onEdit",[1,id,this]);}};function jsonPointer(data,parent){this.d=data;this.dp=parent;};jsonPointer.prototype={text:function(){var afff=function(n){var p=[];for(var i=0;i<n.length;i++)p.push("{"+sfff(n[i])+"}");return p.join(",");};var sfff=function(n){var p=[];for (var a in n)if (typeof(n[a])=="object"){if (a.length)p.push('"'+a+'":['+afff(n[a])+"]");else p.push('"'+a+'":{'+sfff(n[a])+"}");}else p.push('"'+a+'":"'+n[a]+'"');return p.join(",");};return "{"+sfff(this.d)+"}";},
 get:function(name){return this.d[name];},
 exists:function(){return !!this.d },
 content:function(){return this.d.content;},
 each:function(name,f,t){var a=this.d[name];var c=new jsonPointer();if (a)for (var i=0;i<a.length;i++){c.d=a[i];f.apply(t,[c,i]);}},
 get_all:function(){return this.d;},
 sub:function(name){return new jsonPointer(this.d[name],this.d) },
 sub_exists:function(name){return !!this.d[name];},
 each_x:function(name,rule,f,t,i){var a=this.d[name];var c=new jsonPointer(0,this.d);if (a)for (i=i||0;i<a.length;i++)if (a[i][rule]){c.d=a[i];if(f.apply(t,[c,i])==-1) return;}},
 up:function(name){return new jsonPointer(this.dp,this.d);},
 set:function(name,val){this.d[name]=val;},
 clone:function(name){return new jsonPointer(this.d,this.dp);},
 through:function(name,rule,v,f,t){var a=this.d[name];if (a.length)for (var i=0;i<a.length;i++){if (a[i][rule]!=null && a[i][rule]!="" && (!v || a[i][rule]==v )) {var c=new jsonPointer(a[i],this.d);f.apply(t,[c,i]);};var w=this.d;this.d=a[i];if (this.sub_exists(name)) this.through(name,rule,v,f,t);this.d=w;}}};dhtmlXTreeObject.prototype.loadJSArrayFile=function(file,afterCall){if (!this.parsCount)this.callEvent("onXLS",[this,this._ld_id]);this._ld_id=null;this.xmlstate=1;var that=this;this.XMLLoader=new dtmlXMLLoaderObject(function(){eval("var z="+arguments[4].xmlDoc.responseText);that.loadJSArray(z);},this,true,this.no_cashe);if (afterCall)this.XMLLoader.waitCall=afterCall;this.XMLLoader.loadXML(file);};dhtmlXTreeObject.prototype.loadCSV=function(file,afterCall){if (!this.parsCount)this.callEvent("onXLS",[this,this._ld_id]);this._ld_id=null;this.xmlstate=1;var that=this;this.XMLLoader=new dtmlXMLLoaderObject(function(){that.loadCSVString(arguments[4].xmlDoc.responseText);},this,true,this.no_cashe);if (afterCall)this.XMLLoader.waitCall=afterCall;this.XMLLoader.loadXML(file);};dhtmlXTreeObject.prototype.loadJSArray=function(ar,afterCall){var z=[];for (var i=0;i<ar.length;i++){if (!z[ar[i][1]])z[ar[i][1]]=[];z[ar[i][1]].push({id:ar[i][0],text:ar[i][2]});};var top={id: this.rootId};var f=function(top,f){if (z[top.id]){top.item=z[top.id];for (var j=0;j<top.item.length;j++)f(top.item[j],f);}};f(top,f);this.loadJSONObject(top,afterCall);};dhtmlXTreeObject.prototype.loadCSVString=function(csv,afterCall){var z=[];var ar=csv.split("\n");for (var i=0;i<ar.length;i++){var t=ar[i].split(",");if (!z[t[1]])z[t[1]]=[];z[t[1]].push({id:t[0],text:t[2]});};var top={id: this.rootId};var f=function(top,f){if (z[top.id]){top.item=z[top.id];for (var j=0;j<top.item.length;j++)f(top.item[j],f);}};f(top,f);this.loadJSONObject(top,afterCall);};dhtmlXTreeObject.prototype.loadJSONObject=function(json,afterCall){if (!this.parsCount)this.callEvent("onXLS",[this,null]);this.xmlstate=1;var p=new jsonPointer(json);this._parse(p);this._p=p;if (afterCall)afterCall();};dhtmlXTreeObject.prototype.loadJSON=function(file,afterCall){if (!this.parsCount)this.callEvent("onXLS",[this,this._ld_id]);this._ld_id=null;this.xmlstate=1;var that=this;this.XMLLoader=new dtmlXMLLoaderObject(function(){try {eval("var t="+arguments[4].xmlDoc.responseText);}catch(e){dhtmlxError.throwError("LoadXML", "Incorrect JSON", [
 (arguments[4].xmlDoc),
 this
 ]);return;};var p=new jsonPointer(t);that._parse(p);that._p=p;},this,true,this.no_cashe);if (afterCall)this.XMLLoader.waitCall=afterCall;this.XMLLoader.loadXML(file);};dhtmlXTreeObject.prototype.serializeTreeToJSON=function(){var out=['{"id":"'+this.rootId+'", "item":['];var p=[];for (var i=0;i<this.htmlNode.childsCount;i++)p.push(this._serializeItemJSON(this.htmlNode.childNodes[i]));out.push(p.join(","));out.push("]}");return out.join("");};dhtmlXTreeObject.prototype._serializeItemJSON=function(itemNode){var out=[];if (itemNode.unParsed)return (itemNode.unParsed.text());if (this._selected.length)var lid=this._selected[0].id;else lid="";var text=itemNode.span.innerHTML;if (this._xescapeEntities)for (var i=0;i<this._serEnts.length;i++)text=text.replace(this._serEnts[i][2],this._serEnts[i][1]);if (!this._xfullXML)out.push('{"id":"'+itemNode.id+'", '+(this._getOpenState(itemNode)==1?' "open":"1", ':'')+(lid==itemNode.id?' "select":"1",':'')+' "text":"'+text+'"'+( ((this.XMLsource)&&(itemNode.XMLload==0))?', "child":"1" ':''));else
 out.push('{"id":"'+itemNode.id+'", '+(this._getOpenState(itemNode)==1?' "open":"1", ':'')+(lid==itemNode.id?' "select":"1",':'')+' "text":"'+text+'", "im0":"'+itemNode.images[0]+'", "im1":"'+itemNode.images[1]+'", "im2":"'+itemNode.images[2]+'" '+(itemNode.acolor?(', "aCol":"'+itemNode.acolor+'" '):'')+(itemNode.scolor?(', "sCol":"'+itemNode.scolor+'" '):'')+(itemNode.checkstate==1?', "checked":"1" ':(itemNode.checkstate==2?', "checked":"-1"':''))+(itemNode.closeable?', "closeable":"1" ':'')+( ((this.XMLsource)&&(itemNode.XMLload==0))?', "child":"1" ':''));if ((this._xuserData)&&(itemNode._userdatalist))
 {out.push(', "userdata":[');var names=itemNode._userdatalist.split(",");var p=[];for (var i=0;i<names.length;i++)p.push('{"name":"'+names[i]+'" , "content":"'+itemNode.userData["t_"+names[i]]+'" }');out.push(p.join(","));out.push("]");};if (itemNode.childsCount){out.push(', "item":[');var p=[];for (var i=0;i<itemNode.childsCount;i++)p.push(this._serializeItemJSON(itemNode.childNodes[i]));out.push(p.join(","));out.push("]\n");};out.push("}\n")
 return out.join("");};dhtmlXTreeObject.prototype.enableKeyboardNavigation=function(mode){this._enblkbrd=convertStringToBoolean(mode);if (this._enblkbrd){if (_isFF){var z=window.getComputedStyle(this.parentObject,null)["position"];if ((z!="absolute")&&(z!="relative"))
 this.parentObject.style.position="relative";};this._navKeys=[["up",38],["down",40],["open",39],["close",37],["call",13],["edit",113]];var self=this;var z=document.createElement("INPUT");z.className="a_dhx_hidden_input";z.autocomplete="off";if (window._KHTMLrv)z.style.color="white";this.parentObject.appendChild(z);this.parentObject[_isOpera?"onkeypress":"onkeydown"]=function(e){if (self.callEvent("onKeyPress",[(e||window.event).keyCode,(e||window.event)]))
 return self._onKeyDown(e||window.event)
 
 };this.parentObject.onclick=function(e){if (_isFF)z.select();if (window._KHTMLrv || _isOpera)z.focus();}}else
 this.parentObject.onkeydown=null;};dhtmlXTreeObject.prototype._onKeyDown=function(e){var self=this;for (var i=0;i<this._navKeys.length;i++)if (this._navKeys[i][1]==e.keyCode){this["_onkey_"+this._navKeys[i][0]].apply(this,[this.getSelectedItemId()]);if (e.preventDefault)e.preventDefault();(e||event).cancelBubble=true;return false;};if (this._textSearch){return this._searchItemByKey(e);};return true;};dhtmlXTreeObject.prototype._onkey_up=function(id){var temp=this._globalIdStorageFind(id);if (!temp)return;var next=this._getPrevVisibleNode(temp);if (next.id==this.rootId)return;this.focusItem(next.id);this.selectItem(next.id,false);};dhtmlXTreeObject.prototype._onkey_down=function(id){var temp=this._globalIdStorageFind(id);if (!temp)return;var next=this._getNextVisibleNode(temp);if (next.id==this.rootId)return;this.focusItem(next.id);this.selectItem(next.id,false);};dhtmlXTreeObject.prototype._onkey_open=function(id){this.openItem(id);};dhtmlXTreeObject.prototype._onkey_close=function(id){this.closeItem(id);};dhtmlXTreeObject.prototype._onkey_call=function(id){if (this.stopEdit){this.stopEdit();this.parentObject.lastChild.focus();this.parentObject.lastChild.focus();this.selectItem(id,true);}else
 this.selectItem(this.getSelectedItemId(),true);};dhtmlXTreeObject.prototype._onkey_edit=function(id){if (this.editItem)this.editItem(id);};dhtmlXTreeObject.prototype._getNextVisibleNode=function(item,mode){if ((!mode)&&(this._getOpenState(item)>0)) return item.childNodes[0];if ((item.tr)&&(item.tr.nextSibling)&&(item.tr.nextSibling.nodem))
 return item.tr.nextSibling.nodem;if (item.parentObject)return this._getNextVisibleNode(item.parentObject,1);return item;};dhtmlXTreeObject.prototype._getPrevVisibleNode=function(item){if ((item.tr)&&(item.tr.previousSibling)&&(item.tr.previousSibling.nodem))
 return this._lastVisibleChild(item.tr.previousSibling.nodem);if (item.parentObject)return item.parentObject;else return item;};dhtmlXTreeObject.prototype._lastVisibleChild=function(item){if (this._getOpenState(item)>0)
 return this._lastVisibleChild(item.childNodes[item.childsCount-1]);else return item;};dhtmlXTreeObject.prototype._searchItemByKey=function(e){if (e.keyCode==8){this._textSearchString='';return true;};var key = String.fromCharCode(e.keyCode).toUpperCase();if (key.match(/[A-Z,a-z,0-9\ ]/)) {this._textSearchString += key;this._textSearchInProgress = true;if (!(this.getSelectedItemText()||"").match(RegExp('^'+this._textSearchString,"i"))){this.findItem('^'+this._textSearchString, 0);};this._textSearchInProgress = false;if (e.preventDefault)e.preventDefault();(e||event).cancelBubble=true;return false;};return true;};dhtmlXTreeObject.prototype.assignKeys=function(keys){this._navKeys=keys;};dhtmlXTreeObject.prototype.enableKeySearch=function(mode){this._textSearch = convertStringToBoolean(mode);if (!this._textSearch)return;this._textSearchString = '';var self = this;this._markItem2 = this._markItem;this._markItem = function(node)
 {if (!self._textSearchInProgress)self._textSearchString = '';self._markItem2(node);}};dhtmlXTreeObject.prototype.enableLoadingItem=function(text) {this.attachEvent("onXLS",this._showFakeItem);this.attachEvent("onXLE",this._hideFakeItem);this._tfi_text=text||"Loading...";};dhtmlXTreeObject.prototype._showFakeItem=function(tree,id) {if ((id===null)||(this._globalIdStorageFind("fake_load_xml_"+id))) return;var temp = this.XMLsource;this.XMLsource=null;this.insertNewItem(id,"fake_load_xml_"+id,this._tfi_text);this.XMLsource=temp;};dhtmlXTreeObject.prototype._hideFakeItem=function(tree,id) {if (id===null)return;this.deleteItem("fake_load_xml_"+id);};dhtmlXTreeObject.prototype.isLocked=function(itemId)
 {if (!this._locker)this._init_lock();return (this._locker[itemId]==true);};dhtmlXTreeObject.prototype._lockItem=function(sNode,state,skipdraw){if (!this._locker)this._init_lock();if (state){if (this._locker[sNode.id]==true)return;this._locker[sNode.id]=true;sNode.bIm0=sNode.images[0];sNode.bIm1=sNode.images[1];sNode.bIm2=sNode.images[2];sNode.images[0]=this.lico0;sNode.images[1]=this.lico1;sNode.images[2]=this.lico2;var z1=sNode.span.parentNode;var z2=z1.previousSibling;this.dragger.removeDraggableItem(z1);this.dragger.removeDraggableItem(z2);}else{if (this._locker[sNode.id]!=true)return;this._locker[sNode.id]=false;sNode.images[0]=sNode.bIm0;sNode.images[1]=sNode.bIm1;sNode.images[2]=sNode.bIm2;var z1=sNode.span.parentNode;var z2=z1.previousSibling;this.dragger.addDraggableItem(z1,this);this.dragger.addDraggableItem(z2,this);};if (!skipdraw)this._correctPlus(sNode);};dhtmlXTreeObject.prototype.lockItem=function(itemId,state)
 {if (!this._locker)this._init_lock();this._lockOn=false;var sNode=this._globalIdStorageFind(itemId);this._lockOn=true;this._lockItem(sNode,convertStringToBoolean(state));};dhtmlXTreeObject.prototype.setLockedIcons=function(im0,im1,im2)
 {if (!this._locker)this._init_lock();this.lico0=im0;this.lico1=im1;this.lico2=im2;};dhtmlXTreeObject.prototype._init_lock=function()
 {this._locker=new Array();this._locker_count="0";this._lockOn=true;this._globalIdStorageFindA=this._globalIdStorageFind;this._globalIdStorageFind=this._lockIdFind;if (this._serializeItem){this._serializeItemA=this._serializeItem;this._serializeItem=this._serializeLockItem;this._serializeTreeA=this.serializeTree;this.serializeTree=this._serializeLockTree;};this.setLockedIcons(this.imageArray[0],this.imageArray[1],this.imageArray[2]);};dhtmlXTreeObject.prototype._lockIdFind=function(itemId,skipXMLSearch,skipParsing)
 {if (!this.skipLock)if ((!skipParsing)&&(this._lockOn==true)&&(this._locker[itemId]==true)) {return null;};return this._globalIdStorageFindA(itemId,skipXMLSearch,skipParsing);};dhtmlXTreeObject.prototype._serializeLockItem=function(node)
 {if (this._locker[node.id]==true)return "";return this._serializeItemA(node);};dhtmlXTreeObject.prototype._serializeLockTree=function()
 {var out=this._serializeTreeA();return out.replace(/<item[^>]+locked\=\"1\"[^>]+\/>/g,"");};dhtmlXTreeObject.prototype._moveNodeToA=dhtmlXTreeObject.prototype._moveNodeTo;dhtmlXTreeObject.prototype._moveNodeTo=function(itemObject,targetObject,beforeNode){if ((targetObject.treeNod.isLocked)&&(targetObject.treeNod.isLocked(targetObject.id))) {return false;};return this._moveNodeToA(itemObject,targetObject,beforeNode);};dhtmlXTreeObject.prototype.lockTree=function(isLock)
{if (convertStringToBoolean(isLock))
 this._initTreeLocker();else
 if (this._TreeLocker){this._TreeLocker.parentNode.removeChild(this._TreeLocker);this._TreeLocker=null;}};dhtmlXTreeObject.prototype._initTreeLocker=function(isLock)
{if (this._TreeLocker)return;this.parentObject.style.overflow="hidden";if (this.parentObject.style.position != 'absolute')this.parentObject.style.position = 'relative';var div = document.createElement('div');div.style.position = 'absolute';div.style.left = '0px';div.style.top = '0px';div.className = 'dhx_tree_opacity';div.style.width = this.allTree.offsetWidth+'px';div.style.backgroundColor = '#FFFFFF';div.style.height = this.allTree.offsetHeight+'px';this._TreeLocker = div;this.parentObject.appendChild(this._TreeLocker);};dhtmlXTreeObject.prototype.enableRTL=function(mode){var z=convertStringToBoolean(mode);if (((z)&&(!this.rtlMode))||((!z)&&(this.rtlMode)))
 {this.rtlMode=z;this._switchToRTL(this.rtlMode);}};dhtmlXTreeObject.prototype._switchToRTL=function(mode) {if (mode){this.allTree.className=
 this._ltr_line=this.lineArray;this._ltr_min=this.minusArray;this._ltr_plus=this.plusArray;this.lineArray=new Array("line2_rtl.gif","line3_rtl.gif","line4_rtl.gif","blank.gif","blank.gif","line1_rtl.gif");this.minusArray=new Array("minus2_rtl.gif","minus3_rtl.gif","minus4_rtl.gif","minus.gif","minus5_rtl.gif");this.plusArray=new Array("plus2_rtl.gif","plus3_rtl.gif","plus4_rtl.gif","plus.gif","plus5_rtl.gif");this.allTree.className="containerTableStyleRTL";}else
 {this.allTree.className="containerTableStyle";this.lineArray=this._ltr_line;this.minusArray=this._ltr_min;this.plusArray=this._ltr_plus;};if (this.htmlNode.childsCount)this._redrawFrom(this,this.htmlNode);};dhtmlXTreeObject.prototype.sortTree=function(nodeId,order,all_levels)
 {var sNode=this._globalIdStorageFind(nodeId);if (!sNode)return false;this._reorderBranch(sNode,(order.toString().toLowerCase()=="asc"),convertStringToBoolean(all_levels))
 };dhtmlXTreeObject.prototype.setCustomSortFunction=function(func)
 {this._csfunca=func;};dhtmlXTreeObject.prototype._reorderBranch=function(node,order,all_levels){var m=[];var count=node.childsCount;if (!count)return;var parent = node.childNodes[0].tr.parentNode;for (var i=0;i<count;i++){m[i]=node.childNodes[i];parent.removeChild(m[i].tr);};var self=this;if (order==1)if(this._csfunca)m.sort( function(a,b){return self._csfunca(a.id,b.id);});else
 m.sort( function(a,b){return ((a.span.innerHTML.toUpperCase()>b.span.innerHTML.toUpperCase())?1:((a.span.innerHTML.toUpperCase()==b.span.innerHTML.toUpperCase())?0:-1)) });else
 if(this._csfunca)m.sort( function(a,b){return self._csfunca(b.id,a.id);});else
 m.sort( function(a,b){return ((a.span.innerHTML.toUpperCase()<b.span.innerHTML.toUpperCase())?1:((a.span.innerHTML.toUpperCase()==b.span.innerHTML.toUpperCase())?0:-1)) });for (var i=0;i<count;i++){parent.appendChild(m[i].tr);node.childNodes[i]=m[i];if ((all_levels)&&(m[i].unParsed))
 m[i].unParsed.set("order",order?1:-1);else
 if ((all_levels)&&(m[i].childsCount))
 this._reorderBranch(m[i],order,all_levels);};for (var i=0;i<count;i++){this._correctPlus(m[i]);this._correctLine(m[i]);}};dhtmlXTreeObject.prototype._reorderXMLBranch=function(node){var orderold=node.getAttribute("order");if (orderold=="none")return;var order=(orderold==1);var count=node.childNodes.length;if (!count)return;var m=new Array();var j=0;for (var i=0;i<count;i++)if (node.childNodes[i].nodeType==1){m[j]=node.childNodes[i];j++ };for (var i=count-1;i!=0;i--)node.removeChild(node.childNodes[i]);if (order)m.sort( function(a,b){return ((a.getAttribute("text")>b.getAttribute("text"))?1:((a.getAttribute("text")==b.getAttribute("text"))?0:-1)) });else
 m.sort( function(a,b){return ((a.getAttribute("text")<b.getAttribute("text"))?1:((a.getAttribute("text")==b.getAttribute("text"))?0:-1)) });for (var i=0;i<j;i++){m[i].setAttribute("order",orderold);node.appendChild(m[i]);};node.setAttribute("order","none");};dhtmlXTreeObject.prototype.enableSmartRendering=function(){this.enableSmartXMLParsing(true);this._srnd=true;this.itemHeight=18;var that=this;this.allTree.onscroll=function(){if (that._srndT)return;that._srndT=window.setTimeout(function(){that._srndT=null;that._renderState();},300);};this.attachEvent("onXLE",function(){that._renderState();});this._singleTimeSRND();};dhtmlXTreeObject.prototype._renderState=function(){if (!this._idpull[this.rootId]._sready)this.prepareSR(this.rootId,true);var top=this.allTree.scrollTop;var pos=Math.floor(top/this.itemHeight);var height=Math.ceil(this.allTree.offsetHeight/this.itemHeight);this._group_render=true;this._getItemByPos(top,this.itemHeight,height,null,false,this._renderItemSRND);this._group_render=false;};dhtmlXTreeObject.prototype._renderItemSRND=function(a,b){if (!a.span){a.span=-1;var z=a.parentObject.htmlNode.childNodes[0].childNodes;var count=b*this.itemHeight;var x=null;for (var i=1;i<z.length;i++){x=z[i];var y=x.nodem?this.itemHeight:(x.offsetHeight||parseInt(x.childNodes[1].firstChild.style.height));count-=y;if (count<0){if (count==-1){count++;continue;};var h=x.childNodes[1].firstChild;h.style.height=(parseInt(h.style.height)-(y-Math.abs(count)+this.itemHeight))+"px";if (Math.abs(count)!=y){var fill=this._drawNewHolder(count+y,true);x.parentNode.insertBefore(fill,x)
 
 };x.tr={nextSibling:x};break;}};if (h && h.style.height!="0px" && !x.offsetHeight){var rh=this._hAdI;this._hAdI=true;};this._parseItem(a._sxml,a.parentObject,null,x);if (h && h.style.height!="0px" && !x.offsetHeight){this._hAdI=rh;};if (a.unParsed)this._correctPlus(a);if (h && h.style.height=="0px")x.parentNode.removeChild(x);}};dhtmlXTreeObject.prototype._buildSRND=function(z,skipParsing){if (z.parentObject)this._globalIdStorageFind(z.parentObject.id);if (!this._idpull[this.rootId]._sready)this.prepareSR(this.rootId,true);this._renderItemSRND(z,this._getIndex(z));if ((z.unParsed)&&(!skipParsing))
 this.reParse(z,0);if (!z.prepareSR)this.prepareSR(z.id);};dhtmlXTreeObject.prototype._getIndex=function(z){for (var a=0;a<z.parentObject.childsCount;a++)if (z.parentObject.childNodes[a]==z)return a;};dhtmlXTreeObject.prototype.prepareSR=function(it,mode){it=this._idpull[it];if (it._sready)return;var tr=this._drawNewHolder(this.itemHeight*it.childsCount,mode);it.htmlNode.childNodes[0].appendChild(tr);it._sready=true;};dhtmlXTreeObject.prototype._drawNewHolder=function(s,mode){var t=document.createElement("TR");var b=document.createElement("TD");var b2=document.createElement("TD");var z=document.createElement("DIV");z.innerHTML="&nbsp;";b.appendChild(z)
 t.appendChild(b2);t.appendChild(b);if (!mode){t.style.display="none";};z.style.height=s+'px';return t;};dhtmlXTreeObject.prototype._getNextNodeSR=function(item,mode){if ((!mode)&&(item.childsCount)) return item.childNodes[0];if (item==this.htmlNode)return -1;if ((item.tr)&&(item.tr.nextSibling)&&(item.tr.nextSibling.nodem))
 return item.tr.nextSibling.nodem;return this._getNextNode(item.parentObject,true);};dhtmlXTreeObject.prototype._getItemByPos=function(pos,h,l,i,m,f){if (!i){this._pos_c=pos;i=this._idpull[this.rootId];};for (var j=0;j<i.childsCount;j++){this._pos_c-=h;if (this._pos_c<=0)m=true;if (m){f.apply(this,[i.childNodes[j],j]);l--;};if (l<0)return l;if (i.childNodes[j]._open){l=this._getItemByPos(null,h,l,i.childNodes[j],m,f);if (l<0)return l;}};return l;};dhtmlXTreeObject.prototype._addItemSRND=function(pid,id,p){var parentObject=this._idpull[pid];var Count=parentObject.childsCount;var Nodes=parentObject.childNodes;Nodes[Count]=new dhtmlXTreeItemObject(id,"",parentObject,this,null,1);itemId = Nodes[Count].id;Nodes[Count]._sxml=p.clone();parentObject.childsCount++;};dhtmlXTreeObject.prototype._singleTimeSRND=function(){this._redrawFrom=function(){};var _originalTreeItem=dhtmlXTreeItemObject;this._singleTimeSRND=function(){};window.dhtmlXTreeItemObject=function(itemId,itemText,parentObject,treeObject,actionHandler,mode){if (!treeObject._srnd){return _originalTreeItem.call(this,itemId,itemText,parentObject,treeObject,actionHandler,mode);};this.htmlNode="";this.acolor="";this.scolor="";this.tr=0;this.childsCount=0;this.tempDOMM=0;this.tempDOMU=0;this.dragSpan=0;this.dragMove=0;this.span=0;this.closeble=1;this.childNodes=new Array();this.userData=new cObject();this.checkstate=0;this.treeNod=treeObject;this.label=itemText;this.parentObject=parentObject;this.actionHandler=actionHandler;this.images=new Array(treeObject.imageArray[0],treeObject.imageArray[1],treeObject.imageArray[2]);this.id=treeObject._globalIdStorageAdd(itemId,this);if (itemId==treeObject.rootId){if (this.treeNod.checkBoxOff )this.htmlNode=this.treeNod._createItem(1,this,mode);else this.htmlNode=this.treeNod._createItem(0,this,mode);this.htmlNode.objBelong=this;};return this;};this.setCheckSR=this.setCheck;this.setCheck=function(itemId,state){this._globalIdStorageFind(itemId);return this.setCheckSR(itemId,state);};this._get_srnd_p=function(id){var p=[];while(id!=this.rootId){var pid=this.getParentId(id);for (var i=0;i < this._idpull[pid].childsCount;i++)if (this._idpull[pid].childNodes[i].id==id){p.push([pid,i])
 break;};id=pid;};p.reverse();return p
};this._get_srnd_p_last=function(id,p,mask){p=p||[];var pos=0;while (true){var i=this._idpull[id];if (i._sxml && this.findStrInXML(i._sxml.d,"text",mask))
 this._globalIdStorageFind(i.id);var pos=i.childsCount;if (!pos)break;p.push([id,pos-1])
 id=i.childNodes[pos-1].id;};return p;};this._get_prev_srnd=function(p,mask){if (!p.length)p.push.apply(p,this._get_srnd_p_last(0,null,mask));var last=p[p.length-1];if (last[1]){last[1]--;var curr=this._idpull[last[0]].childNodes[last[1]];this._get_srnd_p_last(curr.id,p,mask);var last=p[p.length-1];return this._idpull[last[0]].childNodes[last[1]];}else {p.pop();if (!p.length)return this._get_prev_srnd(p,mask)
 var last=p[p.length-1];return this._idpull[last[0]].childNodes[last[1]];}};this._get_next_srnd=function(p,skip){if (!p.length){p.push([this.rootId,0]);return this._idpull[this.rootId].childNodes[0];};var last=p[p.length-1];var curr=this._idpull[last[0]].childNodes[last[1]];if (curr.childsCount && !skip){p.push([curr.id,0]);return curr.childNodes[0];};last[1]++;var curr=this._idpull[last[0]].childNodes[last[1]];if (curr)return curr;p.pop();if (!p.length)return this.htmlNode;return this._get_next_srnd(p,true);};this._findNodeByLabel=function(searchStr,direction,fromNode){var searchStr=searchStr.replace(new RegExp("^( )+"),"").replace(new RegExp("( )+$"),"");searchStr = new RegExp(searchStr.replace(/([\*\+\\\[\]\(\)]{1})/gi,"\\$1").replace(/ /gi,".*"),"gi");if (!fromNode){fromNode=this._selected[0];if (!fromNode)fromNode=this.htmlNode;};var startNode=fromNode;var p=this._get_srnd_p(startNode.id);while (fromNode=(direction?this._get_prev_srnd(p,searchStr):this._get_next_srnd(p))){if (fromNode.label){if (fromNode.label.search(searchStr)!=-1) return fromNode
 }else {if (fromNode._sxml){if (fromNode._sxml.get("text").search(searchStr)!=-1)
 return fromNode;if (this.findStrInXML(fromNode._sxml.d,"text",searchStr))
 this._globalIdStorageFind(fromNode.id);}};if ((fromNode.unParsed)&&(this.findStrInXML(fromNode.unParsed.d,"text",searchStr)))
 this.reParse(fromNode);if (startNode==fromNode)break;};return null;};this.deleteChildItems=function(id){if (this.rootId==id){this._selected=new Array();this._idpull={};this._p=this._pos_c=this._pullSize=null;this.allTree.removeChild(this.htmlNode.htmlNode);this.htmlNode=new dhtmlXTreeItemObject(this.rootId,"",0,this);this.htmlNode.htmlNode.childNodes[0].childNodes[0].style.display="none";this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[0].className="hiddenRow";this.allTree.insertBefore(this.htmlNode.htmlNode,this.selectionBar);if(_isFF){this.allTree.childNodes[0].width="100%";this.allTree.childNodes[0].style.overflow="hidden";}}};this._HideShow=function(itemObject,mode){if ((this.XMLsource)&&(!itemObject.XMLload)) {if (mode==1)return;itemObject.XMLload=1;this._loadDynXML(itemObject.id);return;};if (!itemObject.span)this._buildSRND(itemObject);if (itemObject.unParsed){this.reParse(itemObject);this.prepareSR(itemObject.id);};if (itemObject.childsCount==0)return;var Nodes=itemObject.htmlNode.childNodes[0].childNodes;var Count=Nodes.length;if (Count>1){if ( ( (Nodes[1].style.display!="none")|| (mode==1) ) && (mode!=2) ) {this.allTree.childNodes[0].border = "1";this.allTree.childNodes[0].border = "0";var nodestyle="none";itemObject._open=false;}else {var nodestyle="";itemObject._open=true;};for (var i=1;i<Count;i++)Nodes[i].style.display=nodestyle;this._renderState();};this._correctPlus(itemObject);}};function dhtmlXTreeFromHTML(obj){if (typeof(obj)!="object")
 obj=document.getElementById(obj);var n=obj;var id=n.id;var cont="";for (var j=0;j<obj.childNodes.length;j++)if (obj.childNodes[j].nodeType=="1"){if (obj.childNodes[j].tagName=="XMP"){var cHead=obj.childNodes[j];for (var m=0;m<cHead.childNodes.length;m++)cont+=cHead.childNodes[m].data;}else if (obj.childNodes[j].tagName.toLowerCase()=="ul")
 cont=dhx_li2trees(obj.childNodes[j],new Array(),0);break;};obj.innerHTML="";var t=new dhtmlXTreeObject(obj,"100%","100%",0);var z_all=new Array();for ( b in t )z_all[b.toLowerCase()]=b;var atr=obj.attributes;for (var a=0;a<atr.length;a++)if ((atr[a].name.indexOf("set")==0)||(atr[a].name.indexOf("enable")==0)){var an=atr[a].name;if (!t[an])an=z_all[atr[a].name];t[an].apply(t,atr[a].value.split(","));};if (typeof(cont)=="object"){t.XMLloadingWarning=1;for (var i=0;i<cont.length;i++){var n=t.insertNewItem(cont[i][0],cont[i][3],cont[i][1]);if (cont[i][2])t._setCheck(n,cont[i][2]);};t.XMLloadingWarning=0;t.lastLoadedXMLId=0;t._redrawFrom(t);}else
 t.loadXMLString("<tree id='0'>"+cont+"</tree>");window[id]=t;var oninit = obj.getAttribute("oninit");if (oninit)eval(oninit);return t;};function dhx_init_trees(){var z=document.getElementsByTagName("div");for (var i=0;i<z.length;i++)if (z[i].className=="dhtmlxTree")dhtmlXTreeFromHTML(z[i])
};function dhx_li2trees(tag,data,ind){for (var i=0;i<tag.childNodes.length;i++){var z=tag.childNodes[i];if ((z.nodeType==1)&&(z.tagName.toLowerCase()=="li")){var c="";var ul=null;var check=z.getAttribute("checked");for (var j=0;j<z.childNodes.length;j++){var zc=z.childNodes[j];if (zc.nodeType==3)c+=zc.data;else if (zc.tagName.toLowerCase()!="ul") c+=dhx_outer_html(zc);else ul=zc;};data[data.length]=[ind,c,check,(z.id||(data.length+1))];if (ul)data=dhx_li2trees(ul,data,(z.id||data.length));}};return data;};function dhx_outer_html(node){if (node.outerHTML)return node.outerHTML;var temp=document.createElement("DIV");temp.appendChild(node.cloneNode(true));temp=temp.innerHTML;return temp;};if (window.addEventListener)window.addEventListener("load",dhx_init_trees,false);else if (window.attachEvent)window.attachEvent("onload",dhx_init_trees);dhtmlXTreeObject.prototype._serEnts=[["&","&amp;"],["<","&lt;"],[">","&gt;"]];dhtmlXTreeObject.prototype.registerXMLEntity=function(rChar,rEntity){this._serEnts[this._serEnts.length]=[rChar,rEntity,new RegExp(rChar,"g")];};dhtmlXTreeObject.prototype.setSerializationLevel=function(userData,fullXML,escapeEntities,userDataAsCData,DTD){this._xuserData=convertStringToBoolean(userData);this._xfullXML=convertStringToBoolean(fullXML);this._dtd=DTD;this._xescapeEntities=convertStringToBoolean(escapeEntities);if (convertStringToBoolean(userDataAsCData)){this._apreUC="<![CDATA[";this._apstUC="]]>";}else{};for (var i=0;i< this._serEnts.length;i++)this._serEnts[i][2]=new RegExp(this._serEnts[i][0],"g");};dhtmlXTreeObject.prototype.serializeTree=function(){if (this.stopEdit)this.stopEdit();this._apreUC=this._apreUC||"";this._apstUC=this._apstUC||"";var out='<?xml version="1.0"?>';if (this._dtd)out+="<!DOCTYPE tree SYSTEM \""+this._dtd+"\">";out+='<tree id="'+this.rootId+'">';if ((this._xuserData)&&(this._idpull[this.rootId]._userdatalist))
 {var names=this._idpull[this.rootId]._userdatalist.split(",");for (var i=0;i<names.length;i++)out+="<userdata name=\""+names[i]+"\">"+this._apreUC+this._idpull[this.rootId].userData["t_"+names[i]]+this._apstUC+"</userdata>";};for (var i=0;i<this.htmlNode.childsCount;i++)out+=this._serializeItem(this.htmlNode.childNodes[i]);out+="</tree>";return out;};dhtmlXTreeObject.prototype._serializeItem=function(itemNode){if (itemNode.unParsed)if (document.all)return itemNode.unParsed.d.xml;else{var xmlSerializer = new XMLSerializer();return xmlSerializer.serializeToString(itemNode.unParsed.d);};var out="";if (this._selected.length)var lid=this._selected[0].id;else lid="\"";var text=itemNode.span.innerHTML;if (this._xescapeEntities)for (var i=0;i<this._serEnts.length;i++)text=text.replace(this._serEnts[i][2],this._serEnts[i][1]);if (!this._xfullXML)out='<item id="'+itemNode.id+'" '+(this._getOpenState(itemNode)==1?' open="1" ':'')+(lid==itemNode.id?' select="1"':'')+' text="'+text+'"'+( ((this.XMLsource)&&(itemNode.XMLload==0))?" child=\"1\" ":"")+'>';else
 out='<item id="'+itemNode.id+'" '+(this._getOpenState(itemNode)==1?' open="1" ':'')+(lid==itemNode.id?' select="1"':'')+' text="'+text+'" im0="'+itemNode.images[0]+'" im1="'+itemNode.images[1]+'" im2="'+itemNode.images[2]+'" '+(itemNode.acolor?('aCol="'+itemNode.acolor+'" '):'')+(itemNode.scolor?('sCol="'+itemNode.scolor+'" '):'')+(itemNode.checkstate==1?'checked="1" ':(itemNode.checkstate==2?'checked="-1"':''))+(itemNode.closeable?'closeable="1" ':'')+( ((this.XMLsource)&&(itemNode.XMLload==0))?" child=\"1\" ":"")+'>';if ((this._xuserData)&&(itemNode._userdatalist))
 {var names=itemNode._userdatalist.split(",");for (var i=0;i<names.length;i++)out+="<userdata name=\""+names[i]+"\">"+this._apreUC+itemNode.userData["t_"+names[i]]+this._apstUC+"</userdata>";};for (var i=0;i<itemNode.childsCount;i++)out+=this._serializeItem(itemNode.childNodes[i]);out+="</item>";return out;};dhtmlXTreeObject.prototype.saveSelectedItem=function(name,cookie_param){name=name||"";this.setCookie("treeStateSelected"+name,this.getSelectedItemId(),cookie_param);};dhtmlXTreeObject.prototype.restoreSelectedItem=function(name){name=name||"";var z=this.getCookie("treeStateSelected"+name);this.selectItem(z,false);};dhtmlXTreeObject.prototype.enableAutoSavingSelected=function(mode,cookieName){this.assMode=convertStringToBoolean(mode);if ((this.assMode)&&(!this.oldOnSelect)){this.oldOnSelect=this.onRowSelect;this.onRowSelect=function(e,htmlObject,mode){if (!htmlObject)htmlObject=this;htmlObject.parentObject.treeNod.oldOnSelect(e,htmlObject,mode);if (htmlObject.parentObject.treeNod.assMode)htmlObject.parentObject.treeNod.saveSelectedItem(htmlObject.parentObject.treeNod.assCookieName);}};this.assCookieName=cookieName;};dhtmlXTreeObject.prototype.saveState=function(name,cookie_param){var z=this._escape(this.serializeTree());var kusok = 4000;if (z.length>kusok){if(navigator.appName.indexOf("Microsoft")!=-1)
 return false;this.setCookie("treeStatex"+name,Math.ceil(z.length/kusok));for (var i=0;i<Math.ceil(z.length/kusok);i++)
 {this.setCookie("treeStatex"+name+"x"+i,z.substr(i*kusok,kusok),cookie_param);}}else
 this.setCookie("treeStatex"+name,z,cookie_param);var z=this.getCookie("treeStatex"+name);if (!z){this.setCookie("treeStatex"+name,"",cookie_param);return false;};return true;};dhtmlXTreeObject.prototype.loadState=function(name){var z=this.getCookie("treeStatex"+name);if (!z)return false;if (z.length){if (z.toString().length<4)
 {var z2="";for (var i=0;i<z;i++){z2+=this.getCookie("treeStatex"+name+"x"+i);};z=z2;};this.loadXMLString((this.utfesc=="utf8")?decodeURI(z):unescape(z));};return true;};dhtmlXTreeObject.prototype.setCookie=function(name,value,cookie_param) {var str = name + "=" + value + (cookie_param?(";"+cookie_param):"");document.cookie = str;};dhtmlXTreeObject.prototype.getCookie=function(name) {var search = name + "=";if (document.cookie.length > 0){var offset = document.cookie.indexOf(search);if (offset != -1){offset += search.length;var end = document.cookie.indexOf(";", offset);if (end == -1)end = document.cookie.length;return document.cookie.substring(offset, end);}}};dhtmlXTreeObject.prototype.saveOpenStates=function(name,cookie_param){var z=[];for (var i=0;i<this.htmlNode.childsCount;i++)z=z.concat(this._collectOpenStates(this.htmlNode.childNodes[i]));z=z.join(this.dlmtr);this.setCookie("treeOpenStatex"+name,z,cookie_param);};dhtmlXTreeObject.prototype.loadOpenStates=function(name){for (var i=0;i<this.htmlNode.childsCount;i++)this._xcloseAll(this.htmlNode.childNodes[i]);this.allTree.childNodes[0].border = "1";this.allTree.childNodes[0].border = "0";var z=getCookie("treeOpenStatex"+name);if (z){var arr=z.split(this.dlmtr);for (var i=0;i<arr.length;i++){var zNode=this._globalIdStorageFind(arr[i]);if (zNode){if ((this.XMLsource)&&(!zNode.XMLload)&&(zNode.id!=this.rootId)){this._delayedLoad(zNode,"loadOpenStates('"+name+"')");return;}else
 this.openItem(arr[i]);}}};this.callEvent("onAllOpenDynamic",[]);};dhtmlXTreeObject.prototype._delayedLoad=function(node,name){this.afterLoadMethod=name;this.onLoadReserve = this.onXLE;this.onXLE=this._delayedLoadStep2;this.loadXML(this.XMLsource+getUrlSymbol(this.XMLsource)+"id="+this._escape(node.id));};dhtmlXTreeObject.prototype._delayedLoadStep2=function(tree){tree.onXLE=tree.onLoadReserve;window.setTimeout( function() {eval("tree."+tree.afterLoadMethod);},100);if (tree.onXLE)tree.onXLE(tree);tree.callEvent("onXLE",[tree]);};dhtmlXTreeObject.prototype._collectOpenStates=function(node){var list=[];if (this._getOpenState(node)==1)
 {list.push(node.id);for (var i=0;i<node.childsCount;i++)list=list.concat(this._collectOpenStates(node.childNodes[i]));};return list;};function setCookie(name,value) {document.cookie = name+'='+value;};function getCookie(name) {var search = name + "=";if (document.cookie.length > 0){var offset = document.cookie.indexOf(search);if (offset != -1){offset += search.length;var end = document.cookie.indexOf(";", offset);if (end == -1)end = document.cookie.length;return (document.cookie.substring(offset, end));}}};dhtmlXTreeObject.prototype.openAllItemsDynamic = function(itemId)
 {this.ClosedElem=new Array();this.G_node=null;var itemNode = this._globalIdStorageFind(itemId||this.rootId);if (itemNode.id != this.rootId && tree.getOpenState(itemNode.id)!= 0) this.openItem(itemId);this._openAllNodeChilds(itemNode, 0);if(this.ClosedElem.length>0){this.onLoadReserve = this.onXLE;this.onXLE=this._loadAndOpen;this._loadAndOpen(this);}};dhtmlXTreeObject.prototype._openAllNodeChilds = function(itemNode)
 {if ((itemNode.XMLload==0)||(itemNode.unParsed)) this.ClosedElem.push(itemNode);for (var i=0;i<itemNode.childsCount;i++){if(this._getOpenState(itemNode.childNodes[i])<0) this._HideShow(itemNode.childNodes[i],2);if(itemNode.childNodes[i].childsCount>0)this._openAllNodeChilds(itemNode.childNodes[i]);if ((itemNode.childNodes[i].XMLload==0)||(itemNode.childNodes[i].unParsed)) this.ClosedElem.push(itemNode.childNodes[i]);}};dhtmlXTreeObject.prototype._loadAndOpen = function(that)
 {if(that.G_node){that._openItem(that.G_node);that._openAllNodeChilds(that.G_node);that.G_node = null;};if(that.ClosedElem.length>0)that.G_node = that.ClosedElem.shift();if(that.G_node)if (that.G_node.unParsed)that.reParse(that.G_node);else
 window.setTimeout( function(){that._loadDynXML(that.G_node.id);},100);else
 {that.onXLE = that.onLoadReserve;if (that.onXLE)that.onXLE(that);that.callEvent("onAllOpenDynamic",[that]);}};dhtmlXTreeObject.prototype.openItemsDynamic=function(list,flag){if (this.onXLE==this._stepOpen)return;this._opnItmsDnmcFlg=convertStringToBoolean(flag);this.onLoadReserve = this.onXLE;this.onXLE=this._stepOpen;this.ClosedElem=list.split(",").reverse();this._stepOpen(this);};dhtmlXTreeObject.prototype._stepOpen=function(that){if(!that.ClosedElem.length){that.onXLE = that.onLoadReserve;if (that._opnItmsDnmcFlg)that.selectItem(that.G_node,true);if ((that.onXLE)&&(arguments[1])) that.onXLE.apply(that,arguments);that.callEvent("onOpenDynamicEnd",[]);return;};that.G_node=that.ClosedElem.pop();var temp=that._globalIdStorageFind(that.G_node);if (temp.XMLload===0)that.openItem(that.G_node);else{that.openItem(that.G_node);that._stepOpen(that);}};dhtmlXGridObject.prototype._updateTGRState=function(z){if (!z.update || z.id==0)return;if (this.rowsAr[z.id].imgTag)this.rowsAr[z.id].imgTag.src=this.imgURL+z.state+".gif";z.update=false;};dhtmlXGridObject.prototype.doExpand=function(obj){this.editStop();var row = obj.parentNode.parentNode.parentNode;var r=this._h2.get[row.idd];if (!this.callEvent("onOpen",[row.idd,(r.state=="plus"?-1:1)])) return;if(r.state=="plus")this.expandKids(row)
 else
 if((r.state=="minus")&&(!r._closeable))
 this.collapseKids(row)
};function dhtmlxHierarchy(){var z={id:0, childs:[], level:-1, parent:null, index:0, state:dhtmlXGridObject._emptyLineImg};this.order=[z];this.get={"0":z};this.swap=function(a,b){var p=a.parent;var z=a.index;p.childs[z]=b;p.childs[b.index]=a;a.index=b.index;b.index=z;};this.forEachChildF=function(id,funct,that,funct2){var z=this.get[id];for (var i=0;i<z.childs.length;i++){if (!funct.apply((that||this),[z.childs[i]])) continue;if (z.childs[i].childs.length)this.forEachChildF(z.childs[i].id,funct,that,funct2);if (funct2)funct2.call((that||this),z.childs[i]);}};this.forEachChild=function(id,funct,that){var z=this.get[id];for (var i=0;i<z.childs.length;i++){funct.apply((that||this),[z.childs[i]]);if (z.childs[i].childs.length)this.forEachChild(z.childs[i].id,funct,that);}};this.change=function(id,name,val){var z=this.get[id];if (z[name]==val)return;z[name]=val;z.update=true;};this.add=function(id,parentId){return this.addAfter(id,parentId);};this.addAfter=function(id,parentId,afterId,fix){var z=this.get[parentId||0];if (afterId)var ind=this.get[afterId].index+(fix?0:1);else var ind=z.childs.length;var x={id:id, childs:[], level:z.level+1, parent:z, index:ind, state:dhtmlXGridObject._emptyLineImg};if (z.state==dhtmlXGridObject._emptyLineImg)this.change(parentId,"state",(parentId==0?"minus":"plus"));if (afterId){for (var i=ind;i<z.childs.length;i++)z.childs[i].index++;z.childs=z.childs.slice(0,ind).concat([x]).concat(z.childs.slice(ind,z.childs.length));}else
 z.childs.push(x);this.get[id]=x;return x;};this.addBefore=function(id,parentId,beforeId){return this.addAfter(id,parentId,beforeId,true)
 };this.remove=function(id){var z=this.get[id||0];for (var i=0;i<z.childs.length;i++)this.deleteAll(z.childs[i].id)
 z.childs=[];z.parent.childs=z.parent.childs.slice(0,z.index).concat(z.parent.childs.slice(z.index+1));for (var i=z.index;i<z.parent.childs.length;i++)z.parent.childs[i].index--;delete this.get[id];};this.deleteAll=function(id){var z=this.get[id||0];for (var i=0;i<z.childs.length;i++)this.deleteAll(z.childs[i].id)
 
 z.childs=[];delete this.get[id];};return this;};dhtmlXGridObject.prototype._getOpenLenght=function(id,start){var z=this._h2.get[id].childs;start+=z.length;for (var i=0;i<z.length;i++)if (z[i].childs.length && z[i].state=='minus')start+=this._getOpenLenght(z[i].id,0);return start;};dhtmlXGridObject.prototype.collapseKids=function(curRow){var r=this._h2.get[curRow.idd];if (r.state!="minus")return;if (!this.callEvent("onOpenStart",[curRow.idd,1])) return;var start = curRow.rowIndex;if (start<0)start=this.rowsCol._dhx_find(curRow)+1;this._h2.change(r.id,"state","plus");this._updateTGRState(r);if (this._srnd || this.pagingOn){this._h2_to_buff();this._renderSort();}else {var len=this._getOpenLenght(this.rowsCol[start-1].idd,0);for (var i=0;i<len;i++)this.rowsCol[start+i].parentNode.removeChild(this.rowsCol[start+i]);this.rowsCol.splice(start,len);};this.callEvent("onGridReconstructed",[]);this.setSizes();this._h2_to_buff();this.callEvent("onOpenEnd",[curRow.idd,-1]);};dhtmlXGridObject.prototype._massInsert=function(r,start,ind,skip){var anew=[];var par=(_isKHTML?this.obj:this.obj.rows[0].parentNode)
 this._h2_to_buff();if (this._srnd || this.pagingOn)return this._renderSort();var len=this._getOpenLenght(r.id,0);for(var i=0;i<len;i++){var ra=this.render_row(ind+i);if (start)start.parentNode.insertBefore(ra,start);else
 par.appendChild(ra);anew.push(ra)
 };this.rowsCol=dhtmlxArray(this.rowsCol.slice(0,ind).concat(anew).concat(this.rowsCol.slice(ind)));return r.childs.length+anew.length;};dhtmlXGridObject.prototype.expandKids=function(curRow,sEv){var r=this._h2.get[curRow.idd];if ((!r.childs.length)&&(!r._xml_await)) return;if (r.state!="plus")return;if (!r._loading && !sEv)if (!this.callEvent("onOpenStart",[r.id,-1])) return;var start = this.getRowIndex(r.id)+1;if(r.childs.length){r._loading=false;this._h2.change(r.id,"state","minus")
 this._updateTGRState(r);var len=this._massInsert(r,this.rowsCol[start],start);this.callEvent("onGridReconstructed",[]);}else{if (r._xml_await){r._loading=true;if (this.callEvent("onDynXLS",[r.id]))
 this.loadXML(this.kidsXmlFile+""+(this.kidsXmlFile.indexOf("?")!=-1?"&":"?")+"id="+r.id);}};this.setSizes();if (!r._loading)this.callEvent("onOpenEnd",[r.id,1]);this._fixAlterCss();};dhtmlXGridObject.prototype.kidsXmlFile = "";dhtmlXGridObject.prototype.sortTreeRows = function(col,type,order){var amet="getValue";if (this.cells5({parentNode:{grid:this}},this.getColType(col)).getDate){amet="getDate";type="str";};this.forEachRow(function(id){var z=this._h2.get[id];if (!z)return;var label=this._get_cell_value(z.buff,col,amet);if(type=='int'){z._sort=parseFloat(label);z._sort=isNaN(z._sort)?-99999999999999:z._sort;}else
 z._sort=label;});var self=this;var pos=1;var neg=-1;if (order=="des"){pos=-1;neg=1;};var funct=null;if(type=='cus')funct=function(a,b){return self._customSorts[col](a._sort,b._sort,order,a.id,b.id);};if(type=='str')funct=function(a,b){return (a._sort<b._sort?neg:(a._sort==b._sort?0:pos))};if(type=='int')funct=function(a,b){return (a._sort<b._sort?neg:(a._sort==b._sort?0:pos))};if(type=='date')funct=function(a,b){return (Date.parse(new Date(a._sort||"01/01/1900"))-Date.parse(new Date(b._sort||"01/01/1900")))*pos};this._sortTreeRows(funct,0);this._renderSort(0,true);this.callEvent("onGridReconstructed",[]);};dhtmlXGridObject.prototype._sortTreeRows = function(funct,id){var ar=this._h2.get[id].childs;if (this.rowsCol.stablesort)this.rowsCol.stablesort.call(ar,funct);else
 ar.sort(funct);for (var i=0;i<ar.length;i++){if (ar[i].childs.length)this._sortTreeRows(funct,ar[i].id);ar[i].index=i;}};dhtmlXGridObject.prototype._renderSort = function(id,mode){this._h2_to_buff();var top=this.objBox.scrollTop;this._reset_view();this.objBox.scrollTop=top;};dhtmlXGridObject.prototype._fixAlterCssTGR = function(){if (!this._realfake)this._h2.forEachChild(0,function(x){if (x.buff.tagName=="TR"){var cs=(this._cssSP?(x.level%2):(x.index%2))?this._cssUnEven:this._cssEven;this.rowsAr[x.id].className=(cs + (this._cssSU?(" "+cs+"_"+x.level):""))+" "+(this.rowsAr[x.id]._css||"")+((this.rowsAr[x.id].className.indexOf("rowselected") != -1)?" rowselected":"");}},this);};dhtmlXGridObject.prototype.moveRowUDTG = function(id,dir){var x=this._h2.get[id];var p=x.parent.childs[x.index+dir]
 if ((!p)|| (p.parent!=x.parent)) return;var state=[x.state,p.state];this.collapseKids(this.rowsAr[x.id]);this.collapseKids(this.rowsAr[p.id]);var ind = this.rowsCol._dhx_find(this.rowsAr[id]);var bInd = this.rowsBuffer._dhx_find(this.rowsAr[id]);var nod=this.obj.rows[0].parentNode.removeChild(this.rowsCol[ind]);var tar=this.rowsCol[ind+((dir==1)?2:dir)];if (tar)tar.parentNode.insertBefore(nod,tar);else
 this.obj.rows[0].parentNode.appendChild(nod);this.rowsCol._dhx_swapItems(ind,ind+dir)
 this.rowsBuffer._dhx_swapItems(bInd,bInd+dir);this._h2.swap(p,x);if (state[0]=="minus")this.expandKids(this.rowsAr[x.id]);if (state[1]=="minus")this.expandKids(this.rowsAr[p.id]);this._fixAlterCss(Math.min(ind,ind+dir));};function eXcell_tree(cell){if (cell){this.cell = cell;this.grid = this.cell.parentNode.grid;};this.isDisabled = function(){return this.cell._disabled||this.grid._edtc;};this.edit = function(){if ((this.er)||(this.grid._edtc)) return;this.er=this.cell.parentNode.valTag;this.val=this.getLabel();this.cell.atag=((!this.grid.multiLine)&&(_isKHTML||_isMacOS||_isFF)) ? "INPUT" : "TEXTAREA";this.er.innerHTML="<"+this.cell.atag+" class='dhx_combo_edit' type='text' style='height:"+(this.cell.offsetHeight-6)+"px;width:100%;border:0px;margin:0px;padding:0px;padding-top:"+(_isFF?1:2)+"px;overflow:hidden;'></"+this.cell.atag+">";this.er.childNodes[0].onmousedown = function(e){(e||event).cancelBubble = true};this.er.childNodes[0].onselectstart=function(e){if (!e)e=event;e.cancelBubble=true;return true;};if (_isFF)this.er.style.top="1px";this.er.className+=" editable";this.er.firstChild.onclick = function(e){(e||event).cancelBubble = true};this.er.firstChild.value=this.val;this.obj=this.er.firstChild;this.er.firstChild.style.width=Math.max(0,this.cell.offsetWidth-this.er.offsetLeft)+"px";this.er.firstChild.focus();if (_isIE)this.er.firstChild.focus();};this.detach = function(){if (!this.er)return;this.setLabel(this.er.firstChild.value);this.er.className=this.er.className.replace("editable","");var z=(this.val!=this.er.innerHTML);if (_isFF)this.er.style.top="2px";this.obj=this.er=null;return (z);};this.getValue = function(){return this.getLabel();};this.setImage = function(url){this.cell.parentNode.imgTag.nextSibling.src=this.grid.iconURL+url;this.grid._h2.get[this.cell.parentNode.idd].image=url;};this.getImage = function(){this.grid._h2.get[this.cell.parentNode.idd].image;};this.setLabel = function(val){this.setValueA(val);};this.getLabel = function(val){return this.cell.parentNode.valTag.innerHTML;}};eXcell_tree.prototype = new eXcell;eXcell_tree.prototype.setValueA = function(content){this.cell.parentNode.valTag.innerHTML=content;this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,content])
 };eXcell_tree.prototype.setValue = function(valAr){if (this.cell.parentNode.imgTag)return this.setLabel(valAr);if ((this.grid._tgc.imgURL==null)||(this.grid._tgc.imgURL!=this.grid.imgURL)){var _tgc={};_tgc.spacer="<img src='"+this.grid.imgURL+"blank.gif' align='absmiddle' class='space'>";_tgc.imst="<img src='"+this.grid.imgURL;_tgc.imsti="<img src='"+(this.grid.iconURL||this.grid.imgURL);_tgc.imact="' align='absmiddle' onclick='this."+(_isKHTML?"":"parentNode.")+"parentNode.parentNode.parentNode.parentNode.grid.doExpand(this);event.cancelBubble=true;'>"
 _tgc.plus=_tgc.imst+"plus.gif"+_tgc.imact;_tgc.minus=_tgc.imst+"minus.gif"+_tgc.imact;_tgc.blank=_tgc.imst+"blank.gif"+_tgc.imact;_tgc.start="<div class='treegrid_cell' style='overflow:hidden;white-space : nowrap;height:"+(_isIE?20:18)+"px;'>";_tgc.itemim="' align='absmiddle' "+(this.grid._img_height?(" height=\""+this.grid._img_height+"\""):"")+(this.grid._img_width?(" width=\""+this.grid._img_width+"\""):"")+" ><span "+((_isFF||_isOpera)?"style='position:relative;top:2px;'":"")+"id='nodeval'>";_tgc.close="</span></div>";this.grid._tgc=_tgc;};var _h2=this.grid._h2;var _tgc=this.grid._tgc;var rid=this.cell.parentNode.idd;var row=this.grid._h2.get[rid];if (this.grid.kidsXmlFile || this.grid._slowParse){row.has_kids=(row.has_kids||(this.cell.parentNode._attrs["xmlkids"]&&(row.state!="minus")));row._xml_await=!!row.has_kids;};row.image=row.image||(this.cell._attrs["image"]||"leaf.gif");row.label=valAr;var html=[_tgc.start];for(var i=0;i<row.level;i++)html.push(_tgc.spacer);if(row.has_kids){html.push(_tgc.plus);row.state="plus"
 }else
 html.push(_tgc.imst+row.state+".gif"+_tgc.imact);html.push(_tgc.imsti);html.push(row.image);html.push(_tgc.itemim);html.push(row.label);html.push(_tgc.close);this.cell.innerHTML=html.join("");this.cell._treeCell=true;this.cell.parentNode.imgTag=this.cell.childNodes[0].childNodes[row.level];this.cell.parentNode.valTag=this.cell.childNodes[0].childNodes[row.level+2];if (_isKHTML)this.cell.vAlign="top";if (row.parent.id!=0 && row.parent.state=="plus"){this.grid._updateTGRState(row.parent,false);this.cell.parentNode._skipInsert=true;};this.grid.callEvent("onCellChanged",[rid,this.cell._cellIndex,valAr]);};dhtmlXGridObject.prototype._process_tree_xml=function(xml,top,pid){this._parsing=true;var main=false;if (!top){this.render_row=this.render_row_tree;main=true;top=xml.getXMLTopNode(this.xml.top) 
 pid=top.getAttribute("parent")||0;if (pid=="0")pid=0;if (!this._h2)this._h2=new dhtmlxHierarchy();if (this._fake)this._fake._h2=this._h2;};var rows=xml.doXPath(this.xml.row,top)
 this._open=this._open||[];for (var i=0;i < rows.length;i++){var id=rows[i].getAttribute("id");if (!id){id=this.uid();rows[i].setAttribute("id",id);};var row=this._h2.add(id,pid);row.buff={idd:id, data:rows[i], _parser: this._process_xml_row, _locator:this._get_xml_data };if (rows[i].getAttribute("open")){row.state="minus";this._open.push(id);};this.rowsAr[id]=row.buff;this._process_tree_xml(xml,rows[i],id);};if (main){if (!rows.length)this._h2.change(pid,"state",dhtmlXGridObject._emptyLineImg);else if (pid!=0 && !this._srnd){this._h2.change(pid,"state","minus");};for (var i=0;i < this._open.length;i++){var r=this._h2.get[this._open[i]];if (!r.childs.length)r.state=dhtmlXGridObject._emptyLineImg;};this._updateTGRState(this._h2.get[pid]);this._h2_to_buff();if (pid!=0 && this._srnd)this.openItem(pid);else {if (this.pagingOn)this._renderSort();else
 this.render_dataset();};if (this.kidsXmlFile){for (var i=0;i < this._open.length;i++){var r=this._h2.get[this._open[i]];if (r._xml_await)this.expandKids({idd:r.id});}};this._open=[];if (this._slowParse===false){this.forEachRow(function(id){this.render_row_tree(0,id)
 })
 };this._parsing=false;if (pid!=0 && !this._srnd){this.callEvent("onOpenEnd",[pid,1]);}};return xml.xmlDoc.responseXML?xml.xmlDoc.responseXML:xml.xmlDoc;};dhtmlXGridObject.prototype._h2_to_buff=function(top){if (!top){top=this._h2.get[0];this.rowsBuffer = new dhtmlxArray();};for (var i=0;i < top.childs.length;i++){this.rowsBuffer.push(top.childs[i].buff);if (top.childs[i].state == "minus")this._h2_to_buff(top.childs[i]);}};dhtmlXGridObject.prototype.render_row_tree=function(ind,id){if (id){var r=this._h2.get[id];r=r?r.buff:r;}else
 var r=this.rowsBuffer[ind];if (!r)return -1;if (r._parser){if (this.rowsAr[r.idd] && this.rowsAr[r.idd].tagName=="TR")return this._h2.get[r.idd].buff=this.rowsBuffer[ind]=this.rowsAr[r.idd];var row=this._prepareRow(r.idd);this.rowsAr[r.idd]=row;if (!id)this.rowsBuffer[ind]=row;this._h2.get[r.idd].buff=row;r._parser.call(this,row,r.data);this._postRowProcessing(row);return row;};return r;};dhtmlXGridObject.prototype._removeTrGrRow=function(node,x){if(x){this._h2.forEachChild(x.id,function(x){this._removeTrGrRow(null,x);delete this.rowsAr[x.id];},this);return;};var ind=this.getRowIndex(node.idd);var x=this._h2.get[node.idd];if (ind!=-1 && ind!==this.undefined){var len=1;if (x && x.state=="minus")len+=this._getOpenLenght(x.id,0)
 for (var i=0;i<len;i++)if (this.rowsCol[i+ind])this.rowsCol[i+ind].parentNode.removeChild(this.rowsCol[i+ind]);if (this._fake){for (var i=0;i<len;i++)this._fake.rowsCol[i+ind].parentNode.removeChild(this._fake.rowsCol[i+ind]);if (len>1)this._fake.rowsCol.splice(ind+1,len-1);};this.rowsCol.splice(ind,len);this.rowsBuffer.splice(ind,len);};if (!x)return;this._removeTrGrRow(null,x);delete this.rowsAr[x.id];if (x.parent.childs.length==1){this._h2.change(x.parent.id,"state",dhtmlXGridObject._emptyLineImg);this._updateTGRState(x.parent);};this._h2.remove(x.id);};dhtmlXGridObject.prototype.openItem=function(rowId){var y=this._h2.get[rowId||0];var x=this.getRowById(rowId||0);if (!x)return;if (y.parent && y.parent.id!=0)this.openItem(y.parent.id);this.expandKids(x);};dhtmlXGridObject.prototype._addRowClassic=dhtmlXGridObject.prototype.addRow;dhtmlXGridObject.prototype.addRow=function(new_id,text,ind,parent_id,img,child){if (!this._h2)return this._addRowClassic(new_id,text,ind);parent_id=parent_id||0;var trcol=this.cellType._dhx_find("tree");if (typeof(text)=="string") text=text.split(this.delim);var row=this._h2.get[new_id];if (!row){if (parent_id==0)ind=this.rowsBuffer.length;else{ind=this.getRowIndex(parent_id)+1;if (this._h2.get[parent_id].state=="minus")ind+=this._getOpenLenght(parent_id,0);else
 this._skipInsert=true;}};row=row||this._h2.add(new_id,parent_id);row.image=img;row.has_kids=child;return row.buff=this._addRowClassic(new_id,text,ind);};dhtmlXGridObject.prototype.addRowBefore=function(new_id,text,sibl_id,img,child){var sb=this.rowsAr[sibl_id];if (!sb)return;if (!this._h2)return this.addRow(new_id,text,this.getRowIndex(sibl_id));var pid=this._h2.get[sibl_id].parent.id;var ind=this.getRowIndex(sibl_id);if (ind==-1)this._skipInsert=true;this._h2.addBefore(new_id,pid,sibl_id);return this.addRow(new_id,text,ind,this._h2.get[sibl_id].parent.id,img,child);};dhtmlXGridObject.prototype.addRowAfter=function(new_id,text,sibl_id,img,child){var sb=this.rowsAr[sibl_id];if (!sb)return;if (!this._h2)return this.addRow(new_id,text,this.getRowIndex(sibl_id)+1);var pid=this._h2.get[sibl_id].parent.id;var ind=this.getRowIndex(sibl_id);if (ind==-1)this._skipInsert=true;if (this._h2.get[sibl_id].state=="minus")ind+=this._getOpenLenght(sibl_id,0)+1;else ind++;this._h2.addAfter(new_id,pid,sibl_id);return this.addRow(new_id,text,ind,pid,img,child);};dhtmlXGridObject.prototype.enableSmartXMLParsing=function(mode) {this._slowParse=convertStringToBoolean(mode);};dhtmlXGridObject.prototype._copyTreeGridRowContent=function(frRow,from_row_id,to_row_id){var z=this.cellType._dhx_find("tree");for(i=0;i<frRow.cells.length;i++){if (i!=z)this.cells(to_row_id,i).setValue(this.cells(from_row_id,i).getValue())
 else
 this.cells(to_row_id,i).setValueA(this.cells(from_row_id,i).getValue())

 }};dhtmlXGridObject.prototype.closeItem=function(rowId){var x=this.getRowById(rowId);if (!x)return;this.collapseKids(x);};dhtmlXGridObject.prototype.deleteChildItems=function(rowId){var z=this._h2.get[rowId];if (!z)return;while (z.childs.length)this.deleteRow(z.childs[0].id);};dhtmlXGridObject.prototype.getAllSubItems=function(rowId){var str=[];var z=this._h2.get[rowId||0];if (z)for (var i=0;i<z.childs.length;i++){str.push(z.childs[i].id);if (z.childs[i].childs.length)str=str.concat(this.getAllSubItems(z.childs[i].id).split(this.delim));};return str.join(this.delim);};dhtmlXGridObject.prototype.getChildItemIdByIndex=function(rowId,ind){var z=this._h2.get[rowId||0];if (!z)return null;return (z.childs[ind]?z.childs[ind].id:null);};dhtmlXGridObject.prototype.getItemText=function(rowId){return this.cells(rowId,this.cellType._dhx_find("tree")).getLabel();};dhtmlXGridObject.prototype.getOpenState=function(rowId){var z=this._h2.get[rowId||0];if (!z)return;if (z.state=="minus")return true;return false;};dhtmlXGridObject.prototype.getParentId=function(rowId){var z=this._h2.get[rowId||0];if ((!z)|| (!z.parent)) return null;return z.parent.id;};dhtmlXGridObject.prototype.getSubItems=function(rowId){var str=[];var z=this._h2.get[rowId||0];if (z)for (var i=0;i<z.childs.length;i++)str.push(z.childs[i].id);return str.join(this.delim);};dhtmlXGridObject.prototype.expandAll=function(){this._renderAllExpand(0);this._h2_to_buff();this._reset_view();this.setSizes();this.callEvent("onGridReconstructed",[]);if (this._redrawLines)this._redrawLines();};dhtmlXGridObject.prototype._renderAllExpand=function(z){var x=this._h2.get[z].childs;for (var i=0;i<x.length;i++){if (x[i].childs.length){this._h2.change(x[i].id,"state","minus")
 this._updateTGRState(x[i]);this._renderAllExpand(x[i].id)
 }}};dhtmlXGridObject.prototype.collapseAll=function(rowId){this._h2.forEachChild(0,function(z){if (z && z.state=="minus"){z.state="plus";z.update=true;this._updateTGRState(z);}},this);this._h2_to_buff();this._reset_view();this.setSizes();this.callEvent("onGridReconstructed",[]);if (this._redrawLines)this._redrawLines();};dhtmlXGridObject.prototype.hasChildren=function(rowId){var x=this._h2.get[rowId];if (x && x.childs.length)return x.childs.length;if (x._xml_await)return -1;return 0;};dhtmlXGridObject.prototype.setItemCloseable=function(rowId,status){var x=this._h2.get[rowId];if (!x)return;x._closeable=(!convertStringToBoolean(status));};dhtmlXGridObject.prototype.setItemText=function(rowId,newtext){return this.cells(rowId,this.cellType._dhx_find("tree")).setLabel(newtext);};dhtmlXGridObject.prototype.setItemImage=function(rowId,url){this._h2.get[rowId].image=url;this.rowsAr[rowId].imgTag.nextSibling.src=url;};dhtmlXGridObject.prototype.getItemImage=function(rowId){this.getRowById(rowId);return this._h2.get[rowId].image;};dhtmlXGridObject.prototype.setImageSize=function(width,height){this._img_width=width;this._img_height=height;};dhtmlXGridObject.prototype._getRowImage=function(row){return this._h2.get[row.idd].image;};dhtmlXGridObject.prototype.setOnOpenStartHandler=function(func){this.attachEvent("onOpenStart",func);};dhtmlXGridObject.prototype.setOnOpenEndHandler=function(func){this.attachEvent("onOpenEnd",func);};dhtmlXGridObject.prototype.enableTreeCellEdit=function(mode){this._edtc=!convertStringToBoolean(mode);};dhtmlXGridObject.prototype.getLevel=function(rowId){var z=this._h2.get[rowId||0];if (!z)return -1;return z.level;};dhtmlXGridObject.prototype._fixHiddenRowsAllTG=function(ind,state){for (i in this.rowsAr){if ((this.rowsAr[i])&&(this.rowsAr[i].childNodes))
 this.rowsAr[i].childNodes[ind].style.display=state;}};dhtmlXGridObject._emptyLineImg="blank";dhtmlXGridObject.prototype._updateLine=function(z,row){row=row||this.rowsAr[z.id];if (!row)return;var im=row.imgTag;if (!im)return;if (z.state=="blank")return im.src=this.imgURL+"blank.gif";var n=1;if (z.index==0){if (z.level==0){if ((z.parent.childs.length-1)>z.index)
 n=3;else n=1;}else
 {if ((z.parent.childs.length-1)>z.index)
 n=3;else
 n=2;}}else
 if ((z.parent.childs.length-1)>z.index)
 n=3;else
 n=2;im.src=this.imgURL+z.state+n+".gif";};dhtmlXGridObject.prototype._updateParentLine=function(z,row){row=row||this.rowsAr[z.id];if (!row)return;var im=row.imgTag;if (!im)return;for (var i=z.level;i>0;i--){if (z.id==0)break;im=im.previousSibling;z=z.parent;if ((z.parent.childs.length-1)>z.index)
 im.src=this.imgURL+"line1.gif";else
 im.src=this.imgURL+"blank.gif";}};dhtmlXGridObject.prototype._renderSortA=dhtmlXGridObject.prototype._renderSort;dhtmlXGridObject.prototype._renderSort=function(){this._renderSortA.apply(this,arguments);this._redrawLines(0) 
};dhtmlXGridObject.prototype._redrawLines=function(id){if (this._tgle)this._h2.forEachChild((id||0),function(z){this._updateLine(z);this._updateParentLine(z);},this);};dhtmlXGridObject.prototype.enableTreeGridLines=function(){dhtmlXGridObject._emptyLineImg="line";this._updateTGRState=function(z,force){if (force || !z.update || z.id==0)return;if (this._tgle)this._updateLine(z,this.rowsAr[z.id]);z.update=false;};this._tgle=true;this.attachEvent("onXLE",function(a,b,id){this._redrawLines(id)
 });this.attachEvent("onOpenEnd",function(id){this._redrawLines(id)
 });this.attachEvent("onRowAdded",function(id){var z=this._h2.get[id];this._updateLine(z);this._updateParentLine(z);if (z.index<(z.parent.childs.length-1)){z=z.parent.childs[z.index+1];this._updateLine(z);this._updateParentLine(z);}else if (z.index!=0){z=z.parent.childs[z.index-1];this._updateLine(z);this._updateParentLine(z);if (z.childs.length)this._h2.forEachChild(z.id,function(c_el){this._updateParentLine(c_el)
 },this)
 }});this.attachEvent("onOpen",function(id,state){if (state){var z=this._h2.get[id];for (var i=0;i < z.childs.length;i++)this._updateParentLine(z.childs[i]);};return true;});this.attachEvent("onBeforeRowDeleted",function(id){var self=this;var z=this._h2.get[id];var w=null;if (z.index!=0)w=z.parent.childs[z.index-1];z=z.parent;window.setTimeout(function(){z = self._h2.get[z.id];if (!z)return;self._updateLine(z);self._updateParentLine(z);if (w){self._updateLine(w);if (w.state=="minus")self._h2.forEachChild(w.id,function(z){self._updateParentLine(z);},self);}},1);return true;});};dhtmlXGridObject.prototype.setFiltrationLevel=function(level,show_lower,show_upper){this._tr_strfltr=level;this._tr_fltr_c=show_lower;this._tr_fltr_d=show_upper;this.refreshFilters();};dhtmlXGridObject.prototype.filterTreeBy=function(column, value, preserve){var origin = this._h2;if (typeof this._tr_strfltr == "undefined")this._tr_strfltr=-1;if (this._f_rowsBuffer){if (!preserve){this._h2=this._f_rowsBuffer;if (this._fake)this._fake._h2=this._h2;}}else
 this._f_rowsBuffer=this._h2;var d=true;this.dma(true)
 this._fbf={};if (typeof(column)=="object")
 for (var j=0;j<value.length;j++)this._filterTreeA(column[j],value[j]);else
 this._filterTreeA(column,value);this._fbf=null;this.dma(false)
 this._fix_filtered_images(this._h2,origin);this._renderSort()
 this.callEvent("onGridReconstructed",[])
};dhtmlXGridObject.prototype._filterTreeA=function(column,value){if (value=="")return;var d=true;if (typeof(value)=="function") d=false;else value=(value||"").toString().toLowerCase();var add_line=function(el,s,t){var z=t.get[el.parent.id];if (!z)z=add_line(el.parent,s,t)
 var t=temp.get[el.id];if (!t){t={id:el.id, childs:[], level:el.level, parent:z, index:z.childs.length, image:el.image, state:el.state, buff:el.buff, has_kids:el.has_kids, _xml_await:el._xml_await};z.childs.push(t);temp.get[t.id]=t;};return t;};var fbf=this._fbf;var temp = new dhtmlxHierarchy();var check;var mode = this._tr_strfltr;var that=this;var temp_c=function(el){for (var i=0;i < el.childs.length;i++)that.temp(el.childs[i]);};switch(mode.toString()){case "-2": check=function(el){if (fbf[el.id])return false;temp_c(el);return true;};break;case "-1": check=function(el){return !el.childs.length;};break;default: check=function(el){return mode==el.level};break;};this.temp=function(el){if (el.id!=0 && check(el)){if (d?(this._get_cell_value(el.buff,column).toString().toLowerCase().indexOf(value)==-1):(!value(this._get_cell_value(el.buff,column),el.id))){fbf[el.id]=true;if (this._tr_fltr_c)add_line(el.parent,this._h2,temp);return false;}else {add_line(el,this._h2,temp);if (el.childs && mode!=-2)this._h2.forEachChild(el.id,function(cel){add_line(cel,this._h2,temp);},this)
 return true;}}else {if (this._tr_fltr_d && this._tr_strfltr > el.level && el.id!=0)add_line(el,this._h2,temp);temp_c(el);}};this.temp(this._h2.get[0]);this._h2=temp;if (this._fake)this._fake._h2=this._h2;};dhtmlXGridObject.prototype._fix_filtered_images=function(temp,origin){temp.forEachChild(0,function(el){if (!el.childs.length && !el.has_kids){if (el.state!=dhtmlXGridObject._emptyLineImg){el.state=dhtmlXGridObject._emptyLineImg;el.update=true;this._updateTGRState(el);}}else {if (el.buff.tagName=="TR"){var prev=origin.get[el.id];if (prev && prev.state!="blank")el.state=prev.state;el.update=true;this._updateTGRState(el);}}},this)
};dhtmlXGridObject.prototype.collectTreeValues=function(column){if (typeof this._tr_strfltr == "undefined")this._tr_strfltr=-1;this.dma(true)
 this._build_m_order();column=this._m_order?this._m_order[column]:column;var c={};var f=[];var col=this._f_rowsBuffer||this._h2;col.forEachChild(0,function(el){if (this._tr_strfltr==-2 || (this._tr_strfltr==-1 && !el.childs.length)|| (this._tr_strfltr==el.level)){var val=this._get_cell_value(el.buff,column);if (val)c[val]=true;}},this);this.dma(false)
 
 var vals=this.combos[column];for (d in c)if (c[d]===true)f.push(vals?(vals.get(d)||d):d);return f.sort();};dhtmlXGridObject.prototype._in_header_stat_tree_total=function(t,i,c){var calck=function(){var summ=0;this._h2.forEachChild(0,function(el){var v=parseFloat(this._get_cell_value((el.buff||this.rowsAr[el.id]),i));summ+=isNaN(v)?0:v;},this)
 return this._maskArr[i]?this._aplNF(summ,i):(Math.round(summ*100)/100);};this._stat_in_header(t,calck,i,c,c);};dhtmlXGridObject.prototype._in_header_stat_tree_total_leaf=function(t,i,c){var calck=function(){var summ=0;this._h2.forEachChild(0,function(el){if (el.childs.length)return;var v=parseFloat(this._get_cell_value((el.buff||this.rowsAr[el.id]),i));summ+=isNaN(v)?0:v;},this)
 return this._maskArr[i]?this._aplNF(summ,i):(Math.round(summ*100)/100);};this._stat_in_header(t,calck,i,c,c);};dhtmlXGridObject.prototype._in_header_stat_tree_multi_total=function(t,i,c){var cols=c[1].split(":");c[1]="";var calck=function(){var summ=0;this._h2.forEachChild(0,function(el){var v=parseFloat(this._get_cell_value((el.buff||this.rowsAr[el.id]),cols[0]))*parseFloat(this._get_cell_value((el.buff||this.rowsAr[el.id]),cols[1]));summ+=isNaN(v)?0:v;},this)
 return this._maskArr[i]?this._aplNF(summ,i):(Math.round(summ*100)/100);};this._stat_in_header(t,calck,i,c,c);};dhtmlXGridObject.prototype._in_header_stat_tree_multi_total_leaf=function(t,i,c){var cols=c[1].split(":");c[1]="";var calck=function(){var summ=0;this._h2.forEachChild(0,function(el){if (el.childs.length)return;var v=parseFloat(this._get_cell_value((el.buff||this.rowsAr[el.id]),cols[0]))*parseFloat(this._get_cell_value((el.buff||this.rowsAr[el.id]),cols[1]));summ+=isNaN(v)?0:v;},this)
 return this._maskArr[i]?this._aplNF(summ,i):(Math.round(summ*100)/100);};this._stat_in_header(t,calck,i,c,c);};dhtmlXGridObject.prototype._in_header_stat_tree_max=function(t,i,c){var calck=function(){var summ=-999999999;if (this.getRowsNum()==0) return "";this._h2.forEachChild(0,function(el){var d=parseFloat(this._get_cell_value((el.buff||this.rowsAr[el.id]),i));if (!isNaN(d))
 summ=Math.max(summ,d);},this)
 return this._maskArr[i]?this._aplNF(summ,i):summ;};this._stat_in_header(t,calck,i,c);};dhtmlXGridObject.prototype._in_header_stat_tree_min=function(t,i,c){var calck=function(){var summ=999999999;if (this.getRowsNum()==0) return "";this._h2.forEachChild(0,function(el){var d=parseFloat(this._get_cell_value((el.buff||this.rowsAr[el.id]),i));if (!isNaN(d))
 summ=Math.min(summ,d);},this)
 return this._maskArr[i]?this._aplNF(summ,i):summ;};this._stat_in_header(t,calck,i,c);};dhtmlXGridObject.prototype._in_header_stat_tree_average=function(t,i,c){var calck=function(){var summ=0;var count=0;this._h2.forEachChild(0,function(el){var v=parseFloat(this._get_cell_value((el.buff||this.rowsAr[el.id]),i));summ+=isNaN(v)?0:v;count++;},this)
 return this._maskArr[i]?this._aplNF(summ,i):(Math.round(summ/count*100)/100);};this._stat_in_header(t,calck,i,c);};dhtmlXGridObject.prototype._in_header_stat_tree_max_leaf=function(t,i,c){var calck=function(){var summ=-999999999;if (this.getRowsNum()==0) return "";this._h2.forEachChild(0,function(el){if (el.childs.length)return;var d=parseFloat(this._get_cell_value((el.buff||this.rowsAr[el.id]),i));if (!isNaN(d))
 summ=Math.max(summ,d);},this)
 return this._maskArr[i]?this._aplNF(summ,i):summ;};this._stat_in_header(t,calck,i,c);};dhtmlXGridObject.prototype._in_header_stat_tree_min_leaf=function(t,i,c){var calck=function(){var summ=999999999;if (this.getRowsNum()==0) return "";this._h2.forEachChild(0,function(el){if (el.childs.length)return;var d=parseFloat(this._get_cell_value((el.buff||this.rowsAr[el.id]),i));if (!isNaN(d))
 summ=Math.min(summ,d);},this)
 return this._maskArr[i]?this._aplNF(summ,i):summ;};this._stat_in_header(t,calck,i,c);};dhtmlXGridObject.prototype._in_header_stat_tree_average_leaf=function(t,i,c){var calck=function(){var summ=0;var count=0;this._h2.forEachChild(0,function(el){if (el.childs.length)return;var v=parseFloat(this._get_cell_value((el.buff||this.rowsAr[el.id]),i));summ+=isNaN(v)?0:v;count++;},this)
 return this._maskArr[i]?this._aplNF(summ,i):(Math.round(summ/count*100)/100);};this._stat_in_header(t,calck,i,c);};dhtmlXGridObject.prototype._in_header_stat_tree_count=function(t,i,c){var calck=function(){var count=0;this._h2.forEachChild(0,function(el){count++;},this)
 return count;};this._stat_in_header(t,calck,i,c);};dhtmlXGridObject.prototype._in_header_stat_tree_count_leaf=function(t,i,c){var calck=function(){var count=0;this._h2.forEachChild(0,function(el){if (!el.childs.length)count++;},this)
 return count;};this._stat_in_header(t,calck,i,c);};dhtmlXGridObject.prototype._stat_in_header=function(t,calck,i,c){var that=this;var f=function(){this.dma(true)
 t.innerHTML=(c[0]?c[0]:"")+calck.call(this)+(c[1]?c[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 i=0;i<this._stat_events.length;i++)for (var j=0;j < 4;j++)this.detachEvent(this._stat_events[i][j]);this._stat_events=[];}})
 };this._stat_events.push([
 this.attachEvent("onGridReconstructed",f),
 this.attachEvent("onXLE",f),
 this.attachEvent("onFilterEnd",f),
 this.attachEvent("onEditCell",function(stage,id,ind){if (stage==2 && ind==i)f.call(this);return true;})]);t.innerHTML="";};function dhtmlXWindowsSngl(){};function dhtmlXWindowsBtn(){};function dhtmlXWindows() {if (!window.dhtmlXContainer){alert(this.i18n.dhx);return;};this.engine = "dhx";var engineFunc = "_"+this.engine+"_Engine";if (!this[engineFunc]){alert(this.i18n.noenginealert);return;}else {this[engineFunc]();};var that = this;this.pathPrefix = "dhxwins_";this.imagePath = dhtmlx.image_path||"codebase/imgs/";this.setImagePath = function(path) {this.imagePath = path;};this.skin = "dhx_skyblue";this.skinParams = {"dhx_black" : {"header_height": 21, "border_left_width": 2, "border_right_width": 2, "border_bottom_height": 2 },
 "dhx_blue" : {"header_height": 21, "border_left_width": 2, "border_right_width": 2, "border_bottom_height": 2 },
 "dhx_skyblue" : {"header_height": 21, "border_left_width": 2, "border_right_width": 2, "border_bottom_height": 2 }};this.setSkin = function(skin) {this.skin = skin;this._engineRedrawSkin();};this.isWindow = function(id) {var t = (this.wins[id] != null);return t;};this.findByText = function(text) {var wins = new Array();for (var a in this.wins){if (this.wins[a].getText().search(text, "gi") >= 0) {wins[wins.length] = this.wins[a];}};return wins;};this.window = function(id) {var win = null;if (this.wins[id] != null){win = this.wins[id];};return win;};this.forEachWindow = function(handler) {for (var a in this.wins){handler(this.wins[a]);}};this.getBottommostWindow = function() {var bottommost = this.getTopmostWindow();for (var a in this.wins){if (this.wins[a].zi < bottommost.zi){bottommost = this.wins[a];}};return (bottommost.zi != 0 ? bottommost : null);};this.getTopmostWindow = function(visibleOnly) {var topmost = {"zi": 0};for (var a in this.wins){if (this.wins[a].zi > topmost.zi){if (visibleOnly == true && !this._isWindowHidden(this.wins[a])) {topmost = this.wins[a];};if (visibleOnly != true){topmost = this.wins[a];}}};return (topmost.zi != 0 ? topmost : null);};this.wins = {};for (var a in this.wins)delete this.wins[a];this.autoViewport = true;this._createViewport = function() {this.vp = document.body;this.vp._css = (String(this.vp.className).length > 0 ? this.vp.className : "");this.vp.className += " dhtmlx_skin_"+this.skin+(this._r?" dhx_wins_rtl":"");this.modalCoverI = document.createElement("IFRAME");this.modalCoverI.frameBorder = "0";this.modalCoverI.className = "dhx_modal_cover_ifr";this.modalCoverI.setAttribute("src","javascript:false;");this.modalCoverI.style.display = "none";this.modalCoverI.style.zIndex = 0;this.vp.appendChild(this.modalCoverI);this.modalCoverD = document.createElement("DIV");this.modalCoverD.className = "dhx_modal_cover_dv";this.modalCoverD.style.display = "none";this.modalCoverD.style.zIndex = 0;this.vp.appendChild(this.modalCoverD);this._vpcover = document.createElement("DIV");this._vpcover.className = "dhx_content_vp_cover";this._vpcover.style.display = "none";this.vp.appendChild(this._vpcover);this._carcass = document.createElement("DIV");this._carcass.className = "dhx_carcass_resmove";this._carcass.style.display = "none";if (_isIE){this._carcass.innerHTML = "<iframe border=0 frameborder=0 style='filter: alpha(opacity=0);width: 100%;height:100%;position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;'></iframe><div style='position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;'></div>";this._carcass.childNodes[0].setAttribute("src","javascript:false;");};this._carcass.onselectstart = function(e) {e = e||event;e.returnValue = false;};this.vp.appendChild(this._carcass);};this._autoResizeViewport = function() {for (var a in this.wins){if (this.wins[a]._isFullScreened){this.wins[a]._content.style.width = document.body.offsetWidth-(_isIE?4:0)+"px";if (document.body.offsetHeight == 0){if (window.innerHeight){this.wins[a]._content.style.height = window.innerHeight+"px";}else {this.wins[a]._content.style.height = document.body.scrollHeight+"px";}}else {this.wins[a]._content.style.height = document.body.offsetHeight-(_isIE?4:0)+"px";};if (this.wins[a].layout != null && _isOpera){this.wins[a].layout._fixCellsContentOpera950();};this.wins[a].updateNestedObjects();};if (this.wins[a]._isMaximized && this.wins[a].style.display != "none"){this._restoreWindow(this.wins[a]);this._maximizeWindow(this.wins[a]);}};if (this.vp == document.body)return;if (this.autoViewport == false)return;this.vp.style.width = (_isIE ? document.body.offsetWidth - 4 : window.innerWidth) + "px";this.vp.style.height = (_isIE ? document.body.offsetHeight - 4 : window.innerHeight) + "px";for (var a in this.wins){var win = this.wins[a];var overX = false;var overY = false;if (win.x > this.vp.offsetWidth - 10){win.x = this.vp.offsetWidth - 10;overX = true;};var skinParams = (win._skinParams!=null?win._skinParams:this.skinParams[this.skin]);if (win.y + skinParams["header_height"] > this.vp.offsetHeight){win.y = this.vp.offsetHeight - skinParams["header_height"];overY = true;};if (overX || overY){this._engineRedrawWindowPos(win);}}};this.enableAutoViewport = function(state) {if (this.vp != document.body)return;this.autoViewport = state;if (state == false){document.body.className = this.vp._css;this.vp = document.createElement("DIV");this.vp.autocreated = true;this.vp.className = "dhtmlx_winviewport dhtmlx_skin_"+this.skin+(this._r?" dhx_wins_rtl":"");this.vp.style.left = "0px";this.vp.style.top = "0px";document.body.appendChild(this.vp);this.vp.ax = 0;this.vp.ay = 0;this._autoResizeViewport();this.vp.appendChild(this.modalCoverI);this.vp.appendChild(this.modalCoverD);this.vp.appendChild(this._carcass);}};this.attachViewportTo = function(objId) {if (this.autoViewport == false){if (this.vp != document.body){this.vp.parentNode.removeChild(this.vp);};this.vp = document.getElementById(objId);this.vp.autocreated = false;this.vp.className += " dhtmlx_skin_"+this.skin+(this._r?" dhx_wins_rtl":"");this.vp.style.position = "relative";this.vp.style.overflow = "hidden";this.vp.ax = 0;this.vp.ay = 0;this.vp.appendChild(this.modalCoverI);this.vp.appendChild(this.modalCoverD);this.vp.appendChild(this._carcass);}};this.setViewport = function(x, y, width, height, parentObj) {if (this.autoViewport == false){this.vp.style.left = x + "px";this.vp.style.top = y + "px";this.vp.style.width = width + "px";this.vp.style.height = height + "px";if (parentObj != null){parentObj.appendChild(this.vp);};this.vp.ax = getAbsoluteLeft(this.vp);this.vp.ay = getAbsoluteTop(this.vp);}};this._effects = {"move" : false, "resize" : false};this.setEffect = function(efName, efValue) {if ((this._effects[efName] != null)&& (typeof(efValue) == "boolean")) {this._effects[efName] = efValue;}};this.getEffect = function(efName) {return this._effects[efName];};this.createWindow = function(id, x, y, width, height) {var win = document.createElement("DIV");win.className = "dhtmlx_window_inactive";win.dir = "ltr";for (var a in this.wins){this.wins[a].zi += this.zIndexStep;this.wins[a].style.zIndex = this.wins[a].zi;};win.zi = this.zIndexStep;win.style.zIndex = win.zi;win.active = false;win._isWindow = true;win.isWindow = true;win.w = width;win.h = height;win.x = x;win.y = y;this._engineFixWindowPosInViewport(win);win._isModal = false;win._allowResize = true;win.maxW = "auto";win.maxH = "auto";win.minW = 200;win.minH = 140;win.iconsPresent = true;win.icons = new Array(this.imagePath+this.pathPrefix+this.skin+"/active/icon_normal.gif", this.imagePath+this.pathPrefix+this.skin+"/inactive/icon_normal.gif");win._allowMove = true;win._allowMoveGlobal = true;win._allowResizeGlobal = true;win._keepInViewport = false;var skin = this.skinParams[this.skin];win.idd = id;this.vp.appendChild(win);this._engineSetWindowBody(win);this._engineRedrawWindowPos(win);this._engineRedrawWindowSize(win);this._engineUpdateWindowIcon(win, win.icons[0]);this._engineDiableOnSelectInWindow(win, true);this.wins[id] = win;dhtmlxEventable(win);this._engineGetWindowHeader(win).onmousedown = function(e) {var w = that.wins[this.idd];if (!w.isOnTop()) w.bringToTop();if (that._engineGetWindowHeaderState(w)) return;e = e||event;if (!that._engineCheckHeaderMouseDown(w, e)) {return;};if (!w._allowMove || !w._allowMoveGlobal){return;};w.oldMoveX = w.x;w.oldMoveY = w.y;w.moveOffsetX = w.x - e.clientX;w.moveOffsetY = w.y - e.clientY;that.movingWin = w;if (that._effects["move"] == false){that._carcass.x = that.movingWin.x;that._carcass.y = that.movingWin.y;that._carcass.w = parseInt(that.movingWin.style.width)+(_isIE?0:-2);that._carcass.h = parseInt(that.movingWin.style.height)+(_isIE?0:-2);that._carcass.style.left = that._carcass.x+"px";that._carcass.style.top = that._carcass.y+"px";that._carcass.style.width = that._carcass.w+"px";that._carcass.style.height = that._carcass.h+"px";that._carcass.style.zIndex = that._getTopZIndex(true)+1;that._carcass._keepInViewport = win._keepInViewport;};that._blockSwitcher(true);that._vpcover.style.zIndex = that.movingWin.style.zIndex-1;that._vpcover.style.display = "";e.returnValue = false;e.cancelBubble = true;w = null;return false;};this._engineGetWindowHeader(win).ondblclick = function(e) {var w = that.wins[this.idd];if (!that._engineCheckHeaderMouseDown(w, e||event)) {return;};if (w._allowResizeGlobal && !w._isParked){if (w._isMaximized == true){that._restoreWindow(w);}else {that._maximizeWindow(w);}}};win.setText = function(text) {that._engineGetWindowLabel(this).innerHTML = text;};win.getText = function() {return that._engineGetWindowLabel(this).innerHTML;};win.getId = function() {return this.idd;};win.show = function() {that._showWindow(this);};win.hide = function() {that._hideWindow(this);};win.minimize = function() {that._restoreWindow(this);};win.maximize = function() {that._maximizeWindow(this);};win.close = function() {that._closeWindow(this);};win.park = function() {if (this._isParkedAllowed){that._parkWindow(this);}};win.stick = function() {that._stickWindow(this);};win.unstick = function() {that._unstickWindow(this);};win.isSticked = function() {return this._isSticked;};win.setIcon = function(iconEnabled, iconDisabled) {that._setWindowIcon(win, iconEnabled, iconDisabled);};win.getIcon = function() {return that._getWindowIcon(this);};win.clearIcon = function() {that._clearWindowIcons(this);};win.restoreIcon = function() {that._restoreWindowIcons(this);};win.keepInViewport = function(state) {this._keepInViewport = state;};win.setModal = function(state) {if (state == true){if (that.modalWin != null || that.modalWin == this)return;that._setWindowModal(this, true);}else {if (that.modalWin != this)return;that._setWindowModal(this, false);}};win.isModal = function() {return this._isModal;};win.isHidden = function() {return that._isWindowHidden(this);};win.isMaximized = function() {return this._isMaximized;};win.isParked = function() {return this._isParked;};win.allowPark = function() {that._allowParking(this);};win.denyPark = function() {that._denyParking(this);};win.isParkable = function() {return this._isParkedAllowed;};win.allowResize = function() {that._allowReszieGlob(this);};win.denyResize = function() {that._denyResize(this);};win.isResizable = function() {return this._allowResizeGlobal;};win.allowMove = function() {if (!this._isMaximized){this._allowMove = true;};this._allowMoveGlobal = true;};win.denyMove = function() {this._allowMoveGlobal = false;};win.isMovable = function() {return this._allowMoveGlobal;};win.bringToTop = function() {that._bringOnTop(this);that._makeActive(this);};win.bringToBottom = function() {that._bringOnBottom(this);};win.isOnTop = function() {return that._isWindowOnTop(this);};win.isOnBottom = function() {return that._isWindowOnBottom(this);};win.setPosition = function(x, y) {this.x = x;this.y = y;that._engineFixWindowPosInViewport(this);that._engineRedrawWindowPos(this);};win.getPosition = function() {return new Array(this.x, this.y);};win.setDimension = function(width, height) {if (width != null){if (this.maxW != "auto")if (width > this.maxW)width = this.maxW;if (width < this.minW)width = this.minW;this.w = width;};if (height != null){if (this.maxH != "auto")if (height > this.maxH)height = this.maxH;if (height < this.minH)height = this.minH;this.h = height;};that._fixWindowDimensionInViewport(this);that._engineFixWindowPosInViewport(this);that._engineRedrawWindowSize(this);this.updateNestedObjects();};win.getDimension = function() {return new Array(this.w, this.h);};win.setMaxDimension = function(maxWidth, maxHeight) {this.maxW = (isNaN(maxWidth)?"auto":maxWidth);this.maxH = (isNaN(maxHeight)?"auto":maxHeight);that._engineRedrawWindowSize(this);};win.getMaxDimension = function() {return new Array(this.maxW, this.maxH);};win.setMinDimension = function(minWidth, minHeight) {if (minWidth != null){this.minW = minWidth;};if (minHeight != null){this.minH = minHeight;};that._fixWindowDimensionInViewport(this);that._engineRedrawWindowPos(this);};win.getMinDimension = function() {return new Array(this.minW, this.minH);};win._adjustToContent = function(cw, ch) {that._engineAdjustWindowToContent(this, cw, ch);};win._doOnAttachMenu = function() {that._engineRedrawWindowSize(this);this.updateNestedObjects();};win._doOnAttachToolbar = function() {that._engineRedrawWindowSize(this);this.updateNestedObjects();};win._doOnAttachStatusBar = function() {that._engineRedrawWindowSize(this);this.updateNestedObjects();};win._doOnFrameMouseDown = function() {this.bringToTop();};win._doOnFrameContentLoaded = function() {that.callEvent("onContentLoaded",[this]);};win.addUserButton = function(id, pos, title, label) {var userBtn = that._addUserButton(this, id, pos, title, label);return userBtn;};win.removeUserButton = function(id) {if (!((id == "minmax1")|| (id == "minmax2") || (id == "park") || (id == "close") || (id == "stick") || (id == "unstick") || (id == "help"))) {if (btn != null){that._removeUserButton(this, id);}}};win.progressOn = function() {that._engineSwitchWindowProgress(this, true);};win.progressOff = function() {that._engineSwitchWindowProgress(this, false);};win.setToFullScreen = function(state) {that._setWindowToFullScreen(this, state);};win.showHeader = function() {that._engineSwitchWindowHeader(this, true);};win.hideHeader = function() {that._engineSwitchWindowHeader(this, false);};win.progressOff();win.canStartResize = false;win.onmousemove = function(e) {if (_isIE && this._isMaximized)return true;e = e || event;var targetObj = e.target || e.srcElement;if (String(targetObj.className).search("dhtmlx_wins_resizer") < 0) targetObj = null;if (!this._allowResize || this._allowResizeGlobal == false || !targetObj){if (targetObj){if (targetObj.style.cursor != "default")targetObj.style.cursor = "default";};if (this.style.cursor != "default")this.style.cursor = "default";this.canStartResize = false;return false;};if (that.resizingWin != null)return;if (that.movingWin != null)return;if (this._isParked)return;var px = (_isIE||_isOpera?e.offsetX:e.layerX);var py = (_isIE||_isOpera?e.offsetY:e.layerY);var resDir = that._engineAllowWindowResize(win, targetObj, px, py);if (resDir == null){this.canStartResize = false;if (targetObj.style.cursor != "default")targetObj.style.cursor = "default";if (this.style.cursor != "default")this.style.cursor = "default";return;};that.resizingDirs = resDir;switch (that.resizingDirs) {case "border_left":
 targetObj.style.cursor = "w-resize";this.resizeOffsetX = this.x - e.clientX;break;case "border_right":
 targetObj.style.cursor = "e-resize";this.resizeOffsetXW = this.x + this.w - e.clientX;break;case "border_top":
 targetObj.style.cursor = "n-resize";this.resizeOffsetY = this.y - e.clientY;break;case "border_bottom":
 targetObj.style.cursor = "n-resize";this.resizeOffsetYH = this.y + this.h - e.clientY;break;case "corner_left":
 targetObj.style.cursor = "sw-resize";this.resizeOffsetX = this.x - e.clientX;this.resizeOffsetYH = this.y + this.h - e.clientY;break;case "corner_up_left":
 targetObj.style.cursor = "nw-resize";this.resizeOffsetY = this.y - e.clientY;this.resizeOffsetX = this.x - e.clientX;break;case "corner_right":
 targetObj.style.cursor = "nw-resize";this.resizeOffsetXW = this.x + this.w - e.clientX;this.resizeOffsetYH = this.y + this.h - e.clientY;break;case "corner_up_right":
 targetObj.style.cursor = "sw-resize";this.resizeOffsetY = this.y - e.clientY;this.resizeOffsetXW = this.x + this.w - e.clientX;break;};this.canStartResize = true;this.style.cursor = targetObj.style.cursor;return false;};win.onmousedown = function(e) {if (that._getActive()!= this) that._makeActive(this);that._bringOnTop(this);if (this.canStartResize){that._blockSwitcher(true);that.resizingWin = this;if (!that._effects["resize"]){that._carcass.x = that.resizingWin.x;that._carcass.y = that.resizingWin.y;that._carcass.w = that.resizingWin.w+(_isIE?0:-2);that._carcass.h = that.resizingWin.h+(_isIE?0:-2);that._carcass.style.left = that._carcass.x+"px";that._carcass.style.top = that._carcass.y+"px";that._carcass.style.width = that._carcass.w+"px";that._carcass.style.height = that._carcass.h+"px";that._carcass.style.zIndex = that._getTopZIndex(true)+1;that._carcass.style.cursor = this.style.cursor;that._carcass._keepInViewport = this._keepInViewport;that._carcass.style.display = "";};that._vpcover.style.zIndex = that.resizingWin.style.zIndex-1;that._vpcover.style.display = "";if (this.layout){this.callEvent("_onBeforeTryResize", [this]);};e = e||event;}};this._addDefaultButtons(win);win.button = function(id) {var b = null;if (this.btns[id] != null){b = this.btns[id];};return b;};win.center = function() {that._centerWindow(this, false);};win.centerOnScreen = function() {that._centerWindow(this, true);};win._attachContent("empty", null);win._redraw = function() {that._engineRedrawWindowSize(this);};win.bringToTop();this._engineRedrawWindowSize(win);return this.wins[id];};this.zIndexStep = 50;this._getTopZIndex = function(ignoreSticked) {var topZIndex = 0;for (var a in this.wins){if (ignoreSticked == true){if (this.wins[a].zi > topZIndex){topZIndex = this.wins[a].zi;}}else {if (this.wins[a].zi > topZIndex && !this.wins[a]._isSticked){topZIndex = this.wins[a].zi;}}};return topZIndex;};this.movingWin = null;this._moveWindow = function(e) {if (this.movingWin != null){if (!this.movingWin._allowMove || !this.movingWin._allowMoveGlobal){return;};if (this._effects["move"] == true){if (this._engineGetWindowHeader(this.movingWin).style.cursor != "move") {this._engineGetWindowHeader(this.movingWin).style.cursor = "move";};this.movingWin.oldMoveX = this.movingWin.x;this.movingWin.oldMoveY = this.movingWin.y;this.movingWin.x = e.clientX + this.movingWin.moveOffsetX;this.movingWin.y = e.clientY + this.movingWin.moveOffsetY;this._engineFixWindowPosInViewport(this.movingWin);this._engineRedrawWindowPos(this.movingWin);}else {if (this._carcass.style.display != ""){this._carcass.style.display = "";};if (this._carcass.style.cursor != "move"){this._carcass.style.cursor = "move";};if (this._engineGetWindowHeader(this.movingWin).style.cursor != "move") {this._engineGetWindowHeader(this.movingWin).style.cursor = "move";};this._carcass.x = e.clientX + this.movingWin.moveOffsetX;this._carcass.y = e.clientY + this.movingWin.moveOffsetY;this._engineFixWindowPosInViewport(this._carcass);this._carcass.style.left = this._carcass.x+"px";this._carcass.style.top = this._carcass.y+"px";}};if (this.resizingWin != null){if (!this.resizingWin._allowResize){return;};if (this.resizingDirs == "border_left" || this.resizingDirs == "corner_left" || this.resizingDirs == "corner_up_left"){if (this._effects["resize"]){var ofs = e.clientX + this.resizingWin.resizeOffsetX;var sign = (ofs > this.resizingWin.x ? -1 : 1);newW = this.resizingWin.w + Math.abs(ofs - this.resizingWin.x)*sign;if ((newW < this.resizingWin.minW)&& (sign < 0)) {this.resizingWin.x = this.resizingWin.x + this.resizingWin.w - this.resizingWin.minW;this.resizingWin.w = this.resizingWin.minW;}else {this.resizingWin.w = newW;this.resizingWin.x = ofs;};this._engineRedrawWindowPos(this.resizingWin);this._engineRedrawWindowSize(this.resizingWin);}else {var ofs = e.clientX + this.resizingWin.resizeOffsetX;var sign = (ofs > this._carcass.x ? -1 : 1);newW = this._carcass.w + Math.abs(ofs - this._carcass.x)*sign;if (newW > this.resizingWin.maxW){newW = this.resizingWin.maxW;ofs = this._carcass.x + this._carcass.w - this.resizingWin.maxW;};if ((newW < this.resizingWin.minW)&& (sign < 0)) {this._carcass.x = this._carcass.x + this._carcass.w - this.resizingWin.minW;this._carcass.w = this.resizingWin.minW;}else {this._carcass.w = newW;this._carcass.x = ofs;};this._carcass.style.left = this._carcass.x+"px";this._carcass.style.width = this._carcass.w+"px";}};if (this.resizingDirs == "border_right" || this.resizingDirs == "corner_right" || this.resizingDirs == "corner_up_right"){if (this._effects["resize"]){var ofs = e.clientX - (this.resizingWin.x + this.resizingWin.w) + this.resizingWin.resizeOffsetXW;newW = this.resizingWin.w + ofs;if (newW < this.resizingWin.minW){newW = this.resizingWin.minW;};this.resizingWin.w = newW;this._engineRedrawWindowPos(this.resizingWin);this._engineRedrawWindowSize(this.resizingWin);}else {var ofs = e.clientX - (this._carcass.x + this._carcass.w) + this.resizingWin.resizeOffsetXW;newW = this._carcass.w + ofs;if (newW < this.resizingWin.minW)newW = this.resizingWin.minW;if (this.resizingWin.maxW != "auto")if (newW > this.resizingWin.maxW)newW = this.resizingWin.maxW;this._carcass.w = newW;this._carcass.style.width = this._carcass.w+"px";}};if (this.resizingDirs == "border_bottom" || this.resizingDirs == "corner_left" || this.resizingDirs == "corner_right"){if (this._effects["resize"]){var ofs = e.clientY - (this.resizingWin.y + this.resizingWin.h) + this.resizingWin.resizeOffsetYH;newH = this.resizingWin.h + ofs;if (newH < this.resizingWin.minH)newH = this.resizingWin.minH;this.resizingWin.h = newH;this._engineRedrawWindowPos(this.resizingWin);this._engineRedrawWindowSize(this.resizingWin);}else {var ofs = e.clientY - (this._carcass.y + this._carcass.h) + this.resizingWin.resizeOffsetYH;newH = this._carcass.h + ofs;if (newH < this.resizingWin.minH)newH = this.resizingWin.minH;if (newH > this.resizingWin.maxH)newH = this.resizingWin.maxH;this._carcass.h = newH;this._carcass.style.height = this._carcass.h+"px";}};if (this.resizingDirs == "border_top" || this.resizingDirs == "corner_up_right" || this.resizingDirs == "corner_up_left"){if (this._effects["resize"]){}else {var ofs = e.clientY + this.resizingWin.resizeOffsetY;var sign = (ofs > this.resizingWin.y ? -1 : 1);newH = this.resizingWin.h + Math.abs(ofs - this.resizingWin.y)*sign;if (newH > this.resizingWin.maxH){newH = this.resizingWin.maxH;ofs = this.resizingWin.y + this.resizingWin.h - this.resizingWin.maxH;};if ((newH < this.resizingWin.minH)&& (sign < 0)) {this._carcass.y = this._carcass.y + this._carcass.h - this.resizingWin.minH;this._carcass.h = this.resizingWin.minH;}else {this._carcass.h = newH+(_isIE?0:-2);this._carcass.y = ofs;};this._carcass.style.top = this._carcass.y+"px";this._carcass.style.height = this._carcass.h+"px";}}}};this._stopMove = function() {if (this.movingWin != null){if (this._effects["move"]){var win = this.movingWin;this.movingWin = null;this._blockSwitcher(false);this._engineGetWindowHeader(win).style.cursor = "";if (_isFF){win.h++;that._engineRedrawWindowPos(win);win.h--;that._engineRedrawWindowPos(win);}}else {this._carcass.style.cursor = "";this._carcass.style.display = "none";var win = this.movingWin;this._engineGetWindowHeader(win).style.cursor = "";this.movingWin = null;this._blockSwitcher(false);win.setPosition(parseInt(this._carcass.style.left), parseInt(this._carcass.style.top));};this._vpcover.style.display = "none";if (!(win.oldMoveX == win.x && win.oldMoveY == win.y)) {if (win.checkEvent("onMoveFinish")) {win.callEvent("onMoveFinish",[win]);}else {this.callEvent("onMoveFinish",[win]);}}};if (this.resizingWin != null){var win = this.resizingWin;this.resizingWin = null;this._blockSwitcher(false);if (!this._effects["resize"]){this._carcass.style.display = "none";win.setDimension(this._carcass.w+(_isIE?0:2), this._carcass.h+(_isIE?0:2));win.setPosition(this._carcass.x, this._carcass.y);}else {win.updateNestedObjects();};if (win.vs[win.av].layout){win.vs[win.av].layout.callEvent("onResize", []);};this._vpcover.style.display = "none";if (win.checkEvent("onResizeFinish")) {win.callEvent("onResizeFinish",[win]);}else {this.callEvent("onResizeFinish",[win]);}}};this._fixWindowDimensionInViewport = function(win) {if (win.w < win.minW){win.w = win.minW;};if (win._isParked)return;if (win.h < win.minH){win.h = win.minH;}};this._bringOnTop = function(win) {var cZIndex = win.zi;var topZIndex = this._getTopZIndex(win._isSticked);for (var a in this.wins){if (this.wins[a] != win){if (win._isSticked || (!win._isSticked && !this.wins[a]._isSticked)) {if (this.wins[a].zi > cZIndex){this.wins[a].zi = this.wins[a].zi - this.zIndexStep;this.wins[a].style.zIndex = this.wins[a].zi;}}}};win.zi = topZIndex;win.style.zIndex = win.zi;};this._makeActive = function(win, ignoreFocusEvent) {for (var a in this.wins){if (this.wins[a] == win){var needEvent = false;if (this.wins[a].className != "dhtmlx_window_active" && !ignoreFocusEvent){needEvent = true;};this.wins[a].className = "dhtmlx_window_active";this._engineUpdateWindowIcon(this.wins[a], this.wins[a].icons[0]);if (needEvent == true){if (win.checkEvent("onFocus")) {win.callEvent("onFocus",[win]);}else {this.callEvent("onFocus",[win]);}}}else {this.wins[a].className = "dhtmlx_window_inactive";this._engineUpdateWindowIcon(this.wins[a], this.wins[a].icons[1]);}}};this._getActive = function() {var win = null;for (var a in this.wins){if (this.wins[a].className == "dhtmlx_window_active"){win = this.wins[a];}};return win;};this._centerWindow = function(win, onScreen) {if (win._isMaximized == true)return;if (onScreen == true){var vpw = (_isIE?document.body.offsetWidth:window.innerWidth);var vph = (_isIE?document.body.offsetHeight:window.innerHeight);}else {var vpw = (this.vp==document.body?document.body.offsetWidth:(Number(parseInt(this.vp.style.width))&&String(this.vp.style.width).search("%")==-1?parseInt(this.vp.style.width):this.vp.offsetWidth));var vph = (this.vp==document.body?document.body.offsetHeight:(Number(parseInt(this.vp.style.height))&&String(this.vp.style.height).search("%")==-1?parseInt(this.vp.style.height):this.vp.offsetHeight));};var newX = Math.round((vpw/2) - (win.w/2));var newY = Math.round((vph/2) - (win.h/2));win.x = newX;win.y = newY;this._engineFixWindowPosInViewport(win);this._engineRedrawWindowPos(win);};this._addDefaultButtons = function(win) {var btnStick = this._engineGetWindowButton(win, "stick");btnStick.title = this.i18n.stick;btnStick.isVisible = false;btnStick.style.display = "none";btnStick._isEnabled = true;btnStick.isPressed = false;btnStick.label = "stick";btnStick._doOnClick = function() {this.isPressed = true;that._stickWindow(win);};var btnSticked = this._engineGetWindowButton(win, "sticked");btnSticked.title = this.i18n.unstick;btnSticked.isVisible = false;btnSticked.style.display = "none";btnSticked._isEnabled = true;btnSticked.isPressed = false;btnSticked.label = "sticked";btnSticked._doOnClick = function() {this.isPressed = false;that._unstickWindow(win);};var btnHelp = this._engineGetWindowButton(win, "help");btnHelp.title = this.i18n.help;btnHelp.isVisible = false;btnHelp.style.display = "none";btnHelp._isEnabled = true;btnHelp.isPressed = false;btnHelp.label = "help";btnHelp._doOnClick = function() {that._needHelp(win);};var btnPark = this._engineGetWindowButton(win, "park");btnPark.titleIfParked = this.i18n.parkdown;btnPark.titleIfNotParked = this.i18n.parkup;btnPark.title = btnPark.titleIfNotParked;btnPark.isVisible = true;btnPark._isEnabled = true;btnPark.isPressed = false;btnPark.label = "park";btnPark._doOnClick = function() {that._parkWindow(win);};var btnMinMax1 = this._engineGetWindowButton(win, "minmax1");btnMinMax1.title = this.i18n.maximize;btnMinMax1.isVisible = true;btnMinMax1._isEnabled = true;btnMinMax1.isPressed = false;btnMinMax1.label = "minmax1";btnMinMax1._doOnClick = function() {that._maximizeWindow(win);};var btnMinMax2 = this._engineGetWindowButton(win, "minmax2");btnMinMax2.title = this.i18n.restore;btnMinMax2.isVisible = false;btnMinMax2.style.display = "none";btnMinMax2._isEnabled = true;btnMinMax2.isPressed = false;btnMinMax2.label = "minmax2";btnMinMax2._doOnClick = function() {that._restoreWindow(win);};var btnClose = this._engineGetWindowButton(win, "close");btnClose.title = this.i18n.close;btnClose.isVisible = true;btnClose._isEnabled = true;btnClose.isPressed = false;btnClose.label = "close";btnClose._doOnClick = function() {that._closeWindow(win);};var btnDock = this._engineGetWindowButton(win, "dock");btnDock.title = this.i18n.dock;btnDock.style.display = "none";btnDock.isVisible = false;btnDock._isEnabled = true;btnDock.isPressed = false;btnDock.label = "dock";btnDock._doOnClick = function() {};win._isSticked = false;win._isParked = false;win._isParkedAllowed = true;win._isMaximized = false;win._isDocked = false;win.btns = {};win.btns["stick"] = btnStick;win.btns["sticked"] = btnSticked;win.btns["help"] = btnHelp;win.btns["park"] = btnPark;win.btns["minmax1"] = btnMinMax1;win.btns["minmax2"] = btnMinMax2;win.btns["close"] = btnClose;win.btns["dock"] = btnDock;for (var a in win.btns){this._attachEventsOnButton(win, win.btns[a]);}};this._attachEventsOnButton = function(win, btn) {btn.onmouseover = function() {if (this._isEnabled){this.className = "dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_over_"+(this.isPressed?"pressed":"default");}else {this.className = "dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_disabled";}};btn.onmouseout = function() {if (this._isEnabled){this.isPressed = false;this.className = "dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_default";}else {this.className = "dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_disabled";}};btn.onmousedown = function() {if (this._isEnabled){this.isPressed = true;this.className = "dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_over_pressed";}else {this.className = "dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_disabled";}};btn.onmouseup = function() {if (this._isEnabled){var wasPressed = this.isPressed;this.isPressed = false;this.className = "dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_over_default";if (wasPressed){if (this.checkEvent("onClick")) {this.callEvent("onClick", [win, this]);}else {this._doOnClick();}}}else {this.className = "dhtmlx_wins_btns_button dhtmlx_button_"+this.label+"_disabled";}};btn.show = function() {that._showButton(win, this.label);};btn.hide = function() {that._hideButton(win, this.label);};btn.enable = function() {that._enableButton(win, this.label);};btn.disable = function() {that._disableButton(win, this.label);};btn.isEnabled = function() {return this._isEnabled;};btn.isHidden = function() {return (!this.isVisible);};dhtmlxEventable(btn);};this._parkWindow = function(win, parkBeforeMinMax) {if (!win._isParkedAllowed && !parkBeforeMinMax)return;if (this.enableParkEffect && win.parkBusy)return;if (win._isParked){if (this.enableParkEffect && !parkBeforeMinMax){win.parkBusy = true;this._doParkDown(win);}else {win.h = win.lastParkH;this._engineRedrawWindowSize(win);this._engineDoOnWindowParkDown(win);win.updateNestedObjects();win.btns["park"].title = win.btns["park"].titleIfNotParked;if (win._allowResizeGlobal == true){this._enableButton(win, "minmax1");this._enableButton(win, "minmax2");};win._isParked = false;if (!parkBeforeMinMax)if (win.checkEvent("onParkDown")) win.callEvent("onParkDown", [win]);else this.callEvent("onParkDown", [win]);}}else {if (this.enableParkEffect && !parkBeforeMinMax){win.lastParkH = (String(win.h).search(/\%$/)==-1?win.h:win.offsetHeight);if (win._allowResizeGlobal == true){this._disableButton(win, "minmax1");this._disableButton(win, "minmax2");};if (this.enableParkEffect){win.parkBusy = true;this._doParkUp(win);}else {var skinParams = (win._skinParams!=null?win._skinParams:this.skinParams[this.skin]);win.h = skinParams["header_height"] + skinParams["border_bottom_height"];win.btns["park"].title = win.btns["park"].titleIfParked;}}else {win.lastParkH = (String(win.h).search(/\%$/)==-1?win.h:win.offsetHeight);win.h = this._engineGetWindowParkedHeight(win);this._engineRedrawWindowSize(win);this._engineDoOnWindowParkUp(win);win.btns["park"].title = win.btns["park"].titleIfParked;win._isParked = true;if (!parkBeforeMinMax)if (win.checkEvent("onParkUp")) win.callEvent("onParkUp", [win]);else this.callEvent("onParkUp", [win]);}}};this._allowParking = function(win) {win._isParkedAllowed = true;this._enableButton(win, "park");};this._denyParking = function(win) {win._isParkedAllowed = false;this._disableButton(win, "park");};this.enableParkEffect = false;this.parkStartSpeed = 80;this.parkSpeed = this.parkStartSpeed;this.parkTM = null;this.parkTMTime = 5;this._doParkUp = function(win) {if (String(win.h).search(/\%$/) != -1) {win.h = win.offsetHeight;};win.h -= this.parkSpeed;var hh = this._engineGetWindowParkedHeight(win);if (win.h <= hh){win.h = hh;this._engineGetWindowButton(win, "park").title = this._engineGetWindowButton(win, "park").titleIfParked;win._isParked = true;win.parkBusy = false;this._engineRedrawWindowSize(win);this._engineDoOnWindowParkUp(win);if (win.checkEvent("onParkUp")) win.callEvent("onParkUp", [win]);else this.callEvent("onParkUp", [win]);}else {this._engineRedrawWindowSize(win);this.parkTM = window.setTimeout(function(){that._doParkUp(win);}, this.parkTMTime);}};this._doParkDown = function(win) {win.h += this.parkSpeed;if (win.h >= win.lastParkH){win.h = win.lastParkH;this._engineGetWindowButton(win, "park").title = this._engineGetWindowButton(win, "park").titleIfNotParked;if (win._allowResizeGlobal == true){this._enableButton(win, "minmax1");this._enableButton(win, "minmax2");};win._isParked = false;win.parkBusy = false;this._engineRedrawWindowSize(win);win.updateNestedObjects();this._engineDoOnWindowParkDown(win);if (win.checkEvent("onParkDown")) win.callEvent("onParkDown", [win]);else this.callEvent("onParkDown", [win]);}else {this._engineRedrawWindowSize(win);this.parkTM = window.setTimeout(function(){that._doParkDown(win);}, this.parkTMTime);}};this._enableButton = function(win, btn) {var button = this._engineGetWindowButton(win, btn);if (!button)return;button._isEnabled = true;button.className = "dhtmlx_wins_btns_button dhtmlx_button_"+button.label+"_default";};this._disableButton = function(win, btn) {var button = this._engineGetWindowButton(win, btn);if (!button)return;button._isEnabled = false;button.className = "dhtmlx_wins_btns_button dhtmlx_button_"+win.btns[btn].label+"_disabled";};this._allowReszieGlob = function(win) {win._allowResizeGlobal = true;this._enableButton(win, "minmax1");this._enableButton(win, "minmax2");};this._denyResize = function(win) {win._allowResizeGlobal = false;this._disableButton(win, "minmax1");this._disableButton(win, "minmax2");};this._maximizeWindow = function(win) {if (win._allowResizeGlobal == false)return;var isParkedBeforeMinMax = win._isParked;if (isParkedBeforeMinMax)this._parkWindow(win, true);win.lastMaximizeX = win.x;win.lastMaximizeY = win.y;win.lastMaximizeW = win.w;win.lastMaximizeH = win.h;if (win.maxW != "auto" && win.maxW != "auto"){win.x = Math.round(win.x+(win.w-win.maxW)/2);win.y = Math.round(win.y+(win.h-win.maxH)/2);win._allowMove = true;}else {win.x = 0;win.y = 0;win._allowMove = false;};win._isMaximized = true;win._allowResize = false;win.w = (win.maxW == "auto" ? (this.vp == document.body ? "100%" : (this.vp.style.width != "" && String(this.vp.style.width).search("%") == -1 ? parseInt(this.vp.style.width) : this.vp.offsetWidth)) : win.maxW);win.h = (win.maxH == "auto" ? (this.vp == document.body ? "100%" : (this.vp.style.height != "" && String(this.vp.style.width).search("%") == -1 ? parseInt(this.vp.style.height) : this.vp.offsetHeight)) : win.maxH);this._hideButton(win, "minmax1");this._showButton(win, "minmax2");this._engineRedrawWindowPos(win);if (isParkedBeforeMinMax){this._parkWindow(win, true);}else {this._engineRedrawWindowSize(win);win.updateNestedObjects();};if (win.checkEvent("onMaximize")) win.callEvent("onMaximize", [win]);else this.callEvent("onMaximize", [win]);};this._restoreWindow = function(win) {if (win._allowResizeGlobal == false)return;if (win.layout)win.layout._defineWindowMinDimension(win);var isParkedBeforeMinMax = win._isParked;if (isParkedBeforeMinMax)this._parkWindow(win, true);if (win.maxW != "auto" && win.maxW != "auto"){win.x = Math.round(win.x+(win.w-win.lastMaximizeW)/2);win.y = Math.round(win.y+(win.h-win.lastMaximizeH)/2);}else {win.x = win.lastMaximizeX;win.y = win.lastMaximizeY;};win.w = win.lastMaximizeW;win.h = win.lastMaximizeH;win._isMaximized = false;win._allowMove = win._allowMoveGlobal;win._allowResize = true;this._fixWindowDimensionInViewport(win);this._hideButton(win, "minmax2");this._showButton(win, "minmax1");this._engineRedrawWindowPos(win);if (isParkedBeforeMinMax){this._parkWindow(win, true);}else {this._engineRedrawWindowSize(win);win.updateNestedObjects();};if (win.checkEvent("onMinimize")) win.callEvent("onMinimize", [win]);else this.callEvent("onMinimize", [win]);};this._showButton = function(win, btn) {var button = this._engineGetWindowButton(win, btn);if (!button)return;button.isVisible = true;button.style.display = "";this._engineRedrawWindowTitle(win);};this._hideButton = function(win, btn) {var button = this._engineGetWindowButton(win, btn);if (!button)return;button.isVisible = false;button.style.display = "none";this._engineRedrawWindowTitle(win);};this._showWindow = function(win) {win.style.display = "";if (win.checkEvent("onShow")) {win.callEvent("onShow", [win]);}else {this.callEvent("onShow", [win]);};var w = this._getActive();if (w == null){this._bringOnTop(win);this._makeActive(win);}else if (this._isWindowHidden(w)) {this._bringOnTop(win);this._makeActive(win);}};this._hideWindow = function(win) {win.style.display = "none";if (win.checkEvent("onHide")) {win.callEvent("onHide", [win]);}else {this.callEvent("onHide", [win]);};var w = this.getTopmostWindow(true);if (w != null){this._bringOnTop(w);this._makeActive(w);}};this._isWindowHidden = function(win) {var isHidden = (win.style.display == "none");return isHidden;};this._closeWindow = function(win) {if (this._focusFixIE){this._focusFixIE.style.top = (this.vp==document.body?0:getAbsoluteTop(this.vp))+win.y+"px";this._focusFixIE.focus();};if (win.checkEvent("onClose")) {if (!win.callEvent("onClose", [win])) return;}else {if(!this.callEvent("onClose", [win])) return;};this._removeWindowGlobal(win);var latest = {"zi": 0 };for (var a in this.wins){if (this.wins[a].zi > latest.zi){latest = this.wins[a];}};if (latest != null){this._makeActive(latest);};if (_isFF && this.vp != document.body){this.vp.style.display = "none";var vp = this.vp;window.setTimeout(function(){vp.style.display="";},1);}};this._needHelp = function(win) {if (win.checkEvent("onHelp")) {win.callEvent("onHelp", [win]);}else {this.callEvent("onHelp", [win]);}};this._setWindowIcon = function(win, iconEnabled, iconDisabled) {win.iconsPresent = true;win.icons[0] = this.imagePath + iconEnabled;win.icons[1] = this.imagePath + iconDisabled;this._engineUpdateWindowIcon(win, win.icons[win.isOnTop()?0:1]);};this._getWindowIcon = function(win) {if (win.iconsPresent){return new Array(win.icons[0], win.icons[1]);}else {return new Array(null, null);}};this._clearWindowIcons = function(win) {win.iconsPresent = false;win.icons[0] = this.imagePath + this.pathPrefix + this.skin + "/active/icon_blank.gif";win.icons[1] = this.imagePath + this.pathPrefix + this.skin + "/inactive/icon_blank.gif";this._engineUpdateWindowIcon(win, win.icons[win.isOnTop()?0:1]);};this._restoreWindowIcons = function(win) {win.iconsPresent = true;win.icons[0] = this.imagePath + this.pathPrefix + this.skin + "/active/icon_normal.gif";win.icons[1] = this.imagePath + this.pathPrefix + this.skin + "/inactive/icon_normal.gif";this._engineUpdateWindowIcon(win, win.icons[win.className=="dhtmlx_window_active"?0:1]);};this._attachWindowContentTo = function(win, obj, w, h) {var data = this._engineGetWindowContent(win).parentNode;data.parentNode.removeChild(data);win.hide();data.style.left = "0px";data.style.top = "0px";data.style.width = (w!=null?w:obj.offsetWidth)+"px";data.style.height = (h!=null?h:obj.offsetHeight)+"px";data.style.position = "relative";obj.appendChild(data);this._engineGetWindowContent(win).style.width = data.style.width;this._engineGetWindowContent(win).style.height = data.style.height;};this._setWindowToFullScreen = function(win, state) {if (state == true){var data = win._content;data.parentNode.removeChild(data);win.hide();win._isFullScreened = true;data.style.left = "0px";data.style.top = "0px";data.style.width = document.body.offsetWidth-(_isIE?4:0)+"px";if (document.body.offsetHeight == 0){if (window.innerHeight){data.style.height = window.innerHeight+"px";}else {data.style.height = document.body.scrollHeight+"px";}}else {data.style.height = document.body.offsetHeight-(_isIE?4:0)+"px";};data.style.position = "absolute";document.body.appendChild(data);}else if (state == false){var data = win.childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1];var base = win._content;document.body.removeChild(base);data.appendChild(base);win._isFullScreened = false;win.setDimension(win.w, win.h);win.show();win.bringToTop();win.center();};win.updateNestedObjects();};this._isWindowOnTop = function(win) {var state = (this.getTopmostWindow() == win);return state;};this._bringOnBottom = function(win) {for (var a in this.wins){if (this.wins[a].zi < win.zi){this.wins[a].zi += this.zIndexStep;this.wins[a].style.zIndex = this.wins[a].zi;}};win.zi = 50;win.style.zIndex = win.zi;this._makeActive(this.getTopmostWindow());};this._isWindowOnBottom = function(win) {var state = true;for (var a in this.wins){if (this.wins[a] != win){state = state && (this.wins[a].zi > win.zi);}};return state;};this._stickWindow = function(win) {win._isSticked = true;this._hideButton(win, "stick");this._showButton(win, "sticked");this._bringOnTop(win);};this._unstickWindow = function(win) {win._isSticked = false;this._hideButton(win, "sticked");this._showButton(win, "stick");this._bringOnTopAnyStickedWindows();};this._addUserButton = function(win, id, pos, title) {var userButton = this._engineAddUserButton(win, id, pos);userButton.title = title;userButton.isVisible = true;userButton._isEnabled = true;userButton.isPressed = false;userButton.label = id;win.btns[id] = userButton;userButton._doOnClick = function() {};this._attachEventsOnButton(win, userButton);};this._removeUserButton = function(win, buttonId) {this._removeButtonGlobal(win, buttonId);};this._blockSwitcher = function(state) {for (var a in this.wins){if (state == true){this.wins[a].showCoverBlocker();}else {this.wins[a].hideCoverBlocker();}}};this.resizingWin = null;this.modalWin = null;this.resizingDirs = "none";if (_isIE){this._focusFixIE = document.createElement("INPUT");this._focusFixIE.className = "dhx_windows_ieonclosefocusfix";this._focusFixIE.style.position = "absolute";this._focusFixIE.style.width = "1px";this._focusFixIE.style.height = "1px";this._focusFixIE.style.border = "none";this._focusFixIE.style.background = "none";this._focusFixIE.style.left = "-10px";this._focusFixIE.style.fontSize = "1px";document.body.appendChild(this._focusFixIE);};this._createViewport();this._doOnMouseUp = function() {if (that != null)that._stopMove();};this._doOnMoseMove = function(e) {e = e||event;if (that != null)that._moveWindow(e);};this._resizeTM = null;this._resizeTMTime = 200;this._lw = null;this._doOnResize = function() {if (that._lw != document.documentElement.clientHeight){window.clearTimeout(that._resizeTM);that._resizeTM = window.setTimeout(function(){that._autoResizeViewport();}, that._resizeTMTime);};that._lw = document.documentElement.clientHeight;};this._doOnUnload = function() {that.unload();};this._doOnSelectStart = function(e) {e = e||event;if (that.movingWin != null || that.resizingWin != null)e.returnValue = false;};if (_isIE){document.body.attachEvent("onselectstart", this._doOnSelectStart);};dhtmlxEvent(window, "resize", this._doOnResize);dhtmlxEvent(document.body, "unload", this._doOnUnload);dhtmlxEvent(document.body, "mouseup", this._doOnMouseUp);dhtmlxEvent(this.vp, "mousemove", this._doOnMoseMove);dhtmlxEvent(this.vp, "mouseup", this._doOnMouseUp);this._setWindowModal = function(win, state) {if (state == true){this._makeActive(win);this._bringOnTop(win);this.modalWin = win;win._isModal = true;this.modalCoverI.style.zIndex = win.zi - 2;this.modalCoverI.style.display = "";this.modalCoverD.style.zIndex = win.zi - 2;this.modalCoverD.style.display = "";}else {this.modalWin = null;win._isModal = false;this.modalCoverI.style.zIndex = 0;this.modalCoverI.style.display = "none";this.modalCoverD.style.zIndex = 0;this.modalCoverD.style.display = "none";}};this._bringOnTopAnyStickedWindows = function() {var wins = new Array();for (var a in this.wins){if (this.wins[a]._isSticked){wins[wins.length] = this.wins[a];}};for (var q=0;q<wins.length;q++){this._bringOnTop(wins[q]);};if (wins.length == 0){for (var a in this.wins){if (this.wins[a].className == "dhtmlx_window_active"){this._bringOnTop(this.wins[a]);}}}};this.unload = function() {this._clearAll();};this._removeButtonGlobal = function(win, buttonId) {if (!win.btns[buttonId])return;var btn = win.btns[buttonId];btn.title = null;btn.isVisible = null;btn._isEnabled = null;btn.isPressed = null;btn.label = null;btn._doOnClick = null;btn.attachEvent = null;btn.callEvent = null;btn.checkEvent = null;btn.detachEvent = null;btn.disable = null;btn.enable = null;btn.eventCatcher = null;btn.hide = null;btn.isEnabled = null;btn.isHidden = null;btn.show = null;btn.onmousedown = null;btn.onmouseout = null;btn.onmouseover = null;btn.onmouseup = null;if (btn.parentNode)btn.parentNode.removeChild(btn);btn = null;win.btns[buttonId] = null;};this._removeWindowGlobal = function(win) {if (this.modalWin == win)this._setWindowModal(win, false);var idd = win.idd;win.coverBlocker().onselectstart = null;win._dhxContDestruct();this._engineDiableOnSelectInWindow(win, false);this._engineGetWindowHeader(win).onmousedown = null;this._engineGetWindowHeader(win).ondblclick = null;this.movingWin = null;this.resizingWin = null;for (var a in win.btns)this._removeButtonGlobal(win, a);win.btns = null;win._adjustToContent = null;win._doOnAttachMenu = null;win._doOnAttachStatusBar = null;win._doOnAttachToolbar = null;win._redraw = null;win.addUserButton = null;win.allowMove = null;win.allowPark = null;win.allowResize = null;win.attachEvent = null;win.bringToBottom = null;win.bringToTop = null;win.callEvent = null;win.center = null;win.centerOnScreen = null;win.checkEvent = null;win.clearIcon = null;win.close = null;win.denyMove = null;win.denyPark = null;win.denyResize = null;win.detachEvent = null;win.eventCatcher = null;win.getDimension = null;win.getIcon = null;win.getId = null;win.getMaxDimension = null;win.getMinDimension = null;win.getPosition = null;win.getText = null;win.hide = null;win.hideHeader = null;win.isHidden = null;win.isMaximized = null;win.isModal = null;win.isMovable = null;win.isOnBottom = null;win.isOnTop = null;win.isParkable = null;win.isParked = null;win.isResizable = null;win.isSticked = null;win.keepInViewport = null;win.maximize = null;win.minimize = null;win.park = null;win.progressOff = null;win.progressOn = null;win.removeUserButton = null;win.restoreIcon = null;win.setDimension = null;win.setIcon = null;win.setMaxDimension = null;win.setMinDimension = null;win.setModal = null;win.setPosition = null;win.setText = null;win.setToFullScreen = null;win.show = null;win.showHeader = null;win.stick = null;win.unstick = null;win.onmousemove = null;win.onmousedown = null;win.icons = null;win.button = null;win._dhxContDestruct = null;win.dhxContGlobal.obj = null;win.dhxContGlobal.setContent = null;win.dhxContGlobal.dhxcont = null;win.dhxContGlobal = null;if (win._frame){while (win._frame.childNodes.length > 0)win._frame.removeChild(win._frame.childNodes[0]);win._frame = null;};this._parseNestedForEvents(win);win._content = null;win.innerHTML = "";win.parentNode.removeChild(win);win = null;this.wins[idd] = null;delete this.wins[idd];idd = null;};this._removeEvents = function(obj) {obj.onmouseover = null;obj.onmouseout = null;obj.onmousemove = null;obj.onclick = null;obj.ondblclick = null;obj.onmouseenter = null;obj.onmouseleave = null;obj.onmouseup = null;obj.onmousewheel = null;obj.onmousedown = null;obj.onselectstart = null;obj.onfocus = null;obj.style.display = "";};this._parseNestedForEvents = function(obj) {this._removeEvents(obj);for (var q=0;q<obj.childNodes.length;q++){if (obj.childNodes[q].tagName != null){this._parseNestedForEvents(obj.childNodes[q]);}}};this._clearAll = function() {this._clearDocumentEvents();for (var a in this.wins)this._removeWindowGlobal(this.wins[a]);this.wins = null;this._parseNestedForEvents(this._carcass);while (this._carcass.childNodes.length > 0)this._carcass.removeChild(this._carcass.childNodes[0]);this._carcass.onselectstart = null;this._carcass.parentNode.removeChild(this._carcass);this._carcass = null;this._parseNestedForEvents(this._vpcover);this._vpcover.parentNode.removeChild(this._vpcover);this._vpcover = null;this._parseNestedForEvents(this.modalCoverD);this.modalCoverD.parentNode.removeChild(this.modalCoverD);this.modalCoverD = null;this._parseNestedForEvents(this.modalCoverI);this.modalCoverI.parentNode.removeChild(this.modalCoverI);this.modalCoverI = null;if (this.vp.autocreated == true)this.vp.parentNode.removeChild(this.vp);this.vp = null;for (var a in this.skinParams){delete this.skinParams[a];};this.skinParams = null;this._effects = null;this._engineSkinParams = null;wins = null;this._addDefaultButtons = null;this._addUserButton = null;this._allowParking = null;this._allowReszieGlob = null;this._attachEventsOnButton = null;this._attachWindowContentTo = null;this._autoResizeViewport = null;this._blockSwitcher = null;this._bringOnBottom = null;this._bringOnTop = null;this._bringOnTopAnyStickedWindows = null;this._centerWindow = null;this._clearAll = null;this._clearDocumentEvents = null;this._clearWindowIcons = null;this._closeWindow = null;this._createViewport = null;this._denyParking = null;this._denyResize = null;this._dhx_Engine = null;this._disableButton = null;this._doOnMoseMove = null;this._doOnMouseUp = null;this._doOnResize = null;this._doOnSelectStart = null;this._doOnUnload = null;this._doParkDown = null;this._doParkUp = null;this._enableButton = null;this._engineAddUserButton = null;this._engineAdjustWindowToContent = null;this._engineAllowWindowResize = null;this._engineCheckHeaderMouseDown = null;this._engineDiableOnSelectInWindow = null;this._engineDoOnWindowParkDown = null;this._engineDoOnWindowParkUp = null;this._engineFixWindowPosInViewport = null;this._engineGetWindowButton = null;this._engineGetWindowContent = null;this._engineGetWindowHeader = null;this._engineGetWindowHeaderState = null;this._engineGetWindowLabel = null;this._engineGetWindowParkedHeight = null;this._engineRedrawSkin = null;this._engineRedrawWindowPos = null;this._engineRedrawWindowSize = null;this._engineRedrawWindowTitle = null;this._engineSetWindowBody = null;this._engineSwitchWindowHeader = null;this._engineSwitchWindowProgress = null;this._engineUpdateWindowIcon = null;this._fixWindowDimensionInViewport = null;this._genStr = null;this._getActive = null;this._getTopZIndex = null;this._getWindowIcon = null;this._hideButton = null;this._hideWindow = null;this._isWindowHidden = null;this._isWindowOnBottom = null;this._isWindowOnTop = null;this._makeActive = null;this._maximizeWindow = null;this._moveWindow = null;this._needHelp = null;this._parkWindow = null;this._parseNestedForEvents = null;this._removeButtonGlobal = null;this._removeEvents = null;this._removeUserButton = null;this._removeWindowGlobal = null;this._restoreWindow = null;this._restoreWindowIcons = null;this._setWindowIcon = null;this._setWindowModal = null;this._setWindowToFullScreen = null;this._showButton = null;this._showWindow = null;this._stickWindow = null;this._stopMove = null;this._unstickWindow = null;this.attachEvent = null;this.attachViewportTo = null;this.callEvent = null;this.checkEvent = null;this.createWindow = null;this.detachEvent = null;this.enableAutoViewport = null;this.eventCatcher = null;this.findByText = null;this.forEachWindow = null;this.getBottommostWindow = null;this.getEffect = null;this.getTopmostWindow = null;this.isWindow = null;this.setEffect = null;this.setImagePath = null;this.setSkin = null;this.setViewport = null;this.unload = null;this.window = null;that = null;};this._clearDocumentEvents = function() {if (_isIE){window.detachEvent("onresize", this._doOnResize);document.body.detachEvent("onselectstart", this._doOnSelectStart);document.body.detachEvent("onmouseup", this._doOnMouseUp);document.body.detachEvent("onunload", this._doOnUnload);this.vp.detachEvent("onmousemove", this._doOnMoseMove);this.vp.detachEvent("onmouseup", this._doOnMouseUp);}else {window.removeEventListener("resize", this._doOnResize, false);document.body.removeEventListener("mouseup", this._doOnMouseUp, false);document.body.removeEventListener("unload", this._doOnUnload, false);this.vp.removeEventListener("mousemove", this._doOnMoseMove, false);this.vp.removeEventListener("mouseup", this._doOnMouseUp, false);}};this._genStr = function(w) {var s = "";var z = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for (var q=0;q<w;q++)s += z.charAt(Math.round(Math.random() * (z.length-1)));return s;};dhtmlxEventable(this);return this;};dhtmlXWindows.prototype._dhx_Engine = function() {this._engineEnabled = true;this._engineName = "dhx";this._engineSkinParams = {dhx_blue: {"hh": 21, "lbw": 2, "rbw": 2, "lch": 2, "lcw": 14, "rch": 14, "rcw": 14, "bbh": 2, "mnh": 23, "tbh": 25, "sbh": 20, "noh_t": null, "noh_h": null},
 dhx_black: {"hh": 21, "lbw": 2, "rbw": 2, "lch": 2, "lcw": 14, "rch": 14, "rcw": 14, "bbh": 2, "mnh": 23, "tbh": 25, "sbh": 20, "noh_t": null, "noh_h": null},
 dhx_skyblue: {"hh": 29, "lbw": 2, "rbw": 2, "lch": 2, "lcw": 14, "rch": 14, "rcw": 14, "bbh": 2, "mnh": 23, "tbh": 25, "sbh": 20, "noh_t": 5, "noh_h": -10},
 dhx_web: {"hh": 27, "lbw": 5, "rbw": 5, "lch": 5, "lcw": 14, "rch": 14, "rcw": 14, "bbh": 5, "mnh": 23, "tbh": 25, "sbh": 20, "noh_t": 5, "noh_h": -10}};this._engineSetWindowBody = function(win) {win.innerHTML = "<div iswin='1' class='dhtmlx_wins_body_outer' style='position: relative;'>"+
 (_isIE?"<iframe frameborder='0' class='dhtmlx_wins_ie6_cover_fix' onload='this.contentWindow.document.body.style.overflow=\"hidden\";'></iframe>":"")+
 "<div class='dhtmlx_wins_icon'></div>"+
 "<div class='dhtmlx_wins_progress'></div>"+
 "<div class='dhtmlx_wins_title'>dhtmlxWindow</div>"+
 "<div class='dhtmlx_wins_btns'>"+
 "<div class='dhtmlx_wins_btns_button dhtmlx_button_sticked_default'></div>"+
 "<div class='dhtmlx_wins_btns_button dhtmlx_button_stick_default'></div>"+
 "<div class='dhtmlx_wins_btns_button dhtmlx_button_help_default'></div>"+
 "<div class='dhtmlx_wins_btns_button dhtmlx_button_park_default'></div>"+
 "<div class='dhtmlx_wins_btns_button dhtmlx_button_minmax2_default'></div>"+
 "<div class='dhtmlx_wins_btns_button dhtmlx_button_minmax1_default'></div>"+
 "<div class='dhtmlx_wins_btns_button dhtmlx_button_close_default'></div>"+
 "<div class='dhtmlx_wins_btns_button dhtmlx_button_dock_default'></div>"+
 "</div>"+
 "<div class='dhtmlx_wins_body_inner'></div>"+
 "<div winResT='yes' class='dhtmlx_wins_resizer_t' style='display:none;'></div>"+
 "<div winResL='yes' class='dhtmlx_wins_resizer_l'></div>"+
 "<div winResR='yes' class='dhtmlx_wins_resizer_r'></div>"+
 "<div winResB='yes' class='dhtmlx_wins_resizer_b'></div>"+
 "<div class='white_line'></div>"+
 "<div class='white_line2'></div>"+
 "</div>";win.dhxContGlobal = new dhtmlXContainer(win);if (this.skin == "dhx_skyblue"){win.dhxContGlobal.obj._offsetWidth = -10;win.dhxContGlobal.obj._offsetHeight = -5;win.dhxContGlobal.obj._offsetLeft = 5;win.dhxContGlobal.obj._offsetHeightSaved = win.dhxContGlobal.obj._offsetHeight;};if (this.skin == "dhx_web"){win.dhxContGlobal.obj._offsetWidth = -10;win.dhxContGlobal.obj._offsetHeight = -5;win.dhxContGlobal.obj._offsetLeft = 5;win.dhxContGlobal.obj._offsetHeightSaved = win.dhxContGlobal.obj._offsetHeight;};win.skin = this.skin;win.dhxContGlobal.setContent(win.childNodes[0].childNodes[(_isIE?5:4)]);win.coverBlocker().onselectstart = function(e) {e = e||event;e.returnValue = false;e.cancelBubble = true;}};this._engineDiableOnSelectInWindow = function(win, state) {var data = new Array();data[0] = win.childNodes[0].childNodes[(_isIE?1:0)];data[1] = win.childNodes[0].childNodes[(_isIE?2:1)];data[2] = win.childNodes[0].childNodes[(_isIE?3:2)];data[3] = win.childNodes[0].childNodes[(_isIE?4:3)];data[4] = win.childNodes[0].childNodes[(_isIE?6:5)];data[5] = win.childNodes[0].childNodes[(_isIE?7:6)];data[6] = win.childNodes[0].childNodes[(_isIE?8:7)];data[7] = win.childNodes[0].childNodes[(_isIE?9:8)];for (var q=0;q<data.length;q++){data[q].onselectstart = (state?function(e){e=e||event;e.returnValue=false;return false;}:null);}};this._engineGetWindowHeader = function(win) {win.childNodes[0].idd = win.idd;return win.childNodes[0];};this._engineRedrawWindowSize = function(win) {win.style.width = (String(win.w).search("%")==-1?win.w+"px":win.w);win.style.height = (String(win.h).search("%")==-1?win.h+"px":win.h);var body = win.childNodes[0];body.style.width = win.clientWidth+"px";body.style.height = win.clientHeight+"px";if (body.offsetWidth > win.clientWidth){body.style.width = win.clientWidth*2-body.offsetWidth+"px";};if (body.offsetHeight > win.clientHeight){var px = win.clientHeight*2-body.offsetHeight;if (px < 0)px = 0;body.style.height = px+"px";};var hh = (win._noHeader==true?win._hdrSize:this._engineSkinParams[this.skin]["hh"]);this._engineRedrawWindowTitle(win);win.adjustContent(body, hh);};this._engineRedrawWindowPos = function(win) {if (win._isFullScreened)return;win.style.left = win.x + "px";win.style.top = win.y + "px";};this._engineFixWindowPosInViewport = function(win) {var hh = (win._noHeader==true?win._hdrSize:this._engineSkinParams[this.skin]["hh"]);if (win._keepInViewport){if (win.x < 0){win.x = 0;};if (win.x + win.w > this.vp.offsetWidth){win.x = this.vp.offsetWidth - win.w;};if (win.y + win.h > this.vp.offsetHeight){win.y = this.vp.offsetHeight - win.h;};if (win.y < 0){win.y = 0;}}else {if (win.y + hh > this.vp.offsetHeight){win.y = this.vp.offsetHeight - hh;};if (win.y < 0){win.y = 0;};if (win.x + win.w - 10 < 0){win.x = 10 - win.w;};if (win.x > this.vp.offsetWidth - 10){win.x = this.vp.offsetWidth - 10;}}};this._engineCheckHeaderMouseDown = function(win, ev) {var x = (_isIE||_isOpera?ev.offsetX:ev.layerX);var y = (_isIE||_isOpera?ev.offsetY:ev.layerY);var obj = ev.target||ev.srcElement;var hh = (win._noHeader==true?win._hdrSize:this._engineSkinParams[this.skin]["hh"]);if (y <= hh && (obj == win.childNodes[0] || obj == win.childNodes[0].childNodes[(_isIE?1:0)] || obj == win.childNodes[0].childNodes[(_isIE?3:2)] || obj == win.childNodes[0].childNodes[(_isIE?4:3)])) return true;return false;};this._engineGetWindowContent = function(win) {alert("_engineGetWindowContent");};this._engineGetWindowButton = function(win, buttonName) {var buttonObj = null;var buttonStyle = "dhtmlx_button_"+String(buttonName).toLowerCase()+"_";for (var q=0;q<win.childNodes[0].childNodes[(_isIE?4:3)].childNodes.length;q++) {var buttonTemp = win.childNodes[0].childNodes[(_isIE?4:3)].childNodes[q];if (String(buttonTemp.className).search(buttonStyle) != -1) {buttonObj = buttonTemp;}};return buttonObj;};this._engineAddUserButton = function(win, buttonName, buttonPos) {if (isNaN(buttonPos)) buttonPos = 0;var button = document.createElement("DIV");button.className = "dhtmlx_wins_btns_button dhtmlx_button_"+buttonName+"_default";var buttonPoly = win.childNodes[0].childNodes[(_isIE?4:3)];buttonPos = buttonPoly.childNodes.length - buttonPos;if (buttonPos < 0)buttonPos = 0;if (buttonPos >= buttonPoly.childNodes.length){buttonPoly.appendChild(button);}else {buttonPoly.insertBefore(button, buttonPoly.childNodes[buttonPos]);};this._engineRedrawWindowTitle(win);return button;};this._engineGetWindowParkedHeight = function(win) {return this._engineSkinParams[this.skin]["hh"]+1;};this._engineDoOnWindowParkDown = function(win) {win.childNodes[0].childNodes[(_isIE?6:5)].style.display = (win._noHeader==true?"":"none");win.childNodes[0].childNodes[(_isIE?7:6)].style.display = "";win.childNodes[0].childNodes[(_isIE?8:7)].style.display = "";win.childNodes[0].childNodes[(_isIE?9:8)].style.display = "";};this._engineDoOnWindowParkUp = function(win) {win.childNodes[0].childNodes[(_isIE?6:5)].style.display = "none";win.childNodes[0].childNodes[(_isIE?7:6)].style.display = "none";win.childNodes[0].childNodes[(_isIE?8:7)].style.display = "none";win.childNodes[0].childNodes[(_isIE?9:8)].style.display = "none";};this._engineUpdateWindowIcon = function(win, icon) {win.childNodes[0].childNodes[(_isIE?1:0)].style.backgroundImage = "url('"+icon+"')";};this._engineAllowWindowResize = function(win, targetObj, mouseX, mouseY) {if (!targetObj.getAttribute)return;var sk = this._engineSkinParams[this.skin];var hh = (win._noHeader==true?win._hdrSize:this._engineSkinParams[this.skin]["hh"]);if (targetObj.getAttribute("winResL")!= null) {if (targetObj.getAttribute("winResL")== "yes") {if (mouseY >= hh){if (mouseY >= win.h - sk["lch"])return "corner_left";if (mouseY <= sk["lch"] && win._noHeader == true)return "corner_up_left";return "border_left";}}};if (targetObj.getAttribute("winResR")!= null) {if (targetObj.getAttribute("winResR")== "yes") {if (mouseY >= hh){if (mouseY >= win.h - sk["rch"])return "corner_right";if (mouseY <= sk["rch"] && win._noHeader == true)return "corner_up_right";return "border_right";}}};if (targetObj.getAttribute("winResT")!= null) {if (targetObj.getAttribute("winResT")== "yes" && win._noHeader == true) {if (mouseX <= sk["lcw"])return "corner_up_left";if (mouseX >= win.w - sk["rcw"])return "corner_up_right";return "border_top";}};if (targetObj.getAttribute("winResB")!= null) {if (targetObj.getAttribute("winResB")== "yes") {if (mouseX <= sk["lcw"])return "corner_left";if (mouseX >= win.w - sk["rcw"])return "corner_right";return "border_bottom";}};return null;};this._engineAdjustWindowToContent = function(win, w, h) {var newW = w+win.w-win.vs[win.av].dhxcont.clientWidth;var newH = h+win.h-win.vs[win.av].dhxcont.clientHeight;win.setDimension(newW, newH);};this._engineRedrawSkin = function() {this.vp.className = "dhtmlx_winviewport dhtmlx_skin_"+this.skin+(this._r?" dhx_wins_rtl":"");var sk = this._engineSkinParams[this.skin];for (var a in this.wins){if (this.skin == "dhx_skyblue"){this.wins[a].dhxContGlobal.obj._offsetTop = (this.wins[a]._noHeader?sk["noh_t"]:null);this.wins[a].dhxContGlobal.obj._offsetWidth = -10;this.wins[a].dhxContGlobal.obj._offsetHeight = (this.wins[a]._noHeader?sk["noh_h"]:-5);this.wins[a].dhxContGlobal.obj._offsetLeft = 5;this.wins[a].dhxContGlobal.obj._offsetHeightSaved = -5;}else {this.wins[a].dhxContGlobal.obj._offsetWidth = null;this.wins[a].dhxContGlobal.obj._offsetHeight = null;this.wins[a].dhxContGlobal.obj._offsetLeft = null;this.wins[a].dhxContGlobal.obj._offsetTop = null;this.wins[a].dhxContGlobal.obj._offsetHeightSaved = null;};this.wins[a].skin = this.skin;this._restoreWindowIcons(this.wins[a]);this._engineRedrawWindowSize(this.wins[a]);}};this._engineSwitchWindowProgress = function(win, state) {if (state == true){win.childNodes[0].childNodes[(_isIE?1:0)].style.display = "none";win.childNodes[0].childNodes[(_isIE?2:1)].style.display = "";}else {win.childNodes[0].childNodes[(_isIE?2:1)].style.display = "none";win.childNodes[0].childNodes[(_isIE?1:0)].style.display = "";}};this._engineSwitchWindowHeader = function(win, state) {if (!win._noHeader)win._noHeader = false;if (state != win._noHeader)return;win._noHeader = (state==true?false:true);win._hdrSize = 0;win.childNodes[0].childNodes[(_isIE?5:4)].className = "dhtmlx_wins_body_inner"+(win._noHeader?" dhtmlx_wins_no_header":"");win.childNodes[0].childNodes[(_isIE?6:5)].style.display = (win._noHeader?"":"none");win.childNodes[0].childNodes[(_isIE?1:0)].style.display = (win._noHeader?"none":"");win.childNodes[0].childNodes[(_isIE?3:2)].style.display = (win._noHeader?"none":"");win.childNodes[0].childNodes[(_isIE?4:3)].style.display = (win._noHeader?"none":"");var sk = this._engineSkinParams[this.skin];if (win._noHeader){win.dhxContGlobal.obj._offsetHeightSaved = win.dhxContGlobal.obj._offsetHeight;win.dhxContGlobal.obj._offsetHeight = sk["noh_h"];win.dhxContGlobal.obj._offsetTop = sk["noh_t"];}else {win.dhxContGlobal.obj._offsetHeight = win.dhxContGlobal.obj._offsetHeightSaved;win.dhxContGlobal.obj._offsetTop = null;};this._engineRedrawWindowSize(win);};this._engineGetWindowHeaderState = function(win) {return (win._noHeader?true:false);};this._engineGetWindowLabel = function(win) {return win.childNodes[0].childNodes[(_isIE?3:2)];};this._engineRedrawWindowTitle = function(win) {if (win._noHeader!==true){var p2 = win.childNodes[0].childNodes[(_isIE?1:0)].offsetWidth;var p3 = win.childNodes[0].childNodes[(_isIE?4:3)].offsetWidth;var newW = win.offsetWidth-p2-p3-24;if (newW < 0)newW = "100%";else newW += "px";win.childNodes[0].childNodes[(_isIE?3:2)].style.width = newW;}}};dhtmlXWindows.prototype.i18n = {dhxcontaler: "dhtmlxcontainer.js is missed on the page",
 noenginealert: "No dhtmlxWindows engine was found.",
 stick: "Stick",
 unstick: "Unstick",
 help: "Help",
 parkdown: "Park Down",
 parkup: "Park Up",
 maximize: "Maximize",
 restore: "Restore",
 close: "Close",
 dock: "Dock"
};(function(){dhtmlx.extend_api("dhtmlXWindows",{_init:function(obj){return [];},
 _patch:function(obj){obj.old_createWindow=obj.createWindow;obj.createWindow=function(obj){if (arguments.length>1)return this.old_createWindow.apply(this,arguments);var res = this.old_createWindow(obj.id,obj.x,obj.y,obj.width,obj.height);res.allowMoveA=function(mode){if (mode)this.allowMove();else this.denyMove();};res.allowParkA=function(mode){if (mode)this.allowPark();else this.denyPark();};res.allowResizeA=function(mode){if (mode)this.allowResize();else this.denyResize();};for (var a in obj){if (map[a])res[map[a]](obj[a]);else if (a.indexOf("on")==0){res.attachEvent(a,obj[a]);}};return res;}},
 animation:"setEffect",
 image_path:"setImagePath",
 skin:"setSkin",
 viewport:"_viewport",
 wins:"_wins"
 },{_viewport:function(data){if (data.object){this.enableAutoViewport(false);this.attachViewportTo(data.object);}else {this.enableAutoViewport(false);this.setViewport(data.left, data.top, data.width, data.height, data.parent);}},
 _wins:function(arr){for (var q=0;q<arr.length;q++){var win = arr[q];this.createWindow(win.id, win.left, win.top, win.width, win.height);if (win.text)this.window(win.id).setText(win.text);if (win.keep_in_viewport)this.window(win.id).keepInViewport(true);if (win.deny_resize)this.window(win.id).denyResize();if (win.deny_park)this.window(win.id).denyPark();if (win.deny_move)this.window(win.id).denyMove();}}});var map={move:"allowMoveA",
 park:"allowParkA",
 resize:"allowResizeA",
 center:"center",
 modal:"setModal",
 caption:"setText",
 header:"showHeader"
 }})();dhtmlx.skin='dhx_skyblue';
window.dhtmlx||(dhtmlx={});dhtmlx.version="3.0";dhtmlx.codebase="./";dhtmlx.extend=function(a,b){for(var c in b)a[c]=b[c];b.g&&a.g();return a};dhtmlx.bind=function(a,b){return function(){return a.apply(b,arguments)}};dhtmlx.require=function(a){if(!dhtmlx.N[a]){dhtmlx.exec(dhtmlx.ajax().sync().get(dhtmlx.codebase+a).responseText);dhtmlx.N[a]=true}};dhtmlx.N={};dhtmlx.exec=function(a){window.execScript?window.execScript(a):window.eval(a)};
dhtmlx.methodPush=function(a,b){return function(){var c=false;return c=a[b].apply(a,arguments)}};dhtmlx.isNotDefined=function(a){return typeof a=="undefined"};dhtmlx.delay=function(a,b,c){setTimeout(function(){var d=a.apply(b,c);a=b=c=null;return d},1)};dhtmlx.uid=function(){if(!this.ca)this.ca=(new Date).valueOf();this.ca++;return this.ca};dhtmlx.toNode=function(a){if(typeof a=="string")return document.getElementById(a);return a};dhtmlx.toArray=function(a){return dhtmlx.extend(a||[],dhtmlx.PowerArray)};
dhtmlx.toFunctor=function(a){return typeof a=="string"?eval(a):a};dhtmlx.h={};dhtmlx.event=function(a,b,c,d){a=dhtmlx.toNode(a);var e=dhtmlx.uid();dhtmlx.h[e]=[a,b,c];if(d)c=dhtmlx.bind(c,d);if(a.addEventListener)a.addEventListener(b,c,false);else a.attachEvent&&a.attachEvent("on"+b,c);return e};dhtmlx.eventRemove=function(a){if(a){var b=dhtmlx.h[a];if(b[0].removeEventListener)b[0].removeEventListener(b[1],b[2],false);else b[0].detachEvent&&b[0].detachEvent("on"+b[1],b[2]);delete this.h[a]}};
dhtmlx.EventSystem={g:function(){this.h={};this.H={};this.B={}},block:function(){this.h.ha=true},unblock:function(){this.h.ha=false},mapEvent:function(a){dhtmlx.extend(this.B,a)},callEvent:function(a,b){if(this.h.ha)return true;a=a.toLowerCase();var c=this.h[a.toLowerCase()],d=true;if(c)for(var e=0;e<c.length;e++)if(c[e].apply(this,b||[])===false)d=false;if(this.B[a]&&!this.B[a].callEvent(a,b))d=false;return d},attachEvent:function(a,b,c){a=a.toLowerCase();c=c||dhtmlx.uid();b=dhtmlx.toFunctor(b);
var d=this.h[a]||dhtmlx.toArray();d.push(b);this.h[a]=d;this.H[c]={f:b,t:a};return c},detachEvent:function(a){var b=this.H[a].t,c=this.H[a].f;b=this.h[b];b.remove(c);delete this.H[a]}};
dhtmlx.PowerArray={removeAt:function(a,b){if(a>=0)this.splice(a,b||1)},remove:function(a){this.removeAt(this.find(a))},insertAt:function(a,b){if(!b&&b!==0)this.push(a);else{var c=this.splice(b,this.length-b);this[b]=a;this.push.apply(this,c)}},find:function(a){for(i=0;i<this.length;i++)if(a==this[i])return i;return-1},each:function(a,b){for(var c=0;c<this.length;c++)a.call(b||this,this[c])},map:function(a,b){for(var c=0;c<this.length;c++)this[c]=a.call(b||this,this[c]);return this}};
if(navigator.userAgent.indexOf("Opera")!=-1)dhtmlx.vb=true;else{dhtmlx.z=!!document.all;dhtmlx.$a=!document.all;dhtmlx.wb=navigator.userAgent.indexOf("KHTML")!=-1;if(navigator.appVersion.indexOf("MSIE 8.0")!=-1&&document.compatMode!="BackCompat")dhtmlx.z=8}dhtmlx.zIndex={drag:1E4};
dhtmlx.html={create:function(a,b,c){b=b||{};var d=document.createElement(a);for(var e in b)d.setAttribute(e,b[e]);if(b.style)d.style.cssText=b.style;if(b["class"])d.className=b["class"];if(c)d.innerHTML=c;return d},getValue:function(a){a=dhtmlx.toNode(a);if(!a)return"";return dhtmlx.isNotDefined(a.value)?a.innerHTML:a.value},remove:function(a){if(a instanceof Array)for(var b=0;b<a.length;b++)this.remove(a[b]);else a&&a.parentNode&&a.parentNode.removeChild(a)},insertBefore:function(a,b,c){if(a)b?b.parentNode.insertBefore(a,
b):c.appendChild(a)},locate:function(a,b){a=a||event;for(var c=a.target||a.srcElement;c;){if(c.getAttribute){var d=c.getAttribute(b);if(d)return d}c=c.parentNode}return null},offset:function(a){if(a.getBoundingClientRect){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,g=window.pageXOffset||d.scrollLeft||c.scrollLeft,i=d.clientTop||c.clientTop||0,l=d.clientLeft||c.clientLeft||0,j=b.top+e-i,m=b.left+g-l;return{y:Math.round(j),
x:Math.round(m)}}else{for(m=j=0;a;){j+=parseInt(a.offsetTop,10);m+=parseInt(a.offsetLeft,10);a=a.offsetParent}return{y:j,x:m}}},pos:function(a){a=a||event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};var b=dhtmlx.z&&document.compatMode!="BackCompat"?document.documentElement:document.body;return{x:a.clientX+b.scrollLeft-b.clientLeft,y:a.clientY+b.scrollTop-b.clientTop}},preventEvent:function(a){a&&a.preventDefault&&a.preventDefault();dhtmlx.html.stopEvent(a)},stopEvent:function(a){(a||event).cancelBubble=
true;return false},addCss:function(a,b){a.className+=" "+b},removeCss:function(a,b){a.className=a.className.replace(RegExp(b,"g"),"")}};(function(){var a=document.getElementsByTagName("SCRIPT");if(a.length){a=(a[a.length-1].getAttribute("src")||"").split("/");a.splice(a.length-1,1);dhtmlx.codebase=a.slice(0,a.length).join("/")+"/"}})();dhtmlx.ui={};
dhtmlx.Template={T:{},empty:function(){return""},setter:function(a,b){return dhtmlx.Template.fromHTML(b)},obj_setter:function(a,b){var c=dhtmlx.Template.setter(a,b),d=this;return function(){return c.apply(d,arguments)}},fromHTML:function(a){if(typeof a=="function")return a;if(this.T[a])return this.T[a];a=(a||"").toString();a=a.replace(/[\r\n]+/g,"\\n");a=a.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"');a=a.replace(/\{common\.([^}\(]*)\}/g,'"+common.$1+"');a=a.replace(/\{common\.([^\}\(]*)\(\)\}/g,
'"+(common.$1?common.$1(obj):"")+"');a=a.replace(/\{obj\.([^}]*)\}/g,'"+obj.$1+"');a=a.replace(/#([a-z0-9_]+)#/gi,'"+obj.$1+"');a=a.replace(/\{obj\}/g,'"+obj+"');a=a.replace(/\{-obj/g,"{obj");a=a.replace(/\{-common/g,"{common");a='return "'+a+'";';return this.T[a]=Function("obj","common",a)}};
dhtmlx.Type={add:function(a,b){if(!a.types&&a.prototype.types)a=a.prototype;var c=b.name||"default";this.ea(b);this.ea(b,"edit");this.ea(b,"loading");a.types[c]=dhtmlx.extend(dhtmlx.extend({},a.types[c]||this.Qa),b);return c},Qa:{css:"default",template:function(){return""},template_edit:function(){return""},template_loading:function(){return"..."},width:150,height:80,margin:5,padding:0},ea:function(a,b){b="template"+(b?"_"+b:"");var c=a[b];if(c&&typeof c=="string"){if(c.indexOf("->")!=-1){c=c.split("->");
switch(c[0]){case "html":c=dhtmlx.html.getValue(c[1]).replace(/\"/g,'\\"');break;case "http":c=(new dhtmlx.ajax).sync().get(c[1],{uid:(new Date).valueOf()}).responseText;break;default:break}}a[b]=dhtmlx.Template.fromHTML(c)}}};
dhtmlx.Settings={g:function(){this.a=this.config=[];this.a.sort=null},define:function(a,b){if(typeof a=="object")return this.Fa(a);return this.la(a,b)},la:function(a,b){var c=this[a+"_setter"];return this.a[a]=c?c.call(this,a,b):b},Fa:function(a){if(a)for(var b in a)this.la(b,a[b])},O:function(a,b){var c=dhtmlx.extend({},b);typeof a=="object"&&!a.tagName&&dhtmlx.extend(c,a);this.Fa(c)},v:function(a,b){for(var c in b)switch(typeof a[c]){case "object":a[c]=this.v(a[c]||{},b[c]);break;case "undefined":a[c]=
b[c];break;default:break}return a},$:function(a,b,c){if(typeof a=="object"&&!a.tagName)a=a.container;this.b=dhtmlx.toNode(a);if(!this.b&&c)this.b=c(a);this.b.className+=" "+b;this.b.onselectstart=function(){return false};this.c=this.b},qb:function(a){if(typeof a=="object")return this.type_setter("type",a);this.type=dhtmlx.extend({},this.types[a]);this.customize()},customize:function(a){a&&dhtmlx.extend(this.type,a);this.type.ya=dhtmlx.Template.fromHTML(this.template_item_start(this.type));this.type.xa=
this.template_item_end(this.type);this.render()},type_setter:function(a,b){this.qb(typeof b=="object"?dhtmlx.Type.add(this,b):b);return b},template_setter:function(a,b){return this.type_setter("type",{template:b})},css_setter:function(a,b){this.b.className+=" "+b;return b}};
dhtmlx.Destruction={g:function(){dhtmlx.destructors.push(this)},destructor:function(){this.destructor=function(){};this.u=this.d=null;this.l&&document.body.appendChild(this.l);this.l=null;if(this.b){this.b.innerHTML="";this.b.d=null}this.data=this.b=this.c=null;this.h=this.H={}}};dhtmlx.destructors=[];
dhtmlx.event(window,"unload",function(){for(var a=0;a<dhtmlx.destructors.length;a++)dhtmlx.destructors[a].destructor();dhtmlx.destructors=[];for(var b in dhtmlx.h){a=dhtmlx.h[b];if(a[0].removeEventListener)a[0].removeEventListener(a[1],a[2],false);else a[0].detachEvent&&a[0].detachEvent("on"+a[1],a[2]);delete dhtmlx.h[b]}});
dhtmlx.ui.pager=function(a){this.name="Pager";dhtmlx.extend(this,dhtmlx.Settings);this.$(a,"dhx_pager");dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.SingleRender);dhtmlx.extend(this,dhtmlx.MouseEvents);this.O(a,{size:10,page:-1,group:5,count:0,type:"default"});this.data=this.a;this.refresh()};
dhtmlx.ui.pager.prototype={j:"dhx_p_id",ub:{dhx_pager_item:function(a,b){this.select(b)}},select:function(a){switch(a){case "next":a=this.a.page+1;break;case "prev":a=this.a.page-1;break;case "first":a=0;break;case "last":a=this.a.limit-1;break;default:break}if(a<0)a=0;if(a>=this.data.limit)a=this.data.limit-1;if(this.callEvent("onBeforePageChange",[this.a.page,a])){this.data.page=a*1;this.refresh();this.callEvent("onAfterPageChange",[a])}},types:{"default":{template:dhtmlx.Template.fromHTML("{common.pages()}"),
pages:function(a){var b="";if(a.page==-1)return"";a.min=a.page-Math.round((a.group-1)/2);a.max=a.min+a.group-1;if(a.min<0){a.max+=a.min*-1;a.min=0}if(a.max>=a.limit){a.min-=Math.min(a.min,a.max-a.limit+1);a.max=a.limit-1}for(var c=a.min||0;c<=a.max;c++)b+=this.button({id:c,index:c+1,selected:c==a.page?"_selected":""});return b},page:function(a){return a.page+1},first:function(){return this.button({id:"first",index:" &lt;&lt; ",selected:""})},last:function(){return this.button({id:"last",index:" &gt;&gt; ",
selected:""})},prev:function(){return this.button({id:"prev",index:"&lt;",selected:""})},next:function(){return this.button({id:"next",index:"&gt;",selected:""})},button:dhtmlx.Template.fromHTML("<div dhx_p_id='{obj.id}' class='dhx_pager_item{obj.selected}'>{obj.index}</div>")}},refresh:function(){var a=this.a;a.limit=Math.ceil(a.count/a.size);if(a.limit&&a.limit!=a.old_limit)a.page=Math.min(a.limit-1,a.page);var b=a.page;if(b!=-1&&b!=a.old_page||a.limit!=a.old_limit){this.render();this.callEvent("onRefresh",
[]);a.old_limit=a.limit;a.old_page=a.page}},template_item_start:dhtmlx.Template.fromHTML("<div>"),template_item_end:dhtmlx.Template.fromHTML("</div>")};dhtmlx.SingleRender={g:function(){},D:function(a){return this.type.ya(a,this.type)+this.type.template(a,this.type)+this.type.xa},render:function(){if(!this.callEvent||this.callEvent("onBeforeRender",[this.data])){if(this.data)this.c.innerHTML=this.D(this.data);this.callEvent&&this.callEvent("onAfterRender",[])}}};
dhtmlx.ui.Tooltip=function(a){this.name="Tooltip";this.version="3.0";if(typeof a=="string")a={template:a};dhtmlx.extend(this,dhtmlx.Settings);dhtmlx.extend(this,dhtmlx.SingleRender);this.O(a,{type:"default",dy:0,dx:20});this.c=this.b=document.createElement("DIV");this.b.className="dhx_tooltip";dhtmlx.html.insertBefore(this.b,document.body.firstChild)};
dhtmlx.ui.Tooltip.prototype={show:function(a,b){if(this.data!=a){this.data=a;this.render(a)}this.b.style.top=b.y+this.a.dy+"px";this.b.style.left=b.x+this.a.dx+"px";this.b.style.display="block"},hide:function(){this.data=null;this.b.style.display="none"},types:{"default":dhtmlx.Template.fromHTML("{obj.id}")},template_item_start:dhtmlx.Template.empty,template_item_end:dhtmlx.Template.empty};
dhtmlx.AutoTooltip={tooltip_setter:function(a,b){var c=new dhtmlx.ui.Tooltip(b);this.attachEvent("onMouseMove",function(d,e){c.show(this.get(d),dhtmlx.html.pos(e))});this.attachEvent("onMouseOut",function(){c.hide()});this.attachEvent("onMouseMoving",function(){c.hide()});return c}};dhtmlx.compat=function(a,b){dhtmlx.compat[a]&&dhtmlx.compat[a](b)};
(function(){if(!window.dhtmlxError){var a=function(){};window.dhtmlxError={catchError:a,throwError:a};window.convertStringToBoolean=function(c){return!!c};window.dhtmlxEventable=function(c){dhtmlx.extend(c,dhtmlx.EventSystem)};var b={getXMLTopNode:function(){},doXPath:function(c){return dhtmlx.DataDriver.xml.xpath(this.xml,c)},xmlDoc:{responseXML:true}};dhtmlx.compat.dataProcessor=function(c){var d="_sendData",e="_in_progress",g="_tMode",i="_waitMode";c[d]=function(l,j){if(l){if(j)this[e][j]=(new Date).valueOf();
if(!this.callEvent("onBeforeDataSending",j?[j,this.getState(j)]:[]))return false;var m=this,p=this.serverProcessor;this[g]!="POST"?dhtmlx.ajax().get(p+(p.indexOf("?")!=-1?"&":"?")+this.serialize(l,j),"",function(q,n){b.xml=dhtmlx.DataDriver.xml.checkResponse(q,n);m.afterUpdate(m,null,null,null,b)}):dhtmlx.ajax().post(p,this.serialize(l,j),function(q,n){b.xml=dhtmlx.DataDriver.xml.checkResponse(q,n);m.afterUpdate(m,null,null,null,b)});this[i]++}}}}})();
dhtmlx.DataProcessor={Ra:function(a){var b="_methods";a[b]=["setItemStyle","","changeId","remove"];this.attachEvent("onAfterAdd",function(c){a.setUpdated(c,true,"inserted")});this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(c,d){c.getUserData&&c.getUserData(d,this.ga)},this));this.attachEvent("onBeforeDelete",function(c){var d=a.getState(c);if(d=="inserted"){a.setUpdated(c,false);return true}if(d=="deleted")return false;if(d=="true_deleted")return true;a.setUpdated(c,true,"deleted");return false});
this.attachEvent("onAfterEditStop",function(c){a.setUpdated(c,true,"updated")});b="_getRowData";a[b]=function(c){c=this.obj.data.get(c);var d={};for(var e in c)if(e.indexOf("_")!==0)d[e]=c[e];return d};b="_clearUpdateFlag";a[b]=function(){};this.ga={};a.attachEvent("insertCallback",this.ma);a.attachEvent("updateCallback",this.ma);a.attachEvent("deleteCallback",function(c,d){this.obj.setUserData(d,this.action_param,"true_deleted");this.obj.remove(d)});dhtmlx.compat("dataProcessor",a)},ma:function(a,
b){this.obj.data.set(b,dhtmlx.DataDriver.xml.getDetails(a.firstChild));this.obj.data.refresh(b)},setItemStyle:function(a,b){if(a=this.m(a))a.style.cssText+=";"+b},changeId:function(a,b){this.data.order[this.data.indexById(a)]=b;this.data.pull[b]=this.data.pull[a];this.data.get(b).id=b;delete this.data.pull[a];this.data.refresh()},setUserData:function(a,b,c){if(a)this.data.get(a)[b]=c;else this.ga[b]=c},getUserData:function(a,b){return a?this.data.get(a)[b]:this.ga[b]}};
(function(){var a="_dp_init";dhtmlx.DataProcessor[a]=dhtmlx.DataProcessor.Ra})();
dhtmlx.compat.dnd=function(){if(window.dhtmlDragAndDropObject){var a="_dragged",b=dhtmlDragAndDropObject.prototype.checkLanding;dhtmlDragAndDropObject.prototype.checkLanding=function(j,m,p){b.apply(this,arguments);if(!p){dhtmlx.DragControl.o=dhtmlx.DragControl.o||{};dhtmlx.DragControl.K(j,m,true)}};var c=dhtmlDragAndDropObject.prototype.stopDrag;dhtmlDragAndDropObject.prototype.stopDrag=function(j,m,p){if(!p)if(dhtmlx.DragControl.i){dhtmlx.DragControl.n=d.dragStartNode;dhtmlx.DragControl.R(j,true)}c.apply(this,
arguments)};var d=new dhtmlDragAndDropObject,e=dhtmlx.DragControl.da;dhtmlx.DragControl.da=function(){e.apply(this,arguments);var j=dhtmlx.DragControl.o;if(j){for(var m=[],p=[],q=0;q<j.source.length;q++){m[q]={idd:j.source[q]};p.push(j.source[q])}d.dragStartNode={parentNode:{},parentObject:{idd:m,id:p.length==1?p[0]:p,treeNod:{object:j.from}}};d.dragStartNode.parentObject.treeNod[a]=m;d.dragStartObject=j.from}};var g=dhtmlx.DragControl.K;dhtmlx.DragControl.K=function(j,m,p){g.apply(this,arguments);
if(!this.i&&!p)j=d.checkLanding(j,m,true)};var i=dhtmlx.DragControl.R;dhtmlx.DragControl.R=function(j,m){i.apply(this,arguments);d.lastLanding&&!m&&d.stopDrag(j,false,true)};var l=dhtmlx.DragControl.getMaster;dhtmlx.DragControl.getMaster=function(j){var m=null;if(j)m=l.apply(this,arguments);if(!m){m=d.dragStartObject;for(var p=[],q=m[a],n=0;n<q.length;n++)p.push(q[n].idd||q[n].id);dhtmlx.DragControl.o.source=p}return m}}};
dhtmlx.DataMove={g:function(){},copy:function(a,b,c,d){var e=this.get(a);if(e){if(c)e=c.externalData(e);c=c||this;return c.add(c.externalData(e,d),b)}},move:function(a,b,c,d){if(a instanceof Array)for(d=0;d<a.length;d++){var e=(c||this).indexById(this.move(a[d],b,c,dhtmlx.uid()));if(a[d+1])b=e+(this.indexById(a[d+1])<e?0:1)}else{nid=a;if(!(b<0)){var g=this.get(a);if(g){if(!c||c==this)this.data.move(this.indexById(a),b);else{nid=c.add(c.externalData(g,d),b);this.remove(a)}return nid}}}},moveUp:function(a,
b){return this.move(a,this.indexById(a)-(b||1))},moveDown:function(a,b){return this.moveUp(a,(b||1)*-1)},moveTop:function(a){return this.move(a,0)},moveBottom:function(a){return this.move(a,this.data.dataCount()-1)},externalData:function(a,b){var c=dhtmlx.extend({},a);c.id=b||dhtmlx.uid();c.$selected=c.$template=null;return c}};
dhtmlx.DragControl={r:dhtmlx.toArray(["dummy"]),addDrop:function(a,b,c){a=dhtmlx.toNode(a);a.dhx_drop=this.sa(b);if(c)a.dhx_master=true},sa:function(a){a=a||dhtmlx.DragControl;var b=this.r.find(a);if(b<0){b=this.r.length;this.r.push(a)}return b},addDrag:function(a,b){a=dhtmlx.toNode(a);a.dhx_drag=this.sa(b);dhtmlx.event(a,"mousedown",this.kb,a)},kb:function(a){if(dhtmlx.DragControl.n){dhtmlx.DragControl.aa();dhtmlx.DragControl.destroyDrag()}dhtmlx.DragControl.n=this;dhtmlx.DragControl.F=dhtmlx.event(document.body,
"mousemove",dhtmlx.DragControl.da);dhtmlx.DragControl.G=dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl.aa);a.cancelBubble=true;return false},aa:function(){dhtmlx.DragControl.F=dhtmlx.eventRemove(dhtmlx.DragControl.F);dhtmlx.DragControl.G=dhtmlx.eventRemove(dhtmlx.DragControl.G)},da:function(a){dhtmlx.DragControl.aa();if(dhtmlx.DragControl.createDrag(a)){dhtmlx.DragControl.sendSignal("start");dhtmlx.DragControl.F=dhtmlx.event(document.body,"mousemove",dhtmlx.DragControl.Ba);dhtmlx.DragControl.G=
dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl.R);dhtmlx.DragControl.Ba(a)}},R:function(a){dhtmlx.DragControl.F=dhtmlx.eventRemove(dhtmlx.DragControl.F);dhtmlx.DragControl.G=dhtmlx.eventRemove(dhtmlx.DragControl.G);if(dhtmlx.DragControl.i){dhtmlx.DragControl.onDrop(dhtmlx.DragControl.n,dhtmlx.DragControl.i,this.A,a);dhtmlx.DragControl.onDragOut(dhtmlx.DragControl.n,dhtmlx.DragControl.i,null,a)}dhtmlx.DragControl.destroyDrag();dhtmlx.DragControl.sendSignal("stop")},Ba:function(a){var b=dhtmlx.html.pos(a);
dhtmlx.DragControl.l.style.top=b.y+dhtmlx.DragControl.top+"px";dhtmlx.DragControl.l.style.left=b.x+dhtmlx.DragControl.left+"px";if(dhtmlx.DragControl.Ia)dhtmlx.DragControl.Ia=false;else dhtmlx.DragControl.K(a.srcElement||a.target,a);a.cancelBubble=true;return false},K:function(a,b){for(;a&&a.tagName!="BODY";){if(a.dhx_drop){if(this.i&&(this.i!=a||a.dhx_master))this.onDragOut(this.n,this.i,a,b);if(!this.i||this.i!=a||a.dhx_master){this.i=null;if(this.A=this.onDragIn(dhtmlx.DragControl.n,a,b))this.i=
a;return}return}a=a.parentNode}if(this.i)this.i=this.A=this.onDragOut(this.n,this.i,null,b)},sendSignal:function(a){dhtmlx.DragControl.active=a=="start"},getMaster:function(a){return this.r[a.dhx_drag||a.dhx_drop]},getContext:function(){return this.o},createDrag:function(a){var b=document.createElement("DIV"),c=dhtmlx.DragControl.n;if(c.dhx_drag&&c.dhx_drag.onCreateDrag){var d=dhtmlx.DragControl.l;d=c.dhx_drag.onCreateDrag(c,a);d.style.position="absolute";d.style.zIndex=dhtmlx.zIndex.drag;d.onmousemove=
dhtmlx.DragControl.Ja;return true}d=dhtmlx.DragControl.onDrag(c,a);if(!d)return false;b.innerHTML=d;b.className="dhx_drag_zone";b.onmousemove=dhtmlx.DragControl.Ja;document.body.appendChild(b);dhtmlx.DragControl.l=b;return true},Ja:function(){dhtmlx.DragControl.Ia=true},destroyDrag:function(){var a=dhtmlx.DragControl.n;a.dhx_drag&&a.dhx_drag.onDestroyDrag?a.dhx_drag.onDestroyDrag(a,dhtmlx.DragControl.l):dhtmlx.html.remove(dhtmlx.DragControl.l);dhtmlx.DragControl.A=dhtmlx.DragControl.n=dhtmlx.DragControl.i=
dhtmlx.DragControl.l=null},top:5,left:5,onDragIn:function(a,b,c){var d=this.r[b.dhx_drop];if(d.onDragIn&&d!=this)return d.onDragIn(a,b,c);b.className+=" dhx_drop_zone";return b},onDragOut:function(a,b,c,d){var e=this.r[b.dhx_drop];if(e.onDragOut&&e!=this)return e.onDragOut(a,b,c,d);b.className=b.className.replace("dhx_drop_zone","");return null},onDrop:function(a,b,c,d){var e=this.r[b.dhx_drop];if(e.onDrop&&e!=this)return e.onDrop(a,b,c,d);b.appendChild(a)},onDrag:function(a,b){var c=this.r[a.dhx_drag];
if(c.onDrag&&c!=this)return c.onDrag(a,b);dhtmlx.DragControl.o={source:a,from:a};return"<div style='"+a.style.cssText+"'>"+a.innerHTML+"</div>"}};
dhtmlx.DragItem={g:function(){if(!this.a||this.a.drag)dhtmlx.DragItem.wa(this);else if(this.a)this.drag_setter=function(a,b){if(b){this.wa(this);delete this.drag_setter}return b};if(this.dragMarker){this.attachEvent("onBeforeDragIn",this.dragMarker);this.attachEvent("onDragOut",this.dragMarker)}},wa:function(a){dhtmlx.DragControl.addDrop(a.b,a,true);dhtmlx.DragControl.addDrag(a.b,a)},onDragIn:function(a,b,c){b=this.locate(c)||null;var d=dhtmlx.DragControl.o,e=dhtmlx.DragControl.getMaster(a);a=this.m(b)||
this.b;if(a==dhtmlx.DragControl.A)return a;d.target=b;d.to=e;if(!this.callEvent("onBeforeDragIn",[d,c]))return d.id=null;dhtmlx.html.addCss(a,"dhx_drag_over");return a},onDragOut:function(a,b,c,d){a=this.locate(d)||null;c=this.m(a)||(c?dhtmlx.DragControl.getMaster(c).b:window.undefined);if(c==dhtmlx.DragControl.A)return null;c=dhtmlx.DragControl.o;dhtmlx.html.removeCss(dhtmlx.DragControl.A,"dhx_drag_over");c.target=c.to=null;this.callEvent("onDragOut",[c,d]);return null},onDrop:function(a,b,c,d){b=
dhtmlx.DragControl.o;b.from=dhtmlx.DragControl.getMaster(a);b.to=this;b.index=b.target?this.indexById(b.target):this.dataCount();b.new_id=dhtmlx.uid();if(this.callEvent("onBeforeDrop",[b,d])){if(b.from==b.to)this.move(b.source,b.index);else b.from&&b.from.move(b.source,b.index,b.to,b.new_id);this.callEvent("onAfterDrop",[b,d])}},onDrag:function(a,b){a=this.locate(b);var c=[a];if(a){if(this.getSelected){var d=this.getSelected();if(dhtmlx.PowerArray.find.call(d,a)!=-1)c=d}var e=dhtmlx.DragControl.o=
{source:c,start:a};e.from=this;if(this.callEvent("onBeforeDrag",[e,b]))return e.html||this.D(this.get(a))}return null}};
dhtmlx.EditAbility={g:function(){this.L=this.p=null;this.attachEvent("onEditKeyPress",function(a,b,c){if(a==13&&!c)this.stopEdit();else a==27&&this.stopEdit(true)});this.attachEvent("onBeforeRender",function(){this.stopEdit()})},isEdit:function(){return this.p},edit:function(a){if(this.stopEdit(false,a))if(this.callEvent("onBeforeEditStart",[a])){var b=this.data.get(a);if(!b.$template){b.$template="edit";this.data.refresh(a);this.p=a;this.pb(a);this.L(true,b);this.callEvent("onAfterEditStart",[a])}}},
stopEdit:function(a,b){if(!this.p)return true;if(this.p==b)return false;if(!this.callEvent("onBeforeEditStop",[this.p]))return false;var c=this.data.get(this.p);c.$template=null;a||this.L(false,c);a=this.p;this.L=this.p=null;this.data.refresh(a);this.callEvent("onAfterEditStop",[a]);return true},pb:function(a){var b=this.m(a),c="",d="",e=[];if(b){var g=b.getElementsByTagName("*"),i="";for(a=0;a<g.length;a++)if(g[a].nodeType==1&&(i=g[a].getAttribute("bind"))){c+="els["+e.length+"].value="+i+";";d+=
i+"=els["+e.length+"].value;";e.push(g[a]);g[a].className+=" dhx_allow_selection";g[a].onselectstart=this.Na}g=null}c=Function("obj","els",c);d=Function("obj","els",d);this.L=function(l,j){if(l){c(j,e);e.length&&e[0].select&&e[0].select()}else d(j,e)}},Na:function(a){return(a||event).cancelBubble=true}};
dhtmlx.KeyEvents={g:function(){dhtmlx.event(this.b,"keypress",this.gb,this)},gb:function(a){a=a||event;var b=a.which||a.keyCode;this.callEvent(this.p?"onEditKeyPress":"onKeyPress",[b,a.ctrlKey,a.shiftKey,a])}};
dhtmlx.MouseEvents={g:function(){if(this.on_click){dhtmlx.event(this.b,"click",this.db,this);dhtmlx.event(this.b,"contextmenu",this.eb,this)}this.on_dblclick&&dhtmlx.event(this.b,"dblclick",this.fb,this);if(this.on_mouse_move){dhtmlx.event(this.b,"mousemove",this.Ea,this);dhtmlx.event(this.b,dhtmlx.z?"mouseleave":"mouseout",this.Ea,this)}},db:function(a){return this.Z(a,this.on_click,"ItemClick")},fb:function(a){return this.Z(a,this.on_dblclick,"ItemDblClick")},eb:function(a){var b=dhtmlx.html.locate(a,
this.j);if(b&&!this.callEvent("onBeforeContextMenu",[b,a]))return dhtmlx.html.preventEvent(a)},Ea:function(a){if(dhtmlx.z)a=document.createEventObject(event);this.Aa&&window.clearTimeout(this.Aa);this.callEvent("onMouseMoving",[a]);this.Aa=window.setTimeout(dhtmlx.bind(function(){a.type=="mousemove"?this.hb(a):this.ib(a)},this),500)},hb:function(a){this.Z(a,this.on_mouse_move,"MouseMove")||this.callEvent("onMouseOut",[a||event])},ib:function(a){this.callEvent("onMouseOut",[a||event])},Z:function(a,
b,c){a=a||event;for(var d=a.target||a.srcElement,e="",g=null,i=false;d&&d.parentNode;){if(!i&&d.getAttribute)if(g=d.getAttribute(this.j)){if(!this.callEvent("on"+c,[g,a,d]))return;i=true}if(e=d.className){e=e.split(" ");e=e[0]||e[1];if(b[e])return b[e].call(this,a,g,d)}d=d.parentNode}return i}};
dhtmlx.SelectionModel={g:function(){this.e=dhtmlx.toArray();this.data.attachEvent("onStoreUpdated",dhtmlx.bind(this.Pa,this))},Pa:function(a,b,c){if(c=="delete")this.e.remove(a);else if(!this.data.dataCount())this.e=dhtmlx.toArray()},P:function(a,b,c){if(!c&&!this.callEvent("onBeforeSelect",[a,b]))return false;this.data.get(a).$selected=b;c?c.push(a):this.ba(a);return true},select:function(a,b,c){if(!a)return this.selectAll();if(a instanceof Array)for(var d=0;d<a.length;d++)this.select(a[d],b,c);
else{if(c&&this.e.length)return this.selectAll(this.e[this.e.length-1],a);if(!b&&(this.e.length!=1||this.e[0]!=a))this.unselectAll();if(this.isSelected(a))b&&this.unselect(a);else if(this.P(a,true)){this.e.push(a);this.callEvent("onAfterSelect",[a])}}},unselect:function(a){if(!a)return this.unselectAll();this.isSelected(a)&&this.P(a,false)&&this.e.remove(a)},selectAll:function(a,b){var c,d=[];c=a||b?this.data.getRange(a,b):this.data.getRange();c.each(function(e){var g=this.data.get(e.id);if(!g.$selected){this.e.push(e.id);
this.P(e.id,true,d)}return e.id},this);this.ba(d)},unselectAll:function(){var a=[];this.e.each(function(b){this.P(b,false,a)},this);this.e=dhtmlx.toArray();this.ba(a)},isSelected:function(a){return this.e.find(a)!=-1},getSelected:function(a){switch(this.e.length){case 0:return a?[]:"";case 1:return a?[this.e[0]]:this.e[0];default:return[].concat(this.e)}},ab:function(a){return a.length>100||a.length>this.data.dataCount/2},ba:function(a){if(typeof a!="object")a=[a];if(a.length){if(this.ab(a))this.data.refresh();
else for(var b=0;b<a.length;b++)this.render(a[b],this.data.get(a[b]),"update");this.callEvent("onSelectChange",[a])}}};
dhtmlx.RenderStack={g:function(){this.l=document.createElement("DIV")},D:function(a){this.callEvent("onItemRender",[a]);return this.type.ya(a,this.type)+(a.$template?this.type["template_"+a.$template]:this.type.template)(a,this.type)+this.type.xa},fa:function(a){this.l.innerHTML=this.D(a);return this.l.firstChild},m:function(a){if(this.d)return this.d[a];this.d={};for(var b=this.c.childNodes,c=0;c<b.length;c++){var d=b[c].getAttribute(this.j);if(d)this.d[d]=b[c]}return this.m(a)},locate:function(a){return dhtmlx.html.locate(a,
this.j)},show:function(a){if(a=this.m(a))this.c.scrollTop=a.offsetTop-this.c.offsetTop},render:function(a,b,c){if(a){var d=this.m(a);switch(c){case "update":if(!d)return;b=this.d[a]=this.fa(b);dhtmlx.html.insertBefore(b,d);dhtmlx.html.remove(d);break;case "delete":if(!d)return;dhtmlx.html.remove(d);delete this.d[a];break;case "add":b=this.d[a]=this.fa(b);dhtmlx.html.insertBefore(b,this.m(this.data.next(a)),this.c);break;case "move":this.render(a,b,"delete");this.render(a,b,"add");break;default:break}}else if(this.callEvent("onBeforeRender",
[this.data])){this.c.innerHTML=this.data.getRange().map(this.D,this).join("");this.d=null;this.callEvent("onAfterRender",[])}},pager_setter:function(a,b){this.attachEvent("onBeforeRender",function(){var e=this.a.pager.a;if(e.page==-1)return false;this.data.min=e.page*e.size;this.data.max=(e.page+1)*e.size-1;return true});var c=new dhtmlx.ui.pager(b),d=dhtmlx.bind(function(){this.data.refresh()},this);c.attachEvent("onRefresh",d);this.data.attachEvent("onStoreUpdated",function(){var e=this.dataCount();
if(e!=c.a.count){c.a.count=e;if(c.a.page==-1)c.a.page=0;c.refresh()}});return c},height_setter:function(a,b){if(b=="auto"){this.attachEvent("onAfterRender",this.ia);dhtmlx.event(window,"resize",dhtmlx.bind(this.ia,this))}return b},ia:function(){this.c.style.overflow="hidden";this.c.style.height="1px";var a=this.c.scrollHeight;this.c.style.height=a+"px";if(dhtmlx.$a){var b=this.c.scrollHeight;if(b!=a)this.c.style.height=b+"px"}this.b.style.height=this.c.style.height},X:function(){var a=this.type,b=
(a.border||0)+(a.padding||0)*2+(a.margin||0)*2;return{x:a.width+b,y:a.height+b}},x_count_setter:function(a,b){var c=this.X();this.c.style.width=c.x*b+(this.a.height!="auto"?18:0)+"px";return b},y_count_setter:function(a,b){a=this.X();this.c.style.height=a.y*b+"px";return b}};
dhtmlx.VirtualRenderStack={g:function(){this.d={};this.c.style.overflowY="scroll";dhtmlx.event(this.c,"scroll",dhtmlx.bind(this.Ha,this));dhtmlx.event(window,"resize",dhtmlx.bind(function(){this.render()},this));this.I=[];this.attachEvent("onItemRender",function(a){a.$template=="loading"&&this.I.push(this.data.id(a))})},m:function(a){return this.d[a]},show:function(a){range=this.ua();var b=this.data.indexById(a),c=Math.floor(b/range.W)*range.S;this.c.scrollTop=c},render:function(a,b,c){if(a){var d=
this.m(a);switch(c){case "update":if(!d)return;a=this.d[a]=this.fa(b);dhtmlx.html.insertBefore(a,d);dhtmlx.html.remove(d);break;default:this.nb();break}}else if(this.callEvent("onBeforeRender",[this.data])){this.d={};this.Ha(null,true);this.La=false;this.callEvent("onAfterRender",[])}},nb:function(){if(!this.La){this.La=true;window.setTimeout(dhtmlx.bind(function(){this.render()},this),1)}},U:function(a){var b=document.createElement("DIV");b.style.cssText="height:"+a+"px; width:100%; overflow:hidden;";
return b},Ha:function(a,b){this.I=[];var c=this.ua();if(!this.c.firstChild||b){this.c.innerHTML="";this.c.appendChild(this.U(c.cb));this.u=[this.c.firstChild]}for(a=c.s;a<=c.Y;){for(;this.u[a]&&this.u[a].Va&&a<=c.Y;)a++;if(a>c.Y)break;for(var d=a;!this.u[d];)d--;var e=this.u[d],g=a*c.W+(this.data.min||0);if(g>(this.data.max||Infinity))break;var i=Math.min(g+c.W-1,this.data.max||Infinity),l=this.U(c.S),j=this.data.getIndexRange(g,i);if(!j.length)break;l.innerHTML=j.map(this.D,this).join("");for(var m=
0;m<j.length;m++)this.d[this.data.idByIndex(g+m)]=l.childNodes[m];var p=parseInt(e.style.height,10),q=(a-d)*c.S,n=p-q-c.S;dhtmlx.html.insertBefore(l,q?e.nextSibling:e,this.c);this.u[a]=l;l.Va=true;if(q<=0&&n>0){e.style.height=n+"px";this.u[a+1]=e}else{if(q<0)dhtmlx.html.remove(e);else e.style.height=q+"px";if(n>0){var w=this.u[a+1]=this.U(n);dhtmlx.html.insertBefore(w,l.nextSibling,this.c)}}a++}if(this.I.length){a=this.indexById(this.I[0]);l=this.indexById(this.I.pop())+1;if(l>a){if(!this.callEvent("onDataRequest",
[a,l-a]))return false;this.data.feed.call(this,a,l-a)}}},ua:function(){var a=this.c.scrollTop,b=Math.max(this.c.scrollWidth,this.c.offsetWidth)-18,c=this.c.offsetHeight,d=this.X(),e=Math.floor(b/d.x)||1,g=Math.floor(a/d.y);c=Math.ceil((c+a)/d.y)-1;var i=this.data.max?this.data.max-this.data.min:this.data.dataCount(),l=Math.ceil(i/e)*d.y;return{s:g,Y:c,xb:a,cb:l,S:d.y,W:e}}};
dhtmlx.DataStore=function(){this.name="DataStore";dhtmlx.extend(this,dhtmlx.EventSystem);this.setDriver("xml");this.pull={};this.order=dhtmlx.toArray()};
dhtmlx.DataStore.prototype={setDriver:function(a){this.driver=dhtmlx.DataDriver[a]},jb:function(a){for(var b=this.driver.getInfo(a),c=this.driver.getRecords(a),d=(b.s||0)*1,e=0,g=0;g<c.length;g++){var i=this.driver.getDetails(c[g]),l=this.id(i);if(!this.pull[l]){this.order[e+d]=l;e++}this.pull[l]=i}for(g=0;g<b.C;g++)if(!this.order[g]){l=dhtmlx.uid();i={id:l,$template:"loading"};this.pull[l]=i;this.order[g]=l}this.callEvent("onStoreLoad",[this.driver,a]);this.refresh()},id:function(a){return a.id||
(a.id=dhtmlx.uid())},get:function(a){return this.pull[a]},set:function(a,b){this.pull[a]=b;this.refresh()},refresh:function(a){a?this.callEvent("onStoreUpdated",[a,this.pull[a],"update"]):this.callEvent("onStoreUpdated",[null,null,null])},getRange:function(a,b){if(arguments.length){a=this.indexById(a);b=this.indexById(b);if(a>b){var c=b;b=a;a=c}}else{a=this.min||0;b=Math.min(this.max||Infinity,this.dataCount()-1)}return this.getIndexRange(a,b)},getIndexRange:function(a,b){b=Math.min(b,this.dataCount()-
1);var c=dhtmlx.toArray();for(a=a;a<=b;a++)c.push(this.get(this.order[a]));return c},dataCount:function(){return this.order.length},exists:function(a){return!!this.pull[a]},move:function(a,b){if(!(a<0||b<0)){var c=this.idByIndex(a),d=this.get(c);this.order.removeAt(a);this.order.insertAt(c,Math.min(this.order.length,b));this.callEvent("onStoreUpdated",[c,d,"move"])}},add:function(a,b){var c=this.id(a),d=this.dataCount();if(dhtmlx.isNotDefined(b)||b<0)b=d;if(b>d)b=Math.min(this.order.length,b);if(this.callEvent("onbeforeAdd",
[c,b])){if(this.exists(c))return null;this.pull[c]=a;this.order.insertAt(c,b);if(this.q){var e=this.q.length;if(!b&&this.order.length)e=0;this.q.insertAt(c,e)}this.callEvent("onafterAdd",[c,b]);this.callEvent("onStoreUpdated",[c,a,"add"]);return c}},remove:function(a){if(a instanceof Array)for(var b=0;b<a.length;b++)this.remove(a[b]);else if(this.callEvent("onbeforedelete",[a])){if(!this.exists(a))return null;b=this.get(a);this.order.remove(a);this.q&&this.q.remove(a);delete this.pull[a];this.callEvent("onafterdelete",
[a]);this.callEvent("onStoreUpdated",[a,b,"delete"])}},clearAll:function(){this.pull={};this.order=dhtmlx.toArray();this.q=null;this.callEvent("onClearAll",[]);this.refresh()},idByIndex:function(a){return this.order[a]},indexById:function(a){return a=this.order.find(a)},next:function(a,b){return this.order[this.indexById(a)+(b||1)]},first:function(){return this.order[0]},last:function(){return this.order[this.order.length-1]},previous:function(a,b){return this.order[this.indexById(a)-(b||1)]},sort:function(a,
b,c){var d=a;if(typeof a=="function")d={as:a,dir:b};else if(typeof a=="string")d={by:a,dir:b,as:c};var e=[d.by,d.dir,d.as];if(this.callEvent("onbeforesort",e)){var g=dhtmlx.sort.create(d),i=this.getRange();i.sort(g);this.order=i.map(function(l){return this.id(l)},this);this.refresh();this.callEvent("onaftersort",e)}},filter:function(a,b){if(this.q){this.order=this.q;delete this.q}if(a){var c=a;if(typeof a=="string"){a=dhtmlx.Template.setter(0,a);c=function(e,g){return a(e).toLowerCase().indexOf(g)!=
-1}}b=(b||"").toString().toLowerCase();var d=dhtmlx.toArray();this.order.each(function(e){c(this.get(e),b)&&d.push(e)},this);this.q=this.order;this.order=d}this.refresh()},each:function(a,b){for(var c=0;c<this.order.length;c++)a.call(b||this,this.get(this.order[c]))},provideApi:function(a,b){b&&this.mapEvent({onbeforesort:a,onaftersort:a,onbeforeadd:a,onafteradd:a,onbeforedelete:a,onafterdelete:a});for(var c=["sort","add","remove","exists","idByIndex","indexById","get","set","refresh","dataCount",
"filter","next","previous","clearAll","first","last"],d=0;d<c.length;d++)a[c[d]]=dhtmlx.methodPush(this,c[d])}};
dhtmlx.sort={create:function(a){return dhtmlx.sort.dir(a.dir,dhtmlx.sort.by(a.by,a.as))},as:{"int":function(a,b){a*=1;b*=1;return a>b?1:a<b?-1:0},string_strict:function(a,b){a=a.toString();b=b.toString();return a>b?1:a<b?-1:0},string:function(a,b){a=a.toString().toLowerCase();b=b.toString().toLowerCase();return a>b?1:a<b?-1:0}},by:function(a,b){if(typeof b!="function")b=dhtmlx.sort.as[b||"string"];a=dhtmlx.Template.setter(0,a);return function(c,d){return b(a(c),a(d))}},dir:function(a,b){if(a=="asc")return b;
return function(c,d){return b(c,d)*-1}}};dhtmlx.ajax=function(a,b,c){if(arguments.length!==0){var d=new dhtmlx.ajax;if(c)d.master=c;d.get(a,null,b)}if(!this.getXHR)return new dhtmlx.ajax;return this};
dhtmlx.ajax.prototype={getXHR:function(){return dhtmlx.z?new ActiveXObject("Microsoft.xmlHTTP"):new XMLHttpRequest},send:function(a,b,c){var d=this.getXHR();if(typeof c=="function")c=[c];if(typeof b=="object"){var e=[];for(var g in b)e.push(g+"="+encodeURIComponent(b[g]));b=e.join("&")}if(b&&!this.post){a=a+(a.indexOf("?")!=-1?"&":"?")+b;b=null}d.open(this.post?"POST":"GET",a,!this.Ka);this.post&&d.setRequestHeader("Content-type","application/x-www-form-urlencoded");if(!this.Ka){var i=this;d.onreadystatechange=
function(){if(!d.readyState||d.readyState==4){if(c&&i)for(var l=0;l<c.length;l++)if(c[l])c[l].call(i.master||i,d.responseText,d.responseXML,d);c=d=i=i.master=null}}}d.send(b||null);return d},get:function(a,b,c){this.post=false;return this.send(a,b,c)},post:function(a,b,c){this.post=true;return this.send(a,b,c)},sync:function(){this.Ka=true;return this}};
dhtmlx.DataLoader={g:function(){this.data=new dhtmlx.DataStore},load:function(a,b,c){this.callEvent("onXLS",[]);if(typeof b=="string"){this.data.setDriver(b);b=c}if(!this.data.feed)this.data.feed=function(d,e){if(this.M)return this.M=[d,e];else this.M=true;this.load(a+(a.indexOf("?")==-1?"?":"&")+"posStart="+d+"&count="+e,function(){var g=this.M;this.M=false;typeof g=="object"&&this.data.feed.apply(this,g)})};dhtmlx.ajax(a,[this.Da,b],this)},parse:function(a,b){this.callEvent("onXLS",[]);b&&this.data.setDriver(b);
this.Da(a,null)},Da:function(a,b){this.data.jb(this.data.driver.toObject(a,b));this.callEvent("onXLE",[])}};dhtmlx.DataDriver={};dhtmlx.DataDriver.json={toObject:function(a){if(typeof a=="string"){eval("dhtmlx.temp="+a);return dhtmlx.temp}return a},getRecords:function(a){if(a&&!(a instanceof Array))return[a];return a},getDetails:function(a){return a},getInfo:function(a){return{C:a.total_count||0,s:a.pos||0}}};
dhtmlx.DataDriver.html={toObject:function(a){if(typeof a=="string"){var b=null;if(a.indexOf("<")==-1)b=dhtmlx.toNode(a);if(!b){b=document.createElement("DIV");b.innerHTML=a}return b.getElementsByTagName(this.tag)}return a},getRecords:function(a){if(a.tagName)return a.childNodes;return a},getDetails:function(a){return dhtmlx.DataDriver.xml.tagToObject(a)},getInfo:function(){return{C:0,s:0}},tag:"LI"};
dhtmlx.DataDriver.jsarray={toObject:function(a){if(typeof a=="string"){eval("dhtmlx.temp="+a);return dhtmlx.temp}return a},getRecords:function(a){return a},getDetails:function(a){for(var b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{C:0,s:0}}};
dhtmlx.DataDriver.csv={toObject:function(a){return a},getRecords:function(a){return a.split(this.row)},getDetails:function(a){a=this.stringToArray(a);for(var b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{C:0,s:0}},stringToArray:function(a){a=a.split(this.cell);for(var b=0;b<a.length;b++)a[b]=a[b].replace(/^[ \t\n\r]*(\"|)/g,"").replace(/(\"|)[ \t\n\r]*$/g,"");return a},row:"\n",cell:","};
dhtmlx.DataDriver.xml={toObject:function(a,b){if(b&&(b=this.checkResponse(a,b)))return b;if(typeof a=="string")return this.fromString(a);return a},getRecords:function(a){return this.xpath(a,this.records)},records:"/*/item",userdata:"/*/userdata",getDetails:function(a){return this.tagToObject(a,{})},getUserData:function(a,b){b=b||{};var c=this.xpath(a,this.userdata);for(a=0;a<c.length;a++){var d=this.tagToObject(c[a]);b[d.name]=d.value}return b},getInfo:function(a){return{C:a.documentElement.getAttribute("total_count")||
0,s:a.documentElement.getAttribute("pos")||0}},xpath:function(a,b){if(window.XPathResult){var c=a;if(a.nodeName.indexOf("document")==-1)a=a.ownerDocument;var d=[];a=a.evaluate(b,c,null,XPathResult.ANY_TYPE,null);for(b=a.iterateNext();b;){d.push(b);b=a.iterateNext()}return d}return a.selectNodes(b)},tagToObject:function(a,b){b=b||{};for(var c=a.attributes,d=0;d<c.length;d++)b[c[d].name]=c[d].value;var e=false,g=a.childNodes;for(d=0;d<g.length;d++)if(g[d].nodeType==1){var i=g[d].tagName;if(typeof b[i]!=
"undefined"){b[i]instanceof Array||(b[i]=[b[i]]);b[i].push(this.tagToObject(g[d],{}))}else b[g[d].tagName]=this.tagToObject(g[d],{});e=true}if(!c.length&&!e)return this.nodeValue(a);b.value=this.nodeValue(a);return b},nodeValue:function(a){if(a.firstChild)return a.firstChild.data;return""},fromString:function(a){if(window.DOMParser)return(new DOMParser).parseFromString(a,"text/xml");if(window.ActiveXObject){temp=new ActiveXObject("Microsoft.xmlDOM");temp.loadXML(a);return temp}},checkResponse:function(a,
b){if(b&&b.firstChild&&b.firstChild.tagName!="parsererror")return b;if(a=this.from_string(a.responseText.replace(/^[\s]+/,"")))return a}};if(!dhtmlx.attaches)dhtmlx.attaches={};
dhtmlx.attaches.attachAbstract=function(a,b){var c=document.createElement("DIV");c.id="CustomObject_"+dhtmlx.uid();c.style.width="100%";c.style.height="100%";c.cmp="grid";document.body.appendChild(c);this.attachObject(c.id);b.container=c.id;var d=this.vs[this.av];d.grid=new window[a](b);d.gridId=c.id;d.gridObj=c;d.grid.setSizes=function(){this.resize?this.resize():this.render()};var e="_viewRestore";return this.vs[this[e]()].grid};
dhtmlx.attaches.attachDataView=function(a){return this.attachAbstract("dhtmlXDataView",a)};dhtmlx.attaches.attachChart=function(a){return this.attachAbstract("dhtmlXChart",a)};dhtmlx.compat.layout=function(){};
dhtmlXDataView=function(a){this.name="DataView";this.version="3.0";dhtmlx.extend(this,dhtmlx.Settings);this.$(a,"dhx_dataview");dhtmlx.extend(this,dhtmlx.DataLoader);dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.RenderStack);dhtmlx.extend(this,dhtmlx.SelectionModel);dhtmlx.extend(this,dhtmlx.MouseEvents);dhtmlx.extend(this,dhtmlx.KeyEvents);dhtmlx.extend(this,dhtmlx.EditAbility);dhtmlx.extend(this,dhtmlx.DataMove);dhtmlx.extend(this,dhtmlx.DragItem);dhtmlx.extend(this,dhtmlx.DataProcessor);
dhtmlx.extend(this,dhtmlx.AutoTooltip);dhtmlx.extend(this,dhtmlx.Destruction);this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render.apply(this,arguments)},this));this.O(a,{drag:false,edit:false,select:"multiselect",type:"default"});this.a.height!="auto"&&dhtmlx.extend(this,dhtmlx.VirtualRenderStack);this.data.provideApi(this,true)};
dhtmlXDataView.prototype={dragMarker:function(a){var b=this.m(a.target);if(this.type.drag_marker){if(this.V){this.V.style.backgroundImage="";this.V.style.backgroundRepeat=""}if(b){b.style.backgroundImage="url("+(dhtmlx.image_path||"")+this.type.drag_marker+")";b.style.backgroundRepeat="no-repeat";this.V=b}}if(b&&this.a.auto_scroll){a=b.offsetTop;var c=b.offsetHeight,d=this.b.scrollTop,e=this.b.offsetHeight;if(a-c>0&&a-c*0.75<d)d=Math.max(a-c,0);else if(a+c/0.75>d+e)d+=c;this.b.scrollTop=d}return true},
j:"dhx_f_id",on_click:{dhx_dataview_item:function(a,b){if(this.stopEdit(false,b))if(this.a.select)this.a.select=="multiselect"?this.select(b,a.ctrlKey,a.shiftKey):this.select(b)}},on_dblclick:{dhx_dataview_item:function(a,b){this.a.edit&&this.edit(b)}},on_mouse_move:{},types:{"default":{css:"default",template:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'>{obj.text}</div>"),template_edit:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'><textarea style='width:100%; height:100%;' bind='obj.text'></textarea></div>"),
template_loading:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'>Loading...</div>"),width:210,height:115,margin:0,padding:10,border:1}},template_item_start:dhtmlx.Template.fromHTML("<div dhx_f_id='{-obj.id}' class='dhx_dataview_item dhx_dataview_{obj.css}_item{-obj.$selected?_selected:}' style='width:{obj.width}px; height:{obj.height}px; padding:{obj.padding}px; margin:{obj.margin}px; float:left; overflow:hidden;'>"),template_item_end:dhtmlx.Template.fromHTML("</div>")};
dhtmlx.compat("layout");dhtmlx.math={};dhtmlx.math.tb=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];dhtmlx.math.toHex=function(a,b){a=parseInt(a,10);for(str="";a>0;){str=this.tb[a%16]+str;a=Math.floor(a/16)}for(;str.length<b;)str="0"+str;return str};dhtmlx.ui.Map=function(a){this.name="Map";this.j="map_"+dhtmlx.uid();this.bb=a;this.B=[]};
dhtmlx.ui.Map.prototype={addRect:function(a,b){this.ka(a,"RECT",b)},addPoly:function(a,b){this.ka(a,"POLY",b)},ka:function(a,b,c){this.B.push("<area "+this.bb+"='"+a+"' shape='"+b+"' coords='"+c.join()+"'></area>")},addSector:function(a,b,c,d,e,g,i){var l=[];l.push(d);l.push(Math.floor(e*i));for(var j=b;j<c;j+=Math.PI/18){l.push(Math.floor(d+g*Math.cos(j)));l.push(Math.floor((e+g*Math.sin(j))*i))}l.push(Math.floor(d+g*Math.cos(c)));l.push(Math.floor((e+g*Math.sin(c))*i));l.push(d);l.push(Math.floor(e*
i));return this.addPoly(a,l)},render:function(a){var b=dhtmlx.html.create("DIV");b.style.cssText="position:absolute; width:100%; height:100%; top:0px; left:0px;";a.appendChild(b);var c=dhtmlx.z?"":"src='data:image/gif;base64,R0lGODlhEgASAIAAAP///////yH5BAUUAAEALAAAAAASABIAAAIPjI+py+0Po5y02ouz3pwXADs='";b.innerHTML="<map id='"+this.j+"' name='"+this.j+"'>"+this.B.join("\n")+"</map><img "+c+" class='dhx_map_img' usemap='#"+this.j+"'>";a.d=b;this.B=[]}};if(!dhtmlx.chart)dhtmlx.chart={};
dhtmlx.chart.line={pvt_render_line:function(a,b,c,d){var e,g,i,l,j,m,p=new dhtmlx.ui.Map(this.j),q=!!this.a.yAxis;if(q&&typeof this.a.yAxis.end!="undefied"&&typeof this.a.yAxis.start!="undefied"&&this.a.yAxis.step){e=parseFloat(this.a.yAxis.end);g=parseFloat(this.a.yAxis.start)}else{e=this.max(this.a.value);g=this.min(this.a.value)}this.ra(a,b,c,d,g,e);if(q){e=parseFloat(this.a.yAxis.end);g=parseFloat(this.a.yAxis.start)}var n=parseInt(this.a.padding.top,10),w=parseInt(this.a.padding.left,10),z=parseInt(this.a.padding.bottom,
10),A=parseInt(this.a.padding.right,10),r=d-n-z;if(g!=e){var D=this.ta(g,e);l=D[0];i=D[1];j=r/l;if(!q){m=j>10?j:10;j=(r-m)/l}}else{i=1;m=0;j=(r-10)/e}var O=Math.round((c-w-A)/b.length),K=Math.floor(O/2);if(b.length){for(var P=function(G){G=this.a.value(G);var H=(parseFloat(G)-g)*i;q||(H+=m/j);if(g==e)H=e;var x=d-Math.floor(j*H)-z;if(H<0)x=d-n;if(G>e)x=n;if(G<g)x=d-z;return x},v=P.call(this,b[0]),B=1;B<=b.length;B++){var C=Math.floor(O*(B-0.5))-0.5+w,I=Math.floor(O*(B+0.5))-0.5+w;this.qa(C,b[B-1]);
this.Ua(a,C,d-z,n);if(b.length!=B){var Q=P.call(this,b[B]);this.w(a,C,v,I,Q,this.a.line.color(b[B-1]),this.a.line.width)}this.Sa(a,C,v,b[B-1]);p.addRect(b[B-1].id,[C-K,v-K,C+K,v+K]);v=Q}P=null}this.pa(a,b,c,d);p.render(this.b)},Sa:function(a,b,c,d){var e=parseInt(this.a.item.radius,10);a.lineWidth=parseInt(this.a.item.borderWidth,10);a.fillStyle=this.a.item.color(d);a.strokeStyle=this.a.item.borderColor(d);a.beginPath();a.arc(b,c,e,0,Math.PI*2,true);a.fill();a.stroke();this.renderTextAt(false,true,
b,c-e-this.a.labelOffset,this.a.label(d))}};if(!dhtmlx.chart)dhtmlx.chart={};
dhtmlx.chart.bar={pvt_render_bar:function(a,b,c,d){var e,g,i,l,j,m,p=new dhtmlx.ui.Map(this.j),q=!!this.a.yAxis,n=!!this.a.xAxis;if(q&&typeof this.a.yAxis.end!="undefied"&&typeof this.a.yAxis.start!="undefied"&&this.a.yAxis.step){e=parseFloat(this.a.yAxis.end);g=parseFloat(this.a.yAxis.start)}else{e=this.max(this.a.value);g=this.min(this.a.value)}this.ra(a,b,c,d,g,e);if(q){e=parseFloat(this.a.yAxis.end);g=parseFloat(this.a.yAxis.start)}var w=parseInt(this.a.padding.top,10),z=parseInt(this.a.padding.left,
10),A=parseInt(this.a.padding.bottom,10),r=d-w-A;if(e!=g){i=this.ta(g,e);l=i[0];i=i[1];j=r/l;if(!q){m=j>10?j:10;j=(r-m)/l}}else{i=1;m=0;j=(r-10)/e}l=Math.floor((c-z-parseInt(this.a.padding.right,10))/b.length);var D=parseInt(this.a.width,10);if(D>l)D=l-2;var O=Math.floor((l-D)/2),K=typeof this.a.radius!="undefined"?parseInt(this.a.radius,10):Math.round(D/5),P=false,v=this.a.gradient;if(v===true){P=true;v=false}else if(v){v=a.createLinearGradient(0,d-w,0,A);this.a.gradient(v)}var B=0;if(A&&!n){B=d-
A;this.w(a,0,B+0.5,c,B+0.5,"#000000",1)}for(n=0;n<b.length;n++){r=parseFloat(this.a.value(b[n]));if(r>e)r=e;r-=g;r*=i;if(g==e)r=e;var C=z+O+n*l,I=d-A;this.qa(C+Math.floor(D/2),b[n]);if(r<0||this.a.yAxis&&r===0)this.renderTextAt(true,true,C+Math.floor(D/2),I,this.a.label(b[n]));else{q||(r+=m/j);var Q=v||this.a.color.call(this,b[n]);if(this.a.border){a.beginPath();a.fillStyle=Q;this.Q(a,C,I,D,K,j,r,0);a.lineTo(C,0);a.fill();a.fillStyle="#000000";a.globalAlpha=0.37;a.beginPath();this.Q(a,C,I,D,K,j,r,
0);a.fill()}a.globalAlpha=this.a.alpha.call(this,b[n]);a.fillStyle=v||this.a.color.call(this,b[n]);a.beginPath();var G=this.Q(a,C,I,D,K,j,r,this.a.border?1:0);if(v&&!P)a.lineTo(C+(this.a.border?1:0),0);a.fill();a.globalAlpha=1;if(P){var H=a.createLinearGradient(0,I-j*r+2,0,I);H.addColorStop(0,Q);H.addColorStop(0.1,Q);H.addColorStop(1,"#FFFFFF");a.fillStyle=H;a.beginPath();G=this.Q(a,C+2,I,D-4,K,j,r,1);a.fill()}this.renderTextAt(true,true,C+Math.floor(D/2),G[1],this.a.label(b[n]));p.addRect(b[n].id,
[C,G[1],G[0],I])}}this.pa(a,b,c,d);p.render(this.b)},Q:function(a,b,c,d,e,g,i,l){var j=0;if(e>g*i){var m=(e-g*i)/e;j=-Math.acos(m)+Math.PI/2}a.moveTo(b+l,c);var p=c-Math.floor(g*i)+e+(e?0:l);e<g*i&&a.lineTo(b+l,p);g=b+e;e&&a.arc(g,p,e-l,-Math.PI+j,-Math.PI/2,false);var q=b+d-e-(e?0:l),n=p-e+(e?l:0);a.lineTo(q,n);var w=p;e&&a.arc(q,w,e-l,-Math.PI/2,0-j,false);var z=b+d-l;a.lineTo(z,c);a.lineTo(b+l,c);return[z,n]}};if(!dhtmlx.chart)dhtmlx.chart={};
dhtmlx.chart.pie={pvt_render_pie:function(a,b,c,d){this.Ga(a,b,c,d,1)},pvt_render_pie3D:function(a,b,c,d){this.Ga(a,b,c,d,this.a.cant)},Ga:function(a,b,c,d,e){var g=new dhtmlx.ui.Map(this.j),i=0,l=this.Xa(c,d),j=this.a.radius?this.a.radius:l.radius;this.max(this.a.value);var m=[],p=[],q=0;if(this.a.legend)this.a.legend.total_height=this.a.legend.height*b.length;for(var n=0;n<b.length;n++)i+=parseFloat(this.a.value(b[n]));for(n=0;n<b.length;n++){p[n]=parseFloat(this.a.value(b[n]));m[n]=Math.PI*2*((p[n]+
q)/i);q+=p[n]}var w=this.a.x?this.a.x:l.x,z=this.a.y?this.a.y:l.y;e==1&&this.a.shadow&&this.Ma(a,w,z,j);z/=e;var A=-Math.PI/2;a.scale(1,e);for(n=0;n<b.length;n++){a.lineWidth=2;a.beginPath();a.moveTo(w,z);alpha1=-Math.PI/2+m[n];a.arc(w,z,j,A,alpha1,false);a.lineTo(w,z);var r=this.a.color.call(this,b[n]);a.fillStyle=r;a.strokeStyle=this.a.lineColor(b[n]);a.stroke();a.fill();this.a.pieInnerText&&this.na(w,z,5*j/6,A,alpha1,e,this.a.pieInnerText(b[n],i),true);this.a.label&&this.na(w,z,j+this.a.labelOffset,
A,alpha1,e,this.a.label(b[n]));if(e!=1){this.ja(a,w,z,A,alpha1,j,true);a.fillStyle="#000000";a.globalAlpha=0.2;this.ja(a,w,z,A,alpha1,j,false);a.globalAlpha=1;a.fillStyle=r}g.addSector(b[n].id,A,alpha1,w,z,j,e);A=alpha1;if(this.a.legend){a.scale(1,1/e);this.Ta(a,b[n],c,d,n);a.scale(1,e)}}g.render(this.b);if(this.a.gradient){b=e!=1?w+j/3:w;c=e!=1?z+j/3:z;this.rb(a,w,z,j,b,c)}a.scale(1,1/e)},Ta:function(a,b,c,d,e){var g=this.a.legend;a.strokeStyle=a.fillStyle;a.lineWidth=g.marker.height;a.lineCap=g.marker.type;
a.beginPath();var i=5+a.lineWidth/2;c=5+a.lineWidth/2;if(g.align=="right")i+=this.b.offsetWidth-g.width;if(g.valign=="bottom"&&d>g.total_height)c+=d-g.total_height-a.lineWidth/2;if(g.valign=="middle"&&d>g.total_height)c+=(d-g.total_height)/2-a.lineWidth/2;c+=e*g.height;a.moveTo(i,c);d=i+g.marker.width-g.marker.height+1;a.lineTo(d,c);a.stroke();this.renderText(d+g.marker.width/2+5,c-g.marker.height/2,g.template(b))},Xa:function(a,b){var c=0;if(this.a.legend)c=this.a.legend.width*(this.a.legend.align==
"right"?-1:1);a=(a+c)/2;b/=2;c=Math.min(a,b)-this.a.padding.top;return{x:a,y:b,radius:c}},ja:function(a,b,c,d,e,g,i){a.lineWidth=1;if(d<=0&&e>=0||d>=0&&e<=Math.PI||d<=Math.PI&&e>=Math.PI){if(d<0&&e>0){d=0;this.oa(a,b,c,g,d,e)}if(d<Math.PI&&e>Math.PI){e=Math.PI;this.oa(a,b,c,g,d,e)}var l=(this.a.height||Math.floor(g/4))/this.a.cant;a.beginPath();a.arc(b,c,g,d,e,false);a.lineTo(b+g*Math.cos(e),c+g*Math.sin(e)+l);a.arc(b,c+l,g,e,d,true);a.lineTo(b+g*Math.cos(d),c+g*Math.sin(d));a.fill();i&&a.stroke()}},
oa:function(a,b,c,d,e,g){a.beginPath();a.arc(b,c,d,e,g,false);a.stroke()},Ma:function(a,b,c,d){for(var e=["#676767","#7b7b7b","#a0a0a0","#bcbcbc","#d1d1d1","#d6d6d6"],g=e.length-1;g>-1;g--){a.beginPath();a.fillStyle=e[g];a.arc(b+2,c+2,d+g,0,Math.PI*2,true);a.fill()}},Wa:function(a){a.addColorStop(0,"#ffffff");a.addColorStop(0.7,"#7a7a7a");a.addColorStop(1,"#000000");return a},rb:function(a,b,c,d,e,g){a.globalAlpha=0.3;a.beginPath();var i;if(typeof this.a.gradient!="function"){i=a.createRadialGradient(e,
g,d/4,b,c,d);i=this.Wa(i)}else i=this.a.gradient(i);a.fillStyle=i;a.arc(b,c,d,0,Math.PI*2,true);a.fill();a.globalAlpha=1},na:function(a,b,c,d,e,g,i,l){if(i=this.renderText(0,0,i,0,1)){var j=i.scrollWidth;i.style.width=j+"px";if(j>a)j=a;var m=8;if(l)m=j/1.8;var p=d+(e-d)/2;c-=(m-8)/2;var q=-m,n=-8,w="left";if(p>=Math.PI/2&&p<Math.PI){q=-j-q+1;w="right"}if(p<=3*Math.PI/2&&p>=Math.PI){q=-j-q+1;w="right"}d=(b+Math.floor(c*Math.sin(p)))*g+n;m=a+Math.floor((c+m/2)*Math.cos(p))+q;var z=e<Math.PI/2+0.01,
A=p<Math.PI/2;if(A&&z)m=Math.max(m,a+3);else if(!A&&!z)m=Math.min(m,a-j);if(!l&&g<1&&d>b*g)d+=this.a.height||Math.floor(c/4);i.style.top=d+"px";i.style.left=m+"px";i.style.width=j+"px";i.style.textAlign=w;i.style.whiteSpace="nowrap"}}};
dhtmlx.Group={g:function(){this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(){this.a.group&&this.group(this.a.group,false)},this));this.attachEvent("onBeforeRender",dhtmlx.bind(function(a){if(this.a.sort){a.block();a.sort(this.a.sort);a.unblock()}},this));this.attachEvent("onBeforeSort",dhtmlx.bind(function(){this.a.sort=null},this))},Za:function(a,b){a.attachEvent("onClearAll",dhtmlx.bind(function(){this.ungroup(false)},b))},sum:function(a,b){a=dhtmlx.Template.setter(0,a);b=b||this.data;
var c=0;b.each(function(d){c+=a(d)*1});return c},min:function(a,b){a=dhtmlx.Template.setter(0,a);b=b||this.data;var c=Infinity;b.each(function(d){if(a(d)*1<c)c=a(d)*1});return c*1},max:function(a,b){a=dhtmlx.Template.setter(0,a);b=b||this.data;var c=-Infinity;b.each(function(d){if(a(d)*1>c)c=a(d)*1});return c},sb:function(a){var b=function(j,m){j=dhtmlx.Template.setter(0,j);return j(m[0])},c=dhtmlx.Template.setter(0,a.by);a.map[c]||(a.map[c]=[c,b]);var d={},e=[];this.data.each(function(j){var m=c(j);
if(!d[m]){e.push({id:m});d[m]=dhtmlx.toArray()}d[m].push(j)});for(var g in a.map){var i=a.map[g][1]||b;if(typeof i!="function")i=this[i];for(var l=0;l<e.length;l++)e[l][g]=i.call(this,a.map[g][0],d[e[l].id])}this.Ca=this.data;this.data=new dhtmlx.DataStore;this.data.provideApi(this,true);this.Za(this.data,this);this.parse(e,"json")},group:function(a,b){this.ungroup(false);this.sb(a);b!==false&&this.render()},ungroup:function(a){if(this.Ca){this.data=this.Ca;this.data.provideApi(this,true)}a!==false&&
this.render()},group_setter:function(a,b){return b},sort_setter:function(a,b){if(typeof b!="object")b={by:b};this.v(b,{as:"string",dir:"asc"});return b}};dhtmlx.DataDriver.dhtmlxgrid={Ya:"_get_cell_value",toObject:function(a){return this.va=a},getRecords:function(a){return a.rowsBuffer},getDetails:function(a){for(var b={},c=0;c<this.va.getColumnsNum();c++)b["data"+c]=this.va[this.Ya](a,c);return b},getInfo:function(){return{C:0,s:0}}};
dhtmlx.Canvas={g:function(){this.J=[]},lb:function(a){this.k=dhtmlx.html.create("canvas",{width:a.offsetWidth,height:a.offsetHeight});a.appendChild(this.k);if(!this.k.getContext)if(dhtmlx.z){dhtmlx.require("thirdparty/excanvas/excanvas.js");G_vmlCanvasManager.init_(document);G_vmlCanvasManager.initElement(this.k)}return this.k},getCanvas:function(a){return(this.k||this.lb(this.b)).getContext(a||"2d")},ob:function(){if(this.k){this.k.setAttribute("width",this.k.parentNode.offsetWidth);this.k.setAttribute("height",
this.k.parentNode.offsetHeight)}},renderText:function(a,b,c,d,e){if(c){a=dhtmlx.html.create("DIV",{"class":"dhx_canvas_text"+(d?" "+d:""),style:"left:"+a+"px; top:"+b+"px;"},c);this.b.appendChild(a);this.J.push(a);if(e)a.style.width=e+"px";return a}},renderTextAt:function(a,b,c,d,e,g,i){if(e=this.renderText.call(this,c,d,e,g,i)){if(a)e.style.top=d-e.offsetHeight+"px";if(b)e.style.left=parseInt(c-e.offsetWidth/2,10)+"px"}},clearCanvas:function(){for(var a=0;a<this.J.length;a++)this.b.removeChild(this.J[a]);
this.J=[];if(this.b.d){this.b.d.parentNode.removeChild(this.b.d);this.b.d=null}this.getCanvas().clearRect(0,0,this.k.offsetWidth,this.k.offsetHeight)}};
dhtmlXChart=function(a){this.name="Chart";this.version="3.0";dhtmlx.extend(this,dhtmlx.Settings);this.$(a,"dhx_chart");dhtmlx.extend(this,dhtmlx.DataLoader);this.data.provideApi(this,true);dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.MouseEvents);dhtmlx.extend(this,dhtmlx.Destruction);dhtmlx.extend(this,dhtmlx.Canvas);dhtmlx.extend(this,dhtmlx.Group);dhtmlx.extend(this,dhtmlx.AutoTooltip);dhtmlx.extend(this,dhtmlx.chart.pie);dhtmlx.extend(this,dhtmlx.chart.bar);dhtmlx.extend(this,
dhtmlx.chart.line);this.O(a,{color:"RAINBOW",alpha:"1",label:false,value:"{obj.value}",padding:{},view:"pie",lineColor:"#ffffff",cant:0.5,width:15,labelWidth:100,line:{},item:{},shadow:true,gradient:false,border:true,labelOffset:20});this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render()},this))};
dhtmlXChart.prototype={j:"dhx_area_id",on_click:{},on_dblclick:{},on_mouse_move:{},resize:function(){this.ob();this.render()},render:function(){if(this.callEvent("onBeforeRender",[this.data])){this.clearCanvas();this["pvt_render_"+this.a.view](this.getCanvas(),this.data.getRange(),this.b.offsetWidth,this.b.offsetHeight)}},value_setter:dhtmlx.Template.obj_setter,alpha_setter:dhtmlx.Template.obj_setter,label_setter:dhtmlx.Template.obj_setter,lineColor_setter:dhtmlx.Template.obj_setter,pieInnerText_setter:dhtmlx.Template.obj_setter,
colormap:{RAINBOW:function(a){a=Math.floor(this.indexById(a.id)/this.dataCount()*1536);if(a==1536)a-=1;return this.mb[Math.floor(a/256)](a%256)}},color_setter:function(a,b){return this.colormap[b]||dhtmlx.Template.obj_setter(a,b)},legend_setter:function(a,b){if(typeof b!="object")b={template:b};this.v(b,{width:150,height:18,align:"left",valign:"bottom",template:"",marker:{type:"square",width:25,height:15}});b.template=dhtmlx.Template.setter(0,b.template);return b},item_setter:function(a,b){if(typeof b!=
"object")b={color:b,borderColor:b};this.v(b,{radius:4,color:"#000000",borderColor:"#000000",borderWidth:2});b.color=dhtmlx.Template.setter(0,b.color);b.borderColor=dhtmlx.Template.setter(0,b.borderColor);return b},line_setter:function(a,b){if(typeof b!="object")b={color:b};this.v(b,{width:3,color:"#d4d4d4"});b.color=dhtmlx.Template.setter(0,b.color);return b},padding_setter:function(a,b){if(typeof b!="object")b={left:b,right:b,top:b,bottom:b};this.v(b,{left:50,right:20,top:35,bottom:40});return b},
xAxis_setter:function(a,b){if(!b)return false;if(typeof b!="object")b={template:b};this.v(b,{title:"",color:"#000000",template:"",lines:false});if(b.template)b.template=dhtmlx.Template.setter(0,b.template);return b},yAxis_setter:function(a,b){this.v(b,{title:"",color:"#000000",template:"{obj}",lines:true});if(b.template)b.template=dhtmlx.Template.setter(0,b.template);return b},pa:function(a,b,c,d){if(this.a.xAxis){b=parseInt(this.a.padding.left,10)-0.5;var e=d-this.a.padding.bottom+0.5,g=c-this.a.padding.right;
this.w(a,b,e,g,e,this.a.xAxis.color,1);this.renderTextAt(true,false,b,d-2,this.a.xAxis.title,"dhx_axis_title_x",c-b-parseInt(this.a.padding.right,10)-2);this.a.xAxis&&this.a.xAxis.lines&&this.w(a,g,e,g+0.5,this.a.padding.top+0.5,this.a.xAxis.color,0.2)}},ra:function(a,b,c,d,e,g){var i,l={};if(this.a.yAxis){b=parseInt(this.a.padding.left,10)-0.5;d=d-parseInt(this.a.padding.bottom,10);var j=parseInt(this.a.padding.top,10);this.w(a,b,d,b,j,this.a.yAxis.color,1);if(this.a.yAxis.step)i=parseFloat(this.a.yAxis.step);
if(typeof this.a.yAxis.step=="undefined"||typeof this.a.yAxis.start=="undefined"||typeof this.a.yAxis.end=="undefined"){l=this.Oa(e,g);e=l.start;g=l.end;i=l.step;this.a.yAxis.end=g;this.a.yAxis.start=e;this.a.yAxis.step=i}if(i!==0){for(var m=(d-j)*i/(g-e),p=0,q=e;q<=g;q+=i){if(l.fixNum)q=parseFloat((new Number(q)).toFixed(l.fixNum));var n=Math.floor(d-p*m)+0.5;q!=e&&this.a.yAxis.lines&&this.w(a,b,n,c-this.a.padding.right,n,this.a.yAxis.color,0.2);this.renderText(0,n-5,this.a.yAxis.template(q.toString()),
"dhx_axis_item_y",parseInt(this.a.padding.left,10)-5);p++}this.renderTextAt(true,false,0,j-4,this.a.yAxis.title,"dhx_axis_title_y")}}},Oa:function(a,b){var c,d,e;c=(b-a)/8;var g=Math.floor(this.za(c)),i=Math.pow(10,g),l=c/i;l=l>5?10:5;c=parseInt(l,10)*i;if(c>Math.abs(a))d=a<=0||a<c/10?-c:0;else{var j=Math.abs(a),m=Math.floor(this.za(j)),p=j/Math.pow(10,m);d=Math.ceil(p*10)/10*Math.pow(10,m)-c;if(a<0)d=-d-2*c}for(e=d;e<=b;){e+=c;e=parseFloat((new Number(e)).toFixed(Math.abs(g)))}return{start:d,end:e,
step:c,fixNum:Math.abs(g)}},za:function(a){var b="log";return Math.floor(Math[b](a)/Math.LN10)},qa:function(a,b){this.a.xAxis&&this.renderTextAt(false,true,a,this.b.offsetHeight-parseInt(this.a.padding.bottom,10),this.a.xAxis.template(b))},Ua:function(a,b,c,d){this.a.xAxis&&this.a.xAxis.lines&&this.w(a,b,c,b,d,this.a.xAxis.color,0.2)},w:function(a,b,c,d,e,g,i){a.strokeStyle=g;a.lineWidth=i;a.beginPath();a.moveTo(b,c);a.lineTo(d,e);a.stroke()},ta:function(a,b){var c=1;if(b!=a){a=b-a;if(Math.abs(a)<
1)for(;Math.abs(a)<1;){c*=10;a*=c}}else a=a;return[a,c]},mb:[function(a){return"#FF"+dhtmlx.math.toHex(a/2,2)+"00"},function(a){return"#FF"+dhtmlx.math.toHex(a/2+128,2)+"00"},function(a){return"#"+dhtmlx.math.toHex(255-a,2)+"FF00"},function(a){return"#00FF"+dhtmlx.math.toHex(a,2)},function(a){return"#00"+dhtmlx.math.toHex(255-a,2)+"FF"},function(a){return"#"+dhtmlx.math.toHex(a,2)+"00FF"}]};dhtmlx.compat("layout");
document.createElement("canvas").getContext||function(){function a(){return this.context_||(this.context_=new m(this))}function b(f,h){var k=C.call(arguments,2);return function(){return f.apply(h,k.concat(C.call(arguments)))}}function c(f){var h=f.srcElement;switch(f.propertyName){case "width":h.style.width=h.attributes.width.nodeValue+"px";h.getContext().clearRect();break;case "height":h.style.height=h.attributes.height.nodeValue+"px";h.getContext().clearRect();break}}function d(f){f=f.srcElement;
if(f.firstChild){f.firstChild.style.width=f.clientWidth+"px";f.firstChild.style.height=f.clientHeight+"px"}}function e(){return[[1,0,0],[0,1,0],[0,0,1]]}function g(f,h){for(var k=e(),o=0;o<3;o++)for(var s=0;s<3;s++){for(var u=0,y=0;y<3;y++)u+=f[o][y]*h[y][s];k[o][s]=u}return k}function i(f,h){h.fillStyle=f.fillStyle;h.lineCap=f.lineCap;h.lineJoin=f.lineJoin;h.lineWidth=f.lineWidth;h.miterLimit=f.miterLimit;h.shadowBlur=f.shadowBlur;h.shadowColor=f.shadowColor;h.shadowOffsetX=f.shadowOffsetX;h.shadowOffsetY=
f.shadowOffsetY;h.strokeStyle=f.strokeStyle;h.globalAlpha=f.globalAlpha;h.arcScaleX_=f.arcScaleX_;h.arcScaleY_=f.arcScaleY_;h.lineScale_=f.lineScale_}function l(f){var h,k=1;f=String(f);if(f.substring(0,3)=="rgb"){h=f.indexOf("(",3);var o=f.indexOf(")",h+1),s=f.substring(h+1,o).split(",");h="#";for(o=0;o<3;o++)h+=Q[Number(s[o])];if(s.length==4&&f.substr(3,1)=="a")k=s[3]}else h=f;return{color:h,alpha:k}}function j(f){switch(f){case "butt":return"flat";case "round":return"round";case "square":default:return"square"}}
function m(f){this.m_=e();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=v*1;this.globalAlpha=1;this.canvas=f;var h=f.ownerDocument.createElement("div");h.style.width=f.clientWidth+"px";h.style.height=f.clientHeight+"px";h.style.overflow="hidden";h.style.position="absolute";f.appendChild(h);this.element_=h;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}function p(f,h,k,o){f.currentPath_.push({type:"bezierCurveTo",
cp1x:h.x,cp1y:h.y,cp2x:k.x,cp2y:k.y,x:o.x,y:o.y});f.currentX_=o.x;f.currentY_=o.y}function q(f){for(var h=0;h<3;h++)for(var k=0;k<2;k++)if(!isFinite(f[h][k])||isNaN(f[h][k]))return false;return true}function n(f,h,k){if(q(h)){f.m_=h;if(k){var o=h[0][0]*h[1][1]-h[0][1]*h[1][0];f.lineScale_=P(K(o))}}}function w(f){this.type_=f;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}function z(){}var A=Math,r=A.round,D=A.sin,O=A.cos,K=A.abs,P=A.sqrt,v=10,B=v/2,C=Array.prototype.slice,
I={init:function(f){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var h=f||document;h.createElement("canvas");h.attachEvent("onreadystatechange",b(this.init_,this,h))}},init_:function(f){f.namespaces.g_vml_||f.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");f.namespaces.g_o_||f.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML");if(!f.styleSheets.ex_canvas_){var h=f.createStyleSheet();h.owningElement.id="ex_canvas_";h.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}"}var k=
f.getElementsByTagName("canvas");for(f=0;f<k.length;f++)this.initElement(k[f])},initElement:function(f){if(!f.getContext){f.getContext=a;f.innerHTML="";f.attachEvent("onpropertychange",c);f.attachEvent("onresize",d);var h=f.attributes;if(h.width&&h.width.specified)f.style.width=h.width.nodeValue+"px";else f.width=f.clientWidth;if(h.height&&h.height.specified)f.style.height=h.height.nodeValue+"px";else f.height=f.clientHeight}return f}};I.init();for(var Q=[],G=0;G<16;G++)for(var H=0;H<16;H++)Q[G*16+
H]=G.toString(16)+H.toString(16);var x=m.prototype;x.clearRect=function(){this.element_.innerHTML=""};x.beginPath=function(){this.currentPath_=[]};x.moveTo=function(f,h){var k=this.getCoords_(f,h);this.currentPath_.push({type:"moveTo",x:k.x,y:k.y});this.currentX_=k.x;this.currentY_=k.y};x.lineTo=function(f,h){f=this.getCoords_(f,h);this.currentPath_.push({type:"lineTo",x:f.x,y:f.y});this.currentX_=f.x;this.currentY_=f.y};x.bezierCurveTo=function(f,h,k,o,s,u){s=this.getCoords_(s,u);u=this.getCoords_(f,
h);var y=this.getCoords_(k,o);p(this,u,y,s)};x.quadraticCurveTo=function(f,h,k,o){var s=this.getCoords_(f,h);k=this.getCoords_(k,o);o={x:this.currentX_+2/3*(s.x-this.currentX_),y:this.currentY_+2/3*(s.y-this.currentY_)};var u={x:o.x+(k.x-this.currentX_)/3,y:o.y+(k.y-this.currentY_)/3};p(this,o,u,k)};x.arc=function(f,h,k,o,s,u){k*=v;var y=u?"at":"wa",t=f+O(o)*k-B,R=h+D(o)*k-B,F=f+O(s)*k-B,M=h+D(s)*k-B;if(t==F&&!u)t+=0.125;f=this.getCoords_(f,h);var J=this.getCoords_(t,R),L=this.getCoords_(F,M);this.currentPath_.push({type:y,
x:f.x,y:f.y,radius:k,xStart:J.x,yStart:J.y,xEnd:L.x,yEnd:L.y})};x.rect=function(f,h,k,o){this.moveTo(f,h);this.lineTo(f+k,h);this.lineTo(f+k,h+o);this.lineTo(f,h+o);this.closePath()};x.strokeRect=function(f,h,k,o){var s=this.currentPath_;this.beginPath();this.moveTo(f,h);this.lineTo(f+k,h);this.lineTo(f+k,h+o);this.lineTo(f,h+o);this.closePath();this.stroke();this.currentPath_=s};x.fillRect=function(f,h,k,o){var s=this.currentPath_;this.beginPath();this.moveTo(f,h);this.lineTo(f+k,h);this.lineTo(f+
k,h+o);this.lineTo(f,h+o);this.closePath();this.fill();this.currentPath_=s};x.createLinearGradient=function(f,h,k,o){var s=new w("gradient");s.x0_=f;s.y0_=h;s.x1_=k;s.y1_=o;return s};x.createRadialGradient=function(f,h,k,o,s,u){var y=new w("gradientradial");y.x0_=f;y.y0_=h;y.r0_=k;y.x1_=o;y.y1_=s;y.r1_=u;return y};x.drawImage=function(f){var h,k,o,s,u,y,t,R,F=f.runtimeStyle.width,M=f.runtimeStyle.height;f.runtimeStyle.width="auto";f.runtimeStyle.height="auto";var J=f.width,L=f.height;f.runtimeStyle.width=
F;f.runtimeStyle.height=M;if(arguments.length==3){h=arguments[1];k=arguments[2];u=y=0;t=o=J;R=s=L}else if(arguments.length==5){h=arguments[1];k=arguments[2];o=arguments[3];s=arguments[4];u=y=0;t=J;R=L}else if(arguments.length==9){u=arguments[1];y=arguments[2];t=arguments[3];R=arguments[4];h=arguments[5];k=arguments[6];o=arguments[7];s=arguments[8]}else throw Error("Invalid number of arguments");var E=this.getCoords_(h,k),S=[],T=10,N=10;S.push(" <g_vml_:group",' coordsize="',v*T,",",v*N,'"',' coordorigin="0,0"',
' style="width:',T,"px;height:",N,"px;position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]){var U=[];U.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",r(E.x/v),",","Dy=",r(E.y/v),"");E=E;var V=this.getCoords_(h+o,k),W=this.getCoords_(h,k+s),X=this.getCoords_(h+o,k+s);E.x=A.max(E.x,V.x,W.x,X.x);E.y=A.max(E.y,V.y,W.y,X.y);S.push("padding:0 ",r(E.x/v),"px ",r(E.y/v),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",U.join(""),", sizingmethod='clip');")}else S.push("top:",
r(E.y/v),"px;left:",r(E.x/v),"px;");S.push(' ">','<g_vml_:image src="',f.src,'"',' style="width:',v*o,"px;"," height:",v*s,'px;"',' cropleft="',u/J,'"',' croptop="',y/L,'"',' cropright="',(J-u-t)/J,'"',' cropbottom="',(L-y-R)/L,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",S.join(""))};x.stroke=function(f){var h=[],k=l(f?this.fillStyle:this.strokeStyle),o=k.color,s=k.alpha*this.globalAlpha,u=k=10;h.push("<g_vml_:shape",' filled="',!!f,'"',' style="position:absolute;width:',
k,"px;height:",u,'px;"',' coordorigin="0 0" coordsize="',v*k," ",v*u,'"',' stroked="',!f,'"',' path="');k={x:null,y:null};u={x:null,y:null};for(var y=0;y<this.currentPath_.length;y++){var t=this.currentPath_[y],R;switch(t.type){case "moveTo":R=t;h.push(" m ",r(t.x),",",r(t.y));break;case "lineTo":h.push(" l ",r(t.x),",",r(t.y));break;case "close":h.push(" x ");t=null;break;case "bezierCurveTo":h.push(" c ",r(t.cp1x),",",r(t.cp1y),",",r(t.cp2x),",",r(t.cp2y),",",r(t.x),",",r(t.y));break;case "at":case "wa":h.push(" ",
t.type," ",r(t.x-this.arcScaleX_*t.radius),",",r(t.y-this.arcScaleY_*t.radius)," ",r(t.x+this.arcScaleX_*t.radius),",",r(t.y+this.arcScaleY_*t.radius)," ",r(t.xStart),",",r(t.yStart)," ",r(t.xEnd),",",r(t.yEnd));break}if(t){if(k.x==null||t.x<k.x)k.x=t.x;if(u.x==null||t.x>u.x)u.x=t.x;if(k.y==null||t.y<k.y)k.y=t.y;if(u.y==null||t.y>u.y)u.y=t.y}}h.push(' ">');if(f)if(typeof this.fillStyle=="object"){var F=this.fillStyle,M=0,J={x:0,y:0};o=0;var L=1;if(F.type_=="gradient"){k=F.x0_/this.arcScaleX_;u=F.y0_/
this.arcScaleY_;y=F.x1_/this.arcScaleX_;t=F.y1_/this.arcScaleY_;var E=this.getCoords_(k,u),S=this.getCoords_(y,t);k=S.x-E.x;u=S.y-E.y;M=Math.atan2(k,u)*180/Math.PI;if(M<0)M+=360;if(M<1.0E-6)M=0}else{E=this.getCoords_(F.x0_,F.y0_);o=u.x-k.x;u=u.y-k.y;J={x:(E.x-k.x)/o,y:(E.y-k.y)/u};o/=this.arcScaleX_*v;u/=this.arcScaleY_*v;var T=A.max(o,u);o=2*F.r0_/T;L=2*F.r1_/T-o}var N=F.colors_;N.sort(function(aa,ba){return aa.offset-ba.offset});k=N.length;var U=N[0].color,V=N[k-1].color,W=N[0].alpha*this.globalAlpha,
X=N[k-1].alpha*this.globalAlpha,Z=[];for(y=0;y<k;y++){var $=N[y];Z.push($.offset*L+o+" "+$.color)}h.push('<g_vml_:fill type="',F.type_,'"',' method="none" focus="100%"',' color="',U,'"',' color2="',V,'"',' colors="',Z.join(","),'"',' opacity="',X,'"',' g_o_:opacity2="',W,'"',' angle="',M,'"',' focusposition="',J.x,",",J.y,'" />')}else h.push('<g_vml_:fill color="',o,'" opacity="',s,'" />');else{var Y=this.lineScale_*this.lineWidth;if(Y<1)s*=Y;h.push("<g_vml_:stroke",' opacity="',s,'"',' joinstyle="',
this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',j(this.lineCap),'"',' weight="',Y,'px"',' color="',o,'" />')}h.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",h.join(""))};x.fill=function(){this.stroke(true)};x.closePath=function(){this.currentPath_.push({type:"close"})};x.getCoords_=function(f,h){var k=this.m_;return{x:v*(f*k[0][0]+h*k[1][0]+k[2][0])-B,y:v*(f*k[0][1]+h*k[1][1]+k[2][1])-B}};x.save=function(){var f={};i(this,f);this.aStack_.push(f);this.mStack_.push(this.m_);
this.m_=g(e(),this.m_)};x.restore=function(){i(this.aStack_.pop(),this);this.m_=this.mStack_.pop()};x.translate=function(f,h){f=[[1,0,0],[0,1,0],[f,h,1]];n(this,g(f,this.m_),false)};x.rotate=function(f){var h=O(f),k=D(f);h=[[h,k,0],[-k,h,0],[0,0,1]];n(this,g(h,this.m_),false)};x.scale=function(f,h){this.arcScaleX_*=f;this.arcScaleY_*=h;f=[[f,0,0],[0,h,0],[0,0,1]];n(this,g(f,this.m_),true)};x.transform=function(f,h,k,o,s,u){s=[[f,h,0],[k,o,0],[s,u,1]];n(this,g(s,this.m_),true)};x.setTransform=function(f,
h,k,o,s,u){f=[[f,h,0],[k,o,0],[s,u,1]];n(this,f,true)};x.clip=function(){};x.arcTo=function(){};x.createPattern=function(){return new z};w.prototype.addColorStop=function(f,h){h=l(h);this.colors_.push({offset:f,color:h.color,alpha:h.alpha})};G_vmlCanvasManager=I;CanvasRenderingContext2D=m;CanvasGradient=w;CanvasPattern=z}();if(dhtmlx&&dhtmlx.N)dhtmlx.N["thirdparty/excanvas/excanvas.js"]=true;

window.dhtmlx||(dhtmlx={});dhtmlx.version="3.0";dhtmlx.codebase="./";dhtmlx.extend=function(a,b){for(var c in b)a[c]=b[c];b.g&&a.g();return a};dhtmlx.bind=function(a,b){return function(){return a.apply(b,arguments)}};dhtmlx.require=function(a){if(!dhtmlx.N[a]){dhtmlx.exec(dhtmlx.ajax().sync().get(dhtmlx.codebase+a).responseText);dhtmlx.N[a]=true}};dhtmlx.N={};dhtmlx.exec=function(a){window.execScript?window.execScript(a):window.eval(a)};
dhtmlx.methodPush=function(a,b){return function(){var c=false;return c=a[b].apply(a,arguments)}};dhtmlx.isNotDefined=function(a){return typeof a=="undefined"};dhtmlx.delay=function(a,b,c){setTimeout(function(){var d=a.apply(b,c);a=b=c=null;return d},1)};dhtmlx.uid=function(){if(!this.ca)this.ca=(new Date).valueOf();this.ca++;return this.ca};dhtmlx.toNode=function(a){if(typeof a=="string")return document.getElementById(a);return a};dhtmlx.toArray=function(a){return dhtmlx.extend(a||[],dhtmlx.PowerArray)};
dhtmlx.toFunctor=function(a){return typeof a=="string"?eval(a):a};dhtmlx.h={};dhtmlx.event=function(a,b,c,d){a=dhtmlx.toNode(a);var e=dhtmlx.uid();dhtmlx.h[e]=[a,b,c];if(d)c=dhtmlx.bind(c,d);if(a.addEventListener)a.addEventListener(b,c,false);else a.attachEvent&&a.attachEvent("on"+b,c);return e};dhtmlx.eventRemove=function(a){if(a){var b=dhtmlx.h[a];if(b[0].removeEventListener)b[0].removeEventListener(b[1],b[2],false);else b[0].detachEvent&&b[0].detachEvent("on"+b[1],b[2]);delete this.h[a]}};
dhtmlx.EventSystem={g:function(){this.h={};this.H={};this.B={}},block:function(){this.h.ha=true},unblock:function(){this.h.ha=false},mapEvent:function(a){dhtmlx.extend(this.B,a)},callEvent:function(a,b){if(this.h.ha)return true;a=a.toLowerCase();var c=this.h[a.toLowerCase()],d=true;if(c)for(var e=0;e<c.length;e++)if(c[e].apply(this,b||[])===false)d=false;if(this.B[a]&&!this.B[a].callEvent(a,b))d=false;return d},attachEvent:function(a,b,c){a=a.toLowerCase();c=c||dhtmlx.uid();b=dhtmlx.toFunctor(b);
var d=this.h[a]||dhtmlx.toArray();d.push(b);this.h[a]=d;this.H[c]={f:b,t:a};return c},detachEvent:function(a){var b=this.H[a].t,c=this.H[a].f;b=this.h[b];b.remove(c);delete this.H[a]}};
dhtmlx.PowerArray={removeAt:function(a,b){if(a>=0)this.splice(a,b||1)},remove:function(a){this.removeAt(this.find(a))},insertAt:function(a,b){if(!b&&b!==0)this.push(a);else{var c=this.splice(b,this.length-b);this[b]=a;this.push.apply(this,c)}},find:function(a){for(i=0;i<this.length;i++)if(a==this[i])return i;return-1},each:function(a,b){for(var c=0;c<this.length;c++)a.call(b||this,this[c])},map:function(a,b){for(var c=0;c<this.length;c++)this[c]=a.call(b||this,this[c]);return this}};
if(navigator.userAgent.indexOf("Opera")!=-1)dhtmlx.vb=true;else{dhtmlx.z=!!document.all;dhtmlx.$a=!document.all;dhtmlx.wb=navigator.userAgent.indexOf("KHTML")!=-1;if(navigator.appVersion.indexOf("MSIE 8.0")!=-1&&document.compatMode!="BackCompat")dhtmlx.z=8}dhtmlx.zIndex={drag:1E4};
dhtmlx.html={create:function(a,b,c){b=b||{};var d=document.createElement(a);for(var e in b)d.setAttribute(e,b[e]);if(b.style)d.style.cssText=b.style;if(b["class"])d.className=b["class"];if(c)d.innerHTML=c;return d},getValue:function(a){a=dhtmlx.toNode(a);if(!a)return"";return dhtmlx.isNotDefined(a.value)?a.innerHTML:a.value},remove:function(a){if(a instanceof Array)for(var b=0;b<a.length;b++)this.remove(a[b]);else a&&a.parentNode&&a.parentNode.removeChild(a)},insertBefore:function(a,b,c){if(a)b?b.parentNode.insertBefore(a,
b):c.appendChild(a)},locate:function(a,b){a=a||event;for(var c=a.target||a.srcElement;c;){if(c.getAttribute){var d=c.getAttribute(b);if(d)return d}c=c.parentNode}return null},offset:function(a){if(a.getBoundingClientRect){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,g=window.pageXOffset||d.scrollLeft||c.scrollLeft,i=d.clientTop||c.clientTop||0,l=d.clientLeft||c.clientLeft||0,j=b.top+e-i,m=b.left+g-l;return{y:Math.round(j),
x:Math.round(m)}}else{for(m=j=0;a;){j+=parseInt(a.offsetTop,10);m+=parseInt(a.offsetLeft,10);a=a.offsetParent}return{y:j,x:m}}},pos:function(a){a=a||event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};var b=dhtmlx.z&&document.compatMode!="BackCompat"?document.documentElement:document.body;return{x:a.clientX+b.scrollLeft-b.clientLeft,y:a.clientY+b.scrollTop-b.clientTop}},preventEvent:function(a){a&&a.preventDefault&&a.preventDefault();dhtmlx.html.stopEvent(a)},stopEvent:function(a){(a||event).cancelBubble=
true;return false},addCss:function(a,b){a.className+=" "+b},removeCss:function(a,b){a.className=a.className.replace(RegExp(b,"g"),"")}};(function(){var a=document.getElementsByTagName("SCRIPT");if(a.length){a=(a[a.length-1].getAttribute("src")||"").split("/");a.splice(a.length-1,1);dhtmlx.codebase=a.slice(0,a.length).join("/")+"/"}})();dhtmlx.ui={};
dhtmlx.Template={T:{},empty:function(){return""},setter:function(a,b){return dhtmlx.Template.fromHTML(b)},obj_setter:function(a,b){var c=dhtmlx.Template.setter(a,b),d=this;return function(){return c.apply(d,arguments)}},fromHTML:function(a){if(typeof a=="function")return a;if(this.T[a])return this.T[a];a=(a||"").toString();a=a.replace(/[\r\n]+/g,"\\n");a=a.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"');a=a.replace(/\{common\.([^}\(]*)\}/g,'"+common.$1+"');a=a.replace(/\{common\.([^\}\(]*)\(\)\}/g,
'"+(common.$1?common.$1(obj):"")+"');a=a.replace(/\{obj\.([^}]*)\}/g,'"+obj.$1+"');a=a.replace(/#([a-z0-9_]+)#/gi,'"+obj.$1+"');a=a.replace(/\{obj\}/g,'"+obj+"');a=a.replace(/\{-obj/g,"{obj");a=a.replace(/\{-common/g,"{common");a='return "'+a+'";';return this.T[a]=Function("obj","common",a)}};
dhtmlx.Type={add:function(a,b){if(!a.types&&a.prototype.types)a=a.prototype;var c=b.name||"default";this.ea(b);this.ea(b,"edit");this.ea(b,"loading");a.types[c]=dhtmlx.extend(dhtmlx.extend({},a.types[c]||this.Qa),b);return c},Qa:{css:"default",template:function(){return""},template_edit:function(){return""},template_loading:function(){return"..."},width:150,height:80,margin:5,padding:0},ea:function(a,b){b="template"+(b?"_"+b:"");var c=a[b];if(c&&typeof c=="string"){if(c.indexOf("->")!=-1){c=c.split("->");
switch(c[0]){case "html":c=dhtmlx.html.getValue(c[1]).replace(/\"/g,'\\"');break;case "http":c=(new dhtmlx.ajax).sync().get(c[1],{uid:(new Date).valueOf()}).responseText;break;default:break}}a[b]=dhtmlx.Template.fromHTML(c)}}};
dhtmlx.Settings={g:function(){this.a=this.config=[];this.a.sort=null},define:function(a,b){if(typeof a=="object")return this.Fa(a);return this.la(a,b)},la:function(a,b){var c=this[a+"_setter"];return this.a[a]=c?c.call(this,a,b):b},Fa:function(a){if(a)for(var b in a)this.la(b,a[b])},O:function(a,b){var c=dhtmlx.extend({},b);typeof a=="object"&&!a.tagName&&dhtmlx.extend(c,a);this.Fa(c)},v:function(a,b){for(var c in b)switch(typeof a[c]){case "object":a[c]=this.v(a[c]||{},b[c]);break;case "undefined":a[c]=
b[c];break;default:break}return a},$:function(a,b,c){if(typeof a=="object"&&!a.tagName)a=a.container;this.b=dhtmlx.toNode(a);if(!this.b&&c)this.b=c(a);this.b.className+=" "+b;this.b.onselectstart=function(){return false};this.c=this.b},qb:function(a){if(typeof a=="object")return this.type_setter("type",a);this.type=dhtmlx.extend({},this.types[a]);this.customize()},customize:function(a){a&&dhtmlx.extend(this.type,a);this.type.ya=dhtmlx.Template.fromHTML(this.template_item_start(this.type));this.type.xa=
this.template_item_end(this.type);this.render()},type_setter:function(a,b){this.qb(typeof b=="object"?dhtmlx.Type.add(this,b):b);return b},template_setter:function(a,b){return this.type_setter("type",{template:b})},css_setter:function(a,b){this.b.className+=" "+b;return b}};
dhtmlx.Destruction={g:function(){dhtmlx.destructors.push(this)},destructor:function(){this.destructor=function(){};this.u=this.d=null;this.l&&document.body.appendChild(this.l);this.l=null;if(this.b){this.b.innerHTML="";this.b.d=null}this.data=this.b=this.c=null;this.h=this.H={}}};dhtmlx.destructors=[];
dhtmlx.event(window,"unload",function(){for(var a=0;a<dhtmlx.destructors.length;a++)dhtmlx.destructors[a].destructor();dhtmlx.destructors=[];for(var b in dhtmlx.h){a=dhtmlx.h[b];if(a[0].removeEventListener)a[0].removeEventListener(a[1],a[2],false);else a[0].detachEvent&&a[0].detachEvent("on"+a[1],a[2]);delete dhtmlx.h[b]}});
dhtmlx.ui.pager=function(a){this.name="Pager";dhtmlx.extend(this,dhtmlx.Settings);this.$(a,"dhx_pager");dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.SingleRender);dhtmlx.extend(this,dhtmlx.MouseEvents);this.O(a,{size:10,page:-1,group:5,count:0,type:"default"});this.data=this.a;this.refresh()};
dhtmlx.ui.pager.prototype={j:"dhx_p_id",ub:{dhx_pager_item:function(a,b){this.select(b)}},select:function(a){switch(a){case "next":a=this.a.page+1;break;case "prev":a=this.a.page-1;break;case "first":a=0;break;case "last":a=this.a.limit-1;break;default:break}if(a<0)a=0;if(a>=this.data.limit)a=this.data.limit-1;if(this.callEvent("onBeforePageChange",[this.a.page,a])){this.data.page=a*1;this.refresh();this.callEvent("onAfterPageChange",[a])}},types:{"default":{template:dhtmlx.Template.fromHTML("{common.pages()}"),
pages:function(a){var b="";if(a.page==-1)return"";a.min=a.page-Math.round((a.group-1)/2);a.max=a.min+a.group-1;if(a.min<0){a.max+=a.min*-1;a.min=0}if(a.max>=a.limit){a.min-=Math.min(a.min,a.max-a.limit+1);a.max=a.limit-1}for(var c=a.min||0;c<=a.max;c++)b+=this.button({id:c,index:c+1,selected:c==a.page?"_selected":""});return b},page:function(a){return a.page+1},first:function(){return this.button({id:"first",index:" &lt;&lt; ",selected:""})},last:function(){return this.button({id:"last",index:" &gt;&gt; ",
selected:""})},prev:function(){return this.button({id:"prev",index:"&lt;",selected:""})},next:function(){return this.button({id:"next",index:"&gt;",selected:""})},button:dhtmlx.Template.fromHTML("<div dhx_p_id='{obj.id}' class='dhx_pager_item{obj.selected}'>{obj.index}</div>")}},refresh:function(){var a=this.a;a.limit=Math.ceil(a.count/a.size);if(a.limit&&a.limit!=a.old_limit)a.page=Math.min(a.limit-1,a.page);var b=a.page;if(b!=-1&&b!=a.old_page||a.limit!=a.old_limit){this.render();this.callEvent("onRefresh",
[]);a.old_limit=a.limit;a.old_page=a.page}},template_item_start:dhtmlx.Template.fromHTML("<div>"),template_item_end:dhtmlx.Template.fromHTML("</div>")};dhtmlx.SingleRender={g:function(){},D:function(a){return this.type.ya(a,this.type)+this.type.template(a,this.type)+this.type.xa},render:function(){if(!this.callEvent||this.callEvent("onBeforeRender",[this.data])){if(this.data)this.c.innerHTML=this.D(this.data);this.callEvent&&this.callEvent("onAfterRender",[])}}};
dhtmlx.ui.Tooltip=function(a){this.name="Tooltip";this.version="3.0";if(typeof a=="string")a={template:a};dhtmlx.extend(this,dhtmlx.Settings);dhtmlx.extend(this,dhtmlx.SingleRender);this.O(a,{type:"default",dy:0,dx:20});this.c=this.b=document.createElement("DIV");this.b.className="dhx_tooltip";dhtmlx.html.insertBefore(this.b,document.body.firstChild)};
dhtmlx.ui.Tooltip.prototype={show:function(a,b){if(this.data!=a){this.data=a;this.render(a)}this.b.style.top=b.y+this.a.dy+"px";this.b.style.left=b.x+this.a.dx+"px";this.b.style.display="block"},hide:function(){this.data=null;this.b.style.display="none"},types:{"default":dhtmlx.Template.fromHTML("{obj.id}")},template_item_start:dhtmlx.Template.empty,template_item_end:dhtmlx.Template.empty};
dhtmlx.AutoTooltip={tooltip_setter:function(a,b){var c=new dhtmlx.ui.Tooltip(b);this.attachEvent("onMouseMove",function(d,e){c.show(this.get(d),dhtmlx.html.pos(e))});this.attachEvent("onMouseOut",function(){c.hide()});this.attachEvent("onMouseMoving",function(){c.hide()});return c}};dhtmlx.compat=function(a,b){dhtmlx.compat[a]&&dhtmlx.compat[a](b)};
(function(){if(!window.dhtmlxError){var a=function(){};window.dhtmlxError={catchError:a,throwError:a};window.convertStringToBoolean=function(c){return!!c};window.dhtmlxEventable=function(c){dhtmlx.extend(c,dhtmlx.EventSystem)};var b={getXMLTopNode:function(){},doXPath:function(c){return dhtmlx.DataDriver.xml.xpath(this.xml,c)},xmlDoc:{responseXML:true}};dhtmlx.compat.dataProcessor=function(c){var d="_sendData",e="_in_progress",g="_tMode",i="_waitMode";c[d]=function(l,j){if(l){if(j)this[e][j]=(new Date).valueOf();
if(!this.callEvent("onBeforeDataSending",j?[j,this.getState(j)]:[]))return false;var m=this,p=this.serverProcessor;this[g]!="POST"?dhtmlx.ajax().get(p+(p.indexOf("?")!=-1?"&":"?")+this.serialize(l,j),"",function(q,n){b.xml=dhtmlx.DataDriver.xml.checkResponse(q,n);m.afterUpdate(m,null,null,null,b)}):dhtmlx.ajax().post(p,this.serialize(l,j),function(q,n){b.xml=dhtmlx.DataDriver.xml.checkResponse(q,n);m.afterUpdate(m,null,null,null,b)});this[i]++}}}}})();
dhtmlx.DataProcessor={Ra:function(a){var b="_methods";a[b]=["setItemStyle","","changeId","remove"];this.attachEvent("onAfterAdd",function(c){a.setUpdated(c,true,"inserted")});this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(c,d){c.getUserData&&c.getUserData(d,this.ga)},this));this.attachEvent("onBeforeDelete",function(c){var d=a.getState(c);if(d=="inserted"){a.setUpdated(c,false);return true}if(d=="deleted")return false;if(d=="true_deleted")return true;a.setUpdated(c,true,"deleted");return false});
this.attachEvent("onAfterEditStop",function(c){a.setUpdated(c,true,"updated")});b="_getRowData";a[b]=function(c){c=this.obj.data.get(c);var d={};for(var e in c)if(e.indexOf("_")!==0)d[e]=c[e];return d};b="_clearUpdateFlag";a[b]=function(){};this.ga={};a.attachEvent("insertCallback",this.ma);a.attachEvent("updateCallback",this.ma);a.attachEvent("deleteCallback",function(c,d){this.obj.setUserData(d,this.action_param,"true_deleted");this.obj.remove(d)});dhtmlx.compat("dataProcessor",a)},ma:function(a,
b){this.obj.data.set(b,dhtmlx.DataDriver.xml.getDetails(a.firstChild));this.obj.data.refresh(b)},setItemStyle:function(a,b){if(a=this.m(a))a.style.cssText+=";"+b},changeId:function(a,b){this.data.order[this.data.indexById(a)]=b;this.data.pull[b]=this.data.pull[a];this.data.get(b).id=b;delete this.data.pull[a];this.data.refresh()},setUserData:function(a,b,c){if(a)this.data.get(a)[b]=c;else this.ga[b]=c},getUserData:function(a,b){return a?this.data.get(a)[b]:this.ga[b]}};
(function(){var a="_dp_init";dhtmlx.DataProcessor[a]=dhtmlx.DataProcessor.Ra})();
dhtmlx.compat.dnd=function(){if(window.dhtmlDragAndDropObject){var a="_dragged",b=dhtmlDragAndDropObject.prototype.checkLanding;dhtmlDragAndDropObject.prototype.checkLanding=function(j,m,p){b.apply(this,arguments);if(!p){dhtmlx.DragControl.o=dhtmlx.DragControl.o||{};dhtmlx.DragControl.K(j,m,true)}};var c=dhtmlDragAndDropObject.prototype.stopDrag;dhtmlDragAndDropObject.prototype.stopDrag=function(j,m,p){if(!p)if(dhtmlx.DragControl.i){dhtmlx.DragControl.n=d.dragStartNode;dhtmlx.DragControl.R(j,true)}c.apply(this,
arguments)};var d=new dhtmlDragAndDropObject,e=dhtmlx.DragControl.da;dhtmlx.DragControl.da=function(){e.apply(this,arguments);var j=dhtmlx.DragControl.o;if(j){for(var m=[],p=[],q=0;q<j.source.length;q++){m[q]={idd:j.source[q]};p.push(j.source[q])}d.dragStartNode={parentNode:{},parentObject:{idd:m,id:p.length==1?p[0]:p,treeNod:{object:j.from}}};d.dragStartNode.parentObject.treeNod[a]=m;d.dragStartObject=j.from}};var g=dhtmlx.DragControl.K;dhtmlx.DragControl.K=function(j,m,p){g.apply(this,arguments);
if(!this.i&&!p)j=d.checkLanding(j,m,true)};var i=dhtmlx.DragControl.R;dhtmlx.DragControl.R=function(j,m){i.apply(this,arguments);d.lastLanding&&!m&&d.stopDrag(j,false,true)};var l=dhtmlx.DragControl.getMaster;dhtmlx.DragControl.getMaster=function(j){var m=null;if(j)m=l.apply(this,arguments);if(!m){m=d.dragStartObject;for(var p=[],q=m[a],n=0;n<q.length;n++)p.push(q[n].idd||q[n].id);dhtmlx.DragControl.o.source=p}return m}}};
dhtmlx.DataMove={g:function(){},copy:function(a,b,c,d){var e=this.get(a);if(e){if(c)e=c.externalData(e);c=c||this;return c.add(c.externalData(e,d),b)}},move:function(a,b,c,d){if(a instanceof Array)for(d=0;d<a.length;d++){var e=(c||this).indexById(this.move(a[d],b,c,dhtmlx.uid()));if(a[d+1])b=e+(this.indexById(a[d+1])<e?0:1)}else{nid=a;if(!(b<0)){var g=this.get(a);if(g){if(!c||c==this)this.data.move(this.indexById(a),b);else{nid=c.add(c.externalData(g,d),b);this.remove(a)}return nid}}}},moveUp:function(a,
b){return this.move(a,this.indexById(a)-(b||1))},moveDown:function(a,b){return this.moveUp(a,(b||1)*-1)},moveTop:function(a){return this.move(a,0)},moveBottom:function(a){return this.move(a,this.data.dataCount()-1)},externalData:function(a,b){var c=dhtmlx.extend({},a);c.id=b||dhtmlx.uid();c.$selected=c.$template=null;return c}};
dhtmlx.DragControl={r:dhtmlx.toArray(["dummy"]),addDrop:function(a,b,c){a=dhtmlx.toNode(a);a.dhx_drop=this.sa(b);if(c)a.dhx_master=true},sa:function(a){a=a||dhtmlx.DragControl;var b=this.r.find(a);if(b<0){b=this.r.length;this.r.push(a)}return b},addDrag:function(a,b){a=dhtmlx.toNode(a);a.dhx_drag=this.sa(b);dhtmlx.event(a,"mousedown",this.kb,a)},kb:function(a){if(dhtmlx.DragControl.n){dhtmlx.DragControl.aa();dhtmlx.DragControl.destroyDrag()}dhtmlx.DragControl.n=this;dhtmlx.DragControl.F=dhtmlx.event(document.body,
"mousemove",dhtmlx.DragControl.da);dhtmlx.DragControl.G=dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl.aa);a.cancelBubble=true;return false},aa:function(){dhtmlx.DragControl.F=dhtmlx.eventRemove(dhtmlx.DragControl.F);dhtmlx.DragControl.G=dhtmlx.eventRemove(dhtmlx.DragControl.G)},da:function(a){dhtmlx.DragControl.aa();if(dhtmlx.DragControl.createDrag(a)){dhtmlx.DragControl.sendSignal("start");dhtmlx.DragControl.F=dhtmlx.event(document.body,"mousemove",dhtmlx.DragControl.Ba);dhtmlx.DragControl.G=
dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl.R);dhtmlx.DragControl.Ba(a)}},R:function(a){dhtmlx.DragControl.F=dhtmlx.eventRemove(dhtmlx.DragControl.F);dhtmlx.DragControl.G=dhtmlx.eventRemove(dhtmlx.DragControl.G);if(dhtmlx.DragControl.i){dhtmlx.DragControl.onDrop(dhtmlx.DragControl.n,dhtmlx.DragControl.i,this.A,a);dhtmlx.DragControl.onDragOut(dhtmlx.DragControl.n,dhtmlx.DragControl.i,null,a)}dhtmlx.DragControl.destroyDrag();dhtmlx.DragControl.sendSignal("stop")},Ba:function(a){var b=dhtmlx.html.pos(a);
dhtmlx.DragControl.l.style.top=b.y+dhtmlx.DragControl.top+"px";dhtmlx.DragControl.l.style.left=b.x+dhtmlx.DragControl.left+"px";if(dhtmlx.DragControl.Ia)dhtmlx.DragControl.Ia=false;else dhtmlx.DragControl.K(a.srcElement||a.target,a);a.cancelBubble=true;return false},K:function(a,b){for(;a&&a.tagName!="BODY";){if(a.dhx_drop){if(this.i&&(this.i!=a||a.dhx_master))this.onDragOut(this.n,this.i,a,b);if(!this.i||this.i!=a||a.dhx_master){this.i=null;if(this.A=this.onDragIn(dhtmlx.DragControl.n,a,b))this.i=
a;return}return}a=a.parentNode}if(this.i)this.i=this.A=this.onDragOut(this.n,this.i,null,b)},sendSignal:function(a){dhtmlx.DragControl.active=a=="start"},getMaster:function(a){return this.r[a.dhx_drag||a.dhx_drop]},getContext:function(){return this.o},createDrag:function(a){var b=document.createElement("DIV"),c=dhtmlx.DragControl.n;if(c.dhx_drag&&c.dhx_drag.onCreateDrag){var d=dhtmlx.DragControl.l;d=c.dhx_drag.onCreateDrag(c,a);d.style.position="absolute";d.style.zIndex=dhtmlx.zIndex.drag;d.onmousemove=
dhtmlx.DragControl.Ja;return true}d=dhtmlx.DragControl.onDrag(c,a);if(!d)return false;b.innerHTML=d;b.className="dhx_drag_zone";b.onmousemove=dhtmlx.DragControl.Ja;document.body.appendChild(b);dhtmlx.DragControl.l=b;return true},Ja:function(){dhtmlx.DragControl.Ia=true},destroyDrag:function(){var a=dhtmlx.DragControl.n;a.dhx_drag&&a.dhx_drag.onDestroyDrag?a.dhx_drag.onDestroyDrag(a,dhtmlx.DragControl.l):dhtmlx.html.remove(dhtmlx.DragControl.l);dhtmlx.DragControl.A=dhtmlx.DragControl.n=dhtmlx.DragControl.i=
dhtmlx.DragControl.l=null},top:5,left:5,onDragIn:function(a,b,c){var d=this.r[b.dhx_drop];if(d.onDragIn&&d!=this)return d.onDragIn(a,b,c);b.className+=" dhx_drop_zone";return b},onDragOut:function(a,b,c,d){var e=this.r[b.dhx_drop];if(e.onDragOut&&e!=this)return e.onDragOut(a,b,c,d);b.className=b.className.replace("dhx_drop_zone","");return null},onDrop:function(a,b,c,d){var e=this.r[b.dhx_drop];if(e.onDrop&&e!=this)return e.onDrop(a,b,c,d);b.appendChild(a)},onDrag:function(a,b){var c=this.r[a.dhx_drag];
if(c.onDrag&&c!=this)return c.onDrag(a,b);dhtmlx.DragControl.o={source:a,from:a};return"<div style='"+a.style.cssText+"'>"+a.innerHTML+"</div>"}};
dhtmlx.DragItem={g:function(){if(!this.a||this.a.drag)dhtmlx.DragItem.wa(this);else if(this.a)this.drag_setter=function(a,b){if(b){this.wa(this);delete this.drag_setter}return b};if(this.dragMarker){this.attachEvent("onBeforeDragIn",this.dragMarker);this.attachEvent("onDragOut",this.dragMarker)}},wa:function(a){dhtmlx.DragControl.addDrop(a.b,a,true);dhtmlx.DragControl.addDrag(a.b,a)},onDragIn:function(a,b,c){b=this.locate(c)||null;var d=dhtmlx.DragControl.o,e=dhtmlx.DragControl.getMaster(a);a=this.m(b)||
this.b;if(a==dhtmlx.DragControl.A)return a;d.target=b;d.to=e;if(!this.callEvent("onBeforeDragIn",[d,c]))return d.id=null;dhtmlx.html.addCss(a,"dhx_drag_over");return a},onDragOut:function(a,b,c,d){a=this.locate(d)||null;c=this.m(a)||(c?dhtmlx.DragControl.getMaster(c).b:window.undefined);if(c==dhtmlx.DragControl.A)return null;c=dhtmlx.DragControl.o;dhtmlx.html.removeCss(dhtmlx.DragControl.A,"dhx_drag_over");c.target=c.to=null;this.callEvent("onDragOut",[c,d]);return null},onDrop:function(a,b,c,d){b=
dhtmlx.DragControl.o;b.from=dhtmlx.DragControl.getMaster(a);b.to=this;b.index=b.target?this.indexById(b.target):this.dataCount();b.new_id=dhtmlx.uid();if(this.callEvent("onBeforeDrop",[b,d])){if(b.from==b.to)this.move(b.source,b.index);else b.from&&b.from.move(b.source,b.index,b.to,b.new_id);this.callEvent("onAfterDrop",[b,d])}},onDrag:function(a,b){a=this.locate(b);var c=[a];if(a){if(this.getSelected){var d=this.getSelected();if(dhtmlx.PowerArray.find.call(d,a)!=-1)c=d}var e=dhtmlx.DragControl.o=
{source:c,start:a};e.from=this;if(this.callEvent("onBeforeDrag",[e,b]))return e.html||this.D(this.get(a))}return null}};
dhtmlx.EditAbility={g:function(){this.L=this.p=null;this.attachEvent("onEditKeyPress",function(a,b,c){if(a==13&&!c)this.stopEdit();else a==27&&this.stopEdit(true)});this.attachEvent("onBeforeRender",function(){this.stopEdit()})},isEdit:function(){return this.p},edit:function(a){if(this.stopEdit(false,a))if(this.callEvent("onBeforeEditStart",[a])){var b=this.data.get(a);if(!b.$template){b.$template="edit";this.data.refresh(a);this.p=a;this.pb(a);this.L(true,b);this.callEvent("onAfterEditStart",[a])}}},
stopEdit:function(a,b){if(!this.p)return true;if(this.p==b)return false;if(!this.callEvent("onBeforeEditStop",[this.p]))return false;var c=this.data.get(this.p);c.$template=null;a||this.L(false,c);a=this.p;this.L=this.p=null;this.data.refresh(a);this.callEvent("onAfterEditStop",[a]);return true},pb:function(a){var b=this.m(a),c="",d="",e=[];if(b){var g=b.getElementsByTagName("*"),i="";for(a=0;a<g.length;a++)if(g[a].nodeType==1&&(i=g[a].getAttribute("bind"))){c+="els["+e.length+"].value="+i+";";d+=
i+"=els["+e.length+"].value;";e.push(g[a]);g[a].className+=" dhx_allow_selection";g[a].onselectstart=this.Na}g=null}c=Function("obj","els",c);d=Function("obj","els",d);this.L=function(l,j){if(l){c(j,e);e.length&&e[0].select&&e[0].select()}else d(j,e)}},Na:function(a){return(a||event).cancelBubble=true}};
dhtmlx.KeyEvents={g:function(){dhtmlx.event(this.b,"keypress",this.gb,this)},gb:function(a){a=a||event;var b=a.which||a.keyCode;this.callEvent(this.p?"onEditKeyPress":"onKeyPress",[b,a.ctrlKey,a.shiftKey,a])}};
dhtmlx.MouseEvents={g:function(){if(this.on_click){dhtmlx.event(this.b,"click",this.db,this);dhtmlx.event(this.b,"contextmenu",this.eb,this)}this.on_dblclick&&dhtmlx.event(this.b,"dblclick",this.fb,this);if(this.on_mouse_move){dhtmlx.event(this.b,"mousemove",this.Ea,this);dhtmlx.event(this.b,dhtmlx.z?"mouseleave":"mouseout",this.Ea,this)}},db:function(a){return this.Z(a,this.on_click,"ItemClick")},fb:function(a){return this.Z(a,this.on_dblclick,"ItemDblClick")},eb:function(a){var b=dhtmlx.html.locate(a,
this.j);if(b&&!this.callEvent("onBeforeContextMenu",[b,a]))return dhtmlx.html.preventEvent(a)},Ea:function(a){if(dhtmlx.z)a=document.createEventObject(event);this.Aa&&window.clearTimeout(this.Aa);this.callEvent("onMouseMoving",[a]);this.Aa=window.setTimeout(dhtmlx.bind(function(){a.type=="mousemove"?this.hb(a):this.ib(a)},this),500)},hb:function(a){this.Z(a,this.on_mouse_move,"MouseMove")||this.callEvent("onMouseOut",[a||event])},ib:function(a){this.callEvent("onMouseOut",[a||event])},Z:function(a,
b,c){a=a||event;for(var d=a.target||a.srcElement,e="",g=null,i=false;d&&d.parentNode;){if(!i&&d.getAttribute)if(g=d.getAttribute(this.j)){if(!this.callEvent("on"+c,[g,a,d]))return;i=true}if(e=d.className){e=e.split(" ");e=e[0]||e[1];if(b[e])return b[e].call(this,a,g,d)}d=d.parentNode}return i}};
dhtmlx.SelectionModel={g:function(){this.e=dhtmlx.toArray();this.data.attachEvent("onStoreUpdated",dhtmlx.bind(this.Pa,this))},Pa:function(a,b,c){if(c=="delete")this.e.remove(a);else if(!this.data.dataCount())this.e=dhtmlx.toArray()},P:function(a,b,c){if(!c&&!this.callEvent("onBeforeSelect",[a,b]))return false;this.data.get(a).$selected=b;c?c.push(a):this.ba(a);return true},select:function(a,b,c){if(!a)return this.selectAll();if(a instanceof Array)for(var d=0;d<a.length;d++)this.select(a[d],b,c);
else{if(c&&this.e.length)return this.selectAll(this.e[this.e.length-1],a);if(!b&&(this.e.length!=1||this.e[0]!=a))this.unselectAll();if(this.isSelected(a))b&&this.unselect(a);else if(this.P(a,true)){this.e.push(a);this.callEvent("onAfterSelect",[a])}}},unselect:function(a){if(!a)return this.unselectAll();this.isSelected(a)&&this.P(a,false)&&this.e.remove(a)},selectAll:function(a,b){var c,d=[];c=a||b?this.data.getRange(a,b):this.data.getRange();c.each(function(e){var g=this.data.get(e.id);if(!g.$selected){this.e.push(e.id);
this.P(e.id,true,d)}return e.id},this);this.ba(d)},unselectAll:function(){var a=[];this.e.each(function(b){this.P(b,false,a)},this);this.e=dhtmlx.toArray();this.ba(a)},isSelected:function(a){return this.e.find(a)!=-1},getSelected:function(a){switch(this.e.length){case 0:return a?[]:"";case 1:return a?[this.e[0]]:this.e[0];default:return[].concat(this.e)}},ab:function(a){return a.length>100||a.length>this.data.dataCount/2},ba:function(a){if(typeof a!="object")a=[a];if(a.length){if(this.ab(a))this.data.refresh();
else for(var b=0;b<a.length;b++)this.render(a[b],this.data.get(a[b]),"update");this.callEvent("onSelectChange",[a])}}};
dhtmlx.RenderStack={g:function(){this.l=document.createElement("DIV")},D:function(a){this.callEvent("onItemRender",[a]);return this.type.ya(a,this.type)+(a.$template?this.type["template_"+a.$template]:this.type.template)(a,this.type)+this.type.xa},fa:function(a){this.l.innerHTML=this.D(a);return this.l.firstChild},m:function(a){if(this.d)return this.d[a];this.d={};for(var b=this.c.childNodes,c=0;c<b.length;c++){var d=b[c].getAttribute(this.j);if(d)this.d[d]=b[c]}return this.m(a)},locate:function(a){return dhtmlx.html.locate(a,
this.j)},show:function(a){if(a=this.m(a))this.c.scrollTop=a.offsetTop-this.c.offsetTop},render:function(a,b,c){if(a){var d=this.m(a);switch(c){case "update":if(!d)return;b=this.d[a]=this.fa(b);dhtmlx.html.insertBefore(b,d);dhtmlx.html.remove(d);break;case "delete":if(!d)return;dhtmlx.html.remove(d);delete this.d[a];break;case "add":b=this.d[a]=this.fa(b);dhtmlx.html.insertBefore(b,this.m(this.data.next(a)),this.c);break;case "move":this.render(a,b,"delete");this.render(a,b,"add");break;default:break}}else if(this.callEvent("onBeforeRender",
[this.data])){this.c.innerHTML=this.data.getRange().map(this.D,this).join("");this.d=null;this.callEvent("onAfterRender",[])}},pager_setter:function(a,b){this.attachEvent("onBeforeRender",function(){var e=this.a.pager.a;if(e.page==-1)return false;this.data.min=e.page*e.size;this.data.max=(e.page+1)*e.size-1;return true});var c=new dhtmlx.ui.pager(b),d=dhtmlx.bind(function(){this.data.refresh()},this);c.attachEvent("onRefresh",d);this.data.attachEvent("onStoreUpdated",function(){var e=this.dataCount();
if(e!=c.a.count){c.a.count=e;if(c.a.page==-1)c.a.page=0;c.refresh()}});return c},height_setter:function(a,b){if(b=="auto"){this.attachEvent("onAfterRender",this.ia);dhtmlx.event(window,"resize",dhtmlx.bind(this.ia,this))}return b},ia:function(){this.c.style.overflow="hidden";this.c.style.height="1px";var a=this.c.scrollHeight;this.c.style.height=a+"px";if(dhtmlx.$a){var b=this.c.scrollHeight;if(b!=a)this.c.style.height=b+"px"}this.b.style.height=this.c.style.height},X:function(){var a=this.type,b=
(a.border||0)+(a.padding||0)*2+(a.margin||0)*2;return{x:a.width+b,y:a.height+b}},x_count_setter:function(a,b){var c=this.X();this.c.style.width=c.x*b+(this.a.height!="auto"?18:0)+"px";return b},y_count_setter:function(a,b){a=this.X();this.c.style.height=a.y*b+"px";return b}};
dhtmlx.VirtualRenderStack={g:function(){this.d={};this.c.style.overflowY="scroll";dhtmlx.event(this.c,"scroll",dhtmlx.bind(this.Ha,this));dhtmlx.event(window,"resize",dhtmlx.bind(function(){this.render()},this));this.I=[];this.attachEvent("onItemRender",function(a){a.$template=="loading"&&this.I.push(this.data.id(a))})},m:function(a){return this.d[a]},show:function(a){range=this.ua();var b=this.data.indexById(a),c=Math.floor(b/range.W)*range.S;this.c.scrollTop=c},render:function(a,b,c){if(a){var d=
this.m(a);switch(c){case "update":if(!d)return;a=this.d[a]=this.fa(b);dhtmlx.html.insertBefore(a,d);dhtmlx.html.remove(d);break;default:this.nb();break}}else if(this.callEvent("onBeforeRender",[this.data])){this.d={};this.Ha(null,true);this.La=false;this.callEvent("onAfterRender",[])}},nb:function(){if(!this.La){this.La=true;window.setTimeout(dhtmlx.bind(function(){this.render()},this),1)}},U:function(a){var b=document.createElement("DIV");b.style.cssText="height:"+a+"px; width:100%; overflow:hidden;";
return b},Ha:function(a,b){this.I=[];var c=this.ua();if(!this.c.firstChild||b){this.c.innerHTML="";this.c.appendChild(this.U(c.cb));this.u=[this.c.firstChild]}for(a=c.s;a<=c.Y;){for(;this.u[a]&&this.u[a].Va&&a<=c.Y;)a++;if(a>c.Y)break;for(var d=a;!this.u[d];)d--;var e=this.u[d],g=a*c.W+(this.data.min||0);if(g>(this.data.max||Infinity))break;var i=Math.min(g+c.W-1,this.data.max||Infinity),l=this.U(c.S),j=this.data.getIndexRange(g,i);if(!j.length)break;l.innerHTML=j.map(this.D,this).join("");for(var m=
0;m<j.length;m++)this.d[this.data.idByIndex(g+m)]=l.childNodes[m];var p=parseInt(e.style.height,10),q=(a-d)*c.S,n=p-q-c.S;dhtmlx.html.insertBefore(l,q?e.nextSibling:e,this.c);this.u[a]=l;l.Va=true;if(q<=0&&n>0){e.style.height=n+"px";this.u[a+1]=e}else{if(q<0)dhtmlx.html.remove(e);else e.style.height=q+"px";if(n>0){var w=this.u[a+1]=this.U(n);dhtmlx.html.insertBefore(w,l.nextSibling,this.c)}}a++}if(this.I.length){a=this.indexById(this.I[0]);l=this.indexById(this.I.pop())+1;if(l>a){if(!this.callEvent("onDataRequest",
[a,l-a]))return false;this.data.feed.call(this,a,l-a)}}},ua:function(){var a=this.c.scrollTop,b=Math.max(this.c.scrollWidth,this.c.offsetWidth)-18,c=this.c.offsetHeight,d=this.X(),e=Math.floor(b/d.x)||1,g=Math.floor(a/d.y);c=Math.ceil((c+a)/d.y)-1;var i=this.data.max?this.data.max-this.data.min:this.data.dataCount(),l=Math.ceil(i/e)*d.y;return{s:g,Y:c,xb:a,cb:l,S:d.y,W:e}}};
dhtmlx.DataStore=function(){this.name="DataStore";dhtmlx.extend(this,dhtmlx.EventSystem);this.setDriver("xml");this.pull={};this.order=dhtmlx.toArray()};
dhtmlx.DataStore.prototype={setDriver:function(a){this.driver=dhtmlx.DataDriver[a]},jb:function(a){for(var b=this.driver.getInfo(a),c=this.driver.getRecords(a),d=(b.s||0)*1,e=0,g=0;g<c.length;g++){var i=this.driver.getDetails(c[g]),l=this.id(i);if(!this.pull[l]){this.order[e+d]=l;e++}this.pull[l]=i}for(g=0;g<b.C;g++)if(!this.order[g]){l=dhtmlx.uid();i={id:l,$template:"loading"};this.pull[l]=i;this.order[g]=l}this.callEvent("onStoreLoad",[this.driver,a]);this.refresh()},id:function(a){return a.id||
(a.id=dhtmlx.uid())},get:function(a){return this.pull[a]},set:function(a,b){this.pull[a]=b;this.refresh()},refresh:function(a){a?this.callEvent("onStoreUpdated",[a,this.pull[a],"update"]):this.callEvent("onStoreUpdated",[null,null,null])},getRange:function(a,b){if(arguments.length){a=this.indexById(a);b=this.indexById(b);if(a>b){var c=b;b=a;a=c}}else{a=this.min||0;b=Math.min(this.max||Infinity,this.dataCount()-1)}return this.getIndexRange(a,b)},getIndexRange:function(a,b){b=Math.min(b,this.dataCount()-
1);var c=dhtmlx.toArray();for(a=a;a<=b;a++)c.push(this.get(this.order[a]));return c},dataCount:function(){return this.order.length},exists:function(a){return!!this.pull[a]},move:function(a,b){if(!(a<0||b<0)){var c=this.idByIndex(a),d=this.get(c);this.order.removeAt(a);this.order.insertAt(c,Math.min(this.order.length,b));this.callEvent("onStoreUpdated",[c,d,"move"])}},add:function(a,b){var c=this.id(a),d=this.dataCount();if(dhtmlx.isNotDefined(b)||b<0)b=d;if(b>d)b=Math.min(this.order.length,b);if(this.callEvent("onbeforeAdd",
[c,b])){if(this.exists(c))return null;this.pull[c]=a;this.order.insertAt(c,b);if(this.q){var e=this.q.length;if(!b&&this.order.length)e=0;this.q.insertAt(c,e)}this.callEvent("onafterAdd",[c,b]);this.callEvent("onStoreUpdated",[c,a,"add"]);return c}},remove:function(a){if(a instanceof Array)for(var b=0;b<a.length;b++)this.remove(a[b]);else if(this.callEvent("onbeforedelete",[a])){if(!this.exists(a))return null;b=this.get(a);this.order.remove(a);this.q&&this.q.remove(a);delete this.pull[a];this.callEvent("onafterdelete",
[a]);this.callEvent("onStoreUpdated",[a,b,"delete"])}},clearAll:function(){this.pull={};this.order=dhtmlx.toArray();this.q=null;this.callEvent("onClearAll",[]);this.refresh()},idByIndex:function(a){return this.order[a]},indexById:function(a){return a=this.order.find(a)},next:function(a,b){return this.order[this.indexById(a)+(b||1)]},first:function(){return this.order[0]},last:function(){return this.order[this.order.length-1]},previous:function(a,b){return this.order[this.indexById(a)-(b||1)]},sort:function(a,
b,c){var d=a;if(typeof a=="function")d={as:a,dir:b};else if(typeof a=="string")d={by:a,dir:b,as:c};var e=[d.by,d.dir,d.as];if(this.callEvent("onbeforesort",e)){var g=dhtmlx.sort.create(d),i=this.getRange();i.sort(g);this.order=i.map(function(l){return this.id(l)},this);this.refresh();this.callEvent("onaftersort",e)}},filter:function(a,b){if(this.q){this.order=this.q;delete this.q}if(a){var c=a;if(typeof a=="string"){a=dhtmlx.Template.setter(0,a);c=function(e,g){return a(e).toLowerCase().indexOf(g)!=
-1}}b=(b||"").toString().toLowerCase();var d=dhtmlx.toArray();this.order.each(function(e){c(this.get(e),b)&&d.push(e)},this);this.q=this.order;this.order=d}this.refresh()},each:function(a,b){for(var c=0;c<this.order.length;c++)a.call(b||this,this.get(this.order[c]))},provideApi:function(a,b){b&&this.mapEvent({onbeforesort:a,onaftersort:a,onbeforeadd:a,onafteradd:a,onbeforedelete:a,onafterdelete:a});for(var c=["sort","add","remove","exists","idByIndex","indexById","get","set","refresh","dataCount",
"filter","next","previous","clearAll","first","last"],d=0;d<c.length;d++)a[c[d]]=dhtmlx.methodPush(this,c[d])}};
dhtmlx.sort={create:function(a){return dhtmlx.sort.dir(a.dir,dhtmlx.sort.by(a.by,a.as))},as:{"int":function(a,b){a*=1;b*=1;return a>b?1:a<b?-1:0},string_strict:function(a,b){a=a.toString();b=b.toString();return a>b?1:a<b?-1:0},string:function(a,b){a=a.toString().toLowerCase();b=b.toString().toLowerCase();return a>b?1:a<b?-1:0}},by:function(a,b){if(typeof b!="function")b=dhtmlx.sort.as[b||"string"];a=dhtmlx.Template.setter(0,a);return function(c,d){return b(a(c),a(d))}},dir:function(a,b){if(a=="asc")return b;
return function(c,d){return b(c,d)*-1}}};dhtmlx.ajax=function(a,b,c){if(arguments.length!==0){var d=new dhtmlx.ajax;if(c)d.master=c;d.get(a,null,b)}if(!this.getXHR)return new dhtmlx.ajax;return this};
dhtmlx.ajax.prototype={getXHR:function(){return dhtmlx.z?new ActiveXObject("Microsoft.xmlHTTP"):new XMLHttpRequest},send:function(a,b,c){var d=this.getXHR();if(typeof c=="function")c=[c];if(typeof b=="object"){var e=[];for(var g in b)e.push(g+"="+encodeURIComponent(b[g]));b=e.join("&")}if(b&&!this.post){a=a+(a.indexOf("?")!=-1?"&":"?")+b;b=null}d.open(this.post?"POST":"GET",a,!this.Ka);this.post&&d.setRequestHeader("Content-type","application/x-www-form-urlencoded");if(!this.Ka){var i=this;d.onreadystatechange=
function(){if(!d.readyState||d.readyState==4){if(c&&i)for(var l=0;l<c.length;l++)if(c[l])c[l].call(i.master||i,d.responseText,d.responseXML,d);c=d=i=i.master=null}}}d.send(b||null);return d},get:function(a,b,c){this.post=false;return this.send(a,b,c)},post:function(a,b,c){this.post=true;return this.send(a,b,c)},sync:function(){this.Ka=true;return this}};
dhtmlx.DataLoader={g:function(){this.data=new dhtmlx.DataStore},load:function(a,b,c){this.callEvent("onXLS",[]);if(typeof b=="string"){this.data.setDriver(b);b=c}if(!this.data.feed)this.data.feed=function(d,e){if(this.M)return this.M=[d,e];else this.M=true;this.load(a+(a.indexOf("?")==-1?"?":"&")+"posStart="+d+"&count="+e,function(){var g=this.M;this.M=false;typeof g=="object"&&this.data.feed.apply(this,g)})};dhtmlx.ajax(a,[this.Da,b],this)},parse:function(a,b){this.callEvent("onXLS",[]);b&&this.data.setDriver(b);
this.Da(a,null)},Da:function(a,b){this.data.jb(this.data.driver.toObject(a,b));this.callEvent("onXLE",[])}};dhtmlx.DataDriver={};dhtmlx.DataDriver.json={toObject:function(a){if(typeof a=="string"){eval("dhtmlx.temp="+a);return dhtmlx.temp}return a},getRecords:function(a){if(a&&!(a instanceof Array))return[a];return a},getDetails:function(a){return a},getInfo:function(a){return{C:a.total_count||0,s:a.pos||0}}};
dhtmlx.DataDriver.html={toObject:function(a){if(typeof a=="string"){var b=null;if(a.indexOf("<")==-1)b=dhtmlx.toNode(a);if(!b){b=document.createElement("DIV");b.innerHTML=a}return b.getElementsByTagName(this.tag)}return a},getRecords:function(a){if(a.tagName)return a.childNodes;return a},getDetails:function(a){return dhtmlx.DataDriver.xml.tagToObject(a)},getInfo:function(){return{C:0,s:0}},tag:"LI"};
dhtmlx.DataDriver.jsarray={toObject:function(a){if(typeof a=="string"){eval("dhtmlx.temp="+a);return dhtmlx.temp}return a},getRecords:function(a){return a},getDetails:function(a){for(var b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{C:0,s:0}}};
dhtmlx.DataDriver.csv={toObject:function(a){return a},getRecords:function(a){return a.split(this.row)},getDetails:function(a){a=this.stringToArray(a);for(var b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{C:0,s:0}},stringToArray:function(a){a=a.split(this.cell);for(var b=0;b<a.length;b++)a[b]=a[b].replace(/^[ \t\n\r]*(\"|)/g,"").replace(/(\"|)[ \t\n\r]*$/g,"");return a},row:"\n",cell:","};
dhtmlx.DataDriver.xml={toObject:function(a,b){if(b&&(b=this.checkResponse(a,b)))return b;if(typeof a=="string")return this.fromString(a);return a},getRecords:function(a){return this.xpath(a,this.records)},records:"/*/item",userdata:"/*/userdata",getDetails:function(a){return this.tagToObject(a,{})},getUserData:function(a,b){b=b||{};var c=this.xpath(a,this.userdata);for(a=0;a<c.length;a++){var d=this.tagToObject(c[a]);b[d.name]=d.value}return b},getInfo:function(a){return{C:a.documentElement.getAttribute("total_count")||
0,s:a.documentElement.getAttribute("pos")||0}},xpath:function(a,b){if(window.XPathResult){var c=a;if(a.nodeName.indexOf("document")==-1)a=a.ownerDocument;var d=[];a=a.evaluate(b,c,null,XPathResult.ANY_TYPE,null);for(b=a.iterateNext();b;){d.push(b);b=a.iterateNext()}return d}return a.selectNodes(b)},tagToObject:function(a,b){b=b||{};for(var c=a.attributes,d=0;d<c.length;d++)b[c[d].name]=c[d].value;var e=false,g=a.childNodes;for(d=0;d<g.length;d++)if(g[d].nodeType==1){var i=g[d].tagName;if(typeof b[i]!=
"undefined"){b[i]instanceof Array||(b[i]=[b[i]]);b[i].push(this.tagToObject(g[d],{}))}else b[g[d].tagName]=this.tagToObject(g[d],{});e=true}if(!c.length&&!e)return this.nodeValue(a);b.value=this.nodeValue(a);return b},nodeValue:function(a){if(a.firstChild)return a.firstChild.data;return""},fromString:function(a){if(window.DOMParser)return(new DOMParser).parseFromString(a,"text/xml");if(window.ActiveXObject){temp=new ActiveXObject("Microsoft.xmlDOM");temp.loadXML(a);return temp}},checkResponse:function(a,
b){if(b&&b.firstChild&&b.firstChild.tagName!="parsererror")return b;if(a=this.from_string(a.responseText.replace(/^[\s]+/,"")))return a}};if(!dhtmlx.attaches)dhtmlx.attaches={};
dhtmlx.attaches.attachAbstract=function(a,b){var c=document.createElement("DIV");c.id="CustomObject_"+dhtmlx.uid();c.style.width="100%";c.style.height="100%";c.cmp="grid";document.body.appendChild(c);this.attachObject(c.id);b.container=c.id;var d=this.vs[this.av];d.grid=new window[a](b);d.gridId=c.id;d.gridObj=c;d.grid.setSizes=function(){this.resize?this.resize():this.render()};var e="_viewRestore";return this.vs[this[e]()].grid};
dhtmlx.attaches.attachDataView=function(a){return this.attachAbstract("dhtmlXDataView",a)};dhtmlx.attaches.attachChart=function(a){return this.attachAbstract("dhtmlXChart",a)};dhtmlx.compat.layout=function(){};
dhtmlXDataView=function(a){this.name="DataView";this.version="3.0";dhtmlx.extend(this,dhtmlx.Settings);this.$(a,"dhx_dataview");dhtmlx.extend(this,dhtmlx.DataLoader);dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.RenderStack);dhtmlx.extend(this,dhtmlx.SelectionModel);dhtmlx.extend(this,dhtmlx.MouseEvents);dhtmlx.extend(this,dhtmlx.KeyEvents);dhtmlx.extend(this,dhtmlx.EditAbility);dhtmlx.extend(this,dhtmlx.DataMove);dhtmlx.extend(this,dhtmlx.DragItem);dhtmlx.extend(this,dhtmlx.DataProcessor);
dhtmlx.extend(this,dhtmlx.AutoTooltip);dhtmlx.extend(this,dhtmlx.Destruction);this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render.apply(this,arguments)},this));this.O(a,{drag:false,edit:false,select:"multiselect",type:"default"});this.a.height!="auto"&&dhtmlx.extend(this,dhtmlx.VirtualRenderStack);this.data.provideApi(this,true)};
dhtmlXDataView.prototype={dragMarker:function(a){var b=this.m(a.target);if(this.type.drag_marker){if(this.V){this.V.style.backgroundImage="";this.V.style.backgroundRepeat=""}if(b){b.style.backgroundImage="url("+(dhtmlx.image_path||"")+this.type.drag_marker+")";b.style.backgroundRepeat="no-repeat";this.V=b}}if(b&&this.a.auto_scroll){a=b.offsetTop;var c=b.offsetHeight,d=this.b.scrollTop,e=this.b.offsetHeight;if(a-c>0&&a-c*0.75<d)d=Math.max(a-c,0);else if(a+c/0.75>d+e)d+=c;this.b.scrollTop=d}return true},
j:"dhx_f_id",on_click:{dhx_dataview_item:function(a,b){if(this.stopEdit(false,b))if(this.a.select)this.a.select=="multiselect"?this.select(b,a.ctrlKey,a.shiftKey):this.select(b)}},on_dblclick:{dhx_dataview_item:function(a,b){this.a.edit&&this.edit(b)}},on_mouse_move:{},types:{"default":{css:"default",template:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'>{obj.text}</div>"),template_edit:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'><textarea style='width:100%; height:100%;' bind='obj.text'></textarea></div>"),
template_loading:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'>Loading...</div>"),width:210,height:115,margin:0,padding:10,border:1}},template_item_start:dhtmlx.Template.fromHTML("<div dhx_f_id='{-obj.id}' class='dhx_dataview_item dhx_dataview_{obj.css}_item{-obj.$selected?_selected:}' style='width:{obj.width}px; height:{obj.height}px; padding:{obj.padding}px; margin:{obj.margin}px; float:left; overflow:hidden;'>"),template_item_end:dhtmlx.Template.fromHTML("</div>")};
dhtmlx.compat("layout");dhtmlx.math={};dhtmlx.math.tb=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];dhtmlx.math.toHex=function(a,b){a=parseInt(a,10);for(str="";a>0;){str=this.tb[a%16]+str;a=Math.floor(a/16)}for(;str.length<b;)str="0"+str;return str};dhtmlx.ui.Map=function(a){this.name="Map";this.j="map_"+dhtmlx.uid();this.bb=a;this.B=[]};
dhtmlx.ui.Map.prototype={addRect:function(a,b){this.ka(a,"RECT",b)},addPoly:function(a,b){this.ka(a,"POLY",b)},ka:function(a,b,c){this.B.push("<area "+this.bb+"='"+a+"' shape='"+b+"' coords='"+c.join()+"'></area>")},addSector:function(a,b,c,d,e,g,i){var l=[];l.push(d);l.push(Math.floor(e*i));for(var j=b;j<c;j+=Math.PI/18){l.push(Math.floor(d+g*Math.cos(j)));l.push(Math.floor((e+g*Math.sin(j))*i))}l.push(Math.floor(d+g*Math.cos(c)));l.push(Math.floor((e+g*Math.sin(c))*i));l.push(d);l.push(Math.floor(e*
i));return this.addPoly(a,l)},render:function(a){var b=dhtmlx.html.create("DIV");b.style.cssText="position:absolute; width:100%; height:100%; top:0px; left:0px;";a.appendChild(b);var c=dhtmlx.z?"":"src='data:image/gif;base64,R0lGODlhEgASAIAAAP///////yH5BAUUAAEALAAAAAASABIAAAIPjI+py+0Po5y02ouz3pwXADs='";b.innerHTML="<map id='"+this.j+"' name='"+this.j+"'>"+this.B.join("\n")+"</map><img "+c+" class='dhx_map_img' usemap='#"+this.j+"'>";a.d=b;this.B=[]}};if(!dhtmlx.chart)dhtmlx.chart={};
dhtmlx.chart.line={pvt_render_line:function(a,b,c,d){var e,g,i,l,j,m,p=new dhtmlx.ui.Map(this.j),q=!!this.a.yAxis;if(q&&typeof this.a.yAxis.end!="undefied"&&typeof this.a.yAxis.start!="undefied"&&this.a.yAxis.step){e=parseFloat(this.a.yAxis.end);g=parseFloat(this.a.yAxis.start)}else{e=this.max(this.a.value);g=this.min(this.a.value)}this.ra(a,b,c,d,g,e);if(q){e=parseFloat(this.a.yAxis.end);g=parseFloat(this.a.yAxis.start)}var n=parseInt(this.a.padding.top,10),w=parseInt(this.a.padding.left,10),z=parseInt(this.a.padding.bottom,
10),A=parseInt(this.a.padding.right,10),r=d-n-z;if(g!=e){var D=this.ta(g,e);l=D[0];i=D[1];j=r/l;if(!q){m=j>10?j:10;j=(r-m)/l}}else{i=1;m=0;j=(r-10)/e}var O=Math.round((c-w-A)/b.length),K=Math.floor(O/2);if(b.length){for(var P=function(G){G=this.a.value(G);var H=(parseFloat(G)-g)*i;q||(H+=m/j);if(g==e)H=e;var x=d-Math.floor(j*H)-z;if(H<0)x=d-n;if(G>e)x=n;if(G<g)x=d-z;return x},v=P.call(this,b[0]),B=1;B<=b.length;B++){var C=Math.floor(O*(B-0.5))-0.5+w,I=Math.floor(O*(B+0.5))-0.5+w;this.qa(C,b[B-1]);
this.Ua(a,C,d-z,n);if(b.length!=B){var Q=P.call(this,b[B]);this.w(a,C,v,I,Q,this.a.line.color(b[B-1]),this.a.line.width)}this.Sa(a,C,v,b[B-1]);p.addRect(b[B-1].id,[C-K,v-K,C+K,v+K]);v=Q}P=null}this.pa(a,b,c,d);p.render(this.b)},Sa:function(a,b,c,d){var e=parseInt(this.a.item.radius,10);a.lineWidth=parseInt(this.a.item.borderWidth,10);a.fillStyle=this.a.item.color(d);a.strokeStyle=this.a.item.borderColor(d);a.beginPath();a.arc(b,c,e,0,Math.PI*2,true);a.fill();a.stroke();this.renderTextAt(false,true,
b,c-e-this.a.labelOffset,this.a.label(d))}};if(!dhtmlx.chart)dhtmlx.chart={};
dhtmlx.chart.bar={pvt_render_bar:function(a,b,c,d){var e,g,i,l,j,m,p=new dhtmlx.ui.Map(this.j),q=!!this.a.yAxis,n=!!this.a.xAxis;if(q&&typeof this.a.yAxis.end!="undefied"&&typeof this.a.yAxis.start!="undefied"&&this.a.yAxis.step){e=parseFloat(this.a.yAxis.end);g=parseFloat(this.a.yAxis.start)}else{e=this.max(this.a.value);g=this.min(this.a.value)}this.ra(a,b,c,d,g,e);if(q){e=parseFloat(this.a.yAxis.end);g=parseFloat(this.a.yAxis.start)}var w=parseInt(this.a.padding.top,10),z=parseInt(this.a.padding.left,
10),A=parseInt(this.a.padding.bottom,10),r=d-w-A;if(e!=g){i=this.ta(g,e);l=i[0];i=i[1];j=r/l;if(!q){m=j>10?j:10;j=(r-m)/l}}else{i=1;m=0;j=(r-10)/e}l=Math.floor((c-z-parseInt(this.a.padding.right,10))/b.length);var D=parseInt(this.a.width,10);if(D>l)D=l-2;var O=Math.floor((l-D)/2),K=typeof this.a.radius!="undefined"?parseInt(this.a.radius,10):Math.round(D/5),P=false,v=this.a.gradient;if(v===true){P=true;v=false}else if(v){v=a.createLinearGradient(0,d-w,0,A);this.a.gradient(v)}var B=0;if(A&&!n){B=d-
A;this.w(a,0,B+0.5,c,B+0.5,"#000000",1)}for(n=0;n<b.length;n++){r=parseFloat(this.a.value(b[n]));if(r>e)r=e;r-=g;r*=i;if(g==e)r=e;var C=z+O+n*l,I=d-A;this.qa(C+Math.floor(D/2),b[n]);if(r<0||this.a.yAxis&&r===0)this.renderTextAt(true,true,C+Math.floor(D/2),I,this.a.label(b[n]));else{q||(r+=m/j);var Q=v||this.a.color.call(this,b[n]);if(this.a.border){a.beginPath();a.fillStyle=Q;this.Q(a,C,I,D,K,j,r,0);a.lineTo(C,0);a.fill();a.fillStyle="#000000";a.globalAlpha=0.37;a.beginPath();this.Q(a,C,I,D,K,j,r,
0);a.fill()}a.globalAlpha=this.a.alpha.call(this,b[n]);a.fillStyle=v||this.a.color.call(this,b[n]);a.beginPath();var G=this.Q(a,C,I,D,K,j,r,this.a.border?1:0);if(v&&!P)a.lineTo(C+(this.a.border?1:0),0);a.fill();a.globalAlpha=1;if(P){var H=a.createLinearGradient(0,I-j*r+2,0,I);H.addColorStop(0,Q);H.addColorStop(0.1,Q);H.addColorStop(1,"#FFFFFF");a.fillStyle=H;a.beginPath();G=this.Q(a,C+2,I,D-4,K,j,r,1);a.fill()}this.renderTextAt(true,true,C+Math.floor(D/2),G[1],this.a.label(b[n]));p.addRect(b[n].id,
[C,G[1],G[0],I])}}this.pa(a,b,c,d);p.render(this.b)},Q:function(a,b,c,d,e,g,i,l){var j=0;if(e>g*i){var m=(e-g*i)/e;j=-Math.acos(m)+Math.PI/2}a.moveTo(b+l,c);var p=c-Math.floor(g*i)+e+(e?0:l);e<g*i&&a.lineTo(b+l,p);g=b+e;e&&a.arc(g,p,e-l,-Math.PI+j,-Math.PI/2,false);var q=b+d-e-(e?0:l),n=p-e+(e?l:0);a.lineTo(q,n);var w=p;e&&a.arc(q,w,e-l,-Math.PI/2,0-j,false);var z=b+d-l;a.lineTo(z,c);a.lineTo(b+l,c);return[z,n]}};if(!dhtmlx.chart)dhtmlx.chart={};
dhtmlx.chart.pie={pvt_render_pie:function(a,b,c,d){this.Ga(a,b,c,d,1)},pvt_render_pie3D:function(a,b,c,d){this.Ga(a,b,c,d,this.a.cant)},Ga:function(a,b,c,d,e){var g=new dhtmlx.ui.Map(this.j),i=0,l=this.Xa(c,d),j=this.a.radius?this.a.radius:l.radius;this.max(this.a.value);var m=[],p=[],q=0;if(this.a.legend)this.a.legend.total_height=this.a.legend.height*b.length;for(var n=0;n<b.length;n++)i+=parseFloat(this.a.value(b[n]));for(n=0;n<b.length;n++){p[n]=parseFloat(this.a.value(b[n]));m[n]=Math.PI*2*((p[n]+
q)/i);q+=p[n]}var w=this.a.x?this.a.x:l.x,z=this.a.y?this.a.y:l.y;e==1&&this.a.shadow&&this.Ma(a,w,z,j);z/=e;var A=-Math.PI/2;a.scale(1,e);for(n=0;n<b.length;n++){a.lineWidth=2;a.beginPath();a.moveTo(w,z);alpha1=-Math.PI/2+m[n];a.arc(w,z,j,A,alpha1,false);a.lineTo(w,z);var r=this.a.color.call(this,b[n]);a.fillStyle=r;a.strokeStyle=this.a.lineColor(b[n]);a.stroke();a.fill();this.a.pieInnerText&&this.na(w,z,5*j/6,A,alpha1,e,this.a.pieInnerText(b[n],i),true);this.a.label&&this.na(w,z,j+this.a.labelOffset,
A,alpha1,e,this.a.label(b[n]));if(e!=1){this.ja(a,w,z,A,alpha1,j,true);a.fillStyle="#000000";a.globalAlpha=0.2;this.ja(a,w,z,A,alpha1,j,false);a.globalAlpha=1;a.fillStyle=r}g.addSector(b[n].id,A,alpha1,w,z,j,e);A=alpha1;if(this.a.legend){a.scale(1,1/e);this.Ta(a,b[n],c,d,n);a.scale(1,e)}}g.render(this.b);if(this.a.gradient){b=e!=1?w+j/3:w;c=e!=1?z+j/3:z;this.rb(a,w,z,j,b,c)}a.scale(1,1/e)},Ta:function(a,b,c,d,e){var g=this.a.legend;a.strokeStyle=a.fillStyle;a.lineWidth=g.marker.height;a.lineCap=g.marker.type;
a.beginPath();var i=5+a.lineWidth/2;c=5+a.lineWidth/2;if(g.align=="right")i+=this.b.offsetWidth-g.width;if(g.valign=="bottom"&&d>g.total_height)c+=d-g.total_height-a.lineWidth/2;if(g.valign=="middle"&&d>g.total_height)c+=(d-g.total_height)/2-a.lineWidth/2;c+=e*g.height;a.moveTo(i,c);d=i+g.marker.width-g.marker.height+1;a.lineTo(d,c);a.stroke();this.renderText(d+g.marker.width/2+5,c-g.marker.height/2,g.template(b))},Xa:function(a,b){var c=0;if(this.a.legend)c=this.a.legend.width*(this.a.legend.align==
"right"?-1:1);a=(a+c)/2;b/=2;c=Math.min(a,b)-this.a.padding.top;return{x:a,y:b,radius:c}},ja:function(a,b,c,d,e,g,i){a.lineWidth=1;if(d<=0&&e>=0||d>=0&&e<=Math.PI||d<=Math.PI&&e>=Math.PI){if(d<0&&e>0){d=0;this.oa(a,b,c,g,d,e)}if(d<Math.PI&&e>Math.PI){e=Math.PI;this.oa(a,b,c,g,d,e)}var l=(this.a.height||Math.floor(g/4))/this.a.cant;a.beginPath();a.arc(b,c,g,d,e,false);a.lineTo(b+g*Math.cos(e),c+g*Math.sin(e)+l);a.arc(b,c+l,g,e,d,true);a.lineTo(b+g*Math.cos(d),c+g*Math.sin(d));a.fill();i&&a.stroke()}},
oa:function(a,b,c,d,e,g){a.beginPath();a.arc(b,c,d,e,g,false);a.stroke()},Ma:function(a,b,c,d){for(var e=["#676767","#7b7b7b","#a0a0a0","#bcbcbc","#d1d1d1","#d6d6d6"],g=e.length-1;g>-1;g--){a.beginPath();a.fillStyle=e[g];a.arc(b+2,c+2,d+g,0,Math.PI*2,true);a.fill()}},Wa:function(a){a.addColorStop(0,"#ffffff");a.addColorStop(0.7,"#7a7a7a");a.addColorStop(1,"#000000");return a},rb:function(a,b,c,d,e,g){a.globalAlpha=0.3;a.beginPath();var i;if(typeof this.a.gradient!="function"){i=a.createRadialGradient(e,
g,d/4,b,c,d);i=this.Wa(i)}else i=this.a.gradient(i);a.fillStyle=i;a.arc(b,c,d,0,Math.PI*2,true);a.fill();a.globalAlpha=1},na:function(a,b,c,d,e,g,i,l){if(i=this.renderText(0,0,i,0,1)){var j=i.scrollWidth;i.style.width=j+"px";if(j>a)j=a;var m=8;if(l)m=j/1.8;var p=d+(e-d)/2;c-=(m-8)/2;var q=-m,n=-8,w="left";if(p>=Math.PI/2&&p<Math.PI){q=-j-q+1;w="right"}if(p<=3*Math.PI/2&&p>=Math.PI){q=-j-q+1;w="right"}d=(b+Math.floor(c*Math.sin(p)))*g+n;m=a+Math.floor((c+m/2)*Math.cos(p))+q;var z=e<Math.PI/2+0.01,
A=p<Math.PI/2;if(A&&z)m=Math.max(m,a+3);else if(!A&&!z)m=Math.min(m,a-j);if(!l&&g<1&&d>b*g)d+=this.a.height||Math.floor(c/4);i.style.top=d+"px";i.style.left=m+"px";i.style.width=j+"px";i.style.textAlign=w;i.style.whiteSpace="nowrap"}}};
dhtmlx.Group={g:function(){this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(){this.a.group&&this.group(this.a.group,false)},this));this.attachEvent("onBeforeRender",dhtmlx.bind(function(a){if(this.a.sort){a.block();a.sort(this.a.sort);a.unblock()}},this));this.attachEvent("onBeforeSort",dhtmlx.bind(function(){this.a.sort=null},this))},Za:function(a,b){a.attachEvent("onClearAll",dhtmlx.bind(function(){this.ungroup(false)},b))},sum:function(a,b){a=dhtmlx.Template.setter(0,a);b=b||this.data;
var c=0;b.each(function(d){c+=a(d)*1});return c},min:function(a,b){a=dhtmlx.Template.setter(0,a);b=b||this.data;var c=Infinity;b.each(function(d){if(a(d)*1<c)c=a(d)*1});return c*1},max:function(a,b){a=dhtmlx.Template.setter(0,a);b=b||this.data;var c=-Infinity;b.each(function(d){if(a(d)*1>c)c=a(d)*1});return c},sb:function(a){var b=function(j,m){j=dhtmlx.Template.setter(0,j);return j(m[0])},c=dhtmlx.Template.setter(0,a.by);a.map[c]||(a.map[c]=[c,b]);var d={},e=[];this.data.each(function(j){var m=c(j);
if(!d[m]){e.push({id:m});d[m]=dhtmlx.toArray()}d[m].push(j)});for(var g in a.map){var i=a.map[g][1]||b;if(typeof i!="function")i=this[i];for(var l=0;l<e.length;l++)e[l][g]=i.call(this,a.map[g][0],d[e[l].id])}this.Ca=this.data;this.data=new dhtmlx.DataStore;this.data.provideApi(this,true);this.Za(this.data,this);this.parse(e,"json")},group:function(a,b){this.ungroup(false);this.sb(a);b!==false&&this.render()},ungroup:function(a){if(this.Ca){this.data=this.Ca;this.data.provideApi(this,true)}a!==false&&
this.render()},group_setter:function(a,b){return b},sort_setter:function(a,b){if(typeof b!="object")b={by:b};this.v(b,{as:"string",dir:"asc"});return b}};dhtmlx.DataDriver.dhtmlxgrid={Ya:"_get_cell_value",toObject:function(a){return this.va=a},getRecords:function(a){return a.rowsBuffer},getDetails:function(a){for(var b={},c=0;c<this.va.getColumnsNum();c++)b["data"+c]=this.va[this.Ya](a,c);return b},getInfo:function(){return{C:0,s:0}}};
dhtmlx.Canvas={g:function(){this.J=[]},lb:function(a){this.k=dhtmlx.html.create("canvas",{width:a.offsetWidth,height:a.offsetHeight});a.appendChild(this.k);if(!this.k.getContext)if(dhtmlx.z){dhtmlx.require("thirdparty/excanvas/excanvas.js");G_vmlCanvasManager.init_(document);G_vmlCanvasManager.initElement(this.k)}return this.k},getCanvas:function(a){return(this.k||this.lb(this.b)).getContext(a||"2d")},ob:function(){if(this.k){this.k.setAttribute("width",this.k.parentNode.offsetWidth);this.k.setAttribute("height",
this.k.parentNode.offsetHeight)}},renderText:function(a,b,c,d,e){if(c){a=dhtmlx.html.create("DIV",{"class":"dhx_canvas_text"+(d?" "+d:""),style:"left:"+a+"px; top:"+b+"px;"},c);this.b.appendChild(a);this.J.push(a);if(e)a.style.width=e+"px";return a}},renderTextAt:function(a,b,c,d,e,g,i){if(e=this.renderText.call(this,c,d,e,g,i)){if(a)e.style.top=d-e.offsetHeight+"px";if(b)e.style.left=parseInt(c-e.offsetWidth/2,10)+"px"}},clearCanvas:function(){for(var a=0;a<this.J.length;a++)this.b.removeChild(this.J[a]);
this.J=[];if(this.b.d){this.b.d.parentNode.removeChild(this.b.d);this.b.d=null}this.getCanvas().clearRect(0,0,this.k.offsetWidth,this.k.offsetHeight)}};
dhtmlXChart=function(a){this.name="Chart";this.version="3.0";dhtmlx.extend(this,dhtmlx.Settings);this.$(a,"dhx_chart");dhtmlx.extend(this,dhtmlx.DataLoader);this.data.provideApi(this,true);dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.MouseEvents);dhtmlx.extend(this,dhtmlx.Destruction);dhtmlx.extend(this,dhtmlx.Canvas);dhtmlx.extend(this,dhtmlx.Group);dhtmlx.extend(this,dhtmlx.AutoTooltip);dhtmlx.extend(this,dhtmlx.chart.pie);dhtmlx.extend(this,dhtmlx.chart.bar);dhtmlx.extend(this,
dhtmlx.chart.line);this.O(a,{color:"RAINBOW",alpha:"1",label:false,value:"{obj.value}",padding:{},view:"pie",lineColor:"#ffffff",cant:0.5,width:15,labelWidth:100,line:{},item:{},shadow:true,gradient:false,border:true,labelOffset:20});this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render()},this))};
dhtmlXChart.prototype={j:"dhx_area_id",on_click:{},on_dblclick:{},on_mouse_move:{},resize:function(){this.ob();this.render()},render:function(){if(this.callEvent("onBeforeRender",[this.data])){this.clearCanvas();this["pvt_render_"+this.a.view](this.getCanvas(),this.data.getRange(),this.b.offsetWidth,this.b.offsetHeight)}},value_setter:dhtmlx.Template.obj_setter,alpha_setter:dhtmlx.Template.obj_setter,label_setter:dhtmlx.Template.obj_setter,lineColor_setter:dhtmlx.Template.obj_setter,pieInnerText_setter:dhtmlx.Template.obj_setter,
colormap:{RAINBOW:function(a){a=Math.floor(this.indexById(a.id)/this.dataCount()*1536);if(a==1536)a-=1;return this.mb[Math.floor(a/256)](a%256)}},color_setter:function(a,b){return this.colormap[b]||dhtmlx.Template.obj_setter(a,b)},legend_setter:function(a,b){if(typeof b!="object")b={template:b};this.v(b,{width:150,height:18,align:"left",valign:"bottom",template:"",marker:{type:"square",width:25,height:15}});b.template=dhtmlx.Template.setter(0,b.template);return b},item_setter:function(a,b){if(typeof b!=
"object")b={color:b,borderColor:b};this.v(b,{radius:4,color:"#000000",borderColor:"#000000",borderWidth:2});b.color=dhtmlx.Template.setter(0,b.color);b.borderColor=dhtmlx.Template.setter(0,b.borderColor);return b},line_setter:function(a,b){if(typeof b!="object")b={color:b};this.v(b,{width:3,color:"#d4d4d4"});b.color=dhtmlx.Template.setter(0,b.color);return b},padding_setter:function(a,b){if(typeof b!="object")b={left:b,right:b,top:b,bottom:b};this.v(b,{left:50,right:20,top:35,bottom:40});return b},
xAxis_setter:function(a,b){if(!b)return false;if(typeof b!="object")b={template:b};this.v(b,{title:"",color:"#000000",template:"",lines:false});if(b.template)b.template=dhtmlx.Template.setter(0,b.template);return b},yAxis_setter:function(a,b){this.v(b,{title:"",color:"#000000",template:"{obj}",lines:true});if(b.template)b.template=dhtmlx.Template.setter(0,b.template);return b},pa:function(a,b,c,d){if(this.a.xAxis){b=parseInt(this.a.padding.left,10)-0.5;var e=d-this.a.padding.bottom+0.5,g=c-this.a.padding.right;
this.w(a,b,e,g,e,this.a.xAxis.color,1);this.renderTextAt(true,false,b,d-2,this.a.xAxis.title,"dhx_axis_title_x",c-b-parseInt(this.a.padding.right,10)-2);this.a.xAxis&&this.a.xAxis.lines&&this.w(a,g,e,g+0.5,this.a.padding.top+0.5,this.a.xAxis.color,0.2)}},ra:function(a,b,c,d,e,g){var i,l={};if(this.a.yAxis){b=parseInt(this.a.padding.left,10)-0.5;d=d-parseInt(this.a.padding.bottom,10);var j=parseInt(this.a.padding.top,10);this.w(a,b,d,b,j,this.a.yAxis.color,1);if(this.a.yAxis.step)i=parseFloat(this.a.yAxis.step);
if(typeof this.a.yAxis.step=="undefined"||typeof this.a.yAxis.start=="undefined"||typeof this.a.yAxis.end=="undefined"){l=this.Oa(e,g);e=l.start;g=l.end;i=l.step;this.a.yAxis.end=g;this.a.yAxis.start=e;this.a.yAxis.step=i}if(i!==0){for(var m=(d-j)*i/(g-e),p=0,q=e;q<=g;q+=i){if(l.fixNum)q=parseFloat((new Number(q)).toFixed(l.fixNum));var n=Math.floor(d-p*m)+0.5;q!=e&&this.a.yAxis.lines&&this.w(a,b,n,c-this.a.padding.right,n,this.a.yAxis.color,0.2);this.renderText(0,n-5,this.a.yAxis.template(q.toString()),
"dhx_axis_item_y",parseInt(this.a.padding.left,10)-5);p++}this.renderTextAt(true,false,0,j-4,this.a.yAxis.title,"dhx_axis_title_y")}}},Oa:function(a,b){var c,d,e;c=(b-a)/8;var g=Math.floor(this.za(c)),i=Math.pow(10,g),l=c/i;l=l>5?10:5;c=parseInt(l,10)*i;if(c>Math.abs(a))d=a<=0||a<c/10?-c:0;else{var j=Math.abs(a),m=Math.floor(this.za(j)),p=j/Math.pow(10,m);d=Math.ceil(p*10)/10*Math.pow(10,m)-c;if(a<0)d=-d-2*c}for(e=d;e<=b;){e+=c;e=parseFloat((new Number(e)).toFixed(Math.abs(g)))}return{start:d,end:e,
step:c,fixNum:Math.abs(g)}},za:function(a){var b="log";return Math.floor(Math[b](a)/Math.LN10)},qa:function(a,b){this.a.xAxis&&this.renderTextAt(false,true,a,this.b.offsetHeight-parseInt(this.a.padding.bottom,10),this.a.xAxis.template(b))},Ua:function(a,b,c,d){this.a.xAxis&&this.a.xAxis.lines&&this.w(a,b,c,b,d,this.a.xAxis.color,0.2)},w:function(a,b,c,d,e,g,i){a.strokeStyle=g;a.lineWidth=i;a.beginPath();a.moveTo(b,c);a.lineTo(d,e);a.stroke()},ta:function(a,b){var c=1;if(b!=a){a=b-a;if(Math.abs(a)<
1)for(;Math.abs(a)<1;){c*=10;a*=c}}else a=a;return[a,c]},mb:[function(a){return"#FF"+dhtmlx.math.toHex(a/2,2)+"00"},function(a){return"#FF"+dhtmlx.math.toHex(a/2+128,2)+"00"},function(a){return"#"+dhtmlx.math.toHex(255-a,2)+"FF00"},function(a){return"#00FF"+dhtmlx.math.toHex(a,2)},function(a){return"#00"+dhtmlx.math.toHex(255-a,2)+"FF"},function(a){return"#"+dhtmlx.math.toHex(a,2)+"00FF"}]};dhtmlx.compat("layout");
document.createElement("canvas").getContext||function(){function a(){return this.context_||(this.context_=new m(this))}function b(f,h){var k=C.call(arguments,2);return function(){return f.apply(h,k.concat(C.call(arguments)))}}function c(f){var h=f.srcElement;switch(f.propertyName){case "width":h.style.width=h.attributes.width.nodeValue+"px";h.getContext().clearRect();break;case "height":h.style.height=h.attributes.height.nodeValue+"px";h.getContext().clearRect();break}}function d(f){f=f.srcElement;
if(f.firstChild){f.firstChild.style.width=f.clientWidth+"px";f.firstChild.style.height=f.clientHeight+"px"}}function e(){return[[1,0,0],[0,1,0],[0,0,1]]}function g(f,h){for(var k=e(),o=0;o<3;o++)for(var s=0;s<3;s++){for(var u=0,y=0;y<3;y++)u+=f[o][y]*h[y][s];k[o][s]=u}return k}function i(f,h){h.fillStyle=f.fillStyle;h.lineCap=f.lineCap;h.lineJoin=f.lineJoin;h.lineWidth=f.lineWidth;h.miterLimit=f.miterLimit;h.shadowBlur=f.shadowBlur;h.shadowColor=f.shadowColor;h.shadowOffsetX=f.shadowOffsetX;h.shadowOffsetY=
f.shadowOffsetY;h.strokeStyle=f.strokeStyle;h.globalAlpha=f.globalAlpha;h.arcScaleX_=f.arcScaleX_;h.arcScaleY_=f.arcScaleY_;h.lineScale_=f.lineScale_}function l(f){var h,k=1;f=String(f);if(f.substring(0,3)=="rgb"){h=f.indexOf("(",3);var o=f.indexOf(")",h+1),s=f.substring(h+1,o).split(",");h="#";for(o=0;o<3;o++)h+=Q[Number(s[o])];if(s.length==4&&f.substr(3,1)=="a")k=s[3]}else h=f;return{color:h,alpha:k}}function j(f){switch(f){case "butt":return"flat";case "round":return"round";case "square":default:return"square"}}
function m(f){this.m_=e();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=v*1;this.globalAlpha=1;this.canvas=f;var h=f.ownerDocument.createElement("div");h.style.width=f.clientWidth+"px";h.style.height=f.clientHeight+"px";h.style.overflow="hidden";h.style.position="absolute";f.appendChild(h);this.element_=h;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}function p(f,h,k,o){f.currentPath_.push({type:"bezierCurveTo",
cp1x:h.x,cp1y:h.y,cp2x:k.x,cp2y:k.y,x:o.x,y:o.y});f.currentX_=o.x;f.currentY_=o.y}function q(f){for(var h=0;h<3;h++)for(var k=0;k<2;k++)if(!isFinite(f[h][k])||isNaN(f[h][k]))return false;return true}function n(f,h,k){if(q(h)){f.m_=h;if(k){var o=h[0][0]*h[1][1]-h[0][1]*h[1][0];f.lineScale_=P(K(o))}}}function w(f){this.type_=f;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}function z(){}var A=Math,r=A.round,D=A.sin,O=A.cos,K=A.abs,P=A.sqrt,v=10,B=v/2,C=Array.prototype.slice,
I={init:function(f){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var h=f||document;h.createElement("canvas");h.attachEvent("onreadystatechange",b(this.init_,this,h))}},init_:function(f){f.namespaces.g_vml_||f.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");f.namespaces.g_o_||f.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML");if(!f.styleSheets.ex_canvas_){var h=f.createStyleSheet();h.owningElement.id="ex_canvas_";h.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}"}var k=
f.getElementsByTagName("canvas");for(f=0;f<k.length;f++)this.initElement(k[f])},initElement:function(f){if(!f.getContext){f.getContext=a;f.innerHTML="";f.attachEvent("onpropertychange",c);f.attachEvent("onresize",d);var h=f.attributes;if(h.width&&h.width.specified)f.style.width=h.width.nodeValue+"px";else f.width=f.clientWidth;if(h.height&&h.height.specified)f.style.height=h.height.nodeValue+"px";else f.height=f.clientHeight}return f}};I.init();for(var Q=[],G=0;G<16;G++)for(var H=0;H<16;H++)Q[G*16+
H]=G.toString(16)+H.toString(16);var x=m.prototype;x.clearRect=function(){this.element_.innerHTML=""};x.beginPath=function(){this.currentPath_=[]};x.moveTo=function(f,h){var k=this.getCoords_(f,h);this.currentPath_.push({type:"moveTo",x:k.x,y:k.y});this.currentX_=k.x;this.currentY_=k.y};x.lineTo=function(f,h){f=this.getCoords_(f,h);this.currentPath_.push({type:"lineTo",x:f.x,y:f.y});this.currentX_=f.x;this.currentY_=f.y};x.bezierCurveTo=function(f,h,k,o,s,u){s=this.getCoords_(s,u);u=this.getCoords_(f,
h);var y=this.getCoords_(k,o);p(this,u,y,s)};x.quadraticCurveTo=function(f,h,k,o){var s=this.getCoords_(f,h);k=this.getCoords_(k,o);o={x:this.currentX_+2/3*(s.x-this.currentX_),y:this.currentY_+2/3*(s.y-this.currentY_)};var u={x:o.x+(k.x-this.currentX_)/3,y:o.y+(k.y-this.currentY_)/3};p(this,o,u,k)};x.arc=function(f,h,k,o,s,u){k*=v;var y=u?"at":"wa",t=f+O(o)*k-B,R=h+D(o)*k-B,F=f+O(s)*k-B,M=h+D(s)*k-B;if(t==F&&!u)t+=0.125;f=this.getCoords_(f,h);var J=this.getCoords_(t,R),L=this.getCoords_(F,M);this.currentPath_.push({type:y,
x:f.x,y:f.y,radius:k,xStart:J.x,yStart:J.y,xEnd:L.x,yEnd:L.y})};x.rect=function(f,h,k,o){this.moveTo(f,h);this.lineTo(f+k,h);this.lineTo(f+k,h+o);this.lineTo(f,h+o);this.closePath()};x.strokeRect=function(f,h,k,o){var s=this.currentPath_;this.beginPath();this.moveTo(f,h);this.lineTo(f+k,h);this.lineTo(f+k,h+o);this.lineTo(f,h+o);this.closePath();this.stroke();this.currentPath_=s};x.fillRect=function(f,h,k,o){var s=this.currentPath_;this.beginPath();this.moveTo(f,h);this.lineTo(f+k,h);this.lineTo(f+
k,h+o);this.lineTo(f,h+o);this.closePath();this.fill();this.currentPath_=s};x.createLinearGradient=function(f,h,k,o){var s=new w("gradient");s.x0_=f;s.y0_=h;s.x1_=k;s.y1_=o;return s};x.createRadialGradient=function(f,h,k,o,s,u){var y=new w("gradientradial");y.x0_=f;y.y0_=h;y.r0_=k;y.x1_=o;y.y1_=s;y.r1_=u;return y};x.drawImage=function(f){var h,k,o,s,u,y,t,R,F=f.runtimeStyle.width,M=f.runtimeStyle.height;f.runtimeStyle.width="auto";f.runtimeStyle.height="auto";var J=f.width,L=f.height;f.runtimeStyle.width=
F;f.runtimeStyle.height=M;if(arguments.length==3){h=arguments[1];k=arguments[2];u=y=0;t=o=J;R=s=L}else if(arguments.length==5){h=arguments[1];k=arguments[2];o=arguments[3];s=arguments[4];u=y=0;t=J;R=L}else if(arguments.length==9){u=arguments[1];y=arguments[2];t=arguments[3];R=arguments[4];h=arguments[5];k=arguments[6];o=arguments[7];s=arguments[8]}else throw Error("Invalid number of arguments");var E=this.getCoords_(h,k),S=[],T=10,N=10;S.push(" <g_vml_:group",' coordsize="',v*T,",",v*N,'"',' coordorigin="0,0"',
' style="width:',T,"px;height:",N,"px;position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]){var U=[];U.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",r(E.x/v),",","Dy=",r(E.y/v),"");E=E;var V=this.getCoords_(h+o,k),W=this.getCoords_(h,k+s),X=this.getCoords_(h+o,k+s);E.x=A.max(E.x,V.x,W.x,X.x);E.y=A.max(E.y,V.y,W.y,X.y);S.push("padding:0 ",r(E.x/v),"px ",r(E.y/v),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",U.join(""),", sizingmethod='clip');")}else S.push("top:",
r(E.y/v),"px;left:",r(E.x/v),"px;");S.push(' ">','<g_vml_:image src="',f.src,'"',' style="width:',v*o,"px;"," height:",v*s,'px;"',' cropleft="',u/J,'"',' croptop="',y/L,'"',' cropright="',(J-u-t)/J,'"',' cropbottom="',(L-y-R)/L,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",S.join(""))};x.stroke=function(f){var h=[],k=l(f?this.fillStyle:this.strokeStyle),o=k.color,s=k.alpha*this.globalAlpha,u=k=10;h.push("<g_vml_:shape",' filled="',!!f,'"',' style="position:absolute;width:',
k,"px;height:",u,'px;"',' coordorigin="0 0" coordsize="',v*k," ",v*u,'"',' stroked="',!f,'"',' path="');k={x:null,y:null};u={x:null,y:null};for(var y=0;y<this.currentPath_.length;y++){var t=this.currentPath_[y],R;switch(t.type){case "moveTo":R=t;h.push(" m ",r(t.x),",",r(t.y));break;case "lineTo":h.push(" l ",r(t.x),",",r(t.y));break;case "close":h.push(" x ");t=null;break;case "bezierCurveTo":h.push(" c ",r(t.cp1x),",",r(t.cp1y),",",r(t.cp2x),",",r(t.cp2y),",",r(t.x),",",r(t.y));break;case "at":case "wa":h.push(" ",
t.type," ",r(t.x-this.arcScaleX_*t.radius),",",r(t.y-this.arcScaleY_*t.radius)," ",r(t.x+this.arcScaleX_*t.radius),",",r(t.y+this.arcScaleY_*t.radius)," ",r(t.xStart),",",r(t.yStart)," ",r(t.xEnd),",",r(t.yEnd));break}if(t){if(k.x==null||t.x<k.x)k.x=t.x;if(u.x==null||t.x>u.x)u.x=t.x;if(k.y==null||t.y<k.y)k.y=t.y;if(u.y==null||t.y>u.y)u.y=t.y}}h.push(' ">');if(f)if(typeof this.fillStyle=="object"){var F=this.fillStyle,M=0,J={x:0,y:0};o=0;var L=1;if(F.type_=="gradient"){k=F.x0_/this.arcScaleX_;u=F.y0_/
this.arcScaleY_;y=F.x1_/this.arcScaleX_;t=F.y1_/this.arcScaleY_;var E=this.getCoords_(k,u),S=this.getCoords_(y,t);k=S.x-E.x;u=S.y-E.y;M=Math.atan2(k,u)*180/Math.PI;if(M<0)M+=360;if(M<1.0E-6)M=0}else{E=this.getCoords_(F.x0_,F.y0_);o=u.x-k.x;u=u.y-k.y;J={x:(E.x-k.x)/o,y:(E.y-k.y)/u};o/=this.arcScaleX_*v;u/=this.arcScaleY_*v;var T=A.max(o,u);o=2*F.r0_/T;L=2*F.r1_/T-o}var N=F.colors_;N.sort(function(aa,ba){return aa.offset-ba.offset});k=N.length;var U=N[0].color,V=N[k-1].color,W=N[0].alpha*this.globalAlpha,
X=N[k-1].alpha*this.globalAlpha,Z=[];for(y=0;y<k;y++){var $=N[y];Z.push($.offset*L+o+" "+$.color)}h.push('<g_vml_:fill type="',F.type_,'"',' method="none" focus="100%"',' color="',U,'"',' color2="',V,'"',' colors="',Z.join(","),'"',' opacity="',X,'"',' g_o_:opacity2="',W,'"',' angle="',M,'"',' focusposition="',J.x,",",J.y,'" />')}else h.push('<g_vml_:fill color="',o,'" opacity="',s,'" />');else{var Y=this.lineScale_*this.lineWidth;if(Y<1)s*=Y;h.push("<g_vml_:stroke",' opacity="',s,'"',' joinstyle="',
this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',j(this.lineCap),'"',' weight="',Y,'px"',' color="',o,'" />')}h.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",h.join(""))};x.fill=function(){this.stroke(true)};x.closePath=function(){this.currentPath_.push({type:"close"})};x.getCoords_=function(f,h){var k=this.m_;return{x:v*(f*k[0][0]+h*k[1][0]+k[2][0])-B,y:v*(f*k[0][1]+h*k[1][1]+k[2][1])-B}};x.save=function(){var f={};i(this,f);this.aStack_.push(f);this.mStack_.push(this.m_);
this.m_=g(e(),this.m_)};x.restore=function(){i(this.aStack_.pop(),this);this.m_=this.mStack_.pop()};x.translate=function(f,h){f=[[1,0,0],[0,1,0],[f,h,1]];n(this,g(f,this.m_),false)};x.rotate=function(f){var h=O(f),k=D(f);h=[[h,k,0],[-k,h,0],[0,0,1]];n(this,g(h,this.m_),false)};x.scale=function(f,h){this.arcScaleX_*=f;this.arcScaleY_*=h;f=[[f,0,0],[0,h,0],[0,0,1]];n(this,g(f,this.m_),true)};x.transform=function(f,h,k,o,s,u){s=[[f,h,0],[k,o,0],[s,u,1]];n(this,g(s,this.m_),true)};x.setTransform=function(f,
h,k,o,s,u){f=[[f,h,0],[k,o,0],[s,u,1]];n(this,f,true)};x.clip=function(){};x.arcTo=function(){};x.createPattern=function(){return new z};w.prototype.addColorStop=function(f,h){h=l(h);this.colors_.push({offset:f,color:h.color,alpha:h.alpha})};G_vmlCanvasManager=I;CanvasRenderingContext2D=m;CanvasGradient=w;CanvasPattern=z}();if(dhtmlx&&dhtmlx.N)dhtmlx.N["thirdparty/excanvas/excanvas.js"]=true;
