/*--------------------------------------------------| | dTree 2.05 | www.destroydrop.com/javascript/tree/ | |---------------------------------------------------| | Copyright (c) 2002-2003 Geir Landr? | | | | This script can be used freely as long as all | | copyright messages are intact. | | | | Updated: 17.04.2003 | |--------------------------------------------------*/ // Node object function Node(id, pid, name, url, title, target, icon, iconOpen, open) { 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._is = false; this._ls = false; this._hc = false; this._ai = 0; this._p; }; // Tree object function dTree(objName) { this.config = { target : null, folderLinks : false, useSelection : false, useCookies : true, useLines : false, useIcons : false, useStatusText : false, useSigns : false, //kmc_acj closeSameLevel : false, inOrder : false, domain : '', path : '' } this.icon = { root : 'modules/mod_sobi2sfxmenu/images/base.gif', none : 'modules/mod_sobi2sfxmenu/images/none.gif', folder : 'modules/mod_sobi2sfxmenu/images/folder.gif', folderOpen : 'modules/mod_sobi2sfxmenu/images/folderopen.gif', node : 'modules/mod_sobi2sfxmenu/images/page.gif', empty : 'modules/mod_sobi2sfxmenu/images/empty.gif', line : 'modules/mod_sobi2sfxmenu/images/line.gif', join : 'modules/mod_sobi2sfxmenu/images/join.gif', joinBottom : 'modules/mod_sobi2sfxmenu/images/joinbottom.gif', plus : 'modules/mod_sobi2sfxmenu/images/plus.gif', plusBottom : 'modules/mod_sobi2sfxmenu/images/plusbottom.gif', minus : 'modules/mod_sobi2sfxmenu/images/minus.gif', minusBottom : 'modules/mod_sobi2sfxmenu/images/minusbottom.gif', nlPlus : 'modules/mod_sobi2sfxmenu/images/nolines_plus.gif', nlMinus : 'modules/mod_sobi2sfxmenu/images/nolines_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) { 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 = '