function cal_bmi(lbs, ins){

   h2 = ins * ins;

   bmi = lbs/h2 * 703

   f_bmi = Math.floor(bmi);

   diff  = bmi - f_bmi;

   diff = diff * 10;

   diff = Math.round(diff);

   if (diff == 10){

      // Need to bump up the whole thing instead

      f_bmi += 1;

      diff = 0;

   }

   bmi = f_bmi + "." + diff;

   return bmi;

}



// please copy the compute() function again...

// anything with // at the beginning, you can take out. :)

function compute(){

   var f = top.document.forms[0];

   var fi = parseInt(f.htf.options[f.htf.selectedIndex].value * 12);

   var ii = parseInt(f.hti.options[f.hti.selectedIndex].value);

   var i = fi + ii;

   w = f.wt.value;

   if (chkw(w)){

      f.bmi.value = cal_bmi(w, i);





if (bmi >= 30) {

                document.getElementById("result").innerHTML = "<font color='black'>Your <b>BMI</b> indicates that...<br>You have a major risk for health problems. Please consult a physician."

			//msgText = "You have a major risk for health problems. Please consult a physician."

		} else if (bmi >= 25) {

                document.getElementById("result").innerHTML = "<font color='black'>Your <b>BMI</b> indicates that...<br>You have an increased risk for health problems associated with being overweight."

			//msgText = "You have an increasing risk for health problems associated with being overweight."

		} else if (bmi >= 18.6) {

                document.getElementById("result").innerHTML = "<font color='black'>Your <b>BMI</b> indicates that you are at a healthy weight."

			//msgText = "You are healthy."

		} else {

		document.getElementById("result").innerHTML = "<font color='black'>Your <b>BMI</b> indicates that you are underweight."

			// msgText = "You are underweight."

}

           

   } else {

	//alert("Please enter your weight.");

		document.getElementById("result").innerHTML = "Please enter your weight."

	}

}



function chkw(w){

   if (isNaN(parseInt(w))){

      return false;

   } else if (w < 0){

      return false;

   }

   else{

      return true;

   }

}

