//Form Validation
function validate() {
	if (checkFirstName(document.theform.fname.value) && checkLastName(document.theform.lname.value) && checkEmail(document.theform.email.value) && checkFeedback(document.theform.feedbackText.value) && ValidMath()) {
		theform.submit();
		return true;
	}
}

function checkFirstName(fname) {
	if (fname == "") {
		alert("You Must Enter Your First Name Here...");
		document.theform.fname.focus();
		return false;
	}
	return true;
}

function checkLastName(lname) {
	if (lname == "") {
		alert("You Must Enter Your Last Name Here...");
		document.theform.lname.focus();
		return false;
	} 
	return true;
}

function checkFeedback(thefeedback) {
	if (thefeedback == "") {
		alert("You Must Enter Your Comments/Feedback here...");
		document.theform.feedbackText.focus();
		return false;
	}
	return true;
}

function checkEmail(email) {
	if (email != "" && (email.indexOf("@") != -1 && email.indexOf(".") != -1) ) {
		return true;
	} else {	
		alert("You Must Enter Your Email Address in the Correct format.\nMouseover the Email title for details...");
		document.theform.email.focus();
		return false;
	} 
}
