<!-- Author: Brian Mackenzie -->
<!-- Date: 11th March 2004 -->
<!-- Version: 1.0 -->

<!-- Function:  Calculate the results from the 250m test -->

<!-- Required by: end250.htm -->

<!-- Copyright Brian Mackenzie 2004 -->


function calculate()

{
  var time = document.stride.time.value;

  r1=14.531737+(time*-0.19884)+(time*time*0.0164982);

  document.stride.r1.value = nt2dp(r1,2);
}


function valclear()
{
  document.stride.r1.value = "";
}

function predcalc()
{
  var t400 = document.pred.t400.value;

  p1=-20.74899+(3.0577211*t400)+(t400*t400*-0.03799);

  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);
}