/*
aqtree3clickable.js

Converts an unordered list to an explorer-style tree, with clickable
icons

To make this work, simply add one line to your HTML:
<script type="text/javascript" src="aqtree3clickable.js"></script>

and then make the top UL of your nested unordered list of class
"aqtree3clickable".

That's it. No registration function, nothing.

http://www.kryogenix.org/code/browser/aqlists/

Stuart Langridge, November 2002
sil@kryogenix.org

Inspired by Aaron's labels.js (http://youngpup.net/demos/labels/) and Dave Lindquist's menuDropDown.js (http://www.gazingus.org/dhtml/?id=109)

*****************************************
Modified for use by Elizabethtown College
Date: March 11, 2005
*****************************************
*/

InitializeTags();

//Sets the onclick event of the nodes
function InitializeTags()
{
	var a = document.getElementsByTagName("a");
	var i
	var temp
	
	for ( i=0; i < a.length; i++ )
	{
		temp = a[i];

		if ( temp.name == '+' )
		{
			//Sets the onclick event
			temp.onclick = function ()
			{
				//Toggles the icons
				if ( this.parentNode.className == 'aq3open' )
					this.parentNode.className = "aq3closed"
				else if ( this.parentNode.className == 'aq3closed' )
					this.parentNode.className = "aq3open"
			}
		}
	}
}

//Expends all of the nodes
function expandTreesC()
{
	lis = document.getElementsByTagName("li");
	for (uli=0;uli<lis.length;uli++)
	{
		li = lis[uli];
		if (li.nodeName == "LI" && li.className == 'aq3closed')
		{
			li.className = 'aq3open'
		}
	}
}

//Closes all of the nodes
function collapseTreesC()
{
	lis = document.getElementsByTagName("li");
	for (uli=0;uli<lis.length;uli++)
	{
		li = lis[uli];
		if (li.nodeName == "LI" && li.className == 'aq3open')
		{
			li.className = 'aq3closed'
		}
	}
}