/*
* nlstree.js v2.2
* Copyright 2005-2006, addobject.com. All Rights Reserved
* Author Jack Hermanto, www.addobject.com
*/
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=new Object();
this.ctxMenu=null;
this.rt=null;
this.selNd=null;
this.defImgPath="";
this.selElm=null;
this.tmId=null;
this.nCnt=0;
this._fl=true;
this.msNds=new Object();
if(nlsTree[this.tId]!=null){alert("The tree with id "+this.tId+" already exist, please change the tree id.")
}else{nlsTree[this.tId]=this
}var A=(document.getElementsByTagName?document.getElementsByTagName("SCRIPT"):document.scripts);
for(var B=0;
B<A.length;
B++){if(A[B].src.toLowerCase().indexOf("nlstree.js")>=0){this.defImgPath=A[B].src.replace(/nlstree.js/gi,"img/");
break
}}this.useIconSet(new StdIco(this.defImgPath));
this.renderer=new DefRenderer(C);
return this
}function StdIco(A){this.pnb=A+"plusnb.gif";
this.pb=A+"plusb.gif";
this.mnb=A+"minusnb.gif";
this.mb=A+"minusb.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.pnl=A+"blank.gif";
this.mnl=A+"blank.gif";
this.toString=function(){return"Standard Icons"
};
return this
}function StdOpt(){this.trg="_self";
this.stlprf="";
this.sort="asc";
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.indent=true;
this.hideRoot=false;
this.showExpdr=false;
this.checkOnLeaf=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=(A==null||A=="")?null:A.split(",");
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.sortFunc=NLSTREE.compareNode;
if(this.ic){preloadIcon(this.ic[0]);
if(this.ic.length>1){preloadIcon(this.ic[1])
}}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){return(this.id==I.id)
}
}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.compareNodeById=function(A,B){return(A.id>=B.id)
};
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(I.sortFunc!=null){if(this.opt.sort=="asc"?I.sortFunc(L,G):I.sortFunc(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){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.renderAttributes=function(B){if(B&&B!=""){NlsGetElementById(B).innerHTML=""
}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(it in nlsctxmenu){if(!NlsGetElementById(it)){A+=nlsctxmenu[it].genMenu()
}}}if(B&&B!=""){NlsGetElementById(B).innerHTML=A
}else{document.write(A)
}};
NLSTREE.render=function(B){this.renderer.render(B);
this.initEvent();
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)
}};
function DefRenderer(B){var A=nlsTree[B];
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')\" class=\"pagetree2 plusminus\">","<img src='@expdr' class='pagetree2 angleline'>","<img src='@ic' class='pagetree2 icon' "+E+">"];
this.rat.cnt=["<div id='@id' class='"+D.stlprf+'row @indent\' title="@title">',"<div id='@id' class='"+D.stlprf+"row @indent' 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 class="pagetree2 lines">','</td><td class="pagetree2 plusminus-and-icon">','</td><td class="pagetree2 cell3">','</td><td class="pagetree2 nodename">',"</td><td class=\"pagetree2 cell5\" 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);
this.rat.ln=['<img src="'+F.bln+"\" class='pagetree2 icon'>",'<img src="'+F.lin+"\" class='pagetree2 line'>"];
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.hideRoot&&!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.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||(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
}}}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,H){var F="";
var G=0;
var I=E.pr;
while(I!=null){I=I.pr;
G++
}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).replace(/@indent/gi,"indent"+G);
if(H){document.write(F)
}if(E.fc!=null){var D=E.fc;
do{if(H){this.genNodes(D,true,H)
}else{F=F+this.genNodes(D,true,H)
}D=D.nx
}while(D!=null)
}if(H){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(C){if(C&&C!=""){NlsGetElementById(C).innerHTML='<div id="'+B+'">'+this.genTree()+"</div>"
}else{this.initRender();
document.write('<div id="'+B+'">');
this.genNodes(A.rt,true,true);
document.write("</div>")
}};
return this
}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);
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 nls_setStyle(A,C,B,D){var E=(D?"sel":"");
var F=0;
var G=C.pr;
while(G!=null){G=G.pr;
F++
}if(A.opt.selRow){B.className=A.opt.stlprf+E+"row indent"+F
}ac=B.childNodes[0].childNodes[0].childNodes[0].childNodes[3].childNodes[0];
ac.className=(C.cstStyle!=""?E+C.cstStyle:A.opt.stlprf+E+(C.fc?"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:(C.fc?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:(C.fc?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];
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.nLst[this.genIntId(B)];
if(!A.exp&&A.fc){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 D=NlsGetElementById("ch_"+E);
var C=null;
if(E!=this.rt.id){C=NlsGetElementById(E).childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0]
}var A=this.nLst[E];
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=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=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){if(D.fc){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 D=NlsGetElementById("cb_"+C);
var B=this.nLst[C];
if(arguments.length>1){D.checked=A
}B.chk=D.checked;
if(this.opt.checkIncSub){if(D.checked==true){this.loopTree(B,actCheckNode)
}else{this.loopTree(B,actUncheckNode)
}}};
function actCheckNode(A){if(!A.checkbox){return 
}var B=NlsGetElementById("cb_"+A.id);
B.checked=true;
A.chk=true
}function actUncheckNode(A){if(!A.checkbox){return 
}var B=NlsGetElementById("cb_"+A.id);
B.checked=false;
A.chk=false
}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=D.childNodes[0].childNodes[0].childNodes[0].childNodes[3].childNodes[0];
C.className=B
}}};
NLSTREE.setNodeCaption=function(E,C){var B=this.genIntId(E);
var D=NlsGetElementById(B).childNodes[0].childNodes[0].childNodes[0].childNodes[3].childNodes[0];
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(this.ico.pnb,this.ico.pb,this.ico.pnl,this.ico.mnb,this.ico.mb,this.ico.mnl,this.ico.opf,this.ico.clf,this.ico.chd,this.ico.rot,this.ico.lnb,this.ico.lb,this.ico.lin,this.ico.bln)
};
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.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=NlsGetElementById(G).childNodes[0].childNodes[0].childNodes[0].childNodes[3].childNodes[0];
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=NlsGetElementById(this.selNd.id).childNodes[0].childNodes[0].childNodes[0].childNodes[3].childNodes[0];
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_cb1(C,D,A){var B=nlsTree[D];
B.checkNode(A);
B.treeOnCheck(B.genOrgId(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 A=preloadIcon.arguments;
for(var B=0;
B<A.length;
B++){if(!nlsTreeIc[A[B]]){nlsTreeIc[A[B]]=new Image();
nlsTreeIc[A[B]].src=A[B]
}}}function NlsGetElementById(A){if(document.all){return document.all(A)
}else{if(document.getElementById){return document.getElementById(A)
}}};
