
<!-- // Hide code from non-Javascript enabled browsers
function formValid() {
	var retVal=true;
	// checks form with textboxes for 'author', 'message'  and  'email' address
	//it checks to make sure the user entered something into each textbox
	if(document.forms[0].author.value==""||document.forms[0].email.value==""||document.forms[0].message.value=="") {
		window.alert("Please enter your name,  email address, and a message.");
		retVal=false;
	}
		if(retVal==false) {
		return retVal;
		}

	var email=document.forms[0].email.value;
	//this will ensure that the email address is in a valid format
	//the ^ metacharacter matches characters at the beginning of a string. The $ metacharacter matches characters at the end of a string.
	//[_\w\-]+ indicates that this part of the address must include one or more alphanumeric characters or an underscore or a hyphen
	//(\.[_\w\-]+)* is the next part. the * in this portion of the code means that the preceding is optional. Zero or more characters must match 
	//@ is included next because there must be an @ in the email address at this point
	//(\.[\D]{2,3}) indicates that there must be a . followed by alphabetic characters (no less than 2 but no more than 3)
	var emailCheck = /^[_\w\-]+(\.[_\w\-]+)*@[\w\-]+(\.[\w\-]+)*(\.[\D]{2,3})$/;
	if(emailCheck.test(email)==false) {
	window.alert("Please enter a valid e-mail address.");
		retVal=false;
	}
		if(retVal==false) {
		return retVal;
		}
}
//-->

