function validate(theForm)
{

  if (theForm.Name.value == "")
  {
    alert("Please enter your name.");
    theForm.Name.focus();
    return (false);
  }

  
  if (theForm.Email.value == "")
  {
    alert("Please enter the Email address");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length < 6)
  {
    alert("The Email address you entered is invalid");
    theForm.Email.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-@_-.";
  var checkStr = theForm.Email.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit and \"@_-.\" characters in the Email field.");
    theForm.Email.focus();
    return (false);
  }
  
 if (theForm.ConfirmEmail.value == "")
  {
    alert("Please  confirm your Email address");
    theForm.ConfirmEmail.focus();
    return (false);
  }

  if (theForm.ConfirmEmail.value.length < 6)
  {
    alert("The Email confirmation you entered is invalid");
    theForm.ConfirmEmail.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-@_-.";
  var checkStr = theForm.ConfirmEmail.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit and \"@_-.\" characters in the Email field.");
    theForm.ConfirmEmail.focus();
    return (false);
  }
  if (theForm.Email.value != theForm.ConfirmEmail.value)
  {
   alert("Your Email addresses do not match");
   theForm.Email.focus();
   return (false);
   }
    if (theForm.URL.value == "")
  {
    alert("Please enter your websites URL.");
    theForm.URL.focus();
    return (false);
  }
  if (theForm.Phrase.value == "")
  {
    alert("Please enter a search phrase.");
    theForm.Phrase.focus();
    return (false);
  }

var temp=theForm.Phrase.value.split(" ")
	if (temp.length<2){
	alert("Please enter at least 2 words into the \"Search Phrase\" field");
	theForm.Phrase.focus();
	return false
	}
    if (theForm.SpamCheck.value == "")
  {
    alert("Please enter the red number.");
    theForm.SpamCheck.focus();
    return (false);
  }
   
   
  return (true);
}
