<!-- Author: Brian Mackenzie -->
<!-- Date: 11th March 2004 -->
<!-- Version: 1.0 -->
<!-- Function:  Calculate the results from the Queens step test -->
<!-- Required by: queens.htm -->
<!-- Copyright Brian Mackenzie 2004 -->

function vo2maxcalculate()
{
  var p1 = eval(document.vo2max.p1.value);
  p1=p1*4;

  document.vo2max.male.value = nt2dp(111.33-(0.42*p1),2);
  document.vo2max.female.value = nt2dp(65.81-(0.1847*p1),2);
}
 
function vo2clear()
{
  document.vo2max.male.value = "";
  document.vo2max.female.value = "";
}

function nt2dp(num,dp)
{
<!-- rounds num to dp decimal places -->
  num=num*1+(0.55/Math.pow(10,dp));
  if (dp>0) dp=dp+1;
  b=Math.floor(num).toString().length+dp;
  return num.toString().substr(0,b);
}