function Node(id,_2,_3,_4,_5,_6,_7,_8,_9){
this.id=id;
this.pid=_2;
this.name=_3;
this.url=_4;
this.title=_5;
this.target=_6;
this.icon=_7;
this.iconOpen=_8;
this._io=_9||false;
this._is=false;
this._ls=false;
this._hc=false;
this._ai=0;
this._p;
}
function dTree(_10){
this.config={folderLinks:true,useSelection:false,useCookies:true,useLines:true,useIcons:true,useStatusText:false,closeSameLevel:false,inOrder:false};
this.icon={root:"images/appicon.gif",folder:"images/folder.gif",folderOpen:"images/folderopen.gif",node:"images/page.gif",empty:"images/empty3.gif",line:"images/line.gif",join:"images/join.gif",joinBottom:"images/joinbottom.gif",plus:"images/plus2.gif",plusBottom:"images/plusbottom.gif",minus:"images/minus2.gif",minusBottom:"images/minusbottom.gif",nlPlus:"images/nolines_plus.gif",nlMinus:"images/nolines_minus.gif"};
this.obj=_10;
this.aNodes=[];
this.aIndent=[];
this.root=new Node(-1);
this.selectedNode=null;
this.selectedFound=false;
this.completed=false;
}
dTree.prototype.add=function(id,pid,_12,url,_14,_15,_16,_17,_18){
this.aNodes[this.aNodes.length]=new Node(id,pid,_12,url,_14,_15,_16,_17,_18);
};
dTree.prototype.openAll=function(){
this.oAll(true);
};
dTree.prototype.closeAll=function(){
this.oAll(false);
};
dTree.prototype.toString=function(){
var str="<div class=\"dtree\">\n";
if(document.getElementById){
if(this.config.useCookies){
this.selectedNode=this.getSelected();
}
str+=this.addNode(this.root);
}else{
str+="Browser not supported.";
}
str+="</div>";
if(!this.selectedFound){
this.selectedNode=null;
}
this.completed=true;
return str;
};
dTree.prototype.addNode=function(_20){
var str="";
var n=0;
if(this.config.inOrder){
n=_20._ai;
}
for(n;n<this.aNodes.length;n++){
if(this.aNodes[n].pid==_20.id){
var cn=this.aNodes[n];
cn._p=_20;
cn._ai=n;
this.setCS(cn);
if(!cn.target&&this.config.target){
cn.target=this.config.target;
}
if(cn._hc&&!cn._io&&this.config.useCookies){
cn._io=this.isOpen(cn.id);
}
if(!this.config.folderLinks&&cn._hc){
cn.url=null;
}
if(this.config.useSelection&&cn.id==this.selectedNode&&!this.selectedFound){
cn._is=true;
this.selectedNode=n;
this.selectedFound=true;
}
str+=this.node(cn,n);
if(cn._ls){
break;
}
}
}
return str;
};
dTree.prototype.node=function(_23,_24){
var str="<div class=\"dTreeNode\">"+this.indent(_23,_24);
if(this.config.useIcons){
if(!_23.icon){
_23.icon=(this.root.id==_23.pid)?this.icon.root:((_23._hc)?this.icon.folder:this.icon.node);
}
if(!_23.iconOpen){
_23.iconOpen=(_23._hc)?this.icon.folderOpen:this.icon.node;
}
if(this.root.id==_23.pid){
_23.icon=this.icon.root;
_23.iconOpen=this.icon.root;
}
if(_23.icon!=null){
if(_23._hc){
str+="<a href=\"javascript: "+this.obj+".o("+_24+");\">";
}
}
str+="<img id=\"i"+this.obj+_24+"\" src=\""+((_23._io)?_23.iconOpen:_23.icon)+"\" alt=\"\" />";
if(_23._hc){
str+="</a>";
}
}
if(_23.url){
str+="<a id=\"s"+this.obj+_24+"\" class=\""+((this.config.useSelection)?((_23._is?"nodeSel":"node")):"node")+"\" href=\""+_23.url+"\"";
if(_23.title){
str+=" title=\""+_23.title+"\"";
}
if(_23.target){
str+=" target=\""+_23.target+"\"";
}
if(this.config.useStatusText){
str+=" onmouseover=\"window.status='"+_23.name+"';return true;\" onmouseout=\"window.status='';return true;\" ";
}
if(this.config.useSelection&&((_23._hc&&this.config.folderLinks)||!_23._hc)){
str+=" onclick=\"javascript: "+this.obj+".s("+_24+");\"";
}
str+=">";
}else{
if((!this.config.folderLinks||!_23.url)&&_23._hc&&_23.pid!=this.root.id){
str+="<a href=\"javascript: "+this.obj+".o("+_24+");\" class=\"node\">";
}
}
str+=_23.name;
if(_23.url||((!this.config.folderLinks||!_23.url)&&_23._hc)){
str+="</a>";
}
str+="</div>";
if(_23._hc){
str+="<div id=\"d"+this.obj+_24+"\" class=\"clip\" style=\"display:"+((this.root.id==_23.pid||_23._io)?"block":"none")+";\">";
str+=this.addNode(_23);
str+="</div>";
}
this.aIndent.pop();
return str;
};
dTree.prototype.indent=function(_25,_26){
var str="";
if(this.root.id!=_25.pid){
for(var n=0;n<this.aIndent.length;n++){
str+="<img src=\""+((this.aIndent[n]==1&&this.config.useLines)?this.icon.line:this.icon.empty)+"\" alt=\"\" />";
}
(_25._ls)?this.aIndent.push(0):this.aIndent.push(1);
if(_25._hc){
str+="<a href=\"javascript: "+this.obj+".o("+_26+");\"><img id=\"j"+this.obj+_26+"\" src=\"";
if(!this.config.useLines){
str+=(_25._io)?this.icon.nlMinus:this.icon.nlPlus;
}else{
str+=((_25._io)?((_25._ls&&this.config.useLines)?this.icon.minusBottom:this.icon.minus):((_25._ls&&this.config.useLines)?this.icon.plusBottom:this.icon.plus));
}
str+="\" alt=\"\" /></a>";
}else{
str+="<img src=\""+((this.config.useLines)?((_25._ls)?this.icon.joinBottom:this.icon.join):this.icon.empty)+"\" alt=\"\" />";
}
}
return str;
};
dTree.prototype.setCS=function(_27){
var _28;
for(var n=0;n<this.aNodes.length;n++){
if(this.aNodes[n].pid==_27.id){
_27._hc=true;
}
if(this.aNodes[n].pid==_27.pid){
_28=this.aNodes[n].id;
}
}
if(_28==_27.id){
_27._ls=true;
}
};
dTree.prototype.getSelected=function(){
var sn=this.getCookie("cs"+this.obj);
return (sn)?sn:null;
};
dTree.prototype.s=function(id){
if(!this.config.useSelection){
return;
}
var cn=this.aNodes[id];
if(cn._hc&&!this.config.folderLinks){
return;
}
if(this.selectedNode!=id){
if(this.selectedNode||this.selectedNode==0){
eOld=document.getElementById("s"+this.obj+this.selectedNode);
eOld.className="node";
}
eNew=document.getElementById("s"+this.obj+id);
eNew.className="nodeSel";
this.selectedNode=id;
if(this.config.useCookies){
this.setCookie("cs"+this.obj,cn.id);
}
}
};
dTree.prototype.o=function(id){
var cn=this.aNodes[id];
this.nodeStatus(!cn._io,id,cn._ls);
cn._io=!cn._io;
if(this.config.closeSameLevel){
this.closeLevel(cn);
}
if(this.config.useCookies){
this.updateCookie();
}
};
dTree.prototype.oAll=function(_30){
for(var n=0;n<this.aNodes.length;n++){
if(this.aNodes[n]._hc&&this.aNodes[n].pid!=this.root.id){
this.nodeStatus(_30,n,this.aNodes[n]._ls);
this.aNodes[n]._io=_30;
}
}
if(this.config.useCookies){
this.updateCookie();
}
};
dTree.prototype.openTo=function(nId,_32,_33){
if(!_33){
for(var n=0;n<this.aNodes.length;n++){
if(this.aNodes[n].id==nId){
nId=n;
break;
}
}
}
var cn=this.aNodes[nId];
if(cn.pid==this.root.id||!cn._p){
return;
}
cn._io=true;
cn._is=_32;
if(this.completed&&cn._hc){
this.nodeStatus(true,cn._ai,cn._ls);
}
if(this.completed&&_32){
this.s(cn._ai);
}else{
if(_32){
this._sn=cn._ai;
}
}
this.openTo(cn._p._ai,false,true);
};
dTree.prototype.closeLevel=function(_34){
for(var n=0;n<this.aNodes.length;n++){
if(this.aNodes[n].pid==_34.pid&&this.aNodes[n].id!=_34.id&&this.aNodes[n]._hc){
this.nodeStatus(false,n,this.aNodes[n]._ls);
this.aNodes[n]._io=false;
this.closeAllChildren(this.aNodes[n]);
}
}
};
dTree.prototype.closeAllChildren=function(_35){
for(var n=0;n<this.aNodes.length;n++){
if(this.aNodes[n].pid==_35.id&&this.aNodes[n]._hc){
if(this.aNodes[n]._io){
this.nodeStatus(false,n,this.aNodes[n]._ls);
}
this.aNodes[n]._io=false;
this.closeAllChildren(this.aNodes[n]);
}
}
};
dTree.prototype.nodeStatus=function(_36,id,_37){
eDiv=document.getElementById("d"+this.obj+id);
eJoin=document.getElementById("j"+this.obj+id);
if(this.config.useIcons){
eIcon=document.getElementById("i"+this.obj+id);
eIcon.src=(_36)?this.aNodes[id].iconOpen:this.aNodes[id].icon;
}
try{
eJoin.src=(this.config.useLines)?((_36)?((_37)?this.icon.minusBottom:this.icon.minus):((_37)?this.icon.plusBottom:this.icon.plus)):((_36)?this.icon.nlMinus:this.icon.nlPlus);
eDiv.style.display=(_36)?"block":"none";
} catch(e) { }
};
dTree.prototype.clearCookie=function(){
var now=new Date();
var _39=new Date(now.getTime()-1000*60*60*24);
this.setCookie("co"+this.obj,"cookieValue",_39);
this.setCookie("cs"+this.obj,"cookieValue",_39);
};
dTree.prototype.setCookie=function(_40,_41,_42,_43,_44,_45){
document.cookie=escape(_40)+"="+escape(_41)+(_42?"; expires="+_42.toGMTString():"")+(_43?"; path="+_43:"")+(_44?"; domain="+_44:"")+(_45?"; secure":"");
};
dTree.prototype.getCookie=function(_46){
var _47="";
var _48=document.cookie.indexOf(escape(_46)+"=");
if(_48!=-1){
var _49=_48+(escape(_46)+"=").length;
var _50=document.cookie.indexOf(";",_49);
if(_50!=-1){
_47=unescape(document.cookie.substring(_49,_50));
}else{
_47=unescape(document.cookie.substring(_49));
}
}
return (_47);
};
dTree.prototype.updateCookie=function(){
var str="";
for(var n=0;n<this.aNodes.length;n++){
if(this.aNodes[n]._io&&this.aNodes[n].pid!=this.root.id){
if(str){
str+=".";
}
str+=this.aNodes[n].id;
}
}
this.setCookie("co"+this.obj,str);
};
dTree.prototype.isOpen=function(id){
var _51=this.getCookie("co"+this.obj).split(".");
for(var n=0;n<_51.length;n++){
if(_51[n]==id){
return true;
}
}
return false;
};
if(!Array.prototype.push){
Array.prototype.push=function array_push(){
for(var i=0;i<arguments.length;i++){
this[this.length]=arguments[i];
}
return this.length;
};
}
if(!Array.prototype.pop){
Array.prototype.pop=function array_pop(){
lastElement=this[this.length-1];
this.length=Math.max(this.length-1,0);
return lastElement;
};
}