	var prices;
	var total;
	// return the value of the radio button that is checked
// return an empty string if none are checked, or
// there are no radio buttons
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '$' + num + '.' + cents);
}

	function updateForm() {
	  total = 0;
	  var elementNames = ["tirerot", "wiperstand", "wiperbeam"];
	  for (i in elementNames) {
	    var el = document.signup[elementNames[i]];
		total += el.checked ? el.value * 1 : 0;
	  }
	  total += getCheckedValue(document.signup.oilchangetype) * 1;
	 
	  total *= 1.055;
	  total = formatCurrency(total);

	  
	  document.getElementById("total").innerHTML = total;
	 				
	}
