/* Top Navigation Rollover and Rolloff script */

function nav_on(menuObject,imageName) {
	menuObject.src='/pt_BR/images/nav/nav_'+imageName+'_on.gif';							
}
function nav_off(menuObject,imageName) {
	menuObject.src='/pt_BR/images/nav/nav_'+imageName+'_off.gif';							
}

/* Home page randomo image */

function showBG() {
	
		if (document.getElementById) {
			bgObj = document.getElementById('content_home');
			randomNum = Math.floor((Math.random() * 3));
			theUrl = '/pt_BR/images/accent_h' + randomNum + '.jpg';
			bgObj.style.backgroundImage = 'url(/pt_BR/images/accent_h' + randomNum + '.jpg)';
		}
	}





/* Hydration and You Popup function */
	function openPopupHydration() {
	  var popup = window.open( "/pt_BR/hydration/hydration_and_you.html", "hydration_and_you", "toolbar=no,status=yes,scrollbars=yes,menubar=yes,locationbar=no,top=35,left=20,width=670,height=475,resizable=yes");
	  popup.focus();
	}

/* Write the Top Navigation */

function write_nav(currsection) {
	navhtml = '';
	// Hydration
	navhtml += '<a href="/pt_BR/hydration/index.shtml">';
	if (currsection=='hydration') {
		navhtml += '<img src="/pt_BR/images/nav/nav_hydration_on.gif" width="109" height="23" alt="Hidrata&ccedil;&atilde;o &#150; Se&ccedil;&atilde;o atual" />';
	} else {
		navhtml += '<img src="/pt_BR/images/nav/nav_hydration_off.gif" width="109" height="23" alt="Hidrata&ccedil;&atilde;o" onmouseover="nav_on(this,\'hydration\');" onmouseout="nav_off(this,\'hydration\')" />';
	}
	navhtml += '</a>';	
	// Nutrition	
	navhtml += '<a href="/pt_BR/nutrition/index.shtml">';
	if (currsection=='nutrition') {
		navhtml += '<img src="/pt_BR/images/nav/nav_nutrition_on.gif" width="99" height="23" alt="Nutri&ccedil;&atilde;o &#150; Se&ccedil;&atilde;o atual" />';
	} else {
		navhtml += '<img src="/pt_BR/images/nav/nav_nutrition_off.gif" width="99" height="23" alt="Nutri&ccedil;&atilde;o" onmouseover="nav_on(this,\'nutrition\');" onmouseout="nav_off(this,\'nutrition\')" />';
	}
	navhtml += '</a>';	
	// Ingredients
	navhtml += '<a href="/pt_BR/ingredients/index.shtml">';
	if (currsection=='ingredients') {
		navhtml += '<img src="/pt_BR/images/nav/nav_ingredients_on.gif" width="120" height="23" alt="Ingredientes &#150; Se&ccedil;&atilde;o atual" />';
	} else {
		navhtml += '<img src="/pt_BR/images/nav/nav_ingredients_off.gif" width="120" height="23" alt="Ingredientes" onmouseover="nav_on(this,\'ingredients\');" onmouseout="nav_off(this,\'ingredients\')" />';
	}
	navhtml += '</a>';	
	// Beverages and Your Health
	navhtml += '<a href="/pt_BR/beverages_and_your_health/index.shtml">';
	if (currsection=='bevs_health') {
		navhtml += '<img src="/pt_BR/images/nav/nav_bevs_health_on.gif" width="196" height="23" alt="As bebidas e sua sa&uacute;de &#150; Se&ccedil;&atilde;o atual" />';
	} else {
		navhtml += '<img src="/pt_BR/images/nav/nav_bevs_health_off.gif" width="196" height="23" alt="As bebidas e sua sa&uacute;de" onmouseover="nav_on(this,\'bevs_health\');" onmouseout="nav_off(this,\'bevs_health\')" />';
	}
	navhtml += '</a>';	
	// Beverages and Your Child
	navhtml += '<a href="/pt_BR/beverages_and_your_child/index.shtml">';
	if (currsection=='bevs_child') {
		navhtml += '<img src="/pt_BR/images/nav/nav_bevs_child_on.gif" width="190" height="23" alt="As bebidas e seu filho &#150; Se&ccedil;&atilde;o atual" />';
	} else {
		navhtml += '<img src="/pt_BR/images/nav/nav_bevs_child_off.gif" width="190" height="23" alt="As bebidas e seu filho" onmouseover="nav_on(this,\'bevs_child\');" onmouseout="nav_off(this,\'bevs_child\')" />';
	}
	navhtml += '</a>';	
	// Beverage Science
	navhtml += '<a href="/pt_BR/beverage_science_and_innovation/index.shtml">';
	if (currsection=='bev_science') {
		navhtml += '<img src="/pt_BR/images/nav/nav_bev_science_on.gif" width="223" height="23" alt="A ci&ecirc;ncia e a inova&ccedil;&atilde;o das bebidas &#150; Se&ccedil;&atilde;o atual" />';
	} else {
		navhtml += '<img src="/pt_BR/images/nav/nav_bev_science_off.gif" width="223" height="23" alt="A ci&ecirc;ncia e a inova&ccedil;&atilde;o das bebidas" onmouseover="nav_on(this,\'bev_science\');" onmouseout="nav_off(this,\'bev_science\')" />';
	}	
	navhtml += '</a>';		
	document.write(navhtml);
}
