//*****************************
//*** CONTACT US
//*****************************
function Validate(form)
{
 var msg = "You must enter your email address!";
 var Email = document.forms[0].email.value;
 var field = document.forms[0].email.value;
 var atPos;

  var parsed = true;
  var validchars = "abcdefghijklmnopqrstuvwxyz0123456789@.-";

 field = document.forms[0].FirstName.value;
 if (field == "" || field == null)
 {
   document.forms[0].FirstName.focus();
   alert("You must enter your First Name");
   return false;
 }

 field = document.forms[0].LastName.value;
 if (field == "" || field == null)
 {
   document.forms[0].LastName.focus();
   alert("You must enter your Last Name");
   return false;
 }

  field = document.forms[0].Phone.value;
  if ((Email == "" || Email == null))
  {
    if (field == "" || field == null)
    {
    document.forms[0].email.focus();
    alert("Please enter one of Email or Phone, or both");
    return false;
    }
  }


 if(Email == "" || Email == null)
 {
  document.forms[0].email.value = '-- No email was entered --';
 }
 else
 {
  for (var i=0; i < Email.length; i++) {
    var letter = Email.charAt(i).toLowerCase();
    if (validchars.indexOf(letter) != -1)
      continue;
      parsed = false;
    break;
  }

  if (!parsed)
   {
   document.forms[0].email.focus();
   alert("Your email address contains invalid characters - must contain only lowercase letters, periods, hyphens and one @ sign.");
   return false;
   }

   atPos = Email.indexOf("@")
   if (atPos == -1)
   {
     document.forms[0].email.focus();
     alert("An email address must have an @ sign in it.");
     return false;
   }
   else
    if (Email.indexOf(".",atPos) == -1)
     {
     document.forms[0].email.focus();
     alert("An email address must have at least one dot (.) after the @ sign.");
     return false;
     }

   atPos = Email.indexOf("@",atPos+1)
   if (atPos >= 0)
   {
     document.forms[0].email.focus();
     alert("An email address must have one (and only one) @ sign in it.");
     return false;
   }


 }


 field = document.forms[0].Comments.value;
 if (field == "" || field == null)
 {
   document.forms[0].Comments.focus();
   alert("Please enter a comment - we'd love to hear from you!");
   return false;
 }

}
//*****************************
//*** SUPPER CLUBS
//*****************************
function ValidateSC(form)
{
 var msg = "You must enter your email address!";
 var Email = document.forms[0].Email.value;
 var field = document.forms[0].Email.value;
 var atPos;

  var parsed = true;
  var validchars = "abcdefghijklmnopqrstuvwxyz0123456789@.-";

 field = document.forms[0].FirstName.value;
 if (field == "" || field == null)
 {
   document.forms[0].FirstName.focus();
   alert("You must enter your First Name");
   return false;
 }

 field = document.forms[0].LastName.value;
 if (field == "" || field == null)
 {
   document.forms[0].LastName.focus();
   alert("You must enter your Last Name");
   return false;
 }

 if (Email == "" || Email == null)
 {
   document.forms[0].Email.focus();
   alert(msg);
   return false;
 }

  for (var i=0; i < Email.length; i++) {
    var letter = Email.charAt(i).toLowerCase();
    if (validchars.indexOf(letter) != -1)
      continue;
      parsed = false;
    break;
  }

  if (!parsed)
   {
   document.forms[0].Email.focus();
   alert("Your email address contains invalid characters - must contain only lowercase letters, periods, hyphens and one @ sign.");
   return false;
   }

 atPos = Email.indexOf("@")
 if (atPos == -1)
 {
   document.forms[0].Email.focus();
   alert("An email address must have an @ sign in it.");
   return false;
 }
 else
  if (Email.indexOf(".",atPos) == -1)
   {
   document.forms[0].Email.focus();
   alert("An email address must have at least one dot (.) after the @ sign.");
   return false;
   }

 atPos = Email.indexOf("@",atPos+1)
 if (atPos >= 0)
 {
   document.forms[0].Email.focus();
   alert("An email address must have one (and only one) @ sign in it.");
   return false;
 }

 field = document.forms[0].Phone.value;
 if (field == "" || field == null)
 {
   document.forms[0].Phone.focus();
   alert("You must enter your phone number");
   return false;
 }

 field = document.forms[0].Type.value;
 if (field == "" || field == null)
 {
   document.forms[0].Type.focus();
   alert("You must choose PARTICIPANT or HOST");
   return false;
 }
}


//*****************************
//*** MEN'S BREAKFAST
//*****************************
function ValidateMB(form)
{
 var msg = "You must enter your email address!";
 var Email = document.forms[0].Email.value;
 var field = document.forms[0].Email.value;
 var atPos;

  var parsed = true;
  var validchars = "abcdefghijklmnopqrstuvwxyz0123456789@.-";

 field = document.forms[0].FirstName.value;
 if (field == "" || field == null)
 {
   document.forms[0].FirstName.focus();
   alert("You must enter your First Name");
   return false;
 }

 field = document.forms[0].LastName.value;
 if (field == "" || field == null)
 {
   document.forms[0].LastName.focus();
   alert("You must enter your Last Name");
   return false;
 }

 field = document.forms[0].Phone.value;
 if ((Email == "" || Email == null))
 {
   if (field == "" || field == null)
   {
    document.forms[0].Email.focus();
    alert("Please enter one of Email or Phone, or both");
    return false;
   }
 }

 if(Email == "" || Email == null)
 {
 }
 else
 {
  for (var i=0; i < Email.length; i++) {
    var letter = Email.charAt(i).toLowerCase();
    if (validchars.indexOf(letter) != -1)
      continue;
      parsed = false;
    break;
  }

  if (!parsed)
   {
   document.forms[0].Email.focus();
   alert("Your email address contains invalid characters - must contain only lowercase letters, periods, hyphens and one @ sign.");
   return false;
   }

 atPos = Email.indexOf("@")
 if (atPos == -1)
 {
   document.forms[0].Email.focus();
   alert("An email address must have an @ sign in it.");
   return false;
 }
 else
  if (Email.indexOf(".",atPos) == -1)
   {
   document.forms[0].Email.focus();
   alert("An email address must have at least one dot (.) after the @ sign.");
   return false;
   }

 atPos = Email.indexOf("@",atPos+1)
 if (atPos >= 0)
 {
   document.forms[0].Email.focus();
   alert("An email address must have one (and only one) @ sign in it.");
   return false;
 }
 }

}