	function calcCost() {
		var sqFt = document.affordform.Square_Footage.value;
		if (isNaN(sqFt) || sqFt == "" ) {
			alert("Square Footage value error. Please re-enter only numbers. \nNo spaces, commas, ect.");
			document.affordform.Square_Footage.value = "";
			document.affordform.Square_Footage.focus();
			return; }
		var totCostA = document.affordform.Square_Footage.value * 100
		document.affordform.hideCost.value = totCostA
		var totCost = outputComma(document.affordform.Square_Footage.value * 100)
		document.affordform.totCost.value = "$"+totCost
		return;
	}
	
	function calcCost2() {
		var sqFt2 = document.affordform.Square_Footage2.value;
		if (isNaN(sqFt2) || sqFt2 == "" ) {
			alert("Square Footage value error. Please re-enter only numbers. \nNo spaces, commas, ect.");
			document.affordform.Square_Footage2.value = "";
			document.affordform.Square_Footage2.focus();
			return; }
		var totCostA2 = document.affordform.Square_Footage2.value * 125
		document.affordform.hideCost.value = totCostA2
		var totCost2 = outputComma(document.affordform.Square_Footage2.value * 125)
		document.affordform.totCost2.value = "$"+totCost2
		return;
	}
	
	function calcCost3() {
		var sqFt3 = document.affordform.Square_Footage3.value;
		if (isNaN(sqFt3) || sqFt3 == "" ) {
			alert("Square Footage value error. Please re-enter only numbers. \nNo spaces, commas, ect.");
			document.affordform.Square_Footage3.value = "";
			document.affordform.Square_Footage3.focus();
			return; }
		var totCostA3 = document.affordform.Square_Footage3.value * 175
		document.affordform.hideCost.value = totCostA3
		var totCost3 = outputComma(document.affordform.Square_Footage3.value * 175)
		document.affordform.totCost3.value = "$"+totCost3
		return;
	}

function outputComma(n) {
  var arr=new Array('0'), i=0; 
  while (n>0) 
    {arr[i]=''+n%1000; n=Math.floor(n/1000); i++;}
  arr=arr.reverse();
  for (var i in arr) if (i>0) //padding zeros
    while (arr[i].length<3) arr[i]='0'+arr[i];
  return arr.join();
}