// Check required feilds
function chkForm(theForm) {
	if(theForm.first_name.value == ""){
		alert("Please enter your First Name");
		theForm.first_name.focus();
		return false;
	}

	
	if(theForm.last_name.value == ""){
		alert("Please enter your Last Name");
		theForm.last_name.focus();
		return false;
	}
	
	
	if(theForm.position.value == ""){
		alert("Please select a desired position, otherwise choose 'other'");
		theForm.position.focus();
		return false;
	}
	

	if(theForm.phone.value == ""){
		alert("Please enter your phone number");
		theForm.phone.focus();
		return false;
	}
	
		if(theForm.address.value == ""){
		alert("Please enter your full address");
		theForm.address.focus();
		return false;
	}
	
			if(theForm.city.value == ""){
		alert("Please enter the city");
		theForm.city.focus();
		return false;
	}
	
			if(theForm.zip_code.value == ""){
		alert("Please enter the zip code");
		theForm.zip_code.focus();
		return false;
	}
	
			if(theForm.state.value == ""){
		alert("Please select the state");
		theForm.state.focus();
		return false;
	}
	
			if(theForm.country.value == ""){
		alert("Please select the country");
		theForm.country.focus();
		return false;
	}
	
			if(theForm.references.value == ""){
		alert("Please enter your references");
		theForm.references.focus();
		return false;
	}
	
	return chkEmail(theForm);
}

//Validate email address
function chkEmail(theForm) {
	var result;
	var str = theForm.email.value;
	var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;

	if(filter.test(str))
		result = true;
	else{
		alert("Please enter a valid email address.");
		theForm.email.focus();
		result = false;
	}
 	return (result);
}