if (document.images) { 
	var images = new Array ("nav_glb_promotions","nav_glb_savings","nav_glb_tips","nav_glb_brand","nav_0_0_mot","nav_0_0_pep","nav_0_0_tyl","nav_0_0_imo","nav_0_0_myl","nav_0_0_stj","nav_0_0_myi","nav_0_0_via","nav_0_0_lac");
	var ImageObjects = new Array(); 
	for (i = 0; i < images.length; i++) { 
		name = images[i]; 
		ImageObjects[name] = new ImageObject(name); 
	} 
}

function ImageObject(name) { 
	this.on = new Image; 
	this.on.src = "http://www.healthzone365espanol.com/enes/images/healthzone365/"+ name + "_on.gif"; 
	this.off = new Image; 
	this.off.src = "http://www.healthzone365espanol.com/enes/images/healthzone365/" + name + "_off.gif"; 
} 

function rollover(imageName, status) { 
	eval("document." + imageName + ".src = ImageObjects[imageName]." + status + ".src"); 
	if (imageName == "nav_glb_brand") {
		if (status == "on") {
			rolloverBVList('on','visible');
		} else {
			rolloverBVList('off','hidden');
		}
	}
}

function positionBrandValues(status) {
	if (document.body.clientWidth < 740) {
		document.getElementById('divBrandValues').style.left = 558;
		document.getElementById('divBrandValuesShadow').style.left = 734;
		for (x=1; x<10; x++) {
			document.getElementById('divBrandValues' + x).style.left = 354;
		}
	} else {
		document.getElementById('divBrandValues').style.left = ((document.body.clientWidth - 740)/2)+558;
		document.getElementById('divBrandValuesShadow').style.left = ((document.body.clientWidth - 740)/2)+734;
		for (x=1; x<10; x++) {
			document.getElementById('divBrandValues' + x).style.left = ((document.body.clientWidth - 740)/2)+354;
		}
	}
	document.getElementById('divBrandValues').style.visibility = status;
}

function rolloverBVList(status, showhide) {
	eval("document.nav_glb_brand.src = ImageObjects['nav_glb_brand']." + status + ".src"); 
	document.getElementById('divBrandValues').style.visibility = showhide;
	document.getElementById('divBrandValuesShadow').style.visibility = showhide;
}

function rolloverBV(imageName, status, brandValue) {
	eval("document." + imageName + ".src = ImageObjects[imageName]." + status + ".src");
	if (status == "on") {
		document.getElementById('divBrandValues' + brandValue).style.visibility = "visible";
	} else {
		document.getElementById('divBrandValues' + brandValue).style.visibility = "hidden";
	}
}

function positionProducts() {
	if (document.body.clientWidth < 740) {
		for (x=1; x<7; x++) {
			document.getElementById('divProductCopy' + x).style.left = 4;
		}
	} else {
		for (x=1; x<7; x++) {
			document.getElementById('divProductCopy' + x).style.left = ((document.body.clientWidth - 740)/2)+4;
		}
	}
}

function rolloverProduct(whichProduct, status) {
	document.getElementById('divProductCopy' + whichProduct).style.visibility = status;
}

function openWin(theURL, windowName, features) {
	newWin = window.open(theURL, windowName, features);
	newWin.focus();
}

// code for the winterize pages, showing and hiding the 4 tabs
dd=document;NS=(dd.layers)?1:0;IE=(dd.all)?1:0;DOM=(dd.getElementById)?1:0 
function showLayer(L){ 
if(NS)dd.layers[L].display='show'; 
else if (IE)obg=dd.all[L]; 
else obg=dd.getElementById(L); 
if(!NS)obg.style.display='block' 
}

function hideLayer(L){ 
if(NS)dd.layers[L].display='hide'; 
else if (IE)obg=dd.all[L]; 
else obg=dd.getElementById(L); 
if(!NS)obg.style.display='none' 
}

function DivTip1()
{
showLayer('Tip1')
hideLayer('Tip2')
hideLayer('Tip3')
hideLayer('Tip4')
}

function DivTip2()
{
hideLayer('Tip1')
showLayer('Tip2')
hideLayer('Tip3')
hideLayer('Tip4')
}

function DivTip3()
{
hideLayer('Tip1')
hideLayer('Tip2')
showLayer('Tip3')
hideLayer('Tip4')
}

function DivTip4()
{
hideLayer('Tip1')
hideLayer('Tip2')
hideLayer('Tip3')
showLayer('Tip4')
}

//////////////////////Page Switching /////////////////////////

function showPage(location){	
	switch (location){
		case "headache":
			DivTip1();
			break;
		case "heartburn":
			DivTip2();
			break;
		case "allergies":
			DivTip3();
			break;
		case "colds":
			DivTip4();
			break;
	}
	
}