<!-- Author: Brian Mackenzie -->
<!-- Date: 11th March 2004 -->
<!-- Version: 1.0 -->
<!-- Function:  Calculate the power from the Sgt jump test -->
<!-- Required by: sgtjump.htm -->
<!-- Copyright Brian Mackenzie 2004 -->

function pcalc()
{
  var m = document.pwatts.mass.value;
  var vj = document.pwatts.vj.value;
  var h = document.pwatts.height.value;

  w2 = Math.sqrt(4.9) * m * Math.sqrt(vj/100) * 9.81;
  w3 = (60.7 * vj) + (45.3 * m) - 2055;
  w4 = (61.9 * vj) + (36.0 * m) + 1822;
  w5 = (21.2 * vj) + (23.0 * m) - 1393;
  w6 = (78.6 * vj) + (60.3 * m) - (15.3 * h) - 1308;
  w7 = (43.8 * vj) + (32.7 * m) - (16.8 * h) + 431;

  document.pwatts.pw2.value = nt2dp(w2,0);
  document.pwatts.pw3.value = nt2dp(w3,0);
  document.pwatts.pw4.value = nt2dp(w4,0);
  document.pwatts.pw5.value = nt2dp(w5,0);
  document.pwatts.pw6.value = nt2dp(w6,0);
  document.pwatts.pw7.value = nt2dp(w7,0);
}

function pclear1()
{
  document.pwatts.pw2.value = "";
  document.pwatts.pw3.value = "";
  document.pwatts.pw4.value = "";
  document.pwatts.pw5.value = "";
  document.pwatts.pw6.value = "";
  document.pwatts.pw7.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);
}