$(function() {
				$("#newsletterForm").submit(testNews);
				$("#emailForm").submit(testEmail);
		});

function testEmail() {
		reEmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
		if(this.name.value == "") {
				alert("Please tell us your name");
				this.name.focus();
				return false;
		}
		if(!reEmail.test(this.emailAddr.value)) {
				alert( "Please enter a valid email address" );
				this.emailAddr.focus();
				this.emailAddr.select();
				return false;
		}
		if (this.message.value == "") {
				alert("Please type a message");
				this.message.focus();
				return false;
		}
		return true;
}

function testNews() {
		reEmail=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
		if(!reEmail.test(this.emailAddr.value)) {
				alert("Please enter a valid email address");
				this.emailAddr.focus();
				return false;
		}
		if(this.emailAddr.value!=this.confEmailAddr.value) {
				alert("Please make sure your email address and the confirmation email address match");
				this.confEmailAddr.focus();
				return false;
		}
		return true;
}
