<!-- Author: Brian Mackenzie -->
<!-- Date: 11th March 2004 -->
<!-- Version: 1.0 -->
<!-- Function:  Calculate 1RM -->
<!-- Required by: maxload.htm -->
<!-- Copyright Brian Mackenzie 2004 -->

function maxcalculate()
{
  var weight = document.max.weight.value;
  var reps = document.max.reps.value;

  var ml1 = weight/(1.0278-(0.0278*reps));
  var ml2 = weight*(1 +(0.033*reps));

  document.max.ml1.value = nt2dp(ml1,0);
  document.max.ml2.value = nt2dp(ml2,0);
}

function vo2clear()
{
  document.max.ml1.value = "";
  document.max.ml2.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);
}