
// This performs primary validation email form when the submit button is pressed
function validate(that) {
	validation = "false"
	error = ""

	re = /^\w(?:\w|-|\.(?!\.|@))*@\w(?:\w|-|\.(?!\.))*\.\w{2,3}/;
	missingfield = ""
	if (!that.name.value) { missingfield = "Name\n" }
	if (!re.test(that.email.value)) { missingfield += "Email address\n" }
	if (!that.subject.value) { missingfield += "Subject\n" }
	if (!that.message.value) { missingfield += "Message\n" }
	if (missingfield) { error = "The following required information is missing or invalid:\n\n" + missingfield +"\n" }

	if (error) {
		alert(error)
		return false 
	}

	// Submit the form
	else {
		return true
	}
}

