function navigate(url) { location.href=url; } // getElementByID with browser check!! function getElById(idVal) { if (document.getElementById != null) return document.getElementById(idVal) if (document.all != null) return document.all[idVal] alert("Problem getting element by id") return null } // Node object function Node(id, pid, name, url, title, target, icon, iconOpen, open , checkable ,checked, add, del) { this.id = id; this.pid = pid; this.name = name; this.url = url; this.title = title; this.target = target; this.icon = icon; this.iconOpen = iconOpen; this._io = open || false; this.checkable = checkable || false; this.checked = checked || false; this.add = add || false; this.del = del || false; this._is = false; this._ls = false; this._hc = false; this._ai = 0; this._p; }; // Tree object function dTree(objName) { this.config = { target : null, folderLinks : true, useSelection : true, useCookies : true, useLines : true, useIcons : true, useStatusText : false, closeSameLevel : false, inOrder : false } this.icon = { root : 'tree-images/zone.gif', folder : 'tree-images/folder.gif', folderOpen : 'tree-images/folderopen.gif', node : 'tree-images/page.gif', empty : 'tree-images/empty.gif', line : 'tree-images/line.gif', join : 'tree-images/join.gif', joinBottom : 'tree-images/joinbottom.gif', plus : 'tree-images/plus_updown.gif', plusBottom : 'tree-images/plus_up.gif', minus : 'tree-images/minus_.gif', minusBottom : 'tree-images/minus_up.gif', nlPlus : 'tree-images/plus_.gif', nlMinus : 'tree-images/minus_.gif' }; this.obj = objName; this.aNodes = []; this.aIndent = []; this.root = new Node(-1); this.selectedNode = null; this.selectedFound = false; this.completed = false; }; // Adds a new node to the node array dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open, checkable, checked, add, del) { this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open, checkable, checked, add, del); }; // 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'; if (node.checkable) { str += ''; str += ' '+node.name; if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += ''; if (node.add && node.url) { str += ' -- '; } if (node.del && node.url) { str += ' '; } if (node._hc) { str += '
'; str += this.addNode(node); str += '
'; } 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) { for (var n=0; n'; (node._ls) ? this.aIndent.push(0) : this.aIndent.push(1); if (node._hc) { 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'+cn.id+'='+what+','+this.aNodes.length ); this.c(cn.id); } } }; dTree.prototype.generate_checkedlist = function(id) { var retStr=''; var n=0; var parent = document.getElementById("c" + this.obj + id); for (n; n'+cn.id+'='+what+','+this.aNodes.length ); } } return retStr; } // Toggle Open or close 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(); }; // Open or close all nodes dTree.prototype.oAll = function(status) { for (var n=0; n