//Manuel Villanueva

function walt(form) {

if (form.option.selectedIndex == 1) {
   
//calculates weight using kg
var typical = Math.pow(form.wt_walt.value,0.75) * 110;
var active = Math.pow(form.wt_walt.value,0.75) * 125;
var hi_active = Math.pow(form.wt_walt.value,0.75) * 175;
var senior = Math.pow(form.wt_walt.value,0.75) * 90;
var lo_lowork_wa = Math.pow(form.wt_walt.value,0.75) * 130;
var hi_lowork_wa = Math.pow(form.wt_walt.value,0.75) * 150;
var hi_modwork_wa = Math.pow(form.wt_walt.value,0.75) * 175;
var hiheavywork_wa = Math.pow(form.wt_walt.value,0.75) * 250;

}

//calculates weight using lbs
else {
var typical = Math.pow(form.wt_walt.value/2.2,0.75) * 110;
var active = Math.pow(form.wt_walt.value/2.2,0.75) * 125;
var hi_active = Math.pow(form.wt_walt.value/2.2,0.75) * 175;
var senior = Math.pow(form.wt_walt.value/2.2,0.75) * 90;
var lo_lowork_wa = Math.pow(form.wt_walt.value/2.2,0.75) * 130;
var hi_lowork_wa = Math.pow(form.wt_walt.value/2.2,0.75) * 150;
var hi_modwork_wa = Math.pow(form.wt_walt.value/2.2,0.75) * 175;
var hiheavywork_wa= Math.pow(form.wt_walt.value/2.2,0.75) * 250;
}



form.typical.value = Math.round(typical); 
form.active.value = Math.round(active);
form.hi_active.value = Math.round(hi_active); 
form.senior.value = Math.round(senior);  
form.lo_lowork_wa.value = Math.round(lo_lowork_wa);  
form.hi_lowork_wa.value = Math.round(hi_lowork_wa); 
form.lo_modwork_wa.value = Math.round(hi_lowork_wa); 
form.hi_modwork_wa.value = Math.round(hi_modwork_wa);
form.loheavywork_wa.value = Math.round(hi_modwork_wa);
form.hiheavywork_wa.value = Math.round(hiheavywork_wa); 

//if statements--
if((form.wt_walt.value==null)||(form.wt_walt.value=="")||(isNaN(form.wt_walt.value))){
alert('Please enter a weight with numbers and use period for decimal place. All other characters are not allowed');
form.wt_walt.focus();
form.wt_walt.select();
return false
} 
}
