//------------------------------------------
// set the var for getElementByClass function
var currentMenu = '';

//-------------------------------------------
// Show sub menu, hide others
function ShowSubMenu(d) {
	HideSubMenu();
	document.getElementById(d).style.display = "inline";
	getElementByClass(d);		
}
//-------------------------------------------
// hide sub menus with slight delay
function HideSubMenu2() {
setTimeout('HideSubMenu()',1000);
}
//-------------------------------------------
// Hide sub menus 
function HideSubMenu() {
	document.getElementById('kitchenMenu').style.display = "none";
	document.getElementById('tableMenu').style.display = "none";
	document.getElementById('chefMenu').style.display = "none";	
	if(currentMenu!='') { currentMenu.style.color='#fff'; currentMenu.style.background='none'; }
}
//--------------------------------------------
// special function to find a class dynamically
// use to style the main menu when active
/* getElementByClass */
var allHTMLTags = new Array();    
function getElementByClass(theClass) {

    //Create Array of All HTML Tags
    var allHTMLTags=document.getElementsByTagName('*');

    //Loop through all tags using a for loop
    for (i=0; i<allHTMLTags.length; i++) {
    	//Get all tags with the specified class name.
    	if (allHTMLTags[i].className==theClass) {
    		allHTMLTags[i].style.background='#f3d4a1';
    		allHTMLTags[i].style.color='#555753';
    		currentMenu = allHTMLTags[i];
    	}    
    }    
}
//-------------------------------------------
