function loanCalc()
{
	var numPayments=12 //Add a form element if client wants variable payment frequency.
	var amount=document.frmCalculate.txtAmt.value
	var term=document.frmCalculate.txtLeng.value
	var rate=document.frmCalculate.txtRate.value
	var payment=document.frmCalculate.txtPayment
	
	 if (amount.length==0||term.length==0||rate.length==0)
		{
			alert("You have left at least one of the fields blank.  Please fill in all three boxes.");
		}
	else if (isNaN(amount)||isNaN(term)||isNaN(rate))
		{
			alert("Sorry, the form only accepts numbers and decimal places.");
		}
	 else
		{
			 var monthlyRate=(rate/100)/numPayments;
			 var payTotal=Math.floor((amount*monthlyRate/(1-(Math.pow(1/(1+monthlyRate),term))))*100)/100;
			 payment.value = "$"+payTotal;
		}
}