// JavaScript Document

//#################FORM VALIDATOR###################
//##################################################
function validateForm(){
	var email = document.my_form.email.value;
	var AtPos = email.indexOf("@");
	var StopPos = email.lastIndexOf(".");
	
	if (document.my_form.first_name.value <2) {
		alert("You have not filled in the FIRST NAME field.");
		document.my_form.first_name.focus();
		return false;
	}

	if (document.my_form.last_name.value <2) {
		alert("You have not filled in the LAST NAME field.");
		document.my_form.last_name.focus();
		return false;
	}
	
	if (email == "") {
	alert("You have not enterd a valid EMAIL ADDRESS.");
	document.my_form.email.focus();
	return false;
	}
	
	if (AtPos == -1 || StopPos == -1) {
	alert("You have not enterd a valid EMAIL ADDRESS.");
	document.my_form.email.focus();
	return false;
	}
	
	if (StopPos < AtPos) {
	alert("You have not enterd a valid EMAIL ADDRESS.");
	document.my_form.email.focus();
	return false;
	}
	
	if (StopPos - AtPos == 1) {
	alert("You have not enterd a valid EMAIL ADDRESS.");
	document.my_form.email.focus();
	return false;
	}

	if (document.my_form.comments.value == "") {
		alert("You have not filled in the COMMENT field.");
		document.my_form.comments.focus();
		return false;
	}
	return true;
}
