
function resetbutton(){
	document.reservation_form.reservation_submit.value = 'Next';
}
function validateAlertBorder(i){
	i.style.borderColor="#FF6666";
    i.style.borderWidth="2px";
    i.style.borderStyle="solid";
	resetbutton()
}
function validateRestoreBorder(x){
	x.style.borderTopColor="#CECECE";
	x.style.borderRightColor="#FDFDFD";
	x.style.borderBottomColor="#FDFDFD";
	x.style.borderLeftColor="#CECECE";
    x.style.borderWidth="2px";
    x.style.borderStyle="inset";
}


 

function ChooseSession(x,y,z) {
	document.reservation_form.session_chosen.value="y";


	if (y < 1) {
		alert ("Reminder: There are NO spots left for GIRLS in this session (" +  x + ").");
	}
	if (z < 1) {
		alert ("Reminder: There are NO spots left for BOYS in this session (" +  x + ").");
	}
}

var test = document.reservation_form.session_chosen.value;
alert(test);
	
	
function validateform() {

	document.reservation_form.reservation_submit.value = 'Please wait...';
	
	var itempath;	
	
	
	
	
	
	/*if (itempath.value == "") {
		alert("What week(s) do you want to attend?");
		validateAlertBorder(itempath)
		itempath.focus();
		return false;
	}*/
	
	itempath = document.reservation_form.session_chosen;
	if (itempath.value == "") {
			alert ("What session(s) do you want to attend?");
			resetbutton();
			return false;
	}
	
	itempath = document.reservation_form.first;
	if (itempath.value == "") {
			alert ("What is the first name of the camper?");
			validateAlertBorder(itempath);
			itempath.focus();
			return false;
	} else { validateRestoreBorder(itempath); }
	
	itempath = document.reservation_form.last;
	if (itempath.value == "") {
			alert ("What is the last name of the camper?");
			validateAlertBorder(itempath);
			itempath.focus();
			return false;
	} else { validateRestoreBorder(itempath); }
	
	itempath = document.reservation_form.birth_month;
	if (itempath.value == "") {
			alert ("What is the birth month of the camper?");
			validateAlertBorder(itempath);
			itempath.focus();
			return false;
	} else { validateRestoreBorder(itempath); }
	
	itempath = document.reservation_form.birth_day;
	if (itempath.value == "") {
			alert ("What is the birth day of the camper?");
			validateAlertBorder(itempath);
			itempath.focus();
			return false;
	} else { validateRestoreBorder(itempath); }
	
	itempath = document.reservation_form.birth_year;
	if (itempath.value == "") {
			alert ("What is the birth year of the camper?");
			validateAlertBorder(itempath);
			itempath.focus();
			return false;
	} else { validateRestoreBorder(itempath); }
	
	
	if (document.reservation_form.gender[0].checked == false && document.reservation_form.gender[1].checked == false) {
			alert ("What is the gender of the camper?");
			resetbutton();
			return false;
	}
	
	if (document.reservation_form.FirstTimeCamper[0].checked == false && document.reservation_form.FirstTimeCamper[1].checked == false) {
			alert ("Is this a first-time VBYC camper?");
			resetbutton();
			return false;
	}
	
	itempath = document.reservation_form.parents;
	if (itempath.value == "") {
			alert ("What is the name of the parent(s)?");
			validateAlertBorder(itempath);
			itempath.focus();
			return false;
	} else { validateRestoreBorder(itempath); }
	
	
	itempath = document.reservation_form.address;
	if (itempath.value == "") {
			alert ("What is your address?");
			validateAlertBorder(itempath);
			itempath.focus();
			return false;
	} else { validateRestoreBorder(itempath); }
	
	
	itempath = document.reservation_form.city;
	if (itempath.value == "") {
			alert ("What is your city?");
			validateAlertBorder(itempath);
			itempath.focus();
			return false;
	} else { validateRestoreBorder(itempath); }
	
	
	itempath = document.reservation_form.state;
	if (itempath.value == "") {
			alert ("What is your state?");
			validateAlertBorder(itempath);
			itempath.focus();
			return false;
	} else { validateRestoreBorder(itempath); }
	
	
	itempath = document.reservation_form.zip;
	if (itempath.value == "") {
			alert ("What is your zip code?");
			validateAlertBorder(itempath);
			itempath.focus();
			return false;
	} else { validateRestoreBorder(itempath); }
	
	
	itempath = document.reservation_form.phone_home;
	if (itempath.value == "") {
			alert ("What is your phone number?");
			validateAlertBorder(itempath);
			itempath.focus();
			return false;
	} else { validateRestoreBorder(itempath); }
	
	
	itempath = document.reservation_form.phone_emergency;
	if (itempath.value == "") {
			alert ("Please give an emergency phone number.");
			validateAlertBorder(itempath);
			itempath.focus();
			return false;
	} else { validateRestoreBorder(itempath); }
	
	
	itempath = document.reservation_form.emergency_contact;
	if (itempath.value == "") {
			alert ("Please give an emergency contact person.");
			validateAlertBorder(itempath);
			itempath.focus();
			return false;
	} else { validateRestoreBorder(itempath); }
	
	
	itempath = document.reservation_form.parents_email;
	if (itempath.value == "") {
			alert ("Please enter the parent's email address.");
			validateAlertBorder(itempath);
			itempath.focus();
			return false;
	} else { validateRestoreBorder(itempath); }
		
		
		
	if (document.reservation_form.forms[0].checked == false && document.reservation_form.forms[1].checked == false) {
			alert ("How would you like to receive your forms?");
			resetbutton();
			return false;
	}
		
		

	
	return true;
	
}