
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 showAddForms(radioObj){
	
	//var curItemStandard = eval("document.getElementById('standard_form1').style");
	var curItemStudent = eval("document.getElementById('student_form1').style");
	
	var radioValue = getCheckedValue(radioObj);
	
	if((radioValue == "Student") || (radioValue == "Registered Student Organization")){
		curItemStudent.display = "";
		//curItemStandard.display = "none";
		}
	else{
		curItemStudent.display = "none";
		//curItemStandard.display = "";
		}
	}
	


function calcTotal(){
	
	var cur_alc_under21 = document.form1.alc_under21;
	var cur_alc_members = document.form1.alc_members;
	var cur_alc_guests = document.form1.alc_guests;
	var cur_alc_total = document.form1.alc_total;
	
	if(!cur_alc_under21.value){
		cur_alc_under21.value = 0;
		}	
	if(!cur_alc_members.value){
		cur_alc_members.value = 0;
		}
	if(!cur_alc_guests.value){
		cur_alc_guests.value = 0;
		}
	
	
	var re = /^[0-9]+$/;

	if((re.exec(cur_alc_under21.value)) && (re.exec(cur_alc_members.value)) && (re.exec(cur_alc_guests.value))){
		cur_alc_total.value = ((cur_alc_under21.value * 1) + (cur_alc_members.value * 1) + (cur_alc_guests.value * 1));
		}
	
	else{
		cur_alc_under21.value = "";
		cur_alc_members.value = "";
		cur_alc_guests.value = "";
		cur_alc_total.value = "";
		alert("Please enter numerals only under Item 9 - Estimated Attendance");
		}
	
	}
	
function zeroOther(){

	var selValue = document.form1.location1[document.form1.location1.selectedIndex].value;
	
	if(selValue > 0){
		document.form1.alc_event_location_other.value = "";
		document.form1.alc_reservationist_name.value = "";
		document.form1.alc_reservationist_email.value = "";
		}
	}
	
function zeroDrop(){

	var curLoc = document.form1.alc_event_location_other.value;
	var curName = document.form1.alc_reservationist_name.value;
	var curEmail = document.form1.alc_reservationist_email.value;
	
	// ZERO THE DROPDOWN
	document.form1.location1.selectedIndex = 0;
	
	// RESET
	document.form1.alc_event_location_other.value = curLoc;
	document.form1.alc_reservationist_name.value = curName;
	document.form1.alc_reservationist_email.value = curEmail;


	}