// By Paul Brady pbrady@umn.edu - http://www.ardilla.umn.edu/nutritiontools/kcalculator.cfm
// Permission granted to SimplytheBest.net to feature script in its DHTML script collection 
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
<!-- hide this script tag's contents from old browsers
function computeBMR(form){    
        form.BMRMale.value = 66.473 + ((form.weight.value / 2.2 ) * 13.751) + (5.0033 * form.height.value * 2.54) - (6.55 * form.age.value);    
        form.BMRFemale.value = 665.51 + ((form.weight.value / 2.2 ) * 9.463) + (1.8496 * form.height.value * 2.54) - (4.6756 * form.age.value);    
        form.BMR.value= 70 * (Math.pow((form.weight.value / 2.2 ), 0.75));    
        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 = (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 = (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 = "";    
        form.BMR.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 -->