function validategb(theForm){

	

 

  if (theForm.name.value == "")

  {

    alert("Please enter Your Name.");

    theForm.name.focus();

    return (false);

  }

  if (theForm.notes.value == "")

  {

    alert("Please enter your comments.");

    theForm.notes.focus();

    return (false);

  }  

  

  if (theForm.email.value == "")

  {

    alert("Please enter Your Email.");

    theForm.email.focus();

    return (false);

  }	

  var checkOK = "0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM@. ";

  var checkStr = eval("theForm.email.value")

  var allValid = true;

  var decPoints = 0;

  var allNum = "";

  for (t = 0;  t < checkStr.length;  t++){

			ch = checkStr.charAt(t);

			for (j = 0;  j < checkOK.length;  j++)

				if (ch == checkOK.charAt(j))

			break;

			if (j == checkOK.length)

			{

			allValid = false;

			break;

			}

  } 

  if (!allValid)

  {

  alert("INVALID EMAIL FORMAT.");

  theForm.email.focus();

  return (false);

  }

  var email = eval("theForm.email.value")

   //EMAIL VALIDATION

  

  

		var at="@"

		var dot="."

		var lat=email.indexOf(at)

		var lstr=email.length

		var ldot=email.indexOf(dot)

		if (email.indexOf(at)==-1){

		   alert("Invalid E-mail")

		   return false

		}



		if (email.indexOf(at)==-1 || email.indexOf(at)==0 || email.indexOf(at)==lstr){

		   alert("Invalid E-mail")

		   return false

		}



		if (email.indexOf(dot)==-1 || email.indexOf(dot)==0 || email.indexOf(dot)==lstr){

		    alert("Invalid E-mail")

		    return false

		}



		 if (email.indexOf(at,(lat+1))!=-1){

		    alert("Invalid E-mail")

		    return false

		 }



		 if (email.substring(lat-1,lat)==dot || email.substring(lat+1,lat+2)==dot){

		    alert("Invalid E-mail")

		    return false

		 }



		 if (email.indexOf(dot,(lat+2))==-1){

		    alert("Invalid E-mail")

		    return false

		 }

		

		 if (email.indexOf(" ")!=-1){

		    alert("Invalid E-mail")

		    return false

		 }

		 

		 

		 

  if (theForm.JoinMailer[0].checked == false && theForm.JoinMailer[1].checked == false)

  {

    alert("Would you like to join our mailing list?");

    theForm.JoinMailer[0].style.backgroundColor = '00CC00';

    theForm.JoinMailer[1].style.backgroundColor = '00CC00';

    theForm.JoinMailer[0].focus();

    return (false);

  }	



 

  return (true);

  

}



































