function IsEmpty(aTextField) {
	if ((aTextField.value.length == 0) || (aTextField.value == null)) {
		return true;
	}
	else {return false;}
}

function validEmailAddress(theAddress) {
	return (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(theAddress));
}

function checkForm() {
	if (IsEmpty(document.entryForm.email) || (document.entryForm.email.value == "Type your e-mail address here")) {
		alert('Please enter your e-mail address.');
		document.entryForm.email.focus();
		return false;
	}

	if (!validEmailAddress(document.entryForm.email.value)) {
		alert('The e-mail address you entered appears invalid. Please check and re-enter it.');
		document.entryForm.email.focus();
		return false;
	}
	
	if (IsEmpty(document.entryForm.msgBody) || (document.entryForm.msgBody.value == "Type your message here")) {
		alert('Please enter a message.');
		document.entryForm.msgBody.focus();
		return false;
	}

	return true;
}
