function checkCompleteCapture() {
	var answer = confirm("Entry complete! The candidate will now be mailed his/her login details.\nYou will now be redirected to the CV on-screen preview.");
	if (answer) {
		window.location='capturecv-complete.php';
	} else {}
}

function checkStep9() {
	var companyname = document.myform.companyname;
	var jobtitle = document.myform.jobtitle;
	var employedfrom_month = document.myform.employedfrom_month;
	var employedfrom_year = document.myform.employedfrom_year;
	var employedto_month = document.myform.employedto_month;
	var employedto_year = document.myform.employedto_year;
	var responsibilities = document.myform.responsibilities;
	var achievements = document.myform.achievements;
	var package = document.myform.package;
	var package_per = document.myform.package_per;
	var benefits = document.myform.benefits;
	
	if (companyname.value == "") {
		alert("Please enter the Company Name");
		companyname.focus();
		return false;
	}
	if (companyname.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from the Company Name');
		companyname.focus();
		return false;
	}
	if (jobtitle.value == "") {
		alert("Please enter your Job Title");
		jobtitle.focus();
		return false;
	}
	if (jobtitle.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Job Title');
		jobtitle.focus();
		return false;
	}
	if (employedfrom_month.selectedIndex == 0) {
		alert("Please enter your Employed From month");
		employedfrom_month.focus();
		return false;
	}
	if (employedfrom_year.selectedIndex == 0) {
		alert("Please enter your Employed From year");
		employedfrom_year.focus();
		return false;
	}

	if (document.myform.current.value == "Yes") {
	} else {	
		if (employedto_month.selectedIndex == 0) {
			alert("Please enter your Employed To month");
			employedto_month.focus();
			return false;
		}
		if (employedto_year.selectedIndex == 0) {
			alert("Please enter your Employed To year");
			employedto_year.focus();
			return false;
		}
	}
	if (responsibilities.value == "") {
		alert("Please enter your Responsibilities");
		responsibilities.focus();
		return false;
	}
	if (responsibilities.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Responsibilities');
		responsibilities.focus();
		return false;
	}
	if (achievements.value == "") {
		alert("Please enter your Achievements. If none, enter N/A");
		achievements.focus();
		return false;
	}
	if (achievements.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Achievements');
		achievements.focus();
		return false;
	}
	if (package.value == "") {
		alert("Please enter an amount for the Package your receive/received for this employment record");
		package.focus();
		return false;
	}
	if (package.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Package detail');
		package.focus();
		return false;
	}
	if (package_per.selectedIndex == 0) {
		alert("Please specify the detail of the Package amount - i.e. per hour/week/month/annually");
		package_per.focus();
		return false;
	}
	if (benefits.value == "") {
		alert("Please enter your Benefits. If none, enter N/A");
		benefits.focus();
		return false;
	}
	if (benefits.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Benefits');
		benefits.focus();
		return false;
	}
	document.myform.employedfrom.value = employedfrom_month.options[employedfrom_month.selectedIndex].value + "-" + employedfrom_year.options[employedfrom_year.selectedIndex].value;
	document.myform.employedto.value = employedto_month.options[employedto_month.selectedIndex].value + "-" + employedto_year.options[employedto_year.selectedIndex].value;
	document.myform.action = "capturecv-step9-add.php";
	return true;
}

function checkStep8() {
	var ref_name = document.myform.ref_name;
	var ref_company = document.myform.ref_company;
	var ref_position = document.myform.ref_position;
	var ref_phonenumber = document.myform.ref_phonenumber;
	var ref_cellnumber = document.myform.ref_cellnumber;
	
	if (ref_name.value == "") {
		alert("Please enter the reference's Name");
		ref_name.focus();
		return false;
	}
	if (ref_company.value == "") {
		alert("Please enter the reference's Company");
		ref_company.focus();
		return false;
	}
	if (ref_position.value == "") {
		alert("Please enter the reference's Position");
		ref_position.focus();
		return false;
	}
	if (ref_phonenumber.value == "") {
		if (ref_cellnumber.value == "") {
			alert("Please enter the reference's Phone / Cellphone Number");
			ref_phonenumber.focus();
			return false;
		} else {
			ref_phonenumber.value = "-";
		}
	}
	if (ref_cellnumber.value == "") {
		if (ref_phonenumber.value == "") {
			alert("Please enter the reference's Phone / Cellphone Number");
			ref_phonenumber.focus();
			return false;
		} else {
			ref_cellnumber.value = "-";
		}
	}
	document.myform.action = "capturecv-step8-add.php";
	return true;
}

function checkStep7() {
	var conf_type = document.myform.conf_type;
	var conf_name = document.myform.conf_name;
	
	if (conf_type.selectedIndex == 0) {
		alert("Please select the Event Type");
		conf_type.focus();
		return false;
	}
	if (conf_name.value == "") {
		alert("Please enter the Event Name");
		conf_name.focus();
		return false;
	}
	document.myform.action = "capturecv-step7-add.php";
	return true;
}

function checkStep6() {
	var program_name = document.addform.program_name;
	var program_proficiency = document.addform.program_proficiency;
	
	if (program_name.value == "") {
		alert("Please enter Program Name (e.g. MS Word)");
		program_name.focus();
		return false;
	}
	if (program_proficiency.selectedIndex == 0) {
		alert("Please select Program Proficiency");
		program_proficiency.focus();
		return false;
	}
	document.addform.action = "capturecv-step6-add.php";
	return true;
}

function checkStep5() {
	var otherskills = document.myform.otherskills;
	if (otherskills.value == "") {
		alert("Please enter your description. If none, enter N/A");
		otherskills.focus();
		return false;
	}
	if (otherskills.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your description');
		otherskills.focus();
		return false;
	}
	document.myform.action = "capturecv-step6.php";
	return true;
}

function checkStep4() {
	var qualification = document.myform.qualification;
	var institution = document.myform.institution;
	var datestarted_month = document.myform.datestarted_month;
	var datestarted_year = document.myform.datestarted_year;
	var datecompleted_month = document.myform.datecompleted_month;
	var datecompleted_year = document.myform.datecompleted_year;
	var majorsubjects = document.myform.majorsubjects;
	var achievements = document.myform.achievements;
	
	if (qualification.value == "") {
		alert("Please enter your Name of Qualification");
		qualification.focus();
		return false;
	}
	if (qualification.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Name of Qualification');
		qualification.focus();
		return false;
	}
	if (institution.value == "") {
		alert("Please enter your Institution Qualification Obtained From");
		institution.focus();
		return false;
	}
	if (institution.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Institution Qualification Obtained From');
		institution.focus();
		return false;
	}
	if (datestarted_month.selectedIndex == 0) {
		alert("Please enter your Date Started (Month)");
		datestarted_month.focus();
		return false;
	}
	if (datestarted_year.selectedIndex == 0) {
		alert("Please enter your Date Started (Year)");
		datestarted_year.focus();
		return false;
	}
	if (datecompleted_month.selectedIndex == 0) {
		alert("Please enter your Date Completed (Month)");
		datecompleted_month.focus();
		return false;
	}
	if (datecompleted_year.selectedIndex == 0) {
		alert("Please enter your Date Completed (Year)");
		datecompleted_year.focus();
		return false;
	}
	if (majorsubjects.value == "") {
		alert("Please enter your Major Subjects");
		majorsubjects.focus();
		return false;
	}
	if (majorsubjects.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Major Subjects');
		majorsubjects.focus();
		return false;
	}
	if (achievements.value == "") {
		alert("Please enter your Achievements. If none, enter N/A");
		achievements.focus();
		return false;
	}
	if (achievements.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Achievements');
		achievements.focus();
		return false;
	}
	document.myform.datestarted.value = datestarted_month.options[datestarted_month.selectedIndex].value + "-" + datestarted_year.options[datestarted_year.selectedIndex].value;
	document.myform.datecompleted.value = datecompleted_month.options[datecompleted_month.selectedIndex].value + "-" + datecompleted_year.options[datecompleted_year.selectedIndex].value;
	document.myform.action = "capturecv-step4-add.php";
	return true;
}

function checkStep3Subjects() {
	var subject = document.subjectform.subject;
	var grade = document.subjectform.grade;
	var symbol = document.subjectform.symbol;
	
	if (subject.value == "") {
		alert("Please enter the Subject");
		subject.focus();
		return false;
	}
	if (subject.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Subject');
		subject.focus();
		return false;
	}
	if (grade.options[grade.selectedIndex].value == "") {
		alert("Please select the Grade (HG = Higher Grade; SG = Standard Grade; LG = Lower Grade)");
		grade.focus();
		return false;
	}
	if (symbol.options[symbol.selectedIndex].value == "") {
		alert("Please select the Symbol");
		symbol.focus();
		return false;
	}
	
	document.subjectform.lastschool.value = document.myform.lastschool.value;
	if (document.getElementById("matriculated_yes").checked == true) {
		document.subjectform.matriculated.value = "Yes";
		document.subjectform.matriculatedyear.value = document.myform.matriculatedyear.value;
	} else {
		document.subjectform.matriculated.value = "No";
		document.subjectform.matriculatedyear.value = document.myform.matriculatedyear.value;
	}
    document.subjectform.academicawards.value = document.myform.academicawards.value;
    document.subjectform.sportingactivities.value = document.myform.sportingactivities.value;
    document.subjectform.culturalactivities.value = document.myform.culturalactivities.value;
	
	document.subjectform.action = "capturecv-step3-add.php";
	return true;
}

function checkStep3SubjectsConf() {
	var conf_na = document.getElementById("conf_na");
	if (conf_na.checked == true) {
		document.subjectform.subject.disabled = true;
		document.subjectform.grade.disabled = true;
		document.subjectform.symbol.disabled = true;
		document.subjectform.addnew.disabled = true;
		document.myform.conf_na.value = "Yes";
	} else {
		document.subjectform.subject.disabled = false;
		document.subjectform.grade.disabled = false;
		document.subjectform.symbol.disabled = false;
		document.subjectform.addnew.disabled = false;
		document.myform.conf_na.value = "";
		conf_na.checked = false;
	}
}

function checkStep3() {
	var lastschool = document.myform.lastschool;
	var matriculated = document.myform.matriculatedselect;
	var matriculatedyear = document.myform.matriculatedyear;
	var academicawards = document.myform.academicawards;
	var sportingactivities = document.myform.sportingactivities;
	var culturalactivities = document.myform.culturalactivities;
	
	if (lastschool.value == "") {
		alert("Please enter your Last School Attended");
		lastschool.focus();
		return false;
	}
	if (lastschool.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Last School Attended');
		lastschool.focus();
		return false;
	}
	if (matriculated.value == "") {
		alert("Please specify whether or not you Matriculated");
		matriculated.focus();
		return false;
	}
	if (matriculated.value == "Yes") {
		if (matriculatedyear.value == "") {
			alert("Please enter your Year of Matriculation");
			matriculatedyear.focus();
			return false;
		}
		if (matriculatedyear.value.indexOf('"') != -1) {
			alert('Please remove the quotation (") mark/s from your Year of Matriculation');
			matriculatedyear.focus();
			return false;
		}
	}
	if (academicawards.value == "") {
		alert("Please enter your Academic Achievements / Awards. If none, enter N/A");
		academicawards.focus();
		return false;
	}
	if (academicawards.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Academic Achievements / Awards');
		academicawards.focus();
		return false;
	}
	if (sportingactivities.value == "") {
		alert("Please enter your Sporting Activities / Achievements. If none, enter N/A");
		sportingactivities.focus();
		return false;
	}
	if (sportingactivities.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Sporting Activities / Achievements');
		sportingactivities.focus();
		return false;
	}
	if (culturalactivities.value == "") {
		alert("Please enter your Cultural Activities / Achievements. If none, enter N/A");
		culturalactivities.focus();
		return false;
	}
	if (culturalactivities.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Cultural Activities / Achievements');
		culturalactivities.focus();
		return false;
	}
	document.myform.action = "capturecv-step4.php";
	return true;
}

