function Checkfields()
{
		if(document.frmGB.name.value == ""){
		alert("Please Enter your name.");
		return false;}
		
		if(document.frmGB.message.value == ""){
		alert("Guestbook cannot be signed without Comments.");
		return false;}
		
		if(checkEmail(document.frmGB.email.value) == false){
			alert("Please enter a valid email address.")
			return false;
		}
	return true;		
}

function checkEmail(the_email)
{
	var the_at = the_email.indexOf("@");
	var the_dot = the_email.lastIndexOf(".");
	var a_space = the_email.indexOf(" ");
	if ((the_at != -1) &&
	(the_at != 0) &&
	(the_dot != -1) &&
	(the_dot > the_at + 1) &&
	(the_dot < the_email.length - 1) &&
	(a_space == -1))
	{
		// email is OK
		return true;
	}
	else
	{
		// bad address
		return false;
	}
}

