<!-- Author: Brian Mackenzie -->
<!-- Date: 11th March 2004 -->
<!-- Version: 1.0 -->

<!-- Function:  Calculate the results from the 150m test -->

<!-- Required by: end150.htm -->

<!-- Copyright Brian Mackenzie 2004 -->


function calculate()

{
  var time = document.stride.time.value;

  r1=-2.496488+(time*0.9996637)+(time*time*-0.010305);

  document.stride.r1.value = nt2dp(r1,2);
}


function valclear()

{
  document.stride.r1.value = "";
}

function predcalc()

{
  var t400 = document.pred.t400.value;

  p1=5.2049864+(0.5009058*t400)+(t400*t400*0.0452899);

  document.pred.p150.value = nt2dp(p1,2);
}

function pclear()
{
  document.pred.p150.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);
}