
// Copyright 2007, Steve McLaughlin. All rights reserved.
// iPhoneLoanCalculator.com



function Morgcal() 
{ 
	form = document.myform ;
	LoanAmount= form.LoanAmount.value;
	DownPayment= 0;
	AnnualInterestRate = form.InterestRate.value/100;
	Years= form.NumberOfYears.value;
	MonthRate=AnnualInterestRate/12 ;
	NumPayments=Years*12 ;
	Prin=LoanAmount-DownPayment;
		
	MonthPayment=Math.floor((Prin * MonthRate)  /(1- Math.pow((1+MonthRate),(-1*NumPayments)) ) * 100) /100 ;

	form.NumberOfPayments.value=NumPayments;
	form.MonthlyPayment.value=MonthPayment;
} // --></script> 

