//displays the first ul in the container when called in rollover script init()
function navOn(temp) {	
	//safe function to show an element with a specified id
	
	try {
		
	
	var x;
	x=temp.getElementsByTagName('ul');
	
	if(x[0]){x[0].style.display = 'block';}

	var y;
	y=temp.getElementsByTagName('a');

	if(y[0]) y[0].className = "navIsOn";

	} catch (e) { alert(e); }
}

//displays the first ul in the container when called in rollover script init()
function navOff(temp) {
	try
	{
		
	//safe function to hide an element with a specified id
	var x;
	x=temp.getElementsByTagName('ul');
	if(x[0]){x[0].style.display = 'none';}
	
	var y;
	y=temp.getElementsByTagName('a');

	if(y[0]) y[0].className = "";

	}
	catch(e) { alert(e); }
}

//loads the onmouseover/onmouseout actions onto all the nav elements
function navInit(){
	
	//try {
	
	$("#topnav").find("li").each(function(item){
	    $(this).mouseover(function () {navOn(this);});
	    $(this).mouseout(function () {navOff(this);});
	});
//	x = document.getElementById('topnav').getElementsByTagName('li');
//	if(x){
//    for (var i=0;i<x.length;i++)
//	{
//	    x[i].onmouseover = function () {navOn(this);}
//		x[i].onmouseout = function () {navOff(this);}
//	}
//  
	//} catch (e) { alert(e); }

}