function checkStep2() {
	var lang_select = document.myform.lang_select;
	if (lang_select.options[lang_select.selectedIndex].value == "") {
		alert("Please select a Language");
		lang_select.focus();
		return false;
	}
	if (lang_select.options[lang_select.selectedIndex].value == "..Other") {
		if (document.myform.lang_other.value == "") {
			alert("Please enter your Other Language");
			document.myform.lang_other.focus();
			return false;
		}
	}
	var lang_read = document.myform.lang_read;
	if (lang_read.options[lang_read.selectedIndex].value == "") {
		alert("Please specifiy your level of Reading");
		lang_read.focus();
		return false;
	}
	var lang_write = document.myform.lang_write;
	if (lang_write.options[lang_write.selectedIndex].value == "") {
		alert("Please specifiy your level of Writing");
		lang_write.focus();
		return false;
	}
	var lang_speak = document.myform.lang_speak;
	if (lang_speak.options[lang_speak.selectedIndex].value == "") {
		alert("Please specifiy your level of Speaking");
		lang_speak.focus();
		return false;
	}
	document.myform.action = "capturecv-step2-add.php";
	return true;
}

function checkStep1() {
	var f = document.myform;
	
	var idnumber = document.myform.idnumber;
	var firstnames = document.myform.firstnames;
	var lastname = document.myform.lastname;
	var title = document.myform.title;
	var gender = document.myform.gender;
	var equity = document.myform.equity;
	var citizenship = document.myform.citizenship;
	var country = document.myform.pd_country;
	
	var telephone = document.myform.telephone;
	var cellphone = document.myform.cellphone;
	var email = document.myform.email;
	
	var marital = document.myform.marital;
	var disableddesc = document.myform.disableddesc;
	var driverslicense = document.myform.driverslicense;
	
	if (idnumber.value == "") {
		alert("Please enter your ID Number");
		idnumber.focus();
		return false;
	}
	if (firstnames.value == "") {
		alert("Please enter your First Names");
		firstnames.focus();
		return false;
	}
	if (firstnames.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your First Names');
		firstnames.focus();
		return false;
	}
	if (lastname.value == "") {
		alert("Please enter your Last Name");
		lastname.focus();
		return false;
	}
	if (lastname.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Last Name');
		lastname.focus();
		return false;
	}
	if (title.selectedIndex == 0) {
		alert("Please select Title");
		title.focus();
		return false;
	}
	if (gender.selectedIndex == 0) {
		alert("Please select Gender");
		gender.focus();
		return false;
	}
	if (equity.selectedIndex == 0) {
		alert("Please select Equity");
		equity.focus();
		return false;
	}
	if (citizenship.selectedIndex == 0) {
		alert("Please select Citizenship");
		citizenship.focus();
		return false;
	}
	if (country.selectedIndex == 0) {
		alert("Please select Country");
		country.focus();
		return false;
	}
	if (telephone.value == "") {
		alert("Please enter your Landline Telephone");
		telephone.focus();
		return false;
	}
	if (telephone.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Landline Telephone');
		telephone.focus();
		return false;
	}
	if (cellphone.value == "") {
		alert("Please enter your Cellphone Number");
		cellphone.focus();
		return false;
	}
	if (cellphone.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Cellphone Number');
		cellphone.focus();
		return false;
	}
	if (email.value == "") {
		alert("Please enter your E-Mail Address");
		email.focus();
		return false;
	}
	if (email.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your E-Mail Address');
		email.focus();
		return false;
	}
	if (email.value.indexOf(".") == -1) {
		alert("Please enter a valid E-Mail Address");
		email.focus();
		return false;
	}
	if (email.value.indexOf("@") == -1) {
		alert("Please enter a valid E-Mail Address");
		email.focus();
		return false;
	}
	
	if (marital.selectedIndex == 0) {
		alert("Please select your Marital Status");
		marital.focus();
		return false;
	}
	if (driverslicense.selectedIndex == 0) {
		alert("Please select Drivers License");
		return false;
	}
	var genpassword = document.myform.genpassword;
	
	var answer = confirm("Login Details have been generated and will be sent once all steps are completed\n\nUsername: "+email.value+"\nPassword: "+genpassword.value);
	if (answer) {
		document.myform.action = "capturecv-step2.php";
		return true;
	} else {
		return false;
	}
}

function checkEnterBackground() {
	var background_name = document.myform.background_name;
	var upload = document.myform.upload;
	
	if (background_name.value == "") {
		alert("Please enter Background Name");
		background_name.focus();
		return false;
	}
	if (upload.value == "") {
		alert("Please select a Background Check to upload");
		upload.focus();
		return false;
	}
	document.myform.action = "candidate_background.php";
	return true;
}

function checkEnterReference() {
	var reference_name = document.myform.reference_name;
	var upload = document.myform.upload;
	
	if (reference_name.value == "") {
		alert("Please enter Reference Name");
		reference_name.focus();
		return false;
	}
	if (upload.value == "") {
		alert("Please select a Reference Check to upload");
		upload.focus();
		return false;
	}
	document.myform.action = "candidate_reference.php";
	return true;
}

function popUpHelp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=400,left = 640,top = 325');");
}

function checkHigherInitConf() {
	var conf_na = document.myform.conf_na_hidden;
	if (conf_na.value == "Yes") {
		document.getElementById("conf_na").checked = true;
		document.myform.qualification.disabled = true;
		document.myform.institution.disabled = true;
		document.myform.datestarted_month.disabled = true;
		document.myform.datestarted_year.disabled = true;
		document.myform.datecompleted_month.disabled = true;
		document.myform.datecompleted_year.disabled = true;
		document.myform.majorsubjects.disabled = true;
		document.myform.achievements.disabled = true;
		document.myform.addnew.disabled = true;
	} else {
		document.getElementById("conf_na").checked = false;
		document.myform.qualification.disabled = false;
		document.myform.institution.disabled = false;
		document.myform.datestarted_month.disabled = false;
		document.myform.datestarted_year.disabled = false;
		document.myform.datecompleted_month.disabled = false;
		document.myform.datecompleted_year.disabled = false;
		document.myform.majorsubjects.disabled = false;
		document.myform.achievements.disabled = false;
		document.myform.addnew.disabled = false;
	}
}

function checkHigherConf() {
	var conf_na = document.getElementById("conf_na");
	if (conf_na.checked == true) {
		document.myform.qualification.disabled = true;
		document.myform.institution.disabled = true;
		document.myform.datestarted_month.disabled = true;
		document.myform.datestarted_year.disabled = true;
		document.myform.datecompleted_month.disabled = true;
		document.myform.datecompleted_year.disabled = true;
		document.myform.majorsubjects.disabled = true;
		document.myform.achievements.disabled = true;
		document.myform.addnew.disabled = true;
		document.myform.conf_na_hidden.value = "Yes";
		var answer = confirm("Are you sure that you do not want to submit any Higher Education records?");
		if (answer == true) {
			if (document.myform.recentry != null) {
				document.myform.conf_na.value = "Yes";
				document.myform.action = "capturecv-step5.php";
				document.myform.submit();
				return true;
			} else {
				var candidate_id_search = document.myform.candidate_id_search.value;
				if (candidate_id_search == "") {
					document.myform.action = "higher_education_na.php";
				} else {
					document.myform.action = "higher_education_na.php?candidate_id_search=" + candidate_id_search;
				}
				document.myform.submit();
				return true;
			}
		} else {
			document.myform.qualification.disabled = false;
			document.myform.institution.disabled = false;
			document.myform.datestarted_month.disabled = false;
			document.myform.datestarted_year.disabled = false;
			document.myform.datecompleted_month.disabled = false;
			document.myform.datecompleted_year.disabled = false;
			document.myform.majorsubjects.disabled = false;
			document.myform.achievements.disabled = false;
			document.myform.addnew.disabled = false;
			document.myform.conf_na.value = "No";
			conf_na.checked = false;
		}
	} else {
		document.myform.qualification.disabled = false;
		document.myform.institution.disabled = false;
		document.myform.datestarted_month.disabled = false;
		document.myform.datestarted_year.disabled = false;
		document.myform.datecompleted_month.disabled = false;
		document.myform.datecompleted_year.disabled = false;
		document.myform.majorsubjects.disabled = false;
		document.myform.achievements.disabled = false;
		document.myform.addnew.disabled = false;
		document.myform.conf_na_hidden.value = "No";
		conf_na.checked = false;
	}
}

function checkCurrentWork() {
	var current = document.myform.current;
	
	var answer = confirm("Do you want to set that you currently work here?");
	if (answer == true) {
		current.value = "Yes";
		document.getElementById("emp_to1").style.display = "none";
		document.getElementById("emp_to1").style.visibility = "hidden";
		document.getElementById("emp_to2").style.display = "none";
		document.getElementById("emp_to2").style.visibility = "hidden";
		document.getElementById("emp_to3").style.display = "block";
		document.getElementById("emp_to3").style.visibility = "visible";
	} else {}
}

function checkHotBox() {
	var newhotbox = document.myform.newhotbox;
	if (newhotbox.value == "") {
		alert("Please enter Hot Box Name");
		newhotbox.focus();
		return false;
	}
	document.myform.action = "myhotbox_create.php";
	return true;
}

function checkProspectiveClient() {
	var searchjob = document.myform.searchjob;
	if (searchjob.value == "") {
		alert("Please enter Search Candidate Job Titles");
		searchjob.focus();
		return false;
	}
	return true;
}

function changeInterviewType() {
	var box = document.myform.interview_type;
	if (box.selectedIndex == 4) {
		document.getElementById("hid_1").style.display = "block";
		document.getElementById("hid_2").style.display = "block";
		document.myform.interview_client.focus();
	} else {
		document.getElementById("hid_1").style.display = "none";
		document.getElementById("hid_2").style.display = "none";
	}
}

function checkLocation_AddCountry() {
	var country = document.myform.new_country;
	if (country.value == "") {
		alert("Please enter Country");
		country.focus();
		return false;
	}
	document.myform.action = "locationfilter_country.php";
	return true;
}

function checkLocation_AddProvinceState() {
	var province_country = document.myform.new_provincestate_country;
	var province = document.myform.new_provincestate;
	if (province_country.selectedIndex == 0) {
		alert("Please select Country");
		province_country.focus();
		return false;
	}
	if (province.value == "") {
		alert("Please enter Province / State");
		province.focus();
		return false;
	}
	document.myform.action = "locationfilter_provincestate.php";
	return true;
}

function checkLocation_AddCity() {
	var city_country = document.myform.new_city_country;
	var city_province = document.myform.new_city_province;
	var city = document.myform.new_city;
	if (city_country.selectedIndex == 0) {
		alert("Please select Country");
		city_country.focus();
		return false;
	}
	if (city_province.selectedIndex == 0) {
		alert("Please select Province / State");
		city_province.focus();
		return false;
	}
	if (city.value == "") {
		alert("Please enter City");
		city.focus();
		return false;
	}
	document.myform.action = "locationfilter_city.php";
	return true;
}

function checkLocation_AddSuburb() {
	var new_suburb_country = document.myform.new_suburb_country;
	var new_suburb_province = document.myform.new_suburb_province;
	var new_suburb_city = document.myform.new_suburb_city;
	var new_suburb = document.myform.new_suburb;
	
	if (new_suburb_country.selectedIndex == 0) {
		alert("Please select Country");
		new_suburb_country.focus();
		return false;
	}
	if (new_suburb_province.selectedIndex == 0) {
		alert("Please select Province / State");
		new_suburb_province.focus();
		return false;
	}
	if (new_suburb_city.selectedIndex == 0) {
		alert("Please select City");
		new_suburb_city.focus();
		return false;
	}
	if (new_suburb.value == "") {
		alert("Please enter Suburb");
		new_suburb.focus();
		return false;
	}
	document.myform.action = "locationfilter_suburb.php";
	return true;
}

