// Validation Sheet for Come to Africa / Outreach Form

function checkPassportName(value) {
	
	var fieldDiv = document.getElementById('passportNameOtherFields');
	
	if(value == "no") {
		fieldDiv.innerHTML = '<input type="text" name="passportNameOther" id="passportNameOther"/>';
	} else {
		fieldDiv.innerHTML = "";
	}
	
}

function tripValidate() {
	
	//#### Applicant Information ####//
	
	if(document.getElementById('date').value == "") {
		alert("Please Enter [Today's Date]");
		document.getElementById('date').select(this);
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('lname').value == "") {
		alert("Please Enter Your [Last Name]");
		document.getElementById('lname').select(this);	
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('fname').value == "") {
		alert("Please Enter Your [First Name]");
		document.getElementById('fname').select(this);	
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('mname').value == "") {
		alert("Please Enter Your [Middle Name]");
		document.getElementById('mname').select(this);	
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('passport_nameY').checked == false && document.getElementById('passport_nameN').checked == false) {
		alert("Please Indicate [If This is Your Passport Name]");
		document.getElementById('passport_nameY').focus();
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('passport_nameN').checked == true && document.getElementById('passportNameOther').value == "") {
		alert("Please Enter [Your Passport Name]");
		document.getElementById('passportNameOther').select(this);
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('birth_date').value == "") {
		alert("Please Enter Your [Birth Date]");
		document.getElementById('birth_date').select(this);
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('sexM').checked == false && document.getElementById('sexF').checked == false) {
		alert("Please Indicate [Your Sex]");
		document.getElementById('sexM').focus();
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('employer').value == "") {
		alert("Please Enter Your [Employer]");
		document.getElementById('employer').select(this);	
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('occupation').value == "") {
		alert("Please Enter Your [Occupation]");
		document.getElementById('occupation').select(this);
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('work_phone').value == "") {
		alert("Please Enter Your [Work Phone]");
		document.getElementById('work_phone').select(this);	
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('home_phone').value == "") {
		alert("Please Enter Your [Home Phone]");
		document.getElementById('home_phone').select(this);	
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('cell_phone').value == "") {
		alert("Please Enter Your [Cell Phone]");
		document.getElementById('cell_phone').select(this);	
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('address').value == "") {
		alert("Please Enter Your [Address]");
		document.getElementById('address').select(this);
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('city').value == "") {
		alert("Please Enter Your [City]");
		document.getElementById('city').select(this);
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('city').value == "") {
		alert("Please Enter Your [City]");
		document.getElementById('city').select(this);
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('state').value == "") {
		alert("Please Select Your [State]");
		document.getElementById('state').focus();	
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('zip').value == "") {
		alert("Please Enter Your [Zip Code]");
		document.getElementById('zip').select(this);
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('email').value == "") {
		alert("Please Enter Your [Email Address]");
		document.getElementById('email').select(this);
		window.location.href="#applicant-information";
		return false;
	} else {
		if(document.getElementById('email').value.indexOf(".") == -1 || document.getElementById('email').value.indexOf("@") == -1) {
			alert("Please Enter A Valid [Email Address]");
			document.getElementById('email').select(this);
			window.location.href="#applicant-information";
			return false;
		}
	}
	
	if(document.getElementById('church').value == "") {
		alert("Please Enter Your [Church]");
		document.getElementById('church').select(this);
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('church_address').value == "") {
		alert("Please Enter Your [Church's Address]");
		document.getElementById('church_address').select(this);
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('church_phone').value == "") {
		alert("Please Enter Your [Church's Phone Number]");
		document.getElementById('church_phone').select(this);
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('pastor').value == "") {
		alert("Please Enter Your [Church's Pastor]");
		document.getElementById('pastor').select(this);
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('denomination').value == "") {
		alert("Please Enter Your [Church's Denomination]");
		document.getElementById('denomination').select(this);
		window.location.href="#applicant-information";
		return false;
	}
	
	if(document.getElementById('newsletterY').checked == false && document.getElementById('newsletterN').checked == false) {
		alert("Please Indicate [Newsletter Preference]");
		document.getElementById('newsletterY').focus();
		window.location.href="#applicant-information";
		return false;
	}
	
	//#### Emergency Medical Information ####//
	
	if(document.getElementById('allergies').value == "") {
		alert("Please Enter Your [Allergies OR N/A]");
		document.getElementById('allergies').select(this);
		window.location.href="#emergency-medical-information";
		return false;
	}
	
	if(document.getElementById('medications').value == "") {
		alert("Please Enter Your [Medications OR N/A]");
		document.getElementById('medications').select(this);
		window.location.href="#emergency-medical-information";
		return false;
	}
	
	if(document.getElementById('doctor').value == "") {
		alert("Please Enter Your [Doctor's Name]");
		document.getElementById('doctor').select(this);
		window.location.href="#emergency-medical-information";
		return false;
	}
	
	if(document.getElementById('doctor_phone').value == "") {
		alert("Please Enter Your [Doctor's Phone]");
		document.getElementById('doctor_phone').select(this);
		window.location.href="#emergency-medical-information";
		return false;
	}
	
	if(document.getElementById('tetanus_shot').value == "") {
		alert("Please Enter Your [Last Tetanus Shot Date]");
		document.getElementById('tetanus_shot').select(this);
		window.location.href="#emergency-medical-information";
		return false;
	}
	
	if(document.getElementById('emergency_contact').value == "") {
		alert("Please Enter Your [Emergency Contact]");
		document.getElementById('emergency_contact').select(this);
		window.location.href="#emergency-medical-information";
		return false;
	}
	
	if(document.getElementById('emergency_contact_relationship').value == "") {
		alert("Please Enter Your [Emergency Contact's Relationship to You]");
		document.getElementById('emergency_contact_relationship').select(this);
		window.location.href="#emergency-medical-information";
		return false;
	}
	
	if(document.getElementById('emergency_contact_phone_day').value == "") {
		alert("Please Enter Your [Emergency Contact's Daytime Phone Number]");
		document.getElementById('emergency_contact_phone_day').select(this);
		window.location.href="#emergency-medical-information";
		return false;
	}
	
	if(document.getElementById('emergency_contact_phone_evening').value == "") {
		alert("Please Enter Your [Emergency Contact's Evening Phone Number]");
		document.getElementById('emergency_contact_phone_evening').select(this);
		window.location.href="#emergency-medical-information";
		return false;
	}
	
	if(document.getElementById('alt_emergency_contact').value == "") {
		alert("Please Enter Your [An Alternate Emergency Contact]");
		document.getElementById('alt_emergency_contact').select(this);
		window.location.href="#emergency-medical-information";
		return false;
	}
	
	if(document.getElementById('alt_emergency_contact_relationship').value == "") {
		alert("Please Enter Your [Your Alternate Emergency Contact's Relationship to You]");
		document.getElementById('alt_emergency_contact_relationship').select(this);
		window.location.href="#emergency-medical-information";
		return false;
	}
	
	if(document.getElementById('alt_emergency_contact_phone_day').value == "") {
		alert("Please Enter Your [Your Alternate Emergency Contact's Daytime Phone Number]");
		document.getElementById('alt_emergency_contact_phone_day').select(this);
		window.location.href="#emergency-medical-information";
		return false;
	}
	
	if(document.getElementById('alt_emergency_contact_phone_evening').value == "") {
		alert("Please Enter Your [Your Alternate Emergency Contact's Evening Phone Number]");
		document.getElementById('alt_emergency_contact_phone_evening').select(this);
		window.location.href="#emergency-medical-information";
		return false;
	}
	
	//#### Travel Document Information ####//
	
	if(document.getElementById('has_passportY').checked == false && document.getElementById('has_passportN').checked == false) {
		alert("Please Indicate [If You Have a Passport]");
		document.getElementById('has_passportY').focus();
		window.location.href="#travel-document-information";
		return false;
	}
	
	if(document.getElementById('passport_country').value == "") {
		alert("Please Enter Your [Passport Country]");
		document.getElementById('passport_country').select(this);
		window.location.href="#travel-document-information";
		return false;
	}
	
	if(document.getElementById('passport_expiration').value == "") {
		alert("Please Enter Your [Passport Expiration]");
		document.getElementById('passport_expiration').select(this);
		window.location.href="#travel-document-information";
		return false;
	}
	
	if(document.getElementById('passport_number').value == "") {
		alert("Please Enter Your [Passport Number]");
		document.getElementById('passport_number').select(this);
		window.location.href="#travel-document-information";
		return false;
	}
	
	if(document.getElementById('passport_citizenship').value == "") {
		alert("Please Enter Your [Passport Citizenship]");
		document.getElementById('passport_citizenship').select(this);
		window.location.href="#travel-document-information";
		return false;
	}
	
	if(document.getElementById('passport_birthcitystate').value == "") {
		alert("Please Enter Your [Passport Birth City and State]");
		document.getElementById('passport_birthcitystate').select(this);
		window.location.href="#travel-document-information";
		return false;
	}
	
	if(document.getElementById('passport_birthcountry').value == "") {
		alert("Please Enter Your [Passport Birth Country]");
		document.getElementById('passport_birthcountry').select(this);
		window.location.href="#travel-document-information";
		return false;
	}
	
	//#### Experience & Qualifications ####//
	
	if(document.getElementById('how_hear').value == "") {
		alert("Please Enter [How You Heard About Us]");
		document.getElementById('how_hear').select(this);
		window.location.href="#experience-qualifications";
		return false;
	}
	
	if(document.getElementById('has_traveledY').checked == false && document.getElementById('has_traveledN').checked == false) {
		alert("Please Indicate [If You Have Traveled Outside the US]");
		document.getElementById('has_traveledY').focus();
		window.location.href="#experience-qualifications";
		return false;
	}
	
	if(document.getElementById('why_go').value == "") {
		alert("Please Enter [Why You Want to Go on This Trip]");
		document.getElementById('why_go').select(this);
		window.location.href="#experience-qualifications";
		return false;
	}
	
	if(document.getElementById('mission_experience').value == "") {
		alert("Please Enter [Any Mission Experience or N/A]");
		document.getElementById('mission_experience').select(this);
		window.location.href="#experience-qualifications";
		return false;
	}
	
	if(document.getElementById('other_ministry_experience').value == "") {
		alert("Please Enter [Any Other Mission Experience or N/A]");
		document.getElementById('other_ministry_experience').select(this);
		window.location.href="#experience-qualifications";
		return false;
	}
	
	if(document.getElementById('leadership_positions').value == "") {
		alert("Please Enter [Any Leadership Experience or N/A]");
		document.getElementById('leadership_positions').select(this);
		window.location.href="#experience-qualifications";
		return false;
	}
	
	if(document.getElementById('enjoy_childrenY').checked == false && document.getElementById('enjoy_childrenN').checked == false) {
		alert("Please Indicate [If You Enjoy Working With Children]");
		document.getElementById('enjoy_childrenY').focus();
		window.location.href="#experience-qualifications";
		return false;
	}
	
	if(document.getElementById('skills_experience').value == "") {
		alert("Please Enter [Any Useful Skills or Experience or N/A]");
		document.getElementById('skills_experience').select(this);
		window.location.href="#experience-qualifications";
		return false;
	}
	
	if(document.getElementById('medical_training').value == "") {
		alert("Please Enter [Any Medical Training or N/A]");
		document.getElementById('medical_training').select(this);
		window.location.href="#experience-qualifications";
		return false;
	}
	
	if(document.getElementById('fundraisingAll').checked == false && document.getElementById('fundraisingPart').checked == false && document.getElementById('fundraisingNotSure').checked == false && document.getElementById('fundraisingNone').checked == false) {
		alert("Please Indicate [If You Will be Doing Any Fundraising]");
		document.getElementById('fundraisingAll').focus();
		window.location.href="#experience-qualifications";
		return false;
	}
	
	if(document.getElementById('faith_story').value == "") {
		alert("Please Enter Your [Spiritual Condition or Faith Story]");
		document.getElementById('faith_story').select(this);
		window.location.href="#experience-qualifications";
		return false;
	}
	
	if(document.getElementById('legal_info').value == "") {
		alert("Please Enter [Any Legal Info We Should Know or N/A]");
		document.getElementById('legal_info').select(this);
		window.location.href="#experience-qualifications";
		return false;
	}
	
	if(document.getElementById('sex_offenderY').checked == false && document.getElementById('sex_offenderN').checked == false) {
		alert("Please Indicate [If Your Name is Listed on Any Sex Offender Registry]");
		document.getElementById('sex_offenderY').focus();
		window.location.href="#experience-qualifications";
		return false;
	}
	
	//
	
	//#### Physical Requirements ####//
	
	if(document.getElementById('physical_fitness').checked == false) {
		alert("Please Read and Agree to the [Physical Fitness Statement]");
		document.getElementById('physical_fitness').select(this);
		window.location.href="#physical-requirements";
		return false;
	}
	
	if(document.getElementById('medical_conditions').checked == false) {
		alert("Please Read and Agree to the [Medical Conditions Statement]");
		document.getElementById('medical_conditions').select(this);
		window.location.href="#physical-requirements";
		return false;
	}
	
	if(document.getElementById('prescriptions').checked == false) {
		alert("Please Read and Agree to the [Prescriptions Statement]");
		document.getElementById('prescriptions').select(this);
		window.location.href="#physical-requirements";
		return false;
	}
	
	if(document.getElementById('health_questions').checked == false) {
		alert("Please Read and Agree to the [Health Questions Statement]");
		document.getElementById('health_questions').select(this);
		window.location.href="#physical-requirements";
		return false;
	}
	
	if(document.getElementById('psychological_conditions').checked == false) {
		alert("Please Read and Agree to the [Psychological Conditions Statement]");
		document.getElementById('psychological_conditions').select(this);
		window.location.href="#physical-requirements";
		return false;
	}
	
	//
	
	//#### Health Information ####//
	
	if(document.getElementById('health_sickY').checked == false && document.getElementById('health_sickN').checked == false) {
		alert("Please Indicate [If You are Currently Being Treated for an Illness]");
		document.getElementById('health_sickY').focus();
		window.location.href="#health-information";
		return false;
	}
	
	if(document.getElementById('allergic_medsY').checked == false && document.getElementById('allergic_medsN').checked == false) {
		alert("Please Indicate [If You Are Allergic to any Meds]");
		document.getElementById('allergic_medsY').focus();
		window.location.href="#health-information";
		return false;
	}
	
	if(document.getElementById('other_allergiesY').checked == false && document.getElementById('other_allergiesN').checked == false) {
		alert("Please Indicate [If You Have Other Allergies]");
		document.getElementById('other_allergiesY').focus();
		window.location.href="#health-information";
		return false;
	}
	
	if(document.getElementById('eating_disorderY').checked == false && document.getElementById('eating_disorderN').checked == false) {
		alert("Please Indicate [If You Have Had an Eating Disorder");
		document.getElementById('eating_disorderY').focus();
		window.location.href="#health-information";
		return false;
	}
	
	if(document.getElementById('special_dietY').checked == false && document.getElementById('special_dietN').checked == false) {
		alert("Please Indicate [If You Have Special Diet Requirements");
		document.getElementById('special_dietY').focus();
		window.location.href="#health-information";
		return false;
	}
	
	if(document.getElementById('sleeping_problemsY').checked == false && document.getElementById('sleeping_problemsN').checked == false) {
		alert("Please Indicate [If You Have Sleeping Problems");
		document.getElementById('sleeping_problemsY').focus();
		window.location.href="#health-information";
		return false;
	}
	
	if(document.getElementById('nervousY').checked == false && document.getElementById('nervousN').checked == false) {
		alert("Please Indicate [If You Get Nervous or Upset Easily");
		document.getElementById('nervousY').focus();
		window.location.href="#health-information";
		return false;
	}
	
	if(document.getElementById('psychiatric_careY').checked == false && document.getElementById('psychiatric_careN').checked == false) {
		alert("Please Indicate [If You Have Had Phsychiatric Care");
		document.getElementById('psychiatric_careY').focus();
		window.location.href="#health-information";
		return false;
	}
	
	if(document.getElementById('depressionY').checked == false && document.getElementById('depressionN').checked == false) {
		alert("Please Indicate [If You Have Been Treated for Depression");
		document.getElementById('depressionY').focus();
		window.location.href="#health-information";
		return false;
	}
	
	if(document.getElementById('physical_disabilitiesY').checked == false && document.getElementById('physical_disabilitiesN').checked == false) {
		alert("Please Indicate [If You Have Any Physical Disabilities");
		document.getElementById('physical_disabilitiesY').focus();
		window.location.href="#health-information";
		return false;
	}
	
	if(document.getElementById('seizuresY').checked == false && document.getElementById('seizuresN').checked == false) {
		alert("Please Indicate [If You Have Ever Had a Seizure Disorder");
		document.getElementById('seizuresY').focus();
		window.location.href="#health-information";
		return false;
	}

	if(document.getElementById('breathingY').checked == false && document.getElementById('breathingN').checked == false) {
		alert("Please Indicate [If You Have Any Breathing Problems");
		document.getElementById('breathingY').focus();
		window.location.href="#health-information";
		return false;
	}
	
	if(document.getElementById('heart_murmurY').checked == false && document.getElementById('heart_murmurN').checked == false) {
		alert("Please Indicate [If You Have Ever Had a Heart Murmur");
		document.getElementById('heart_murmurY').focus();
		window.location.href="#health-information";
		return false;
	}
	
	if(document.getElementById('kidney_diseaseY').checked == false && document.getElementById('kidney_diseaseN').checked == false) {
		alert("Please Indicate [If You Have Ever Had Kidney Disease");
		document.getElementById('kidney_diseaseY').focus();
		window.location.href="#health-information";
		return false;
	}
	
	if(document.getElementById('diabetesY').checked == false && document.getElementById('diabetesN').checked == false) {
		alert("Please Indicate [If You Have Ever Had Diabetes");
		document.getElementById('diabetesY').focus();
		window.location.href="#health-information";
		return false;
	}

	//
	
	//#### Self Evaluation ####//
	
	
	if(document.getElementById('eval_strengths').value == "") {
		alert("Please Describe [Three Strengths]");
		document.getElementById('eval_strengths').select(this);
		window.location.href="#self-evaluation";
		return false;
	}
	
	if(document.getElementById('eval_weaknesses').value == "") {
		alert("Please Describe [Three Weaknesses]");
		document.getElementById('eval_weaknesses').select(this);
		window.location.href="#self-evaluation";
		return false;
	}
	
	if(document.getElementById('eval_tobaccoY').checked == false && document.getElementById('eval_tobaccoN').checked == false) {
		alert("Please Indicate [If You Been Involved with Tobacco in the Last Year");
		document.getElementById('eval_tobaccoY').focus();
		window.location.href="#self-evaluation";
		return false;
	}
	
	if(document.getElementById('eval_alcoholY').checked == false && document.getElementById('eval_alcoholN').checked == false) {
		alert("Please Indicate [If You Been Involved with Alcohol in the Last Year");
		document.getElementById('eval_alcoholY').focus();
		window.location.href="#self-evaluation";
		return false;
	}
	
	if(document.getElementById('eval_drugsY').checked == false && document.getElementById('eval_drugsN').checked == false) {
		alert("Please Indicate [If You Been Involved with Illegal Drugs in the Last Year");
		document.getElementById('eval_drugsY').focus();
		window.location.href="#self-evaluation";
		return false;
	}
	
	if(document.getElementById('eval_gangsY').checked == false && document.getElementById('eval_gangsN').checked == false) {
		alert("Please Indicate [If You Been Involved with Gang-Related Activity in the Last Year");
		document.getElementById('eval_gangsY').focus();
		window.location.href="#health-information";
		return false;
	}
	
	if(document.getElementById('eval_cultY').checked == false && document.getElementById('eval_cultN').checked == false) {
		alert("Please Indicate [If You Been Involved with a Cult or the Occult in the Last Year");
		document.getElementById('eval_cultY').focus();
		window.location.href="#self-evaluation";
		return false;
	}
	
	//
	
	
	//#### Final Agreements ####//
	
	if(document.getElementById('captchaCode').value == "") {
		alert("Please Enter the [Code]");
		document.getElementById('captchaCode').select(this);
		return false;
	}
	
	if(document.getElementById('agreementBox').value == "") {
		alert("Please Read & Agree to our Policies and Agreements");
		document.getElementById('agreementBox').focus();
		return false;
	}
	
	
}
