function updatePrice(subtotal) {
	var theForm = document.getElementById("RegistrationForm")
	gstExempt = theForm.GST_Exempt.checked;
	var creditAmount = theForm.Credit_Amount.value;
	var creditType = theForm.Credit_Type.value;
	var total = eval (gst) + eval (subtotal);
	var discount = 0;
	if (creditType == "Credit") {
		discount = creditAmount;
	} else if (creditType == "Discount") {
		discount = subtotal * (creditAmount);
	}
	var gst = ((subtotal - discount) * gstRate);
	if (gstExempt) {
		gst = 0;
	}
	var total = eval (gst) + eval (subtotal) - discount;
	curSubtotal = subtotal;
	subtotal = "$" + subtotal.toFixed(2);
	gst = "$" + gst.toFixed (2);
	total = "$" + total.toFixed (2);
	document.getElementById("Subtotal_Cell").innerHTML = subtotal;
	document.getElementById("GST_Cell").innerHTML = gst;
	document.getElementById("Total").innerHTML = total;
	if (discount > 0 && creditType == "Discount") {
		discount = "$" + discount.toFixed (2);
		document.getElementById("Discount").innerHTML = discount;
	}
}
function updateGSTExempt (price) {
	if (curSubtotal == 0) {
		curSubtotal = price;
	}
	gstExempt = document.getElementById("RegistrationForm").GST_Exempt.checked;
	updatePrice (curSubtotal);
}
function updateWorkshops(curChecked) {
	var theForm = document.getElementById("RegistrationForm");
	if (theForm.Registration_Rate_ID[0].checked) { // if single-day conference registration, only one green homebuilder workshop is allowed.
		for (var i = 0; i < theForm.Workshops.length; i++) {
			if (i != curChecked) {
				theForm.Workshops[i].checked = false;
			}
		}
		theForm.Workshops[curChecked].checked = true;
	} else if (!theForm.Workshops[curChecked].checked) { // is the field already checked off, and can it be unchecked?
		var checkedFlag = true;
		for (var i = 0; i < theForm.Workshops.length; i++) {
			if (theForm.Workshops[i].checked) {
				checkedFlag = false;
				break;
			}
		}
		theForm.Workshops[curChecked].checked = checkedFlag;
	}
	return false;
}
var gstRate = 0.05;
var gstExempt = false;
var curSubtotal = 0;
