// Warning Pop-Up
function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
}

/*  CALCULATE BMI  */
function calcEnglish(form, feet, inches, pounds) {
   if ((! inches) || isNaN(inches)){
	   inches = 0;
   }
   
   if ((pounds <= 0) || isNaN(pounds)){
	   alert ('Please enter your weight.');
	   return false;
   }
   
      if (((inches <= 0) || isNaN(inches)) && ((feet <= 0) || isNaN(feet))){
	   alert ('Please enter your height.');
	   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
}

/*Body Fat Calculator*/
/*For Men: %Fat=495/(1.0324-0.19077(log(waist-neck))+0.15456(log(height)))-450 */
/*For Women: %Fat=495/(1.29579-0.35004(log(waist+hip-neck))+0.22100(log(height)))-450 */