activeLayer = 0;

function switchLayerVisibility(index)
{
    var layer;
    for(i=0;i<map.GetShapeLayerCount();i++)
    {
        layer = map.GetShapeLayerByIndex(i);
        layer.Hide(); 
    }
}

function show(div,section)
{
	switch(section)
	{
		case "breakfast":
			k=7;
			break;
			
		case "dimsum":
			k=7;
			break;
			
			case "dimsumnew":
				k=4;
				break;
				
		case "drinks":
			k=10;
			break;
			
		case "foodspecials":
			k=1;
			break;
	}
	

	for(i=1;i<(k+1);i++)
    {
		divHeader = "menuItem" + i + "Header";
		divContent = "menuItem" + i + "Content";
		document.getElementById(divContent).setAttribute("class","hidden");
		document.getElementById(divContent).setAttribute("className","hidden");
		/*
		if((i==8) && (section=="dimsum"))
		{
			hoverOff("menuItem8Header",'Grey');
		}
		else if((i==9) && (section=="dimsum"))
		{
			hoverOff("menuItem9Header",'Pink');
		}
		else
		{*/
			hoverOff(divHeader,'Blue');
		//}
    }
	
	divHeader = "menuItem" + div + "Header";
	divContent = "menuItem" + div + "Content";
	
	//If this is not the current active layer show the new one otherwise everything stays colapsed
	if(div != activeLayer)
	{
		//set the current active layer.
		activeLayer = div;
	/*
		if((div=="menuItem8") && (section=="dimsum"))
		{
			document.getElementById(divHeader).setAttribute("class","menuTitleHeaderGreyOn");
			document.getElementById(divHeader).setAttribute("className","menuTitleHeaderGreyOn");
			document.getElementById(divContent).setAttribute("class","menuContents visible");
			document.getElementById(divContent).setAttribute("className","menuContents visible");
		}else if((div=="menuItem9") && (section=="dimsum"))
		{
			document.getElementById(divHeader).setAttribute("class","menuTitleHeaderPinkOn");
			document.getElementById(divHeader).setAttribute("className","menuTitleHeaderPinkOn");
			document.getElementById(divContent).setAttribute("class","menuContents visible");
			document.getElementById(divContent).setAttribute("className","menuContents visible");
		}else
		{*/
			document.getElementById(divHeader).setAttribute("class","menuTitleHeaderBlueOn");
			document.getElementById(divHeader).setAttribute("className","menuTitleHeaderBlueOn");
			document.getElementById(divContent).setAttribute("class","menuContents visible");
			document.getElementById(divContent).setAttribute("className","menuContents visible");
		//}
	}else
	{
		//Other wise set no active layers
		activeLayer = 0;
	}
}
function hoverOn(div,color)
{
	document.getElementById(div).setAttribute("class","menuTitleHeader" + color +"Over");
	document.getElementById(div).setAttribute("className","menuTitleHeader" + color +"Over");
}
function hoverOff(div,color)
{
	document.getElementById(div).setAttribute("class","menuTitleHeader" + color +"Off");
	document.getElementById(div).setAttribute("className","menuTitleHeader" + color +"Off");
}


function hideAll(section)
{
	
	//Set the number of layers to hide in each section
	switch(section)
	{
		case "breakfast":
			k=7;
			break;
		case "dimsum":
			k=7;
			break;
			case "dimsumnew":
				k=8;
				break;
		case "drinks":
			k=10;
			break;
			case "party":
			k=2;
			break;
		case "foodspecials":
			k=1;
			break;
	}
	//Hide every layer on the page.
	for(i=1;i<(k+1);i++)
    {
		divContent = "menuItem" + i + "Content";
		document.getElementById(divContent).setAttribute("class","hidden");
		document.getElementById(divContent).setAttribute("className","hidden");
    }
}

function dosIFR()
{
		sIFR.replaceElement("h3", "heart.swf", "#FFFFFF", "#000000", "#000000", "#000000", 0, 0, 0, 0);
}