function startUp() {
	updateLinks();
}	
window.onload = startUp;

/**
 * Standard popup window open
 * The first parameter will be the new URL.
 * Subsequent parameters will be (if supplied) the width and height.
 * If not specified the width and height will be 500 and 200 respectively.
 */
function openWin() {
	var url, width=500, height=200, menu=""; args = arguments;
	url = args[0];
	if (args.length>1) {
		width=args[1];
	}
	if (args.length>2) {
		height=args[2];
	}
	if (args.length>3) {
		if (args[3]) {
			menu=",menubar=yes,toolbar=yes";
		}
	}
	var newwin = window.open(url, 'newWin'+Math.floor(Math.random()*1000), 'width='+width+',height='+height+',scrollbars,resizable' + menu);
}

/**
 * Tabbed Content for Contact Us Product Information
 */
function prodSupportSelectedItem(currProd) {
	//Global variable declaration
	var offClass = "contact-us-prod-support-item-off";
	var onClass = "contact-us-prod-support-item-on";
	var offClassTopCell = "contact-us-prod-support-item-off-for-top-cell";
	var offClassMdlCell = "contact-us-prod-support-item-off-for-middle-cell";	
	//Array
	var prodArray = ['prd1','prd2'];
	var prodContentArray = ['prdContent1','prdContent2','prdContent3'];
	
	for(var i=0; i<prodArray.length; i++)	
	{
		if(currProd==prodArray[i]) {
			if(i==1){
				document.getElementById(prodArray[i-1]).className=offClassTopCell;	
			}	
			else if(i==(prodArray.length-1) ){
				document.getElementById(prodArray[0]).className=offClassTopCell;	
				document.getElementById(prodArray[i-1]).className=offClassMdlCell;	
			}		
			document.getElementById(prodArray[i]).className=onClass;
			document.getElementById(prodContentArray[i]).style.display="block";
		}
		else {
			document.getElementById(prodArray[i]).className=offClass;	
			document.getElementById(prodContentArray[i]).style.display="none";
		}	
	}
}

/*  CALCULATE BMI */ 
	function calcEnglish(form, feet, inches, pounds) {
	if ((! inches) || isNaN(inches)){
		inches = 0;
	}
	if (((inches <= 0) || isNaN(inches)) && ((feet <= 0) || isNaN(feet))){
		alert ('Please enter your height.');
		return false;
	}
	if ((pounds <= 0) || isNaN(pounds)){
	alert ('Please enter your weight.');
	return false;
	}	   
	TotalInches = eval(feet*12) + eval(inches)
	form.calcval.value = Math.round(pounds * 703 * 10 / TotalInches / TotalInches) / 10
	return false;
	}
	
	function calcMetric(form, meters, kilograms) {
		if ((meters <= 0) || isNaN(meters)){
			alert ('Please enter your height.');
			return false;
		}
	
		if ((kilograms <= 0) || isNaN(kilograms)){
			alert ('Please enter your weight.');
			return false;
		}
		form.calcval.value = Math.round(kilograms * 10 / meters / meters) / 10
	}