function diet(form) {

if (form.D1.selectedIndex == 1) {
   
//calculates weight using kg
var sixty = (Math.pow(form.wt.value,0.75) * 132) * .6;
var seventy = (Math.pow(form.wt.value,0.75) * 132) * .7;
var mer = Math.pow(form.wt.value,0.75) * 132;
var rate ="2.2 kg"
var lo_day = 3500 /((Math.pow(form.wt.value,0.75) * 132) - ((Math.pow(form.wt.value,0.75) * 132) * .6));
var hi_day = 3500 / ((Math.pow(form.wt.value,0.75) * 132) - ((Math.pow(form.wt.value,0.75) * 132) * .7));

}

//calculates weight using lbs
else {
var sixty = (Math.pow(form.wt.value*.454,0.75) * 132) * .6;
var seventy = (Math.pow(form.wt.value*.454,0.75) * 132) * .7;
var mer = Math.pow(form.wt.value*.454,0.75) * 132;
var rate ="1 lb"
var lo_day = 3500 / ((Math.pow(form.wt.value*.454,0.75) * 132) - ((Math.pow(form.wt.value*.454,0.75) * 132) * .6));
var hi_day = 3500 / ((Math.pow(form.wt.value*.454,0.75) * 132) - ((Math.pow(form.wt.value*.454,0.75) * 132) * .7));
}

form.sixty.value = Math.round(sixty);
form.seventy.value = Math.round(seventy);
form.mer.value = Math.round(mer);
form.rate.value = rate;
form.lo_day.value = Math.round(10*lo_day)/10;
form.hi_day.value = Math.round(10*hi_day)/10;

//if statements--
if((form.wt.value==null)||(form.wt.value=="")||(isNaN(form.wt.value))){
alert('Please enter a weight with numbers only. You may use a period for decimal place.');
form.wt.focus();
form.wt.select();
return false
}
}
