<!-- Do not copy any part of this script without permission; James T. Griffing, MS, BS; http://www.exrx.net //--><!-- 
function calc (form) {
var Mode, Speed, NG, WVO, RVO, FWVO, Weight, Time
Mode=form.Mode.options[form.Mode.selectedIndex].value
Speed=form.SpeedUnit.options[form.SpeedUnit.selectedIndex].value * form.Speed.value
NG=form.NG.options[form.NG.selectedIndex].value
Weight=form.Weight.value / form.WeightUnit.options[form.WeightUnit.selectedIndex].value 
Time=form.TimeUnit.options[form.TimeUnit.selectedIndex].value * form.Time.value
FWVO= 21.11 - 0.3593 * Speed + 0.0030 * Speed * Speed + 0.018 * form.Grade.value * Speed - 3.5 + NG * 1
WVO= 0.1 * Speed + 0.018 * form.Grade.value * Speed + NG * 1
RVO= 0.2 * Speed + 0.009 * form.Grade.value * Speed + NG * 1
  if (Mode == "walk" && Speed > 100){
     form.VO.value = Math.round(FWVO*10) / 10
     form.METs.value = Math.round(FWVO/3.5*10) / 10
     form.Cal.value = Math.round(Time*FWVO*Weight/200)
}
  if (Mode == "walk" && Speed <= 100){
     form.VO.value = Math.round(WVO*10) / 10
     form.METs.value = Math.round(WVO/3.5*10) / 10
     form.Cal.value = Math.round(Time*WVO*Weight/200)
}
  if (Mode == "run"){
     form.VO.value = Math.round(RVO*10) / 10
     form.METs.value = Math.round(RVO/3.5*10) / 10
     form.Cal.value = Math.round(Time*RVO*Weight/200)
}
}
//-->
