// JavaScript Document
function validate() {
	x=document.Inspection;
	email=x.Email.value;
	AtPos = email.indexOf("@");
	StopPos = email.lastIndexOf(".");
	name=x.Name.value;
	address=x.Address.value;
	city=x.City.value;
	state=x.State.value;
	zip=x.Zip.value;
	submitOK="True";

	//clear all fields
	formChangeBack(x);
	document.getElementById("nameError").innerHTML="";
	document.getElementById("emailError").innerHTML="";
	document.getElementById("addressError").innerHTML="";
	document.getElementById("cityError").innerHTML="";
	document.getElementById("stateError").innerHTML="";
	document.getElementById("zipError").innerHTML="";
	
	if (name.length<1) {
		document.getElementById("nameError").innerHTML="Error: No Information";
		document.getElementById("Name").className="inputReq";
		submitOK="False";
	}
	if (email.length<1) {
		document.getElementById("emailError").innerHTML="Error: No Information";
		document.getElementById("Email").className="inputReq";
		submitOK="False";
	} else if (AtPos == -1 || StopPos == -1 || StopPos - AtPos == 1) {
		document.getElementById("emailError").innerHTML="Error: Invalid Email Address";
		document.getElementById("Email").className="inputReq";
		submitOK = "False";
	}
	if (address.length<1) {
		document.getElementById("addressError").innerHTML="Error: No Information";
		document.getElementById("Address").className="inputReq";
		submitOK="False";
	}
	if (city.length<1) {
		document.getElementById("cityError").innerHTML="Error: No Information";
		document.getElementById("City").className="inputReq";
		submitOK="False";
	}
	if (state.length<1) {
		document.getElementById("stateError").innerHTML="Error: No Information";
		document.getElementById("State").className="inputReq";
		submitOK="False";
	}
	if (zip.length<1) {
		document.getElementById("zipError").innerHTML="Error: No Information";
		document.getElementById("Zip").className="inputReq";
		submitOK="False";
	}
	if (submitOK=="False") {
		return false;
	}
}