/* $Revision: 1.2 $ $Date: 2005/05/06 11:13:24 $ */
function validEmail(email) {
	invalidChars = " /:,;";
	if(email == "") {
		return true;
	}

	for(i=0; i<invalidChars.length; i++)
	{
		badChar = invalidChars.charAt(i);
		if(email.indexOf(badChar,0) != -1) {
			return false;
		}
	}
	atPos = email.indexOf("@",1);
	if(atPos == -1) {
		return false;
	}
	if(email.indexOf("@",atPos+1) != -1) {
		return false;
	}
	periodPos = email.indexOf(".",atPos);
	if(periodPos == -1) {
		return false;
	}
	if(periodPos+3 > email.length) {
		return false;
	}
	return true;
}

function isEmptyFields()
{
	if (document.objectlabjob.realname.value.length == 0){
		alert("You must enter your name before you can continue.");
		return false;
	}
	else if(document.objectlabjob.email.value.length == 0){
		alert("You must enter your email before you can continue.");
		return false;
	}
	return true;
}

function validateJobForm(form) {
	if (!isEmptyFields()){
		return false;
	}
	if (!validEmail(form.email.value)){
		alert("You must enter a valid email address before you can continue.");
		return false;
	}
	return true;
}
