//// Email Validation Routines  //////////////

function checkForm()
{
var emailFilter=/^.+@.+\..{2,3}$/;
var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/

	if (document.gbAdd.realname.value=='')
	{
		//name is blank
		alert('Please enter your name');
		return false;
	}
	else if ((document.gbAdd.username.value.length > 0 ) && (!(emailFilter.test(document.gbAdd.username.value))))
	{
		//email is entered but invalid
		alert('You\'ve entered an email address but it does not appear to be valid');
		return false;
	}
	else if (document.gbAdd.username.value.match(illegalChars))
	{
		//email contains illegal characters
		alert('The email address contains illegal characters');
		return false;
	}
	else if ((document.gbAdd.state.value.length > 0 ) && (document.gbAdd.state.value=='USA'))
	{
		//USA entered as state/province (spammers have done this a lot lately -rh)
		alert('You\'ve entered a state or province but it is invalid');
		return false;
	}
	else if (document.gbAdd.comments.value=='')
	{
		//comments are blank
		alert('Don\'t forget your comment.');
		return false;
	}
	else if (((document.gbAdd.security.value != 'Kristen') && (document.gbAdd.security.value != 'kristen')) || (document.gbAdd.security.value-=''))
	{
		//security answer is blank or incorrect
		alert('Security Question: What is Kristen\'s first name?');
		return false;
	}
	// If the script gets this far through all of your fields
	// without problems, it's ok and we can submit the form

	return true;
}

