// JavaScript Document
function ReCalc(){

	//var Duration = 84; //Change this to reflect the duration of the loan
	var Duration = document.getElementById("cmbDuration").value;
	//var InterestRate = 0.41204; //Change this to reflect the interest for the term
	var InterestRate = 0;
	switch(Number(Duration)){		
		case 36: InterestRate =	0.19916
		break
		case 48: InterestRate = 0.26864
		break
		case 60: InterestRate = 0.34100
		break
		default:
		alert("Error: Please refresh the page and try again.")
	}
	var CashPrice = document.getElementById("txtCashPrice").value;
	var Deposit = document.getElementById("txtDeposit").value;

	LoanAmount="";



	if(CashPrice.charAt(0)=="£"){CashPrice = CashPrice.substr(1)};
	if(Deposit.charAt(0)=="£"){Deposit = Deposit.substr(1)};
	LoanAmount = CashPrice - Deposit;
	LoanAmount = Math.round(LoanAmount*100)/100;
	document.getElementById("txtLoanAmount").value = "£"+LoanAmount;
	InterestCharge = LoanAmount * InterestRate;
	document.getElementById("txtInterestCharge").value = "£"+Math.round(InterestCharge*100)/100;
	document.getElementById("txtMonthlyInstallment").value = "£"+Math.round(((LoanAmount+InterestCharge)/Duration)*100)/100;
	document.getElementById("txtTotalPayable").value = "£"+(Number(CashPrice)+Number(InterestCharge));

}
function Nsignup() {
	window.open("newsletter.html", "newsle","width=320, height=220");
	return false;
}