<!-- Do not copy any part of this script without permission; James T. Griffing, MS, BS; http://www.exrx.net //--><!-- 
function calc (form) {
var S, Age, Pop, W, HUnit, H, BHAge, GHAge, Ave, ME, FE, BE, GE, MScore, FScore, BScore, GScore
S= form.Sex.options[form.Sex.selectedIndex].value
Pop= form.Population.options[form.Population.selectedIndex].value
W= form.Weight.value*form.WeightUnit.options[form.WeightUnit.selectedIndex].value
HUnit= form.HeightUnit.options[form.HeightUnit.selectedIndex].value
H= form.Height.value/HUnit
BHAge= H-(0.006*Math.pow(Pop,2)+1.0655*Pop-11.375)
  if (Pop < 15) {
     GHAge= H-(0.5*Pop-5)
}
  else {
     GHAge= H-3
}
ME= Math.exp(0.37881694*(H-19.517363))
FE= Math.exp(0.53505831*(H-13.163193))
BE= Math.exp(0.61151407*(BHAge-10.961794))
GE= Math.exp(-0.73106079*(GHAge-10.000857))
MScore= 50.825777*(ME-1)/(ME+1)+49.984861
FScore= 50.738729*(FE-1)/(FE+1)+49.961544
BScore= 50.120844*(BE-1)/(BE+1)+51.280068
GScore= -50.093397*(GE-1)/(GE+1)+50.01197
  if (S == "Male" && Pop < 18) {
     Ave= Math.round((0.006*Math.pow(Pop,2)+1.0655*Pop-0.375)*10)/10;
     form.Score.value= Math.round(BScore);
}
  if (S == "Female" && Pop < 18) {
     if (Pop < 15) {
     Ave= 0.5*Pop+5;
     }
     else {
     Ave=13
     }
     form.Score.value= Math.round(GScore);
}
  if (S == "Male" && Pop == "20") {
     Ave= 19.5;
     form.Score.value= Math.round(MScore);
}
  if (S == "Female" && Pop == "20") {
     Ave= 13.2;
     form.Score.value= Math.round(FScore);
}
  if (S == "Male" && Pop == "100") {
     Ave= 26;
     form.Score.value= Math.round(5*H-80);
}
  if (S == "Female" && Pop == "100") {
     Ave= 22;
     form.Score.value= Math.round(5*H-60);
}
  if (HUnit == 1) {
     form.PopAve.value= Ave;
     form.Power.value= Math.round(W*Math.pow(0.12446*H,2));
}
  else {
     form.PopAve.value= Ave*2.54;
     form.Power.value= Math.round(W*Math.pow(0.049*form.Height.value,2));
}
  if (form.Score.value > 84) {
     form.Rating.value ="Excellent"
}
  if (form.Score.value <= 84 && form.Score.value > 67) {
     form.Rating.value ="Good"
}
  if (form.Score.value <= 67 && form.Score.value >= 33) {
     form.Rating.value ="Average"
}
  if (form.Score.value < 33 && form.Score.value >= 16) {
     form.Rating.value ="Fair"
}
  if (form.Score.value < 16) {
     form.Rating.value ="Poor"
}
}
//-->