function overMenu(object) {
	document.getElementById(object).className = 'red';
}

function outMenu(object) {
	document.getElementById(object).className = 'gray';
}

function overWeb(object) {
	document.getElementById(object).className = 'red';
}

function outWeb(object) {
	document.getElementById(object).className = 'black';
}

// JavaScript Document

//signup form

function checkInitSignup() {
	if (document.myform.signup_other.value == "") {
		document.myform.signup_other.disabled = true;
	} else {}
}

function checkChangeHearAbout() {
	var signup_hearabout = document.myform.signup_hearabout;
	if (signup_hearabout.options[signup_hearabout.selectedIndex].value == "Other") {
		document.myform.signup_other.disabled = false;
		document.myform.signup_other.focus();
	} else {
		document.myform.signup_other.value = "";
		document.myform.signup_other.disabled = true;
	}
}

function checkSignupForm() {
	var signup_idnumber = document.myform.signup_idnumber;
	var allids = document.myform.allids.value;
	var signup_firstnames = document.myform.signup_firstnames;
	var signup_lastname = document.myform.signup_lastname;
	
	var signup_currentlocation = document.myform.signup_currentlocation;
	var signup_country = document.myform.signup_country;
	var signup_provincestate = document.myform.signup_provincestate;
	var signup_city = document.myform.signup_city;
	var signup_suburb = document.myform.signup_suburb;
	
	var username = document.myform.username;
	
	var signup_emailaddress = document.myform.signup_emailaddress;
	var signup_retype = document.myform.signup_retype;
	
	var signup_hearabout = document.myform.signup_hearabout;
	var signup_other = document.myform.signup_other;
	
	//personal details
	if (signup_idnumber.value == "") {
		alert("Please enter your ID Number");
		signup_idnumber.focus();
		return false;
	}
	if (allids.indexOf(","+signup_idnumber.value+",") != -1) {
		alert("Your ID Number already exists in the system. Please verify");
		signup_idnumber.focus();
		return false;
	}
	if (signup_idnumber.value.length < 6) {
		alert("Your ID Number is invalid");
		signup_idnumber.focus();
		return false;
	}
	if (signup_firstnames.value == "") {
		alert("Please enter your First Names (including middle name/s)");
		signup_firstnames.focus();
		return false;
	}
	if (signup_lastname.value == "") {
		alert("Please enter your Last Name");
		signup_lastname.focus();
		return false;
	}
	
	//current location
	if (signup_country.selectedIndex == 0) {
		alert("Please select your Country");
		signup_country.focus();
		return false;
	}
	if (signup_provincestate.selectedIndex == 0) {
		alert("Please select your Province / State");
		signup_provincestate.focus();
		return false;
	}
	if (signup_city.selectedIndex == 0) {
		alert("Please select your City");
		signup_city.focus();
		return false;
	}
	if (signup_suburb.selectedIndex == 0) {
		alert("Please select your Suburb");
		signup_suburb.focus();
		return false;
	}
	
	//username
	if (username.value == "") {
		alert("Please enter a Username");
		username.focus();
		return false;
	}
	if (username.value.length < 6) {
		alert("Your Username is less than 6 characters long. Please verify");
		username.value = "";
		document.getElementById('username_exists').innerHTML = "";
		username.focus();
		return false;
	}
	if (document.getElementById('username_exists').innerHTML == "Username already exists") {
		alert("The Username you entered already exists, please choose another and first Check before proceeding");
		username.focus();
		return false;
	}
	if (document.myform.checkusername.value != "yes") {
		alert("Please Check the availability of your Username before proceeding");
		username.focus();
		return false;
	}
	var q = username.value;
	var e = "Your Username contains 1 or more spaces. This is not permitted for login purposes";
	if (q.indexOf(" ") != -1) { alert(e); return false; }
	
	//email address
	if (signup_emailaddress.value == "") {
		alert("Please enter your E-Mail Address");
		signup_emailaddress.focus();
		return false;
	}
	if (signup_emailaddress.value.indexOf("@") == -1) {
		alert("Please enter a valid E-Mail Address");
		signup_emailaddress.focus();
		return false;
	}
	if (signup_emailaddress.value.indexOf(".") == -1) {
		alert("Please enter a valid E-Mail Address");
		signup_emailaddress.focus();
		return false;
	}
	if (signup_retype.value == "") {
		alert("Please re-type your E-Mail Address");
		signup_retype.focus();
		return false;
	}
	if (signup_retype.value.indexOf("@") == -1) {
		alert("Please enter a valid E-Mail Address");
		signup_retype.focus();
		return false;
	}
	if (signup_retype.value.indexOf(".") == -1) {
		alert("Please enter a valid E-Mail Address");
		signup_retype.focus();
		return false;
	}
	if (signup_emailaddress.value != signup_retype.value) {
		alert("E-Mail Addresses don't match. Please check");
		signup_emailaddress.focus();
		return false;
	}
	
	//hear about
	if (signup_hearabout.options[signup_hearabout.selectedIndex].value == "") {
		alert("Please specify how you heard about Adecco");
		signup_hearabout.focus();
		return false;
	}
	if (signup_hearabout.options[signup_hearabout.selectedIndex].value == "Other") {
		if (signup_other.value == "") {
			alert("Please specify how you heard about Adecco");
			signup_other.focus();
			return false;
		}
	}
	
	//agree boxes
	if (document.getElementById("agreeoverseas").checked == true) {
		document.myform.agreeoverseas_hid.value = "Yes";
	}
	if (document.getElementById("agreeoverseas").checked == false) {
		document.myform.agreeoverseas_hid.value = "No";
	}
	if (document.getElementById("agreeterms").checked == false) {
		alert("Please read and accept Terms and Conditions");
		document.getElementById("agreeterms").focus();
		return false;
	}
	document.myform.agreeterms_hid.value = "Yes";
	
	signup_currentlocation.value = signup_country.value + ", " + signup_provincestate.value + ", " + signup_city.value + ", " + signup_suburb.value;
	document.getElementById("submission").style.display = 'none';
	document.getElementById("submission").style.visibility='hidden';
	document.myform.action = "signup_validate.php";
	return true;
}

function changeCitizenship() {
	var signup_citizenship = document.myform.signup_citizenship;
	if (signup_citizenship.options[signup_citizenship.selectedIndex].value == "") {
	}
	else if (signup_citizenship.options[signup_citizenship.selectedIndex].value == "South African Citizen") {
		document.myform.signup_country.value = "South Africa";
		document.myform.signup_provincestate.focus();
	}
	else if (signup_citizenship.options[signup_citizenship.selectedIndex].value == "Foreigner with a Work Permit") {
		document.myform.signup_country.focus();
	}
}


//login form
function checkLoginForm() {
	var username = document.myform.username;
	var password = document.myform.password;
	
	if (username.value == "") {
		alert("Please enter your Username");
		username.focus();
		return false;
	}
	if (password.value == "") {
		alert("Please enter your Password");
		password.focus();
		return false;
	}
	document.myform.action = "validate_login.php";
	return true;
}


//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

//step 1: personal details form
function checkForm() {
	var firstnames = document.myform.firstnames;
	var lastname = document.myform.lastname;
	var title = document.myform.title;
	var gender = document.myform.gender;
	var equity = document.myform.equity;
	var citizenship = document.myform.citizenship;
	var country = document.myform.pd_country;
	var provincestate = document.myform.pd_provincestate;
	var city = document.myform.pd_city;
	var suburb = document.myform.pd_suburb;
	var currentlocation = document.myform.currentlocation;
	
	var telephone = document.myform.telephone;
	var cellphone = document.myform.cellphone;
	var email = document.myform.email;
	
	/*var resaddress1 = document.myform.resaddress1;
	var resaddress2 = document.myform.resaddress2;
	var resaddress3 = document.myform.resaddress3;
	var resaddress4 = document.myform.resaddress4;
	var respostalcode = document.myform.respostalcode;
	var postaladdress1 = document.myform.postaladdress1;
	var postaladdress2 = document.myform.postaladdress2;
	var postaladdress3 = document.myform.postaladdress3;
	var postaladdress4 = document.myform.postaladdress4;
	var postalcode = document.myform.postalcode;*/
	
	var marital = document.myform.marital;
	var disabled = document.myform.disabledselect;
	var disableddesc = document.myform.disableddesc;
	var citizenship = document.myform.citizenship;
	var driverslicense = document.myform.driverslicense;
	//var driverslicensedesc = document.myform.driverslicensedesc;
	
	if (firstnames.value == "") {
		alert("Please enter your First Names");
		firstnames.focus();
		return false;
	}
	if (firstnames.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your First Names');
		firstnames.focus();
		return false;
	}
	if (lastname.value == "") {
		alert("Please enter your Last Name");
		lastname.focus();
		return false;
	}
	if (lastname.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Last Name');
		lastname.focus();
		return false;
	}
	if (title.selectedIndex == 0) {
		alert("Please select Title");
		title.focus();
		return false;
	}
	if (gender.selectedIndex == 0) {
		alert("Please select Gender");
		gender.focus();
		return false;
	}
	if (equity.selectedIndex == 0) {
		alert("Please select Equity");
		equity.focus();
		return false;
	}
	if (citizenship.selectedIndex == 0) {
		alert("Please select Citizenship");
		citizenship.focus();
		return false;
	}
	if (country.selectedIndex == 0) {
		alert("Please select Country");
		country.focus();
		return false;
	}
	if (provincestate.selectedIndex == 0) {
		alert("Please select Province / State");
		provincestate.focus();
		return false;
	}
	if (city.selectedIndex == 0) {
		alert("Please select City");
		city.focus();
		return false;
	}
	if (suburb.selectedIndex == 0) {
		alert("Please select Suburb");
		suburb.focus();
		return false;
	}
	if (telephone.value == "") {
		alert("Please enter your Landline Telephone");
		telephone.focus();
		return false;
	}
	if (telephone.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Landline Telephone');
		telephone.focus();
		return false;
	}
	if (cellphone.value == "") {
		alert("Please enter your Cellphone Number");
		cellphone.focus();
		return false;
	}
	if (cellphone.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Cellphone Number');
		cellphone.focus();
		return false;
	}
	if (email.value == "") {
		alert("Please enter your E-Mail Address");
		email.focus();
		return false;
	}
	if (email.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your E-Mail Address');
		email.focus();
		return false;
	}
	if (email.value.indexOf(".") == -1) {
		alert("Please enter a valid E-Mail Address");
		email.focus();
		return false;
	}
	if (email.value.indexOf("@") == -1) {
		alert("Please enter a valid E-Mail Address");
		email.focus();
		return false;
	}
	
	/*if (resaddress1.value == "") {
		alert("Please enter your Residential Address");
		resaddress1.focus();
		return false;
	}
	if (resaddress1.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Residential Address');
		resaddress1.focus();
		return false;
	}
	if (resaddress2.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Residential Address');
		resaddress2.focus();
		return false;
	}
	if (resaddress3.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Residential Address');
		resaddress3.focus();
		return false;
	}
	if (resaddress4.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Residential Address');
		resaddress4.focus();
		return false;
	}
	if (respostalcode.value == "") {
		alert("Please enter your Residential Postal Code");
		respostalcode.focus();
		return false;
	}
	if (respostalcode.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Residential Postal Code');
		respostalcode.focus();
		return false;
	}
	if (postaladdress1.value == "") {
		alert("Please enter your Postal Address");
		postaladdress1.focus();
		return false;
	}
	if (postaladdress1.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Postal Address');
		postaladdress1.focus();
		return false;
	}
	if (postaladdress2.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Postal Address');
		postaladdress2.focus();
		return false;
	}
	if (postaladdress3.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Postal Address');
		postaladdress3.focus();
		return false;
	}
	if (postaladdress4.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Postal Address');
		postaladdress4.focus();
		return false;
	}
	if (postalcode.value == "") {
		alert("Please enter your Postal Code");
		postalcode.focus();
		return false;
	}
	if (postalcode.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Postal Code');
		postalcode.focus();
		return false;
	}*/
	if (marital.selectedIndex == 0) {
		alert("Please select your Marital Status");
		marital.focus();
		return false;
	}
	if (disabled.value == "") {
		alert("Please select whether or not you are Disabled");
		return false;
	}
	if (disabled.value == "Yes") {
		if (disableddesc.value == "") {
			alert("Please describe your Disability");
			disableddesc.focus();
			return false;
		}
		if (disableddesc.value.indexOf('"') != -1) {
			alert('Please remove the quotation (") mark/s from your Disability Description');
			disableddesc.focus();
			return false;
		}
	}
	if (driverslicense.selectedIndex == 0) {
		alert("Please select Drivers License");
		return false;
	}
	/*if (driverslicense.value == "Yes") {
		if (driverslicensedesc.value == "") {
			alert("Please indicate your type of Drivers License");
			driverslicensedesc.focus();
			return false;
		}
		if (driverslicensedesc.value.indexOf('"') != -1) {
			alert('Please remove the quotation (") mark/s from your Drivers License Description');
			driverslicensedesc.focus();
			return false;
		}
	}*/
	
	document.myform.action = "personal_details_up.php";
	return true;
}
//step 1: check disabled yes/no
function changeDisabledNo() {
	document.myform.disabledselect.value = "No";
	document.myform.disableddesc.value = "";
	document.myform.disableddesc.disabled = true;
	return true;
}

