');
Newwindow.document.write('');
Newwindow.document.write('
');
Newwindow.document.write('Results Window ' + iWin + '');
Newwindow.document.write('
');
Newwindow.document.write('Loan Amount: | ');
Newwindow.document.write('$' + setup.principal.value + ' |
');
Newwindow.document.write('Interest Rate: | ');
Newwindow.document.write('' + setup.rate.value + ' % |
');
Newwindow.document.write('Payment Amount: | ');
Newwindow.document.write('$' + setup.payment.value + ' |
');
Newwindow.document.write('Payment Interval: | ');
Newwindow.document.write('' + setup.interval.value + ' |
');
Newwindow.document.write('Monthly Fee: | ');
Newwindow.document.write('$' + setup.fee.value + ' |
');
Newwindow.document.write('
');
Newwindow.document.write('');
Newwindow.document.write('
');
Newwindow.document.write('');
Popwindow=window.open("",0,"resizable=no,scrollbars=no,status=0,width=150,height=20");
Popwindow.document.write('
Please Wait');
Popwindow.document.write('Calculating ...');
Popwindow.document.write('
');
Newwindow.document.write('');
Newwindow.document.write('Date | Payment | Principal | Total Payment | Total Interest | Total Fees | Extra Payment |
');
while (Principal>0) {
iDays++;
today.setDate(today.getDate()+1);
if (setup.interval.value=="Fortnightly") {
if (iDays==14) {
Principal=Principal-Payment;
TotalPayment+=Payment*1;
PaymentNo++;
iDays=0;
bLine=1;
}
}
else {
if (today.getDate()==iStartDate) {
Principal=Principal-Payment;
TotalPayment+=Payment*1;
PaymentNo++;
bLine=1;
}
}
if (today.getDate()==iStartDate) {
Principal+=MonthlyFee*1;
TotalFees+=MonthlyFee*1;
Principal+=Interest*1;
TotalInterest+=Interest*1;
Interest=0;
iMonths++;
if (iMonths>=13) {
iYears++;
iMonths=0;
}
}
if (Principal<=0) {
Principal+=Interest*1;
TotalInterest+=Interest*1;
Interest=0;
if (Principal<=0) {
TotalPayment+=Principal*1;
Principal=0;
bLine = 1;
}
}
Interest+=Principal*Rate/36500;
if (bLine==1) {
Newwindow.document.write(''+today.getDate()+'/'+(today.getMonth()*1+1)+'/'+today.getYear()+' | '+PaymentNo+' | '+(Math.round(Principal*100)/100)+' | '+(Math.round(TotalPayment*100)/100)+' | '+(Math.round(TotalInterest*100)/100)+' | '+(Math.round(TotalFees*100)/100)+' | |
');
bLine=0;
}
}
Popwindow.close();
Newwindow.document.write('
');
Newwindow.document.write('');
setup.index.value++;
}
MORTGAGE CALCULATOR