function toggleContent(id){
	// Hide all sub menus
	var div 	 = document.getElementById("menu");
	div				 = div.getElementsByTagName("div")
	for(var i=0; i<div.length; i++){
		// Hide all sub menus apart from the id of the item clicked (is hidden in the 2nd phase)
		if(div[i].id.indexOf(id) == -1)	div[i].className = "hide";
		// Extract the id of the parent tag i.e. id of div tag minus "-sub-menu"
		var parent = div[i].id.substring(0, div[i].id.indexOf("-sub-menu"));
		parent = document.getElementById(parent);
		// Remove the background styles
		parent.style.backgroundColor = "#8B8B79";
	}
	
	// Show the selected sub menu
	div 	 = document.getElementById(id + "-sub-menu");
	parent = document.getElementById(id);
	if(div.className == "hide"){
		div.className = "show";
		parent.style.backgroundColor = "#585850";
	} else {
		div.className = "hide";
	}
}


function addMenuRollovers(divId, overColor, outColor){ // Add menu rollover styles for IE
	var divArea, liTags;
	divArea = document.getElementById(divId);
	liTags	= divArea.getElementsByTagName("li");	
	for(var i=0; i<liTags.length; i++){
		liTags[i].onmouseover = function(){this.style.backgroundColor = overColor}
		liTags[i].onmouseout = function(){this.style.backgroundColor = outColor}
	}		
}

window.onload=function(){
	addMenuRollovers("menu", "#585850", "#8B8B79");
	addMenuRollovers("services-sub-menu", "#D6D6B5", "#EAEAC4");
	addMenuRollovers("products-sub-menu", "#D6D6B5", "#EAEAC4");	
}