<!--
function numbersOnly(el){
	el.value = el.value.replace(/[^0-9]/g, "");
}

function addCommas(nStr)
{
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}

function  Calculate() {
	var cost = form.cost.value;
	
	if (cost > 800000) {
			alert('Cost cannot be greater than $800,000');	
	}
		
	else {
	if (cost >= 250000) {
		
		first = cost - 200000;
		deduction179 = (cost - 250000) / 2;
		bonus = (cost - 250000) / 2; 
		regular = 50000;
	}
	else {
		first = cost - 0;
		deduction179 = cost - 0;
		bonus = 0;
		regular = 0;
	}
	
	savings = first * .35;
	lowered = cost - savings;
	
	form.first.value = addCommas(first.toFixed(2));
	form.deduction179.value = addCommas(deduction179.toFixed(2));
	form.bonus.value = addCommas(bonus.toFixed(2));
	form.regular.value = addCommas(regular.toFixed(2));
	form.savings.value = addCommas(savings.toFixed(2));
	form.lowered.value = addCommas(lowered.toFixed(2));
}
}
-->