function formCheck(myForm) {
	if (myForm.name.value == "") {
	alert ("Please enter your Name");
	myForm.name.focus();
	return false;
	}
	if (myForm.email.value == "") {
	alert ("Please enter your E-mail Address");
	myForm.email.focus();
	return false;
	}
return true;
}

function valButton(btn) {
	var cnt = -1;
	for (var i=btn.length-1; i > -1; i--) {
	   if (btn[i].checked) {
		   cnt = i; 
		   i = -1;
	   }
	}
	if (cnt > -1) {
		return true;
	}else{ 
		return null;
	}
}

function appCheck(appForm) {
	// Required text field list - Field Name : Alert Message
	var reQd_txt = {
	'last_name' : 'your Last Name',
	'first_name' : 'your First Name',
	'home_phone' : 'your Home Phone',
	'address' : 'your Address',
	'city' : 'your City',
	'state' : 'your State',
	'zip' : 'your Zip Code',
	'email' : 'your Email Address',
	'call_day' : 'the Best Day To Call',
	'call_time' : 'the Best Time To Call',
	'desired_salary' : 'your Desired Salary',
	'hs_name' : 'your High School Name',
	'hs_city' : 'your High School City',
	'hs_state' : 'your High School State',
	'hs_country' : 'your High School Country',
	'hs_years' : 'your High School Highest Grade Completed',
	'cv_name' : 'your College-Vocational School Name',
	'cv_city' : 'your College-Vocational School City',
	'cv_state' : 'your College-Vocational School State',
	'cv_country' : 'your College-Vocational School Country',
	'cv_degree_level' : 'your College-Vocational School Level and Type',
	'lic1_type' : 'your License - Certification Type',
	'lic1_cert' : 'your License - Certification Number',
	'lic1_state' : 'your License - Certification State',
	'lic1_exp' : 'your License - Certification Expiration Date',
	'facility_1' : 'your Employer No.1 Name',
	'facility_1_city' : 'your Employer No.1 City',
	'facility_1_state' : 'your Employer No.1 State',
	'facility_1_country' : 'your Employer No.1 Country',
	'facility_1_phone' : 'your Employer No.1 Phone',
	'facility_1_begin_mo' : 'your Employer No.1 Begin Employment Month',
	'facility_1_begin_yr' : 'your Employer No.1 Begin Employment Year',
	'facility_1_end_mo' : 'your Employer No.1 End Employment Month',
	'facility_1_end_yr' : 'your Employer No.1 End Employment Year',
	'facility_1_dept' : 'your Employer No.1 Department',
	'facility_1_title' : 'your Employer No.1 Title',
	'facility_1_supervisor' : 'your Employer No.1 Supervisor',
	'facility_1_beds' : 'your Employer No.1 Beds',
	'facility_1_reason' : 'your Employer No.1 Reason for leaving',
	'facility_1_salary' : 'your Employer No.1 Pay Rate/Salary',
	'reference_1_name' : 'your Reference No.1 Name',
	'reference_1_title' : 'your Reference No.1 Title',
	'reference_1_phone' : 'your Reference No.1 Phone',
	'reference_2_name' : 'your Reference No.2 Name',
	'reference_2_title' : 'your Reference No.2 Title',
	'reference_2_phone' : 'your Reference No.2 Phone',
	'reference_3_name' : 'your Reference No.3 Name',
	'reference_3_title' : 'your Reference No.3 Title',
	'reference_3_phone' : 'your Reference No.3 Phone'
	};
	// Check required text fields
	for (test_fiEld in reQd_txt){
		var tempField = "";
		tempField = eval('appForm.'+test_fiEld+'.value');
		if (tempField == "") {
			var tempMesage = "Please enter "+reQd_txt[test_fiEld];
			alert (tempMesage);
			eval('appForm.'+test_fiEld+'.focus()');
			return false;
		}
	}
	// Check checkboxes
	var tow_noNe = "";
	// Check for no entries in Type of Work Desired
	var reQd_tow = {
	'1' : 'work_type_h', 
	'2' : 'work_type_ltc', 
	'3' : 'work_type_hh', 
	'4' : 'work_type_r', 
	'5' : 'work_type_c', 
	'6' : 'work_type_o'
	};
	for (test_bOx in reQd_tow){
		var tempBox = eval('appForm.'+reQd_tow[test_bOx]+'.checked');
		if (tempBox == 1){
			tow_noNe = "no";
		}
	}
	// Alert for no entries in Type of Work Desired
	if (tow_noNe !== 'no') {
		alert ('Please choose at least one Type of Work Desired');
		appForm.work_type_h.focus();
		return false;
	}
	// Alert for Type of Work/Clinic Details
	if ((appForm.work_type_c.checked)&&(appForm.work_type_clinic.value == "")) {
		alert ('Please enter more detail for- Type of Work Desired/Clinic');
		appForm.work_type_clinic.focus();
		return false;
	}
	// Alert for Type of Work/Other Details
	if ((appForm.work_type_o.checked)&&(appForm.work_type_other.value == "")) {
		alert ('Please enter more detail for- Type of Work Desired/Other');
		appForm.work_type_other.focus();
		return false;
	}
	// Check required radio buttons
	var reQd_rad = {
	'poSition' : 'the Position Applying For',
	'cv_degree' : 'your College-Vocational School Degree completed',
	'lic_revoked' : 'your License - Certification License Revoked',
	'facility_1_contact' : 'your Employer No.1 Contact Approval',
	'facility_1_supervisory' : 'your Employer No.1 Supervisory Experience',
	'facility_1_aka' : 'your Employer No.1 Another Name'
	};
	// validate radio buttons
	for (test_Rad in reQd_rad){
		var btn = "";
		var tempRad = eval('appForm.'+test_Rad);
		var btn = valButton(tempRad);
		if (btn == null) {
			var tempradMesage = ("Please enter "+reQd_rad[test_Rad]);
			alert (tempradMesage);
			var tempFoc = ('appForm.'+test_Rad+'[0].focus()');
			eval(tempFoc);
			return false;
		}
	}
	// Check for missing details
	// Check license revocation details
	if ((appForm.lic_revoked[0].checked == true)&&(appForm.lic_revoked_reason.value == "")) {
		alert ('Please enter more detail for- License revocation details');
		appForm.lic_revoked_reason.focus();
		return false;
	}
	// Check Position Other
	if ((appForm.poSition[9].checked == true)&&(appForm.position_other.value == "")) {
		alert ('Please enter more detail for- Position Other');
		appForm.position_other.focus();
		return false;
	}
	// Do not contact details
	if ((appForm.facility_1_contact[1].checked == true)&&(appForm.facility_1_contact_whyno.value == "")) {
		alert ('Please enter more detail for- Employer No. 1 Do not contact details');
		appForm.facility_1_contact_whyno.focus();
		return false;
	}
	// Supervisory Exp. details
	if ((appForm.facility_1_supervisory[0].checked == true)&&(appForm.facility_1_supervisory_yes.value == "")) {
		alert ('Please enter more detail for- Employer No. 1 Supervisory Experience details');
		appForm.facility_1_supervisory_yes.focus();
		return false;
	}
	// AKA details
	if ((appForm.facility_1_aka[0].checked == true)&&(appForm.facility_1_aka_yes.value == "")) {
		alert ('Please enter more detail for- Employer No. 1 Alternate Name details');
		appForm.facility_1_aka_yes.focus();
		return false;
	}
	// Alert for Applicant Acknowledgment
	if (!appForm.approval.checked) {
		alert ('Please enter your Approval of the Applicant Acknowledgment');
		appForm.approval.focus();
		return false;
	}
return true;
}


