// JavaScript Document

function Leadership_Form_Validator(theForm)
{

  if (theForm.lastname.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.lastname.focus();
    return (false);
  }

  if (theForm.lastname.value.length > 30)
  {
    alert("Please enter at most 30 characters in the \"Last Name\" field.");
    theForm.name.focus();
    return (false);
  }

	//var checkLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ";
   var checkLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	var checkNumbers = "0123456789";
	var checkWhitespace = "\t\r\n\f ";
  var checkOK = checkLetters + checkWhitespace + "-";
  var checkStr = theForm.lastname.value;
  var allValid = 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 letters, whitespace and \"-\" characters in the \"Last Name\" field.");
    theForm.lastname.focus();
    return (false);
  }

  if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"E-mail\" field.");
    theForm.email.focus();
    return (false);
  }

  if (theForm.email.value.length > 60)
  {
    alert("Please enter at most 60 characters in the \"E-mail\" field.");
    theForm.email.focus();
    return (false);
  }

  checkOK = checkLetters + checkNumbers + "@-_."
  checkStr = theForm.email.value;
  allValid = 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 letters, numbers, and \"@\", \"-\", \"_\", \".\" characters in the \"E-mail\" field.");
    theForm.email.focus();
    return (false);
  }
  
  if (theForm.phone.value == "")
  {
	  alert("Please enter a value for the \"Phone\" field on the first line.");
	  theForm.phone.focus();
	  return (false);
  }
  
  if (theForm.phone.value.length > 30)
  {
    alert("Please enter at most 30 characters in the \"Phone\" field.");
    theForm.phone.focus();
    return (false);
  }
  
  checkOK = checkNumbers + checkWhitespace + "-()EXT.ext.";
  checkStr = theForm.phone.value;
  allValid = 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 numbers, whitespace, parentheses, \"Ext.\" and \"-\" characters in the \"Phone\" field.");
    theForm.phone.focus();
    return (false);
  }
 
   return (true);

}

function Events_Form_Validator(theForm)
{

  if ((theForm.tFirstName.value == "First Name") || (theForm.tFirstName.value == ""))
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.tFirstName.focus();
    return (false);
  }

  if (theForm.tFirstName.value.length > 30)
  {
    alert("Please enter at most 30 characters in the \"First Name\" field.");
    theForm.tFirstName.focus();
    return (false);
  }

	//var checkLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ";
	var checkLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
   var checkNumbers = "0123456789";
	var checkWhitespace = "\t\r\n\f ";
  var checkOK = checkLetters + checkWhitespace + "-";
  var checkStr = theForm.tLastName.value;
  var allValid = 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 letters, whitespace and \"-\" characters in the \"First Name\" field.");
    theForm.tFirstName.focus();
    return (false);
  }

  if ((theForm.tLastName.value == "Last Name") || (theForm.tLastName.value == ""))
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.tLastName.focus();
    return (false);
  }

  if (theForm.tLastName.value.length > 30)
  {
    alert("Please enter at most 30 characters in the \"Last Name\" field.");
    theForm.firstname.focus();
    return (false);
  }

	//var checkLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ";
	var checkLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
   var checkNumbers = "0123456789";
	var checkWhitespace = "\t\r\n\f ";
  var checkOK = checkLetters + checkWhitespace + "-";
  var checkStr = theForm.tLastName.value;
  var allValid = 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 letters, whitespace and \"-\" characters in the \"Last Name\" field.");
    theForm.tLastName.focus();
    return (false);
  }

  if ((theForm.tEmail.value == "") || (theForm.tEmail.value=="E-mail Address"))
  {
    alert("Please enter a value for the \"E-mail\" field.");
    theForm.tEmail.focus();
    return (false);
  }

  if (theForm.tEmail.value.length > 60)
  {
    alert("Please enter at most 60 characters in the \"E-mail\" field.");
    theForm.tEmail.focus();
    return (false);
  }

  checkOK = checkLetters + checkNumbers + "@-_."
  checkStr = theForm.tEmail.value;
  allValid = 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 letters, numbers, and \"@\", \"-\", \"_\", \".\" characters in the \"E-mail\" field.");
    theForm.tEmail.focus();
    return (false);
  }
  
  return (true);

}