/* =================================================================== Copyright DHTMLX LTD. http://www.dhtmlx.com This code is obfuscated and not allowed for any purposes except using on sites which belongs to DHTMLX LTD. Please contact sales@dhtmlx.com to obtain necessary license for usage of dhtmlx components. =================================================================== */dhtmlXGridObject.prototype._updateTGRState=function(c){if(c.update&&c.id!=0){if(this.rowsAr[c.id].imgTag)this.rowsAr[c.id].imgTag.src=this.imgURL+c.state+".gif";c.update= !1}};dhtmlXGridObject.prototype.doExpand=function(c){this.editStop();var a=c.parentNode.parentNode.parentNode,b=this._h2.get[a.idd];if(this.callEvent("onOpen",[a.idd,b.state=="plus"? -1:1]))b.state=="plus"?this.expandKids(a):b.state=="minus"&& !b._closeable&&this.collapseKids(a)};function dhtmlxHierarchy(){var c={id:0,childs:[],level: -1,parent:null,index:0,state:dhtmlXGridObject._emptyLineImg};this.order=[c];this.get={0:c};this.swap=function(a,b){var c=a.parent,e=a.index;c.childs[e]=b;c.childs[b.index]=a;a.index=b.index;b.index=e};this.forEachChildF=function(a,b,c,e){for(var f=this.get[a],g=0;g";this.er.childNodes[0].onmousedown=function(a){(a||event).cancelBubble= !0};this.er.childNodes[0].onselectstart=function(a){a||(a=event);return a.cancelBubble= !0};if(_isFF)this.er.style.top="1px";this.er.className+=" editable";this.er.firstChild.onclick=function(a){(a||event).cancelBubble= !0};this.er.firstChild.value=this.val;this.obj=this.er.firstChild;this.er.firstChild.style.width=Math.max(0,this.cell.offsetWidth-this.er.offsetLeft)+"px";this.er.firstChild.focus();_isIE&&this.er.firstChild.focus()}};this.detach=function(){if(this.er){this.setLabel(this.er.firstChild.value);this.er.className=this.er.className.replace("editable","");var a=this.val!=this.er.innerHTML;if(_isFF)this.er.style.top="2px";this.obj=this.er=null;return a}};this.getValue=function(){return this.getLabel()};this.setImage=function(a){this.cell.parentNode.imgTag.nextSibling.src=this.grid.iconURL+a;this.grid._h2.get[this.cell.parentNode.idd].image=a};this.getImage=function(){};this.setLabel=function(a){this.setValueA(a)};this.getLabel=function(){return this.cell.parentNode.valTag.innerHTML}}eXcell_tree.prototype=new eXcell;eXcell_tree.prototype.setValueA=function(c){this.cell.parentNode.valTag.innerHTML=c;this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,c])};eXcell_tree.prototype.setValue=function(c){if(this.cell.parentNode.imgTag)return this.setLabel(c);if(this.grid._tgc.imgURL==null||this.grid._tgc.imgURL!=this.grid.imgURL){var a={};a.spacer="";a.imst="";a.plus=a.imst+"plus.gif"+a.imact;a.minus=a.imst+"minus.gif"+a.imact;a.blank=a.imst+"blank.gif"+a.imact;a.start="
";a.itemim="' align='absmiddle' "+(this.grid._img_height?' height="'+this.grid._img_height+'"':"")+(this.grid._img_width?' width="'+this.grid._img_width+'"':"")+" >";a.close="
";this.grid._tgc=a}var a=this.grid._tgc,b=this.cell.parentNode.idd,d=this.grid._h2.get[b];if(this.grid.kidsXmlFile||this.grid._slowParse)d.has_kids=d.has_kids||this.cell.parentNode._attrs.xmlkids&&d.state!="minus",d._xml_await= ! !d.has_kids;d.image=d.image||this.cell._attrs.image||"leaf.gif";d.label=c;for(var e=[a.start],f=0;f1&&this._fake.rowsCol.splice(b+1,d-1)}this.rowsCol.splice(b,d);this.rowsBuffer.splice(b,d)}a&&(this._removeTrGrRow(null,a),delete this.rowsAr[a.id],a.parent.childs.length==1&&(this._h2.change(a.parent.id,"state",dhtmlXGridObject._emptyLineImg),this._updateTGRState(a.parent)),this._h2.remove(a.id))}};dhtmlXGridObject.prototype.openItem=function(c){var a=this._h2.get[c||0],b=this.getRowById(c||0);b&&(a.parent&&a.parent.id!=0&&this.openItem(a.parent.id),this.expandKids(b))};dhtmlXGridObject.prototype._addRowClassic=dhtmlXGridObject.prototype.addRow;dhtmlXGridObject.prototype.addRow=function(c,a,b,d,e,f){if(!this._h2)return this._addRowClassic(c,a,b);var d=d||0,g=this.cellType._dhx_find("tree");typeof a=="string"&&(a=a.split(this.delim));var h=this._h2.get[c];if(!h)d==0?b=this.rowsBuffer.length:(b=this.getRowIndex(d)+1,this._h2.get[d].state=="minus"?b+=this._getOpenLenght(d,0):this._skipInsert= !0);h=h||this._h2.add(c,d);h.image=e;h.has_kids=f;return h.buff=this._addRowClassic(c,a,b)};dhtmlXGridObject.prototype.addRowBefore=function(c,a,b,d,e){var f=this.rowsAr[b];if(f){if(!this._h2)return this.addRow(c,a,this.getRowIndex(b));var g=this._h2.get[b].parent.id,h=this.getRowIndex(b);if(h== -1)this._skipInsert= !0;this._h2.addBefore(c,g,b);return this.addRow(c,a,h,this._h2.get[b].parent.id,d,e)}};dhtmlXGridObject.prototype.addRowAfter=function(c,a,b,d,e){var f=this.rowsAr[b];if(f){if(!this._h2)return this.addRow(c,a,this.getRowIndex(b)+1);var g=this._h2.get[b].parent.id,h=this.getRowIndex(b);if(h== -1)this._skipInsert= !0;this._h2.get[b].state=="minus"?h+=this._getOpenLenght(b,0)+1:h++;this._h2.addAfter(c,g,b);return this.addRow(c,a,h,g,d,e)}};dhtmlXGridObject.prototype.af=function(c){this._slowParse=convertStringToBoolean(c)};dhtmlXGridObject.prototype._copyTreeGridRowContent=function(c,a,b){var d=this.cellType._dhx_find("tree");for(i=0;i