<!-- Do not copy any part of this script without permission; James T. Griffing, MS, BS; http://www.exrx.net //--><!-- 
function calc (form) {
var S, StandDev, PercRegress, Zscore, PE
S=form.Sex.options[form.Sex.selectedIndex].value
  if (S == "Male") {
     form.PopulationAverage.value =
     Math.round(70.592*Math.pow(10,-0.010502*form.Age.value))
}
  if (S == "Female") {
     form.PopulationAverage.value =
     Math.round(36.695-0.51*form.Age.value)
}
  if (S == "Male" && form.Repetitions.value<=form.PopulationAverage.value) {
     StandDev =
     179.35*Math.pow(form.Age.value,-0.69961)
}
  if (S == "Male" && form.Repetitions.value>form.PopulationAverage.value) {
     StandDev =
     14.5
}
  if (S == "Female" && form.Repetitions.value<=form.PopulationAverage.value) {
     StandDev =
     28.155-0.39*form.Age.value
}
  if (S == "Female" && form.Repetitions.value>form.PopulationAverage.value) {
     StandDev =
     22.279+0.084286*form.Age.value-0.0028571*Math.pow(form.Age.value,2)
}
Zscore = (form.Repetitions.value-form.PopulationAverage.value)/StandDev
PE= Math.exp(-1.8355027*(Math.abs(Zscore)-0.23073201))
PercRegress= -0.41682992*(PE-1)/(PE+1)+0.58953708
  if (Zscore > 0) {
     form.Score.value =
     Math.round(PercRegress*100)
}
  if (Zscore <= 0) {
     form.Score.value =
     Math.round((1-PercRegress)*100)
}
  if (Zscore >= 1) {
     form.Rating.value ="Excellent"
}
  if (Zscore < 1 && Zscore >= 0.5) {
     form.Rating.value ="Good"
}
  if (Zscore < 0.5 && Zscore >= -0.5) {
     form.Rating.value ="Average"
}
  if (Zscore < -0.5 && Zscore >= -1) {
     form.Rating.value ="Fair"
}
  if (Zscore < -1) {
     form.Rating.value ="Poor"
}
}
//--> 
