// Preload Rollovers
if (document.images)
{
  pic1 = new Image(180,175); 
  pic1.src="images/structure/products/p_nav_benefits_on.gif"; 

  pic2 = new Image(180,95); 
  pic2.src="images/structure/products/p_nav_benefits.gif";
  
  pic3 = new Image(180,175); 
  pic3.src="images/structure/products/p_nav_guide_on.gif"; 

  pic4 = new Image(180,95); 
  pic4.src="images/structure/products/p_nav_guide.gif";
  
  pic5 = new Image(180,175); 
  pic5.src="images/structure/products/p_nav_recipe_on.gif"; 

  pic6 = new Image(180,95); 
  pic6.src="images/structure/products/p_nav_recipe.gif";
  
  pic7 = new Image(180,345); 
  pic7.src="images/structure/products/p_nav_browse_on.jpg"; 

  pic8 = new Image(180,95); 
  pic8.src="images/structure/products/p_nav_browse.jpg";
  
  pic9 = new Image(330,15); 
  pic9.src="images/structure/products/curved_b.gif";
  
  pic10 = new Image(330,15); 
  pic10.src="images/structure/products/curved_t.gif";
  
  pic11 = new Image(330,10); 
  pic11.src="images/structure/products/strip.gif";
  
  pic12 = new Image(13,19); 
  pic12.src="images/structure/products/pointer.gif";
  
  pic13 = new Image(15,22); 
  pic13.src="images/structure/products/pointer2.gif";
}

var timerID = null;
var timerOn = false;
var timecount = 500;

var timerIDMain = null;
var timecountMain = 700;

var productMenuOn = false;

var imgPath = 'images/structure/products/';

var browser=navigator.appName
var b_version=navigator.appVersion
var version=parseFloat(b_version)

// Highlight image
function p_On(z) {
	if (ie6) {
		document.getElementById("product_" + z).style.cursor = "pointer";
	}
	else {
		document.getElementById("product_" + z).style.backgroundImage = "url(" + imgPath + "p_nav_" + z + "_on.gif)";
		document.getElementById("product_" + z).style.height = "175px";
		document.getElementById("product_" + z).style.cursor = "pointer";
		document.getElementById(z + "_img").style.margin = "83px 0 0 3px";
		//productOff();
	}	
}
// Turn off image highlight
function p_Off(z) {
	if (ie6) {
		document.getElementById("product_" + z).style.cursor = "default";
	}
	else {
		document.getElementById("product_" + z).style.backgroundImage = "url(" + imgPath + "p_nav_" + z + ".gif)";
		document.getElementById("product_" + z).style.height = "95px";
		document.getElementById("product_" + z).style.cursor = "default";
		document.getElementById(z + "_img").style.margin = "3px 0 0 3px";
	}
}

// Show Products Menu
function productOn() {
	if(productMenuOn == false) {
	stopTime();
	document.getElementById("product_browse").style.backgroundImage = "url(" + imgPath + "p_nav_browse_on.jpg)";
	document.getElementById("product_browse").style.height = "345px";
	document.getElementById("p_menu_list").style.display = "block";
	document.getElementById("product_browse").style.cursor = "pointer";
	productMenuOn = true;
	}
}
function productOff() {
	if(document.location.href.indexOf("product_detail")==-1)
	{
		subHide();
		document.getElementById("product_browse").style.backgroundImage = "url(" + imgPath + "p_nav_browse.jpg)";
		document.getElementById("product_browse").style.height = "95px";
		document.getElementById("p_menu_list").style.display = "none";
		document.getElementById("product_browse").style.cursor = "hand";
		productMenuOn = false;
	}
}

// Show Subnav
function subOn(id) {
	stopTime();
	subHide();
	document.getElementById("pointer_" + id).style.display = "block";
	document.getElementById("p_" + id).style.display = "block";
	
}

// Set Subnav Off
function subOff(id) {

	document.getElementById("pointer_" + id).style.display = "none";
	document.getElementById("p_" + id).style.display = "none";
	
}

function subHide() {
	subOff('diced');
	subOff('whole');
	subOff('stewed');
	subOff('crushed');
	subOff('puree');
	subOff('sauce');
	subOff('paste');
	subOff('s_sauce');
}

function startTime() {
	if (timerOn == false) {
	timerID=setTimeout( "subHide()" , timecount);
	timerIDMain=setTimeout( "productOff()" , timecountMain);
	timerOn = true;
	}
}

function stopTime() {
	if (timerOn) {
	clearTimeout(timerID);
	clearTimeout(timerIDMain);
	timerID = null;
	timerIDMain = null;
	timerOn = false;
	}
}
