//Written by Manuel Villanueva

function ped_dose(form) {
var answer = (Math.pow(form.kg.value,0.425) * Math.pow(form.cm.value,0.725) * 0.007184) / 1.73 * (form.adult.value);
form.answer.value = Math.round(100*answer)/100;   


//if statements--
if((form.kg.value==null)||(form.kg.value=="")||(isNaN(form.kg.value))){
alert('Please enter a weight with numbers and or periods only. All other characters are not allowed');
form.kg.focus();
form.kg.select();
return false
}
if((form.cm.value==null)||(form.cm.value=="")||(isNaN(form.cm.value))){
alert('Please enter a height with numbers and or periods only. All other characters are not allowed');
form.cm.focus();
form.cm.select();
return false
}
if((form.adult.value==null)||(form.adult.value=="")||(isNaN(form.adult.value))){
alert('Please enter an adult dose with numbers and or periods only. All other characters are not allowed');
form.adult.focus();
form.adult.select();
return false
}
}