var nlsTree=new Object();var nlsTreeIc=new Object();var _ua=window.navigator.userAgent;var nls_isIE=(_ua.indexOf("MSIE")>=0);var nls_isSafari=(_ua.indexOf("Safari")>=0);var nls_isOpera=(_ua.indexOf("Opera")>=0);if(nls_isOpera){nls_isIE=false}var NLSTREE=NlsTree.prototype;function NlsTree(C){this.tId=C;this.opt=new StdOpt();this.nLst={};this.ctxMenu=null;this.rt=null;this.selNd=null;this.defImgPath="";this.chUrl=null;this.selElm=null;this.tmId=null;this.nCnt=0;this._fl=true;this.msNds={};this.rtm={};nlsTree[this.tId]=this;var B=(document.getElementsByTagName?document.getElementsByTagName("SCRIPT"):document.scripts);for(var A=0;A<B.length;A++){if(B[A].src.toLowerCase().indexOf("nlstree.js")>=0){this.defImgPath=B[A].src.replace(/nlstree.js/gi,"img/");break}}this.useIconSet(new StdIco(this.defImgPath));this.renderer=new DefRenderer(C);return this}function NlsTreeUtil(){}function StdIco(A){this.pnb=A+"plusnb.gif";this.pb=A+"plusb.gif";this.pnl=A+"plusnl.gif";this.mnb=A+"minusnb.gif";this.mb=A+"minusb.gif";this.mnl=A+"minusnl.gif";this.opf=A+"folderopen.gif";this.clf=A+"folder.gif";this.chd=A+"leaf.gif";this.rot=A+"root.gif";this.lnb=A+"lineang.gif";this.lb=A+"lineints.gif";this.lin=A+"line.gif";this.bln=A+"blank.gif";this.lod=A+"loading.gif";this.toString=function(){return"Standard Icons"};return this}function StdOpt(){this.enbScroll=false;this.height="300px";this.width="200px";this.trg="_self";this.stlprf="";this.sort="no";this.icon=true;this.check=false;this.editable=false;this.selRow=false;this.editKey=113;this.oneExp=false;this.enableCtx=true;this.oneClick=false;this.mntState=false;this.icAsSel=false;this.checkIncSub=true;this.checkParents=false;this.indent=true;this.hideRoot=false;this.showExpdr=false;this.checkOnLeaf=false;this.renderOnDemand=false;this.evDblClick=false;this.evCtxMenu=false;this.evMouseUp=false;this.evMouseDown=false;this.evMouseMove=false;this.evMouseOut=false;this.evMouseOver=false;return this}function NlsNode(C,E,D,A,G,B,H,F){this.orgId=C;this.id="";this.capt=E;this.url=(D==null||D=="")?"":D;this.ic=null;this.exp=G==null?false:G;this.chk=(B?B:false);this.xtra=H==null?false:H;this.ctxMenu=null;this.cstStyle="";this.trg=null;this.custom=null;this.title=F==null?E:F;this.editablity=true;this.checkbox=true;this.setIcon=function(I){var K=(I==null||I=="")?null:I.split(",");if(K){for(var J=0;J<K.length;J++){preloadIcon(K[J])}}this.ic=K};this.isCustomNode=function(){return this.custom==null};this.nx=null;this.pv=null;this.fc=null;this.lc=null;this.pr=null;this.equals=function(I){if(!I){return false}else{return(this.id==I.id)}};this.setIcon(A)}NLSTREE.genIntId=function(A){return this.tId+A};NLSTREE.genOrgId=function(A){return A.substr(this.tId.length)};NLSTREE.compareNode=function(A,B){return(A.capt>=B.capt)};NLSTREE.add=function(C,K,E,B,D,F,H,A,J){var G=new NlsNode(((C==null||String(C)=="")?("int"+(++this.nCnt)):C),E,B,D,F,H,A,J);G.id=this.genIntId(G.orgId);if(this.nLst[G.id]!=null){return }if(this.rt==null){this.rt=G}else{var I=this.nLst[this.genIntId(K)];if(I==null){return }G.pr=I;if(I.lc==null){I.fc=G;I.lc=G}else{var L=I.fc;if(this.opt.sort!="no"){do{if(this.opt.sort=="asc"?this.compareNode(L,G):this.compareNode(G,L)){break}L=L.nx}while(L!=null);if(L!=null){if(L.pv==null){L.pv=G;I.fc=G}else{G.pv=L.pv;L.pv.nx=G;L.pv=G}G.nx=L}}if(this.opt.sort=="no"||L==null){G.pv=I.lc;I.lc.nx=G;I.lc=G}}}this.nLst[G.id]=G;return G};NLSTREE.addCustomNode=function(D,C,A){var B=this.add(D,C,"");B.capt="";B.custom=A;return B};NLSTREE.addBefore=function(C,E,F,B,D,G,J,A,K){var H=this.getNodeById(E);if(H==null){return }var I=new NlsNode(((C==null||C=="")?("int"+(++this.nCnt)):C),F,B,D,G,J,A,K);I.id=this.genIntId(I.orgId);if(this.nLst[I.id]!=null){alert("Item with id "+C+" already exist");return }this.nLst[I.id]=I;I.pr=H.pr;I.nx=H;if(H.pv==null){H.pv=I;H.pr.fc=I}else{I.pv=H.pv;H.pv.nx=I;H.pv=I}return I};NLSTREE.addAfter=function(C,E,F,B,D,G,J,A,K){var H=this.getNodeById(E);if(H==null){return }var I=new NlsNode(((C==null||C=="")?("int"+(++this.nCnt)):C),F,B,D,G,J,A,K);I.id=this.genIntId(I.orgId);if(this.nLst[I.id]!=null){alert("Item with id "+C+" already exist");return }this.nLst[I.id]=I;I.pr=H.pr;I.pv=H;if(H.nx==null){H.nx=I;H.pr.lc=I}else{I.nx=H.nx;H.nx.pv=I;H.nx=I}return I};NLSTREE.append=function(C,J,E,B,D,F,H,A,I){var G=this.add(C,J,E,B,D,F,H,A,I);this.reloadNode(J);return G};NLSTREE.remove=function(E,B){var A=(E!=null?this.nLst[this.genIntId(E)]:this.selNd);if(A!=null){if(this.rt.equals(A)){this.rt=null;this.nLst=new Object();this.selNd=null;this.selElm=null;return A}if(this.selNd&&A.equals(this.selNd)){this.selNd=null;this.selElm=null}var D=A.pr;if(D.lc.equals(A)){D.lc=A.pv}if(D.fc.equals(A)){D.fc=A.nx}if(A.pv!=null){A.pv.nx=A.nx}if(A.nx!=null){A.nx.pv=A.pv}A.nx=null;A.pv=null;A.pr=null;var C=this.tId;this.loopTree(A,function(F){nlsTree[C].nLst[F.id]=null});if(this.opt.multiSel){delete this.msNds[A.id]}if(B==null||B){this.reloadNode(this.genOrgId(D.id))}}return A};NLSTREE.removeSelected=function(){var B=this.getSelNodes();for(var A=0;A<B.length;A++){this.remove(B[A].orgId)}};NLSTREE.removeChilds=function(C,B){var A=(C!=null?this.nLst[this.genIntId(C)]:this.selNd);if(A!=null){while(A.fc){this.remove(A.fc.orgId,false)}if(B==null||B){this.reloadNode(C)}}};NLSTREE.getSelNode=function(){return this.selNd};NLSTREE.getSelNodes=function(){var A=[];if(this.opt.multiSel){for(var B in this.msNds){if(this.msNds[B] instanceof NlsNode){A[A.length]=this.msNds[B]}}}else{if(this.selNd!=null){A[0]=this.selNd}}return A};NLSTREE.isSelected=function(A){var C=this.getNodeById(A);var D=this.getSelNodes();for(var B=0;B<D.length;B++){if(C.id==D[B].id){return true}}return false};NLSTREE.genTree=function(){return this.renderer.genTree()};NLSTREE.genAttrib=function(){var A="<input id='ndedt"+this.tId+"' type='text' class='"+this.opt.stlprf+"nodeedit' style='display:none' value='' onblur='if (nlsTree."+this.tId+"._fl) nlsTree."+this.tId+".liveNodeWrite()'>"+(!NlsGetElementById("ddGesture")?"<div id='ddGesture' style='position:absolute;border:#f0f0f0 1px solid;left:0px;top:0px;display:none'></div>":"");if(typeof (nlsctxmenu)!="undefined"){for(var B in nlsctxmenu){if(nlsctxmenu[B] instanceof NlsCtxMenu){if(!NlsGetElementById(B)){A+=nlsctxmenu[B].genMenu()}}}}return A};NLSTREE.renderAttributes=function(C){var B=(C?NlsGetElementById(C):null);if(B){B.innerHTML=""}var A=this.genAttrib();if(B){B.innerHTML=A}else{document.write(A)}};NLSTREE.render=function(C){var B=NlsGetElementById(this.tId+"$attr");if(!B){B=document.createElement("SPAN");B.id=this.tId+"$attr";document.body.insertBefore(B,document.body.childNodes[0])}else{B.innerHTML=""}B.innerHTML=this.genAttrib();if(this.opt.renderOnDemand){this.renderer.genNodes=DefRenderer.$genNodes}this.renderer.render(C);this.initEvent();this.selNd=null;this.selElm=null;var A=null;if(this.opt.mntState&&nls_getCookie){var A=nls_getCookie(this.tId+"_selnd");nls_maintainNodeState(this.tId,true)}if(A&&A!=""){this.selectNodeById(A)}};NLSTREE.renderTo=function(F,E){var D=this.getNodeById(F),B=D,C=[];if(E&&D.fc&&!NlsGetElementById(D.fc.id)){C[C.length]=D}while(B){if(NlsGetElementById(B.id)){break}C[C.length]=B.pr;B=B.pr}for(var A=C.length;A>0;A--){this.reloadNode(C[A-1].orgId)}};function DefRenderer(B){var A=nlsTree[B];this.tr=A;this.rat=new Object();this.dsp=new Object();this.initRender=function(){var D=A.opt;var F=A.ico;var E="onclick=\"return nls_c2(event, '"+B+"','@id')\" ";if(D.evDblClick){E+="ondblclick=\"return nls_c3(event, '"+B+"', '@id')\" "}if(D.evCtxMenu){E+="oncontextmenu=\"return nls_c4(event, '"+B+"', '@id')\" "}if(D.evMouseUp){E+="onmouseup=\"return nls_c5(event, '"+B+"', '@id')\" "}if(D.evMouseDown){E+="onmousedown=\"return nls_c6(event, '"+B+"', '@id')\" "}if(D.evMouseOver){E+="onmouseover=\"return nls_c7(event, '"+B+"', '@id')\" "}if(D.evMouseOut){E+="onmouseout=\"return nls_c8(event, '"+B+"', '@id')\" "}if(D.evMouseMove){E+="onmousemove=\"return nls_c9(event, '"+B+"', '@id')\" "}var G="onclick=\"nls_cb1(event, '"+B+"','@id')\"";var C=["<img src='@expdr' onclick=\"nls_c1(event, '"+B+"', '@id')\" onmouseover=\"nls_c11(event, '"+B+"', '@id')\" onmouseout=\"nls_c12(event, '"+B+"', '@id')\">","<img src='@expdr'>","<img src='@ic' "+E+">"];this.rat.cnt=["<div id='@id' class='"+D.stlprf+'row\' title="@title">',"<div id='@id' class='"+D.stlprf+"row' title=\"@title\" style='display:none'>","</div><div style='display:block' id='ch_@id'>","</div><div style='display:none' id='ch_@id'>"];this.rat.ex=[[[C[1].replace(/@expdr/gi,F.lnb),C[1].replace(/@expdr/gi,F.lb)],[C[1].replace(/@expdr/gi,F.lnb),C[1].replace(/@expdr/gi,F.lb)]],[[C[0].replace(/@expdr/gi,F.pnb),C[0].replace(/@expdr/gi,F.pb)],[C[0].replace(/@expdr/gi,F.mnb),C[0].replace(/@expdr/gi,F.mb)]]];this.rat.mn=["<table cellspacing=0 cellpadding=0><tr><td nowrap>","</td><td nowrap>","</td><td nowrap>","</td><td nowrap>","</td><td width='100%'>","</td></tr></table>"];this.rat.ics=C[2];this.rat.ic=[[C[2].replace(/@ic/gi,F.chd),C[2].replace(/@ic/gi,F.chd)],[C[2].replace(/@ic/gi,F.clf),C[2].replace(/@ic/gi,(A.opt.icAsSel?F.clf:F.opf))]];this.rat.rt=[C[2].replace(/@ic/gi,F.rot),[C[0].replace(/@expdr/gi,F.pnl),C[0].replace(/@expdr/gi,F.mnl)]];this.rat.ln=['<img src="'+F.bln+'">','<img src="'+F.lin+'">'];this.rat.ac=['<a class="@nstyle" style=\'display:block\' href="javascript:void(0);" '+E+" >@capt</a>","<a class=\"@nstyle\" style='display:block' target='@trg' "+E+' href="'];this.rat.st=[D.stlprf+"node",D.stlprf+"prnnode"];this.rat.cb=["<input style='height:14px;margin:1px' type='checkbox' id='cb_@id' name='cb_@id' "+G+" >","<input style='height:14px;margin:1px' type='checkbox' checked id='cb_@id' name='cb_@id' "+G+" >"];this.rat.rd=["<input style='height:14px;margin:1px' type='radio' name='rd_@id'>","<input style='height:14px;margin:1px' type='radio' checked name='rd_@id'>"]};this.genANode=function(E){this.dsp.ln="";this.dsp.ic="";this.dsp.chk="";var I=E.pr;if(A.opt.indent){while(true){if(!I||I.equals(A.rt)&&!A.opt.showExpdr||(A.opt.hideRoot&&(I.equals(A.rt)||(!A.opt.showExpdr&&I.pr.equals(A.rt))))){break}this.dsp.ln=this.rat.ln[(I.nx!=null?1:0)]+this.dsp.ln;I=I.pr}}if(E.custom!=null){this.dsp.nd=E.custom;this.dsp.ip=this.rat.ln[0];return this.rat.mn[0]+this.dsp.ln+this.rat.mn[1]+this.dsp.ip+this.dsp.ic+this.rat.mn[2]+this.dsp.chk+this.rat.mn[4]+this.dsp.nd+this.rat.mn[5]}else{var G=1,F=0,C=1,D=0;if(!E.fc){G=0;E.exp=false}if(E.svrLoad&&E.loaded==0){G=1}if(E.exp){F=1}if(!E.nx){C=0}if(E.id==A.rt.id){D=1}this.dsp.ip=this.rat.ex[G][F][C];if(D==1){this.dsp.ip=(A.opt.showExpdr?this.rat.rt[1][F]:"")}else{if(A.opt.hideRoot&&!A.opt.showExpdr&&E.pr.id==A.rt.id){this.dsp.ip=""}}if(A.opt.icon||D==1){if(E.ic!=null){this.dsp.ic=this.rat.ics.replace(/@ic/gi,E.ic[(!A.opt.icAsSel&&E.ic[F]?F:0)])}else{this.dsp.ic=this.rat.ic[G][F];if(D==1){this.dsp.ic=this.rat.rt[0]}}}if(E.url){this.dsp.nd=this.rat.ac[1].replace(/@trg/gi,(E.trg==null?A.opt.trg:E.trg))+E.url+'">'+E.capt+"</a>"}else{this.dsp.nd=this.rat.ac[0].replace(/@capt/gi,E.capt)}if(E.cstStyle!=""){this.dsp.nd=this.dsp.nd.replace(/@nstyle/gi,E.cstStyle)}else{this.dsp.nd=this.dsp.nd.replace(/@nstyle/gi,this.rat.st[G])}if(A.opt.check&&E.checkbox){var H=A.opt.checkOnLeaf;if(!H||(H&&G==0)){this.dsp.chk=this.rat.cb[(E.chk?1:0)]}}if(E.pr&&E.pr.rad){this.dsp.chk=this.rat.rd[(E.chk?1:0)].replace(/@id/gi,E.pr.id)}return this.rat.mn[0]+this.dsp.ln+this.rat.mn[1]+this.dsp.ip+this.dsp.ic+this.rat.mn[2]+this.dsp.chk+this.rat.mn[3]+this.dsp.nd+this.rat.mn[5]}};this.genNodes=function(E,C,G){var F="";if(C){F=this.rat.cnt[(A.opt.hideRoot&&E.equals(A.rt)?1:0)]+this.genANode(E)+this.rat.cnt[(E.fc&&E.exp?2:3)]}F=F.replace(/@id/gi,E.id).replace(/@title/gi,E.title);if(G){document.write(F)}if(E.fc!=null){var D=E.fc;do{if(G){this.genNodes(D,true,G)}else{F=F+this.genNodes(D,true,G)}D=D.nx}while(D!=null)}if(G){if(C){document.write("</div>")}return""}else{F=C?(F+"</div>"):F;return F}};this.genTree=function(){this.initRender();return this.genNodes(A.rt,true,false)};this.render=function(D){var C="class='"+this.tr.opt.stlprf+"nlstree' ";if(this.tr.opt.enbScroll){C+="style='overflow:auto;height:"+this.tr.opt.height+";width:"+this.tr.opt.width+";' onmousemove=\"return nls_c10(event, '"+B+"')\""}if(D&&D!=""){NlsGetElementById(D).innerHTML='<div id="'+B+'" '+C+" >"+this.genTree()+"</div>"}else{this.initRender();document.write('<div id="'+B+'" '+C+" >");this.genNodes(A.rt,true,true);document.write("</div>")}};return this}DefRenderer.$genNodes=function(C,A,G){var E="",F=this.tr;if(A){E=this.rat.cnt[(F.opt.hideRoot&&C.equals(F.rt)?1:0)]+this.genANode(C)+this.rat.cnt[(C.fc&&C.exp?2:3)]}E=E.replace(/@id/gi,C.id).replace(/@title/gi,C.title);if(G){document.write(E)}var B=C.fc,D="";while(B){if(B.exp){if(G){this.genNodes(B,true,G)}else{E=E+this.genNodes(B,true,G)}}else{D=this.rat.cnt[0]+this.genANode(B)+this.rat.cnt[(B.fc&&B.exp?2:3)]+"</div>";D=D.replace(/@id/gi,B.id).replace(/@title/gi,B.title);if(G){document.write(D)}else{E=E+D}}B=B.nx}if(G){if(A){document.write("</div>")}return""}else{E=A?(E+"</div>"):E;return E}};function $getAnchor(A){return A.childNodes[0].childNodes[0].childNodes[0].childNodes[3].childNodes[0]}NLSTREE.initEvent=function(){var A=(nls_isIE?document.body.onkeydown:window.onkeydown);if(!A||A.toString().search(/orgEvent/gi)<0){var B=function(C){if(nlsTree.selectedTree){nlsTree.selectedTree.liveNodePress(nls_isIE?event:C)}if(A){return A()}};if(nls_isIE){document.body.onkeydown=B}else{window.onkeydown=B}}};NLSTREE.reloadNode=function(G,A){this.renderer.initRender();var B=this.genIntId(G);var D=this.nLst[B];var F=NlsGetElementById("ch_"+B);if(A!=false){var E=this.renderer.genNodes(D,false);F.innerHTML=E;if(F.innerHTML==""){F.style.display="none"}}if(D.exp==true&&D.fc!=null){F.style.display=""}F=NlsGetElementById(B);F.innerHTML="";F.innerHTML=this.renderer.genANode(D).replace(/@id/gi,B);F.setAttribute("title",D.title);if(this.selNd!=null){var C=this.selNd.id;this.selNd=null;this.selElm=null;this.selectNode(C)}};NLSTREE.selNToggle=function(A){this.toggleNode(A);if(!this.selNd||this.selNd.id!=A){this.selectNode(A)}if(this.tmId!=null){clearTimeout(this.tmId);this.tmId=null}};function $pbsHasChild(A){return(A.fc||(A.svrLoad&&A.loaded==0))}function nls_setStyle(A,C,B,D){var E=(D?"sel":"");if(A.opt.selRow){B.className=A.opt.stlprf+E+"row"}ac=$getAnchor(B);ac.className=(C.cstStyle!=""?E+C.cstStyle:A.opt.stlprf+E+($pbsHasChild(C)?"prnnode":"node"))}function nls_setNodeIcon(A,C,B,D){if(A.opt.icon){ic=B.childNodes[0].childNodes[0].childNodes[0].childNodes[1];if(ic.childNodes.length==2){ic=ic.childNodes[1]}else{ic=ic.childNodes[0]}if(D){if(C.ic!=null){ic.src=nlsTreeIc[C.ic[1]?C.ic[1]:C.ic[0]].src}else{ic.src=nlsTreeIc[(C.id==A.rt.id?A.ico.rot:($pbsHasChild(C)?A.ico.opf:A.ico.chd))].src}}else{if(C.ic!=null){ic.src=nlsTreeIc[C.ic[0]].src}else{ic.src=nlsTreeIc[(C.id==A.rt.id?A.ico.rot:($pbsHasChild(C)?A.ico.clf:A.ico.chd))].src}}}}NLSTREE.selectNode=function(F){nlsTree.selectedTree=this;if(this.opt.editable){var C=this.selNd;if(C!=null&&C.id!=F){if(this.tmId){clearTimeout(this.tmId);this.tmId=null}}if(C!=null&&C.id==F&&!NlsTree._blockEdit){this.tmId=setTimeout("nlsTree."+this.tId+".liveNodeEdit('"+F+"')",1000)}var E=NlsGetElementById("ndedt"+this.tId);if(E&&E.style.display==""){E.style.display="none";E.disabled=true}}var D=null;var A=null;var C=this.selNd;var B=this.selElm;if(B!=null){nls_setStyle(this,C,B,false);if(this.opt.icAsSel){nls_setNodeIcon(this,C,B,false)}}C=this.nLst[F];if(this.opt.renderOnDemand){this.renderTo(C.orgId)}this.selNd=C;this.selElm=NlsGetElementById(F);B=this.selElm;nls_setStyle(this,C,B,true);if(this.opt.icAsSel){nls_setNodeIcon(this,C,B,true)}if(this.opt.mntState&&nls_setCookie){nls_setCookie(this.tId+"_selnd",C.orgId)}if(this.opt.multiSel){this.msRemoveAll();this.msAdd(C)}};NLSTREE.selectNodeById=function(C){var B=this.getNodeById(C);if(!B){return }var A=B.pr;while(A!=null){this.expandNode(A.orgId);A=A.pr}this.selectNode(B.id)};NLSTREE.unselectNodeById=function(C){var B=this.getNodeById(C);if(this.selNd!=null&&this.selNd.equals(B)){var A=NlsGetElementById(B.id);if(this.opt.icAsSel){nls_setNodeIcon(this,B,A,false)}if(this.opt.mntState&&nls_setCookie){nls_removeCookie(this.tId+"_selnd")}this.selNd=null;this.selElm=null;nls_setStyle(this,B,A,false)}};NLSTREE.isChild=function(D,B){var C=this.getNodeById(D);if(!C){return false}var A=C.pr;while(A!=null){if(A.orgId==B){return true}A=A.pr}return false};NLSTREE.hasChild=function(B){var A=this.getNodeById(B);return(A.fc!=null)};NLSTREE.expandNode=function(B){var A=this.getNodeById(B);if((!A.exp&&A.fc)||(A.svrLoad&&A.loaded==0)){this.toggleNode(A.id)}};NLSTREE.collapseNode=function(B){var A=this.nLst[this.genIntId(B)];if(A.exp&&A.fc){this.toggleNode(A.id)}};NLSTREE.prepareToggle=function(B){var A=this.selNd;if(A==null){this.selectNode(B);return }if(A.id==B){return }while(A!=null&&A.id!=B){A=A.pr}if(A==null){return }if(A.id==B){this.selectNode(B)}};NLSTREE.toggleNode=function(E){var A=this.nLst[E];if(A.svrLoad&&A.loaded==0){this.ajaxLoadChildNodes(A.orgId);return }if(this.opt.renderOnDemand){this.renderTo(A.orgId,true)}var D=NlsGetElementById("ch_"+E),C=null;if(E!=this.rt.id||(E==this.rt.id&&this.opt.showExpdr)){C=NlsGetElementById(E).childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0]}if(this.opt.hideRoot&&!this.opt.showExpdr&&A.pr&&A.pr.equals(this.rt)){C=null}if(A.exp){A.exp=false;D.style.display="none";if(C!=null&&A.fc!=null){C.src=(E==this.rt.id?this.ico.pnl:(A.nx?this.ico.pb:this.ico.pnb))}if(!this.opt.icAsSel){nls_setNodeIcon(this,A,NlsGetElementById(E),false)}if(this.opt.mntState&&nls_delExpandedId){nls_delExpandedId(this.tId+"_ndstate",A.orgId)}this.treeOnCollapse(A.orgId)}else{if(this.opt.oneExp&&A.pr){var B=A.pr.fc;while(B){if(B.id!=E&&B.exp){this.collapseNode(B.orgId)}B=B.nx}}A.exp=true;D.style.display="block";if(C!=null&&A.fc!=null){C.src=(E==this.rt.id?this.ico.mnl:(A.nx?this.ico.mb:this.ico.mnb))}if(!this.opt.icAsSel){nls_setNodeIcon(this,A,NlsGetElementById(E),true)}if(this.opt.mntState&&nls_addExpandedId){nls_addExpandedId(this.tId+"_ndstate",A.orgId)}this.treeOnExpand(A.orgId)}};NLSTREE.expandAll=function(C){var B=this.tId;var A=(!C?this.rt:this.getNodeById(C));this.loopTree(A,function(D){nlsTree[B].expandNode(D.orgId)})};NLSTREE.collapseAll=function(B,D){var C=this.tId;var A=(!D?this.rt:this.getNodeById(D));this.loopTree(A,function(E){if(E.fc&&(!A.equals(E)||B)){nlsTree[C].collapseNode(E.orgId)}})};NLSTREE.checkNode=function(C,A){var G=NlsGetElementById("cb_"+C);var B=this.nLst[C];if(arguments.length>1){G.checked=A}B.chk=G.checked;if(this.opt.checkIncSub){if(G.checked==true){this.loopTree(B,$nlsCheck)}else{this.loopTree(B,$nlsUnCheck)}}if(this.opt.checkParents){var D=B;if(G.checked==true){while(D){$nlsCheck(D);D=D.pr}}else{var E,F=false;while(D){$nlsUnCheck(D);E=D;if(E.pr!=null){E=E.pr.fc}while(E){if(E.chk==true){F=true;break}E=E.nx}if(F){break}D=D.pr}}}};function $nlsCheck(A){$setCheck(A,true)}function $nlsUnCheck(A){$setCheck(A,false)}function $setCheck(A,B){if(!A.checkbox){return }var C=NlsGetElementById("cb_"+A.id);if(C){C.checked=B}A.chk=B}NLSTREE.setNodeStyle=function(F,B,A){var E=this.getNodeById(F);E.cstStyle=B;if(A){var D=NlsGetElementById(E.id);if(D){var C=$getAnchor(D);C.className=B}}};NLSTREE.setNodeCaption=function(E,C){var B=this.genIntId(E);var D=$getAnchor(NlsGetElementById(B));var A=this.nLst[B];D.innerHTML=C;A.capt=C};NLSTREE.getNodeById=function(A){return this.nLst[this.genIntId(A)]};NLSTREE.setGlobalCtxMenu=function(A){this.opt.evCtxMenu=true;this.ctxMenu=A;A.container=this};NLSTREE.setNodeCtxMenu=function(C,A){this.opt.evCtxMenu=true;var B=this.nLst[this.genIntId(C)];B.ctxMenu=A;if(A.mId){A.container=this}};NLSTREE.setNodeTarget=function(C,A){var B=this.nLst[this.genIntId(C)];B.trg=A};NLSTREE.setEditablity=function(C,A){var B=this.nLst[this.genIntId(C)];B.editablity=A};NLSTREE.enableCheckbox=function(C,A){var B=this.nLst[this.genIntId(C)];B.checkbox=A};NLSTREE.useIconSet=function(A){this.ico=A;preloadIcon(A.pnb,A.pb,A.pnl,A.mnb,A.mb,A.mnl,A.opf,A.clf,A.chd,A.rot,A.lnb,A.lb,A.lin,A.bln,A.lod)};NLSTREE.contextMenu=function(E,G){if(!this.opt.enableCtx){return false}var B=this.nLst[G];var A=null;if(B.ctxMenu&&B.ctxMenu.mId){A=B.ctxMenu}else{if(B.ctxMenu=="DEFAULT"){A=null}else{if(B.ctxMenu=="NONE"){return false}else{A=this.ctxMenu}}}if(!A){return true}if(this.opt.multiSel&&this.isSelected(B.orgId)){var F=this.getSelNodes();for(var D=0;D<F.length;D++){var C=(F[D].ctxMenu==null?this.ctxMenu:F[D].ctxMenu);if(C!=null&&C.mId!=A.mId){this.selectNode(G);break}}}else{this.selectNode(G)}if(this.tmId){clearTimeout(this.tmId)}A.container=this;A.showMenu(E.clientX,E.clientY);return false};NLSTREE.loopTree=function(C,A){A(C);if(C.fc!=null){var B=C.fc;do{this.loopTree(B,A);B=B.nx}while(B!=null)}};NLSTREE.liveNodeEditStart=function(A){this.tmId=setTimeout("nlsTree."+this.tId+".liveNodeEdit('"+A+"')",0)};NLSTREE.liveNodeEdit=function(G){if(!this.nLst[G].editablity){this.tmId=null;return }if(this.tmId!=null){var D=NlsGetElementById("ndedt"+this.tId);var C=$getAnchor(NlsGetElementById(G));var B=0,F=0,E=C;while(E){B+=E.offsetLeft;F+=E.offsetTop;E=E.offsetParent}E=NlsGetElementById(this.tId);if(E){F-=E.scrollTop;B-=E.scrollLeft}D.disabled=false;var A=this.editBoxPosAdj();D.style.top=F+A[1]+"px";D.style.left=B+A[0]+"px";D.style.display="block";D.focus();D.value=this.nLst[G].capt;this.tmId=null;this.$editing=true}};NLSTREE.liveNodeWrite=function(){var B=NlsGetElementById("ndedt"+this.tId);if(B.style.display=="none"){return }var A=$getAnchor(NlsGetElementById(this.selNd.id));if(B.value!=""&&B.value!=this.selNd.capt){if(this.treeOnBeforeNodeChange(this.selNd.orgId)){A.innerHTML=B.value;this.selNd.capt=B.value;this.treeOnNodeChange(this.selNd.orgId)}else{return }}B.style.display="none";B.disabled=true;this.$editing=false};NLSTREE.liveNodePress=function(A){if(!this.opt.editable){return }if(A.keyCode==13){this._fl=false;this.liveNodeWrite();this._fl=true}else{if(A.keyCode==27){var B=NlsGetElementById("ndedt"+this.tId);B.style.display="none";B.disabled=true}else{if(A.keyCode==this.opt.editKey){this.tmId=setTimeout("nlsTree."+this.tId+".liveNodeEdit('"+this.selNd.id+"')",10)}}}};NLSTREE.editBoxPosAdj=function(){return[0,0]};function nls_c1(B,C,A){nlsTree[C].prepareToggle(A);nlsTree[C].toggleNode(A)}function nls_c2(C,E,A){var B=nlsTree[E];var D=B.nLst[A];if(C.ctrlKey&&C.altKey){if(C.stopPropagation){C.stopPropagation()}else{C.cancelBubble=true}return B.contextMenu(C,A)}if(B.opt.multiSel){if(!nls_msTreeOnClick(C,E,A)){return false}}if((B.opt.oneClick||(B.opt.hideRoot&&B.rt.equals(D.pr)))&&B.nLst[A].fc){B.selNToggle(A)}else{B.selectNode(A)}return B.treeOnClick(C,B.genOrgId(A))}function nls_c3(C,D,A){var B=nlsTree[D];if(B.nLst[A].fc){B.selNToggle(A)}return B.treeOnDblClick(C,B.genOrgId(A))}function nls_c4(C,D,A){var B=nlsTree[D];return B.contextMenu(C,A)}function nls_c5(C,D,A){var B=nlsTree[D];return B.treeOnMouseUp(C,B.genOrgId(A))}function nls_c6(C,D,A){var B=nlsTree[D];return B.treeOnMouseDown(C,B.genOrgId(A))}function nls_c7(C,D,A){var B=nlsTree[D];return B.treeOnMouseOver(C,B.genOrgId(A))}function nls_c8(C,D,A){var B=nlsTree[D];return B.treeOnMouseOut(C,B.genOrgId(A))}function nls_c9(C,D,A){var B=nlsTree[D];return B.treeOnMouseMove(C,B.genOrgId(A))}function nls_c10(B,C){var A=nlsTree[C];return A.$treeMove(B)}function nls_c11(C,D,A){var B=nlsTree[D];B.$expdrMove(C,B.genOrgId(A))}function nls_c12(C,D,A){var B=nlsTree[D];B.$expdrOut(C,B.genOrgId(A))}function nls_cb1(C,D,A){var B=nlsTree[D];B.checkNode(A);B.treeOnCheck(B.genOrgId(A))}NLSTREE.$expdrMove=function(A,B){};NLSTREE.$expdrOut=function(A,B){};NLSTREE.$treeMove=function(A){};NLSTREE.treeOnClick=function(A,B){return true};NLSTREE.treeOnDblClick=function(A,B){};NLSTREE.treeOnMouseOver=function(A,B){};NLSTREE.treeOnMouseMove=function(A,B){};NLSTREE.treeOnMouseOut=function(A,B){};NLSTREE.treeOnMouseDown=function(A,B){};NLSTREE.treeOnMouseUp=function(A,B){};NLSTREE.treeOnCheck=function(A){};NLSTREE.treeOnExpand=function(A){};NLSTREE.treeOnCollapse=function(A){};NLSTREE.treeOnNodeChange=function(A){};NLSTREE.treeOnBeforeNodeChange=function(A){return true};function preloadIcon(){var B=preloadIcon.arguments,A;for(var C=0;C<B.length;C++){if(!B[C]){continue}A=nlsTreeIc[B[C]];if(!A){A=new Image();A.src=B[C];nlsTreeIc[B[C]]=A}}}function NlsGetElementById(A){if(document.all){return document.all(A)}else{if(document.getElementById){return document.getElementById(A)}}}NlsTree.isEquals=function(B,A){if(!B||!A){return false}return(B.id==A.id)};