<!-- Author: Brian Mackenzie -->
<!-- Date: 11th March 2004 -->
<!-- Version: 1.0 -->

<!-- Function: Calculate results from the 400m drop off test -->

<!-- Required by: 400dot.htm -->

<!-- Copyright Brian Mackenzie 2004 -->


function dropoffcalculate()

{
  var t100 = document.dropoff.t100.value;
  var t400 = document.dropoff.t400.value;
  drop = (t400/4) - t100;
  document.dropoff.drop.value = nt2dp(drop,2);
}


function valclear()

{
  document.dropoff.drop.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);
}