<!-- Author: Brian Mackenzie -->
<!-- Date: 11th March 2004 -->
<!-- Version: 1.0 -->

<!-- Function:  Calculate training times for a 10k taper  -->

<!-- Required by: 10ktaper.htm -->

<!-- Copyright Brian Mackenzie 2004 -->

function speedcalculate()

{
  var target = document.speed.target.value;
  var distance = document.speed.distance.value;

  t1 = (target/10);
  t2 = t1*60/1000*distance*.95;
  t6=t2/60;
  t7=Math.round(t6);
 
  if (t7 > t6)
    {
      t7= 60*(t6-(t7-1));
      t6 = t6-1;
    }
  else
    {
      t7= 60*(t6-t7);
    }

  t4 = t1*60/1000*distance*1.05;
  t10=t4/60;
  t11=Math.round(t10);
 
  if (t11 > t10)
    {
      t11= 60*(t10-(t11-1));
      t10 = t10-1;
    }
  else
    {
      t11= 60*(t10-t11);
    }

  t5 = t1*60/1000*distance;
  t8=t5/60;
  t9=Math.round(t8); 

  if (t9 > t8)
    {
      t9= 60*(t8-(t9-1));
      t8 = t8-1;
    }
  else
    {
      t9= 60*(t8-t9);
    }

  document.speed.t6.value = Math.round(t6);
  document.speed.t7.value = Math.round(t7);
  document.speed.t8.value = Math.round(t8);
  document.speed.t9.value = Math.round(t9);
  document.speed.t10.value = Math.round(t10);
  document.speed.t11.value = Math.round(t11);
}


function valclear()

{
  document.speed.t6.value = "";
  document.speed.t7.value = "";
  document.speed.t8.value = "";
  document.speed.t9.value = "";
  document.speed.t10.value = "";
  document.speed.t11.value = "";
}
