function compute(obj) {
  baseNum = 220;
  tarform = obj.form;
  secondsSelected = tarform.seconds.selectedIndex;
  if (tarform.gender[1].checked) baseNum = 222;
  age = tarform.age.value;
  maxHR = (baseNum - age);
  tarform.max_thr.value = Math.round(((maxHR * 0.60)/60) * (tarform.seconds.options[secondsSelected].value));
  tarform.min_thr.value = Math.round(((maxHR * 0.80)/60) * (tarform.seconds.options[secondsSelected].value));
  tarform.hrmax.value = Math.round((maxHR/60) * (tarform.seconds.options[secondsSelected].value));
  if (obj.name == "change_focus" ) {tarform.max_thr.focus()}
}

