function get_prices(type) {
	var myArray = null;
	switch (type) {
		case "SPONSOR"				:	myArray = new Array(10000, 8000, 6500, 4500, 0);
										break;
		case "AD"					:	myArray = new Array(2500, 1500, 850, 150, 0);
										break;
		case "REGISTRATION-EARLY"	:	myArray = new Array(0, 100, 175, 100, 300);
										break;
		case "REGISTRATION-LATE"	:	myArray = new Array(0, 100, 250, 150, 350);
										break;
		case "ADDITIONAL"			:	myArray = new Array(450, 100);
										break;
	}
	return myArray;
}

function toggle_regchoice(a_choice) {
	// Calculate date difference
	var type = "REGISTRATION-EARLY";
	var today = new Date();
	var myDate = new Date();
	myDate.setFullYear(2010, 6, 7);
	if (today.valueOf() > myDate.valueOf()) 
		type = "REGISTRATION-LATE";
	// Determine if we need to display the member ID div
	var drop_flag = "none";
	var disabled_flag = "none";
	var data_array = get_prices(type);
	var price = 0;
	// Member ID div flag
	switch (a_choice) {
		case 1	:	disabled_flag = "block";
					break;
		case 2	:
		case 3	:	drop_flag = "block";
					break;
	}
	//document.getElementById("div-id").style.display = drop_flag;
	document.getElementById("veteran").style.display = disabled_flag;
	// Get the price of the registration
	if (data_array != null) price = data_array[a_choice];
	document.getElementById("total-due").value = price;
	if (a_choice == 0)
		document.getElementById("total").innerHTML = "";
	else
		document.getElementById("total").innerHTML = "AMOUNT DUE: $ " + price + ".00";
}

function exh_add() {
	// Get values
	var sponsorship = 0;
	for (i = 0; i < 5; i++) {
		if (document.regform.sponsorship[i].checked) {
			var data_array = get_prices("SPONSOR");
			sponsorship = data_array[i];
		}
	}
	var ad = 0;
	for (j = 0; j < 5; j++) {
		if (document.regform.ad[j].checked) {
			var data_array = get_prices("AD");
			ad = data_array[j];
		}
	}
	var data_array = get_prices("ADDITIONAL");
	var exhibitor = 0;
	if (document.getElementById("exhibitor").checked)
		exhibitor = data_array[0];
	var nonprofit = 0;
	if (document.getElementById("nonprofit").checked)
		nonprofit = data_array[1];
	// Print the results
	var total = parseInt(sponsorship) + parseInt(ad) + parseInt(exhibitor) + parseInt(nonprofit);
	document.getElementById("total-due").value = total;
	if (total == 0)
		document.getElementById("total").innerHTML = "";
	else
		document.getElementById("total").innerHTML = "AMOUNT DUE: $ " + total + ".00";
}

function toggle_div_ccchoice(a_choice) {
	var cc_div_flag = "none";
	var po_div_flag = "none";
	var ch_div_flag = "none";
	// Do we show credit card?
	if (a_choice == 1 || a_choice == 2) {
		cc_div_flag = "block";
		po_div_flag = "none";
		ch_div_flag = "none";
	}
	// Do we show purchase order?
	if (a_choice == 4) {
		cc_div_flag = "none";
		po_div_flag = "block";
		ch_div_flag = "none";
	}
	// Do we show check/money order box?
	if (a_choice == 3) {
		cc_div_flag = "none";
		po_div_flag = "none";
		ch_div_flag = "block";
	}
	document.getElementById("cc-div").style.display = cc_div_flag;
	document.getElementById("po-div").style.display = po_div_flag;
	document.getElementById("check-div").style.display = ch_div_flag;
}

//	---------------------------------------------------------------------
//	Function: toggle_div_billing
//	When user clicks on the different billing address check box, this
//	function determines whether it should show or hide the container
//	holding the billing address fields.
//	---------------------------------------------------------------------
function toggle_div_billing(a_choice) {
	if (!a_choice)
		document.getElementById("billing-addr-div").style.display = "none";
	else
		document.getElementById("billing-addr-div").style.display = "block";
}
//	---------------------------------------------------------------------
//	END toggle_div_billing
//	---------------------------------------------------------------------

function invoke_popup(id, path) {
	window.open(path, id, 'scrollbars=1, status=0, toolbar=0, height=320, width=500, menubar=0');
}
