

/*
function below decorates the html to add javascript events to show the sub navigation mouseovers in ie

the pure css2 code (li > ul, li:hover etc.) will work in standards compliant browsers 
(mozilla 1+, netscape 7+, opera 7+ etc.) but not ie, ie5+ (win/mac) is fixed up by the code below

much ameneded from ideas at: 
	http://www.alistapart.com/articles/horizdropdowns/
	http://www.howtocreate.co.uk/tutorials/testMenu.html
	http://www.brothercake.com/scripts/navmeister/page.php
*/


function decorateList()
{
	// see if we are in ie/win
	if (document.all && document.getElementById) 
	{
		// find the parent list by id and check node name (note: dom always returns this in uppercase)
		root = document.getElementById("navigation").getElementsByTagName("UL")[0];

		// loop through the child nodes adding mouse events
		for (i=0; i<root.childNodes.length; i++)			
			addEvents(root.childNodes[i]);
	}
}

function addEvents(node)
{
	if (node.nodeName=="LI") 
	{
		// add a mouseover function
		node.onmouseover= function() {
			// change display of child list
			for(var x=0; this.childNodes[x]; x++)
				if(this.childNodes[x].nodeName == 'UL' ) {this.childNodes[x].className += " toshow";}
		}
		
		// add a mouseout function
		node.onmouseout=function() {
			// change display of child list
			for(var x=0; this.childNodes[x]; x++)
			{
				if(this.childNodes[x].nodeName == 'UL' ) {this.childNodes[x].className = this.childNodes[x].className.replace(" toshow", "");}
			}
		}
	}
}




/* ends */

