<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://htyp.org/mw/index.php?action=history&amp;feed=atom&amp;title=dTree%2Fdtree.js%2F2.05</id>
	<title>dTree/dtree.js/2.05 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://htyp.org/mw/index.php?action=history&amp;feed=atom&amp;title=dTree%2Fdtree.js%2F2.05"/>
	<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=dTree/dtree.js/2.05&amp;action=history"/>
	<updated>2026-07-06T09:12:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://htyp.org/mw/index.php?title=dTree/dtree.js/2.05&amp;diff=14869&amp;oldid=prev</id>
		<title>Woozle: moved dTree/dtree.js to dTree/dtree.js/2.05: making room for multiple versions</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=dTree/dtree.js/2.05&amp;diff=14869&amp;oldid=prev"/>
		<updated>2011-01-12T02:05:05Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/dTree/dtree.js&quot; title=&quot;dTree/dtree.js&quot;&gt;dTree/dtree.js&lt;/a&gt; to &lt;a href=&quot;/dTree/dtree.js/2.05&quot; title=&quot;dTree/dtree.js/2.05&quot;&gt;dTree/dtree.js/2.05&lt;/a&gt;: making room for multiple versions&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:05, 12 January 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Woozle</name></author>
	</entry>
	<entry>
		<id>https://htyp.org/mw/index.php?title=dTree/dtree.js/2.05&amp;diff=14867&amp;oldid=prev</id>
		<title>Woozle: moved dtree/dtree.js to dTree/dtree.js: the T is capitalized in the code, so I think that must be the official name. This will help distinguish it from the Linux CLI utility &quot;dtree&quot;, too.</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=dTree/dtree.js/2.05&amp;diff=14867&amp;oldid=prev"/>
		<updated>2011-01-12T02:01:18Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/dtree/dtree.js&quot; class=&quot;mw-redirect&quot; title=&quot;dtree/dtree.js&quot;&gt;dtree/dtree.js&lt;/a&gt; to &lt;a href=&quot;/dTree/dtree.js&quot; title=&quot;dTree/dtree.js&quot;&gt;dTree/dtree.js&lt;/a&gt;: the T is capitalized in the code, so I think that must be the official name. This will help distinguish it from the Linux CLI utility &amp;quot;dtree&amp;quot;, too.&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:01, 12 January 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Woozle</name></author>
	</entry>
	<entry>
		<id>https://htyp.org/mw/index.php?title=dTree/dtree.js/2.05&amp;diff=14857&amp;oldid=prev</id>
		<title>Woozle: Created page with &quot;category:source code ==About== This is the original 2003 version from the dtree site. It doesn&#039;t seem to have any option to prepend a path to the images, so either they all h...&quot;</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=dTree/dtree.js/2.05&amp;diff=14857&amp;oldid=prev"/>
		<updated>2011-01-12T00:51:52Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/mw/index.php?title=Category:source_code&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:source code (page does not exist)&quot;&gt;category:source code&lt;/a&gt; ==About== This is the original 2003 version from the dtree site. It doesn&amp;#039;t seem to have any option to prepend a path to the images, so either they all h...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[category:source code]]&lt;br /&gt;