function changeDisabledYes() {
	document.myform.disabledselect.value = "Yes";
	document.myform.disableddesc.disabled = false;
	document.myform.disableddesc.value = document.myform.initdisabled.value;
	document.myform.disableddesc.focus();
	return true;
}
//step 1: check drivers yes/no
function changeDriversNo() {
	document.myform.driverslicenseselect.value = "No";
	document.myform.driverslicensedesc.value = "";
	document.myform.driverslicensedesc.disabled = true;
	return true;
}

function changeDriversYes() {
	document.myform.driverslicenseselect.value = "Yes";
	document.myform.driverslicensedesc.disabled = false;
	document.myform.driverslicensedesc.value = document.myform.initdrivers.value;
	document.myform.driverslicensedesc.focus();
	return true;
}
//step 1: check initial gender/marital/disabled/drivers
function checkInit() {
	var disabledselect = document.myform.disabledselect.value;
	if (disabledselect == "Yes") {
		document.myform.disabled_yes.checked = true;
	} else if (disabledselect == "No") {
		document.myform.disabled_no.checked = true;
		document.myform.disableddesc.disabled = true;
	} else {}
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

//step 2: high school form
function checkHighSchoolForm() {
	var lastschool = document.myform.lastschool;
	var matriculated = document.myform.matriculatedselect;
	var matriculatedyear = document.myform.matriculatedyear;
	var academicawards = document.myform.academicawards;
	var sportingactivities = document.myform.sportingactivities;
	var culturalactivities = document.myform.culturalactivities;
	
	if (lastschool.value == "") {
		alert("Please enter your Last School Attended");
		lastschool.focus();
		return false;
	}
	if (lastschool.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Last School Attended');
		lastschool.focus();
		return false;
	}
	if (matriculated.value == "") {
		alert("Please specify whether or not you Matriculated");
		matriculated.focus();
		return false;
	}
	if (matriculated.value == "Yes") {
		if (matriculatedyear.value == "") {
			alert("Please enter your Year of Matriculation");
			matriculatedyear.focus();
			return false;
		}
		if (matriculatedyear.value.indexOf('"') != -1) {
			alert('Please remove the quotation (") mark/s from your Year of Matriculation');
			matriculatedyear.focus();
			return false;
		}
	}
	if (academicawards.value == "") {
		alert("Please enter your Academic Achievements / Awards. If none, enter N/A");
		academicawards.focus();
		return false;
	}
	if (academicawards.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Academic Achievements / Awards');
		academicawards.focus();
		return false;
	}
	if (sportingactivities.value == "") {
		alert("Please enter your Sporting Activities / Achievements. If none, enter N/A");
		sportingactivities.focus();
		return false;
	}
	if (sportingactivities.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Sporting Activities / Achievements');
		sportingactivities.focus();
		return false;
	}
	if (culturalactivities.value == "") {
		alert("Please enter your Cultural Activities / Achievements. If none, enter N/A");
		culturalactivities.focus();
		return false;
	}
	if (culturalactivities.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Cultural Activities / Achievements');
		culturalactivities.focus();
		return false;
	}
	document.myform.action = "highschool_education_up.php";
	return true;
}
//step 2: check matriculation yes/no
function changeMatriculatedNo() {
	document.myform.matriculatedselect.value = "No";
	document.myform.matriculatedyear.value = "";
	document.myform.matriculatedyear.disabled = true;
	return true;
}

function changeMatriculatedYes() {
	document.myform.matriculatedselect.value = "Yes";
	document.myform.matriculatedyear.disabled = false;
	document.myform.matriculatedyear.value = document.myform.initmatriculated.value;
	document.myform.matriculatedyear.focus();
	return true;
}
//step 2: check initial matriculation
function checkHighSchoolInit() {
	var matriculatedselect = document.myform.matriculatedselect;
	if (matriculatedselect.value == "Yes") {
		document.myform.matriculated_yes.checked = true;
	} else if (matriculatedselect.value == "No") {
		document.myform.matriculated_no.checked = true;
		document.myform.matriculatedyear.disabled = true;
	} else {}
}
//step 2: subjects add form
function checkSubjectForm() {
	var subject = document.subjectform.subject;
	var grade = document.subjectform.grade;
	var symbol = document.subjectform.symbol;
	
	if (subject.value == "") {
		alert("Please enter the Subject");
		subject.focus();
		return false;
	}
	if (subject.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Subject');
		subject.focus();
		return false;
	}
	if (grade.options[grade.selectedIndex].value == "") {
		alert("Please select the Grade (HG = Higher Grade; SG = Standard Grade; LG = Lower Grade)");
		grade.focus();
		return false;
	}
	if (symbol.options[symbol.selectedIndex].value == "") {
		alert("Please select the Symbol");
		symbol.focus();
		return false;
	}
	var candidate_id_search = document.subjectform.candidate_id_search.value;
	if (candidate_id_search == "") {
		document.subjectform.action = "subject_add.php";
	} else {
		document.subjectform.action = "subject_add.php?candidate_id_search=" + candidate_id_search;
	}
	return true;
}

function checkSubjectsConf() {
	var conf_na = document.getElementById("conf_na");
	if (conf_na.checked == true) {
		document.subjectform.subject.disabled = true;
		document.subjectform.grade.disabled = true;
		document.subjectform.symbol.disabled = true;
		document.subjectform.addnew.disabled = true;
		document.subjectform.conf_na_hidden.value = "Yes";
		var answer = confirm("Are you sure that you do not want to submit any Subject records?");
		if (answer == true) {
			var candidate_id_search = document.subjectform.candidate_id_search.value;
			if (candidate_id_search == "") {
				document.subjectform.action = "highschool_education_na.php";
			} else {
				document.subjectform.action = "highschool_education_na.php?candidate_id_search=" + candidate_id_search;
			}
			document.subjectform.submit();
			return true;
		} else {
			document.subjectform.subject.disabled = false;
			document.subjectform.grade.disabled = false;
			document.subjectform.symbol.disabled = false;
			document.subjectform.addnew.disabled = false;
			document.subjectform.conf_na_hidden.value = "No";
			conf_na.checked = false;
		}
	} else {
		document.subjectform.subject.disabled = false;
		document.subjectform.grade.disabled = false;
		document.subjectform.symbol.disabled = false;
		document.subjectform.addnew.disabled = false;
		document.subjectform.conf_na_hidden.value = "No";
		conf_na.checked = false;
	}
}

function checkSubjectsInitConf() {
	var conf_na = document.subjectform.conf_na_hidden;
	if (conf_na.value == "Yes") {
		document.getElementById("conf_na").checked = true;
		document.subjectform.subject.disabled = true;
		document.subjectform.grade.disabled = true;
		document.subjectform.symbol.disabled = true;
		document.subjectform.addnew.disabled = true;
	} else {
		document.getElementById("conf_na").checked = false;
		document.subjectform.subject.disabled = false;
		document.subjectform.grade.disabled = false;
		document.subjectform.symbol.disabled = false;
		document.subjectform.addnew.disabled = false;
	}
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

//step 3: higher education add form
function checkHigherEducation() {
	var qualification = document.myform.qualification;
	var institution = document.myform.institution;
	var datestarted_month = document.myform.datestarted_month;
	var datestarted_year = document.myform.datestarted_year;
	var datecompleted_month = document.myform.datecompleted_month;
	var datecompleted_year = document.myform.datecompleted_year;
	var majorsubjects = document.myform.majorsubjects;
	var achievements = document.myform.achievements;
	
	if (qualification.value == "") {
		alert("Please enter your Name of Qualification");
		qualification.focus();
		return false;
	}
	if (qualification.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Name of Qualification');
		qualification.focus();
		return false;
	}
	if (institution.value == "") {
		alert("Please enter your Institution Qualification Obtained From");
		institution.focus();
		return false;
	}
	if (institution.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Institution Qualification Obtained From');
		institution.focus();
		return false;
	}
	if (datestarted_month.selectedIndex == 0) {
		alert("Please enter your Date Started (Month)");
		datestarted_month.focus();
		return false;
	}
	if (datestarted_year.selectedIndex == 0) {
		alert("Please enter your Date Started (Year)");
		datestarted_year.focus();
		return false;
	}
	if (datecompleted_month.selectedIndex == 0) {
		alert("Please enter your Date Completed (Month)");
		datecompleted_month.focus();
		return false;
	}
	if (datecompleted_year.selectedIndex == 0) {
		alert("Please enter your Date Completed (Year)");
		datecompleted_year.focus();
		return false;
	}
	if (majorsubjects.value == "") {
		alert("Please enter your Major Subjects");
		majorsubjects.focus();
		return false;
	}
	if (majorsubjects.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Major Subjects');
		majorsubjects.focus();
		return false;
	}
	if (achievements.value == "") {
		alert("Please enter your Achievements. If none, enter N/A");
		achievements.focus();
		return false;
	}
	if (achievements.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Achievements');
		achievements.focus();
		return false;
	}
	document.myform.datestarted.value = datestarted_month.options[datestarted_month.selectedIndex].value + "-" + datestarted_year.options[datestarted_year.selectedIndex].value;
	document.myform.datecompleted.value = datecompleted_month.options[datecompleted_month.selectedIndex].value + "-" + datecompleted_year.options[datecompleted_year.selectedIndex].value;
	document.myform.action = "higher_education_add.php";
	return true;
}
//step 3: higher education edit form
function checkEditHigherEducation() {
	var selform = document.myform.selform.value;
	var qualification = document.forms[selform].qualification;
	var institution = document.forms[selform].institution;
	var datestarted = document.forms[selform].datestarted2;
	var datecompleted = document.forms[selform].datecompleted2;
	var majorsubjects = document.forms[selform].majorsubjects;
	var achievements = document.forms[selform].achievements;
	
	if (qualification.value == "") {
		alert("Please enter your Name of Qualification");
		qualification.focus();
		return false;
	}
	if (qualification.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Name of Qualification');
		qualification.focus();
		return false;
	}
	if (institution.value == "") {
		alert("Please enter your Institution Qualification Obtained From");
		institution.focus();
		return false;
	}
	if (institution.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Institution Qualification Obtained From');
		institution.focus();
		return false;
	}
	if (datestarted.value == "") {
		alert("Please enter your Date Started");
		datestarted.focus();
		return false;
	}
	if (datestarted.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Date Started');
		datestarted.focus();
		return false;
	}
	if (datecompleted.value == "") {
		alert("Please enter your Date Completed");
		datecompleted.focus();
		return false;
	}
	if (datecompleted.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Date Completed');
		datecompleted.focus();
		return false;
	}
	if (majorsubjects.value == "") {
		alert("Please enter your Major Subjects");
		majorsubjects.focus();
		return false;
	}
	if (majorsubjects.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Major Subjects');
		majorsubjects.focus();
		return false;
	}
	if (achievements.value == "") {
		alert("Please enter your Achievements. If none, enter N/A");
		achievements.focus();
		return false;
	}
	if (achievements.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Achievements');
		achievements.focus();
		return false;
	}
	document.forms[selform].action = "higher_education_up.php";
	return true;
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

//step 4: employment record add form
function checkEmploymentRecord() {
	var companyname = document.myform.companyname;
	var jobtitle = document.myform.jobtitle;
	var employedfrom_day = document.myform.employedfrom_day;
	var employedfrom_month = document.myform.employedfrom_month;
	var employedfrom_year = document.myform.employedfrom_year;
	var employedto_day = document.myform.employedto_day;
	var employedto_month = document.myform.employedto_month;
	var employedto_year = document.myform.employedto_year;
	var responsibilities = document.myform.responsibilities;
	var achievements = document.myform.achievements;
	var package = document.myform.package;
	var package_per = document.myform.package_per;
	var benefits = document.myform.benefits;
	
	if (companyname.value == "") {
		alert("Please enter the Company Name");
		companyname.focus();
		return false;
	}
	if (companyname.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from the Company Name');
		companyname.focus();
		return false;
	}
	if (jobtitle.value == "") {
		alert("Please enter your Job Title");
		jobtitle.focus();
		return false;
	}
	if (jobtitle.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Job Title');
		jobtitle.focus();
		return false;
	}
	if (employedfrom_day.selectedIndex == 0) {
		alert("Please enter your Employed From day");
		employedfrom_day.focus();
		return false;
	}
	if (employedfrom_month.selectedIndex == 0) {
		alert("Please enter your Employed From month");
		employedfrom_month.focus();
		return false;
	}
	if (employedfrom_year.selectedIndex == 0) {
		alert("Please enter your Employed From year");
		employedfrom_year.focus();
		return false;
	}

	if (document.myform.current.value == "Yes") {
	} else {	
		if (employedto_day.selectedIndex == 0) {
			alert("Please enter your Employed To day");
			employedto_day.focus();
			return false;
		}
		if (employedto_month.selectedIndex == 0) {
			alert("Please enter your Employed To month");
			employedto_month.focus();
			return false;
		}
		if (employedto_year.selectedIndex == 0) {
			alert("Please enter your Employed To year");
			employedto_year.focus();
			return false;
		}
	}
	if (responsibilities.value == "") {
		alert("Please enter your Responsibilities");
		responsibilities.focus();
		return false;
	}
	if (responsibilities.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Responsibilities');
		responsibilities.focus();
		return false;
	}
	if (achievements.value == "") {
		alert("Please enter your Achievements. If none, enter N/A");
		achievements.focus();
		return false;
	}
	if (achievements.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Achievements');
		achievements.focus();
		return false;
	}
	if (package.value == "") {
		alert("Please enter an amount for the Package your receive/received for this employment record");
		package.focus();
		return false;
	}
	if (package.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Package detail');
		package.focus();
		return false;
	}
	if (package_per.selectedIndex == 0) {
		alert("Please specify the detail of the Package amount - i.e. per hour/week/month/annually");
		package_per.focus();
		return false;
	}
	if (benefits.value == "") {
		alert("Please enter your Benefits. If none, enter N/A");
		benefits.focus();
		return false;
	}
	if (benefits.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Benefits');
		benefits.focus();
		return false;
	}
	document.myform.employedfrom.value = employedfrom_year.options[employedfrom_year.selectedIndex].value + "-" + employedfrom_month.options[employedfrom_month.selectedIndex].value + "-" +
										 employedfrom_day.options[employedfrom_day.selectedIndex].value;
	document.myform.employedto.value =   employedto_year.options[employedto_year.selectedIndex].value + "-" + employedto_month.options[employedto_month.selectedIndex].value + "-" +
									     employedto_day.options[employedto_day.selectedIndex].value;
	document.myform.action = "employment_record_add.php";
	return true;
}
//step 4: employment record edit form
function checkEditEmploymentRecord() {
	var selform = document.myform.selform.value;
	var companyname = document.forms[selform].companyname;
	var jobtitle = document.forms[selform].jobtitle;
	var employedfrom = document.forms[selform].employedfrom2;
	var employedto = document.forms[selform].employedto2;
	var responsibilities = document.forms[selform].responsibilities;
	var achievements = document.forms[selform].achievements;
	var package = document.forms[selform].package;
	var package_per = document.forms[selform].package_per;
	var benefits = document.forms[selform].benefits;
	
	if (companyname.value == "") {
		alert("Please enter the Company Name");
		companyname.focus();
		return false;
	}
	if (companyname.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from the Company Name');
		companyname.focus();
		return false;
	}
	if (jobtitle.value == "") {
		alert("Please enter your Job Title");
		jobtitle.focus();
		return false;
	}
	if (jobtitle.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Job Title');
		jobtitle.focus();
		return false;
	}
	if (employedfrom.value == "") {
		alert("Please enter your Employed From date");
		employedfrom.focus();
		return false;
	}
	if (employedfrom.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Employed From date');
		employedfrom.focus();
		return false;
	}
	if (employedfrom.value.length != 10) {
		alert("Please enter a valid Employed From date\n\nFormat (STRICTLY): YYYY-MM-DD");
		employedfrom.focus();
		return false;
	}
	if (employedto.value == "") {
		alert("Please enter your Employed To date");
		employedto.focus();
		return false;
	}
	if (employedto.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Employed To date');
		employedto.focus();
		return false;
	}
	if (employedto.value.length != 10) {
		if (employedto.value == "Current") {
		} else {
			alert("Please enter a valid Employed To date\n\nIf you currently work here, please enter 'Current', otherwise format is STRICTLY:\nYYYY-MM-DD");
			employedto.focus();
			return false;
		}
	}
	if (responsibilities.value == "") {
		alert("Please enter your Responsibilities");
		responsibilities.focus();
		return false;
	}
	if (responsibilities.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Responsibilities');
		responsibilities.focus();
		return false;
	}
	if (achievements.value == "") {
		alert("Please enter your Achievements. If none, enter N/A");
		achievements.focus();
		return false;
	}
	if (achievements.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Achievements');
		achievements.focus();
		return false;
	}
	if (package.value == "") {
		alert("Please enter an amount for the Package your receive/received for this employment record");
		package.focus();
		return false;
	}
	if (package.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Package detail');
		package.focus();
		return false;
	}
	if (package_per.selectedIndex == 0) {
		alert("Please specify the detail of the Package amount - i.e. per hour/week/month/annually");
		package_per.focus();
		return false;
	}
	if (benefits.value == "") {
		alert("Please enter your Benefits. If none, enter N/A");
		benefits.focus();
		return false;
	}
	if (benefits.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your Benefits');
		benefits.focus();
		return false;
	}
	document.forms[selform].action = "employment_record_up.php";
	return true;
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

//step 5: other skills form
function checkOtherSkills() {
	var otherskills = document.myform.otherskills;
	if (otherskills.value == "") {
		alert("Please enter your description. If none, enter N/A");
		otherskills.focus();
		return false;
	}
	if (otherskills.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your description');
		otherskills.focus();
		return false;
	}
	document.myform.action = "otherskills_up.php";
	return true;
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

//step 6: languages add form
function checkLanguages() {
	var lang_select = document.myform.lang_select;
	if (lang_select.options[lang_select.selectedIndex].value == "") {
		alert("Please select a Language");
		lang_select.focus();
		return false;
	}
	if (lang_select.options[lang_select.selectedIndex].value == "..Other") {
		if (document.myform.lang_other.value == "") {
			alert("Please enter your Other Language");
			document.myform.lang_other.focus();
			return false;
		}
	}
	var lang_read = document.myform.lang_read;
	if (lang_read.options[lang_read.selectedIndex].value == "") {
		alert("Please specifiy your level of Reading");
		lang_read.focus();
		return false;
	}
	var lang_write = document.myform.lang_write;
	if (lang_write.options[lang_write.selectedIndex].value == "") {
		alert("Please specifiy your level of Writing");
		lang_write.focus();
		return false;
	}
	var lang_speak = document.myform.lang_speak;
	if (lang_speak.options[lang_speak.selectedIndex].value == "") {
		alert("Please specifiy your level of Speaking");
		lang_speak.focus();
		return false;
	}
	document.myform.action = "languages_add.php";
	return true;
}
//step 6: initial disable other language field
function initLanguages() {
	document.myform.lang_other.disabled = true;
}
//step 6: change language box to other
function changeLanguageBox() {
	var lang_select = document.myform.lang_select;
	if (lang_select.options[lang_select.selectedIndex].value == "..Other") {
		document.myform.lang_other.disabled = false;
		document.myform.lang_other.focus();
	} else {
		document.myform.lang_other.value = "";
		document.myform.lang_other.disabled = true;
	}
}

//step 7: computer literacy form
function checkComputerLiteracy() {
	var compliteracy = document.myform.compliteracy;
	if (compliteracy.value == "") {
		alert("Please give a description of your level of computer literacy");
		compliteracy.focus();
		return false;
	}
	if (compliteracy.value.indexOf('"') != -1) {
		alert('Please remove the quotation (") mark/s from your description');
		compliteracy.focus();
		return false;
	}
	if (compliteracy.value.indexOf('@') != -1) {
		alert('Please remove the at (@) sign/s from your description');
		compliteracy.focus();
		return false;
	}
	if (compliteracy.value.indexOf('#') != -1) {
		alert('Please remove the hash (#) sign/s from your description');
		compliteracy.focus();
		return false;
	}
	if (compliteracy.value.indexOf('&') != -1) {
		alert('Please remove the ampersand (&) sign/s from your description');
		compliteracy.focus();
		return false;
	}
	document.myform.action = "computer_literacy_up.php";
	return true;
}

function checkAddComputer() {
	var program_name = document.addform.program_name;
	var program_proficiency = document.addform.program_proficiency;
	
	if (program_name.value == "") {
		alert("Please enter Program Name (e.g. MS Word)");
		program_name.focus();
		return false;
	}
	if (program_proficiency.selectedIndex == 0) {
		alert("Please select Program Proficiency");
		program_proficiency.focus();
		return false;
	}
	document.addform.action = "computer_literacy_add.php";
	return true;
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

//step 8: conferences / workshops add form
function checkConferencesForm() {
	var conf_type = document.myform.conf_type;
	var conf_name = document.myform.conf_name;
	
	if (conf_type.selectedIndex == 0) {
		alert("Please select the Event Type");
		conf_type.focus();
		return false;
	}
	if (conf_name.value == "") {
		alert("Please enter the Event Name");
		conf_name.focus();
		return false;
	}
	document.myform.action = "conferences_workshops_add.php";
	return true;
}
//step 8: conferences / workshops edit form
function checkEditConferencesForm() {
	var selform = document.myform.selform.value;
	var conf_name = document.forms[selform].conf_name;
		
	if (conf_name.value == "") {
		alert("Please enter the Event Name");
		conf_name.focus();
		return false;
	}
	document.forms[selform].action = "conferences_workshops_up.php";
	return true;
}
//step 8: check N/A box
function checkNAConf() {
	var conf_na = document.getElementById("conf_na");
	if (conf_na.checked == true) {
		document.myform.conf_type.disabled = true;
		document.myform.conf_name.disabled = true;
		document.myform.addnew.disabled = true;
		document.myform.conf_na_hidden.value = "Yes";
		var answer = confirm("Are you sure that you do not want to submit any Training / Workshop entries?");
		if (answer == true) {
			if (document.myform.recentry != null) {
				document.myform.conf_na.value = "Yes";
				document.myform.action = "capturecv-step8.php";
				document.myform.submit();
				return true;
			} else {
				var candidate_id_search = document.myform.candidate_id_search.value;
				if (candidate_id_search == "") {
					document.myform.action = "conferences_workshops_na.php";
				} else {
					document.myform.action = "conferences_workshops_na.php?candidate_id_search=" + candidate_id_search;
				}
				document.myform.submit();
				return true;
			}
		} else {
			conf_na.checked = false;
			document.myform.conf_type.disabled = false;
			document.myform.conf_name.disabled = false;
			document.myform.addnew.disabled = false;
			document.myform.conf_na_hidden.value = "No";
		}
	} else {
		conf_na.checked = false;
		document.myform.conf_type.disabled = false;
		document.myform.conf_name.disabled = false;
		document.myform.addnew.disabled = false;
		document.myform.conf_na_hidden.value = "No";
	}
}
//step 8: check N/A initial
function checkNAInitConf() {
	var conf_na = document.myform.conf_na_hidden;
	if (conf_na.value == "Yes") {
		document.getElementById("conf_na").checked = true;
		document.myform.conf_type.disabled = true;
		document.myform.conf_name.disabled = true;
		document.myform.addnew.disabled = true;
	} else {
		document.getElementById("conf_na").checked = false;
		document.myform.conf_type.disabled = false;
		document.myform.conf_name.disabled = false;
		document.myform.addnew.disabled = false;
	}
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

//step 9: references add form
function checkReferencesForm() {
	var ref_name = document.myform.ref_name;
	var ref_company = document.myform.ref_company;
	var ref_position = document.myform.ref_position;
	var ref_phonenumber = document.myform.ref_phonenumber;
	var ref_cellnumber = document.myform.ref_cellnumber;
	
	if (ref_name.value == "") {
		alert("Please enter the reference's Name");
		ref_name.focus();
		return false;
	}
	if (ref_company.value == "") {
		alert("Please enter the reference's Company");
		ref_company.focus();
		return false;
	}
	if (ref_position.value == "") {
		alert("Please enter the reference's Position");
		ref_position.focus();
		return false;
	}
	if (ref_phonenumber.value == "") {
		if (ref_cellnumber.value == "") {
			alert("Please enter the reference's Phone / Cellphone Number");
			ref_phonenumber.focus();
			return false;
		} else {
			ref_phonenumber.value = "-";
		}
	}
	if (ref_cellnumber.value == "") {
		if (ref_phonenumber.value == "") {
			alert("Please enter the reference's Phone / Cellphone Number");
			ref_phonenumber.focus();
			return false;
		} else {
			ref_cellnumber.value = "-";
		}
	}
	document.myform.action = "references_add.php";
	return true;
}
//step 9: references edit form
function checkEditReferencesForm() {
	var selform = document.myform.selform.value;
	var ref_name = document.forms[selform].ref_name;
	var ref_company = document.forms[selform].ref_company;
	var ref_position = document.forms[selform].ref_position;
	var ref_phonenumber = document.forms[selform].ref_phonenumber;
	var ref_cellnumber = document.forms[selform].ref_cellnumber;
	var ref_email = document.forms[selform].ref_email;
	
	if (ref_name.value == "") {
		alert("Please enter the reference's Name");
		ref_name.focus();
		return false;
	}
	if (ref_company.value == "") {
		alert("Please enter the reference's Company");
		ref_company.focus();
		return false;
	}
	if (ref_position.value == "") {
		alert("Please enter the reference's Position");
		ref_position.focus();
		return false;
	}
	if (ref_phonenumber.value == "") {
		if (ref_cellnumber.value == "") {
			alert("Please enter the reference's Phone / Cellphone Number");
			ref_phonenumber.focus();
			return false;
		} else {
			ref_phonenumber.value = "-";
		}
	}
	if (ref_cellnumber.value == "") {
		if (ref_phonenumber.value == "") {
			alert("Please enter the reference's Phone / Cellphone Number");
			ref_phonenumber.focus();
			return false;
		} else {
			ref_cellnumber.value = "-";
		}
	}
	if (ref_email.value.indexOf(".") == -1) {
		alert("Please enter a valid E-Mail Address");
		ref_email.focus();
		return false;
	}
	if (ref_email.value.indexOf("@") == -1) {
		alert("Please enter a valid E-Mail Address");
		ref_email.focus();
		return false;
	}
	document.forms[selform].action = "references_up.php";
	return true;
}

//step 9: check N/A box
function checkNARef() {
	var ref_na = document.getElementById("ref_na");
	if (ref_na.checked == true) {
		document.myform.ref_name.disabled = true;
		document.myform.ref_company.disabled = true;
		document.myform.ref_position.disabled = true;
		document.myform.ref_phonenumber.disabled = true;
		document.myform.ref_cellnumber.disabled = true;
		document.myform.ref_email.disabled = true;
		document.myform.addnew.disabled = true;
		document.myform.ref_na_hidden.value = "Yes";
		var answer = confirm("Are you sure that you do not want to Adecco to contact your references at this time?");
		if (answer == true) {
			if (document.myform.recentry != null) {
				document.myform.action = "capturecv-step9.php";
				document.myform.submit();
				return true;
			} else {
				var candidate_id_search = document.myform.candidate_id_search.value;
				if (candidate_id_search == "") {
					document.myform.action = "references_na.php";
				} else {
					document.myform.action = "references_na.php?candidate_id_search=" + candidate_id_search;
				}
				document.myform.submit();
				return true;
			}
		} else {
			ref_na.checked = false;
			document.myform.ref_name.disabled = false;
			document.myform.ref_company.disabled = false;
			document.myform.ref_position.disabled = false;
			document.myform.ref_phonenumber.disabled = false;
			document.myform.ref_cellnumber.disabled = false;
			document.myform.ref_email.disabled = false;
			document.myform.addnew.disabled = false;
			document.myform.ref_na_hidden.value = "No";
		}
	} else {
		ref_na.checked = false;
		document.myform.ref_name.disabled = false;
		document.myform.ref_company.disabled = false;
		document.myform.ref_position.disabled = false;
		document.myform.ref_phonenumber.disabled = false;
		document.myform.ref_cellnumber.disabled = false;
		document.myform.ref_email.disabled = false;
		document.myform.addnew.disabled = false;
		document.myform.ref_na_hidden.value = "No";
	}
}
//step 9: check N/A initial
function checkNAInitRef() {
	var ref_na_hidden = document.myform.ref_na_hidden;
	if (ref_na_hidden.value == "Yes") {
		document.getElementById("ref_na").checked = true;
		document.myform.ref_name.disabled = true;
		document.myform.ref_company.disabled = true;
		document.myform.ref_position.disabled = true;
		document.myform.ref_phonenumber.disabled = true;
		document.myform.ref_cellnumber.disabled = true;
		document.myform.ref_email.disabled = true;
		document.myform.addnew.disabled = true;
	} else {
		document.getElementById("ref_na").checked = false;
		document.myform.ref_name.disabled = false;
		document.myform.ref_company.disabled = false;
		document.myform.ref_position.disabled = false;
		document.myform.ref_phonenumber.disabled = false;
		document.myform.ref_cellnumber.disabled = false;
		document.myform.ref_email.disabled = false;
		document.myform.addnew.disabled = false;
	}
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

//JOB FORM

//intital values for job form
function initJobDetails() {
	var desired_type_hid = document.myform.desired_type_hid.value;
	var desired_availability_hid = document.myform.desired_availability_hid.value;
	var desired_workexperience_hid = document.myform.desired_workexperience_hid.value;
	var desired_packageper_hid = document.myform.desired_packageper_hid.value;
	
	var desired_type = document.myform.desired_type;
	var desired_availability = document.myform.desired_availability;
	var desired_workexperience = document.myform.desired_workexperience;
	var desired_packageper = document.myform.desired_packageper;
	
	if (desired_type_hid == "") {
		desired_type.selectedIndex = 0;
	}
	else if (desired_type_hid == "Permanent") {
		desired_type.selectedIndex = 1;
	}
	else if (desired_type_hid == "Temporary") {
		desired_type.selectedIndex = 2;
	}
	else if (desired_type_hid == "Permanent &amp; Temporary") {
		desired_type.selectedIndex = 3;
	}
	
	if (desired_availability_hid == "") {
		desired_availability.selectedIndex = 0;
	}
	else if (desired_availability_hid == "Immediate") {
		desired_availability.selectedIndex = 1;
	}
	else if (desired_availability_hid == "1 Week") {
		desired_availability.selectedIndex = 2;
	}
	else if (desired_availability_hid == "2 Weeks") {
		desired_availability.selectedIndex = 3;
	}
	else if (desired_availability_hid == "1 Month") {
		desired_availability.selectedIndex = 4;
	}
	
	if (desired_workexperience_hid == "") {
		desired_workexperience.selectedIndex = 0;
	}
	else if (desired_workexperience_hid == "0 - 1 Years") {
		desired_workexperience.selectedIndex = 1;
	}
	else if (desired_workexperience_hid == "1 - 2 Years") {
		desired_workexperience.selectedIndex = 2;
	}
	else if (desired_workexperience_hid == "2 - 3 Years") {
		desired_workexperience.selectedIndex = 3;
	}
	else if (desired_workexperience_hid == "More than 3 Years") {
		desired_workexperience.selectedIndex = 4;
	}
	
	if (desired_packageper_hid == "") {
		desired_packageper.selectedIndex = 0;
	}
	else if (desired_packageper_hid == "Per Hour") {
		desired_packageper.selectedIndex = 1;
	}
	else if (desired_packageper_hid == "Per Week") {
		desired_packageper.selectedIndex = 2;
	}
	else if (desired_packageper_hid == "Per Month") {
		desired_packageper.selectedIndex = 3;
	}
	else if (desired_packageper_hid == "Per Year") {
		desired_packageper.selectedIndex = 4;
	}
}

//check job details form
function checkJobDetails() {
	var desired_country = document.myform.desired_country;
	var desired_provincestate = document.myform.desired_provincestate;
	var desired_city = document.myform.desired_city;
	
	var desired_location = document.myform.desired_location;
	var desired_type = document.myform.desired_type;
	var desired_availability = document.myform.desired_availability;
	var desired_workexperience = document.myform.desired_workexperience;
	var desired_sector = document.myform.desired_sector;
	var desired_jobtitle = document.myform.desired_jobtitle;
	var desired_package = document.myform.desired_package;
	var desired_packageper = document.myform.desired_packageper;
	
	if (desired_country.selectedIndex == 0) {
		alert("Please select your Desired Location (Country)");
		desired_country.focus();
		return false;
	}
	if (desired_provincestate.selectedIndex == 0) {
		alert("Please select your Desired Location (Province / State)");
		desired_provincestate.focus();
		return false;
	}
	if (desired_city.selectedIndex == 0) {
		alert("Please select your Desired Location (City)");
		desired_city.focus();
		return false;
	}
	if (desired_type.selectedIndex == 0) {
		alert("Please select your Desired Type of Employment");
		desired_type.focus();
		return false;
	}
	if (desired_availability.selectedIndex == 0) {
		alert("Please select your Desired Availability");
		desired_availability.focus();
		return false;
	}
	if (desired_workexperience.selectedIndex == 0) {
		alert("Please select your Work Experience");
		desired_workexperience.focus();
		return false;
	}
	if (desired_sector.value == "") {
		alert("Please select your Work Sector");
		desired_sector.focus();
		return false;
	}
	if (desired_jobtitle.value == "") {
		alert("Please select your Desired Job Title");
		desired_jobtitle.focus();
		return false;
	}
	if (desired_package.value == "") {
		alert("Please select your Desired Package");
		desired_package.focus();
		return false;
	}
	if (desired_packageper.selectedIndex == 0) {
		alert("Please specify the detail of the Package amount - i.e. per hour/week/month/annually");
		desired_packageper.focus();
		return false;
	}
	document.myform.desired_location.value = desired_country.options[desired_country.selectedIndex].value + ", " +
									   desired_provincestate.options[desired_provincestate.selectedIndex].value + ", " +
									   desired_city.options[desired_city.selectedIndex].value;
	
	document.myform.action = "jobdetails_up.php";
	return true;
}

//clear job details
function clearJobDetails() {
	var desired_location = document.myform.desired_location;
	var desired_type = document.myform.desired_type;
	var desired_availability = document.myform.desired_availability;
	var desired_workexperience = document.myform.desired_workexperience;
	var desired_sector = document.myform.desired_sector;
	var desired_jobtitle = document.myform.desired_jobtitle;
	var desired_package = document.myform.desired_package;
	var desired_packageper = document.myform.desired_packageper;
	
	var answer = confirm("Are you sure you want to clear your job preferences?");
	if (answer) {
		desired_location.value = "";
		desired_type.selectedIndex = 0;
		desired_availability.selectedIndex = 0;
		desired_workexperience.selectedIndex = 0;
		desired_sector.value = "";
		desired_jobtitle.value = "";
		desired_package.value = "";
		desired_packageper.selectedIndex = 0;
		document.myform.action = "jobdetails_up.php";
		return true;
	} else {
		return false;
	}
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

//UPLOAD CV

//check upload cv form
function checkUploadCV() {
	document.myform.action = "uploadcv_action.php";
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//

//PASSWORD FORM

//check the password form
function checkChangePassword() {
	var hid_password = document.myform.oldpassword;
	var old_password = document.myform.old_password;
	var new_password = document.myform.new_password;
	var new_password_retype = document.myform.new_password_retype;
	
	if (old_password.value == "") {
		alert("Please enter your Old/Current Password");
		old_password.focus();
		return false;
	}
	if (old_password.value != hid_password.value) {
		alert("Your Old/Current Password is incorrect. Please re-enter");
		old_password.value = "";
		old_password.focus();
		return false;
	}
	if (new_password.value == "") {
		alert("Please enter your Password");
		new_password.focus();
		return false;
	}
	if (new_password.value.length < 6) {
		alert("Your Password is less than 6 characters long");
		new_password.focus();
		return false;
	}
	if (new_password.value.indexOf("0") == -1) {if (new_password.value.indexOf("1") == -1) {if (new_password.value.indexOf("2") == -1) {if (new_password.value.indexOf("3") == -1) {
	if (new_password.value.indexOf("4") == -1) {if (new_password.value.indexOf("5") == -1) {if (new_password.value.indexOf("6") == -1) {if (new_password.value.indexOf("7") == -1) {
	if (new_password.value.indexOf("8") == -1) {if (new_password.value.indexOf("9") == -1) {
		alert("Your Password does not contain a numeric character. Please add a number to your password");
		new_password.focus();
		return false;
	}}}}}}}}}}
	if (new_password_retype.value == "") {
		alert("Please re-enter your Password");
		new_password_retype.focus();
		return false;
	}
	if (new_password.value != new_password_retype.value) {
		alert("Your Passwords don't match. Please verify");
		new_password.focus();
		return false;
	}
	document.myform.action = "changepassword_action.php";
	return true;
}


function checkVacancyForm() {
	var jobtitle = document.myform.jobtitle;
	var jobsector = document.myform.jobsector;
	var country = document.myform.vac_country;
	var provincestate = document.myform.vac_provincestate;
	var city = document.myform.vac_city;
	var suburb = document.myform.vac_suburb;
	var equity = document.myform.equity;
	var competencies = document.myform.competencies;
	var market = document.myform.market;
	var responsibilities = document.myform.responsibilities;
	var equity = document.myform.equity;
	var renumerations = document.myform.renumerations;
	var renumerations_per = document.myform.renumerations_per;
	var closingdate_day = document.myform.closingdate_day;
	var closingdate_month = document.myform.closingdate_month;
	var closingdate_year = document.myform.closingdate_year;
	var closingdate = document.myform.closingdate;
	var personloading = document.myform.personloading;
	var persondivision = document.myform.persondivision;
	var personemail = document.myform.personemail;
	
	if (jobtitle.value == "") {
		alert("Please enter the Job Title");
		jobtitle.focus();
		return false;
	}
	if (jobtitle.value.indexOf('"') != -1) {
		alert("Please remove the quotation mark/s from Job Title");
		jobtitle.focus();
		return false;
	}
	if (jobsector.value == "") {
		alert("Please enter the Job Sector");
		jobsector.focus();
		return false;
	}
	if (jobsector.value.indexOf('"') != -1) {
		alert("Please remove the quotation mark/s from Job Sector");
		jobsector.focus();
		return false;
	}
	if (country.selectedIndex == 0) {
		alert("Please select Country");
		country.focus();
		return false;
	}
	if (provincestate.selectedIndex == 0) {
		alert("Please select Province / State");
		provincestate.focus();
		return false;
	}
	if (city.selectedIndex == 0) {
		alert("Please select City");
		city.focus();
		return false;
	}
	if (suburb.selectedIndex == 0) {
		alert("Please select Suburb");
		suburb.focus();
		return false;
	}
	if (market.value == "") {
		alert("Please Market the Position (e.g. amazing, great position, prime location)");
		market.focus();
		return false;
	}
	if (market.value.indexOf('"') != -1) {
		alert("Please remove the quotation mark/s from Position Marketing");
		market.focus();
		return false;
	}
	if (responsibilities.value == "") {
		alert("Please enter the Key Responsibilities");
		responsibilities.focus();
		return false;
	}
	if (responsibilities.value.indexOf('"') != -1) {
		alert("Please remove the quotation mark/s from Key Responsibilities");
		responsibilities.focus();
		return false;
	}
	if (competencies.value == "") {
		alert("Please enter the Required Competencies");
		competencies.focus();
		return false;
	}
	if (competencies.value.indexOf('"') != -1) {
		alert("Please remove the quotation mark/s from Required Competencies");
		competencies.focus();
		return false;
	}
	if (renumerations.value != "") {
		if (renumerations_per.selectedIndex == 0) {
			alert("Please select the Renumerations detail (per Hour / Week / Month / Year");
			renumerations_per.focus();
			return false;
		}
	}
	if (closingdate_day.selectedIndex == 0) {
		alert("Please select Closing Date (Day)");
		closingdate_day.focus();
		return false;
	}
	if (closingdate_month.selectedIndex == 0) {
		alert("Please select Closing Date (Month)");
		closingdate_month.focus();
		return false;
	}
	if (closingdate_year.selectedIndex == 0) {
		alert("Please select Closing Date (Year)");
		closingdate_year.focus();
		return false;
	}
	if (persondivision.selectedIndex == 0) {
		alert("Please select Person's Division");
		persondivision.focus();
		return false;
	}
	if (personemail.value == "") {
		alert("Please enter Person's E-Mail Address");
		personemail.focus();
		return false;
	}
	if (personemail.value.indexOf("@") != -1) {
		alert("Only Adecco e-mail's are allowed. Please only enter the first part of the address");
		personemail.focus();
		return false;
	}
	document.myform.location.value = country.options[country.selectedIndex].value + ", " + provincestate.options[provincestate.selectedIndex].value + ", " + city.options[city.selectedIndex].value + ", " + suburb.options[suburb.selectedIndex].value;
	document.myform.closingdate.value = closingdate_day.options[closingdate_day.selectedIndex].value + "-" + closingdate_month.options[closingdate_month.selectedIndex].value + "-" + closingdate_year.options[closingdate_year.selectedIndex].value
	
	document.myform.action = "previewvacancy.php";
	return true;
}

function checkSearchVacancy() {
	var trackingnumber = document.myform.trackingnumber;
	
	if (trackingnumber.value == "") {
		alert("Please enter Vacancy Tracking Number");
		trackingnumber.focus();
		return false;
	}
	document.myform.action = "viewvacancies.php";
}

function checkEnterComments() {
	var interview_type = document.myform.interview_type;
	var interview_client = document.myform.interview_client;
	var interview_day = document.myform.interview_day;
	var interview_month = document.myform.interview_month;
	var interview_year = document.myform.interview_year;
	var comments = document.myform.entercomments;
	
	if (interview_type.value == "") {
		alert("Please select Interview Type");
		interview_type.focus();
		return false;
	}
	if (interview_type.selectedIndex == 4) {
		if (interview_client.value == "") {
			alert("Please enter Client to which CV was Sent");
			interview_client.focus();
			return false;
		} else {}
	}
	if (interview_day.value == "") {
		alert("Please select Interview Date (Day)");
		interview_day.focus();
		return false;
	}
	if (interview_month.value == "") {
		alert("Please select Interview Date (Month)");
		interview_month.focus();
		return false;
	}
	if (interview_year.value == "") {
		alert("Please select Interview Date (Year)");
		interview_year.focus();
		return false;
	}
	if (comments.value == "") {
		alert("Please enter your comments");
		comments.focus();
		return false;
	}
	if (comments.value.indexOf('"') != -1) {
		alert('Please remove the quotation mark/s (") from your comments');
		comments.focus();
		return false;
	}
	document.myform.action = "candidate_viewcomments.php";
	return true;
}

function checkEnterXpert() {
	var xpert_test = document.myform.xpert_test;
	var xpert_day = document.myform.xpert_day;
	var xpert_month = document.myform.xpert_month;
	var xpert_year = document.myform.xpert_year;
	
	if (xpert_test.value == "") {
		alert("Please enter Xpert Test Done");
		xpert_test.focus();
		return false;
	}
	if (xpert_day.selectedIndex == 0) {
		alert("Please select Date Completed (Day)");
		xpert_day.focus();
		return false;
	}
	if (xpert_month.selectedIndex == 0) {
		alert("Please select Date Completed (Month)");
		xpert_month.focus();
		return false;
	}
	if (xpert_year.selectedIndex == 0) {
		alert("Please select Date Completed (Year)");
		xpert_year.focus();
		return false;
	}
	var candidate_id_search = document.myform.candidate_id_search.value;
	document.myform.action = "candidate_viewxpert.php?candidate_id_search=" + candidate_id_search;
	return true;
}

function checkChangeAvail() {
	if (document.avform.availability.selectedIndex == 0) {
		document.getElementById("recruiter_div1").style.display = 'none';
		document.getElementById("recruiter_div1").style.visibility='hidden';
		document.getElementById("recruiter_div2").style.display = 'none';
		document.getElementById("recruiter_div2").style.visibility='hidden';
		
		document.getElementById("bus_div1").style.display = 'none';
		document.getElementById("bus_div1").style.visibility = 'hidden';
		document.getElementById("bus_div2").style.display = 'none';
		document.getElementById("bus_div2").style.visibility='hidden';
		document.avform.businessline.selectedIndex = 0;
		document.avform.client.selectedIndex = 0;
		
		document.getElementById("client_div1").style.display = 'none';
		document.getElementById("client_div1").style.visibility='hidden';
		document.getElementById("client_div2").style.display = 'none';
		document.getElementById("client_div2").style.visibility='hidden';
		
		document.getElementById("candidate_div1").style.display = 'none';
		document.getElementById("candidate_div1").style.visibility='hidden';
		document.getElementById("candidate_div2").style.display = 'none';
		document.getElementById("candidate_div2").style.visibility='hidden';
		
		document.getElementById("reason_div1").style.display = 'none';
		document.getElementById("reason_div1").style.visibility='hidden';
		document.getElementById("reason_div2").style.display = 'none';
		document.getElementById("reason_div2").style.visibility='hidden';
	}
	else if (document.avform.availability.selectedIndex == 1) {
		document.getElementById("recruiter_div1").style.display = 'block';
		document.getElementById("recruiter_div1").style.visibility='visible';
		document.getElementById("recruiter_div2").style.display = 'block';
		document.getElementById("recruiter_div2").style.visibility='visible';
		
		document.getElementById("bus_div1").style.display = 'block';
		document.getElementById("bus_div1").style.visibility='visible';
		document.getElementById("bus_div2").style.display = 'block';
		document.getElementById("bus_div2").style.visibility='visible';
		
		document.getElementById("client_div1").style.display = 'block';
		document.getElementById("client_div1").style.visibility='visible';
		document.getElementById("client_div2").style.display = 'block';
		document.getElementById("client_div2").style.visibility='visible';
		
		document.getElementById("candidate_div1").style.display = 'block';
		document.getElementById("candidate_div1").style.visibility='visible';
		document.getElementById("candidate_div2").style.display = 'block';
		document.getElementById("candidate_div2").style.visibility='visible';
		
		document.getElementById("reason_div1").style.display = 'block';
		document.getElementById("reason_div1").style.visibility='visible';
		document.getElementById("reason_div2").style.display = 'block';
		document.getElementById("reason_div2").style.visibility='visible';
		
		document.avform.businessline.focus();
	}
}

function ppmCheck() {
	var availability = document.avform.availability;
	var recruiter_name = document.avform.recruiter_name;
	var businessline = document.avform.businessline;
	var client = document.avform.client;
	var candidate_id = document.avform.candidate_id;
	var reason = document.avform.reason;
	var persondivision = document.avform.persondivision;
	
	var authorized = false;
	
	if (availability.selectedIndex == 1) {
		if (recruiter_name.value != "") {
			if (businessline.options[businessline.selectedIndex].value != "") {
				if (client.options[client.selectedIndex].value != "") {
					if (candidate_id.value != "") {
						if (reason.selectedIndex == 0) {
							authorized = true;
						} else {}
					} else {}
				} else {}
			} else {}
		} else {}
	} else {}
	
	if (authorized == true) {
		var URL = "'http://www.adecco.co.za/testportal/ppm/integrate.php?bl=" + businessline.options[businessline.selectedIndex].value + "&cl=" + client.options[client.selectedIndex].value + "&rc=" + recruiter_name.value + "&cd=" + candidate_id.value + "&pd=" + persondivision.value + "'";
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open("+ URL +", '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=980,height=500,left = 640,top = 325');");
	} else {}
}

function checkChangeVacancy() {
	if (document.getElementById("recruiter_div1").style.display == "none") {
		return false;
	} else {
		var recruiter_name = document.avform.recruiter_name;
		var client_name = document.avform.client_name;
		var candidate_id = document.avform.client_id;
		
		if (recruiter_name.value == "") {
			alert("Please enter your name (the Recruiter)");
			recruiter_name.focus();
			return false;
		}
		if (client_name.value == "") {
			alert("Please enter the Client Name");
			client_name.focus();
			return false;
		}
		if (candidate_id.value == "") {
			alert("Please enter the candidate's ID Number");
			candidate_id.focus();
			return false;
		}
		return true;
	}
}

function checkInitVacancy() {
	if (document.avform.hidava.value == "Closed") {
		if (document.avform.hidbus.value != "") {
			if (document.avform.hidcli.value != "") {
				document.getElementById("recruiter_div1").style.display = 'block';
				document.getElementById("recruiter_div1").style.visibility='visible';
				document.getElementById("recruiter_div2").style.display = 'block';
				document.getElementById("recruiter_div2").style.visibility='visible';
				document.avform.recruiter_name.disabled = true;
				
				document.getElementById("bus_div1").style.display = 'block';
				document.getElementById("bus_div1").style.visibility='visible';
				document.getElementById("bus_div2").style.display = 'block';
				document.getElementById("bus_div2").style.visibility='visible';
				document.avform.businessline.disabled = true;
				
				document.getElementById("client_div1").style.display = 'block';
				document.getElementById("client_div1").style.visibility='visible';
				document.getElementById("client_div2").style.display = 'block';
				document.getElementById("client_div2").style.visibility='visible';
				document.avform.client.disabled = true;
				
				document.getElementById("candidate_div1").style.display = 'block';
				document.getElementById("candidate_div1").style.visibility='visible';
				document.getElementById("candidate_div2").style.display = 'block';
				document.getElementById("candidate_div2").style.visibility='visible';
				document.avform.candidate_id.disabled = true;
				
				document.getElementById("reason_div1").style.display = 'block';
				document.getElementById("reason_div1").style.visibility='visible';
				document.getElementById("reason_div2").style.display = 'block';
				document.getElementById("reason_div2").style.visibility='visible';
				document.avform.reason.disabled = true;
				
				document.getElementById("reasonspec_div1").style.display = 'block';
				document.getElementById("reasonspec_div1").style.visibility='visible';
				document.getElementById("reasonspec_div2").style.display = 'block';
				document.getElementById("reasonspec_div2").style.visibility='visible';
				document.avform.reasonspec.disabled = true;
				
				document.getElementById("xpert_div1").style.display = 'block';
				document.getElementById("xpert_div1").style.visibility='visible';
				document.getElementById("xpert_div2").style.display = 'block';
				document.getElementById("xpert_div2").style.visibility='visible';
				document.avform.xpert.disabled = true;
				
				document.avform.availability.selectedIndex = 1;
				document.avform.availability.disabled = true;
			} else {}
		} else {}
	} else {
		document.getElementById("recruiter_div1").style.display = 'none';
		document.getElementById("recruiter_div1").style.visibility='hidden';
		document.getElementById("recruiter_div2").style.display = 'none';
		document.getElementById("recruiter_div2").style.visibility='hidden';
		
		document.getElementById("bus_div1").style.display = 'none';
		document.getElementById("bus_div1").style.visibility='hidden';
		document.getElementById("bus_div2").style.display = 'none';
		document.getElementById("bus_div2").style.visibility='hidden';
		
		document.getElementById("client_div1").style.display = 'none';
		document.getElementById("client_div1").style.visibility='hidden';
		document.getElementById("client_div2").style.display = 'none';
		document.getElementById("client_div2").style.visibility='hidden';
		
		document.getElementById("candidate_div1").style.display = 'none';
		document.getElementById("candidate_div1").style.visibility='hidden';
		document.getElementById("candidate_div2").style.display = 'none';
		document.getElementById("candidate_div2").style.visibility='hidden';
		
		document.getElementById("reason_div1").style.display = 'none';
		document.getElementById("reason_div1").style.visibility='hidden';
		document.getElementById("reason_div2").style.display = 'none';
		document.getElementById("reason_div2").style.visibility='hidden';
		
		document.getElementById("reasonspec_div1").style.display = 'none';
		document.getElementById("reasonspec_div1").style.visibility='hidden';
		document.getElementById("reasonspec_div2").style.display = 'none';
		document.getElementById("reasonspec_div2").style.visibility='hidden';
		
		document.getElementById("xpert_div1").style.display = 'none';
		document.getElementById("xpert_div1").style.visibility='hidden';
		document.getElementById("xpert_div2").style.display = 'none';
		document.getElementById("xpert_div2").style.visibility='hidden';
		
		document.avform.availability.selectedIndex = 0;
	}
}

function changeReason() {
	if (document.avform.reason.selectedIndex == 3) {
		document.getElementById("reasonspec_div1").style.display = 'block';
		document.getElementById("reasonspec_div1").style.visibility='visible';
		document.getElementById("reasonspec_div2").style.display = 'block';
		document.getElementById("reasonspec_div2").style.visibility='visible';
		document.avform.reasonspec.focus();
	} else {
		document.getElementById("reasonspec_div1").style.display = 'none';
		document.getElementById("reasonspec_div1").style.visibility='hidden';
		document.getElementById("reasonspec_div2").style.display = 'none';
		document.getElementById("reasonspec_div2").style.visibility='hidden';
	}
}

function changeLocation() {
	var box = document.myform.filter_location;
	if (box.selectedIndex == 0) {
		document.getElementById("filter_location_div").style.visibility = "hidden";
		document.getElementById("filter_location_div").style.display = "none";
		document.myform.filter_location_country.selectedIndex = 0;
		document.myform.filter_location_provincestate.selectedIndex = 0;
		document.myform.filter_location_city.selectedIndex = 0;
	} else {
		document.getElementById("filter_location_div").style.visibility = "visible";
		document.getElementById("filter_location_div").style.display = "block";
		document.myform.filter_location_country.focus();
	}
}

function checkInitLocation() {
	var filter_location1 = document.myform.filter_location1.value;
	
	if (filter_location1 == "Search Desired Location") {
		document.getElementById("filter_location_div").style.visibility = "visible";
		document.getElementById("filter_location_div").style.display = "block";
		document.myform.filter_location.selectedIndex = 2;
	} else if (filter_location1 == "Search Current Location") {
		document.getElementById("filter_location_div").style.visibility = "visible";
		document.getElementById("filter_location_div").style.display = "block";
		document.myform.filter_location.selectedIndex = 1;
	} else {
		document.getElementById("filter_location_div").style.visibility = "hidden";
		document.getElementById("filter_location_div").style.display = "none";
		document.myform.filter_location_country.selectedIndex = 0;
		document.myform.filter_location_provincestate.selectedIndex = 0;
		document.myform.filter_location_city.selectedIndex = 0;
		document.myform.filter_location.selectedIndex = 0;
	}
}

function checkSearchSkills() {
	var box = document.myform.filter_location;
	if (box.selectedIndex == 1) {
		if (document.myform.filter_location_specify.value == "") {
			alert("Please specify what location you are looking for");
			document.myform.filter_location_specify.focus();
			return false;
		}
	}
	return true;
}

function changeJobPlacement() {
	var box = document.myform.answer;
	if (box.selectedIndex == 0) {
		document.getElementById("specifydiv1").style.display = 'none';
		document.getElementById("specifydiv1").style.visibility='hidden';
		document.getElementById("specifydiv2").style.display = 'none';
		document.getElementById("specifydiv2").style.visibility='hidden';
		document.getElementById("buttondiv").style.display = 'none';
		document.getElementById("buttondiv").style.visibility='hidden';
		document.myform.specifyclient.value = "";
	} else if (box.selectedIndex == 1) {
		document.getElementById("specifydiv1").style.display = 'none';
		document.getElementById("specifydiv1").style.visibility='hidden';
		document.getElementById("specifydiv2").style.display = 'none';
		document.getElementById("specifydiv2").style.visibility='hidden';
		document.getElementById("buttondiv").style.display = 'block';
		document.getElementById("buttondiv").style.visibility='visible';
		document.myform.specifyclient.value = "";
	} else if (box.selectedIndex == 2) {
		document.getElementById("specifydiv1").style.display = 'block';
		document.getElementById("specifydiv1").style.visibility='visible';
		document.getElementById("specifydiv2").style.display = 'block';
		document.getElementById("specifydiv2").style.visibility='visible';
		document.getElementById("buttondiv").style.display = 'block';
		document.getElementById("buttondiv").style.visibility='visible';
		document.myform.specifyclient.focus();
	} else if (box.selectedIndex == 3) {
		document.getElementById("specifydiv1").style.display = 'none';
		document.getElementById("specifydiv1").style.visibility='hidden';
		document.getElementById("specifydiv2").style.display = 'none';
		document.getElementById("specifydiv2").style.visibility='hidden';
		document.getElementById("buttondiv").style.display = 'block';
		document.getElementById("buttondiv").style.visibility='visible';
		document.myform.specifyclient.value = "";
	}
}

function checkJobPlacement() {
	var specifyclient = document.myform.specifyclient;
	var box = document.myform.answer;
	if (box.selectedIndex == 2) {
		if (specifyclient.value == "") {
			alert("Please enter the Client Name");
			specifyclient.focus();
			return false;
		}
	}
	document.myform.action = "jobplacement.php";
	return true;
}