// JavaScript Document

//#################FORM VALIDATOR###################
//##################################################
function validateContactForm(){
	var email = document.my_contact_form.email.value;
	var AtPos = email.indexOf("@");
	var StopPos = email.lastIndexOf(".");

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