function CalculateBond()
{
 amount=document.form1.text1.value;
 interest=document.form1.text2.value;
 noofterms=document.form1.text3.value;
 //noofterms*=12;
if((amount>=0)&&(interest>=0)&&(noofterms>=0))
 { 
   var monthlyinterest=interest/1200;
   var top =amount*monthlyinterest;
   var x=1+monthlyinterest;
   var power=1;
 for(i=1;i<=noofterms;i++)
  {
      power=power/x;
  }
   var y=1-power;
   var payment=top/y;
   var total=payment*noofterms;
   var totalinterest=total-amount;  
   document.form1.textarea1.value="\nYour payment per month is : \nR "+payment+" for "+noofterms+"  months at "+interest+"% interest."+"\nYou will eventually pay a total of \nR "+total+" of which \nR "+totalinterest+" will be interest";  
 }
 else 
   {  
    alert("You have not filled it in properly");  
   }
}

function CalculateBond2()
{
 amount=document.form1.text1.value;
 interest=document.form1.text2.value;
 noofterms=document.form1.text3.value;
 noofterms*=12;
if((amount>=0)&&(interest>=0)&&(noofterms>=0))
 { 
   var payment=(amount*(interest/1200))/(1-(Math.pow(1-interest/1200,noofterms)));
   var total=payment*noofterms;
   var totalinterest=total-amount;  
   document.form1.textarea1.value="\nYour payment per month is : \nR "+payment+" for "+noofterms+"  months at "+interest+"% interest."+"\nYou will eventually pay a total of \nR "+total+" of which \nR "+totalinterest+" will be interest";  
 }
 else 
   {  
    alert("You have not filled it in properly");  
   }
}
