/*
Copyright DHTMLX LTD. http://www.dhtmlx.com
To use this library please contact sales@dhtmlx.com to obtain license
*/

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);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)};this._retry=false;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.onloadAction=null;this.mainObject=null;this.xmlDoc=null;return null};function callerFunction(funcObject, dhtmlObject){this.handler=function(e){if (!e)e=window.event;funcObject(e, dhtmlObject);return true};return this.handler};function getAbsoluteLeft(htmlObject){var xPos = htmlObject.offsetLeft;var temp = htmlObject.offsetParent;while (temp != null){xPos+=temp.offsetLeft;temp=temp.offsetParent};return xPos};function getAbsoluteTop(htmlObject){var yPos = htmlObject.offsetTop;var temp = htmlObject.offsetParent;while (temp != null){yPos+=temp.offsetTop;temp=temp.offsetParent};return yPos};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&&(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;if ((e)&&(e.preventDefault)){e.preventDefault();return false};return false};dhtmlDragAndDropObject.prototype.callDrag=function(e){if (!e)e=window.event;dragger=window.dhtmlDragAndDrop;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.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 (_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++)if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
 window.frames[i].dhtmlDragAndDrop.stopFrameRoute(window);if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
 parent.dhtmlDragAndDrop.stopFrameRoute(window)};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()};if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
 parent.dhtmlDragAndDrop.initFrameRoute(window);for (var i = 0;i < window.frames.length;i++)if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
 window.frames[i].dhtmlDragAndDrop.initFrameRoute(window, ((!win||mode) ? 1 : 0))};var _isFF = false;var _isIE = false;var _isOpera = false;var _isKHTML = false;var _isMacOS = false;if (navigator.userAgent.indexOf('Macintosh')!= -1)
 _isMacOS=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;else {_isFF=true;var _FFrv = parseFloat(navigator.userAgent.split("rv:")[1])
};function isIE(){if (navigator.appName.indexOf("Microsoft")!= -1)
 if (navigator.userAgent.indexOf('Opera')== -1)
 return true;return false};dtmlXMLLoaderObject.prototype.doXPath=function(xpathExp, docObj, namespace, result_type){if ((_isKHTML))
 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");xmlDoc.transformNodeToObject(xslDoc, result)};return result};dtmlXMLLoaderObject.prototype.doXSLTransToString=function(xslDoc, xmlDoc){return this.doSerialization(this.doXSLTransToObject(xslDoc, xmlDoc))};dtmlXMLLoaderObject.prototype.doSerialization=function(xmlDoc){if (!isIE()){var xmlSerializer = new XMLSerializer();return xmlSerializer.serializeToString(xmlDoc)}else
 return xmlDoc.xml};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="";this.dhx_Event();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
 };this.obj=document.createElement("TABLE");this.obj.cellSpacing=0;this.obj.cellPadding=0;this.obj.style.width="100%";this.obj.style.tableLayout="fixed";this.obj.className="c_obj".substr(2);this.hdr=document.createElement("TABLE");this.hdr.style.border="1px solid gray";this.hdr.cellSpacing=0;this.hdr.cellPadding=0;if ((!_isOpera)||(_OperaRv >= 8.5))
 this.hdr.style.tableLayout="fixed";this.hdr.className="c_hdr".substr(2);this.hdr.width="100%";this.xHdr=document.createElement("TABLE");this.xHdr.className="xhdr";this.xHdr.cellPadding=0;this.xHdr.cellSpacing=0;this.xHdr.style.width='100%'
 var r = this.xHdr.insertRow(0)
 var c = r.insertCell(0);r.insertCell(1).innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";r.childNodes[1].style.width='100%';r.childNodes[1].className='xhdr_last';c.appendChild(this.hdr)
 this.objBuf=document.createElement("DIV");this.objBuf.appendChild(this.obj);this.entCnt=document.createElement("TABLE");this.entCnt.insertRow(0).insertCell(0)
 this.entCnt.insertRow(1).insertCell(0);this.entCnt.cellPadding=0;this.entCnt.cellSpacing=0;this.entCnt.width="100%";this.entCnt.height="100%";this.entCnt.style.tableLayout="fixed";this.objBox=document.createElement("DIV");this.objBox.style.width="100%";this.objBox.style.height=this.entBox.style.height;this.objBox.style.overflow="auto";this.objBox.style.position="relative";this.objBox.appendChild(this.objBuf);this.objBox.className="objbox";this.hdrBox=document.createElement("DIV");this.hdrBox.style.width="100%"

 if (((_isOpera)&&(_OperaRv < 9)))
 this.hdrSizeA=25;else
 this.hdrSizeA=200;this.hdrBox.style.height=this.hdrSizeA+"px";if (_isIE)this.hdrBox.style.overflowX="hidden";else
 this.hdrBox.style.overflow="hidden";this.hdrBox.style.position="relative";this.hdrBox.appendChild(this.xHdr);this.preloadImagesAr=new Array(0)

 this.sortImg=document.createElement("IMG")
 this.sortImg.style.display="none";this.hdrBox.insertBefore(this.sortImg, this.xHdr)
 this.entCnt.rows[0].cells[0].style.verticalAlign="top";this.entCnt.rows[0].cells[0].appendChild(this.hdrBox);this.entCnt.rows[1].cells[0].appendChild(this.objBox);this.entBox.appendChild(this.entCnt);this.entBox.grid=this;this.objBox.grid=this;this.hdrBox.grid=this;this.obj.grid=this;this.hdr.grid=this;this.cellWidthPX=new Array(0);this.cellWidthPC=new Array(0);this.cellWidthType=this.entBox.cellwidthtype||"px";this.delim=this.entBox.delimiter||",";this._csvDelim=",";this.hdrLabels=[];this.columnIds=[];this.columnColor=[];this.cellType=dhtmlxArray();this.cellAlign=[];this.initCellWidth=[];this.fldSort=[];this.imgURL="./";this.isActive=false;this.isEditable=true;this.useImagesInHeader=false;this.pagingOn=false;this.rowsBufferOutSize=0;dhtmlxEvent(window, "unload", function(){try{self.destructor()}catch (e){}});this.setSkin=function(name){this.entBox.className="gridbox gridbox_"+name;this.enableAlterCss("ev_"+name, "odd_"+name, this.isTreeGrid())
 this._fixAlterCss()

 this._sizeFix=this._borderFix=0;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:0px' 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:0px' src='"+this.imgURL+"skinD_bottom_right.gif'>";this.entBox.appendChild(this._botMb);this.entBox.style.position="relative";this._gcCorr=20;break;case "glassy_blue":
 this.forceDivInHeader=true;break;case "dhx_black":
 case "dhx_blue":
 case "modern":
 case "light":
 this._sizeFix=1;this.forceDivInHeader=true;break;case "xp":
 this.forceDivInHeader=true;this._srdh=22;if ((_isIE)&&(document.compatMode != "BackCompat"))
 this._srdh=25;this._sizeFix=1;break;case "mt":
 this._srdh=22;if ((_isIE)&&(document.compatMode != "BackCompat"))
 this._srdh=25;this._sizeFix=1;this._borderFix=(_isIE ? 1 : 0);break;case "gray":
 if ((_isIE)&&(document.compatMode != "BackCompat"))
 this._srdh=22;this._sizeFix=1;this._borderFix=(_isIE ? 1 : 0);break;case "sbdark":
 if (_isFF)this._gcCorr=1;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(){self._update_srnd_view()}, 100)}};this.attachToObject=function(obj){obj.appendChild(this.entBox)
 this.objBox.style.height=this.entBox.style.height};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.gridWidth=0;this.gridHeight=0;this.cellWidthPX=new Array(0);this.cellWidthPC=new Array(0);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)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)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;this.entCnt.rows[0].style.display='' 

 if (this.noHeader){this.entCnt.rows[0].style.display='none'}else {this.noHeader=false
 };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.setSizes=function(fl){if ((!this.hdr.rows[0]))
 return;if (!this.entBox.offsetWidth){if (this._sizeTime)window.clearTimeout(this._sizeTime);this._sizeTime=window.setTimeout(function(){self.setSizes()
 }, 250);return};if (((_isFF)&&(this.entBox.style.height == "100%"))||(this._fixLater)){this.entBox.style.height=this.entBox.parentNode.clientHeight;this._fixLater=true};if (fl&&this.gridWidth == this.entBox.offsetWidth&&this.gridHeight == this.entBox.offsetHeight){return false
 }else if (fl){this.gridWidth=this.entBox.offsetWidth
 this.gridHeight=this.entBox.offsetHeight
 };if ((!this.hdrBox.offsetHeight)&&(this.hdrBox.offsetHeight > 0))
 this.entCnt.rows[0].cells[0].height=this.hdrBox.offsetHeight+"px";var gridWidth = parseInt(this.entBox.offsetWidth)-(this._gcCorr||0);var gridHeight = parseInt(this.entBox.offsetHeight)-(this._sizeFix||0);var _isVSroll = (this.objBox.scrollHeight > this.objBox.offsetHeight);if (((!this._ahgr)&&(_isVSroll))||((this._ahgrM)&&(this._ahgrM < this.objBox.scrollHeight)))
 gridWidth-=(this._scrFix||(_isFF ? 17 : 17));var len = this.hdr.rows[0].cells.length
 

 for (var i = 0;i < this._cCount;i++){if (this.cellWidthType == 'px'&&this.cellWidthPX.length < len){this.cellWidthPX[i]=this.initCellWidth[i]-this._wcorr}else if (this.cellWidthType == '%'&&this.cellWidthPC.length < len){this.cellWidthPC[i]=this.initCellWidth[i]};if (this.cellWidthType == '%'&&this.cellWidthPC.length != 0&&this.cellWidthPC[i]){this.cellWidthPX[i]=parseInt(gridWidth*this.cellWidthPC[i] / 100)}};var wcor = this.entBox.offsetWidth-this.entBox.clientWidth;var summ = 0;var fcols = new Array();for (var i = 0;i < this._cCount;i++)if ((this.initCellWidth[i] == "*")&&((!this._hrrar)||(!this._hrrar[i])))
 fcols[fcols.length]=i;else
 summ+=parseInt(this.cellWidthPX[i]);if (fcols.length){var ms = Math.floor((gridWidth-summ-wcor) / fcols.length);if (ms < 0)ms=1;for (var i = 0;i < fcols.length;i++){var min = (this._drsclmW ? this._drsclmW[fcols[i]] : 0);this.cellWidthPX[fcols[i]]=(min ? (min > ms ? min : ms) : ms)-this._wcorr;summ+=ms};if (!this._rseb){this._setAutoResize();this._rseb=true}};var summ = 0;for (var i = 0;i < this._cCount;i++)summ+=parseInt(this.cellWidthPX[i])

 if (_isOpera)summ-=1;this.chngCellWidth();if ((this._awdth)&&(this._awdth[0])){if (this.cellWidthType == '%'){this.cellWidthType="px";this.cellWidthPC=[]};var gs = (summ > this._awdth[1]
 ? this._awdth[1]
 : (summ < this._awdth[2]
 ? this._awdth[2]
 : summ))
 +(this._borderFix||0)*2;if (this._fake)for (var i = 0;i < this._fake._cCount;i++)gs+=parseInt(this._fake.cellWidthPX[i])
 this.entBox.style.width=gs+((_isVSroll&&(!this._ahgr||(this._ahgrM && this._ahgrM < this.objBox.scrollHeight) )) ? (_isFF ? 20 : 18) : 0)+"px";if (this._fake && !this._realfake)this._fake._correctSplit()};this.objBuf.style.width=summ+"px";if ((this.ftr)&&(!this._realfake))
 this.ftr.style.width=summ+"px";this.objBuf.childNodes[0].style.width=summ+"px";this.doOnScroll(0, 1);this.hdr.style.border="0px solid gray";var zheight = this.hdr.offsetHeight+(this._borderFix ? this._borderFix : 0);if (this.ftr)zheight+=this.ftr.offsetHeight;if (this._ahgr)if (this.objBox.scrollHeight){if (_isIE)var z2 = this.objBox.scrollHeight;else
 var z2 = this.objBox.childNodes[0].scrollHeight;var scrfix =
 this.parentGrid
 ? 1
 : ((this.objBox.offsetWidth < this.objBox.scrollWidth)
 ? (_isFF
 ? 20
 : 18)
 : 1);if (this._ahgrMA)z2=this.entBox.parentNode.offsetHeight-zheight-scrfix-(this._sizeFix ? this._sizeFix : 0)*2;if (((this._ahgrM)&&((this._ahgrF ? (z2+zheight+scrfix) : z2) > this._ahgrM)))
 gridHeight=this._ahgrM*1+(this._ahgrF ? 0 : (zheight+scrfix));else
 gridHeight=z2+zheight+scrfix;this.entBox.style.height=gridHeight+"px"};if (this.ftr)zheight-=this.ftr.offsetHeight;var aRow = this.entCnt.rows[1].cells[0].childNodes[0];if (!this.noHeader)aRow.style.top=(zheight-this.hdrBox.offsetHeight)+"px";if (this._topMb){this._topMb.style.top=(zheight||0)+"px";this._topMb.style.width=(gridWidth+20)+"px"};if (this._botMb){this._botMb.style.top=(gridHeight-3)+"px";this._botMb.style.width=(gridWidth+20)+"px"};aRow.style.height=Math.max((((gridHeight-zheight-1) < 0&&_isIE)
 ? 20
 : (gridHeight-zheight-1))
 -(this.ftr
 ? this.ftr.offsetHeight
 : 0)-(_isIE&&(document.compatMode == "BackCompat")&&this._fake?(this._sizeFix||0)*2:0),0)
 +"px";if (this.ftr&&this.entBox.offsetHeight > this.ftr.offsetHeight)this.entCnt.style.height=this.entBox.offsetHeight-this.ftr.offsetHeight+"px";if (this._srdh)this.doOnScroll()};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, ""));this._setAutoResize()};this._setAutoResize=function(){var el = window;var self = this;if (el.addEventListener){if ((_isFF)&&(_FFrv < 1.8))
 el.addEventListener("resize", function(){if (!self.entBox)return;var z = self.entBox.style.width;self.entBox.style.width="1px";window.setTimeout(function(){self.entBox.style.width=z;self.setSizes();if (self._fake)self._fake._correctSplit()}, 10)}, false);else
 el.addEventListener("resize", function(){if (self.setSizes)self.setSizes();if (self._fake)self._fake._correctSplit()}, false)}else if (el.attachEvent)el.attachEvent("onresize", function(){if (self._resize_timer)window.clearTimeout(self._resize_timer);if (self.setSizes)self._resize_timer=window.setTimeout(function(){self.setSizes();if (self._fake)self._fake._correctSplit()}, 500)});this._setAutoResize=function(){}};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])-2}};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.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){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;this.entBox.onmousemove=function(e){this.grid.doColResize(e||window.event, el, startW, x, tabW)
 };document.body.onmouseup=function(){self.stopColResize()}}};this.stopColResize=function(){this.entBox.onmousemove="";document.body.onmouseup="";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.objBuf.childNodes[0].style.width="";if (_isOpera || _isFF)this.setSizes()};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-=(this._scrFix||(_isFF ? 17 : 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];for (var i = 0;i < r.childNodes.length;i++)if (r.childNodes[i]._cellIndex == ind)this.r_fldSorted=r.childNodes[i];this.setSortImgPos()};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){document.body.oncontextmenu=Function("return true;");(e||event).cancelBubble=true;return false};if (_isIE)ev.srcElement.oncontextmenu=z;else if (!_isMacOS)document.body.oncontextmenu=z;return false};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(ev.clientX-1,ev.clientY-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}}}else if (this._ctmndx){if (this._ctmndx.hideContextMenu)this._ctmndx.hideContextMenu()
 else
 this._ctmndx._contextEnd()};return true};this.doClick=function(el, fl, selMethod, show){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.selectedRows._dhx_find(this.row)== -1)
 this.selectedRows[this.selectedRows.length]=this.row}};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)
 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();this.selectedRows=dhtmlxArray([].concat(this.rowsCol));for (var i = this.rowsCol.length-1;i >= 0;i--){if (this.rowsCol[i]._cntr)this.selectedRows.splice(i, 1);else
 this.rowsCol[i].className+=" rowselected"};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;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 (!cell_obj.offsetHeight){var h=this.rowsBuffer._dhx_find(cell_obj.parentNode)*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)}};this._nextRowCell=function(row, dir, pos){row=this._nextRow(this.rowsCol._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()};if ((dir == -1)&&this.tabStart){this.tabStart.focus();this.tabStart.focus()};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){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.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.getRow=function(cell){if (!cell)cell=window.event.srcElement;if (cell.tagName != 'TD')cell=cell.parentElement;r=cell.parentElement;if (this.cellType[cell._cellIndex] == 'lk')eval(this.onLink+"('"+this.getRowId(r.rowIndex)+"',"+cell._cellIndex+")");this.selectCell(r, cell._cellIndex, 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.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};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]);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){var z = 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.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 = "";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 (_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){try{if (row_id == "")row_id="gridglobaluserdata";if (!this.UserData[row_id])this.UserData[row_id]=new Hashtable()
 this.UserData[row_id].put(name, value)
 }catch (er){alert("UserData Error:"+er.description)
 }};this.getUserData=function(row_id, name){this.getRowById(row_id);if (row_id == "")row_id="gridglobaluserdata";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.setColumnLabel=function(c, label, ind){var z = 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]+)/, ".desc$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.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._aFoot=null;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(/\.[ascde]+\./, ".")};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.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]="";arSrt[arSrt.length]="na"};this.splitSign=splitSign||"#cspan";this.hdrLabels=arLab;this.cellWidth=arWdth;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)

 };this.setColAlign=function(alStr){this.cellAlign=alStr.split(this.delim)
 };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.pagingOn){var newPage=Math.floor(this.getRowIndex(rowID) / this.rowsBufferOutSize)+1;if (newPage!=this.currentPage)this.changePage(newPage)};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]+" };", 0)}};this.setColumnColor=function(clr){this.columnColor=clr.split(this.delim)
 };this.enableAlterCss=function(cssE, cssU, perLevel, levelUnique){if (cssE||cssU)this.attachEvent("onGridReconstructed",function(){if (!this._cssSP){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._cssSP&&this._h2)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].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.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)};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){return this.grid._doContClick(e||window.event)}}else
 this.entBox.onmousedown=function(e){return this.grid._doContClick(e||window.event)};this.obj.ondblclick=function(e){if (!this.grid.wasDblClicked(e||window.event)) 
 return false;if (this.grid._dclE)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._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;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()},
 




 
 enableRowsHover:function(mode, cssClass){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');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;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)},


 
 destructor:function(){if (this._sizeTime)this._sizeTime=window.clearTimeout(this._sizeTime);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="";this.entBox.onclick=function(){};this.entBox.onmousedown=function(){};this.entBox.onbeforeactivate=function(){};this.entBox.onbeforedeactivate=function(){};this.entBox.onbeforedeactivate=function(){};this.entBox.onselectstart=function(){};this.entBox.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 (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){this._scrFix=parseInt(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},

 

 
 
 _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("//rows/head", xmlDoc);if (hheadCol.length){var headCol = this.xmlLoader.doXPath("//rows/head/column", hheadCol[0]);var asettings = this.xmlLoader.doXPath("//rows/head/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("//rows/head/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 = ["setHeader", 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*((.|\n)*.+)\s*$/gi, "$1"))};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] == "calendar")||(this.fldSort[i] == "date"))
 this.setDateFormat(sets[6][i], 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("//rows/head/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.forEachRow(function(id){if (this.cells(id, col_ind).getValue() != 0)
 d.push(id)})
 return d.join(",")},

 
 _drawTooltip:function(e){var c = this.grid.getFirstParentOfType(e ? e.target : event.srcElement, 'TD');if ((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
 ]))
 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.cells(r.idd, 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()},
 

 
 
 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 (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){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)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 (this.forceDivInHeader)w.innerHTML="<div class='hdrcell'>"+data[0][i]+"</div>";else
 w.innerHTML=data[0][i];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)}},



 
 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 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")
 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])}}},
 
 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])},
 
 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)
 ]},

 
 
 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){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]){this.rowsBuffer.push({idd: id,
 data: row,
 _parser: this._process_xml_row,
 _locator: this._get_xml_data
 });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();this.callEvent("onXLE", [
 this,
 rows.length
 ])},


 
 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=[];for (var i = 0;i < this._cCount;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 < this._cCount;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("./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[j];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, (this._c_order ? this._swapColumns(strAr) : 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.cells5(r.childNodes[i], (r.childNodes[i]._cellType||this.cellType[ii]));if ((this.defVal[ii])&&((val == "")||( typeof (val) == "undefined")))
 val=this.defVal[ii];aeditor.setValue(val)
 }else {var val = "&nbsp;";r.childNodes[i].innerHTML=val;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++){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){xml=that["_process_"+type](xml);if (!that._contextCallTimer)that.callEvent("onXLE", [that,0,0,xml]);if (call){call();call=null}};this.xmlLoader.loadXML(url)},

 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=(this.currentPage-1)*this.rowsBufferOutSize;max=Math.min(min+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._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];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 == '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){var p=this._get_view_size;this._get_view_size=function(){return 1};this.render_dataset();this._get_view_size=p}else
 this.render_dataset()}},
 
 
 deleteRow:function(row_id, node){if (!node)node=this.getRowById(row_id)
 
 if (!node)return;this.editStop();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", []);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);ev.cancelBubble=true;if (ev.keyCode == 9){grid.selectCell(0, 0, 0, 0, 1);if (grid.cells2(0, 0).isDisabled()){grid._key_events["k9_0_0"].call(grid)};return false}};this.tabEnd=( typeof (end) == "object") ? end : document.getElementById(end);this.tabEnd.onkeydown=function(e){var ev = (e||window.event);ev.cancelBubble=true;if ((ev.keyCode == 9)&&ev.shiftKey){grid.selectCell((grid.getRowsNum()-1), (grid.getColumnCount()-1), 0, 0, 1);if (grid.cells2((grid.getRowsNum()-1), (grid.getColumnCount()-1)).isDisabled()){grid._key_events["k9_0_1"].call(grid)};return false}}},
 
 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)return [this.currentPage, (this.currentPage-1)*this.rowsBufferOutSize, (this.currentPage-1)*this.rowsBufferOutSize+this.rowsCol.length, this.rowsBuffer.length ];return [
 Math.floor(this.objBox.scrollTop/this._srdh),
 Math.ceil(parseInt(this.objBox.offsetHeight)/this._srdh),
 this.limit
 ]}};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}};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};dhtmlXGridCellObject.prototype.setCTxtValue=function(val){this.cell.innerHTML="";this.cell.appendChild(document.createTextNode(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 : 2))+"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.select();this.obj.value=this.obj.value};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_ch(cell){if (cell){this.cell=cell;this.grid=this.cell.parentNode.grid;this.cell.obj=this};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",true)
 else
 this.setValue("1",true)
 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 (arguments[1])z.cell.wasChanged=true;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);if (!this.cell._clearCell)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);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.cell._clearCell=true}else
 this.cell._clearCell=false;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 val = this.readonly ? String.fromCharCode((e||event).keyCode) : 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.setValue(cell.value);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){if (this.list.selectedIndex&&this.list.options[this.list.selectedIndex].text == this.obj.value)this.setValue(this.list.value)
 else
 this.setValue(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)this.setCValue((this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(val)||val, 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.style.backgroundColor)
 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

 if (this.val != null&&"#"+rgb.toUpperCase()== this.val.toUpperCase()){c.style.border="2px solid white"
 }}}}};this.getValue=function(){return this.cell.firstChild.style ? this.cell.firstChild.style.backgroundColor : ""};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.cell.offsetHeight-2)+";background-color:"+(val||"")
 +";border:0px;'>&nbsp;</div>",
 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.tit
 : "");else if (this.cell.firstChild.tagName == "A"){var out = this.cell.firstChild.firstChild.src+(this.cell.titFl != null ? "^"+this.cell.tit : "");out+="^"+this.cell.lnk;if (this.cell.trg)out+="^"+this.cell.trg
 return out}}};eXcell_img.prototype=new eXcell;eXcell_img.prototype.getTitle=function(){return this.cell.tit
};eXcell_img.prototype.setValue=function(val){var title = val;if (val.indexOf("^")!= -1){var ar = val.split("^");val=ar[0]
 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.tit=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_ro(cell){if (cell){this.cell=cell;this.grid=this.cell.parentNode.grid};this.edit=function(){};this.isDisabled=function(){return true}};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.setCValue(val?this.grid._aplNF(val, this.cell._cellIndex):"0");this.cell._clearCell=false};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.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.filterBy=function(column, value, preserve){this._filters_ready();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)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.collectValues=function(column){if (this.isTreeGrid()) return this.collectTreeValues(column);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.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(){self.filterByAll()},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.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, first){var res = new Array();value=value.toString().toLowerCase();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 (this._get_cell_value(el.buff,i).toString().toLowerCase().indexOf(value) != -1){res.push([el.id,i]);if (first)return res}},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 (first)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.setSelectedRow(z[0][0])
 }},500)}};if (id.parentNode)id.parentNode.className+=" filter"};dhtmlXGridObject.prototype._loadSelectOptins=function(t,c){var l=this.collectValues(c);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])};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("","");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)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("onClearAll",function(){this._f_rowsBuffer=null;if (!this.obj.rows.length)this.filters=[]});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.firstChild.onclick=function(e){self._build_m_order();var j=self._m_order?self._m_order[i]:i;var val=this.checked?1:0;self.forEachRow(function(id){var c=this.cells(id,j);if (c.isCheckbox()) c.setValue(val)});(e||event).cancelBubble=true}};dhtmlXGridObject.prototype._in_header_stat_total=function(t,i,c){var calck=function(){var summ=0;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};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_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,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.enableDragAndDrop=function(mode){if (mode=="temporary_disabled"){this.dADTempOff=false;mode=true}else
 this.dADTempOff=true;this.dragAndDropOff=convertStringToBoolean(mode)};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;if (!this.callEvent("onBeforeDrag",[htmlObject.parentNode.idd])) return null;var z=new Array();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=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.rowsCol._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.rowsCol[ind].idd].state=="minus")?this.tobj._getOpenLenght(this.tobj.rowsCol[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){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()) 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);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");c.tobj._clearMove();c.tobj.dragContext=c;if (!c.tobj.callEvent("onDrag",[c.slist(),c.tid,c.sobj,c.tobj,c.sExtra,c.tExtra])) return;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.source=="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")){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();if(htmlObject.parentNode==shtmlObject.parentNode)return 0;if ((tree)&&((this.checkParentLine(this._h2.get[htmlObject.parentNode.idd],shtmlObject.parentNode.idd))))
 return 0;var obj=shtmlObject.parentNode.idd?shtmlObject.parentNode:shtmlObject.parentObject;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){var a1=getAbsoluteTop(htmlObject);var a2=getAbsoluteTop(this.objBox);if ( (a1-a2-parseInt(this.objBox.scrollTop))>(parseInt(this.objBox.offsetHeight)-50) )
 this.objBox.scrollTop=parseInt(this.objBox.scrollTop)+20;if ( (a1-a2)<(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+((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();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.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()};dhtmlXGridObject.prototype.submitOnlyChanged = function(mode)
{this.FormSubmitOnlyChanged = convertStringToBoolean(mode)};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._createInput = function(name,value){var input = document.createElement('input');input.type = 'hidden';input.name =(this.entBox.id||'dhtmlXGrid')+'_'+name;input.value = value;this.parentForm.appendChild(input);this.formInputs.push(input)};dhtmlXGridObject.prototype._createInputRow = function(r){for (var j=0;j<this._cCount;j++){var foo_cell = this.cells3(r, j);if ((!this.FormSubmitOnlyChanged)|| foo_cell.wasChanged())
 this._createInput(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._createInput("serialized",this.serialize())}else if (this.FormSubmitOnlySelected){if (this.FormSubmitOnlyRowID)this._createInput("selected",this.getSelectedId());else
 for(var i=0;i<this.selectedRows.length;i++)this._createInputRow(this.selectedRows[i])}else{if (this._submitAR){if (this._added_rows.length)this._createInput("rowsadded",this._added_rows.join(","));if (this._deleted_rows.length)this._createInput("rowsdeleted",this._deleted_rows.join(","))};this.forEachRow(function(id){this._createInputRow(this.rowsAr[id])})
 
 }};dhtmlXGridObject.prototype.detectParentFormPresent = function()
{var parentForm = false;var parent = this.entBox;while(parent != document.body){if (parent.tagName.toLowerCase()== 'form') {parentForm = parent;break}else {parent = parent.parentNode}};return parentForm};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.loadCSVString = function(str){this.parse(str,"csv")
};dhtmlXGridObject.prototype.serializeToCSV = function(){this.editStop()
 if (this._mathSerialization)this._agetm="getMathValue";else if (this._strictText)this._agetm="getTitle";else this._agetm="getValue";var out=[];if (this._csvHdr){var a=[];var b=this.hdr.rows[1].cells;for (var i=0;i<b.length;i++)if ((!this._srClmn)||(this._srClmn[i]))
 a.push(_isIE?b[i].innerText:b[i].textContent);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())};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};</style>";var st_hr=null;if (this._fake){st_hr=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 = this.rowsBuffer.length;var col_length = this._cCount;var width = this._printWidth();html += '<tr>';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="padding-left:2px;padding-right:2px;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'>";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 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;for (var j=0;j<col_length;j++){if (this._hrrar && this._hrrar[j])continue;if(this.rowsCol[i]){var c=this.cells(this.rowsCol[i].idd, 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="padding-left:2px;padding-right:2px;'+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 && _isFF)?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){netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');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){netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');if (!this._make()) return false;this._p[0].getData(this._p[1],this._p[0].kGlobalClipboard);var strLength = new Object();var str = new Object();this._p[1].getTransferData("text/unicode",str,strLength);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 (!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);var src = event.srcElement || event.target;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.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;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.obj.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.rowsCol[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.rowsCol[i];if (!row)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
 ed[ ed.setImage ? "setLabel" : "setValue" ]( serialized[ k ][ l++ ] );ed.cell.wasChanged=true};this.callEvent("onRowPaste",[row.idd])
 k++}};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()},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)}}}}};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};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);if (acs2)eval(acs2);obj.parentNode.removeChild(obj,true)
 return windowf};dhtmlXGridObject.prototype._process_html=function(xml){var temp=document.createElement("DIV");temp.innerHTML=xml.xmlDoc.responseText;var mr = temp.getElementsByTagName("TABLE")[0];this._process_inner_html(mr)};dhtmlXGridObject.prototype._process_inner_html=function(mr){var n_l=mr.rows.length;for (var j=1;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])}});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);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",[this.grid._grid_calendarA]);var sgrid=this.grid;this.grid._grid_calendarA.setOnClickHandler(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_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.cell._cediton=true;this.val=this.cell.val;this._val=this.cell.innerHTML;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()};eXcell_dhxCalendar.prototype.getDate = function(){if (this.cell.val)return this.cell.val;return null};eXcell_dhxCalendar.prototype.getValue = function(){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);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.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.getFormatedDate((this.grid._dtmask||"%d/%m/%Y"),val.toString()))};if ((this.cell.val=="NaN")||(this.cell.val=="Invalid Date")){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");var sgrid=this.grid;this.grid._grid_calendarA.setOnClickHandler(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(){this.grid._grid_calendarA.setPosition(this.cell);this.grid._grid_calendarA.show();this.grid._grid_calendarA._last_operation_calendar=false;this.cell._cediton=true;this.val=this.cell.val;this._val=this.cell.innerHTML;this.grid._grid_calendarA.setDateFormat((this.grid._dtmask||"%d/%m/%Y"));this.grid._grid_calendarA.setDate(this.val);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(){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);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.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=new Date()}else{this.cell._clearCell=false;this.cell.val=new Date(this.grid._grid_calendarA.setFormatedDate((this.grid._dtmask||"%d/%m/%Y"),val.toString()))};if ((this.cell.val=="NaN")||(this.cell.val=="Invalid Date")){this.cell.val=new Date();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(0)});this.grid.attachEvent("onBeforeSorting",function(){var that=this;window.setTimeout(function(){if (that._fake && !that._realfake)that._fake.resetCounter(0);else
 that.resetCounter(0)},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=val*1+(cell.parentNode.grid.currentPage-1)*cell.parentNode.grid.rowsBufferOutSize;if (val<0 || cell.parentNode.grid._srnd)val=cell.parentNode.grid.rowsBuffer._dhx_find(cell.parentNode)+1;cell.innerHTML = val;if (cell.parentNode.grid._fake && 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)
 var i=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].cells[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 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="treeGfx/";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";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);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.dhx_Event();this._onEventSet={onMouseIn:function(){this.ehlt=true},onMouseOut:function(){this.ehlt=true},onSelect:function(){this._onSSCF=true}};this.setImagesPath=this.setImagePath;this.setIconsPath=this.setIconPath;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;this._acMenu=(obj.cMenu||this.cMenu);if (this._acMenu){if (!(this.callEvent("onBeforeContextMenu", [
 obj.id
 ]))) return true;if (_isIE)ev.srcElement.oncontextmenu = function(){event.cancelBubble=true;return false};if (_isFF)ev.target.oncontextmenu = function(e){e.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=this._acMenu.contextMenuZoneId=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="";this.XMLLoader.destructor();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){return z};return null};dhtmlXTreeObject.prototype._escape=function(str){switch(this.utfesc){case "none":
 return str;break;case "utf8":
 return encodeURI(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){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.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);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};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){newNode.span.parentNode.previousSibling.previousSibling.childNodes[0].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)};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;this.parsCount=this.parsCount?(this.parsCount+1):1;this.XMLloadingWarning=1;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 reffers to not existing parent");if ((temp.childsCount)&&(!start)&&(!this._edsbps)&&(!temp._has_top))
 var preNode=temp.childNodes[temp.childsCount-1];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,preNode);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.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)};if (this.onXLE)this.onXLE(this,parentId);this._redrawFrom(this,null,start)
 
 
 if (p.get("order")&& p.get("order")!="none")
 this._reorderBranch(temp,p.get("order"),true);if (this.nodeAskingCall!="")this.selectItem(this.nodeAskingCall,true);if (this._branchUpdate)this._branchUpdateNext(p)};if (this.parsCount==1){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--;if ((this._epgps)&&(start))
 this._setPrevPageSign(temp,(start||0),level,node);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 ((!tempx.unParsed)&&((tempx.XMLload)||(!this.XMLsource)))
 tempx._acc=acc;dhtmlObject._correctLine(tempx);dhtmlObject._correctPlus(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){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.imPath+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="none";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};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){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 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.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._onSSCF)this._onSSCFold=this.getSelectedItemId();this._unselectItems();this._markItem(node);if (this._onSSCF){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 ((e)&&(e.button==2))
 that.callEvent("onRightClick",[obj.id,e]);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)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 (!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){tr.onmousemove=this._itemMouseIn;tr[(_isIE)?"onmouseleave":"onmouseout"]=this._itemMouseOut};if(this.checkEvent && this.checkEvent("onRightClick"))
 tr.oncontextmenu=Function("e","this.childNodes[0].parentObject.treeNod.callEvent('onRightClick',[this.childNodes[0].parentObject.id,(e||window.event)]);return false;");return table};dhtmlXTreeObject.prototype.setImagePath=function( newPath ){this.imPath=newPath;if (!this.iconURL)this.iconURL=newPath};dhtmlXTreeObject.prototype.setIconPath=function(path){this.iconURL=path};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);this._onSSCF=true};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){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)};for (var i=0;i<itemObject.childsCount;i++)this._recreateBranch(itemObject.childNodes[i],newNode,0,1);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.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.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._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;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;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};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._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.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);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.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.dadmodec=this.dadmode;this.dadmodefix=0;var zN=htmlNode.parentObject.span;zN.className+=" dragAndDropRow";this._lastMark=zN;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);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.scrollTop+this.allTree.offsetHeight-30))||(z<this.allTree.scrollTop))
 this.allTree.scrollTop=z};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]))
 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._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.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}};dhtmlXTreeObject.prototype._loadDynXML=function(id,src) {src=src||this.XMLsource;var sn=(new Date()).valueOf();this._ld_id=id;this.loadXML(src+getUrlSymbol(src)+"uid="+sn+"&id="+this._escape(id))};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.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.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 (list)return list;else return ""};dhtmlXTreeObject.prototype.setItemStyle=function(itemId,style_string){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+=(";"+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){this.parentObject.className+=" dhxtree_"+name};dhtmlXTreeObject.prototype.dhx_Event=function()
{this.dhx_SeverCatcherPath="";this.attachEvent = function(original, catcher, CallObj)
 {if (this._onEventSet && this._onEventSet[original])this._onEventSet[original].apply(this,[]);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,a){if (this["ev_"+name])return this["ev_"+name].apply(this,a);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 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" )
 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] )}}};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.style.zIndex=12;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;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.onclick=function(){};var id=this._editCell.id;this._editCell=null;if (this.childCalc)this._fixChildCountLabel(this._editCell);this.callEvent("onEdit",[3,id,this]);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.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){(e||event).cancelBubble=true};temp.span.childNodes[0].onkeypress=function(e){if (!e)e=window.event;if (e.keyCode==13){self._stopEdit(-1)}else if (e.keyCode==27){self._editCell.span.childNodes[0].value=self._editCell._oldValue;self._stopEdit(-1)}};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.d.parentNode,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(){eval("var t="+arguments[4].xmlDoc.responseText);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" ':''));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("")};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;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);function dhtmlXLayoutPanel(){};function dhtmlXLayoutObject(base, view, skin) {var that = this;this.skin = (skin!=null?skin:"dhx_blue");if (typeof(base)== "string") {base = document.getElementById(base)};if (!base._skipChecksOnStartUp){if (base._isLayoutCell == true){this._updateDimensions = true;base = base.window};if (base._isWindow == true){var layout = base.attachLayout(view, this.skin);if (this._updateDimensions == true){layout._dimension = new Array(0, 0)};return layout}else if (base == document.body){document.body.style.overflow = "hidden";this.parentDhxWins = new dhtmlXWindows();this.parentDhxWins.setSkin(this.skin);this.parentDhxWindow = this.parentDhxWins.createWindow("parentDhxWins", 10, 10, 800, 600);this.parentDhxWindow.setToFullScreen(true);var layout = this.parentDhxWindow.attachLayout(view, this.skin);return layout}else if (typeof(base)== "object") {this.parentDhxWins = new dhtmlXWindows();this.parentDhxWins.setSkin(this.skin);this.parentDhxWins.enableAutoViewport(false);this.parentDhxWins.setViewport(0, 0, base.offsetWidth, base.offsetHeight, base);this.parentDhxWindow = this.parentDhxWins.createWindow("parentDhxWins", 0, 0, base.offsetWidth, base.offsetHeight);this.parentDhxWindow.denyMove();this.parentDhxWindow.denyResize();this.parentDhxWindow.denyPark();this.parentDhxWindow.button("close").disable();this.parentDhxWins._attachWindowContentTo(this.parentDhxWindow, base);var globalParent = this;this.layout = this.parentDhxWindow.attachLayout(view, this.skin);this.layout.globalParent = globalParent;return this.layout}};if (_isOpera){this._opera950FixBorder = "#FFFFFF 0px solid";switch (this.skin) {case "dhx_black":
 this._opera950FixBorder = "#333333 1px solid";break;case "dhx_blue":
 this._opera950FixBorder = "#D3E2E5 1px solid";break}};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.base = base;this.imagePath = "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 = {"standard" : {"hor_sep_height": 6, "cpanel_height": 31, "cpanel_collapsed_width": 20, "cpanel_collapsed_height": (_isFF?20:22)},
 "glassy_blue" : {"hor_sep_height": 4, "cpanel_height": 23, "cpanel_collapsed_width": 7, "cpanel_collapsed_height": (_isFF?7:8)},
 "glassy_caramel" : {"hor_sep_height": 4, "cpanel_height": 23, "cpanel_collapsed_width": 7, "cpanel_collapsed_height": (_isFF?7:8)},
 "glassy_greenapple" : {"hor_sep_height": 4, "cpanel_height": 23, "cpanel_collapsed_width": 7, "cpanel_collapsed_height": (_isFF?7:8)},
 "glassy_rainy" : {"hor_sep_height": 4, "cpanel_height": 23, "cpanel_collapsed_width": 7, "cpanel_collapsed_height": (_isFF?7:8)},
 "glassy_raspberries": {"hor_sep_height": 4, "cpanel_height": 23, "cpanel_collapsed_width": 7, "cpanel_collapsed_height": (_isFF?7:8)},
 "glassy_yellow" : {"hor_sep_height": 4, "cpanel_height": 23, "cpanel_collapsed_width": 7, "cpanel_collapsed_height": (_isFF?7:8)},
 "dhx_black" : {"hor_sep_height": 5, "cpanel_height": (_isOpera?34:34), "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18},
 "dhx_blue" : {"hor_sep_height": 5, "cpanel_height": (_isOpera?34:34), "cpanel_collapsed_width": 18, "cpanel_collapsed_height": 18}};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.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.tplData = {"1C": '<layout><autosize hor="a" ver="a" rows="1" cols="1"/><row><cell obj="a" resize="ver" neighbors="a"/></row></layout>',
 "2E": '<layout><autosize hor="a;b" ver="b" rows="2" cols="1"/><row><cell obj="a" a_height="*" resize="ver" neighbors="a;b"/></row><row sep="true"><cell sep="hor" top="a" bottom="b" dblclick="a"/></row><row><cell obj="b" b_height="*" resize="ver" neighbors="a;b"/></row></layout>',
 "2U": '<layout><autosize hor="b" ver="a;b" rows="1" cols="2"/><row><cell obj="a" a_width="*" resize="hor" neighbors="a;b"/><cell sep="ver" left="a" right="b"/><cell obj="b" b_width="*" resize="hor" neighbors="a;b"/></row></layout>',
 
 "3E": '<layout><autosize hor="a;b;c" ver="c" rows="3" cols="1"/><row><cell obj="a" a_height="*" 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" b_height="*" 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" c_height="*" resize="ver" neighbors="a;b;c"/></row></layout>',
 "3J": '<layout><autosize hor="b" ver="b;c" rows="2" cols="2"/><row><cell obj="a" a_width="*" a_height="*" resize="ver" neighbors="a;c"/><cell sep="ver" left="a,c" right="b" dblclick="b" rowspan="3"/><cell obj="b" b_width="*" 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" c_width="*" c_height="*" resize="ver" neighbors="a;c"/></row></layout>',
 "3L": '<layout><autosize hor="b;c" ver="a;c" rows="2" cols="2"/><row><cell obj="a" a_width="*" resize="hor" neighbors="a;b,c" rowspan="3"/><cell sep="ver" left="a" right="b,c" dblclick="a" rowspan="3"/><cell obj="b" b_width="*" b_height="*" resize="ver" neighbors="b;c"/></row><row sep="true"><cell sep="hor" top="b" dblclick="b" bottom="c"/></row><row><cell obj="c" c_width="*" c_height="*" resize="ver" neighbors="b;c"/></row></layout>',
 "3T": '<layout><autosize hor="a;c" ver="b;c" rows="2" cols="2"/><row><cell obj="a" a_height="*" 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" b_width="*" b_height="*" resize="hor" neighbors="b;c"/><cell sep="ver" left="b" right="c" dblclick="b"/><cell obj="c" c_width="*" c_height="*" resize="hor" neighbors="b;c"/></row></layout>',
 "3U": '<layout><autosize hor="b;c" ver="c" rows="2" cols="2"/><row><cell obj="a" a_width="*" a_height="*" resize="hor" neighbors="a;b"/><cell sep="ver" left="a" right="b" dblclick="a"/><cell obj="b" b_width="*" b_height="*" 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" c_height="*" resize="ver" neighbors="a,b;c" colspan="3"/></row></layout>',
 "3W": '<layout><autosize hor="c" ver="a;b;c" rows="1" cols="3"/><row><cell obj="a" a_width="*" resize="hor" neighbors="a;b;c"/><cell sep="ver" left="a" right="b;c" dblclick="a"/><cell obj="b" b_width="*" resize="hor" neighbors="a;b;c"/><cell sep="ver" left="a;b" right="c" dblclick="b"/><cell obj="c" c_width="*" resize="hor" neighbors="a;b;c"/></row></layout>',
 
 "4H": '<layout><autosize hor="d" ver="a;c;d" rows="2" cols="3"/><row><cell obj="a" a_width="*" 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" b_width="*" b_height="*" resize="ver" neighbors="b;c"/><cell sep="ver" left="a;b,c" right="d" dblclick="d" rowspan="3"/><cell obj="d" d_width="*" 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" c_width="*" c_height="*" resize="ver" neighbors="b;c"/></row></layout>',
 "4I": '<layout><autosize hor="a;c;d" ver="d" rows="3" cols="2"/><row><cell obj="a" a_height="*" resize="ver" neighbors="a;b,c;d" colspan="4"/></row><row sep="true"><cell sep="hor" top="a" bottom="b,c;d" dblclick="a" colspan="4"/></row><row><cell obj="b" b_width="*" b_height="*" resize="hor" neighbors="b;c"/><cell sep="ver" left="b" dblclick="b" right="c"/><cell obj="c" c_width="*" c_height="*" resize="hor" neighbors="b;c"/></row><row sep="true"><cell sep="hor" top="a;b,c" bottom="d" dblclick="d" colspan="4"/></row><row><cell obj="d" d_height="*" resize="ver" neighbors="a;b,c;d" colspan="4"/></row></layout>',
 "4T": '<layout><autosize hor="a;d" ver="b;c;d" rows="2" cols="3"/><row><cell obj="a" a_height="*" 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" b_width="*" b_height="*" resize="hor" neighbors="b;c;d"/><cell sep="ver" left="b" right="c;d" dblclick="b"/><cell obj="c" c_width="*" c_height="*" resize="hor" neighbors="b;c;d"/><cell sep="ver" left="b;c" right="d" dblclick="c"/><cell obj="d" d_width="*" d_height="*" resize="hor" neighbors="b;c;d"/></row></layout>',
 "4U": '<layout><autosize hor="c;d" ver="d" rows="2" cols="3"/><row><cell obj="a" a_width="*" a_height="*" resize="hor" neighbors="a;b;c"/><cell sep="ver" left="a" right="b;c" dblclick="a"/><cell obj="b" c_width="*" b_height="*" resize="hor" neighbors="a;b;c"/><cell sep="ver" left="a;b" right="c" dblclick="b"/><cell obj="c" c_width="*" c_height="*" 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" d_height="*" 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"/><row><cell obj="a" a_width="*" 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" b_width="*" b_height="*" resize="ver" neighbors="b;c;d"/><cell sep="ver" left="a;b,c,d" right="e" dblclick="e" rowspan="5"/><cell obj="e" e_width="*" 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" c_width="*" c_height="*" 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" d_width="*" d_height="*" resize="ver" neighbors="b;c;d"/></row></layout>',
 "5I": '<layout><autosize hor="a;d;e" ver="e" rows="3" cols="3"/><row><cell obj="a" a_height="*" 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" b_width="*" b_height="*" resize="hor" neighbors="b;c;d"/><cell sep="ver" left="b" right="c;d" dblclick="b"/><cell obj="c" c_width="*" c_height="*" resize="hor" neighbors="b;c;d"/><cell sep="ver" left="b;c" right="d" dblclick="c"/><cell obj="d" d_width="*" d_height="*" 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" e_height="*" 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"/><row><cell obj="a" a_height="*" 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" b_width="*" b_height="*" resize="hor" neighbors="b;c;d;e"/><cell sep="ver" left="b" right="c;d;e" dblclick="b"/><cell obj="c" c_width="*" c_height="*" resize="hor" neighbors="b;c;d;e"/><cell sep="ver" left="b;c" right="d;e" dblclick="c"/><cell obj="d" d_width="*" d_height="*" resize="hor" neighbors="b;c;d;e"/><cell sep="ver" left="b;c;d" right="e" dblclick="d"/><cell obj="e" e_width="*" e_height="*" 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" f_height="*" resize="ver" neighbors="a;b,c,d,e;f" colspan="7"/></row></layout>'
 };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";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.dhxWins = new dhtmlXWindows();this.dhxWins.setSkin(this.skin);this.dhxWins.setImagePath(this.imagePath);this.dhxWins.attachEvent("onTextChange", that._changeCPanelText);this.dhxWins.dhxLayout = this;this._xmlLoader.loadXMLString(this.tplData[this._layoutView]!=null?this.tplData[this._layoutView]:this.tplData["3E"])};this._autoHor = new Array();this._autoVer = new Array();this._dimension = new Array(320, 200);this._rowsRatio = 100;this._colsRatio = 100;this._xmlParser = function() {var usedRows = 0;var totalHeight = "none";var usedHeight = 0;var sepHeight = that.skinParams[that.skin]["hor_sep_height"];if (that.base.style.height != null){totalHeight = parseInt(that.base.style.height)};if (isNaN(totalHeight)) {totalHeight = that.base.offsetHeight};if (isNaN(totalHeight)) {alert("init error, incorrect height of parent object, aborted");return};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");var rowHeight = "";if (row.getAttribute("sep")!= null) {tr.style.height = sepHeight+"px";usedHeight += sepHeight}else {if (usedRows < that._totalRows - 1){rowHeight = Math.round((totalHeight - (that._totalRows-1)*sepHeight)/that._totalRows)}else {rowHeight = totalHeight - usedHeight};usedHeight += rowHeight;usedRows++};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");td.style.height = rowHeight;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");if (cell.getAttribute("width")!= null) {td.style.width = cell.getAttribute("width")};if (cell.getAttribute("height")!= null) {td.style.height = cell.getAttribute("height")};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 (that._parentWindow != null){that._parentWindow.setMinDimension(that._dimension[0], that._dimension[1])};that._buildSurface()};this._xmlLoader = new dtmlXMLLoaderObject(this._xmlParser, window);this._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"),
 "3J_hor": new Array("a;c", "b"),
 "3J_ver": new Array("a;b", "c;b"),
 "3L_hor": new Array("a", "b;c"),
 "3L_ver": new Array("a;b", "a;c"),
 "3T_hor": new Array("a;b", "a;c"),
 "3T_ver": new Array("a", "b;c"),
 "3U_hor": new Array("a;c", "b;c"),
 "3U_ver": new Array("a;b", "c"),
 "3W_hor": new Array("a", "b", "c"),
 "3W_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")
 };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._isLayoutCell = true;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.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, this._wId)};td.undock = function() {if (that._isCollapsed(this._idd)) {return};that.unDockWindow(this._wId);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.attachGrid = function() {this._grid = this.window.attachGrid();return this._grid};td.attachTree = function(root) {this._tree = this.window.attachTree(root);return this._tree};td.attachTabbar = function() {this._tabbar = this.window.attachTabbar();return this._tabbar};td.attachAccordion = function() {this._accordion = this.window.attachAccordion();return this._accordion};td.attachFolders = function() {this._folders = this.window.attachFolders();return this._folders};td.attachStatusBar = function() {this._status = this.window.attachStatusBar();return this._status};td.attachMenu = function() {this._menu = this.window.attachMenu();return this._menu};td.attachToolbar = function() {this._toolbar = this.window.attachToolbar();return this._toolbar};td.attachEditor = function() {this._editor = this.window.attachEditor();return this._editor};td.attachObject = function(obj) {this._obj = this.window.attachObject(obj)};td.attachURL = function(url) {this._url = this.window.attachURL(url);this._frame = this.window._frame}};if (td._dir == "ver"){td.onselectstart = function(e) {e = e||event;e.returnValue = false};td.onmousedown = function(e) {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"};e = e||event;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) {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"};e = e||event;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}}};td.ondblclick = function() {if (this._dblClick == null){return};if (that.polyObj[this._dblClick] == null){return};var obj = that.polyObj[this._dblClick];if (obj.childNodes[0].style.display == "none"){return};if (obj._collapsed == true){that._doExpand(obj._resize, this._dblClick, obj._rowData, "hide")}else {obj._savedW = parseInt(obj.style.width);obj._savedH = parseInt(obj.style.height);that._doCollapse(obj._resize, this._dblClick, obj._rowData, "hide")}}}};var p = {};for (var a in this.polyObj){var w = this.polyObj[a].offsetWidth;var h = this.polyObj[a].offsetHeight;p[a] = new Array(w,h)};var q = 1;for (var a in p){this.polyObj[a].style.width = p[a][0]-2+"px";this.polyObj[a].style.height = p[a][1]-2+"px";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 bar = document.createElement("DIV");bar._dockCell = a;bar._resize = this.polyObj[a]._resize;bar.className = "dhtmlxPolyInfoBar";bar.innerHTML = "<div class='dhtmlxInfoBarLabel'>&nbsp;</div>"+
 "<div class='dhtmlxInfoBarButtonsFake'>&nbsp;</div>"+
 "<div class='dhtmlxInfoButtonDock' title='Dock'></div>"+
 "<div class='dhtmlxInfoButtonUnDock' style='display: none;' title='UnDock'></div>"+
 "<div class='dhtmlxInfoButtonShowHide_"+bar._resize+"' title='Collapse'></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].appendChild(bar);for (var r=0;r<bar.childNodes.length;r++){bar.childNodes[r].onselectstart = function(e) {e = e||event;e.returnValue = false}};var wId = "w"+a;var win = this.dhxWins.createWindow(wId, 10, 10, p[a][0], p[a][1]);win.hide();win._tmpRowData = this.polyObj[a]._rowData;win._tmpReszie = bar._resize;win._dockCell = a;win.setText(a);win.button("close").hide();win.addUserButton("dock", 99, "Dock", "dock");win.button("dock").attachEvent("onClick", function(win) {that._doExpand(win._tmpReszie, win._dockCell, win._tmpRowData, "dock")});this.polyObj[a]._wId = wId;this.polyObj[a].window = win;bar._win = wId;bar.childNodes[2].onclick = function() {that._expand(this.parentNode._dockCell, "dock")};bar.childNodes[3].onclick = function() {that.unDockWindow(this.parentNode._win);that._collapse(this.parentNode._dockCell, "dock")};bar.childNodes[4].onclick = function() {var pId = this.parentNode._dockCell;if (that._isCollapsed(pId)) {that._expand(pId, "hide")}else {that._collapse(pId, "hide")}};this.dockWindow(a, wId)};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++){var win = this.polyObj[data[q][w]].window;if (win.layout != null){var dims = win.layout._defineWindowMinDimension(win, 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++){objL[q].style.width = newWL + "px";objL[q].childNodes[1].style.width = newWL + "px"};for (var q=0;q<objR.length;q++){objR[q].style.width = newWR + "px";objR[q].childNodes[1].style.width = newWR + "px"};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++){objL[q].style.width = newWL + "px";objL[q].childNodes[1].style.width = newWL + "px"};for (var q=0;q<objR.length;q++){objR[q].style.width = newWR + "px";objR[q].childNodes[1].style.width = newWR + "px"};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++){objT[q].style.height = newHT + "px";objT[q].childNodes[1].style.height = newHT - objT[q].childNodes[0]._h + "px"};for (var q=0;q<objB.length;q++){objB[q].style.height = newHB + "px";objB[q].childNodes[1].style.height = newHB - objB[q].childNodes[0]._h + "px"};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++){objT[q].style.height = newHT + "px";objT[q].childNodes[1].style.height = newHT - objT[q].childNodes[0]._h + "px"};for (var q=0;q<objB.length;q++){objB[q].style.height = newHB + "px";objB[q].childNodes[1].style.height = newHB - objB[q].childNodes[0]._h + "px"};this._resY = newY}}};this._resizeStop = function() {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)};if (typeof(this._anyExpT)== "object" && this._anyExpT != null) {this._fixInnerContentFromArray(this._anyExpT);this._anyExpT = null};if (typeof(this._anyExpB)== "object" && this._anyExpB != null) {this._fixInnerContentFromArray(this._anyExpB);this._anyExpB = null};if (typeof(this._anyExpL)== "object" && this._anyExpL != null) {this._fixInnerContentFromArray(this._anyExpL);this._anyExpL = null};if (typeof(this._anyExpR)== "object" && this._anyExpR != null) {this._fixInnerContentFromArray(this._anyExpR);this._anyExpR = null};this._resObj = null;this._resFunc = null;this._hideCovers();this.callEvent("onPanelResizeFinish", []);this._fixCellsContentOpera950();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 wId = new Array();for (var q=0;q<poly.length;q++){if (typeof(poly[q])== "object") {for (var w=0;w<poly[q].length;w++){wId[wId.length] = this.polyObj[poly[q][w]]._win}}else {wId[wId.length] = this.polyObj[poly[q]]._win}};for (var q=0;q<wId.length;q++){if (this.dhxWins.window(wId[q])!= null) {this._updateComponentsView(this.dhxWins.window(wId[q]))}};this.callEvent("onPanelResizeFinish", [])};this._showCovers = function() {for (var a in this.polyObj){if (this.polyObj[a].childNodes[1] != null){if (this.polyObj[a].childNodes[1].childNodes[this.polyObj[a].childNodes[1].childNodes.length-1] != null){var cover = this.polyObj[a].childNodes[1].childNodes[this.polyObj[a].childNodes[1].childNodes.length-1];cover.className = (this._effects["highlight"]&&this._isResizable(a)?"dhxLayout_Cover_"+this.skin:"dhx_content_cover_blocker");cover.style.display = ""}}}};this._hideCovers = function() {for (var a in this.polyObj){if (this.polyObj[a].childNodes[1] != null){if (this.polyObj[a].childNodes[1].childNodes[this.polyObj[a].childNodes[1].childNodes.length-1] != null){var cover = this.polyObj[a].childNodes[1].childNodes[this.polyObj[a].childNodes[1].childNodes.length-1];cover.style.display = "none"}}}};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])}}};if (_isIE){document.body.attachEvent("onselectstart", function(){e = event;if (that._resObj != null){e.returnValue = false}});document.body.attachEvent("onmousemove", function(e){e = e||event;if (that._resObj != null && that._resFunc != null){that._resFunc(e)}}, false);document.body.attachEvent("onmouseup", function(){that._resizeStop()})}else {document.body.addEventListener("mousemove", function(e){e = e||event;if (that._resObj != null && that._resFunc != null){that._resFunc(e)}}, false);document.body.addEventListener("mouseup", function(){that._resizeStop()}, false)};this._fixCellsContentOpera950 = function() {if (_isOpera){this.forEachItem(function(item){var cell = item.childNodes[1].childNodes[2];var brd = that._opera950FixBorder;cell.style.border = "#FFFFFF 0px dashed";window.setTimeout(function(){cell.style.border=brd}, 1)})}};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 = parseInt(this.polyObj[anyExp[0]].style.width) - this._minWidth;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 = parseInt(this.polyObj[anyExp[0]].style.height) - this._minHeight;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[1].style.display = "";this.polyObj[pId].childNodes[0].className = "dhtmlxPolyInfoBar";this.polyObj[pId].childNodes[0].childNodes[1].style.display = "";this.polyObj[pId].childNodes[0].childNodes[2].style.display = "";this.polyObj[pId].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[1].style.display = "";this.polyObj[anyExp]._collapsed = false;this.polyObj[anyExp].childNodes[0].className = "dhtmlxPolyInfoBar";this.polyObj[anyExp].childNodes[0].childNodes[1].style.display = "";this.polyObj[anyExp].childNodes[0].childNodes[4].title = "Collapse";this.polyObj[anyExp].childNodes[0].childNodes[2].style.display = "";this.polyObj[anyExp].childNodes[0].childNodes[3].style.display = "none";this.polyObj[anyExp].childNodes[0].childNodes[4].style.display = "";var wId = this.polyObj[anyExp].childNodes[0]._win;var win = this.dhxWins.window(wId);if (!win._isDocked){this.dockWindow(anyExp, wId)};if (this.polyObj[anyExp].className == "dhtmlxLayoutSinglePolyTabbarCollapsed"){this.polyObj[anyExp].className = "dhtmlxLayoutSinglePolyTabbar"};this._fixCellsContentOpera950();this._fixSplitters();this._fixIcons();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[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[1].style.width = newS+"px"}else {obj.style.height = newS+"px";obj.childNodes[1].style.height = newS-obj.childNodes[0]._h+"px"};for (var q=0;q<obj2.length;q++){if (dir == "hor"){obj2[q].style.width = s2+s-newS+"px";obj2[q].childNodes[1].style.width = s2+s-newS+"px"}else {obj2[q].style.height = s2+s-newS+"px";obj2[q].childNodes[1].style.height = s2+s-newS-obj2[q].childNodes[0]._h+"px"}};if (newS != maxSize){window.setTimeout(function(){that._expandEffect(obj, obj2, maxSize, mode, step, dir)}, 4)}else {obj._collapsed = false;var wId = obj.childNodes[0]._win;var win = this.dhxWins.window(wId);if (!win._isDocked){this.dockWindow(obj._idd, wId)};for (var q=0;q<obj2.length;q++){if (obj2[q]._win != null){this._updateComponentsView(this.dhxWins.window(obj2[q]._win))}};this._updateComponentsView(this.dhxWins.window(wId));this.polyObj[obj._idd].childNodes[0].childNodes[4].title = "Collapse";this._fixCellsContentOpera950();this._fixSplitters();this._fixIcons();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"}else {if (newS < this._collapsedH){newS = this._collapsedH};obj.style.height = newS+"px";var p = newS-obj.childNodes[0]._h;if (p < 0){p = 0}};for (var q=0;q<obj2.length;q++){if (dir == "hor"){obj2[q].style.width = s2+(s-newS)+"px"}else {obj2[q].style.height = s2+(s-newS)+"px"}};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].childNodes[1].style.width = s2+(s-newS)+"px"}else {obj2[q].childNodes[1].style.height = s2+(s-newS)-obj2[q].childNodes[0]._h+"px"}};obj._collapsed = true;if (dir == "hor"){obj.childNodes[0].className = "dhtmlxPolyInfoBarCollapsedVer"}else {obj.childNodes[0].className = "dhtmlxPolyInfoBarCollapsedHor"};for (var q=0;q<obj2.length;q++){if (obj2[q]._win != null){this._updateComponentsView(this.dhxWins.window(obj2[q]._win))}};if (mode == "hide"){obj.childNodes[0].childNodes[1].style.display = "";obj.childNodes[0].childNodes[2].style.display = "none";obj.childNodes[0].childNodes[3].style.display = "none";obj.childNodes[0].childNodes[4].style.display = ""}else {obj.childNodes[0].childNodes[1].style.display = "";obj.childNodes[0].childNodes[2].style.display = "";obj.childNodes[0].childNodes[3].style.display = "none";obj.childNodes[0].childNodes[4].style.display = "none"};if (obj.className == "dhtmlxLayoutSinglePolyTabbar"){obj.className = "dhtmlxLayoutSinglePolyTabbarCollapsed"};this.polyObj[obj._idd].childNodes[0].childNodes[4].title = "Expand";this._fixCellsContentOpera950();this._fixSplitters();this._fixIcons();this.callEvent("onCollapse", [obj._idd])}};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.polyObj[anyExpL[q]].style.width = (sep[1]=="left"?width:width2)+"px";this.polyObj[anyExpL[q]].childNodes[1].style.width = (sep[1]=="left"?width:width2)+"px";this._updateComponentsView(this.polyObj[anyExpL[q]].window)};for (var q=0;q<anyExpR.length;q++){this.polyObj[anyExpR[q]].style.width = (sep[1]=="right"?width:width2)+"px";this.polyObj[anyExpR[q]].childNodes[1].style.width = (sep[1]=="right"?width:width2)+"px";this._updateComponentsView(this.polyObj[anyExpR[q]].window)}}};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.polyObj[anyExpT[q]].style.height = (sep[1]=="top"?height:height2)+"px";this.polyObj[anyExpT[q]].childNodes[1].style.height = (sep[1]=="top"?height:height2)-this.polyObj[anyExpT[q]].childNodes[0]._h+"px";this._updateComponentsView(this.polyObj[anyExpT[q]].window)};for (var q=0;q<anyExpB.length;q++){this.polyObj[anyExpB[q]].style.height = (sep[1]=="bottom"?height:height2)+"px";this.polyObj[anyExpB[q]].childNodes[1].style.height = (sep[1]=="bottom"?height:height2)-this.polyObj[anyExpB[q]].childNodes[0]._h+"px";this._updateComponentsView(this.polyObj[anyExpB[q]].window)}}};this._fixInnerContentFromArray = function(obj) {for (var q=0;q<obj.length;q++){if (typeof(obj[q])=="object") {this._fixInnerContentFromArray(obj[q])}else {this._updateComponentsView(this.polyObj[obj[q]].window)}}};this._fixInnerContent = function(pId) {this._updateComponentsView(this.polyObj[pId].window)};this._updateComponentsView = function(win) {if (win.grid != null){win.grid.setSizes();win.grid.setSizes()};if (win.tabbar){win.tabbar.adjustOuterSize()};if (win.accordion != null){win.accordion.setSizes()};if (win.layout != null){win.layout.setSizes(win)};if (win.folders != null){win.folders.setSizes()};if (win.editor != null){if (_isOpera){window.setTimeout(function(){win.editor.adjustSize()},10)}else {win.editor.adjustSize()}}};this.dockWindow = function(pId, wId) {if (this.polyObj[pId] == null){return};if (this.polyObj[pId]._win != null){return};if (this.dhxWins.window(wId)== null) {return};var win = this.dhxWins.window(wId);if (win.editor != null){var winEditorStoredData = win.editor.getContent()};win._isDocked = true;win._dockCell = pId;while (this.polyObj[pId].childNodes.length > 1){this.polyObj[pId].removeChild(this.polyObj[pId].childNodes[1])};var data = win._content;data.parentNode.removeChild(data);win.hide();data.style.width = this.polyObj[pId].style.width;var p = parseInt(this.polyObj[pId].style.height) - this.polyObj[pId].childNodes[0]._h;if (p < 0){p = 0};data.style.height = p + "px";this.polyObj[pId].appendChild(data);this.polyObj[pId]._win = wId;this._updateComponentsView(this.dhxWins.window(wId));if (win.editor != null && winEditorStoredData != null){var iconsPath = win.editor.iconsPath;win.editor = win.attachEditor();win.editor.setIconsPath(iconsPath);win.editor.init();win.editor.setContent(winEditorStoredData)};if (_isIE && this.dhxWins.window(wId)._IEFixMTS == true) {var obj = this.dhxWins.window(wId)._content.childNodes[2];var pad = obj.style.paddingBottom;obj.style.paddingBottom = "0px";window.setTimeout(function(){obj.style.paddingBottom=pad},1)};this.callEvent("onDock", [pId])};this.unDockWindow = function(wId) {var p = null;var win = null;for (var a in this.polyObj){if (this.polyObj[a]._win == wId){p = a;win = this.dhxWins.window(wId)}};if (p != null && win != null){if (win.editor != null){var winEditorStoredData = win.editor.getContent()};var data = win.childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1];var base = this.polyObj[p].childNodes[1];this.polyObj[p].removeChild(base);var fake = document.createElement("DIV");fake.style.position = "relative";fake.innerHTML = "&nbsp;";this.polyObj[p].appendChild(fake);this.polyObj[p]._win = null;data.appendChild(base);win._isDocked = false;if (win._isParked){base.style.height = "0px"}else {win.setDimension(400, 300)};win.show();win.bringToTop();win.center();this._updateComponentsView(this.dhxWins.window(wId));if (win.editor != null && winEditorStoredData != null){var iconsPath = win.editor.iconsPath;win.editor = win.attachEditor();win.editor.setIconsPath(iconsPath);win.editor.init();win.editor.setContent(winEditorStoredData)};if (_isIE && this.dhxWins.window(wId)._IEFixMTS == true) {var obj = this.dhxWins.window(wId)._content.childNodes[2];var pad = obj.style.paddingBottom;obj.style.paddingBottom = "0px";window.setTimeout(function(){obj.style.paddingBottom=pad},1)};this.callEvent("onUnDock", [p])}};this.isPanelVisible = function(pId) {if (this.polyObj[pId] == null){return};if (this.polyObj[pId]._collapsed == true){return};var bar = this.polyObj[pId].childNodes[0];var isVisible = (bar.style.display!="none");return isVisible};this.showPanel = function(pId) {if (this.polyObj[pId] == null){return};if (this.polyObj[pId]._collapsed == true){return};var bar = this.polyObj[pId].childNodes[0];if (bar._tabbarMode == -2){this.dhxWins.window(bar._win).tabbar._tabZone.style.display='';this.dhxWins.window(bar._win).tabbar.adjustOuterSize();return bar._tabbarMode = -1};if (bar._tabbarMode == -1)return;bar._h = this._CPanelHeight;this.polyObj[pId].childNodes[1].style.height = parseInt(this.polyObj[pId].style.height) - bar._h + "px";bar.style.display = "";if (_isOpera){this._fixCellsContentOpera950()}};this.hidePanel = function(pId) {if (this.polyObj[pId] == null){return};if (this.polyObj[pId]._collapsed == true){return};var bar = this.polyObj[pId].childNodes[0];if (typeof bar._tabbarMode == "undefined"){bar.style.display = "none"}else {if (bar._tabbarMode===true){this.polyObj[pId].childNodes[1].style.position = "absolute";bar._tabbarMode = -1}else if (bar._tabbarMode == -1){this.dhxWins.window(bar._win).tabbar._tabZone.style.display='none'
 this.dhxWins.window(bar._win).tabbar.adjustOuterSize();bar._tabbarMode = -2}};bar._h = 0;var h = parseInt(this.polyObj[pId].style.height);this.polyObj[pId].childNodes[1].style.height = h+"px";if (_isOpera){this._fixCellsContentOpera950()}};this.setText = function(pId, text) {this.dhxWins.window("w"+pId).setText(text)};this._changeCPanelText = function(pId, text) {var layout = that;if (layout.polyObj[pId] == null){return};layout.polyObj[pId].childNodes[0].childNodes[0].innerHTML = 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() {this._menu = this._parentWindow.attachMenu();return this._menu};this.attachToolbar = function() {this._toolbar = this._parentWindow.attachToolbar();return this._toolbar};this.attachStatusBar = function() {this._status = this._parentWindow.attachStatusBar();return this._status};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[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._content.style.width);dim[1] = parseInt(win._content.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]){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]){minHeight = that._dimension[1]};if (inLayout == true){return new Array("", minWidth, minHeight)}else {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.adjustOuterSize = function() {};this.setSizes = function(winObj) {var bw = parseInt(this.base.style.width);var bh = parseInt(this.base.style.height);var ww = winObj._content.offsetWidth;var wh = winObj._content.childNodes[2].offsetHeight;if (_isIE){if (winObj.sb != null){wh = wh-winObj._sbH};if (winObj.menu != null){wh = wh-winObj._menuH};if (winObj.toolbar != null){wh = wh-winObj._toolbarH}};var ax = ww-bw;var ay = wh-bh;var hor = this._getNearestParents("hor");var ver = this._getNearestParents("ver");var both = {};for (var a in hor){both[a] = a;this.polyObj[a].style.width = hor[a]+ax+"px";this.polyObj[a].childNodes[1].style.width = hor[a]+ax+"px"};for (var a in ver){both[a] = a;this.polyObj[a].style.height = ver[a]+ay+"px";this.polyObj[a].childNodes[1].style.height = ver[a]-this.polyObj[a].childNodes[0]._h+ay+"px"};this.base.style.width = ww+"px";this.base.style.height = wh+"px";for (var a in both){this._updateComponentsView(this.dhxWins.window(this.polyObj[a]._win))};this.callEvent("onResizeFinish", [])};this._cleatTDActions = function(obj) {obj._dir = null;obj._top = null;obj._bottom = null;obj._left = null;obj._right = null;obj._dblClick = null;obj._minW = null;obj._minH = null;obj._initCPanel = null;obj._resize = null;obj._rowData = null;obj.onselectstart = null;obj.onmousedown = null;obj.onmouseup = null;obj.onmousemove = null;obj.onclick = null;obj.ondblclick = null};this.clearAll = function() {for (var a in this.polyObj){var bar = this.polyObj[a].childNodes[0];while (bar.childNodes.length > 0){this._cleatTDActions(bar.childNodes[0]);bar.removeChild(bar.childNodes[0])};bar = null;while (this.polyObj[a].childNodes.length > 0){this.polyObj[a].removeChild(this.polyObj[a].childNodes[0])};delete this.polyObj[a]};while (this.tpl.childNodes[0].childNodes.length > 0){var tr = this.tpl.childNodes[0].childNodes[0];while (tr.childNodes.length > 0){this._cleatTDActions(tr.childNodes[0]);tr.removeChild(tr.childNodes[0])};this.tpl.childNodes[0].removeChild(tr);tr = null}};this.dhx_Event();this.dhxLayout_destructor();this._init()};dhtmlXLayoutObject.prototype.dhx_Event = function() {this.dhx_SeverCatcherPath="";this.attachEvent = function(original, catcher, CallObj) {original = original.toLowerCase();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) {name = name.toLowerCase();if (this["ev_"+name]){return this["ev_"+name].apply(this,arg0)};return true};this.checkEvent = function(name) {name = name.toLowerCase();if (this["ev_"+name]){return true};return false};this.eventCatcher = function(obj) {var dhx_catch = new Array();var m_obj = obj;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") 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])}}};dhtmlXLayoutObject.prototype.dhxLayout_destructor = function() {this.destructor = function() {var vars = new Array("_CPanelBtnsWidth", "_CPanelHeight", "_resFunc", "_resObj", "_resX", "_resY", "_totalCols", "_totalRows", "_autoHor", "_autoVer",
 "_anyExpB", "_anyExpL", "_anyExpR", "_anyExpT", "_layoutView", "_minHeight", "_minWidth", "_availAutoSize", "_dimension", "_effects",
 "_collapsedH", "_collapsedW", "_colsRatio", "_rowsRatio", "h", "w", "skin", "imagePath");for (var q=0;q<vars.length;q++){delete this[vars[q]]};vars = null;var seps = new Array("sepHor", "sepVer");var vars = new Array("_bottom", "_top", "_left", "_right", "_dblClick", "_dir", "_isLayoutCell", "_isSep");var funcs = new Array("ondblclick", "onmousedown", "onmouseup", "onselectstart");for (var w=0;w<seps.length;w++){for (var a in this[seps[w]]){var sep = this[seps[w]][a];sep.className = null;for (var q=0;q<vars.length;q++){delete sep[vars[q]]};for (var q=0;q<funcs.length;q++){sep[funcs[q]] = null;delete sep[funcs[q]]};sep = null};delete this[seps[w]]};vars = null;funcs = null;seps = null}};function dhtmlXMenuObject(baseId, skin) {var main_self = this;this.addBaseIdAsContextZone = null;this.skin = (skin!=null?skin:"dhx_blue");this.skinPath = "imgs/"+this.skin;this.imagePath = this.skinPath;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";this.base._autoSkinUpdate = true;this.addBaseIdAsContextZone = baseId}else {this.base = document.body}};this.topId = "dhxWebMenuTopId";this.menu = new Array();this.subMenuData = new Array();this.menuSelected = -1;this.menuLastClicked = -1;this.idPrefix = "";this.itemTagName = "item";this.itemTextTagName = "itemtext";this.userDataTagName = "userdata";this.itemTipTagName = "tooltip";this.itemHotKeyTagName = "hotkey";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.menuTouched = false;this.zIndInit = 1200;this.zInd = this.zIndInit;this.zIndStep = 50;this.menuModeTopLevelTimeout = true;this.menuModeTopLevelTimeoutTime = 200;this.topLevelItemPaddingIconExists = 27;this.topLevelItemPaddingIconNotExists = 6;this._topLevelBottomMargin = 1;this._topLevelRightMargin = 0;this._arrowFFFix = (_isIE ? 0 : -4);this.setSkin = function(skin) {var oldSkin = this.skin;this.skin = skin;switch (this.skin){case "standard":
 this._topLevelBottomMargin = 1;this._arrowFFFix = (_isIE ? 0 : -4);break;case "clear_blue":
 case "clear_green":
 case "clear_silver":
 this._topLevelBottomMargin = 3;this._arrowFFFix = (_isIE ? 0 : -4);break;case "aqua_orange":
 case "aqua_sky":
 case "aqua_dark":
 this._topLevelBottomMargin = 1;this._arrowFFFix = (_isIE ? 0 : -2);break;case "modern_blue":
 case "modern_red":
 case "modern_black":
 this._topLevelBottomMargin = 3;this._arrowFFFix = (_isIE ? 0 : -2);break;case "glassy_blue":
 this._topLevelBottomMargin = 0;break;case "dhx_black":
 case "dhx_blue":
 this._topLevelBottomMargin = 2;this._topLevelRightMargin = 1;break};if (this.base._autoSkinUpdate){this.base.className = this.base.className.replace("dhtmlxMenu_"+oldSkin+"_Middle", "")+" dhtmlxMenu_"+this.skin+"_Middle"}};this.setSkin(this.skin);this.dLoad = false;this.dLoadUrl = "";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.sxDacProc = null;this.dacSpeed = 30;this.dacCycles = [];for (var q=0;q<10;q++){this.dacCycles[q] = q};this.dacSpeedIE = 60;this.dacCyclesIE = [];for (var q=0;q<3;q++){this.dacCyclesIE[q] = q*2+1};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 {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"}}}}};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}};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){arrowUp = this.idPull["arrowup_"+id];arrowUp.style.visibility = "hidden";arrowUp.style.display = "";arrowUp.style.zIndex = this.zInd;arrUpH = arrowUp.offsetHeight};if (this.idPull["arrowdown_"+id] != null){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.display = "";this.idPull[pId].style.zIndex = this.zInd;if (this.limit > 0 && this.limit < itemCount){this.idPull[pId].style.height = this.idPull[pId].childNodes[0].offsetHeight*this.limit;this.idPull[pId].scrollTop = 0};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 scrTp = (this.idPull[parPoly] != null ? this.idPull[parPoly].scrollTop : 0);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]) - scrTp;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"){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 == "top"){x = srcX - 1;y = srcY - h + 2};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){x = srcX - w + 2};if (y+h > my && this.menuY2 != null){y = srcY + srcH - h + 2};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;document.body.appendChild(ifr)
 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 = ""};this.callEvent("_onPolyShow",[id.replace(this.idPrefix,"")])}}};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 = "dhtmlxMenu_"+this.skin+"_SubLevelArea_Item_Normal"}}};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 = "dhtmlxMenu_"+this.skin+"_SubLevelArea_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+"?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) {this.menuLastClicked = id;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])}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 = s + z.charAt(Math.round(Math.random() * z.length))};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 == "dhtmlxMenu_"+main_self.skin+"_SubLevelArea_Item_Selected"){main_self.idPull[id].className = "dhtmlxMenu_"+main_self.skin+"_SubLevelArea_Item_Normal"};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;main_self.zInd = main_self.zIndInit};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"] = "dhtmlxmenu_chbx_"+(item["checked"]?"1":"0")+".gif";item["imgdis"] = "dhtmlxmenu_chbxdis_"+(item["checked"]?"1":"0")+".gif"};if (item["type"] == "radio"){item["checked"] = (r.getAttribute("checked")!=null);item["imgen"] = "dhtmlxmenu_rdbt_"+(item["checked"]?"1":"0")+".gif";item["imgdis"] = "dhtmlxmenu_rdbtdis_"+(item["checked"]?"1":"0")+".gif";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?"disabled":"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}};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);dhtmlxEvent(document.body, "click", function(){if (main_self.context){main_self._hideContextMenu()}else {main_self._clearAndHide()}});dhtmlxEvent(document.body, "contextmenu", function(e) {if (main_self._skip_hide){main_self._skip_hide = false;return};e = e||event;var toHide = true;var testZone = e.target || e.srcElement;if (testZone.id != null){if (main_self.isContextZone(testZone.id)) {toHide = false}};if (toHide){main_self.hideContextMenu()}});this.dhx_Event();return this};dhtmlXMenuObject.prototype.init = function() {if (this._isInited == true){return};if (this.dLoad){this.callEvent("onXLS", []);this._xmlLoader.loadXML(this.dLoadUrl+"?action=loadMenu&etc="+new Date().getTime())}else {this._initTopLevelMenu();this._isInited = true}};dhtmlXMenuObject.prototype._initTopLevelMenu = function() {this.dirTopLevel = "bottom";this.dirSubLevel = "right";if (this.context){this.idPull[this.idPrefix+this.topId] = new Array(0,0);this._addSubMenuPolygon(this.idPrefix+this.topId, this.idPrefix+this.topId);this._attachEvents()}else {var m = this._getMenuNodes(this.idPrefix + this.topId);for (var q=0;q<m.length;q++){this._renderToplevelItem(m[q], null)}}};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;var arrowObj = null;if (id == this.idPrefix+this.topId){return};for (var q=0;q<this.idPull[id].childNodes.length;q++){var node = this.idPull[id].childNodes[q];if (node.id != null){if (node.id == "arrow_"+id){arrowObj = node}}};if (this.itemPull[id]["complex"]){if (arrowObj == null){arrowObj = document.createElement("IMG");arrowObj.className = "dhtmlxMenu_"+this.skin+"_SubLevelArea_Item_Arrow";arrowObj.id = "arrow_"+id;arrowObj.border = "0";this.idPull[id].appendChild(arrowObj)};if (this.dLoad && (this.itemPull[id]["loaded"] == "get")&& this.loaderIcon) {var ldrImg = this.skinPath+"dhtmlxmenu_loader.gif";if (arrowObj.src.search(ldrImg)== -1) {arrowObj.src = ldrImg}}else {arrowObj.src = this.skinPath+"dhtmlxmenu_sub"+(this.itemPull[id]["state"]=="enabled"?(over?"over":"enable"):"disable")+".gif"};return};if ((!this.itemPull[id]["complex"])&& (arrowObj!=null)) {this.idPull[id].removeChild(arrowObj);if (this.itemPull[id]["hotkey_backup"] != null){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._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;this.idPull[j].className = "dhtmlxMenu_"+this.skin+"_"+(!this.context?levelType:"SubLevelArea")+"_Item_"+(this.itemPull[j]["state"]=="enabled"?"Normal":"Disabled");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){this._redistribTopLevelPositions();this._redistribTopLevelSelection(id, "parent")}}};return t};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>";arrow.style.display = "none";arrow.over = 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)};document.body.appendChild(arrow);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>";arrow.style.display = "none";arrow.over = 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)};document.body.appendChild(arrow);this.idPull[arrow.id] = arrow};dhtmlXMenuObject.prototype._removeUpArrow = function(id) {};dhtmlXMenuObject.prototype._removeDownArrow = function(id) {};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};if (this.limit == 0 && itemsNum > 0){var needHeight = true;for (var a in this.idPull){if (a.match(/^polygon_/gi)!= null) {var id = a.replace("polygon_"+this.idPrefix, "");var itemCount = this._countPolygonItems(id);if (itemCount > itemsNum){this._addDownArrow(id);this._addUpArrow(id)}}};this.limit = itemsNum;return};if (this.limit > 0 && itemsNum > 0){for (var a in this.idPull){if (a.match(/^polygon_/gi)!= null) {var id = a.replace("polygon_"+this.idPrefix, "");var itemCount = this._countPolygonItems(id);if (this._isArrowExists && itemCount <= itemsNum){this._removeDownArrow(id);this._removeUpArrow(id)};if (!this._isArrowExists && itemCount > itemsNum){this._addDownArrow(id);this._addUpArrow(id)}}};this.limit = itemsNum};if (this.limit > 0 && itemsNum <= 0){return}};dhtmlXMenuObject.prototype._redistribTopLevelPositions = function() {var w = 0;for (var q=0;q<this.base.childNodes.length;q++){if (this.base.childNodes[q].tagName == "DIV"){this.base.childNodes[q].style.left = w + "px";w += this.base.childNodes[q].offsetWidth}}};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.setImagePath = function(path) {this.skinPath = path+"dhxmenu_"+this.skin+"/"};dhtmlXMenuObject.prototype.setIconsPath = function(path) {this.imagePath = path};dhtmlXMenuObject.prototype.setIconPath = dhtmlXMenuObject.prototype.setIconsPath;dhtmlXMenuObject.prototype.setOpenMode = function(mode) {if ((mode == "win")|| (mode == "web")) {this.menuMode = mode}else {this.menuMode == "web"}};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.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.idPull[id].innerHTML = this.idPull[id].innerHTML.replace(this.itemPull[id]["title"], text);this.itemPull[id]["title"] = text;if (this.idPrefix + this.menuLastClicked == id){this._redistribSubLevelSelection(id, this.itemPull[id]["parent"])};if (this.itemPull[id]["parent"] == this.idPrefix+this.topId){this._redistribTopLevelPositions()}}};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");if (this._getItemLevelType(id)== "TopLevel") {this._redistribTopLevelPositions()};this._redefineComplexState(this.itemPull[this.idPrefix+id]["parent"])};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.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._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"] = "dhtmlxmenu_chbx_" + (this._getCheckboxState(id)?"1":"0") + ".gif";this.itemPull[this.idPrefix+id]["imgdis"] = "dhtmlxmenu_chbxdis_" + (this._getCheckboxState(id)?"1":"0") + ".gif";this.idPull[this.idPrefix+id].childNodes[0].src = this.skinPath + (this.itemPull[this.idPrefix+id]["state"]=="enabled"?this.itemPull[this.idPrefix+id]["imgen"]:this.itemPull[this.idPrefix+id]["imgdis"])};dhtmlXMenuObject.prototype._checkboxOnClickHandler = function(id, type) {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])) {this.setCheckboxState(id, !state)}}else {this.setCheckboxState(id, !state)}};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.itemPull[this.idPrefix+nextToId] == null){return};if (this.itemPull[this.idPrefix+nextToId]["parent"] == this.idPrefix+this.topId){return};var img = "dhtmlxmenu_chbx_"+(state?"1":"0")+".gif";var imgDis = "dhtmlxmenu_chbxdis_"+(state?"1":"0")+".gif";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._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);if (this.idPull["polygon_"+parentId] == null){this._renderSublevelPolygon(parentId, parentId)};this._renderSublevelItem(id, pos-1);this._redefineComplexState(parentId)}};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._updateItemImage = function(id, levelType) {var imgObj = null;for (var q=0;q<this.idPull[this.idPrefix+id].childNodes.length;q++){var node = this.idPull[this.idPrefix+id].childNodes[q];if (node.id != null){if (node.id == "image_"+this.idPrefix+id){imgObj = node}}};if (this.itemPull[this.idPrefix+id]["type"] == "radio"){var imgSrc = this.itemPull[this.idPrefix+id][(this.itemPull[this.idPrefix+id]["state"]=="enabled"?"imgen":"imgdis")]}else {var imgSrc = this.itemPull[this.idPrefix+id][(this.itemPull[this.idPrefix+id]["state"]=="enabled"?"imgen":"imgdis")]};if (imgSrc.length > 0){if (imgObj != null){imgObj.src = (this.itemPull[this.idPrefix+id]["type"]=="checkbox"||this.itemPull[this.idPrefix+id]["type"]=="radio"?this.skinPath:this.imagePath) + imgSrc}else {var newImgObj = document.createElement("IMG");newImgObj.className = "dhtmlxMenu_"+this.skin+"_"+levelType+"_Item_Icon";newImgObj.src = this.imagePath + imgSrc;newImgObj.id = "image_"+this.idPrefix+id;newImgObj.border = 0;this.idPull[this.idPrefix+id].appendChild(newImgObj);if (levelType == "TopLevel"){this.idPull[this.idPrefix+id].style.paddingLeft = this.topLevelItemPaddingIconExists+"px"}}}else {if (imgObj != null){this.idPull[this.idPrefix+id].removeChild(imgObj);if (levelType == "TopLevel"){this.idPull[this.idPrefix+id].style.paddingLeft = this.topLevelItemPaddingIconNotExists+"px"}}}};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));this._redistribTopLevelPositions()};dhtmlXMenuObject.prototype.clearItemImage = function(id) {this.setItemImage(id, "", "")};dhtmlXMenuObject.prototype.setWebModeTimeout = function(tm) {this.menuTimeoutMsec = (!isNaN(tm)?tm:400)};dhtmlXMenuObject.prototype._getRadioImgObj = function(id) {var imgObj = null;for (var q=0;q<this.idPull[this.idPrefix+id].childNodes.length;q++){var node = this.idPull[this.idPrefix+id].childNodes[q];if (node.id != null){if (node.id == "image_"+this.idPrefix+id){imgObj = node}}};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"] = "dhtmlxmenu_rdbt_"+(rObj["checked"]?"1":"0")+".gif";rObj["imgdis"] = "dhtmlxmenu_rdbtdis_"+(rObj["checked"]?"1":"0")+".gif";imgObj.src = this.skinPath + (rObj["state"]=="disabled"?rObj["imgdis"]:rObj["imgen"])}};dhtmlXMenuObject.prototype._radioOnClickHandler = function(id, type) {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])) {this.setRadioChecked(group, id)}}else {this.setRadioChecked(group, 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.src).match(/dhtmlxmenu_rdbt_1\.gif$/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.itemPull[this.idPrefix+nextToId] == null){return};if (this.itemPull[this.idPrefix+nextToId]["parent"] == this.idPrefix+this.topId){return};var img = "dhtmlxmenu_rdbt_"+(state?"1":"0")+".gif";var imgDis = "dhtmlxmenu_rdbtdis_"+(state?"1":"0")+".gif";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, "radio", disabled, img, imgDis);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, "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};dhtmlXMenuObject.prototype.enableDynamicLoading = function(url, icon) {this.dLoad = true;this.dLoadUrl = url;this.loaderIcon = icon;this.init()};dhtmlXMenuObject.prototype._updateLoaderIcon = function(id, state) {if (this.idPull[id] == null){return};for (var q=0;q<this.idPull[id].childNodes.length;q++){if (this.idPull[id].childNodes[q].tagName == "IMG"){if (this.idPull[id].childNodes[q].className == "dhtmlxMenu_"+this.skin+"_SubLevelArea_Item_Arrow" + (state?"":"_Loading")) {this.idPull[id].childNodes[q].className = "dhtmlxMenu_"+this.skin+"_SubLevelArea_Item_Arrow" + (state?"_Loading":"");this.idPull[id].childNodes[q].src = this.skinPath + "dhtmlxmenu_" + (state?"loader":"subenable") + ".gif"}}}};dhtmlXMenuObject.prototype.removeItem = function(id) {id = this.idPrefix + id;if (this.itemPull[id] == null){return};var parentId = this.itemPull[id]["parent"];if (this.itemPull[id]["type"] == "separator"){this.idPull["separator_"+id].parentNode.removeChild(this.idPull["separator_"+id]);delete this.idPull["separator_"+id];delete this.itemPull[id]}else {if (this.itemPull[id]["complex"]){var items = this._getAllParents(id);items[items.length] = id;var polygons = new Array();for (var q=0;q<items.length;q++){if (this.itemPull[items[q]]["type"] == "separator"){this.removeItem(items[q].replace(this.idPrefix,""))}else {if (this.itemPull[items[q]]["complex"]){polygons[polygons.length] = items[q]};this.idPull[items[q]].parentNode.removeChild(this.idPull[items[q]]);delete this.idPull[items[q]];delete this.itemPull[items[q]]}};for (var q=0;q<polygons.length;q++){this.idPull["polygon_"+polygons[q]].parentNode.removeChild(this.idPull["polygon_"+polygons[q]]);if (this._isIE6){var pId = "polygon_"+polygons[q]+"_ie6cover";if (this.idPull[pId] != null){document.body.removeChild(this.idPull[pId]);delete this.idPull[pId]}};delete this.idPull["polygon_"+polygons[q]];delete this.itemPull[polygons[q]]};if (!this.context){this._redistribTopLevelPositions()}}else {this.idPull[id].parentNode.removeChild(this.idPull[id]);delete this.idPull[id];delete this.itemPull[id]}};if (this.idPull["polygon_"+parentId] != null){if (this.idPull["polygon_"+parentId].childNodes.length == 0){document.body.removeChild(this.idPull["polygon_"+parentId]);if (this._isIE6){var pId = "polygon_"+parentId+"_ie6cover";if (this.idPull[pId] != null){document.body.removeChild(this.idPull[pId]);delete this.idPull[pId]}};delete this.idPull["polygon_"+parentId];this._updateItemComplexState(parentId, false, false)}}};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) {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){zone.attachEvent("mouseup", function(e) {e.cancelBubble = true;e.returnValue = false;if (e.button == 0 && e.ctrlKey == true){main_self._doOnContextBeforeCall(e, this)};return false})}else {if (zone.oncontextmenu != null){zone._oldContextMenuHandler = zone.oncontextmenu};zone.oncontextmenu = function(e) {e = e||event;e.cancelBubble = true;e.returnValue = false;main_self._doOnContextBeforeCall(e, this);return false}}};dhtmlXMenuObject.prototype.removeContextZone = function(zoneId) {if (!this.isContextZone(zoneId)) {return false};var zone = this.contextZones[zoneId];if (_isOpera){zone.onmouseup = null}else {zone.oncontextmenu = (zone._oldContextMenuHandler!=null?zone._oldContextMenuHandler:null)};delete this.contextZones[zoneId];return true};dhtmlXMenuObject.prototype.isContextZone = function(zoneId) {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) {if (this.idPull["polygon_"+this.idPrefix+this.topId] == null){return false};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._attachEvents = function() {var main_self = this;dhtmlxEvent(document.body, "click", function(){if (_isOpera && e.ctrlKey == true){return};if (main_self._isContextMenuVisible()&& main_self.contextAutoHide) {main_self._hideContextMenu()}})};dhtmlXMenuObject.prototype._doOnContextBeforeCall = function(e, cZone) {this.contextMenuZoneId = cZone.id;this._clearAndHide();this._hideContextMenu();if (this.checkEvent("onBeforeContextMenu")) {if (this.callEvent("onBeforeContextMenu", [cZone.id])) {if (this.contextAutoShow){this._showContextMenu(e.clientX, e.clientY);this.callEvent("onAfterContextMenu", [cZone.id])}}}else {if (this.contextAutoShow){this._showContextMenu(e.clientX, e.clientY);this.callEvent("onAfterContextMenu", [cZone.id])}}};dhtmlXMenuObject.prototype.showContextMenu = function(x, y) {this._showContextMenu(x, y, false)};dhtmlXMenuObject.prototype.hideContextMenu = function() {this._hideContextMenu()};dhtmlXMenuObject.prototype.setAutoShowMode = function(mode) {this.contextAutoShow = (mode==true?true:false)};dhtmlXMenuObject.prototype.setAutoHideMode = function(mode) {this.contextAutoHide = (mode==true?true:false)};dhtmlXMenuObject.prototype.setVisibleArea = function(x1, x2, y1, y2) {this.menuX1 = x1;this.menuX2 = x2;this.menuY1 = y1;this.menuY2 = y2};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]:this.base);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]:this.base);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)};if (isOnTopLevel){this._redistribTopLevelPositions()}};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) {itemId = this.idPrefix+(itemId!=null?itemId:this._genStr(24));if (parentId == null){parentId = this.topId};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.addNewSeparator = function(nextToId, itemId) {itemId = this.idPrefix+(itemId!=null?itemId:this._genStr(24));var parentId = this.idPrefix+this.getParentId(nextToId);if ((parentId == this.idPrefix+this.topId)&& (!this.context)) {return};this._addItemIntoGlobalStrorage(itemId, parentId, "", "separator", false, "", "");this._renderSeparator(itemId, this.getItemPosition(nextToId))};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._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")};m.innerHTML = this.itemPull[id]["title"];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 imgTop = "<img id='image_"+id+"' src='"+this.imagePath+imgTop+"' class='dhtmlxMenu_"+this.skin+"_TopLevel_Item_Icon' border='0'>";m.innerHTML = imgTop+m.innerHTML;m.style.paddingLeft = this.topLevelItemPaddingIconExists+"px"}};m.onselectstart = function(e) {e = e || event;e.returnValue = false};var w = 0;for (var q=0;q<this.base.childNodes.length;q++){if (!isNaN(this.base.childNodes[q].offsetWidth)) {w = w + this.base.childNodes[q].offsetWidth}};m.style.left = w + "px";if (pos != null){pos++;if (pos < 0){pos = 0};if (pos > this.base.childNodes.length - 1){pos = null}};if (pos != null){this.base.insertBefore(m, this.base.childNodes[pos]);this._redistribTopLevelPositions()}else {this.base.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 {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+"?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;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":"-");main_self._doOnClick(this.id.replace(main_self.idPrefix, ""), tc+td+"t")}};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"};this.subMenuData[this.subMenuData.length] = new Array(id, s, level);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";s.oncontextmenu = function() {return false};s.id = "polygon_" + parentId;s.onclick = function(e) {e = e || event;e.cancelBubble = true};s.style.display = "none";document.body.appendChild(s);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 k = document.createElement("DIV");if (this.itemPull[id]["state"] == "enabled"){k.className = "dhtmlxMenu_"+this.skin+"_SubLevelArea_Item_Normal";var arw = "dhtmlxmenu_subenable.gif";j_icon = this.itemPull[id]["imgen"]}else {k.className = "dhtmlxMenu_"+this.skin+"_SubLevelArea_Item_Disabled";var arw = "dhtmlxmenu_subdisable.gif";j_icon = this.itemPull[id]["imgdis"]};var imgPath = (this.itemPull[id]["type"]=="checkbox"||this.itemPull[id]["type"]=="radio"?this.skinPath:this.imagePath);if (this.itemPull[id]["complex"]){var j_nodes = "<img src='" + this.skinPath + arw + "' border='0' class='dhtmlxMenu_"+this.skin+"_SubLevelArea_Item_Arrow' id='arrow_" + this.itemPull[id]["id"] + "'>"}else {var j_nodes = ""};if (j_icon.length > 0){j_icon = "<img id='image_" + this.itemPull[id]["id"] + "' src='" + imgPath + j_icon + "' border='0' class='dhtmlxMenu_"+this.skin+"_SubLevelArea_Item_Icon'>"};k.innerHTML = j_icon + this.itemPull[id]["title"] + j_nodes;if (this.itemPull[id]["hotkey"].length > 0 && !this.itemPull[id]["complex"]){var p = "";for (var q=0;q<this.itemPull[id]["hotkey"].length;q++){p += "&nbsp;&nbsp;"};k.innerHTML += "<div class='dhtmlxMenu_"+this.skin+"_SubLevelArea_Item_HotKey'>"+this.itemPull[id]["hotkey"]+"</div><span>"+p+"</span>"};k.id = this.itemPull[id]["id"];k.parent = this.itemPull[id]["parent"];if (this.itemPull[id]["tip"].length > 0){k.title = this.itemPull[id]["tip"]};k.onselectstart = function(e) {e = e || event;e.returnValue = false};k.onmouseover = function() {if (main_self.menuMode == "web"){window.clearTimeout(main_self.menuTimeoutHandler)};main_self._redistribSubLevelSelection(this.id, this.parent)};if (main_self.menuMode == "web"){k.onmouseout = function() {window.clearTimeout(main_self.menuTimeoutHandler);main_self.menuTimeoutHandler = window.setTimeout(function(){main_self._clearAndHide()}, main_self.menuTimeoutMsec, "JavaScript")}};k.onclick = function(e) {if (!main_self.checkEvent("onClick")&& main_self.itemPull[this.id]["complex"]) {return};e = e || event;e.cancelBubble = true;tc = (main_self.itemPull[this.id]["complex"]?"c":"-");td = (main_self.itemPull[this.id]["state"]=="enabled"?"-":"d");switch (main_self.itemPull[this.id]["type"]) {case "checkbox":
 main_self._checkboxOnClickHandler(this.id.replace(main_self.idPrefix, ""), tc+td+"n");break;case "radio":
 main_self._radioOnClickHandler(this.id.replace(main_self.idPrefix, ""), tc+td+"n");break;case "item":
 main_self._doOnClick(this.id.replace(main_self.idPrefix, ""), tc+td+"n");break}};var polygon = this.idPull["polygon_"+this.itemPull[id]["parent"]];if (pos != null){pos++;if (pos < 0){pos = 0};if (pos > polygon.childNodes.length - 1){pos = null}};if (pos != null){polygon.insertBefore(k, polygon.childNodes[pos])}else {polygon.appendChild(k)};this.idPull[k.id] = k};dhtmlXMenuObject.prototype._renderSeparator = function(id, pos) {var main_self = this;var k = document.createElement("DIV");k.id = "separator_"+id;k.className = "dhtmlxMenu_"+this.skin+"_SubLevelArea_Separator";k.onselectstart = function(e) {e = e || event;e.returnValue = false};k.onclick = function(e) {e = e || event;e.cancelBubble = true;main_self._doOnClick(this.id.replace("separator_" + main_self.idPrefix, ""), "--s")};var polygon = this.idPull["polygon_"+this.itemPull[id]["parent"]];if (pos != null){pos++;if (pos < 0){pos = 0};if (pos > polygon.childNodes.length - 1){pos = null}};if (pos != null){polygon.insertBefore(k, polygon.childNodes[pos])}else {polygon.appendChild(k)};this.idPull[k.id] = k};dhtmlXMenuObject.prototype.hide = function() {this._clearAndHide()};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 ? this.itemPull[id]["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){return};if (this.itemPull[id]["complex"]){return};if (this.itemPull[id]["type"] != "item"){return};var hkObj = null;var spnObj = null;for (var q=0;q<this.idPull[id].childNodes.length;q++){if (this.idPull[id].childNodes[q].tagName == "DIV" && this.idPull[id].childNodes[q].className == "dhtmlxMenu_"+this.skin+"_SubLevelArea_Item_HotKey"){hkObj = this.idPull[id].childNodes[q]};if (this.idPull[id].childNodes[q].tagName == "SPAN"){spnObj = this.idPull[id].childNodes[q]}};if (hkey.length == 0){this.itemPull[id]["hotkey_backup"] = this.itemPull[id]["hotkey"];this.itemPull[id]["hotkey"] = "";if (hkObj != null){this.idPull[id].removeChild(hkObj)};if (spnObj != null){this.idPull[id].removeChild(spnObj)}}else {this.itemPull[id]["hotkey"] = hkey;this.itemPull[id]["hotkey_backup"] = null;if (hkObj == null){hkObj = document.createElement("DIV");hkObj.className = "dhtmlxMenu_"+this.skin+"_SubLevelArea_Item_HotKey";this.idPull[id].appendChild(hkObj)};hkObj.innerHTML = hkey;var p = "";for (var q=0;q<hkey.length;q++){p += "&nbsp;&nbsp;"};if (spnObj == null){spnObj = document.createElement("SPAN");this.idPull[id].appendChild(spnObj)};spnObj.innerHTML = p}};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.dhx_Event = function() {this.dhx_SeverCatcherPath="";this.attachEvent = function(original, catcher, CallObj) {original = original.toLowerCase();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) {name = name.toLowerCase();if (this["ev_"+name]){return this["ev_"+name].apply(this,arg0)};return true};this.checkEvent = function(name) {name = name.toLowerCase();if (this["ev_"+name]){return true};return false};this.eventCatcher = function(obj) {var dhx_catch = new Array();var m_obj = obj;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") 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 dhtmlXToolbarObject(baseId, skin) {var main_self = this;this.base = (typeof baseId != "object")?document.getElementById(baseId):baseId;while (this.base.childNodes.length > 0){this.base.removeChild(this.base.childNodes[0])};this._isIE6 = false;if (_isIE){this._isIE6 = (window.XMLHttpRequest==null?true:false)};this.skin = (skin==null?"dhx_blue":skin);this.base.className = "dhtmlxToolbar_"+this.skin;this.base.innerHTML = "<table border='0' cellspacing='0' cellpadding='1' class='dhtmlxToolbarTable_"+this.skin+"'><tr><td width='5'></td></tr></table>";this.tr = this.base.childNodes[0].childNodes[0].childNodes[0];this.objPull = {};this.anyUsed = "none";this.layout = "HOR";this._setLayout = function(layout) {this.layout = ((layout=="HOR"||layout=="VER")?layout:"HOR")};this.imagePath = "";this.emptyImage = "blank.gif";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.loadXML(xmlFile)};this.loadXMLString = function(xmlString, onLoadFunction) {if (onLoadFunction != null){this._doOnLoad = function() {onLoadFunction()}};this._xmlLoader.loadXMLString(xmlString)};this._xmlParser = function() {var root = this.getXMLTopNode("toolbar");for (var q=0;q<root.childNodes.length;q++){if (root.childNodes[q].tagName == "item"){main_self._addItemToStorage(root.childNodes[q])}};if (main_self.layout == "VER"){main_self.base.style.width = main_self.base.childNodes[0].offsetWidth+"px";var tr = document.createElement("TR");main_self.tr.parentNode.appendChild(tr);main_self.tr = tr;var td = document.createElement("TD");td.width = "5";td.height = "1";main_self.tr.appendChild(td);main_self.tr.childNodes[0].height = "100%"}else {var td = document.createElement("TD");td.width = "5";main_self.tr.appendChild(td)};main_self.callEvent("onXLE", []);main_self._doOnLoad()};this._addItemToStorage = function(itemData, pos) {var id = (itemData.getAttribute("id")!=null?itemData.getAttribute("id"):this._genStr(24));var type = (itemData.getAttribute("type")!=null?itemData.getAttribute("type"):"");if (type != ""){if (this["_"+type+"Object"] != null){this.objPull[this.idPrefix+id] = new this["_"+type+"Object"](this, id, itemData, pos);this.objPull[this.idPrefix+id]["type"] = type;if (this.layout == "VER"){var tbody = this.tr.parentNode;var tr = document.createElement("TR");if (!isNaN(pos)) {var total = Math.floor((tbody.childNodes.length - 2)/2);if (pos < 1){pos = 1};if (pos > total){pos = total};tbody.insertBefore(tr, tbody.childNodes[(pos+1)*2])}else {tbody.appendChild(tr)};this.tr = tr;this.tr.height = "1";var td = document.createElement("TD");td.style.fontSize = "1px";td.height = "1";this.tr.appendChild(td)}}}};this._xmlLoader = new dtmlXMLLoaderObject(this._xmlParser, window);this._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.rootTypes = new Array("button", "buttonSelect", "buttonTwoState", "separator", "label", "slider", "text", "buttonInput");this.idPrefix = this._genStr(12);this.dhx_Event();this.hotkeyManager();this._isWebToolbar = true;dhtmlxEvent(document.body, "click", 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 = "itemDefault";item.p1.childNodes[0].className = item.obj.renderAs;item.p2.childNodes[0].className = item.obj.renderAs;main_self.anyUsed = "none";item.polygon.style.display = "none";if (main_self._isIE6){item.polygon._ie6cover.style.display = "none"}}}})});return this};dhtmlXToolbarObject.prototype.getType = function(itemId) {if (this.objPull[this.idPrefix+itemId] == null){return ""};return this.objPull[this.idPrefix+itemId]["type"]};dhtmlXToolbarObject.prototype.inArray = function(array, value) {for (var q=0;q<array.length;q++){if (array[q]==value)return true};return false};dhtmlXToolbarObject.prototype._string2xml = function(xmlString) {try {var parser = new DOMParser();var xmlDoc = parser.parseFromString(xmlString, "text/xml")}catch(e) {var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async = this.async;xmlDoc["loadXM"+"L"](xmlString)};return (xmlDoc != null ? xmlDoc : null)};dhtmlXToolbarObject.prototype._addObject = function(obj, pos) {var cell = null;if (this.layout == "VER"){var tr = document.createElement("TR");if (!isNaN(parseInt(pos))) {pos--;var tbody = this.tr.parentNode;var total = (tbody.childNodes.length - 2)/2;if (pos < 0){pos = 0};if (pos > total){pos = total};tbody.insertBefore(tr, tbody.childNodes[pos*2+1])}else {this.tr.parentNode.appendChild(tr)};this.tr = tr;cell = this.tr}else {cell = obj};if (!isNaN(parseInt(pos)) && this.layout != "VER") {var total = this.tr.childNodes.length - 3;if (total < 0 && this.tr.childNodes.length == 1){var td = document.createElement("TD");td.style.width = "1px";this.tr.insertBefore(td, this.tr.childNodes[0]);var td = document.createElement("TD");td.style.width = "5px";this.tr.insertBefore(td, this.tr.childNodes[0]);this.tr.insertBefore(obj, this.tr.childNodes[1])}else {if (pos < 1){pos = 1};if (pos > total){pos = total + 1};this.tr.insertBefore(obj, this.tr.childNodes[pos])}}else {this.tr.appendChild(obj)};return cell};dhtmlXToolbarObject.prototype._addItem = function(str, pos) {var data = this._string2xml(str);if (isNaN(pos)) {pos = null}else {if (this.layout != "VER")pos++};this._addItemToStorage(data.childNodes[0], pos)};dhtmlXToolbarObject.prototype.addButton = function(id, pos, text, imgEnabled, imgDisabled) {var itemText = (text!=null?(text.length==0?null:text):null);var str = '<item id="'+id+'" type="button"'+(imgEnabled!=null?' img="'+imgEnabled+'"':'')+(imgDisabled!=null?' imgdis="'+imgDisabled+'"':'')+(itemText!=null?' text="'+itemText+'"':"")+'/>';this._addItem(str, pos)};dhtmlXToolbarObject.prototype.addText = function(id, pos, text) {var str = '<item id="'+id+'" type="text" text="'+text+'"/>';this._addItem(str, pos)};dhtmlXToolbarObject.prototype.addButtonSelect = function(id, pos, text, opts, imgEnabled, imgDisabled) {var itemText = (text!=null?(text.length==0?null:text):null);var str = '<item id="'+id+'" type="buttonSelect"'+(imgEnabled!=null?' img="'+imgEnabled+'"':'')+(imgDisabled!=null?' imgdis="'+imgDisabled+'"':'')+(itemText!=null?' text="'+itemText+'"':"")+'>';for (var q=0;q<opts.length;q++){if (opts[q][1] == "obj"){str += '<item type="button" id="'+opts[q][0]+'" text="'+opts[q][2]+'"'+(opts[q][3]!=null?' img="'+opts[q][3]+'"':'')+'/>'}else if (opts[q][1] == "sep"){str += '<item id="'+opts[q][0]+'" type="separator"/>'}};str += '</item>';this._addItem(str, pos)};dhtmlXToolbarObject.prototype.addButtonTwoState = function(id, pos, text, imgEnabled, imgDisabled) {var itemText = (text!=null?(text.length==0?null:text):null);var str = '<item id="'+id+'" type="buttonTwoState"'+(imgEnabled!=null?' img="'+imgEnabled+'"':'')+(imgDisabled!=null?' imgdis="'+imgDisabled+'"':'')+(itemText!=null?' text="'+itemText+'"':"")+'/>';this._addItem(str, pos)};dhtmlXToolbarObject.prototype.addSeparator = function(id, pos) {var str = '<item id="'+id+'" type="separator"/>';this._addItem(str, pos)};dhtmlXToolbarObject.prototype.addSlider = function(id, pos, len, valueMin, valueMax, valueNow, textMin, textMax, tip) {var itemTextMin = (textMin!=null?(textMin.length==0?null:textMin):null);var itemTextMax = (textMax!=null?(textMax.length==0?null:textMax):null);var str = '<item id="'+id+'" type="slider" length="'+len+'" valueMin="'+valueMin+'" valueMax="'+valueMax+'" valueNow="'+valueNow+'"'+(itemTextMin!=null?' textMin="'+itemTextMin+'"':'')+(itemTextMax!=null?' textMax="'+itemTextMax+'"':'')+' toolTip="'+tip+'"/>';this._addItem(str, pos)};dhtmlXToolbarObject.prototype.addInput = function(id, pos, value, width) {var str = '<item id="'+id+'" type="buttonInput" value="'+value+'" width="'+width+'"/>';this._addItem(str, 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.setPosition = function(itemId, pos) {this._setPosition(itemId, pos)};dhtmlXToolbarObject.prototype.getPosition = function(itemId) {return this._getPosition(itemId)};dhtmlXToolbarObject.prototype._setPosition = function(id, pos) {itemId = this.idPrefix+id;if (this.objPull[itemId] == null){return};var itemPos = this._getPosition(id);if (itemPos == pos){return};if (this.layout == "VER"){var tbody = this.base.childNodes[0].childNodes[0];var tbody = this.tr.parentNode;var total = (tbody.childNodes.length - 2)/2;if (pos < 1){pos = 1};if (pos > total){pos = total};var k1 = tbody.childNodes[(itemPos-1)*2+1];var k2 = tbody.childNodes[(itemPos-1)*2+2];tbody.removeChild(k1);tbody.removeChild(k2);tbody.insertBefore(k2, tbody.childNodes[pos*2-1]);tbody.insertBefore(k1, tbody.childNodes[pos*2-1])}else {var tr = this.base.childNodes[0].childNodes[0].childNodes[0];var total = tr.childNodes.length - 3;if (pos < 1){pos = 1};if (pos > total){pos = total};var k = tr.childNodes[itemPos];tr.removeChild(k);tr.insertBefore(k, tr.childNodes[pos])
 }};dhtmlXToolbarObject.prototype._getPosition = function(id) {var pos = -1;id = this.idPrefix+id;if (this.objPull[id] == null){return pos};if (this.layout == "VER"){var tbody = this.base.childNodes[0].childNodes[0];for (var q=0;q<tbody.childNodes.length;q++){if (tbody.childNodes[q].childNodes[0] == this.objPull[id].obj){pos = Math.ceil(q/2)};if (tbody.childNodes[q].childNodes[0].childNodes[0] == this.objPull[id].obj){pos = Math.ceil(q/2)}}}else {var tr = this.base.childNodes[0].childNodes[0].childNodes[0];for (var q=0;q<tr.childNodes.length;q++){if (tr.childNodes[q] == this.objPull[id].obj){pos = q};if (tr.childNodes[q].childNodes[0] == this.objPull[id].obj){pos = q}}};return pos};dhtmlXToolbarObject.prototype.removeItem = function(itemId) {if (this.objPull[this.idPrefix+itemId] == null){return};if (this.layout == "VER"){var obj = this.objPull[this.idPrefix+itemId].obj.parentNode.parentNode;var pos = this._getPosition(itemId);obj.removeChild(obj.childNodes[pos+1]);obj.removeChild(obj.childNodes[pos+1])}else {var obj = this.objPull[this.idPrefix+itemId].obj;obj.parentNode.removeChild(obj)};if (this.objPull[this.idPrefix+itemId].polygon != null){var polygon = this.objPull[this.idPrefix+itemId].polygon;polygon.parentNode.removeChild(polygon);polygon = null};if (this.objPull[this.idPrefix+itemId].obj != null){if (this.objPull[this.idPrefix+itemId].obj.pen != null){if (this.objPull[this.idPrefix+itemId].obj.pen.label != null){var label = this.objPull[this.idPrefix+itemId].obj.pen.label;label.parentNode.removeChild(label);label = null}}};obj = null;delete this.objPull[this.idPrefix+itemId]};(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._separatorObject = function(that, id, data, pos) {this.id = that.idPrefix+id;this.obj = document.createElement("TD");this.obj.className = "dhtmlxToolbarItem";this.obj.align = "left";this.obj.valign = "middle";this.obj.idd = String(id);this.obj.title = (data.getAttribute("title")!=null?data.getAttribute("title"):"");this.obj.onselectstart = function(e) {e = e||event;e.returnValue = false};this.obj.innerHTML = "<table cellspacing='0' cellpadding='0' class='itemDefault'>"+
 "<tr>"+
 "<td><div class='dhtmlxToolbarSep'>&nbsp;</div></id>"+
 "</tr>"+
 "</table>";this.tr = that._addObject(this.obj, pos);this.showItem = function() {this.tr.style.display = ""};this.hideItem = function() {this.tr.style.display = "none"};this.isVisible = function() {return (this.tr.style.display == "")};return this};dhtmlXToolbarObject.prototype._textObject = function(that, id, data, pos) {this.id = that.idPrefix+id;this.obj = document.createElement("TD");this.obj.className = "dhtmlxToolbarItem";this.obj.align = "left";this.obj.valign = "middle";this.obj.idd = String(id);this.obj.title = (data.getAttribute("title")!=null?data.getAttribute("title"):"");this.obj.onselectstart = function(e) {e = e||event;e.returnValue = false};this.obj.innerHTML = "<table cellspacing='0' cellpadding='0' class='itemDefault'>"+
 "<tr>"+
 "<td class='dhtmlxToolbarTEXT' valign='middle'><span>"+data.getAttribute("text")+"</span></td>"+
 "</tr>"+
 "</table>";this.tr = that._addObject(this.obj, pos);this.showItem = function() {this.tr.style.display = ""};this.hideItem = function() {this.tr.style.display = "none"};this.isVisible = function() {return (this.tr.style.display == "")};this.setItemText = function(text) {this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].innerHTML = text};this.getItemText = function() {return this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].innerHTML};this.setWidth = function(width) {this.obj.style.width = width+"px"};return this};dhtmlXToolbarObject.prototype._buttonObject = function(that, id, data, pos) {this.id = that.idPrefix+id;this.state = (data.getAttribute("enabled")!=null?false:true);this.imgEn = (data.getAttribute("img")!=null?data.getAttribute("img"):"");this.imgDis = (data.getAttribute("imgdis")!=null?data.getAttribute("imgdis"):"");this.img = (this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.obj = document.createElement("TD");this.obj.className = "dhtmlxToolbarItem";this.obj.allowClick = false;this.obj.align = "left";this.obj.valign = "middle";this.obj.renderAs = "itemDefault";this.obj.idd = String(id);this.obj.title = (data.getAttribute("title")!=null?data.getAttribute("title"):"");this.obj.onselectstart = function(e) {e = e||event;e.returnValue = false};this.obj.pressed = false;this.obj.innerHTML = "<table cellspacing='0' cellpadding='0' class='item"+(this.state?"Default":"Disabled")+"'>"+
 "<tr>"+
 "<td class='dhtmlxToolbarIMG' valign='middle'"+(this.img!=""?"":" style='display: none;'")+"><img src='"+(this.img!=""?that.imagePath+this.img:that.imagePath+that.emptyImage)+"'></td>"+
 "<td class='dhtmlxToolbarTEXT' valign='middle'"+(data.getAttribute("text")!=null?"":" style='display: none;'")+"><span>"+(data.getAttribute("text")!=null?data.getAttribute("text"):"")+"</span></td>"+
 "</tr>"+
 "</table>";this.obj.that = 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 = false;if (this.that.state == false){return};if (that.anyUsed != "none"){return};this.childNodes[0].className = "itemOver";this.renderAs = "itemOver"};this.obj._doOnMouseOut = function() {this.allowClick = false;if (this.that.state == false){return};if (that.anyUsed != "none"){return};this.childNodes[0].className = "itemDefault";this.renderAs = "itemDefault"};this.obj.onclick = function(e) {if (this.that.state == false){return};if (this.allowClick == false){return};e = e||event;e.cancelBubble = true;that.callEvent("onClick", [this.idd.replace(that.idPrefix,"")])};this.obj.onmousedown = function(e) {this.allowClick = true;if (this.that.state == false){return};if (that.anyUsed != "none"){return};that.anyUsed = this.idd;this.childNodes[0].className = "itemPressed";this.pressed = true;this.onmouseover = function() {this._doOnMouseOver()};this.onmouseout = function() {that.anyUsed = "none";this._doOnMouseOut()};return false};this.obj.onmouseup = function(e) {if (this.that.state == false){return};if (that.anyUsed != "none"){if (that.anyUsed != this.idd){return}};this._doOnMouseUp()};this.obj._doOnMouseUp = function() {that.anyUsed = "none";this.childNodes[0].className = this.renderAs;this.pressed = false};this.obj._doOnMouseUpOnceAnywhere = function() {this._doOnMouseUp();this.onmouseover = function() {this._doOnMouseOver()};this.onmouseout = function() {this._doOnMouseOut()}};this.tr = that._addObject(this.obj, pos);this.enableItem = function() {if (!this.state){this.state = true;this.obj.childNodes[0].className = "itemDefault";if (this.imgEn != ""){this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+this.imgEn}else {this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "none";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+that.emptyImage}}};this.disableItem = function() {if (this.state){this.state = false;this.obj.childNodes[0].className = "itemDisabled";if (this.imgDis != ""){this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+this.imgDis}else {this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "none";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+that.emptyImage};this.obj.renderAs = "itemDefault"}};this.isEnabled = function() {return this.state};this.showItem = function() {this.tr.style.display = ""};this.hideItem = function() {this.tr.style.display = "none"};this.isVisible = function() {return (this.tr.style.display == "")};this.setItemText = function(text) {if (text == null || text.length == 0){this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[1].style.display = "none";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].innerHTML = ""}else {this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[1].style.display = "";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].innerHTML = text}};this.getItemText = function() {return this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].innerHTML};this.setItemImage = function(url) {this.imgEn = url;if (this.state){this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+this.imgEn}};this.clearItemImage = function() {this.imgEn = "";if (this.state){this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "none";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+that.emptyImage}};this.setItemImageDis = function(url) {this.imgDis = url;if (!this.state){this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+this.imgDis}};this.clearItemImageDis = function() {this.imgDis = "";if (!this.state){this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "none";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+that.emptyImage}};this.setItemToolTip = function(tip) {this.obj.title = tip};this.getItemToolTip = function() {return this.obj.title};return this};dhtmlXToolbarObject.prototype._buttonSelectObject = function(that, id, data, pos) {this.id = that.idPrefix+id;this.state = (data.getAttribute("enabled")!=null?(data.getAttribute("enabled")=="true"?true:false):true);this.imgEn = (data.getAttribute("img")!=null?data.getAttribute("img"):"");this.imgDis = (data.getAttribute("imgdis")!=null?data.getAttribute("imgdis"):"");this.img = (this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.obj = document.createElement("TD");this.obj.allowClick = false;this.obj.className = "dhtmlxToolbarItem";this.obj.align = "left";this.obj.valign = "middle";this.obj.renderAs = "itemDefault";this.obj.idd = String(id);this.obj.title = (data.getAttribute("title")!=null?data.getAttribute("title"):"");this.obj.pressed = false;this.obj.innerHTML = "<table border='0' cellspacing='0' cellpadding='0'><tr><td>"+
 "<table border='0' cellspacing='0' cellpadding='0' class='item"+(this.state?"Default":"Disabled")+"' width='100%'>"+
 "<tr>"+
 "<td class='dhtmlxToolbarIMG' valign='middle'"+(this.img!=""?"":" style='display: none;'")+"><img src='"+(this.img!=""?that.imagePath+this.img:that.imagePath+that.emptyImage)+"'></td>"+
 "<td class='dhtmlxToolbarTEXT' valign='middle'"+(data.getAttribute("text")!=null?"":" style='display: none;'")+"><span>"+(data.getAttribute("text")!=null?data.getAttribute("text"):"")+"</span></td>"+
 "</tr>"+
 "</table></td>"+
 "<td width='10'><table border='0' cellspacing='0' cellpadding='0' class='itemDefault' width='100%'>"+
 "<tr>"+
 "<td class='dhtmlxToolbarArrow'><div class='dhtmlxToolbarArrow'>&nbsp;</div></td>"+
 "</tr>"+
 "</table></td></tr></table>";this.tr = that._addObject(this.obj, pos);var self = this;this.p1 = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0];this.p2 = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[1];this.p1.onmouseover = function(e) {e = e||event;if (that.anyUsed != "none"){return};if (!self.state){return};self.obj.renderAs = "itemOver";self.p1.childNodes[0].className = self.obj.renderAs;self.p2.childNodes[0].className = self.obj.renderAs};this.p1.onmouseout = function() {self.obj.allowClick = false;if (that.anyUsed != "none"){return};if (!self.state){return};self.obj.renderAs = "itemDefault";self.p1.childNodes[0].className = self.obj.renderAs;self.p2.childNodes[0].className = self.obj.renderAs};this.p2.onmouseover = this.p1.onmouseover;this.p2.onmouseout = this.p1.onmouseout;this.p1.onclick = function(e) {e = e||event;e.cancelBubble = true;if (!self.obj.allowClick){return};if (!self.state){return};if (that.anyUsed != "none"){return};that.callEvent("onClick", [self.obj.idd.replace(that.idPrefix,"")])};this.p1.onmousedown = function(e) {e = e||event;e.cancelBubble = true;if (that.anyUsed != "none"){return};if (!self.state){return};self.obj.allowClick = true;self.p1.childNodes[0].className = "itemPressed";self.p2.childNodes[0].className = "itemPressed"};this.p1.onmouseup = function(e) {e = e||event;e.cancelBubble = true;if (that.anyUsed != "none"){return};if (!self.state){return};self.p1.childNodes[0].className = self.obj.renderAs;self.p2.childNodes[0].className = self.obj.renderAs};this.p2.onmousedown = function(e) {e = e||event;e.cancelBubble = true;if (!self.state){return};if (that.anyUsed == self.obj.idd){self.p1.childNodes[0].className = self.obj.renderAs;self.p2.childNodes[0].className = self.obj.renderAs;that.anyUsed = "none";self.polygon.style.display = "none";if (that._isIE6){self.polygon._ie6cover.style.display = "none"}}else if (that.anyUsed == "none"){self.p1.childNodes[0].className = "itemOver";self.p2.childNodes[0].className = "itemPressed";that.anyUsed = self.obj.idd;self.polygon.style.left = getAbsoluteLeft(self.obj)+"px";self.polygon.style.top = getAbsoluteTop(self.obj)+self.obj.offsetHeight+"px";self.polygon.style.display = "";if (that._isIE6){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.p2.onclick = function(e) {e = e||event;e.cancelBubble = true};this.p2.onmouseup = function(e) {e = e||event;e.cancelBubble = true};this.obj.iddPrefix = that.idPrefix;this._listOptions = {};this._separatorButtonSelectObject = function(that, inner, id, data, pos) {this.obj = document.createElement("DIV");this.obj.className = "buttonSeparator";if (isNaN(pos)) {inner.polygon.appendChild(this.obj)}else {if (pos < 1){pos = 1};if (pos > inner.polygon.childNodes.length){inner.polygon.appendChild(this.obj)}else {inner.polygon.insertBefore(this.obj, inner.polygon.childNodes[pos-1])}};self._listOptions[id] = this.obj;return this};this._buttonButtonSelectObject = function(that, inner, id, data, pos) {this.obj = document.createElement("DIV");this.obj.en = (data.getAttribute("enabled")=="false"?false:true);this.obj._selected = (data.getAttribute("selected")!=null);this.obj.className = (this.obj.en?"buttonItem"+(this.obj._selected?"Selected":""):"buttonItemDis");var itemText = (data.getAttribute("text")!= null?data.getAttribute("text"):null);if (itemText == null){var itm = data.getElementsByTagName("itemText");itemText = (itm[0]!=null?itm[0].firstChild.nodeValue:"")};this.obj.innerHTML = (data.getAttribute("img")!=null?"<img src='"+that.imagePath+data.getAttribute("img")+"' border='0' class='buttonImage'>":"")+"<span>"+itemText+"</span>";this.obj.onmouseover = function(e) {if (!this.en){return};this.className = "buttonItemOver"};this.obj.onmouseout = function(e) {if (!this.en){return};if (this._selected == true){this.className = "buttonItemSelected"}else {this.className = "buttonItem"}};this.obj.idd = String(id);this.obj.globalObj = that;this.obj.parentObj = inner;this.obj.onclick = function(e) {e = e||event;e.cancelBubble = true;if (!this.en){return};self.setListOptionSelected(this.idd.replace(this.globalObj.idPrefix,""));self.obj.renderAs = "itemDefault";self.p1.childNodes[0].className = self.obj.renderAs;self.p2.childNodes[0].className = self.obj.renderAs;self.polygon.style.display = "none";if (that._isIE6){self.polygon._ie6cover.style.display = "none"};that.anyUsed = "none";this.globalObj.callEvent("onClick", [this.idd.replace(this.globalObj.idPrefix,"")])};this.obj.onselectstart = function(e) {e = e||event;e.returnValue = false};if (isNaN(pos)) {inner.polygon.appendChild(this.obj)}else {if (pos < 1){pos = 1};if (pos > inner.polygon.childNodes.length){inner.polygon.appendChild(this.obj)}else {inner.polygon.insertBefore(this.obj, inner.polygon.childNodes[pos-1])}};self._listOptions[id] = this.obj;return this};this.polygon = document.createElement("DIV");this.polygon.style.display = "none";this.polygon.style.zIndex = 101;this.polygon.className = "dhtmlxToolbarPoly_"+that.skin;for (var q=0;q<data.childNodes.length;q++){if (data.childNodes[q].tagName == "item"){var id = (data.childNodes[q].getAttribute("id")!=null?data.childNodes[q].getAttribute("id"):that._genStr(24));var type = (data.childNodes[q].getAttribute("type")!=null?"_"+data.childNodes[q].getAttribute("type")+"ButtonSelectObject":that._genStr(24));if (this[type] != null){that.objPull[that.idPrefix+id] = new this[type](that, this, id, data.childNodes[q]);that.objPull[that.idPrefix+id]["type"] = "buttonSelectNode"}}};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";document.body.appendChild(this.polygon._ie6cover)};this.setWidth = function(width) {this.obj.style.width = width+"px";this.obj.childNodes[0].style.width = "100%";this.polygon.style.width = this.obj.style.width};this.enableItem = function() {if (!this.state){this.state = true;var p1 = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0];var p2 = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[1];p1.childNodes[0].className = "itemDefault";p2.childNodes[0].className = "itemDefault";if (this.imgEn != ""){p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "";p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+this.imgEn}else {p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "none";p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+that.emptyImage};this.obj.renderAs = "itemDefault"}};this.disableItem = function() {if (this.state){this.state = false;var p1 = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0];var p2 = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[1];p1.childNodes[0].className = "itemDisabled";p2.childNodes[0].className = "itemDisabled";if (this.imgDis != ""){p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "";p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+this.imgDis}else {p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "none";p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+that.emptyImage};this.obj.renderAs = "itemDefault"}};this.isEnabled = function() {return this.state};this.showItem = function() {this.tr.style.display = ""};this.hideItem = function() {this.tr.style.display = "none"};this.isVisible = function() {return (this.tr.style.display == "")};this.setItemText = function(text) {var p1 = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0];if (text == null || text.length == 0){p1.childNodes[0].childNodes[0].childNodes[0].childNodes[1].style.display = "none";p1.childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].innerHTML = ""}else {p1.childNodes[0].childNodes[0].childNodes[0].childNodes[1].style.display = "";p1.childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].innerHTML = text}};this.getItemText = function() {var p1 = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0];return p1.childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].innerHTML;};this.setItemImage = function(url) {this.imgEn = url;var p1 = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0];if (this.state){p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "";p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+this.imgEn}};this.clearItemImage = function() {this.imgEn = "";var p1 = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0];if (this.state){p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "none";p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+that.emptyImage}};this.setItemImageDis = function(url) {this.imgDis = url;var p1 = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0];if (!this.state){p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "";p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+this.imgDis}};this.clearItemImageDis = function() {this.imgDis = "";var p1 = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0];if (!this.state){p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "none";p1.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+that.emptyImage}};this.addListOption = function(id, pos, type, text, img) {if (type == "button"){var str = '<item id="'+id+'" type="button" text="'+text+'"'+(img!=null?' img="'+img+'"':'')+'/>';var data = that._string2xml(str);that.objPull[that.idPrefix+id] = new this._buttonButtonSelectObject(that, this, id, data.childNodes[0], pos);that.objPull[that.idPrefix+id]["type"] = "buttonSelectNode"}else if (type == "separator"){var str = '<item id="'+id+'" type="separator"/>';var data = that._string2xml(str);that.objPull[that.idPrefix+id] = new this._separatorButtonSelectObject(that, this, id, data.childNodes[0], pos);that.objPull[that.idPrefix+id]["type"] = "buttonSelectNode"}};this.removeListOption = function(id) {if (that.objPull[that.idPrefix+id] == null){return};var obj = that.objPull[that.idPrefix+id].obj;obj.parentNode.removeChild(obj);obj = null;delete that.objPull[that.idPrefix+id];delete this._listOptions[id]};this.showListOption = function(id) {id = that.idPrefix + id;if (that.objPull[id] == null){return};that.objPull[id].obj.style.display = ""};this.hideListOption = function(id) {id = that.idPrefix + id;if (that.objPull[id] == null){return};that.objPull[id].obj.style.display = "none"};this.isListOptionVisible = function(id) {id = that.idPrefix + id;if (that.objPull[id] == null){return};return (that.objPull[id].obj.style.display != "none")};this.enableListOption = function(id) {id = that.idPrefix + id;if (that.objPull[id] == null){return};if (that.objPull[id].obj.className == "buttonSeparator"){return};that.objPull[id].obj.en = true;that.objPull[id].obj.className = "buttonItem"};this.disableListOption = function(id) {id = that.idPrefix + id;if (that.objPull[id] == null){return};if (that.objPull[id].obj.className == "buttonSeparator"){return};that.objPull[id].obj.en = false;that.objPull[id].obj.className = "buttonItemDis"};this.isListOptionEnabled = function(id) {id = that.idPrefix + id;if (that.objPull[id] == null){return};if (that.objPull[id].obj.className == "buttonSeparator"){return};return that.objPull[id].obj.en};this.setListOptionPosition = function(id, pos) {if (this.getListOptionPosition(id)== pos) {return};id = that.idPrefix + id;if (that.objPull[id] == null){return};if (pos < 1){pos = 1};this.polygon.removeChild(that.objPull[id].obj);if (pos > this.polygon.childNodes.length){this.polygon.appendChild(that.objPull[id].obj)}else {this.polygon.insertBefore(that.objPull[id].obj, this.polygon.childNodes[pos-1])}};this.getListOptionPosition = function(id) {id = that.idPrefix + id;var pos = -1;if (that.objPull[id] == null){return pos};for (var q=0;q<this.polygon.childNodes.length;q++){if (this.polygon.childNodes[q] == that.objPull[id].obj){pos = q+1}};return pos};this.setListOptionImage = function(id, img) {id = that.idPrefix + id;if (that.objPull[id] == null){return};if (that.objPull[id].obj.className == "buttonSeparator"){return};var imgObj = null;if ((that.objPull[id].obj.childNodes[0].tagName).toLowerCase() == "img") {imgObj = that.objPull[id].obj.childNodes[0]}else {imgObj = document.createElement("IMG");imgObj.className = "buttonImage";imgObj.border = "0";that.objPull[id].obj.insertBefore(imgObj, that.objPull[id].obj.childNodes[0])};imgObj.src = that.imagePath+img};this.getListOptionImage = function(id) {id = that.idPrefix + id;if (that.objPull[id] == null){return};if (that.objPull[id].obj.className == "buttonSeparator"){return};var img = null;if ((that.objPull[id].obj.childNodes[0].tagName).toLowerCase() == "img") {img = that.objPull[id].obj.childNodes[0].src};return img};this.clearListOptionImage = function(id) {id = that.idPrefix + id;if (that.objPull[id] == null){return};if (that.objPull[id].obj.className == "buttonSeparator"){return};if ((that.objPull[id].obj.childNodes[0].tagName).toLowerCase() == "img") {var imgObj = that.objPull[id].obj.childNodes[0];that.objPull[id].obj.removeChild(imgObj);imgObg = null}};this.setListOptionText = function(id, text) {id = that.idPrefix + id;if (that.objPull[id] == null){return};if (that.objPull[id].obj.className == "buttonSeparator"){return};var obj = that.objPull[id].obj;for (var q=0;q<obj.childNodes.length;q++){if ((obj.childNodes[q].tagName).toLowerCase() == "span") {obj.childNodes[q].innerHTML = text}}};this.getListOptionText = function(id) {var text = "";id = that.idPrefix + id;if (that.objPull[id] == null){return};if (that.objPull[id].obj.className == "buttonSeparator"){return};var obj = that.objPull[id].obj;for (var q=0;q<obj.childNodes.length;q++){if ((obj.childNodes[q].tagName).toLowerCase() == "span") {text = obj.childNodes[q].innerHTML}};return text};this.setListOptionToolTip = function(id, tip) {id = that.idPrefix + id;if (that.objPull[id] == null){return};if (that.objPull[id].obj.className == "buttonSeparator"){return};that.objPull[id].obj.title = tip};this.getListOptionToolTip = function(id) {id = that.idPrefix + id;if (that.objPull[id] == null){return};if (that.objPull[id].obj.className == "buttonSeparator"){return};return that.objPull[id].obj.title};this.setItemToolTip = function(tip) {this.obj.title = tip};this.getItemToolTip = function() {return this.obj.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){if (a == id){this._listOptions[a]._selected = true;if (this._listOptions[a].className == "buttonItem"){this._listOptions[a].className = "buttonItemSelected"}}else {this._listOptions[a]._selected = false;if (this._listOptions[a].className == "buttonItemSelected"){this._listOptions[a].className = "buttonItem"}}}};this.getListOptionSelected = function() {var id = null;for (var a in this._listOptions){if (this._listOptions[a]._selected == true){id = a}};return id};return this};dhtmlXToolbarObject.prototype._buttonInputObject = function(that, id, data, pos) {if (that.layout == "VER"){return};this.id = that.idPrefix+id;this.obj = document.createElement("TD");this.obj.className = "dhtmlxToolbarItem";this.obj.align = "left";this.obj.valign = "middle";this.obj.idd = String(id);this.obj.w = (data.getAttribute("width")!=null?data.getAttribute("width"):100);this.obj.title = (data.getAttribute("title")!=null?data.getAttribute("title"):"");this.obj.innerHTML = "<table cellspacing='0' cellpadding='0' class='itemDefault'>"+
 "<tr>"+
 "<td valign='middle'"+(this.img!=""?"":" style='display: none;'")+">"+
 "<input class='dhtmlxToolbarInp' type='text' style='width:"+this.obj.w+"px;'"+(data.getAttribute("value")!=null?" value='"+data.getAttribute("value")+"'":"")+">"+
 "</td>"+
 "</tr>"+
 "</table>";var th = that;var self = this;this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].onkeydown = function(e) {e = e||event;if (e.keyCode == 13){th.callEvent("onEnter", [self.obj.idd, this.value])}};this.tr = that._addObject(this.obj, pos);this.enableItem = function() {this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].disabled = false};this.disableItem = function() {this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].disabled = true};this.isEnabled = function() {return (!this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].disabled)};this.showItem = function() {this.tr.style.display = ""};this.hideItem = function() {this.tr.style.display = "none"};this.isVisible = function() {return (this.tr.style.display != "none")};this.setValue = function(value) {this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].value = value};this.getValue = function() {return this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].value};this.setWidth = function(width) {this.obj.w = width;this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].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, pos) {this.id = that.idPrefix+id;this.state = (data.getAttribute("enabled")!=null?false:true);this.imgEn = (data.getAttribute("img")!=null?data.getAttribute("img"):"");this.imgDis = (data.getAttribute("imgdis")!=null?data.getAttribute("imgdis"):"");this.img = (this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.obj = document.createElement("TD");this.obj.className = "dhtmlxToolbarItem";this.obj.align = "left";this.obj.valign = "middle";this.obj.renderAs = "itemDefault";this.obj.onselectstart = function(e) {e = e||event;e.returnValue = false};this.obj.idd = String(id);this.obj.title = (data.getAttribute("title")!=null?data.getAttribute("title"):"");this.obj.pressed = (data.getAttribute("selected")!=null);if (this.obj.pressed){this.obj.renderAs = "itemOver"};this.obj.innerHTML = "<table cellspacing='0' cellpadding='0' class='"+(this.obj.pressed?"itemPressed":"item"+(this.state?"Default":"Disabled"))+"'>"+
 "<tr>"+
 "<td class='dhtmlxToolbarIMG' valign='middle'"+(this.img!=""?"":" style='display: none;'")+"><img src='"+(this.img!=""?that.imagePath+this.img:that.imagePath+that.emptyImage)+"'></td>"+
 "<td class='dhtmlxToolbarTEXT' valign='middle'"+(data.getAttribute("text")!=null?"":" style='display: none;'")+"><span>"+(data.getAttribute("text")!=null?data.getAttribute("text"):"")+"</span></td>"+
 "</tr>"+
 "</table>";this.obj.that = 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 (this.that.state == false){return};if (that.anyUsed != "none"){return};if (this.pressed){return};this.childNodes[0].className = "itemOver";this.renderAs = "itemOver"};this.obj._doOnMouseOut = function() {if (this.that.state == false){return};if (that.anyUsed != "none"){return};if (this.pressed){return};this.childNodes[0].className = "itemDefault";this.renderAs = "itemDefault"};this.obj.onmousedown = function(e) {if (that.checkEvent("onBeforeStateChange")) {if (!that.callEvent("onBeforeStateChange", [this.idd.replace(that.idPrefix, ""), this.pressed])) {return}};if (this.that.state == false){return};if (that.anyUsed != "none"){return};this.pressed = !this.pressed;this.childNodes[0].className = (this.pressed?"itemPressed":this.renderAs);that.callEvent("onStateChange", [this.idd.replace(that.idPrefix, ""), this.pressed]);return false};this.obj.onmouseup = function(e) {};this.tr = that._addObject(this.obj, pos);this.setItemState = function(state, callEvent) {if (this.obj.pressed != state){this.obj.pressed = state;this.obj.childNodes[0].className = (this.obj.pressed?"itemPressed":"itemDefault");if (callEvent == true){that.callEvent("onStateChange", [this.obj.idd.replace(that.idPrefix, ""), this.obj.pressed])}}};this.getItemState = function() {return this.obj.pressed};this.enableItem = function() {if (!this.state){this.state = true;this.obj.childNodes[0].className = (this.obj.pressed?"itemPressed":"itemDefault");if (this.imgEn != ""){this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+this.imgEn}else {this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "none";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+that.emptyImage}}};this.disableItem = function() {if (this.state){this.state = false;this.obj.childNodes[0].className = "itemDisabled";if (this.imgDis != ""){this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+this.imgDis}else {this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "none";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+that.emptyImage};this.obj.renderAs = "itemDefault"}};this.isEnabled = function() {return this.state};this.showItem = function() {this.tr.style.display = ""};this.hideItem = function() {this.tr.style.display = "none"};this.isVisible = function() {return (this.tr.style.display == "")};this.setItemText = function(text) {if (text == null || text.length == 0){this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[1].style.display = "none";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].innerHTML = ""}else {this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[1].style.display = "";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].innerHTML = text}};this.getItemText = function() {return this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].innerHTML};this.setItemImage = function(url) {this.imgEn = url;if (this.state){this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+this.imgEn}};this.clearItemImage = function() {this.imgEn = "";if (this.state){this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "none";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+that.emptyImage}};this.setItemImageDis = function(url) {this.imgDis = url;if (!this.state){this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+this.imgDis}};this.clearItemImageDis = function() {this.imgDis = "";if (!this.state){this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "none";this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].src = that.imagePath+that.emptyImage}};this.setItemToolTip = function(tip) {this.obj.title = tip};this.getItemToolTip = function() {return this.obj.title};return this};dhtmlXToolbarObject.prototype._sliderObject = function(that, id, data, pos) {this.id = that.idPrefix+id;this.state = (data.getAttribute("enabled")!=null?false:true);this.obj = document.createElement("TD");this.obj.className = "dhtmlxToolbarItem";this.obj.align = "left";this.obj.valign = "middle";this.obj.idd = String(id);this.obj.len = (data.getAttribute("length")!=null?Number(data.getAttribute("length")):50);this.obj.innerHTML = "<table border='0' cellspacing='0' cellpadding='0' class='item"+(this.state?"Default":"Disabled")+"'>"+
 "<tr>"+
 "<td class='dhtmlxToolbarTEXT' valign='middle'"+(data.getAttribute("textMin")!=null?"":" style='display: none;'")+"><span>"+(data.getAttribute("textMin")!=null?data.getAttribute("textMin"):"")+"</span></td>"+
 "<td>"+
 "<div style='position: relative;'>"+
 "<table border='0' cellspacing='0' cellpadding='0' style='width:"+this.obj.len+"px;'>"+
 "<tr>"+
 "<td class='dhtmlxToolbarSliderBarLeft'>&nbsp;</td>"+
 "<td class='dhtmlxToolbarSliderBarMiddle'>&nbsp;</td>"+
 "<td class='dhtmlxToolbarSliderBarRight'>&nbsp;</td>"+
 "</tr>"+
 "</table>"+
 "<div class='dhtmlxToolbarBarSliderPen'>&nbsp;</div>"+
 "</div>"+
 "</td>"+
 "<td class='dhtmlxToolbarTEXT' valign='middle'"+(data.getAttribute("textMax")!=null?"":" style='display: none;'")+"><span>"+(data.getAttribute("textMax")!=null?data.getAttribute("textMax"):"")+"</span></td>"+
 "</tr>"+
 "</table>";this.tr = that._addObject(this.obj, pos);this.obj.onselectstart = function(e) {e = e||event;e.returnValue = false};this.obj.pen = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[1];var self = this;this.obj.pen.obj = this.obj;this.obj.pen.valueMin = (data.getAttribute("valueMin")!=null?Number(data.getAttribute("valueMin")):0);this.obj.pen.valueMax = (data.getAttribute("valueMax")!=null?Number(data.getAttribute("valueMax")):100);if (this.obj.pen.valueMin >= this.obj.pen.valueMax){this.obj.pen.valueMin = this.obj.pen.valueMax - 1};this.obj.pen.valueNow = (data.getAttribute("valueNow")!=null?Number(data.getAttribute("valueNow")):this.obj.pen.valueMax);if (this.obj.pen.valueNow >= this.obj.pen.valueMax){this.obj.pen.valueNow = this.obj.pen.valueMax};if (this.obj.pen.valueNow <= this.obj.pen.valueMin){this.obj.pen.valueNow = this.obj.pen.valueMin};this.obj.pen._detectLimits = function() {this.minX = 0;this.maxX = this.parentNode.parentNode.childNodes[0].offsetWidth-this.offsetWidth};this.obj.pen._detectLimits();this.obj.that = this;this.obj.pen.initXY = 0;this.obj.pen.that = this;this.obj.pen.allowMove = false;this.obj.pen.onmousedown = function(e) {if (this.that.state == false){return};e = e||event;this.initXY = e.clientX;this.newValueNow = this.valueNow;this.allowMove = true;this.className = "dhtmlxToolbarBarSliderPenOver";self.obj.childNodes[0].className = (self.state?"itemDefault":"itemDisabled");if (this.label.tip != ""){this.label.style.visibility = "hidden";this.label.style.display = "";this.label.innerHTML = this.label.tip.replace("%v", this.valueNow);this.label.style.left = Math.round(getAbsoluteLeft(this)+this.offsetWidth/2-this.label.offsetWidth/2)+"px";this.label.style.top = getAbsoluteTop(this)-this.label.offsetHeight-3+"px";this.label.style.visibility = ""}};this.obj.pen._doOnMouseMoveStart = function(evnt) {if (!this.allowMove){return};var ofst = (this.vert?evnt.clientY:evnt.clientX) - this.initXY;if (evnt.clientX < getAbsoluteLeft(this)+Math.round(this.offsetWidth/2) && this.nowX == this.minX) {return};if (evnt.clientX > getAbsoluteLeft(this)+Math.round(this.offsetWidth/2) && this.nowX == this.maxX) {return};this.newNowX = this.nowX + ofst;if (this.newNowX < this.minX){this.newNowX = this.minX};if (this.newNowX > this.maxX){this.newNowX = this.maxX};this.nowX = this.newNowX;this.style.left = this.nowX+"px";this.initXY = (this.vert?evnt.clientY:evnt.clientX);this.newValueNow = Math.round((this.valueMax-this.valueMin)*(this.newNowX-this.minX)/(this.maxX-this.minX)+this.valueMin);if (this.label.tip != ""){this.label.innerHTML = this.label.tip.replace(/%v/gi, this.newValueNow);this.label.style.left = Math.round(getAbsoluteLeft(this)+this.offsetWidth/2-this.label.offsetWidth/2)+"px";this.label.style.top = getAbsoluteTop(this)-this.label.offsetHeight-3+"px"}};this.obj.pen._doOnMouseMoveEnd = function() {if (!this.allowMove){return};this.className = "dhtmlxToolbarBarSliderPen";self.obj.childNodes[0].className = (self.state?"itemDefault":"itemDisabled");if (this.label.tip != ""){this.label.style.display = "none"};this.allowMove = false;this.nowX = this.newNowX;this.valueNow = this.newValueNow;that.callEvent("onValueChange", [this.obj.idd.replace(that.idPrefix, ""), this.valueNow])};this.obj.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.obj.pen._definePos();this.obj.pen.label = document.createElement("DIV");this.obj.pen.label.className = "dhtmlxToolbarSliderPenLabel_"+that.skin;this.obj.pen.label.style.display = "none";this.obj.pen.label.tip = (data.getAttribute("toolTip")!=null?data.getAttribute("toolTip"):"%v");document.body.appendChild(this.obj.pen.label);var pen = this.obj.pen;if (_isIE){document.body.attachEvent("onmousemove", function(e){e=e||event;pen._doOnMouseMoveStart(e)});document.body.attachEvent("onmouseup", function(){pen._doOnMouseMoveEnd()})}else {window.addEventListener("mousemove", function(e){e=e||event;pen._doOnMouseMoveStart(e)}, false);window.addEventListener("mouseup", function(){pen._doOnMouseMoveEnd()}, false)};this.enableItem = function() {if (!this.state){this.state = true;this.obj.childNodes[0].className = "itemDefault"}};this.disableItem = function() {if (this.state){this.state = false;this.obj.childNodes[0].className = "itemDisabled"}};this.isEnabled = function() {return this.state};this.showItem = function() {this.tr.style.display = ""};this.hideItem = function() {this.tr.style.display = "none"};this.isVisible = function() {return (this.tr.style.display == "")};this.setValue = function(value, callEvent) {if (value < this.obj.pen.valueMin){value = this.obj.pen.valueMin};if (value > this.obj.pen.valueMax){value = this.obj.pen.valueMax};this.obj.pen.valueNow = Number(value);this.obj.pen._definePos();if (callEvent == true){that.callEvent("onValueChange", [this.obj.idd.replace(that.idPrefix, ""), this.obj.pen.valueNow])}};this.getValue = function() {return this.obj.pen.valueNow};this.setMinValue = function(value, label) {var obj = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0];obj.innerHTML = label;obj.style.display = (label.length>0?"":"none");this.obj.pen.valueMin = Number(value);this.obj.pen._detectLimits();this.obj.pen._definePos()};this.setMaxValue = function(value, label) {var obj = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[2].childNodes[0];obj.innerHTML = label;obj.style.display = (label.length>0?"":"none");this.obj.pen.valueMax = Number(value);this.obj.pen._detectLimits();this.obj.pen._definePos()};this.getMinValue = function() {var label = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].innerHTML;var value = this.obj.pen.valueMin;return new Array(value, label)};this.getMaxValue = function() {var label = this.obj.childNodes[0].childNodes[0].childNodes[0].childNodes[2].childNodes[0].innerHTML;var value = this.obj.pen.valueMax;return new Array(value, label)};this.setItemToolTipTemplate = function(template) {this.obj.pen.label.tip = template};this.getItemToolTipTemplate = function() {return this.obj.pen.label.tip};return this};dhtmlXToolbarObject.prototype.dhx_Event = function() {this.dhx_SeverCatcherPath="";this.attachEvent = function(original, catcher, CallObj) {original = original.toLowerCase();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) {name = name.toLowerCase();if (this["ev_"+name]){return this["ev_"+name].apply(this,arg0)};return true};this.checkEvent = function(name) {name = name.toLowerCase();if (this["ev_"+name]){return true};return false};this.eventCatcher = function(obj) {var dhx_catch = new Array();var m_obj = obj;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") 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])}}};dhtmlXToolbarObject.prototype.hotkeyManager = function() {this._hkPool = {};this.attachHotkey = function(hkey, obj) {};var that = this;if (_isIE){document.attachEvent("onkeyup", that.hotkeyAction)}else {window.addEventListener("keyup", that.hotkeyAction, false)}};dhtmlXToolbarObject.prototype.hotkeyAction = function(e) {e = e||event;e.cancelBubble = true;e.returnValue = false};function dhtmlXWindowsSngl(){};function dhtmlXWindowsBtn(){};function dhtmlXWindows() {var that = this;this.pathPrefix = "dhxwins_";this.imagePath = "codebase/imgs/";this.setImagePath = function(path) {this.imagePath = path};this.skin = "dhx_blue";this.skinParams = {"standard" : {"header_height": 32, "border_left_width": 6, "border_right_width": 7, "border_bottom_height": 6 },
 
 "aqua_dark" : {"header_height": 31, "border_left_width": 3, "border_right_width": 3, "border_bottom_height": 3 },
 "aqua_orange" : {"header_height": 31, "border_left_width": 3, "border_right_width": 3, "border_bottom_height": 3 },
 "aqua_sky" : {"header_height": 31, "border_left_width": 3, "border_right_width": 3, "border_bottom_height": 3 },
 
 "clear_blue" : {"header_height": 32, "border_left_width": 6, "border_right_width": 6, "border_bottom_height": 6 },
 "clear_green" : {"header_height": 32, "border_left_width": 6, "border_right_width": 6, "border_bottom_height": 6 },
 "clear_silver" : {"header_height": 32, "border_left_width": 6, "border_right_width": 6, "border_bottom_height": 6 },
 
 "glassy_blue" : {"header_height": 26, "border_left_width": 4, "border_right_width": 4, "border_bottom_height": 4 },
 "glassy_blue_light" : {"header_height": 26, "border_left_width": 3, "border_right_width": 3, "border_bottom_height": 3 },
 "glassy_caramel" : {"header_height": 26, "border_left_width": 4, "border_right_width": 4, "border_bottom_height": 4 },
 "glassy_greenapple" : {"header_height": 26, "border_left_width": 4, "border_right_width": 4, "border_bottom_height": 4 },
 "glassy_rainy" : {"header_height": 26, "border_left_width": 4, "border_right_width": 4, "border_bottom_height": 4 },
 "glassy_raspberries": {"header_height": 26, "border_left_width": 4, "border_right_width": 4, "border_bottom_height": 4 },
 "glassy_yellow" : {"header_height": 26, "border_left_width": 4, "border_right_width": 4, "border_bottom_height": 4 },
 
 "modern_black" : {"header_height": 39, "border_left_width": 2, "border_right_width": 2, "border_bottom_height": 2 },
 "modern_blue" : {"header_height": 39, "border_left_width": 2, "border_right_width": 2, "border_bottom_height": 2 },
 "modern_red" : {"header_height": 39, "border_left_width": 2, "border_right_width": 2, "border_bottom_height": 2 },
 
 "web" : {"header_height": 21, "border_left_width": 2, "border_right_width": 2, "border_bottom_height": 2 },
 
 "vista_blue" : {"header_height": 28, "border_left_width": 8, "border_right_width": 8, "border_bottom_height": 8 },
 
 "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 }};this.setSkin = function(skin) {this.skin = skin;this._redrawSkin()};this._redrawSkin = function() {for (var a in this.wins){var win = this.wins[a];var skinParams = (win._skinParams!=null?win._skinParams:this.skinParams[this.skin]);win.childNodes[0].className = "dhtmlx_wins_"+this.skin;win.childNodes[1].className = "dhtmlx_wins_icon_"+this.skin;this._restoreWindowIcons(win);win.childNodes[2].className = "dhtmlx_wins_title_"+this.skin;win.childNodes[3].className = "dhtmlx_wins_buttons_"+this.skin;this._redrawWindow(win)}};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.lentgh] = 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 = {};this.autoViewport = true;this._createViewport = function() {this.vp = document.body;this.modalCoverI = document.createElement("IFRAME");this.modalCoverI.frameBorder = "0";this.modalCoverI.className = "dhx_modal_cover_ifr";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.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._fixInnerObjs(this.wins[a])};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._redrawWindow(win)}}};this.enableAutoViewport = function(state) {if (this.vp != document.body){return};this.autoViewport = state;if (state == false){this.vp = document.createElement("DIV");this.vp.className = "dhtmlx_winviewport";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.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";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._fixWindowPositionInViewport(win);win.style.width = win.w + "px";win.style.height = win.h + "px";win.style.left = win.x + "px";win.style.top = win.y + "px";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;win._midd = "dhxWMNObj_"+this._genStr(12);win._tidd = "dhxWTBObj_"+this._genStr(12);win._sidd = "dhxSTBObj_"+this._genStr(12);win.innerHTML = "<table border='0' cellspacing='0' cellpadding='0' width='100%' height='"+win.h+"' class='dhtmlx_wins_"+this.skin+"'>"+
 
 "<tr><td class='dhtmlx_wins_td_header_full' clearonselect='yes'>"+
 "<table border='0' cellspacing='0' cellpadding='0' width='100%' class='dhtmlx_wins_header' clearonselect='yes'>"+
 "<tr>"+
 "<td class='dhtmlx_wins_td_header_left' clearonselect='yes'>&nbsp;</td>"+
 "<td class='dhtmlx_wins_td_header_middle' clearonselect='yes'>&nbsp;</td>"+
 "<td class='dhtmlx_wins_td_header_right' clearonselect='yes'>&nbsp;</td>"+
 "</tr>"+
 "</table>"+
 (_isIE?"<iframe frameborder='0' class='dhx_ie6_wincover_forsel' onload='this.contentWindow.document.body.style.overflow=\"hidden\";'></iframe>":"")+
 "</td></tr>"+
 
 "<tr><td class='dhtmlx_wins_td_body_full' height='"+(win.h-skin["header_height"])+"'>"+
 "<table border='0' cellspacing='0' cellpadding='0' width='100%' height='"+(win.h-skin["header_height"])+"' class='dhtmlx_wins_body'>"+
 
 "<tr>"+
 "<td class='dhtmlx_wins_body_border_middle_left' clearonselect='yes'>&nbsp;</td>"+
 "<td class='dhtmlx_wins_body_content' align='left' valign='top'>"+
 "<div class='dhtmlx_wins_body_content' style='width: "+(win.w-skin["border_left_width"]-skin["border_right_width"])+"px;height:"+(win.h-skin["header_height"]-skin["border_bottom_height"])+"px;'>"+
 "<div id='"+win._midd+"' class='dhtmlxMenuInWin' style='height: 0px;display: none;position: relative;'></div>"+
 "<div id='"+win._tidd+"' class='dhtmlxToolbarInWin' style='height: 0px;display: none;position: relative;'></div>"+
 "<div class='dhtmlxWindowMainContent' style='position: absolute;overflow: hidden;width=100%;top: 0px;bottom: 0px;height=100%;left: 0px;right: 0px;'></div>"+
 "<div id='"+win._sidd+"' style='height: 0px;display: none;'></div>"+
 "<div class='dhx_content_cover_blocker' style='display: none;'></div>"+
 "</div>"+
 "</td>"+
 "<td class='dhtmlx_wins_body_border_middle_right' clearonselect='yes'>&nbsp;</td>"+
 "</tr>"+
 
 "<tr clearonselect='yes'>"+
 "<td class='dhtmlx_wins_body_border_bottom_left' clearonselect='yes'>&nbsp;</td>"+
 "<td class='dhtmlx_wins_body_border_bottom_middle' clearonselect='yes'>&nbsp;</td>"+
 "<td class='dhtmlx_wins_body_border_bottom_right' clearonselect='yes'>&nbsp;</td>"+
 "</tr>"+
 "</table>"+
 (_isIE?"<iframe frameborder='0' style='top:"+skin["header_height"]+"px;' class='dhx_ie6_wincover_forsel' onload='this.contentWindow.document.body.style.overflow=\"hidden\";'></iframe>":"")+
 "</td></tr>"+
 "</table>"+
 
 "<img clearonselect='yes' class='dhtmlx_wins_icon_"+this.skin+"' src='"+win.icons[0]+"'>"+
 
 "<div clearonselect='yes' class='dhtmlx_wins_title_"+this.skin+"'>dhtmlxWindow</div>"+
 
 "<div class='dhtmlx_wins_buttons_"+this.skin+"'>"+
 "<table border='0' cellspacing='0' cellpadding='0'><tr></tr></table>"+
 "</div>"+
 
 "<div clearonselect='yes' class='dhtmlx_wins_progress_"+this.skin+"'></div>"+
 "";this.vp.appendChild(win);win._content = win.childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0];this._diableOnSelectInWin(win, true);this.wins[id] = win;win.dhx_Event = this.dhx_Event;win.dhx_Event();this._makeActive(win, true);var hdr = win.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0];hdr.onmousedown = function(e) {if (!win._allowMove || !win._allowMoveGlobal){return};e = e || event;win.oldMoveX = win.x;win.oldMoveY = win.y;win.moveOffsetX = win.x - e.clientX;win.moveOffsetY = win.y - e.clientY;that.movingWin = win;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.movingWin.style.zIndex+that._getTopZIndex()+10;that._carcass.style.cursor = "move";that._carcass._keepInViewport = win._keepInViewport};that._blockSwitcher("none");that.movingWin.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1].style.cursor = "move";that.movingWin.childNodes[2].style.cursor = "move";that._vpcover.style.zIndex = that.movingWin.style.zIndex-1;that._vpcover.style.display = "";if (_isOpera){e.returnValue = false;e.cancelBubble = true}};hdr.ondblclick = function() {if (win._allowResizeGlobal && !win._isParked){if (win._isMaximized == true){that._restoreWindow(win)}else {that._maximizeWindow(win)}}};var h_title = win.childNodes[2];h_title.onmousedown = hdr.onmousedown;h_title.ondblclick = hdr.ondblclick;win.setText = function(text) {this.childNodes[2].innerHTML = text;that.callEvent("onTextChange", [this._dockCell, text])};win.getText = function() {return this.childNodes[2].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._fixWindowPositionInViewport(this);if (_isFF){this.h++;that._redrawWindow(this);this.h--};that._redrawWindow(this)};win.getPosition = function() {return new Array(this.x, this.y)};win.setDimension = function(width, height) {if (width != null){this.w = width};if (height != null){this.h = height};that._fixWindowDimensionInViewport(this);that._fixWindowPositionInViewport(this);that._redrawWindow(this)};win.getDimension = function() {return new Array(this.w, this.h)};win.setMaxDimension = function(maxWidth, maxHeight) {this.minW = "auto";this.minH = "auto";that._redrawWindow(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._redrawWindow(this)};win.getMinDimension = function() {return new Array(this.minW, this.minH)};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"))) {var btn = this.button(id);if (btn != null){that._removeUserButton(this, id, btn)}}};win.progressOn = function() {that._switchProgress(this, true)};win.progressOff = function() {that._switchProgress(this, false)};win.attachStatusBar = function() {return that._attachStatusBar(this)};win.attachMenu = function() {return that._attachWebMenu(this)};win.attachToolbar = function() {return that._attachWebToolbar(this)};win.attachGrid = function() {var obj = document.createElement("DIV");obj.id = "dhxGridObj_"+that._genStr(12);obj.style.width = "100%";obj.style.height = "100%";document.body.appendChild(obj);this.attachObject(obj.id);this.grid = new dhtmlXGridObject(obj.id);this.grid.setSkin(that.skin);this.grid.entBox.style.border="0px solid white";this.grid._sizeFix=0;return this.grid};win.attachTree = function(rootId) {var obj = document.createElement("DIV");obj.id = "dhxTreeObj_"+that._genStr(12);obj.style.width = "100%";obj.style.height = "100%";document.body.appendChild(obj);this.attachObject(obj.id);this.tree = new dhtmlXTreeObject(obj.id, "100%", "100%", (rootId||0));this.tree.setSkin(that.skin);this.tree.allTree.childNodes[0].style.marginTop = "2px";this.tree.allTree.childNodes[0].style.marginBottom = "2px";return this.tree};win.attachTabbar = function() {var obj = document.createElement("DIV");obj.id = "dhxTabbarObj_"+that._genStr(12);obj.style.width = "100%";obj.style.height = "100%";obj.style.overflow = "hidden";document.body.appendChild(obj);this.attachObject(obj.id);if (this._dockCell != null && that.dhxLayout != null){var dockCell = that.dhxLayout.polyObj[this._dockCell];if (dockCell != null){dockCell.childNodes[0]._tabbarMode = true;that.dhxLayout.hidePanel(this._dockCell);dockCell.className = "dhtmlxLayoutSinglePolyTabbar"}};this.tabbar = new dhtmlXTabBar(obj.id, "top",26);this.tabbar._linePos=-4;if ((_isIE)&&(document.compatMode == "BackCompat")){this.tabbar._lineAHeight=this.tabbar._lineA.style.height="6px";this.tabbar._bFix=5}else{this.tabbar._lineAHeight=this.tabbar._lineA.style.height="4px";this.tabbar._bFix=4};this.tabbar.setSkin(that.skin);this.tabbar._conZone.style.borderWidth="0px";this.tabbar._EARS = true;this.tabbar.setMargin(-1)
 this.tabbar.setOffset(0)
 this.tabbar.adjustOuterSize();this.tabbar.cells=function(id,name){return this._cells.call(this,that,id,name)};return this.tabbar};win.attachFolders = function() {var obj = document.createElement("DIV");obj.id = "dhxFoldersObj_"+that._genStr(12);obj.style.width = "100%";obj.style.height = "100%";obj.style.overflow = "hidden";document.body.appendChild(obj);this.attachObject(obj.id);this.folders = new dhtmlxFolders(obj.id);this.folders.setSizes();return this.folders};win.attachAccordion = function() {var obj = document.createElement("DIV");obj.id = "dhxAccordionObj_"+that._genStr(12);obj.style.width = "100%";obj.style.height = "100%";obj.style.position = "relative";document.body.appendChild(obj);this.attachObject(obj.id);this.accordion = new dhtmlXAccordion(obj.id, that.skin);win._content.childNodes[2].className += " dhtmlxAccordionAttached";this.accordion.setSizes();return this.accordion};win.attachLayout = function(view, skin) {var obj = document.createElement("DIV");obj.id = "dhxLayoutObj_"+that._genStr(12);obj.style.position = "relative";document.body.appendChild(obj);this.attachObject(obj.id);var w = this._content.childNodes[2].offsetWidth;var h = this._content.childNodes[2].offsetHeight;if (w == 0){w = parseInt(this._content.style.width)};obj.style.left = "0px";obj.style.top = "0px";obj.style.width = w+"px";obj.style.height = h+"px";obj._skipChecksOnStartUp = true;if (skin == null){skin = that.skin};this.layout = new dhtmlXLayoutObject(obj, view, skin);this.layout._parentWindow = this;this.attachEvent("_onBeforeTryResize", this.layout._defineWindowMinDimension);return this.layout};win.attachEditor = function(skin) {var obj = document.createElement("DIV");obj.id = "dhxEditorObj_"+that._genStr(12);obj.style.position = "relative";obj.style.display = "none";obj.style.overflow = "hidden";obj.style.width = "100%";obj.style.height = "100%";document.body.appendChild(obj);this.attachObject(obj.id);this.editor = new dhtmlXEditor(obj.id, (skin!=null?skin:that.skin));return this.editor};win.setToFullScreen = function(state) {that._setWindowToFullScreen(this, state)};win.showHeader = function() {that._showWindowHeader(this)};win.hideHeader = function() {that._hideWindowHeader(this)};win.progressOff();win.canStartResize = false;win.onmousemove = function(e) {if ((!this._allowResize)|| (this._allowResizeGlobal == false)) {this.canStartResize = false;this.style.cursor = "";return};if (that.resizingWin != null){return};if (this._isParked){return};e = e || event;var targetObj = e.target || e.srcElement;var useDefaultCursor = true;this.canStartResize = true;var skin = (this._skinParams!=null?this._skinParams:that.skinParams[that.skin]);var hh = skin["header_height"];var bwl = skin["border_left_width"] + 2;var bwr = skin["border_right_width"] + 2;var bhb = skin["border_bottom_height"] + 2;if (targetObj.className == "dhtmlx_wins_body_border_middle_left"){that.resizingDirs = "border_left";this.style.cursor = "w-resize";this.resizeOffsetX = this.x - e.clientX;useDefaultCursor = false};if (targetObj.className == "dhtmlx_wins_body_border_middle_right"){that.resizingDirs = "border_right";this.style.cursor = "e-resize";this.resizeOffsetXW = this.x + this.w - e.clientX;useDefaultCursor = false};if (targetObj.className == "dhtmlx_wins_body_border_bottom_middle"){that.resizingDirs = "border_bottom";this.style.cursor = "n-resize";this.resizeOffsetYH = this.y + this.h - e.clientY;useDefaultCursor = false};if (targetObj.className == "dhtmlx_wins_body_border_bottom_left"){that.resizingDirs = "corner_left";this.style.cursor = "sw-resize";this.resizeOffsetX = this.x - e.clientX;this.resizeOffsetYH = this.y + this.h - e.clientY;useDefaultCursor = false};if (targetObj.className == "dhtmlx_wins_body_border_bottom_right"){that.resizingDirs = "corner_right";this.style.cursor = "nw-resize";this.resizeOffsetXW = this.x + this.w - e.clientX;this.resizeOffsetYH = this.y + this.h - e.clientY;useDefaultCursor = false};if (useDefaultCursor){this.canStartResize = false;this.style.cursor = ""}};win.onmousedown = function(e) {that._makeActive(this);that._bringOnTop(this);if (this.canStartResize){that._blockSwitcher("none");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.resizingWin.style.zIndex+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])};if (_isOpera){e = e||event;e.returnValue = false;e.cancelBubble = true}}};this._addDefaultButtons(win);win.button = function(id) {var b = null;if (this.btns[id] != null){b = this.btns[id]};return b};win.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};that._attachContent(this, "obj", obj);if (autoSize){obj.style.visibility = "visible";var skinParams = that.skinParams[that.skin];var newW = objW + skinParams["border_left_width"] + skinParams["border_right_width"];var newH = objH + skinParams["header_height"] + skinParams["border_bottom_height"];this.setDimension(newW, newH)}};win.appendObject = function(obj) {if (typeof(obj)== "string") {obj = document.getElementById(obj)};that._attachContent(this, "obj", obj, true)};win.attachHTMLString = function(str) {that._attachContent(this, "str", str)};win.attachURL = function(url, ajax) {that._attachContent(this, (ajax==true?"urlajax":"url"), url, false)};win.center = function() {that._centerWindow(this, false)};win.centerOnScreen = function() {that._centerWindow(this, true)};this._attachContent(win, "empty", null);win.bringToTop();return this.wins[id]};this._diableOnSelectInWin = function(obj, state) {for (var q=0;q<obj.childNodes.length;q++){var child = obj.childNodes[q];if ((child.tagName == "TD")|| (child.tagName == "TR") || (child.tagName == "TABLE") || (child.tagName == "DIV")) {if (child.getAttribute("clearonselect")!= null) {if (state){child.onselectstart = function(e) {e = e || event;e.returnValue = false}}else {child.onselectstart = null}}};if (child.childNodes.length > 0){this._diableOnSelectInWin(child, state)};child = null}};this._redrawWindow = function(win) {if (win._isFullScreened)return;win.style.left = win.x + "px";win.style.top = win.y + "px";win.style.width = (win.w == "100%" ? win.w : win.w+"px");win.style.height = (win.h == "100%" ? win.h : win.h+"px");if (win.w == "100%"){var winW = "100%";win.w = win.offsetWidth};if (win.h == "100%"){var winH = "100%";win.h = win.offsetHeight};win.childNodes[0].style.height = win.h + "px";var p = win.childNodes[0].childNodes[0].childNodes[1].childNodes[0];var s = (win._skinParams!=null?win._skinParams:this.skinParams[this.skin]);p.style.height = win.h-s["header_height"] + "px";p.childNodes[0].style.height = win.h-s["header_height"] + "px";var trObj = win.childNodes[3].childNodes[0].childNodes[0].childNodes[0];var tdVis = 0;for (var q=0;q<trObj.childNodes.length;q++){if (trObj.childNodes[q].className == "dhtmlx_wins_btn_visible"){tdVis++}};var wdth = win.w - tdVis*18 - 30 ;if (wdth < 0){wdth = 0};win.childNodes[2].style.width = wdth + "px";var w = win.w - s["border_left_width"] - s["border_right_width"];var h = win.h - s["header_height"] - s["border_bottom_height"];if (w < 0){w = 0};if (h < 0){h = 0};var bd = p.childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0];if (bd == null){bd = win._content};bd.style.width = w + "px";bd.style.height = h + "px";if (winW != null){win.w = winW};if (winH != null){win.h = winH}};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){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._fixWindowPositionInViewport(this.movingWin);this._redrawWindow(this.movingWin)}else {if (this._carcass.style.display != ""){this._carcass.style.display = ""};this._carcass.x = e.clientX + this.movingWin.moveOffsetX;this._carcass.y = e.clientY + this.movingWin.moveOffsetY;this._fixWindowPositionInViewport(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"){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._redrawWindow(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.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"){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._redrawWindow(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};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._redrawWindow(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};this._carcass.h = newH;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("");win.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1].style.cursor = "";win.childNodes[2].style.cursor = "";if (_isFF){win.h++;this._redrawWindow(win);win.h--;this._redrawWindow(win)}}else {this._carcass.style.display = "none";var win = this.movingWin;this.movingWin = null;this._blockSwitcher("");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("");if (!this._effects["resize"]){this._carcass.style.display = "none";win.setPosition(this._carcass.x, this._carcass.y);win.setDimension(this._carcass.w+(_isIE?0:2), this._carcass.h+(_isIE?0:2))};this._fixInnerObjs(win);if (win.layout){win.layout.callEvent("onResize", [])};if (_isOpera){win._content.childNodes[2].style.border="#FFFFFF 0px solid";var w = win._content.childNodes[2];window.setTimeout(function(){w.style.border="none"}, 1)};this._vpcover.style.display = "none";if (win.checkEvent("onResizeFinish")) {win.callEvent("onResizeFinish",[win])}else {this.callEvent("onResizeFinish",[win])}}};this._fixWindowPositionInViewport = function(win) {var skin = (win._skinParams!=null?win._skinParams:this.skinParams[this.skin]);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 + skin["header_height"] > this.vp.offsetHeight){win.y = this.vp.offsetHeight - skin["header_height"]};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._fixWindowDimensionInViewport = function(win) {if (win.w < win.minW){win.w = win.minW};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.wins[a].childNodes[1].src = 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.wins[a].childNodes[1].src = 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 (win._isParked == 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._fixWindowPositionInViewport(win);this._redrawWindow(win)};this._switchProgress = function(win, state) {if (state == true){win.childNodes[1].style.display = "none";win.childNodes[4].style.display = ""}else {win.childNodes[4].style.display = "none";win.childNodes[1].style.display = ""}};this._addDefaultButtons = function(win) {var btnStick = document.createElement("DIV");btnStick.className = "button_stick_default";btnStick.title = "Stick";btnStick.isVisible = false;btnStick._isEnabled = true;btnStick.isPressed = false;win._isSticked = false;btnStick.label = "stick";btnStick._doOnClick = function() {this.isPressed = true;that._stickWindow(win)};var btnSticked = document.createElement("DIV");btnSticked.className = "button_sticked_default";btnSticked.title = "Unstick";btnSticked.isVisible = false;btnSticked._isEnabled = true;btnSticked.isPressed = false;btnSticked.label = "sticked";btnSticked._doOnClick = function() {this.isPressed = false;that._unstickWindow(win)};var btnHelp = document.createElement("DIV");btnHelp.className = "button_help_default";btnHelp.title = "Help";btnHelp.isVisible = false;btnHelp._isEnabled = true;btnHelp.isPressed = false;btnHelp.label = "help";btnHelp.that = this;btnHelp._doOnClick = function() {that._needHelp(win)};var btnPark = document.createElement("DIV");btnPark.className = "button_park_default";btnPark.titleIfParked = "Park Down";btnPark.titleIfNotParked = "Park Up";btnPark.title = btnPark.titleIfNotParked;btnPark.isVisible = true;btnPark._isEnabled = true;btnPark.isPressed = false;btnPark.label = "park";win._isParked = false;win._isParkedAllowed = true;btnPark._doOnClick = function() {that._parkWindow(win)};var btnMinMax1 = document.createElement("DIV");btnMinMax1.className = "button_minmax1_default";btnMinMax1.title = "Maximize";btnMinMax1.isVisible = true;btnMinMax1._isEnabled = true;btnMinMax1.isPressed = false;btnMinMax1.label = "minmax1";win._isMaximized = false;btnMinMax1._doOnClick = function() {that._maximizeWindow(win)};var btnMinMax2 = document.createElement("DIV");btnMinMax2.className = "button_minmax2_default";btnMinMax2.title = "Restore";btnMinMax2.isVisible = false;btnMinMax2._isEnabled = true;btnMinMax2.isPressed = false;btnMinMax2.label = "minmax2";btnMinMax2._doOnClick = function() {that._restoreWindow(win)};var btnClose = document.createElement("DIV");btnClose.className = "button_close_default";btnClose.title = "Close";btnClose.isVisible = true;btnClose._isEnabled = true;btnClose.isPressed = false;btnClose.label = "close";btnClose._doOnClick = function() {that._closeWindow(win)};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;var b = win.childNodes[3].childNodes[0].childNodes[0].childNodes[0];for (var a in win.btns){var btn = win.btns[a];var td = document.createElement("TD");td.className = "dhtmlx_wins_btn_" + (btn.isVisible ? "visible" : "hidden");b.appendChild(td);td.appendChild(btn);this._attachEventsOnButton(win, btn);btn = null}};this._attachEventsOnButton = function(win, btn) {btn.onmouseover = function() {if (this._isEnabled){this.className = "button_"+this.label+"_over_" + (this.isPressed ? "pressed": "default")}else {this.className = "button_"+this.label+"_disabled"}};btn.onmouseout = function() {if (this._isEnabled){this.isPressed = false;this.className = "button_"+this.label+"_default"}else {this.className = "button_"+this.label+"_disabled"}};btn.onmousedown = function() {if (this._isEnabled){this.isPressed = true;this.className = "button_"+this.label+"_over_pressed"}else {this.className = "button_"+this.label+"_disabled"}};btn.onmouseup = function() {if (this._isEnabled){var wasPressed = this.isPressed;this.isPressed = false;this.className = "button_"+this.label+"_over_default";if (wasPressed){if (this.checkEvent("onClick")) {this.callEvent("onClick", [win, this])}else {this._doOnClick()}}}else {this.className = "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)};btn.dhx_Event = this.dhx_Event;btn.dhx_Event()};this._parkWindow = function(win) {if (!win._isParkedAllowed){return};if (this.enableParkEffect && win.parkBusy){return};if (win._isParked){if (this.enableParkEffect){win.parkBusy = true;win.childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "";this._doParkDown(win)}else {win.h = win.lastParkH;win.childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "";win.btns["park"].title = win.btns["park"].titleIfNotParked;if (win._allowResizeGlobal == true){this._enableButton(win, "minmax1");this._enableButton(win, "minmax2")}}}else {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.childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "none";win.btns["park"].title = win.btns["park"].titleIfParked}};if (!this.enableParkEffect){win._isParked = !win._isParked;this._redrawWindow(win);if (!win._isParked){this._fixInnerObjs(win);if (_isOpera){win._content.childNodes[2].style.border="#FFFFFF 0px solid";var w = win._content.childNodes[2];window.setTimeout(function(){w.style.border="none"}, 1)};if (win.checkEvent("onParkDown")) {win.callEvent("onParkDown", [win])}else {this.callEvent("onParkDown", [win])}}else {if (_isOpera){win.childNodes[0].border = 1;win.childNodes[0].border = 0};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 = true;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 skinParams = (win._skinParams!=null?win._skinParams:this.skinParams[this.skin]);if (win.h <= skinParams["header_height"] + skinParams["border_bottom_height"]){win.h = skinParams["header_height"] + skinParams["border_bottom_height"];win.childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.display = "none";win.btns["park"].title = win.btns["park"].titleIfParked;win._isParked = true;win.parkBusy = false;this._redrawWindow(win, true);if (_isOpera){win.childNodes[0].border = 1;win.childNodes[0].border = 0};if (win.checkEvent("onParkUp")) {win.callEvent("onParkUp", [win])}else {this.callEvent("onParkUp", [win])}}else {this._redrawWindow(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;win.btns["park"].title = win.btns["park"].titleIfNotParked;if (win._allowResizeGlobal == true){this._enableButton(win, "minmax1");this._enableButton(win, "minmax2")};win._isParked = false;win.parkBusy = false;this._redrawWindow(win);this._fixInnerObjs(win);if (_isOpera){win._content.childNodes[2].style.border="#FFFFFF 0px solid";var w = win._content.childNodes[2];window.setTimeout(function(){w.style.border="none"}, 1)};if (win.checkEvent("onParkDown")) {win.callEvent("onParkDown", [win])}else {this.callEvent("onParkDown", [win])}}else {this._redrawWindow(win);this.parkTM = window.setTimeout(function(){that._doParkDown(win)}, this.parkTMTime)}};this._enableButton = function(win, btn) {win.btns[btn]._isEnabled = true;win.btns[btn].className = "button_"+win.btns[btn].label+"_default"};this._disableButton = function(win, btn) {win.btns[btn]._isEnabled = false;win.btns[btn].className = "button_"+win.btns[btn].label+"_disabled"};this._showWindowHeader = function(win) {win.childNodes[1].style.display = "";win.childNodes[2].style.display = "";win.childNodes[3].style.display = "";for (var a in win._skinParams){delete win._skinParams[a]};win._skinParams = null;var h = this.skinParams[this.skin]["header_height"]+"px";win.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.height = h;win.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.height = h;var hdr = win.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0];for (var q=0;q<hdr.childNodes.length;q++){hdr.childNodes[q].style.height = h};this._redrawWindow(win)};this._hideWindowHeader = function(win) {win.childNodes[1].style.display = "none";win.childNodes[2].style.display = "none";win.childNodes[3].style.display = "none";win._skinParams = {};for (var a in this.skinParams[this.skin]){win._skinParams[a] = Number(this.skinParams[this.skin][a]).valueOf()};win._skinParams["header_height"] = win._skinParams["border_bottom_height"];var h = win._skinParams["header_height"]+"px";win.childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.height = h;win.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].style.height = h;var hdr = win.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0];for (var q=0;q<hdr.childNodes.length;q++){hdr.childNodes[q].style.height = h};this._redrawWindow(win)};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};win.lastMaximizeX = win.x;win.lastMaximizeY = win.y;win.lastMaximizeW = win.w;win.lastMaximizeH = win.h;win.x = 0;win.y = 0;win._isMaximized = true;win._allowMove = false;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._redrawWindow(win);this._fixInnerObjs(win);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)};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._redrawWindow(win);this._fixInnerObjs(win);if (win.checkEvent("onMinimize")) {win.callEvent("onMinimize", [win])}else {this.callEvent("onMinimize", [win])}};this._showButton = function(win, btn) {win.btns[btn].isVisible = true;var p = win.btns[btn].parentNode;p.className = "dhtmlx_wins_btn_visible";p = null};this._hideButton = function(win, btn) {win.btns[btn].isVisible = false;var p = win.btns[btn].parentNode;p.className = "dhtmlx_wins_btn_hidden";p = null};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 (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)}};this._needHelp = function(win) {if (win.checkEvent("onHelp")) {win.callEvent("onHelp", [win])}else {this.callEvent("onHelp", [win])}};this._attachContent = function(win, type, obj, append) {if (append !== true){while (win._content.childNodes[2].childNodes.length > 0){win._content.childNodes[2].removeChild(win._content.childNodes[2].childNodes[0])}};if (type == "url"){var fr = document.createElement("IFRAME");fr.frameBorder = 0;fr.border = 0;fr.style.width = "100%";fr.style.height = "100%";fr.src = obj;win._content.childNodes[2].appendChild(fr);win._frame = fr;if (_isIE){win._frame.onreadystatechange = function(a) {if (win._frame.readyState == "complete"){that.callEvent("onContentLoaded", [win])}}}else {win._frame.onload = function() {that.callEvent("onContentLoaded", [win])}}}else if (type == "urlajax"){var xmlParser = function(){this.dhxWindowObject.attachHTMLString(this.xmlDoc.responseText);that.callEvent("onContentLoaded", [win]);this.destructor()};var xmlLoader = new dtmlXMLLoaderObject(xmlParser, window);xmlLoader.dhxWindowObject = win;xmlLoader.loadXML(obj)}else if (type == "obj"){win._frame = null;win._content.childNodes[2].appendChild(obj);win._content.childNodes[2].style.overflow = (append===true?"auto":"hidden");obj.style.display = ""}else if (type == "str"){win._frame = null;win._content.childNodes[2].innerHTML = obj}};this._setWindowIcon = function(win, iconEnabled, iconDisabled) {win.iconsPresent = true;win.icons[0] = this.imagePath + iconEnabled;win.icons[1] = this.imagePath + iconDisabled;win.childNodes[1].src = 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";win.childNodes[1].src = 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";win.childNodes[1].src = win.icons[win.className=="dhtmlx_window_active"?0:1]};this._attachWindowContentTo = function(win, obj, w, h) {var data = win._content;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._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()};this._fixInnerObjs(win)};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, label) {var btn = document.createElement("DIV");btn.className = "button_"+label+"_default";btn.title = title;btn.isVisible = true;btn._isEnabled = true;btn.isPressed = false;btn.label = label;win.btns[id] = btn;btn._doOnClick = function() {};var b = win.childNodes[3].childNodes[0].childNodes[0].childNodes[0];var td = document.createElement("TD");td.className = "dhtmlx_wins_btn_" + (btn.isVisible ? "visible" : "hidden");if (pos > b.childNodes.length){b.appendChild(td)}else {if (pos < 0){pos = 0};b.insertBefore(td, b.childNodes[pos])};td.appendChild(btn);this._attachEventsOnButton(win, btn)};this._removeUserButton = function(win, id, btn) {this._removeButtonGlobal(win, id, btn)};this._blockSwitcher = function(state) {for (var a in this.wins){var winContent = this.wins[a]._content;var cover = null;for (var q=0;q<winContent.childNodes.length;q++){if (winContent.childNodes[q].className == "dhx_content_cover_blocker"){cover = winContent.childNodes[q]}};if (cover != null){cover.style.display = (state?"":"none")}}};this.resizingWin = null;this.modalWin = null;this.resizingDirs = "none";this._createViewport();this._doOnMouseUp = function() {that._stopMove()};this._doOnMoseMove = function(e) {e = e||event;if (that!=null){that._moveWindow(e)}};this._resizeTM = null;this._resizeTMTime = 200;this._doOnResize = function() {window.clearTimeout(that._resizeTM);that._resizeTM = window.setTimeout(function(){that._autoResizeViewport()}, that._resizeTMTime)};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, id, btn) {this._parseNestedForEvents(btn);for (var a in btn){if (typeof(btn[a])== "function") {var k = (btn[a].toString()).split("\n");if (!(k.length == 3 && k[1].search(/\[native\scode\]/gi)!= -1)) {btn[a] = null}}};var p = btn.parentNode;p.removeChild(btn);delete win.btns[id];btn = null;p = null};this._removeWindowGlobal = function(win) {if (this.modalWin == win){this._setWindowModal(win, false)};this._parseNestedForEvents(win);if (!_isOpera){for (var a in win.btns){this._removeButtonGlobal(win, a, win.btns[a])}};if (!_isOpera){for (var a in win){if (typeof(win[a])== "function") {var k = (win[a].toString()).split("\n");if (!(k.length == 3 && k[1].search(/\[native\scode\]/gi)!= -1)) {win[a] = null}}}};win._content = null;var p = win.parentNode;p.removeChild(win);delete this.wins[win.idd];win = null;p = 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._attachStatusBar = function() {};this._attachWebMenu = function() {return null};this._attachWebToolbar = function() {return null};this._fixInnerObjs = function(win) {if (win.grid){win.grid.setSizes();win.grid.setSizes()};if (win.tabbar){win.tabbar.adjustOuterSize()};if (win.menu){win.menu._redistribTopLevelPositions()};if (win.accordion){win.accordion.setSizes()};if (win.layout){win.layout.setSizes(win)};if (win.folders){win.folders.setSizes()};if (win.editor){if (_isOpera){window.setTimeout(function(){win.editor.adjustSize()},10)}else {win.editor.adjustSize()}}};this._clearAll = function() {this._clearDocumentEvents();for (var a in this.wins){this._diableOnSelectInWin(this.wins[a]);this._removeWindowGlobal(this.wins[a])};this.modalCoverD.style.display = "";this._parseNestedForEvents(this.modalCoverD);this.modalCoverD.parentNode.removeChild(this.modalCoverD);this.modalCoverD = null;this._parseNestedForEvents(this.modalCoverI);this.modalCoverI.style.display = "";this.modalCoverI.parentNode.removeChild(this.modalCoverI);this.modalCoverI = null;if (this.vp != document.body){this.vp.parentNode.removeChild(this.vp)};this.vp = null;for (var a in this.skinParams){delete this.skinParams[a]};this.skinParams = null;that = null;for (var a in this){if (typeof(this[a])== "function") {this[a] = null}};for (var a in this){delete this[a]}};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)}};if (this._enableStatusBar != null){this._enableStatusBar()};if (this._enableWebMenu != null){this._enableWebMenu()};if (this._enableWebToolbar != null){this._enableWebToolbar()};this._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.dhx_Event = function() {this.dhx_SeverCatcherPath="";this.attachEvent = function(original, catcher, CallObj) {original = original.toLowerCase();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) {name = name.toLowerCase();if (this["ev_"+name]){return this["ev_"+name].apply(this,arg0)};return true};this.checkEvent = function(name) {name = name.toLowerCase();if (this["ev_"+name]){return true};return false};this.eventCatcher = function(obj) {var dhx_catch = new Array();var m_obj = obj;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") 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])}}};this.dhx_Event();return this};dhtmlXWindows.prototype._enableStatusBar = function() {this._attachStatusBar = function(win, bar, show) {var wt = (win._toolbarT!=null?win._toolbarT:0);var mt = (win._menuT!=null?win._menuT:0);win._sbId = win._sidd;win._sbH = (_isIE?19:18);win._sbB = (_isIE?20:19);win.sb = win._content.childNodes[3];win.sb.className = "dhtmlxWebStatusBarInWin_"+this.skin;win._content.childNodes[3].style.display = "";win._content.childNodes[3].style.height = win._sbH + "px";win._content.childNodes[2].style.top = wt + mt + "px";win._content.childNodes[2].style.bottom = win._sbB + "px";if (_isIE){win._IEFixMTS = true;var pad = 19 + wt + mt;win._content.childNodes[2].style.paddingBottom = pad+"px"};win.sb.setText = function(text) {this.innerHTML = text};win.sb.getText = function() {return this.innerHTML};if (win.accordion != null){win.accordion.setSizes()};if (win.layout != null){win.layout.setSizes(win)};return win.sb}};dhtmlXWindows.prototype._enableWebMenu = function() {this._attachWebMenu = function(win) {win._menuId = win._midd;win._menuH = (_isIE?25:22);win._menuT = (_isIE?24:23);win.menu = new dhtmlXMenuObject(win._menuId, "topId");var skin = "glassy_blue";switch (this.skin) {case "glassy_blue":
 case "glassy_blue_light":
 
 win._menuH = 23;win._menuT = 23;break;case "dhx_black":
 case "dhx_blue":
 skin = this.skin;if (win.toolbar != null){win._menuH = 25;win._menuT = 25;win._content.childNodes[0].className += " dhtmlxMenu_"+this._skin+"_bottom
