function resetform() {
document.forms[0].elements[1]=="";
}
function submitApplication() {
	if (trueFname() && trueLname() && trueAddress() && trueCity() && trueState() && trueZip() && trueAge() && trueDate() && trueTime() && trueUnavailable() && trueEmployed() && truePay() && trueHours() && /*trueInterest() && */trueHighSchool() && trueGradYear() && trueAfterSchool() && trueAttendance() &&trueCustomerService() && trueExperience() && trueValue() && trueWishes() && trueQualities() && trueRef() && trueFelony() && trueSig()) 
	if (confirm("Do you want to submit your application?")) {
		return true;
	}
	else {
		alert("You have chosen to abort the submission.");
		return false;
	}
	else
	return false;	
}
function trueFname() {
	if (document.application.first_name.value == "" || document.application.first_name.value == "First Name")
	{
		alert ("The First Name field is required.\nPlease enter your First Name.")
		document.application.first_name.focus();
		return false;
	}
	return true;
}
function trueLname() {
	if (document.application.last_name.value == "" || document.application.last_name.value == "Last Name")
	{
		alert ("The Last Name field is required.\nPlease enter your Last Name.")
		document.application.last_name.focus();
		return false;
	}
	return true;
}
function trueAddress() {
	if (document.application.address.value == "")
	{
		alert ("The Present Address field is required.\nPlease enter your Present Address.")
		document.application.address.focus();
		return false;
	}
	return true;
}
function trueCity() {
	if (document.application.city.value == "")
	{
		alert ("The City field is required.\nPlease enter your City.")
		document.application.city.focus();
		return false;
	}
	return true;
}
function trueState() {
	if (document.application.state.value == "")
	{
		alert ("The State field is required.\nPlease enter your State.")
		document.application.state.focus();
		return false;
	}
	return true;
}
function trueZip() {
	if (document.application.zip.value == "")
	{
		alert ("The Zip Code field is required.\nPlease enter your Zip Code.")
		document.application.zip.focus();
		return false;
	}
	return true;
}
function trueAge() {
	if (!(document.application.age_18[0].checked || document.application.age_18[1].checked))
	{
		alert ("The \"Are you 18 years of age or older?\" field is required. Please select YES or NO.")
		return false;
	}
	return true;
}
function trueDate() {
	if (document.application.begin_month.value == "" || document.application.begin_month.value == "mm")
	{
		alert ("Question 1 under the heading \"Desired Employment\" is required.\nPlease complete application and try again.")
		document.application.begin_month.focus();
		return false;
	}
	else if (document.application.begin_day.value == "" || document.application.begin_day.value == "dd")
	{
		alert ("Question 1 under the heading \"Desired Employment\" is required.\nPlease complete application and try again.")
		document.application.begin_day.focus();
		return false;
	}
	else if (document.application.begin_year.value == "" || document.application.begin_year.value == "yyyy")
	{
		alert ("Question 1 under the heading \"Desired Employment\" is required.\nPlease complete application and try again.")
		document.application.begin_year.focus();
		return false;
	}
	return true;
}
function truePay() {
		if (document.application.desired_rate.value == "")
	{
		alert ("Question 2 under the heading \"Desired Employment\" is required.\nPlease complete application and try again.")
		document.application.desired_rate.focus();
		return false;
	}
	return true;
}
function trueTime() {
	if (document.application.time_period.value == "")
	{
		alert ("Question 3 under the heading \"Desired Employment\" is required.\nPlease complete application and try again.")
		document.application.time_period.focus();
		return false;
	}
	return true;
}
function trueHours() {
	if (document.application.hours_per_week.value == "")
	{
		alert ("Question 4 under the heading \"Desired Employment\" is required.\nPlease complete application and try again.")
		document.application.hours_per_week.focus();
		return false;
	}
	return true;
}
function trueUnavailable() {
	if (document.application.unavailable.value == "")
	{
		alert ("Question 5 under the heading \"Desired Employment\" is required.\nPlease complete application and try again.")
		document.application.unavailable.focus();
		return false;
	}
	return true;
}
function trueEmployed() {
if (!(document.application.employed[0].checked || document.application.employed[1].checked))
	{
		alert ("Question 5 under the heading \"Desired Employment\" is required.\nPlease complete application and try again.")
		return false;
	}
	return true;
}
/*function trueInterest() {
if (!(document.application.referred_by[0].checked || document.application.referred_by[1].checked || document.application.referred_by[2].checked || document.application.referred_by[3].checked || document.application.referred_by[4].checked))
	{
		alert ("Question 6 under the heading \"Desired Employment\" is required.\nPlease complete application and try again.")
		return false;
	}
	else if (document.application.referred_by[3].checked && document.application.friend.value == "") {
		alert ("You did not specify who referred you to Lull Farm.\nPlease complete application and try again.")
		document.application.friend.focus();
		return false;
	}
		else if (document.application.referred_by[4].checked && document.application.other.value == "") {
		alert ("You did not specify what sparked your interest in Lull Farm.\nPlease complete application and try again.")
		document.application.other.focus();
		return false;
	}
	return true;
}*/
function trueHighSchool() {
	if (document.application.high_school.value == "")
	{
		alert ("The name of your high school is required.\nPlease complete application and try again.")
		document.application.high_school.focus();
		return false;
	}
	return true;
}
function trueGradYear() {
	if (document.application.grad_year_hs.value == "" && (document.application.class_hs.value == "" || document.application.intended_year_hs.value == ""))
	{
		alert ("Your high school graduation year is required.\nIf have not yet graduated, select your current class standing and intended year of graduation.\nPlease complete application and try again.")
		document.application.grad_year_hs.focus();
		return false;
	}
	return true;
}
function trueAfterSchool() {
if (!(document.application.sports[0].checked || document.application.sports[1].checked))
	{
		alert ("The \"Are you invlolved in any after school activities or sports?\" question is required.\nPlease complete application and try again.")
		return false;
	}
	return true;
}
function trueAttendance() {
	if (document.application.attendance_punctuality.value == "")
	{
		alert ("Question 1 under the heading \"Questionaire\" is required.\nPlease complete application and try again.")
		document.application.attendance_punctuality.focus();
		return false;
	}
	return true;
}
function trueCustomerService() {
	if (document.application.customer_service.value == "")
	{
		alert ("Question 2 under the heading \"Questionaire\" is required.\nPlease complete application and try again.")
		document.application.customer_service.focus();
		return false;
	}
	return true;
}
function trueExperience() {
	if (document.application.life_experience.value == "")
	{
		alert ("Question 3 under the heading \"Questionaire\" is required.\nPlease complete application and try again.")
		document.application.life_experience.focus();
		return false;
	}
	return true;
}
function trueValue() {
	if (document.application.values.value == "")
	{
		alert ("Question 4 under the heading \"Questionaire\" is required.\nPlease complete application and try again.")
		document.application.values.focus();
		return false;
	}
	return true;
}
function trueWishes() {
	if (document.application.wish_1.value == "")
	{
		alert ("Question 5 under the heading \"Questionaire\" is not complete.\nPlease complete application and try again.")
		document.application.wish_1.focus();
		return false;
	}
	else if (document.application.wish_2.value == "")
	{
		alert ("Question 5 under the heading \"Questionaire\" is not complete.\nPlease complete application and try again.")
		document.application.wish_2.focus();
		return false;
	}
	else if (document.application.wish_3.value == "")
	{
		alert ("Question 5 under the heading \"Questionaire\" is not complete.\nPlease complete application and try again.")
		document.application.wish_3.focus();
		return false;
	}
	return true;
}
function trueQualities() {
	if (document.application.quality_1.value == "")
	{
		alert ("Question 6 under the heading \"Questionaire\" is not complete.\nPlease complete application and try again.")
		document.application.quality_1.focus();
		return false;
	}
	else if (!(document.application.quality_1.value == "") && document.application.why_1.value == "")
	{
		alert ("Question 6 under the heading \"Questionaire\" is not complete.\nPlease complete application and try again.")
		document.application.why_1.focus();
		return false;
	}
	else if (document.application.quality_2.value == "")
	{
		alert ("Question 6 under the heading \"Questionaire\" is not complete.\nPlease complete application and try again.")
		document.application.quality_2.focus();
		return false;
	}
	else if (!(document.application.quality_2.value == "") && document.application.why_2.value == "")
	{
		alert ("Question 6 under the heading \"Questionaire\" is not complete.\nPlease complete application and try again.")
		document.application.why_2.focus();
		return false;
	}
	else if (document.application.quality_3.value == "")
	{
		alert ("Question 6 under the heading \"Questionaire\" is not complete.\nPlease complete application and try again.")
		document.application.quality_3.focus();
		return false;
	}
	else if (!(document.application.quality_3.value == "") && document.application.why_3.value == "")
	{
		alert ("Question 6 under the heading \"Questionaire\" is not complete.\nPlease complete application and try again.")
		document.application.why_3.focus();
		return false;
	}
	return true;
}
function trueRef() {
	if (document.application.ref_name_1.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.ref_name_1.focus();
		return false;
	}
	else if (document.application.ref_phoneone_1.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.ref_phoneone_1.focus();
		return false;
	}
	else if (document.application.ref_phonetwo_1.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.ref_phonetwo_1.focus();
		return false;
	}
	else if (document.application.ref_phonethree_1.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.ref_phonethree_1.focus();
		return false;
	}
	else if (document.application.business_relation_1.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.business_relation_1.focus();
		return false;
	}
	else if (document.application.ref_years_1.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.ref_years_1.focus();
		return false;
	}
	else if (document.application.ref_name_2.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.ref_name_2.focus();
		return false;
	}
	else if (document.application.ref_phoneone_2.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.ref_phoneone_2.focus();
		return false;
	}
	else if (document.application.ref_phonetwo_2.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.ref_phonetwo_2.focus();
		return false;
	}
	else if (document.application.ref_phonethree_2.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.ref_phonethree_2.focus();
		return false;
	}
	else if (document.application.business_relation_2.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.business_relation_2.focus();
		return false;
	}
	else if (document.application.ref_years_2.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.ref_years_2.focus();
		return false;
	}
	else if (document.application.ref_name_3.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.ref_name_3.focus();
		return false;
	}
	else if (document.application.ref_phoneone_3.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.ref_phoneone_3.focus();
		return false;
	}
	else if (document.application.ref_phonetwo_3.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.ref_phonetwo_3.focus();
		return false;
	}
	else if (document.application.ref_phonethree_3.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.ref_phonethree_3.focus();
		return false;
	}
	else if (document.application.business_relation_3.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.business_relation_3.focus();
		return false;
	}
	else if (document.application.ref_years_3.value == "") 
	{
		alert ("Your must enter all information for 3 references.\nPlease complete application and try again.")
		document.application.ref_years_3.focus();
		return false;
	}
	return true;
}
function trueFelony() {
	if (!(document.application.felony[0].checked || document.application.felony[1].checked))
	{
		alert ("The \"Have you been convicted of a felony in the past 5 years?\" question is required.\nPlease complete application and try again.")
		return false;
	}
	else if (document.application.felony[0].checked && document.application.felony_explain.value =="")
	{
		alert ("An explanation of your conviction is required.\nPlease complete application and try again.")
		document.application.felony_explain.focus();
		return false;
	}
	return true;
}
function trueSig() {
	if (document.application.sig_name.value == "")
	{
		alert ("All fields for the Application Signature are required.\nPlease complete application and try again.")
		document.application.sig_name.focus();
		return false;
	}
	else if (document.application.sig_month.value == "" || document.application.sig_month.value == "mm")
	{
		alert ("All fields for the Application Signature are required.\nPlease complete application and try again.")
		document.application.sig_month.focus();
		return false;
	}
	else if (document.application.sig_day.value == "" || document.application.sig_day.value == "dd")
	{
		alert ("All fields for the Application Signature are required.\nPlease complete application and try again.")
		document.application.sig_day.focus();
		return false;
	}
	else if (document.application.sig_year.value == "" || document.application.sig_year.value == "yyyy")
	{
		alert ("All fields for the Application Signature are required.\nPlease complete application and try again.")
		document.application.sig_year.focus();
		return false;
	}
	else if (document.application.lastfour.value == "")
	{
		alert ("All fields for the Application Signature are required.\nPlease complete application and try again.")
		document.application.lastfour.focus();
		return false;
	}
	return true;
}
		

