var prodTimerId = 0;

function onProdSubMouseover(index)
{
	//alert("dash" + (parseInt(index)-1));

	if (document.getElementById("dash" + index) != null)
		document.getElementById("dash" + index).style.visibility = "hidden";

	if (document.getElementById("dash" + (parseInt(index)-1)) != null)
		document.getElementById("dash" + (parseInt(index)-1)).style.visibility = "hidden";

	if (index == '1')
		showProdSubNav();

}

function onProdSubMouseout(index)
{
	if (document.getElementById("dash" + index) != null)
		document.getElementById("dash" + index).style.visibility = "visible";

	if (document.getElementById("dash" + (parseInt(index)-1)) != null)
		document.getElementById("dash" + (parseInt(index)-1)).style.visibility = "visible";

	if (index == '1')
		hideProdSubNav();

}

function showProdSubNav()
{
	clearTimeout(prodTimerId);
	document.getElementById("prod-subnav").style.display = "block";
	document.getElementById("prod-nav-item1").className = "background-selected";
}

function hideProdSubNav()
{
	prodTimerId = setTimeout("hideProdSubNavTimer()", 300 );

}

function hideProdSubNavTimer()
{
	//alert("hello");
	document.getElementById("prod-subnav").style.display = "none";
	pathArray = window.location.pathname.split( '/' );

	if (pathArray.length < 1 || (pathArray[1] != 'frozen-meals' && prodSubNavItem !='frozen-meals'))
		document.getElementById("prod-nav-item1").className = "background-unselected";
}