==About==&lt;br /&gt;
This is the original 2003 version from the dtree site. It doesn&amp;#039;t seem to have any option to prepend a path to the images, so either they all have to be in an /img subfolder of the calling HTML page&amp;#039;s folder or else you have to fully specify every icon image.&lt;br /&gt;
&lt;br /&gt;
The formatting has been slightly tidied for this venue but the code is unaltered.&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;javascript&amp;gt;&lt;br /&gt;
/*--------------------------------------------------|&lt;br /&gt;
| dTree 2.05 | www.destroydrop.com/javascript/tree/ |&lt;br /&gt;
|---------------------------------------------------|&lt;br /&gt;
| Copyright (c) 2002-2003 Geir Landrö               |&lt;br /&gt;
|                                                   |&lt;br /&gt;
| This script can be used freely as long as all     |&lt;br /&gt;
| copyright messages are intact.                    |&lt;br /&gt;
|                                                   |&lt;br /&gt;
| Updated: 17.04.2003                               |&lt;br /&gt;
|--------------------------------------------------*/&lt;br /&gt;
&lt;br /&gt;
// Node object&lt;br /&gt;
&lt;br /&gt;
function Node(id, pid, name, url, title, target, icon, iconOpen, open) {&lt;br /&gt;
	this.id = id;&lt;br /&gt;
	this.pid = pid;&lt;br /&gt;
	this.name = name;&lt;br /&gt;
	this.url = url;&lt;br /&gt;
	this.title = title;&lt;br /&gt;
	this.target = target;&lt;br /&gt;
	this.icon = icon;&lt;br /&gt;
	this.iconOpen = iconOpen;&lt;br /&gt;
	this._io = open || false;&lt;br /&gt;
	this._is = false;&lt;br /&gt;
	this._ls = false;&lt;br /&gt;
	this._hc = false;&lt;br /&gt;
	this._ai = 0;&lt;br /&gt;
	this._p;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Tree object&lt;br /&gt;
&lt;br /&gt;
function dTree(objName) {&lt;br /&gt;
	this.config = {&lt;br /&gt;
		target		: null,&lt;br /&gt;
		folderLinks	: true,&lt;br /&gt;
		useSelection	: true,&lt;br /&gt;
		useCookies	: true,&lt;br /&gt;
		useLines	: true,&lt;br /&gt;
		useIcons	: true,&lt;br /&gt;
		useStatusText	: false,&lt;br /&gt;
		closeSameLevel	: false,&lt;br /&gt;
		inOrder		: false&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	this.icon = {&lt;br /&gt;
		root		: &amp;#039;img/base.gif&amp;#039;,&lt;br /&gt;
		folder		: &amp;#039;img/folder.gif&amp;#039;,&lt;br /&gt;
		folderOpen	: &amp;#039;img/folderopen.gif&amp;#039;,&lt;br /&gt;
		node		: &amp;#039;img/page.gif&amp;#039;,&lt;br /&gt;
		empty		: &amp;#039;img/empty.gif&amp;#039;,&lt;br /&gt;
		line		: &amp;#039;img/line.gif&amp;#039;,&lt;br /&gt;
		join		: &amp;#039;img/join.gif&amp;#039;,&lt;br /&gt;
		joinBottom	: &amp;#039;img/joinbottom.gif&amp;#039;,&lt;br /&gt;
		plus		: &amp;#039;img/plus.gif&amp;#039;,&lt;br /&gt;
		plusBottom	: &amp;#039;img/plusbottom.gif&amp;#039;,&lt;br /&gt;
		minus		: &amp;#039;img/minus.gif&amp;#039;,&lt;br /&gt;
		minusBottom	: &amp;#039;img/minusbottom.gif&amp;#039;,&lt;br /&gt;
		nlPlus		: &amp;#039;img/nolines_plus.gif&amp;#039;,&lt;br /&gt;
		nlMinus		: &amp;#039;img/nolines_minus.gif&amp;#039;&lt;br /&gt;
	};&lt;br /&gt;
	this.obj = objName;&lt;br /&gt;
	this.aNodes = [];&lt;br /&gt;
	this.aIndent = [];&lt;br /&gt;
	this.root = new Node(-1);&lt;br /&gt;
	this.selectedNode = null;&lt;br /&gt;
	this.selectedFound = false;&lt;br /&gt;
	this.completed = false;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Adds a new node to the node array&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) {&lt;br /&gt;
	this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Open/close all nodes&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.openAll = function() {&lt;br /&gt;
	this.oAll(true);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.closeAll = function() {&lt;br /&gt;
	this.oAll(false);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Outputs the tree to the page&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.toString = function() {&lt;br /&gt;
	var str = &amp;#039;&amp;lt;div class=&amp;quot;dtree&amp;quot;&amp;gt;\n&amp;#039;;&lt;br /&gt;
	if (document.getElementById) {&lt;br /&gt;
		if (this.config.useCookies) this.selectedNode = this.getSelected();&lt;br /&gt;
		str += this.addNode(this.root);&lt;br /&gt;
	} else str += &amp;#039;Browser not supported.&amp;#039;;&lt;br /&gt;
	str += &amp;#039;&amp;lt;/div&amp;gt;&amp;#039;;&lt;br /&gt;
	if (!this.selectedFound) this.selectedNode = null;&lt;br /&gt;
	this.completed = true;&lt;br /&gt;
	return str;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Creates the tree structure&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.addNode = function(pNode) {&lt;br /&gt;
	var str = &amp;#039;&amp;#039;;&lt;br /&gt;
	var n=0;&lt;br /&gt;
	if (this.config.inOrder) n = pNode._ai;&lt;br /&gt;
	for (n; n&amp;lt;this.aNodes.length; n++) {&lt;br /&gt;
		if (this.aNodes[n].pid == pNode.id) {&lt;br /&gt;
			var cn = this.aNodes[n];&lt;br /&gt;
			cn._p = pNode;&lt;br /&gt;
			cn._ai = n;&lt;br /&gt;
			this.setCS(cn);&lt;br /&gt;
			if (!cn.target &amp;amp;&amp;amp; this.config.target) cn.target = this.config.target;&lt;br /&gt;
			if (cn._hc &amp;amp;&amp;amp; !cn._io &amp;amp;&amp;amp; this.config.useCookies) cn._io = this.isOpen(cn.id);&lt;br /&gt;
			if (!this.config.folderLinks &amp;amp;&amp;amp; cn._hc) cn.url = null;&lt;br /&gt;
			if (this.config.useSelection &amp;amp;&amp;amp; cn.id == this.selectedNode &amp;amp;&amp;amp; !this.selectedFound) {&lt;br /&gt;
					cn._is = true;&lt;br /&gt;
					this.selectedNode = n;&lt;br /&gt;
					this.selectedFound = true;&lt;br /&gt;
			}&lt;br /&gt;
			str += this.node(cn, n);&lt;br /&gt;
			if (cn._ls) break;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	return str;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Creates the node icon, url and text&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.node = function(node, nodeId) {&lt;br /&gt;
	var str = &amp;#039;&amp;lt;div class=&amp;quot;dTreeNode&amp;quot;&amp;gt;&amp;#039; + this.indent(node, nodeId);&lt;br /&gt;
	if (this.config.useIcons) {&lt;br /&gt;
		if (!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node);&lt;br /&gt;
		if (!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node;&lt;br /&gt;
		if (this.root.id == node.pid) {&lt;br /&gt;
			node.icon = this.icon.root;&lt;br /&gt;
			node.iconOpen = this.icon.root;&lt;br /&gt;
		}&lt;br /&gt;
		str += &amp;#039;&amp;lt;img id=&amp;quot;i&amp;#039; + this.obj + nodeId + &amp;#039;&amp;quot; src=&amp;quot;&amp;#039; + ((node._io) ? node.iconOpen : node.icon) + &amp;#039;&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;#039;;&lt;br /&gt;
	}&lt;br /&gt;
	if (node.url) {&lt;br /&gt;
		str += &amp;#039;&amp;lt;a id=&amp;quot;s&amp;#039; + this.obj + nodeId + &amp;#039;&amp;quot; class=&amp;quot;&amp;#039; + ((this.config.useSelection) ? ((node._is ? &amp;#039;nodeSel&amp;#039; : &amp;#039;node&amp;#039;)) : &amp;#039;node&amp;#039;) + &amp;#039;&amp;quot; href=&amp;quot;&amp;#039; + node.url + &amp;#039;&amp;quot;&amp;#039;;&lt;br /&gt;
		if (node.title) str += &amp;#039; title=&amp;quot;&amp;#039; + node.title + &amp;#039;&amp;quot;&amp;#039;;&lt;br /&gt;
		if (node.target) str += &amp;#039; target=&amp;quot;&amp;#039; + node.target + &amp;#039;&amp;quot;&amp;#039;;&lt;br /&gt;
		if (this.config.useStatusText) str += &amp;#039; onmouseover=&amp;quot;window.status=\&amp;#039;&amp;#039; + node.name + &amp;#039;\&amp;#039;;return true;&amp;quot; onmouseout=&amp;quot;window.status=\&amp;#039;\&amp;#039;;return true;&amp;quot; &amp;#039;;&lt;br /&gt;
		if (this.config.useSelection &amp;amp;&amp;amp; ((node._hc &amp;amp;&amp;amp; this.config.folderLinks) || !node._hc))&lt;br /&gt;
			str += &amp;#039; onclick=&amp;quot;javascript: &amp;#039; + this.obj + &amp;#039;.s(&amp;#039; + nodeId + &amp;#039;);&amp;quot;&amp;#039;;&lt;br /&gt;
		str += &amp;#039;&amp;gt;&amp;#039;;&lt;br /&gt;
	}&lt;br /&gt;
	else if ((!this.config.folderLinks || !node.url) &amp;amp;&amp;amp; node._hc &amp;amp;&amp;amp; node.pid != this.root.id)&lt;br /&gt;
		str += &amp;#039;&amp;lt;a href=&amp;quot;javascript: &amp;#039; + this.obj + &amp;#039;.o(&amp;#039; + nodeId + &amp;#039;);&amp;quot; class=&amp;quot;node&amp;quot;&amp;gt;&amp;#039;;&lt;br /&gt;
	str += node.name;&lt;br /&gt;
	if (node.url || ((!this.config.folderLinks || !node.url) &amp;amp;&amp;amp; node._hc)) str += &amp;#039;&amp;lt;/a&amp;gt;&amp;#039;;&lt;br /&gt;
	str += &amp;#039;&amp;lt;/div&amp;gt;&amp;#039;;&lt;br /&gt;
	if (node._hc) {&lt;br /&gt;
		str += &amp;#039;&amp;lt;div id=&amp;quot;d&amp;#039; + this.obj + nodeId + &amp;#039;&amp;quot; class=&amp;quot;clip&amp;quot; style=&amp;quot;display:&amp;#039; + ((this.root.id == node.pid || node._io) ? &amp;#039;block&amp;#039; : &amp;#039;none&amp;#039;) + &amp;#039;;&amp;quot;&amp;gt;&amp;#039;;&lt;br /&gt;
		str += this.addNode(node);&lt;br /&gt;
		str += &amp;#039;&amp;lt;/div&amp;gt;&amp;#039;;&lt;br /&gt;
	}&lt;br /&gt;
	this.aIndent.pop();&lt;br /&gt;
	return str;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Adds the empty and line icons&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.indent = function(node, nodeId) {&lt;br /&gt;
	var str = &amp;#039;&amp;#039;;&lt;br /&gt;
	if (this.root.id != node.pid) {&lt;br /&gt;
		for (var n=0; n&amp;lt;this.aIndent.length; n++)&lt;br /&gt;
			str += &amp;#039;&amp;lt;img src=&amp;quot;&amp;#039; + ( (this.aIndent[n] == 1 &amp;amp;&amp;amp; this.config.useLines) ? this.icon.line : this.icon.empty ) + &amp;#039;&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;#039;;&lt;br /&gt;
		(node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);&lt;br /&gt;
		if (node._hc) {&lt;br /&gt;
			str += &amp;#039;&amp;lt;a href=&amp;quot;javascript: &amp;#039; + this.obj + &amp;#039;.o(&amp;#039; + nodeId + &amp;#039;);&amp;quot;&amp;gt;&amp;lt;img id=&amp;quot;j&amp;#039; + this.obj + nodeId + &amp;#039;&amp;quot; src=&amp;quot;&amp;#039;;&lt;br /&gt;
			if (!this.config.useLines) str += (node._io) ? this.icon.nlMinus : this.icon.nlPlus;&lt;br /&gt;
			else str += ( (node._io) ? ((node._ls &amp;amp;&amp;amp; this.config.useLines) ? this.icon.minusBottom : this.icon.minus) : ((node._ls &amp;amp;&amp;amp; this.config.useLines) ? this.icon.plusBottom : this.icon.plus ) );&lt;br /&gt;
			str += &amp;#039;&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;#039;;&lt;br /&gt;
		} else str += &amp;#039;&amp;lt;img src=&amp;quot;&amp;#039; + ( (this.config.useLines) ? ((node._ls) ? this.icon.joinBottom : this.icon.join ) : this.icon.empty) + &amp;#039;&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;#039;;&lt;br /&gt;
	}&lt;br /&gt;
	return str;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Checks if a node has any children and if it is the last sibling&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.setCS = function(node) {&lt;br /&gt;
	var lastId;&lt;br /&gt;
	for (var n=0; n&amp;lt;this.aNodes.length; n++) {&lt;br /&gt;
		if (this.aNodes[n].pid == node.id) node._hc = true;&lt;br /&gt;
		if (this.aNodes[n].pid == node.pid) lastId = this.aNodes[n].id;&lt;br /&gt;
	}&lt;br /&gt;
	if (lastId==node.id) node._ls = true;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Returns the selected node&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.getSelected = function() {&lt;br /&gt;
	var sn = this.getCookie(&amp;#039;cs&amp;#039; + this.obj);&lt;br /&gt;
	return (sn) ? sn : null;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Highlights the selected node&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.s = function(id) {&lt;br /&gt;
	if (!this.config.useSelection) return;&lt;br /&gt;
	var cn = this.aNodes[id];&lt;br /&gt;
	if (cn._hc &amp;amp;&amp;amp; !this.config.folderLinks) return;&lt;br /&gt;
	if (this.selectedNode != id) {&lt;br /&gt;
		if (this.selectedNode || this.selectedNode==0) {&lt;br /&gt;
			eOld = document.getElementById(&amp;quot;s&amp;quot; + this.obj + this.selectedNode);&lt;br /&gt;
			eOld.className = &amp;quot;node&amp;quot;;&lt;br /&gt;
		}&lt;br /&gt;
		eNew = document.getElementById(&amp;quot;s&amp;quot; + this.obj + id);&lt;br /&gt;
		eNew.className = &amp;quot;nodeSel&amp;quot;;&lt;br /&gt;
		this.selectedNode = id;&lt;br /&gt;
		if (this.config.useCookies) this.setCookie(&amp;#039;cs&amp;#039; + this.obj, cn.id);&lt;br /&gt;
	}&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Toggle Open or close&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.o = function(id) {&lt;br /&gt;
	var cn = this.aNodes[id];&lt;br /&gt;
	this.nodeStatus(!cn._io, id, cn._ls);&lt;br /&gt;
	cn._io = !cn._io;&lt;br /&gt;
	if (this.config.closeSameLevel) this.closeLevel(cn);&lt;br /&gt;
	if (this.config.useCookies) this.updateCookie();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Open or close all nodes&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.oAll = function(status) {&lt;br /&gt;
	for (var n=0; n&amp;lt;this.aNodes.length; n++) {&lt;br /&gt;
		if (this.aNodes[n]._hc &amp;amp;&amp;amp; this.aNodes[n].pid != this.root.id) {&lt;br /&gt;
			this.nodeStatus(status, n, this.aNodes[n]._ls)&lt;br /&gt;
			this.aNodes[n]._io = status;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	if (this.config.useCookies) this.updateCookie();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Opens the tree to a specific node&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.openTo = function(nId, bSelect, bFirst) {&lt;br /&gt;
	if (!bFirst) {&lt;br /&gt;
		for (var n=0; n&amp;lt;this.aNodes.length; n++) {&lt;br /&gt;
			if (this.aNodes[n].id == nId) {&lt;br /&gt;
				nId=n;&lt;br /&gt;
				break;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	var cn=this.aNodes[nId];&lt;br /&gt;
	if (cn.pid==this.root.id || !cn._p) return;&lt;br /&gt;
	cn._io = true;&lt;br /&gt;
	cn._is = bSelect;&lt;br /&gt;
	if (this.completed &amp;amp;&amp;amp; cn._hc) this.nodeStatus(true, cn._ai, cn._ls);&lt;br /&gt;
	if (this.completed &amp;amp;&amp;amp; bSelect) this.s(cn._ai);&lt;br /&gt;
	else if (bSelect) this._sn=cn._ai;&lt;br /&gt;
	this.openTo(cn._p._ai, false, true);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Closes all nodes on the same level as certain node&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.closeLevel = function(node) {&lt;br /&gt;
	for (var n=0; n&amp;lt;this.aNodes.length; n++) {&lt;br /&gt;
		if (this.aNodes[n].pid == node.pid &amp;amp;&amp;amp; this.aNodes[n].id != node.id &amp;amp;&amp;amp; this.aNodes[n]._hc) {&lt;br /&gt;
			this.nodeStatus(false, n, this.aNodes[n]._ls);&lt;br /&gt;
			this.aNodes[n]._io = false;&lt;br /&gt;
			this.closeAllChildren(this.aNodes[n]);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Closes all children of a node&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.closeAllChildren = function(node) {&lt;br /&gt;
	for (var n=0; n&amp;lt;this.aNodes.length; n++) {&lt;br /&gt;
		if (this.aNodes[n].pid == node.id &amp;amp;&amp;amp; this.aNodes[n]._hc) {&lt;br /&gt;
			if (this.aNodes[n]._io) this.nodeStatus(false, n, this.aNodes[n]._ls);&lt;br /&gt;
			this.aNodes[n]._io = false;&lt;br /&gt;
			this.closeAllChildren(this.aNodes[n]);		&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Change the status of a node(open or closed)&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.nodeStatus = function(status, id, bottom) {&lt;br /&gt;
	eDiv	= document.getElementById(&amp;#039;d&amp;#039; + this.obj + id);&lt;br /&gt;
	eJoin	= document.getElementById(&amp;#039;j&amp;#039; + this.obj + id);&lt;br /&gt;
	if (this.config.useIcons) {&lt;br /&gt;
		eIcon	= document.getElementById(&amp;#039;i&amp;#039; + this.obj + id);&lt;br /&gt;
		eIcon.src = (status) ? this.aNodes[id].iconOpen : this.aNodes[id].icon;&lt;br /&gt;
	}&lt;br /&gt;
	eJoin.src = (this.config.useLines)?&lt;br /&gt;
	((status)?((bottom)?this.icon.minusBottom:this.icon.minus):((bottom)?this.icon.plusBottom:this.icon.plus)):&lt;br /&gt;
	((status)?this.icon.nlMinus:this.icon.nlPlus);&lt;br /&gt;
	eDiv.style.display = (status) ? &amp;#039;block&amp;#039;: &amp;#039;none&amp;#039;;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// [Cookie] Clears a cookie&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.clearCookie = function() {&lt;br /&gt;
	var now = new Date();&lt;br /&gt;
	var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);&lt;br /&gt;
	this.setCookie(&amp;#039;co&amp;#039;+this.obj, &amp;#039;cookieValue&amp;#039;, yesterday);&lt;br /&gt;
	this.setCookie(&amp;#039;cs&amp;#039;+this.obj, &amp;#039;cookieValue&amp;#039;, yesterday);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// [Cookie] Sets value in a cookie&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.setCookie = function(cookieName, cookieValue, expires, path, domain, secure) {&lt;br /&gt;
	document.cookie =&lt;br /&gt;
		escape(cookieName) + &amp;#039;=&amp;#039; + escape(cookieValue)&lt;br /&gt;
		+ (expires ? &amp;#039;; expires=&amp;#039; + expires.toGMTString() : &amp;#039;&amp;#039;)&lt;br /&gt;
		+ (path ? &amp;#039;; path=&amp;#039; + path : &amp;#039;&amp;#039;)&lt;br /&gt;
		+ (domain ? &amp;#039;; domain=&amp;#039; + domain : &amp;#039;&amp;#039;)&lt;br /&gt;
		+ (secure ? &amp;#039;; secure&amp;#039; : &amp;#039;&amp;#039;);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// [Cookie] Gets a value from a cookie&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.getCookie = function(cookieName) {&lt;br /&gt;
	var cookieValue = &amp;#039;&amp;#039;;&lt;br /&gt;
	var posName = document.cookie.indexOf(escape(cookieName) + &amp;#039;=&amp;#039;);&lt;br /&gt;
	if (posName != -1) {&lt;br /&gt;
		var posValue = posName + (escape(cookieName) + &amp;#039;=&amp;#039;).length;&lt;br /&gt;
		var endPos = document.cookie.indexOf(&amp;#039;;&amp;#039;, posValue);&lt;br /&gt;
		if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));&lt;br /&gt;
		else cookieValue = unescape(document.cookie.substring(posValue));&lt;br /&gt;
	}&lt;br /&gt;
	return (cookieValue);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// [Cookie] Returns ids of open nodes as a string&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.updateCookie = function() {&lt;br /&gt;
	var str = &amp;#039;&amp;#039;;&lt;br /&gt;
	for (var n=0; n&amp;lt;this.aNodes.length; n++) {&lt;br /&gt;
		if (this.aNodes[n]._io &amp;amp;&amp;amp; this.aNodes[n].pid != this.root.id) {&lt;br /&gt;
			if (str) str += &amp;#039;.&amp;#039;;&lt;br /&gt;
			str += this.aNodes[n].id;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	this.setCookie(&amp;#039;co&amp;#039; + this.obj, str);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// [Cookie] Checks if a node id is in a cookie&lt;br /&gt;
&lt;br /&gt;
dTree.prototype.isOpen = function(id) {&lt;br /&gt;
	var aOpen = this.getCookie(&amp;#039;co&amp;#039; + this.obj).split(&amp;#039;.&amp;#039;);&lt;br /&gt;
	for (var n=0; n&amp;lt;aOpen.length; n++)&lt;br /&gt;
		if (aOpen[n] == id) return true;&lt;br /&gt;
	return false;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// If Push and pop is not implemented by the browser&lt;br /&gt;
&lt;br /&gt;
if (!Array.prototype.push) {&lt;br /&gt;
	Array.prototype.push = function array_push() {&lt;br /&gt;
		for(var i=0;i&amp;lt;arguments.length;i++)&lt;br /&gt;
			this[this.length]=arguments[i];&lt;br /&gt;
		return this.length;&lt;br /&gt;
	}&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
if (!Array.prototype.pop) {&lt;br /&gt;
	Array.prototype.pop = function array_pop() {&lt;br /&gt;
		lastElement = this[this.length-1];&lt;br /&gt;
		this.length = Math.max(this.length-1,0);&lt;br /&gt;
		return lastElement;&lt;br /&gt;
	}&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/javascript&amp;gt;&lt;/div&gt;</summary>
		<author><name>Woozle</name></author>
	</entry>
</feed>