//image sources for mouseover effect, called by the template file
image_portfolio = new Image();
image_portfolio.src = "/images/template/ieg_masthead_nav_portf_mo.jpg";

image_career = new Image();
image_career.src = "/images/template/ieg_masthead_nav_contact_mo.jpg";

image_about = new Image();
image_about.src = "/images/template/ieg_masthead_nav_about_mo.jpg";

var timer=null;

function SwitchWidget(obj)
{
	
	if (timer != null)
	{
		clearTimeout(timer);
	}
	if(document.getElementById)
	{
		var x = obj;
		var ar = document.getElementById("tabFrame").getElementsByTagName("div");
		
	
		for (var i=0; i<ar.length; i++)
		{
			if (ar[i].className == "toggle")
			{
				if (ar[i].id == x)
				{
					pauseComp(500);
					
					ar[i].style.display = "block";
				}
				else
				{
					ar[i].style.display = "none";
				}
			}
		}
		
	}
	timer = setTimeout("hideMenu()", 5000);
	
}



//a function just delay the menu switch in half a second
function pauseComp(millis)
{
	date = new Date();
	var curDate = null;
	
	do { var curDate = new Date(); } 
	while(curDate-date < millis);
}

function cancelTimer()
{
	if (timer != null)
	{
		clearTimeout(timer);
	}
}


function hideMenu()
{
	var ar = document.getElementById("tabFrame").getElementsByTagName("div");

		
		for (var i=0; i<ar.length; i++)
		{
			if (ar[i].className == "toggle")
			{
				ar[i].style.display = "none";
			}
		}
		if (timer != null)
		{
			clearTimeout(timer);
		}
}

