

<!--


// Copyright NAOI 2004-2007

// --------------------- Accumulate.asp Calculator

function compound(form)
{
  
  var tot = parseFloat(form.Init.value, 10);
  var contrib = parseFloat(form.Monthly.value, 10);
  var tx = parseFloat(form.Tax.value/100, 10);
  var infl = parseFloat(form.Inflate.value/100, 10);
  var i = 0;
  var r = parseFloat(form.Rate.value/100, 10);
  
  earn = (tot*r) + ((contrib*6) * r)
  tot = tot + earn + contrib*12 - (tx*earn);
  tot = tot * (1.0-infl)
  form.OneYear.value = Math.round(tot);
  
  earn = (tot*r) + ((contrib*6) * r)
  tot = tot + earn + contrib*12 - (tx*earn);
  tot = tot * (1.0-infl)
  form.TwoYear.value = Math.round(tot);
  
  earn = (tot*r) + ((contrib*6) * r)
  tot = tot + earn + contrib*12 - (tx*earn);
  tot = tot * (1.0-infl)
  form.ThreeYear.value = Math.round(tot);
  
  earn = (tot*r) + ((contrib*6) * r)
  tot = tot + earn + contrib*12 - (tx*earn);
  tot = tot * (1.0-infl)
  form.FourYear.value = Math.round(tot);
  
  earn = (tot*r) + ((contrib*6) * r)
  tot = tot + earn + contrib*12 - (tx*earn);
  tot = tot * (1.0-infl)
  form.FiveYear.value = Math.round(tot);
  
  for (i=1; i<=5; i=i+1)
  {
    earn = (tot*r) + ((contrib*6) * r)
  tot = tot + earn + contrib*12 - (tx*earn);
  tot = tot * (1.0-infl)
      }
  form.TenYear.value = Math.round(tot);
  
  for (i=1; i<=5; i=i+1)
  {
    earn = (tot*r) + ((contrib*6) * r)
  tot = tot + earn + contrib*12 - (tx*earn);
  tot = tot * (1.0-infl)
        }
  form.FifteenYear.value = Math.round(tot);
  
  for (i=1; i<=5; i=i+1)
  {
    earn = (tot*r) + ((contrib*6) * r)
  tot = tot + earn + contrib*12 - (tx*earn);
  tot = tot * (1.0-infl)
      }
  form.TwentyYear.value = Math.round(tot);
  
  for (i=1; i<=10; i=i+1)
  {
    earn = (tot*r) + ((contrib*6) * r)
  tot = tot + earn + contrib*12 - (tx*earn);
  tot = tot * (1.0-infl)
      }
  form.ThirtyYear.value = Math.round(tot);
  
  for (i=1; i<=10; i=i+1)
  {
    earn = (tot*r) + ((contrib*6) * r)
  tot = tot + earn + contrib*12 - (tx*earn);
  tot = tot * (1.0-infl)
      }
  form.FourtyYear.value = Math.round(tot);
}


//-->
