<!--//

	//------------------------------------------------------------
	// Function Name: doCandidateRegisterStep1
	// Parameters   : None
	// Author       : Matthew Wall
	// Date         : 16 Oct 2005
	// Purpose      : 
	//------------------------------------------------------------
	function doCandidateRegisterStep1() {
	
		var strErrorMessage = "Form submission error(s):\n\n";
		var blnErrors = false;
		
		if (document.form1.title.selectedIndex == 0) {
				strErrorMessage = strErrorMessage + " - Please select a title.\n";
				blnErrors = true;
		}
		
		if (document.form1.firstname.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter your first name.\n";
				blnErrors = true;
		} 

		if (document.form1.lastname.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter your last name.\n";
				blnErrors = true;
		} 

		if (!isDate(document.form1.dayDateOfBirth.value, document.form1.monthDateOfBirth.value, document.form1.yearDateOfBirth.value)) {
			strErrorMessage = strErrorMessage + " - Please enter a valid date of birth\n";
			blnErrors = true;
		}

		if (document.form1.address1.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter a value in address 1.\n";
				blnErrors = true;
		} 

		if (document.form1.town.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter your town.\n";
				blnErrors = true;
		} 

		if (document.form1.postcode.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter your postcode.\n";
				blnErrors = true;
		} 

		if (document.form1.telephone.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter your telephone number.\n";
				blnErrors = true;
		} 

		if (document.form1.email.value == "") {
			strErrorMessage = strErrorMessage + " - Please enter your email.\n";
			blnErrors = true;
		} 
		else if (!IsValidEmail(document.form1.email.value)) {
			strErrorMessage = strErrorMessage + " - Email address is not valid.\n";
			blnErrors = true;
		}

		if (document.form1.emailVacancies.checked) { document.form1.emailVacancies.value = "1"; } else { document.form1.emailVacancies.value = "0"; }
		if (document.form1.newsletter.checked) { document.form1.newsletter.value = "1"; } else { document.form1.newsletter.value = "0"; }

		if (document.form1.NIN.value.length > 0) {
			if (!checkNINO (document.form1.NIN.value)) { 
				strErrorMessage = strErrorMessage + " - Invalid National Insurance Number.\n";
				blnErrors = true;
			}
		}

		if (document.form1.Nationality.selectedIndex == 0) {
				strErrorMessage = strErrorMessage + " - Please select your nationality.\n";
				blnErrors = true;
		}

		if (radioButtonChecker(document.form1.criminalRecord) == null) {
				strErrorMessage = strErrorMessage + " - Do you have a criminal record?\n";
				blnErrors = true;
		}
		
		if (radioButtonChecker(document.form1.requireWorkPermit) == null) {
				strErrorMessage = strErrorMessage + " - Do you require any type of work permit?\n";
				blnErrors = true;
		}
		else if ((document.form1.requireWorkPermit[0].checked) && (document.form1.specifyWorkPermit.value == "")) {
				strErrorMessage = strErrorMessage + " - Please specify type of work permit?\n";
				blnErrors = true;
		}
		
		if (radioButtonChecker(document.form1.holdUKDrivingLicense) == null) {
				strErrorMessage = strErrorMessage + " - Do you hold a UK driving licence?\n";
				blnErrors = true;
		}

		if (radioButtonChecker(document.form1.accessToCar) == null) {
				strErrorMessage = strErrorMessage + " - Do you have access to a car?\n";
				blnErrors = true;
		}

		if (radioButtonChecker(document.form1.CRBDisclosure) == null) {
				strErrorMessage = strErrorMessage + " - Do you have a CRB disclosure?\n";
				blnErrors = true;
		}

		if ((document.form1.hearAboutUsID.selectedIndex == 7) && (document.form1.hearAboutUsOther.value == "")) {
				strErrorMessage = strErrorMessage + " - Please tell us how you heard about us.\n";
				blnErrors = true;
		}
		
		if (blnErrors) {
			document.form1.submitForm.value = "0";
			alert(strErrorMessage);
		} 
		else {
			document.form1.submitForm.value = "1";
			document.form1.submit();
		}
	}



	//------------------------------------------------------------
	// Function Name: doCandidateRegisterStep2
	// Parameters   : None
	// Author       : Matthew Wall
	// Date         : 16 Oct 2005
	// Purpose      : 
	//------------------------------------------------------------
	function doCandidateRegisterStep2() {
		var strErrorMessage = "Form submission error(s):\n\n";
		var blnErrors = false;
		
		if (radioButtonChecker(document.form1.qualifications) == null) {
				strErrorMessage = strErrorMessage + "What qualifications do you have?\n";
				blnErrors = true;
		}
		
		if (blnErrors) {
			document.form1.submitForm.value = "0";
			alert(strErrorMessage);
		} 
		else {
			document.form1.submitForm.value = "1";
			document.form1.submit();
		}
	}



	//------------------------------------------------------------
	// Function Name: doCandidateRegisterStep3
	// Parameters   : None
	// Author       : Matthew Wall
	// Date         : 16 Oct 2005
	// Purpose      : 
	//------------------------------------------------------------
	function doCandidateRegisterStep3() {
		var strErrorMessage = "Form submission error(s):\n\n";
		var blnErrors = false;
		
		/*
		if (document.form1.personalReferenceFirstname.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter a first name.\n";
				blnErrors = true;
		} 

		if (document.form1.personalReferenceLastname.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter a last name.\n";
				blnErrors = true;
		} 

		if (document.form1.personalReferenceAddress1.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter a value in address 1.\n";
				blnErrors = true;
		} 

		if (document.form1.personalReferenceTelephone.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter a telephone number.\n";
				blnErrors = true;
		} 
		*/

		if (blnErrors) {
			document.form1.submitForm.value = "0";
			alert(strErrorMessage);
		} 
		else {
			document.form1.submitForm.value = "1";
			document.form1.submit();
		}
	}



	//------------------------------------------------------------
	// Function Name: doCandidateRegisterStep4
	// Parameters   : None
	// Author       : Matthew Wall
	// Date         : 16 Oct 2005
	// Purpose      : 
	//------------------------------------------------------------
	function doCandidateRegisterStep4() {
		var strErrorMessage = "Form submission error(s):\n\n";
		var blnErrors = false;

		if (document.form1.monthPastJob1FromDate.selectedIndex > 0) {
			if (!isDate(01, document.form1.monthPastJob1FromDate.value, document.form1.yearPastJob1FromDate.value)) {
				strErrorMessage = strErrorMessage + " - Please enter a valid starting date for Job #1.\n";
				blnErrors = true;
			}
		}

		if (document.form1.monthPastJob1ToDate.selectedIndex > 0) {
			if (!isDate(01, document.form1.monthPastJob1ToDate.value, document.form1.yearPastJob1ToDate.value)) {
				strErrorMessage = strErrorMessage + " - Please enter a valid ending date for Job #1.\n";
				blnErrors = true;
			}
		}
		
		if (document.form1.monthPastJob2FromDate.selectedIndex > 0) {
			if (!isDate(01, document.form1.monthPastJob2FromDate.value, document.form1.yearPastJob2FromDate.value)) {
				strErrorMessage = strErrorMessage + " - Please enter a valid starting date for Job #1.\n";
				blnErrors = true;
			}
		}

		if (document.form1.monthPastJob2ToDate.selectedIndex > 0) {
			if (!isDate(01, document.form1.monthPastJob2ToDate.value, document.form1.yearPastJob2ToDate.value)) {
				strErrorMessage = strErrorMessage + " - Please enter a valid ending date for Job #1.\n";
				blnErrors = true;
			}
		}

		if (document.form1.monthPastJob3FromDate.selectedIndex > 0) {
			if (!isDate(01, document.form1.monthPastJob3FromDate.value, document.form1.yearPastJob3FromDate.value)) {
				strErrorMessage = strErrorMessage + " - Please enter a valid starting date for Job #1.\n";
				blnErrors = true;
			}
		}

		if (document.form1.monthPastJob3ToDate.selectedIndex > 0) {
			if (!isDate(01, document.form1.monthPastJob3ToDate.value, document.form1.yearPastJob3ToDate.value)) {
				strErrorMessage = strErrorMessage + " - Please enter a valid ending date for Job #1.\n";
				blnErrors = true;
			}
		}

		if (blnErrors) {
			document.form1.submitForm.value = "0";
			alert(strErrorMessage);
		} 
		else {
			document.form1.submitForm.value = "1";
			document.form1.submit();
		}
	}



	//------------------------------------------------------------
	// Function Name: doCandidateRegisterStep5
	// Parameters   : None
	// Author       : Matthew Wall
	// Date         : 16 Oct 2005
	// Purpose      : 
	//------------------------------------------------------------
	function doCandidateRegisterStep5() {
		var strErrorMessage = "Form submission error(s):\n\n";
		var blnErrors = false;
		
		if (!validateSelectControl(document.form1.jobTitleID)) {
				strErrorMessage = strErrorMessage + " - Please select at least one job title.\n";
				blnErrors = true;
		}

		/*
		if (!validateSelectControl(document.form1.sectorID)) {
				strErrorMessage = strErrorMessage + " - Please select at least one sector.\n";
				blnErrors = true;
		}
		*/

		if (!validateSelectControl(document.form1.UKCounties)) {
				strErrorMessage = strErrorMessage + " - Please select at least one location.\n";
				blnErrors = true;
		}
		
		if (document.form1.salaryRangeID == 0) {
				strErrorMessage = strErrorMessage + " - Please select a salary range.\n";
				blnErrors = true;
		}
		
		if (document.form1.startDateID.selectedIndex == 0) {
				strErrorMessage = strErrorMessage + " - Please select a start date.\n";
				blnErrors = true;
		}

		/* Checkboxes */
		if (document.form1.typeOfWorkTemp.checked) { document.form1.typeOfWorkTemp.value = "1"; } else { document.form1.typeOfWorkTemp.value = "0"; }
		if (document.form1.typeOfWorkPerm.checked) { document.form1.typeOfWorkPerm.value = "1"; } else { document.form1.typeOfWorkPerm.value = "0"; }
		if (document.form1.typeOfWorkFT.checked) { document.form1.typeOfWorkFT.value = "1"; } else { document.form1.typeOfWorkFT.value = "0"; }
		if (document.form1.typeOfWorkPT.checked) { document.form1.typeOfWorkPT.value = "1"; } else { document.form1.typeOfWorkPT.value = "0"; }

		if (blnErrors) {
			document.form1.submitForm.value = "0";
			alert(strErrorMessage);
		} 
		else {
		
			var strStatement = "Providing any misleading or false information to support your application will disqualify you from registration.  I hereby declare that I have understood and compiled with the requirements laid down in the previous paragraphs and I agree that the information given on this form may be used for registered purposes under the Data Protection Act 1984.  I have read and understood the service agreement and understand I will be issued with a copy.  I also agree that during my employment with or through Flow Sports Ltd, I will not disclose any confidential information to any person which I have obtained while attending my assignment or which has been disclosed by Flow Sports."

			if (confirm(strStatement)) {
				document.form1.submitForm.value = "1";
				document.form1.submit();
			}
		}
	}



	
	//------------------------------------------------------------
	// Function Name: doEmployerRegister()
	// Parameters   : None
	// Author       : Matthew Wall
	// Date         : 16 Oct 2005
	// Purpose      : 
	//------------------------------------------------------------
	function doEmployerRegister() {
		var strErrorMessage = "Form submission error(s):\n\n";
		var blnErrors = false;
		
		if (document.form1.title.selectedIndex == 0) {
				strErrorMessage = strErrorMessage + " - Please select a title.\n";
				blnErrors = true;
		}

		if (document.form1.firstname.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter your first name.\n";
				blnErrors = true;
		} 

		if (document.form1.lastname.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter your last name.\n";
				blnErrors = true;
		} 

		if (document.form1.organisation.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter your organisation.\n";
				blnErrors = true;
		} 

		if (!validateSelectControl(document.form1.sectorID)) {
				strErrorMessage = strErrorMessage + " - Please select at least one sector.\n";
				blnErrors = true;
		}

		if (document.form1.address1.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter a value in address 1.\n";
				blnErrors = true;
		} 

		if (document.form1.town.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter your town.\n";
				blnErrors = true;
		} 

		if (document.form1.postcode.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter your postcode.\n";
				blnErrors = true;
		} 

		if (document.form1.email.value != "") {
			if (!IsValidEmail(document.form1.email.value)) {
				strErrorMessage = strErrorMessage + " - Email address is not valid.\n";
				blnErrors = true;
			}
		}

		if (document.form1.telephone.value == "") {
				strErrorMessage = strErrorMessage + " - Please enter your telephone number.\n";
				blnErrors = true;
		} 

		if (document.form1.message.value.length > 1000) {
				strErrorMessage = strErrorMessage + " - Please limit your message to 1000 characters. Current count: " + document.form1.message.value.length + "\n";
				blnErrors = true;
		} 
		
		if (document.form1.newsletter.checked) { document.form1.newsletter.value = "1"; } else { document.form1.newsletter.value = "0"; }

		if (blnErrors) {
			document.form1.submitForm.value = "0";
			alert(strErrorMessage);
		} 
		else {
			document.form1.submitForm.value = "1";
			document.form1.submit();
		}
	}


	//------------------------------------------------------------
	// Function Name: doVacanciesAdvancedSearch()
	// Parameters   : None
	// Author       : Matthew Wall
	// Date         : 22 Oct 2005
	// Purpose      : 
	//------------------------------------------------------------
	function doVacanciesAdvancedSearch() {
		/* Checkboxes */
		if (document.form1.typeOfWorkTemp.checked) { document.form1.typeOfWorkTemp.value = "1"; } else { document.form1.typeOfWorkTemp.value = "0"; }
		if (document.form1.typeOfWorkPerm.checked) { document.form1.typeOfWorkPerm.value = "1"; } else { document.form1.typeOfWorkPerm.value = "0"; }
		if (document.form1.typeOfWorkFT.checked) { document.form1.typeOfWorkFT.value = "1"; } else { document.form1.typeOfWorkFT.value = "0"; }
		if (document.form1.typeOfWorkPT.checked) { document.form1.typeOfWorkPT.value = "1"; } else { document.form1.typeOfWorkPT.value = "0"; }

		/* submit the form */
		document.form1.submit();
	}

//-->