function submitForms() {
if (isEmail() && isFname() /*&& isLname() && isAddress() */&& isCity() && isState() /*&& isZip()*/)
if (confirm("Do you want to e-mail your submission?"))
{
return true;
}
else
{
alert("You have chosen to abort the submission.");
return false
}
else 
return false;
}
function isEmail() {
if (document.forms[0].elements[1].value == "") {
alert ("The E-Mail field is blank.\nPlease enter your E-Mail address.")
document.forms[0].elements[1].focus();
return false;
}
if (document.forms[0].elements[1].value.indexOf ('@',0) == -1 ||
document.forms[0].elements[1].value.indexOf ('.',0) == -1) {
alert ("The E-Mail field requires a '@' and a '.' be used.\nPlease re-enter your E-Mail address.")
document.forms[0].elements[1].select()
document.forms[0].elements[1].focus();
return false;
}
return true;
}
function isFname() {
if (document.forms[0].elements[2].value == "")
{
alert ("The First Name field is blank.\nPlease enter your First Name.")
document.forms[0].elements[2].focus();
return false;
}
return true;
}
function isLname() {
if (document.forms[0].elements[3].value == "") {
alert ("The Last Name field is blank.\nPlease enter your Last Name.")
document.forms[0].elements[3].focus();
return false;
}
return true;
}
function isAddress() {
if (document.forms[0].elements[4].value == "") {
alert ("The Address field is blank.\nPlease enter your Address.")
document.forms[0].elements[4].focus();
return false;
}
return true;
}
function isCity()
{
if (document.forms[0].elements[5].value == "")
{
alert ("The City field is blank.\nPlease enter your City.")
document.forms[0].elements[5].focus();
return false;
}
return true;
}
function isState() {
if (document.forms[0].elements[6].value == "") {
alert ("The State field is blank.\nPlease select your State.")
document.forms[0].elements[6].focus();
return false;
}
return true;
}
function isZip() {
if (document.forms[0].elements[7].value == "") {
alert ("The Zip Code field is blank.\nPlease enter your Zip Code.")
document.forms[0].elements[7].focus();
return false;
}
return true;
}
