/*
	Copyright (c) 2004 Ned Martin
	http://copyright.the-i.org/
	Unless otherwise stated.

	JavaScript for jianshe.com.au

	09-DEC-2004
*/

// modified from http://www.alistapart.com/articles/dropdowns/
// shows hidden nested list menus
menuList = function()
{
	// IE only
	if (document.all && document.getElementById)
	{
		// get div.menu
		divMenu = document.getElementById("menu");

		// loop through all child elements of div.menu
		for (i = 0; i < divMenu.childNodes.length; i++)
		{
			ulNode = divMenu.childNodes[i];

			// if the element is ul
			if (ulNode.nodeName=="UL")
			{
				// loop through all child nodes of div.menu ul
				for (j = 0; j < ulNode.childNodes.length; j++)
				{
					node = ulNode.childNodes[j];

					// if the node is a div.menu ul li
					if (node.nodeName=="LI")
					{
						// add mouse events
						node.onmouseover = function()
						{
							this.className+=" show";
						}
						node.onmouseout=function()
						{
							this.className=this.className.replace(" show", "");
						}
					}
				}
			}
		}
	}
}
//window.onload = menuList;


// Clear input boxes
function clr(fieldID)
{
	if (fieldID.defaultValue==fieldID.value) fieldID.value = "";
	else if (fieldID.value == "") fieldID.value = fieldID.defaultValue
}

/*
 * Write an email link
 *
 * Accepts two parameters, the name part of the email before the at symbol
 * and the host part after the at symbol.
 */
function mail(name, host)
{
	document.write ("<a href=\"mailto:" + name + "@" + host + "\" title=\"Email " + name + "\">" + name + "@" + host + "</a>");
}