





function computeBMR(form){



   form.BMRMale.value = Math.round(66.473 + ((form.weight.value / 2.2 ) * 13.751) + (5.0033 * form.height.value * 2.54) - (6.55 * form.age.value));



    form.BMRFemale.value = Math.round(665.51 + ((form.weight.value / 2.2 ) * 9.463) + (1.8496 * form.height.value * 2.54) - (4.6756 * form.age.value));





    return;



}







function computeTotal(form){



    if (form.vlight.value.length == 0){



       form.vlight.value = "0";



    }



    if (form.light.value.length == 0){



       form.light.value = "0";



    }



    if (form.moderate.value.length == 0){



       form.moderate.value = "0";



    }



    if (form.heavy.value.length == 0){



       form.heavy.value = "0";



    }



    if (form.vheavy.value.length == 0){



       form.vheavy.value = "0";



    }



    form.TotMale.value = Math.round((1.0 * form.BMRMale.value) + (1.4 * form.vlight.value) + (2.5 * form.light.value) + (4.2 *form.moderate.value) + (8.2 * form.heavy.value) + (12 * form.vheavy.value));



    form.TotFemale.value = Math.round((1.0 * form.BMRFemale.value) + (1.4 * form.vlight.value) + (2.5 * form.light.value) + (4.2 *form.moderate.value) + (8.2 * form.heavy.value) + (12 * form.vheavy.value));



    return;



}







function clearBMR(form){



    form.age.value = "";



    form.weight.value = "";



    form.height.value = "";



    form.BMRMale.value = "";



    form.BMRFemale.value = "";



    return;



}







function clearTotal(form){



    form.vlight.value = "0";



    form.light.value = "0";



    form.moderate.value = "0";



    form.heavy.value = "0";



    form.vheavy.value = "0";



    form.TotMale.value = "0";



    form.TotFemale.value = "0";



    return;



}

<!-- done hiding from old browsers -->




  
<!-- 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)));
if ( (w <= 35) || (w >= 500)  || (h <= 48) || (h >= 120) ) {
alert ("Invalid data.  Please check and re-enter!");
return false;
}
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 = "Underweight";
if (displaybmi >=19 && displaybmi <=25) 
document.bmi.comment.value = "Desirable";
if (displaybmi >=26 && displaybmi <=29) 
document.bmi.comment.value = "prone to health risks";
if (displaybmi >=30 && displaybmi <=40) 
document.bmi.comment.value = "Obese";
if (displaybmi >40) 
document.bmi.comment.value = "Extremely obese";
document.bmi.answer.value = displaybmi;
}
//  End -->




 
 
<!-- Begin
var myWeight;
var myDistance;
function HowMany(form) {
var difference;
difference = (myDistance * myWeight) * .653;
form.Fdiff.value = difference;
    
if (difference < 100) {
form.comment.value="You better start working!";
}
if (difference >  101 && difference < 200) {
form.comment.value="Nice run, but you can do better.";
}
if (difference >  201 && difference < 300) {
form.comment.value="Very good!  Push above 300 next time.";
}
if (difference >  301 && difference < 500) {
form.comment.value="Great!  You're a runner.....keep it up!";
}
if (difference >  501 && difference < 700) {
form.comment.value="Great Effort!!!!!";
}
if (difference > 701) {
form.comment.value="Olympic potential!!";  
}
}
function SetMyWeight(weight) {
myWeight = weight.value;
}
function SetmyDistance(dis) {
myDistance = dis.value;
}
function ClearForm(form){
form.myWeight.value = "";
form.myDistance.value = "";
form.Fdiff.value = "";
form.comment.value = "";
}
// End -->



