
	
//Check the inquiry form is filled in correctly
function CheckForm () { 

	//Initialise variables
	var errorMsg = "";

	
	//Check for availability
	if (document.careers.availability.value == ""){
		errorMsg += "\n\tPosition \t- Enter your position of interest";	
	}
	
	//Check for a first name
	if (document.careers.firstName.value == ""){
		errorMsg += "\n\tFirst Name \t- Enter your First Name";	
	}
	
	//Check for a first name
	if (document.careers.lastName.value == ""){
		errorMsg += "\n\tLast Name \t- Enter your Last Name";	
	}
	
	//Check for a phone number
	if (document.careers.tel.value == ""){
		errorMsg += "\n\tPhone Number \t- Enter your area code";
	}
		if (document.careers.tel2.value == ""){
		errorMsg += "\n\tPhone Number \t- Enter your exchange";
	}
		if (document.careers.tel3.value == ""){
		errorMsg += "\n\tPhone Number \t- Enter your phone number";
	}

//Check for an e-mail address and that it is valid
if ((document.careers.email.value == "") || (document.careers.email.value.length > 0 && (document.careers.email.value.indexOf("@",0) == - 1 || document.careers.email.value.indexOf(".",0) == - 1))) { 
	errorMsg += "\n\tE-mail Address \t- Enter your valid e-mail address";
}


 //Check for city
	if (document.careers.city.value == ""){
		errorMsg += "\n\tCity \t\t- Enter your city";
	}
	
 //Check for state
	if (document.careers.state.value == ""){
		errorMsg += "\n\tState \t\t- Enter your state";
	}			

 //Check for zip code
	if (document.careers.zip.value == ""){
		errorMsg += "\n\tZip \t\t- Enter your zip";
	}
	
	 //Check for zip Reference Link
	if (document.careers.ref1name.value == ""){
		errorMsg += "\n\tReference #1 \t- Enter Reference #1";
	}
	
		 //Check for Reference Link
	if (document.careers.ref2name.value == ""){
		errorMsg += "\n\tReference #2 \t- Enter Reference #2";
	}
	
		 //Check for Reference Link
	if (document.careers.ref3name.value == ""){
		errorMsg += "\n\tReference #3 \t- Enter Reference #3";
	}
	
	
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Your application has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the application.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}
