function CalBtn_onclick(theform) 
{

var fee=350;
  carhp = parseFloat( theform.carhp.value.replace(",", "") );
  if( isNaN(carhp) ) carhp = 0;
  cc1 = parseFloat( theform.cc1.value.replace(",", "") );
  if( isNaN(cc1) ) cc1 = 0;
  cc2 = parseFloat( theform.cc2.value.replace(",", "") );
  if( isNaN(cc2) ) cc2 = 0;
  hp1 = parseFloat( theform.hp1.value.replace(",", "") );
  if( isNaN(hp1) ) hp1 = 0;
  hp2 = parseFloat( theform.hp2.value.replace(",", "") );
  if( isNaN(hp2) ) hp2 = 0;
  other1 = parseFloat( theform.other1.value.replace(",", "") );
  if( isNaN(other1) ) other1 = 0;
  other2 = parseFloat( theform.other2.value.replace(",", "") );
  if( isNaN(other2) ) other2 = 0;
  
  carhpmp = parseFloat( theform.carhpmp.value.replace(",", "") );
  if( isNaN(carhpmp) ) carhpmp = 0;
  cc1mp = parseFloat( theform.cc1mp.value.replace(",", "") );
  if( isNaN(cc1mp) ) cc1mp = 0;
  cc2mp = parseFloat( theform.cc2mp.value.replace(",", "") );
  if( isNaN(cc2mp) ) cc2mp = 0;
  hp1mp = parseFloat( theform.hp1mp.value.replace(",", "") );
  if( isNaN(hp1mp) ) hp1mp = 0;
  hp2mp = parseFloat( theform.hp2.value.replace(",", "") );
  if( isNaN(hp2mp) ) hp2mp = 0;
  other1mp = parseFloat( theform.other1mp.value.replace(",", "") );
  if( isNaN(other1mp) ) other1mp = 0;
  other2mp = parseFloat( theform.other2mp.value.replace(",", "") );
  if( isNaN(other2mp) ) other2mp = 0;
  
  ir = 0.17;
  
  // calculate totals
  
  total = (carhp + cc1 + cc2 + hp1 + hp2 + other1 + other2);
  totalmp = (carhpmp + cc1mp + cc2mp + hp1mp + hp2mp + other1mp + other2mp);
  
  if( isNaN(total) ) total = 0; 
  if( isNaN(totalmp) ) totalmp = 0;
  
  theform.total.value = total;
  theform.totalmp.value = totalmp;
  
  /* add in a fee */
  total=total+fee*1;
  
  year1 = (total * ((ir/12) * Math.pow((1+ir/12), 12))/((Math.pow((1+ir/12), 12)) - 1 ))/4.33;
  year1 = Math.round(year1*100)/100;
  year2 = (total * ((ir/12) * Math.pow((1+ir/12), 24))/((Math.pow((1+ir/12), 24)) - 1 ))/4.33;
  year2 = Math.round(year2*100)/100;
  year3 = (total * ((ir/12) * Math.pow((1+ir/12), 36))/((Math.pow((1+ir/12), 36)) - 1 ))/4.33;
  year3 = Math.round(year3*100)/100;
  year4 = (total * ((ir/12) * Math.pow((1+ir/12), 48))/((Math.pow((1+ir/12), 48)) - 1 ))/4.33;
  year4 = Math.round(year4*100)/100;
  year5 = (total * ((ir/12) * Math.pow((1+ir/12), 60))/((Math.pow((1+ir/12), 60)) - 1 ))/4.33;
  year5 = Math.round(year5*100)/100;  


  theform.year1.value = year1;
  theform.year2.value = year2;
  theform.year3.value = year3;
  theform.year4.value = year4;
  theform.year5.value = year5;
  
  
}