// JavaScript Document
var newwindow = ''
function popitup(url,w,h) {
if (newwindow.location && !newwindow.closed) {
    newwindow.location.href = url;
    newwindow.focus(); }
else
	{
    newwindow=window.open(url,'htmlname','width='+w+',height='+h+',resizable=0, left=50, top=50')
	}

}

function tidy() {
if (newwindow.location && !newwindow.closed) {
   newwindow.close(); }
}

function doNothing() {
}

function daneio()
{
	form = document.daneio
	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
	TotalPayment=NumPayments * MonthPayment
	form.Total.value=TotalPayment
}

