
function validateForm(theForm)
{
	



if(""==document.forms.theForm.Firstname.value)
{
alert("Please enter your first name name.");
document.forms.theForm.Firstname.focus();
return false;
}

if(""==document.forms.theForm.Lastname.value)
{
alert("Please enter your last name.");
document.forms.theForm.Lastname.focus();
return false;
}

myOption = -1;
for (i=theForm.User6.length-1; i > -1; i--) {
if (theForm.User6[i].checked) {
myOption = i; i = -1;
}
}
if (myOption == -1) {
alert("You must select your gender");
return false;
}

if(""==document.forms.theForm.Birthdaya.value)
{
alert("Please enter your birthday.");
document.forms.theForm.Birthdaya.focus();
return false;
}
if(""==document.forms.theForm.Birthdayb.value)
{
alert("Please enter your birthday.");
return false;
}
if(""==document.forms.theForm.Birthdayc.value)
{
alert("Please enter your birthday.");
return false;
}
if(""==document.forms.theForm.Address.value)
{
alert("Please enter your mailing address.");
document.forms.theForm.Address.focus();
return false;
}
if(""==document.forms.theForm.City.value)
{
alert("Please enter your city.");
document.forms.theForm.City.focus();
return false;
}
if(""==document.forms.theForm.State.value)
{
alert("Please select your state.");
document.forms.theForm.State.focus();
return false;
}
if(""==document.forms.theForm.User7.value)
{
alert("Please select your county of residence.");
document.forms.theForm.User7.focus();
return false;
}
if(""==document.forms.theForm.Zip.value)
{
alert("Please enter your zip code.");
document.forms.theForm.Zip.focus();
return false;
}
if(""==document.forms.theForm.Phonea.value)
{
alert("Please enter your phone number.");
document.forms.theForm.Phonea.focus();
return false;
}
if(""==document.forms.theForm.Phoneb.value)
{
alert("Please enter your phone number.");
return false;
}
if(""==document.forms.theForm.Phonec.value)
{
alert("Please enter your phone number.");
return false;
}
if(""==document.forms.theForm.Email.value)
{
alert("Please enter your email address.");
document.forms.theForm.Email.focus();
return false;
}


if(""==document.forms.theForm.User36.value)
{
alert("Please select at least 1 volunteer opportunity.");
document.forms.theForm.User36.focus();
return false;
}

if(""==document.forms.theForm.SampleUser12.value)
{
alert("Please select the county you would like to volunteer in.");
document.forms.theForm.SampleUser12.focus();
return false;
}
myOption2 = -1;
for (i=theForm.User13.length-1; i > -1; i--) {
if (theForm.User13[i].checked) {
myOption2 = i; i = -1;
}
}
if (myOption2 == -1) {
alert("You must choose your volunteer location preference");
return false;
}

myOption4 = -1;
for (i=theForm.User26.length-1; i > -1; i--) {
if (theForm.User26[i].checked) {
myOption4 = i; i = -1;
}
}
if (myOption4 == -1) {
alert("Please indicate your criminal status.");
return false;
}

if(!document.theForm.User32.checked){alert("You must acknowledge that you have read, understand and commit to the saftey requirements.");
return false; }



if(!document.theForm.User31.checked){alert("You must acknowledge that you agree to the authorization and release.");
return false; }


return true;

}


function redirect_minor()
{
	//MINOR UNDER 18
		if(document.theForm.minor.value == "yes")
		{
			window.location="application_minors.htm";
		}
}


//GENERATES SCHOOLS DROPDOWNS
	function createSchools(targetArray)
	{
		document.theForm.User14.options.length = 1;//deletes all options in target except first, which is usually instructional
		document.theForm.User15.options.length = 1;//deletes all options in target except first, which is usually instructional
		document.theForm.User16.options.length = 1;//deletes all options in target except first, which is usually instructional
		
		if(targetArray)
		{
			var schools_data = eval(targetArray).split(";");
			//Fills in contact name for county
			//document.theForm.notification.value = schools_data[1];
			//document.theForm.contactemail.value = schools_data[1];

			var schools_array_ref = eval("schools_" + schools_data[2]);
			var schools_length = eval("schools_" + schools_data[2] + ".length");
			document.theForm.User12.value = schools_data[0];

			var theCount = 1;
			
			for(i = 0; i < schools_length; i++)
			{
				if(schools_array_ref[i] != undefined)
				{
					newOption1 = new Option(schools_array_ref[i], schools_array_ref[i]);//creates new Option object
					newOption2 = new Option(schools_array_ref[i], schools_array_ref[i]);//creates new Option object
					newOption3 = new Option(schools_array_ref[i], schools_array_ref[i]);//creates new Option object
					document.theForm.User14.options[theCount] = newOption1;//assigns new option to target
					document.theForm.User15.options[theCount] = newOption2;//assigns new option to target
					document.theForm.User16.options[theCount] = newOption3;//assigns new option to target
					theCount++;
				}
			}
			document.theForm.User14.disabled =false;
			document.theForm.User15.disabled = false;
			document.theForm.User16.disabled = false;
		}
		else
		{
			document.theForm.User12.value = "";
			document.theForm.User14.disabled = true;
			document.theForm.User15.disabled = true;
			document.theForm.User16.disabled = true;
		}
	}
	

	var datester = new Date();
	var todaysDate = (datester.getMonth() + 1) + "/" + datester.getDate() + "/" + datester.getFullYear();
	
	function loadInfo()
	{
		document.theForm.User2.value = todaysDate;
	}
	
	

function setVisibility(id, visibility) {
document.getElementById(id).style.display = visibility;
}