 function CalculateAmounts()
 {
  var test="<b>$";
  var total=0;
  var planb="";
  var planbdown=0;
  var down=0;
  if (document.theform.newfamily.checked==true)
  {
   total=30.00;
  }
  else
  {
   total=0;
  }
  
  var kn=parseFloat(document.theform.kn.options[document.theform.kn.selectedIndex].value);
  var ele=parseFloat(document.theform.ele.options[document.theform.ele.selectedIndex].value);
  var middle=parseFloat(document.theform.middle.options[document.theform.middle.selectedIndex].value);
  var junior=parseFloat(document.theform.junior.options[document.theform.junior.selectedIndex].value);
  var high=parseFloat(document.theform.high.options[document.theform.high.selectedIndex].value);
  
  total+=(kn*195);
  
  total+=(middle*25);
  
  total+=(junior*45);
  
  total+=(high*175);
  
  planb="<b>";
  
  var totalkids=middle+junior+high+ele; //does NOT include kindergarten
  
  //  planbdown+=total+((totalkids)*200);
  
  if (totalkids==1)
  {
   planbdown+=total+100;
   total+=490;
   down=46;
  }
  
  else if (totalkids==2)
  {
   planbdown+=total+200;
   total+=930;
   down=87;
  }
  
  else if (totalkids==3)
  {
   planbdown+=total+300;
   total+=1320;
   down=123;
  }
  
  else if (totalkids==4)
  {
   planbdown+=total+400;
   total+=1710;
   down=159;
  }
  
  else if (totalkids>4)
  {
   planbdown+=(total+400) + (100 * (totalkids - 4));
   total+= 1710 + (330 * (totalkids - 4));
   down=159 + (30 * (totalkids - 4));
  }
  
  planbdown=centify(planbdown);
  planb+=planbdown+"</b> down and ";

  var savings=parseFloat(planbdown) + (down * 10) - total;

  total=centify(total);
  down=centify(down);
  
  savings=centify(savings);
  
  test+=total+"</b>";
  
  planb+="</b>";
  planb+="<b>"+down+"</b> a month<br /><br />Plan A savings: "+savings;
  
  
  
  if (document.getElementById) 
  {
    document.getElementById("plana").innerHTML=test;
    document.getElementById("planbdown").innerHTML=planb;
  }
  else 
  {
    document.plana.document.open();
    document.plana.document.write(test);
    document.plana.document.close();
    
    document.planbdown.document.open();
    document.planbdown.document.write(planb);
    document.planbdown.document.close();
  }
 }
 
 function centify(amount)
 {
  return (amount == Math.floor(amount)) ? amount + '.00' : (  (amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
 }
