// Credit enabler (Able2Buy) calculator.

function runCalc(code, amount) {
	var screenX    = screen.width;
	var screenY    = screen.height;
	var winWidth   = 600;
	var winHeight  = 440;
	var topX       = (screenX / 2) - (winWidth / 2);
	var topY       = (screenY / 2) - (winHeight / 2);
	
	if (amount<200) {
		alert('You must spend at least £200 to buy on credit with Able2Buy.');
	} else if (amount>10000) {
		alert('Your order value cannot exceed £10,000 if you wish to buy on credit with Able2Buy.');
	} else {
		newWin =  window.open("", "Wait", "width=" + winWidth + ", height=" + winHeight + ", left=" + topX + ", top=" + topY);
		newWin.location='https://www.creditenabler.COM/webjsp/autocalc.jsp?sc=' + code + '&price=' + amount;
	}
}

