// node object function node(id, pid, name, url,istrue ,title, target, icon, iconopen, open) { this.id = id; this.pid = pid; this.name = name; this.url = url; this.istrue = istrue; this.title = title; this.target = target; this.icon = icon; this.iconopen = iconopen; this._io = open || false; this._is = false; this._ls = false; this._hc = false; this._ai = 0; this._p; }; // tree object function dtree(objname,targetmode) { this.config = { target : null, folderlinks : true, useselection : true, usecookies : true, uselines : true, useicons : true, usestatustext : false, closesamelevel : false, inorder : false } this.icon = { root : 'img/base.gif', folder : 'img/folder.gif', folderopen : 'img/folderopen.gif', node : 'img/page.gif', empty : 'img/empty.gif', line : 'img/line.gif', join : 'img/join.gif', joinbottom : 'img/joinbottom.gif', plus : 'img/plus.gif', plusbottom : 'img/plusbottom.gif', minus : 'img/minus.gif', minusbottom : 'img/minusbottom.gif', nlplus : 'img/nolines_plus.gif', nlminus : 'img/nolines_minus.gif' }; this.obj = objname; this.anodes = []; this.aindent = []; this.root = new node(-1); this.selectednode = null; this.selectedfound = false; this.completed = false; if(!targetmode) { this.targetmode = "_self"; } else { this.targetmode = targetmode; } }; // adds a new node to the node array dtree.prototype.add = function(id, pid, name, url, title, target, icon, iconopen, open) { this.anodes[this.anodes.length] = new node(id, pid, name, url, title, target, icon, iconopen, open); }; // open/close all nodes dtree.prototype.openall = function() { this.oall(true); }; dtree.prototype.closeall = function() { this.oall(false); }; // outputs the tree to the page dtree.prototype.tostring = function() { var str = '
\n'; if (document.getelementbyid) { if (this.config.usecookies) this.selectednode = this.getselected(); str += this.addnode(this.root); } else str += 'browser not supported.'; str += '
'; if (!this.selectedfound) this.selectednode = null; this.completed = true; return str; }; // creates the tree structure dtree.prototype.addnode = function(pnode) { var str = ''; var n=0; if (this.config.inorder) n = pnode._ai; for (n; n'; } else{ str += ''; } } if (node.url) { str += ''; str += node.name; if (node.url || ((!this.config.folderlinks || !node.url) && node._hc)) str += ''; str += ''; if (node._hc) { str += '
'; str += this.addnode(node); str += '
'; } this.aindent.pop(); return str; }; // adds the empty and line icons dtree.prototype.indent = function(node, nodeid) { var str = ''; if (this.root.id != node.pid) { var len=this.aindent.length; for (var n=0; n'; (node._ls) ? this.aindent.push(0) : this.aindent.push(1); if (node._hc) { str += ''; } else{ //alert(node.istrue); if(!node._ls){ str += ''; }else{ str += ''; } } } return str; }; // checks if a node has any children and if it is the last sibling dtree.prototype.setcs = function(node) { var lastid; for (var n=0; n