// JavaScript Document

var Height = 30;
var HeightOther = 0;
var Width = 0;
var Padding = 8;
var firstRun = true;
var Growing = false;
var Element;
var requestS = false;
var requestG = false;
var Shrinking = true;
var PreviousElement;
var FirstElement;

var CurrentNum = new String();
var VideoNum = new String();
var VideoHTML = new Array();
function Grow(Input)
{
	if(firstRun)
	{
		Element = Input;
		firstRun = false;
		Growing = true;
	}
	if(Growing)
	{
		if(requestS)
		{
			requestS = false;
			Growing = false;
			Shrink();
		}
		else
		{
			requestG = false;
			if (Element.offsetHeight != 150)
				Element.style.height = Element.offsetHeight + 2 + "px";
			
			if (Element.offsetHeight < 150)
				setTimeout("Grow()",10);
				
			else
			{
				Growing = false;
			}
		}
	}
	else
		requestG = true;
}
function Shrink(Input)
{
	if (!Growing)
	{
		if (requestG)
		{
			Growing = true;
			requestG = false;
			Grow();
		}
		else
		{
			requestS = false;
			var Temp = Element.offsetHeight;
			Temp = Temp - 2;
			Element.style.height = Temp + "px";
			
			if(Element.offsetHeight > Height)
			{
				if(Element.offsetHeight <= Height)
					Element.style.height = Height + "px";
				else
					setTimeout("Shrink()",10);
			}
			
			else
			{	
				Growing = true
			}
		}
	}
	else
		requestS = true;
}

function Init(Input)
{
	PreviousElement = Input;
	FirstElement = Input;
	FirstElement.style.backgroundColor = "#900";
	for(x = 1; x < 12; x++)
	{
		if (x !=2)
		{
			document.getElementById("Nav" + x).onmouseover =
			function() {
			Hover(this);
			}
			document.getElementById("Nav" + x).onmouseout = 
			function() {
			HoverOut(this);
			}
		}
	}
}

function Hover(Input)
{
	PreviousElement.style.backgroundColor = "#9c6318";
	Input.style.backgroundColor = "#900";
	PreviousElement = Input;
}
function HoverOut(Input)
{
	FirstElement.style.backgroundColor = "#900";
	if(Input!=FirstElement)
		Input.style.backgroundColor = "#9c6318";
	PreviousElement = FirstElement;
}



function InitializeWH()
{
	Width = document.documentElement.clientWidth;
	HeightOther = document.documentElement.clientHeight;
}
function DisplayVideo(Input)
{ 	 	
	 
	 var PDF = "menu-" + Input + ".pdf";
	 document.getElementById("Video1").innerHTML = "<embed src='" + PDF + "' height='500' width='906' id='PDF'> <div align='center' style='padding-top:5px;'><a href='" + PDF + "'>If the above link doesn't work click here to download the menu</a></div>";
	 
	 if( Width == 0 || HeightOther == 0)
	 	InitializeWH();	 
	 document.getElementById("MainContainer").style.visibility = "hidden";
	 document.getElementById("MainContainer").style.height = HeightOther + "px";
	 document.getElementById("MainContainer").style.width = 900 + "px";
	 document.getElementById("MainContainer").style.overflow = "hidden";
	 
	 document.getElementById("VideoContainer").style.height = HeightOther + "px";
	 document.getElementById("VideoContainer").style.width = Width + "px";	
	  	
	 document.getElementById("MainContainer").style.visibility = "visible";
	 document.getElementById("VideoContainer").style.visibility = "visible";
	 
	 document.getElementById("Video1").style.visibility = "visible";  
}

function HideVideo()
{
	 document.getElementById("MainContainer").style.height = "auto";
	 document.getElementById("MainContainer").style.overflow = "visible";
	 
	 document.getElementById("VideoContainer").style.height = 0 + "px";
	 document.getElementById("VideoContainer").style.width = 0 + "px";
	 document.getElementById("VideoContainer").style.visibility = "hidden";
	 document.getElementById("Video1").innerHTML = "";
	 document.getElementById("Video1").style.visibility = "hidden";
}
