<!-- Original:  Marat Rikelman (rikelman@bellsouth.net) -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function mod(div,base) {
return Math.round(div - (Math.floor(div/base)*base));
}
function calcBmi() {
var w = document.bmi.weight.value * 1;
var HeightFeetInt = document.bmi.htf.value * 1;
var HeightInchesInt = document.bmi.hti.value * 1;
HeightFeetConvert = HeightFeetInt * 12;
h = HeightFeetConvert + HeightInchesInt;
displaybmi = (Math.round((w * 703) / (h * h)));
var rvalue = true;
if ( (w <= 35) || (w >= 500)  || (h <= 48) || (h >= 120) ) {
alert ("Datos inválidos. ˇCompruebe y entre por favor otra vez!");
rvalue = false;
}
if (rvalue) {
if (HeightInchesInt > 11) {
reminderinches = mod(HeightInchesInt,12);
document.bmi.hti.value = reminderinches;
document.bmi.htf.value = HeightFeetInt + 
((HeightInchesInt - reminderinches)/12);
document.bmi.answer.value = displaybmi;
}
if (displaybmi <19) 
document.bmi.comment.value = "Peso Insuficiente";
if (displaybmi >=19 && displaybmi < 25) 
document.bmi.comment.value = "Peso Deseable-Sano";
if (displaybmi >=25 && displaybmi <=29) 
document.bmi.comment.value = "Gordo-Propenso a los Riesgos de Salud";
if (displaybmi >=30 && displaybmi <=40) 
document.bmi.comment.value = "Obeso";
if (displaybmi >40) 
document.bmi.comment.value = "Extremadamente Obeso";
document.bmi.answer.value = displaybmi; }
return rvalue;
}
//  End -->