/// Functions to show and hide sub navigation bars
var timeout,subnav;




function initSubnav(){
	// initialize sub nav elements
	subnav = new Array("company","products","news","support","contact");
}
	
function show(obj){
	// hide all sub navs
	hideAll(obj);
	// get the name of nav image associated with sub menu	
	img = obj + "header";
		
	// show selected sub nav
	if(obj){
		obj = getStyleObj(obj);
		obj.visibility = (document.layers) ? "show" : "visible";
	}
	
	// show selected nav
	document.images[img].src = menuon[img].src;
}




function hide(){
	// after 250ms timeout, hide all nav items
	timeout = setTimeout("hideAll('');",250);
}




function hideAll(exclude){
	// clear any existing timeouts
	clearTimeout(timeout);
		
	// hide all sub navs
	if(subnav){
		for(i = 0; i < subnav.length; i++){
			if(exclude != subnav[i]){
				var obj = getStyleObj(subnav[i]);
				obj.visibility = (document.layers) ? "hide" : "hidden";
			}
		}
	}
	
	// hide all navs
	headerexclude = exclude + 'header';
	for(i=0; i < nav.length; i++){
		var img = nav[i];
		if(headerexclude != img){
			document.images[img].src = menuoff[img].src;
		}
	}
}
