<!-- Begin

// Pop-up begin

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=430,height=500,left = 312,top = 134');");
}

function popUpLoan(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=400,height=400,left = 312,top = 134');");
}

function popUpCalc(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=400,height=200,left = 312,top = 134');");
}

function popUpFooter(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=430,height=500,left = 312,top = 134');");
}

// PPI Calculator
function calcPPI(form) {
	a = form.a.value/100;
	b = a*14;
	form.total1.value = b.toFixed(2);
}
// MPPI Calculator
function calcMPPI(form) {
	rate = 0.00;
	resultA = 0.00;
	
		if (form.covType.value == "covAs"){
			rate = 2.63;
		}
		if(form.covType.value == "covU"){
			rate = 2.63;
		}
		if(form.covType.value == "covAsu"){
			rate = 4.25;
		}
		if(form.covType.value == "null"){
			rate = 0.00;
		}
	
	tmpAmt = (form.covAmt.value / 100) * 25.00;  // work out 25% of mortgage monthly payments
	addAmt = form.addAmt.value * 1; // convert to numbers
	covAmt = form.covAmt.value * 1; // convert to numbers
	
	if(form.addAmt.value > tmpAmt){ 
		
		alert("Error:\r\rThe additional amount should be no more\rthan 25% of your monthly repayments\r");
	}
	else{
		resultA = addAmt + covAmt; // add the two boxes together
		resultB = (resultA / 100) * rate; // work out the result
		form.total.value = resultB.toFixed(2); // update text box
		}
}

 function doClear(theText) {
     if (theText.value == theText.defaultValue) {
         theText.value = ""
     }
 }
function calcBudget(form) {
	f1 = parseFloat(form.f1.value);
	f2 = parseFloat(form.f2.value);
	f3 = parseFloat(form.f3.value);
	f4 = parseFloat(form.f4.value);
	f5 = parseFloat(form.f5.value);
	f6 = parseFloat(form.f6.value);
	f7 = parseFloat(form.f7.value);
	f8 = parseFloat(form.f8.value);
	f9 = parseFloat(form.f9.value);
	f10 = parseFloat(form.f10.value);
	f11 = parseFloat(form.f11.value);
	f12 = parseFloat(form.f12.value);
	f13 = parseFloat(form.f13.value);
	f14 = parseFloat(form.f14.value);
	f15 = parseFloat(form.f15.value);
	f16 = parseFloat(form.f16.value);
	f17 = parseFloat(form.f17.value);
	f18 = parseFloat(form.f18.value);
	f19 = parseFloat(form.f19.value);

	tot1 = 0.00;
	tot2 = 0.00;
	tot3 = 0.00;
	
	tot1 = f1 + f2 + f3;
	
	tot2 = f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + f13 + f14 + f15 + f16 + f17 + f18 + f19;
	
	tot3 = tot1 - tot2;

	form.total1.value = tot1.toFixed(2);
	
	form.total2.value = tot2.toFixed(2);
	
	form.total3.value = tot3.toFixed(2);
}
//  End -->