
function GetPayment(RefNo) {
var CurencySmbl = '£';
var CreditFee = '145';
var APR = '11.9';
var Interest = '.065';


var Price = document.CalcFinance.Price.value;
var myExp = /\D/g;
Price = Price.replace(myExp,"");
var Deposit = document.CalcFinance.deposit.value;
var MyDeposit = document.CalcFinance.deposit.value * 1;
var Term = document.CalcFinance.term.value * 1;
var Years = Term / 12;
var AmtBrrowed = (Price - Deposit);
var Fprice = (Price - Deposit) * Interest;
var Trm = (Fprice * Years) + (Price - Deposit);
var Payment = Trm / Term;
Price = Math.round(Price*100)/100;  Price = Price.toFixed(2); 
Deposit = Math.round(Deposit*100)/100;  Deposit = Deposit.toFixed(2);  
AmtBrrowed = Math.round(AmtBrrowed*100)/100;  AmtBrrowed = AmtBrrowed.toFixed(2);  
Payment = Math.round(Payment*100)/100;   Payment = Payment.toFixed(2); 

var TotalAmt = (Term * Payment) + MyDeposit + (CreditFee * 2);    TotalAmt = TotalAmt.toFixed(2);

if(MyDeposit == "Enter Down Payment" || MyDeposit == "") { alert("Please enter a down payment amount."); document.CalcFinance.deposit.focus();}
else{
var All = "<Table Class='FormTable' Width='100%'>";
All += "<TR><TD Class='FormText'>Price</TD><TD Class='FormText' Align=Right>£"+Price+"</TD></TR>";
All += "<TR><TD Class='FormText'>Customer deposit</TD><TD Class='FormText' Align=Right>"+CurencySmbl+Deposit+"</TD></TR>";
All += "<TR><TD Class='FormText'>Amount to borrow</TD><TD Class='FormText' Align=Right>"+CurencySmbl+AmtBrrowed+"</TD></TR>";
All += "<TR><TD Class='FormText'><B>"+Term + " Monthly Payments</TD><TD Class='FormText' Align=Right>"+CurencySmbl+Payment+"</TD></TR>";
All += "<TR><TD Class='FormText'>Credit Facility Fee</TD><TD Class='FormText' Align=Right>"+CurencySmbl+"145.00</TD></TR>";
All += "<TR><TD Class='APR_TAP'>Typical APR</TD><TD Class='APR_TAP' Align=Right>"+APR+"%</TD></TR>";
All += "<TR><TD Class='FormText'>Total amount repayable</TD><TD Class='FormText' Align=Right>"+CurencySmbl+TotalAmt+"</TD></TR>";
All += "<TR><TD Class='FormText' Colspan=2 Align=Center><HR Noshade><A HREF='/cgi-bin/MHDB/mdb.pl?FinanceNow&"+Deposit+"&"+RefNo+"&"+Price+"'><IMG SRC='/ADB/images/Finance_Now.gif' Border=0></A></TD></TR>";
All += "</Table>";
document.getElementById("Finance").innerHTML=All;
 }
}


function DetailsWindow(REF) {
window.open(REF,  'window', 'toolbar=no,scrollbars=yes,resizable=yes,width=800,height=780,left=10,top=10')
}

function ContactUs() {
window.open('/cgi-bin/ADB/adb.pl?contactus',  'window', 'toolbar=no,scrollbars=auto,resizable=yes,width=440,height=400,left=10,top=10')
}

function MailFriend(MAKE) {
window.open('/cgi-bin/catalog/catalog.cgi/catalog.cgi?p&contactus',  'window', 'toolbar=no,scrollbars=auto,resizable=yes,width=800,height=600,left=10,top=10')
}

function printit(){  
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (NS) {
    window.print() ;  
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2); 
 }
}

var blue;
  fbPageOptions = {
    theme: blue,
    resizeDuration: 5.5,
    imageFadeDuration: 4.5,
    overlayFadeDuration: 0,
    navType: 'both'
  };
