var productIDs = ["Single", "Multi"];
var productPrices = {"Single":4.95, "Multi":11.95};

function total()
{
	var total = 0;
	var i;
	for (i = 0; i < productIDs.length; i++) {
		var element = document.getElementsByName("quantity" + productIDs[i])[0].value;
		total += element * productPrices[productIDs[i]];
	}
	
	total = roundNumber(total);
	if ((total + "").indexOf(".") != -1){
		if ((total + "").split(".")[1].length == 0){
			total += "00";
		} else if ((total + "").split(".")[1].length == 1){
			total += "0";
		}
	} else {
		total += ".00";
	}
	
	document.getElementById("total").innerHTML = "<b>Total: $" + total + "</b>";
	
	return total;
}

function roundNumber(number)
{
	return Math.round(number * Math.pow(10, 2)) / Math.pow(10, 2);
}

function submitForm()
{
	if (total() > 0.00) {
		return true;
	} else {
		return false;
	}
}