


//*****   function ValidateAdminLogin(theForm)
//*****   function ValidateMemberLogin(theForm)
//*****   function ValidateForgotPWD(theForm)
//*****   function ValidateEmailNewsletter(theForm)
//*****   function ValidateUpdateMember(theForm)
//*****   function ValidateMemberEntry(theForm)
//*****   function ValidateEvent(theForm)
//*****   Mail form functions
//*****   function ValidateEmailMembers(theForm)
//*****   Show Hide Div
//*****   newpopup(page)



//*********************************************************************************************
//*********************************************************************************************
function ValidateAdminLogin(theForm)
{

  if (theForm.Admin.value == "")
  {
    alert("Please enter a value for the \"Admin Name\" field.");
    theForm.Admin.focus();
    return (false);
  }

  if (theForm.Admin.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Admin Name\" field.");
    theForm.Admin.focus();
    return (false);
  }

  if (theForm.Admin.value.length > 50)
  {
    alert("Please enter at most 25 characters in the \"Admin Name\" field.");
    theForm.Admin.focus();
    return (false);
  }
  
  if (theForm.AdminPWD.value == "")
  {
    alert("Please enter a value for the \"Admin PWD\" field.");
    theForm.AdminPWD.focus();
    return (false);
  }

  if (theForm.AdminPWD.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Admin PWD\" field.");
    theForm.AdminPWD.focus();
    return (false);
  }

  if (theForm.AdminPWD.value.length > 50)
  {
    alert("Please enter at most 25 characters in the \"Admin PWD\" field.");
    theForm.AdminPWD.focus();
    return (false);
  }
  return (true);
}
//*********************************************************************************************

//*********************************************************************************************
//*********************************************************************************************
function ValidateMemberLogin(theForm)
{

  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length < 6)
  {
    alert("Please enter at least 6 characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length > 50)
  {
    alert("Please enter at most 25 characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }
  
  if (theForm.PWD.value == "")
  {
    alert("Please enter a value for the \"PWD\" field.");
    theForm.PWD.focus();
    return (false);
  }

  if (theForm.PWD.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"PWD\" field.");
    theForm.PWD.focus();
    return (false);
  }

  if (theForm.PWD.value.length > 50)
  {
    alert("Please enter at most 25 characters in the \"PWD\" field.");
    theForm.PWD.focus();
    return (false);
  }
  return (true);
}
//*********************************************************************************************

//*********************************************************************************************
//*********************************************************************************************
function ValidateForgotPWD(theForm)
{

  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Old Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Old Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Old Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.SQ.selectedIndex < 0)
  {
    alert("Please select one of the \"Secret Question\" options.");
    theForm.SQ.focus();
    return (false);
  }

  if (theForm.SQ.selectedIndex == 0)
  {
    alert("The first \"Secret Question\" option is not a valid selection.  Please choose one of the other options.");
    theForm.SQ.focus();
    return (false);
  }

  if (theForm.SQAnswer.value == "")
  {
    alert("Please enter a value for the \"Answer to Secret Question\" field.");
    theForm.SQAnswer.focus();
    return (false);
  }

  if (theForm.SQAnswer.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Answer to Secret Question\" field.");
    theForm.SQAnswer.focus();
    return (false);
  }

  if (theForm.SQAnswer.value.length > 35)
  {
    alert("Please enter at most 35 characters in the \"Answer to Secret Question\" field.");
    theForm.SQAnswer.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = theForm.SQAnswer.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 letter, digit and whitespace characters in the \"Answer to Secret Question\" field.");
    theForm.SQAnswer.focus();
    return (false);
  }
  return (true);
}
//*********************************************************************************************

//*********************************************************************************************
//*********************************************************************************************
function ValidateEmailNewsletter(theForm)
{

  if (theForm.Name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Address.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.Address.focus();
    return (false);
  }

  if (theForm.CityStateZip.value == "")
  {
    alert("Please enter a value for the \"City State and Zip\" field.");
    theForm.CityStateZip.focus();
    return (false);
  }

  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }
  return (true);
}
//*********************************************************************************************

//*********************************************************************************************
//*********************************************************************************************
function ValidateUpdateMember(theForm)
{

  if (theForm.First.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.First.focus();
    return (false);
  }

  if (theForm.First.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"First Name\" field.");
    theForm.First.focus();
    return (false);
  }

  if (theForm.First.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"First Name\" field.");
    theForm.First.focus();
    return (false);
  }

  if (theForm.MI.value.length > 1)
  {
    alert("Please enter at most 1 characters in the \"Middle Initial\" field.");
    theForm.MI.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ";
  var checkStr = theForm.MI.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 letter characters in the \"Middle Initial\" field.");
    theForm.MI.focus();
    return (false);
  }

  if (theForm.Last.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.Last.focus();
    return (false);
  }

  if (theForm.Last.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Last Name\" field.");
    theForm.Last.focus();
    return (false);
  }

  if (theForm.Last.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"Last Name\" field.");
    theForm.Last.focus();
    return (false);
  }

  if (theForm.Street.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.Street.focus();
    return (false);
  }

  if (theForm.Street.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Address\" field.");
    theForm.Street.focus();
    return (false);
  }

  if (theForm.Street.value.length > 35)
  {
    alert("Please enter at most 35 characters in the \"Address\" field.");
    theForm.Street.focus();
    return (false);
  }

  if (theForm.City.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.City.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.City.value.length > 30)
  {
    alert("Please enter at most 30 characters in the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.State.value == "")
  {
    alert("Please enter a value for the \"State\" field.");
    theForm.State.focus();
    return (false);
  }

  if (theForm.State.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"State\" field.");
    theForm.State.focus();
    return (false);
  }

  if (theForm.State.value.length > 2)
  {
    alert("Please enter at most 2 characters in the \"State\" field.");
    theForm.State.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ";
  var checkStr = theForm.State.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 letter characters in the \"State\" field.");
    theForm.State.focus();
    return (false);
  }

  if (theForm.Zip.value == "")
  {
    alert("Please enter a value for the \"Zip Code\" field.");
    theForm.Zip.focus();
    return (false);
  }

  if (theForm.Zip.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Zip Code\" field.");
    theForm.Zip.focus();
    return (false);
  }

  if (theForm.Zip.value.length > 5)
  {
    alert("Please enter at most 5 characters in the \"Zip Code\" field.");
    theForm.Zip.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.Zip.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 digit characters in the \"Zip Code\" field.");
    theForm.Zip.focus();
    return (false);
  }


  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length < 6)
  {
    alert("Please enter at least 6 characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email1.value == "")
  {
    alert("Please enter a value for the \"Email Confirmation\" field.");
    theForm.Email1.focus();
    return (false);
  }

  if (theForm.Email1.value.length < 6)
  {
    alert("Please enter at least 6 characters in the \"Email Confirmation\" field.");
    theForm.Email1.focus();
    return (false);
  }

  if (theForm.Email1.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Email Confirmation\" field.");
    theForm.Email1.focus();
    return (false);
  }
  
  if (theForm.Email.value != theForm.Email.value)
  {
    alert("The Confirmation Email address is not the same as the Email address.");
    theForm.Email1.focus();
    return (false);
  }



  if (theForm.Password.value == "")
  {
    alert("Please enter a value for the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  if (theForm.Password.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  if (theForm.Password.value.length > 30)
  {
    alert("Please enter at most 30 characters in the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-";
  var checkStr = theForm.Password.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 letter and digit characters in the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  if (theForm.SQ.selectedIndex < 0)
  {
    alert("Please select one of the \"Secret Question\" options.");
    theForm.SQ.focus();
    return (false);
  }

  if (theForm.SQAnswer.value == "")
  {
    alert("Please enter a value for the \"Answer to Secret Question\" field.");
    theForm.SQAnswer.focus();
    return (false);
  }

  if (theForm.SQAnswer.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Answer to Secret Question\" field.");
    theForm.SQAnswer.focus();
    return (false);
  }

  if (theForm.SQAnswer.value.length > 35)
  {
    alert("Please enter at most 35 characters in the \"Answer to Secret Question\" field.");
    theForm.SQAnswer.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = theForm.SQAnswer.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 letter, digit and whitespace characters in the \"Answer to Secret Question\" field.");
    theForm.SQAnswer.focus();
    return (false);
  }
  return (true);
}
//*********************************************************************************************



//*********************************************************************************************
//*********************************************************************************************
function ValidateMemberEntry(theForm)
{

  if (theForm.First.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.First.focus();
    return (false);
  }

  if (theForm.First.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"First Name\" field.");
    theForm.First.focus();
    return (false);
  }

  if (theForm.First.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"First Name\" field.");
    theForm.First.focus();
    return (false);
  }

  if (theForm.Last.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.Last.focus();
    return (false);
  }

  if (theForm.Last.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Last Name\" field.");
    theForm.Last.focus();
    return (false);
  }

  if (theForm.Last.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"Last Name\" field.");
    theForm.Last.focus();
    return (false);
  }
  if (theForm.City.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.City.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.City.value.length > 30)
  {
    alert("Please enter at most 30 characters in the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.State.value == "")
  {
    alert("Please enter a value for the \"State\" field.");
    theForm.State.focus();
    return (false);
  }

  if (theForm.State.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"State\" field.");
    theForm.State.focus();
    return (false);
  }

  if (theForm.State.value.length > 2)
  {
    alert("Please enter at most 2 characters in the \"State\" field.");
    theForm.State.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  var checkStr = theForm.State.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 letter characters in the \"State\" field.");
    theForm.State.focus();
    return (false);
  }

  if (theForm.Zip.value == "")
  {
    alert("Please enter a value for the \"Zip Code\" field.");
    theForm.Zip.focus();
    return (false);
  }

  if (theForm.Zip.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Zip Code\" field.");
    theForm.Zip.focus();
    return (false);
  }

  if (theForm.Zip.value.length > 5)
  {
    alert("Please enter at most 5 characters in the \"Zip Code\" field.");
    theForm.Zip.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.Zip.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 digit characters in the \"Zip Code\" field.");
    theForm.Zip.focus();
    return (false);
  }


  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length < 6)
  {
    alert("Please enter at least 6 characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email1.value == "")
  {
    alert("Please enter a value for the \"Email Confirmation\" field.");
    theForm.Email1.focus();
    return (false);
  }

  if (theForm.Email1.value.length < 6)
  {
    alert("Please enter at least 6 characters in the \"Email Confirmation\" field.");
    theForm.Email1.focus();
    return (false);
  }

  if (theForm.Email1.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Email Confirmation\" field.");
    theForm.Email1.focus();
    return (false);
  }
  
  if (theForm.Email.value != theForm.Email.value)
  {
    alert("The Confirmation Email address is not the same as the Email address.");
    theForm.Email1.focus();
    return (false);
  }

  if (theForm.Password.value == "")
  {
    alert("Please enter a value for the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  if (theForm.Password.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  if (theForm.Password.value.length > 30)
  {
    alert("Please enter at most 30 characters in the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-";
  var checkStr = theForm.Password.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 letter and digit characters in the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  if (theForm.SQ.selectedIndex < 0)
  {
    alert("Please select one of the \"Secret Question\" options.");
    theForm.SQ.focus();
    return (false);
  }

  if (theForm.SQ.selectedIndex == 0)
  {
    alert("The first \"Secret Question\" option is not a valid selection.  Please choose one of the other options.");
    theForm.SQ.focus();
    return (false);
  }

  if (theForm.SQAnswer.value == "")
  {
    alert("Please enter a value for the \"Answer to Secret Question\" field.");
    theForm.SQAnswer.focus();
    return (false);
  }

  if (theForm.SQAnswer.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Answer to Secret Question\" field.");
    theForm.SQAnswer.focus();
    return (false);
  }

  if (theForm.SQAnswer.value.length > 35)
  {
    alert("Please enter at most 35 characters in the \"Answer to Secret Question\" field.");
    theForm.SQAnswer.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = theForm.SQAnswer.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 letter, digit and whitespace characters in the \"Answer to Secret Question\" field.");
    theForm.SQAnswer.focus();
    return (false);
  }
  return (true);
}
//*********************************************************************************************


//*********************************************************************************************
//*********************************************************************************************
function ValidateEvent(theForm)
{

    if (theForm.CatName.selectedIndex < 0)
  {
    alert("Please select one of the \"Category\" options.");
    theForm.CatName.focus();
    return (false);
  }

	if (theForm.event_title.value == "")
  {
    alert("Please enter a value for the \"event_title\" field.");
    theForm.event_title.focus();
    return (false);
  }

  if (theForm.event_desc.value == "")
  {
    alert("Please enter a value for the \"Event Description\" field.");
    theForm.Address.focus();
    return (false);
  }

  if (theForm.event_date.value == "")
  {
    alert("Please enter a value for the \"Event Date\" field.");
    theForm.event_date.focus();
    return (false);
  }

  return (true);
}
//*********************************************************************************************

//**************************************************************************
//************** Mail form functions

function FormatText(command, option){
	
  	frames.message.document.execCommand(command, true, option);
  	frames.message.focus();
}

//Function to add image
function AddImage(){	
	imagePath = prompt('Enter the web address of the image', 'http://');				
	
	if ((imagePath != null) && (imagePath != "")){					
		frames.message.document.execCommand('InsertImage', false, imagePath);
  		frames.message.focus();
	}
	frames.message.focus();			
}

//Function to add smiley
function AddSmileyIcon(imagePath){	
									
	frames.message.document.execCommand('InsertImage', false, imagePath);
  	frames.message.focus();			
}

//Function to clear form
function ResetForm(){

	if (window.confirm('Are you sure you want to clear the e-mail you have entered?')){
	 	frames.message.document.body.innerHTML = ''; 
	 	return true;
	 } 
	 return false;		
}
//*********************************************************************************************
//*********************************************************************************************

//*********************************************************************************************
//*********************************************************************************************
function ValidateEmailMembers(theForm)
{

  if (theForm.strSubject.value == "")
  {
    alert("Please enter a value for the \"Subject\" field.");
    theForm.strSubject.focus();
    return (false);
  }

  if (theForm.ATA.checked == false && theForm.EmailMe.checked == false && theForm.EmailN.checked == false && theForm.Trap.checked == false && theForm.member.checked == false && theForm.Active.checked == false )
  {
    alert("Please indicate the group(s) to receive the mail");
    return (false);
  }
  
  if (theForm.EmailMe.checked == true )
  {
    document.frmSendmail.target = "_blank" ;
  }

  
  
 
  return (true);
}


function DeselectEmailGroups(theForm)
{
  if (document.frmSendmail.EmailMe.checked == true )
  {
    document.frmSendmail.ATA.checked = false;
    document.frmSendmail.EmailN.checked = false;
    document.frmSendmail.member.checked = false;
    document.frmSendmail.Trap.checked = false;
    document.frmSendmail.Active.checked = false;
  }
}

//*********************************************************************************************



var state = 'hidden';
function showhide(layer_ref) {
	
		if (state == 'visible') {
		state = 'hidden';
		}
		else {
		state = 'visible';
		}
		if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.visibility = state");
		}
		if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].visibility = state;
		}
		if (document.getElementById && !document.all) {
		maxwell_smart = document.getElementById(layer_ref);
	maxwell_smart.style.visibility = state;
	}
}




						function toggle(obj) {
							var el = document.getElementById(obj);
							var e2 = obj + "close"
							var e3 = obj + "open"
							if ( el.style.display != 'none' ) {
								el.style.display = 'none';
										document.getElementById(e2).style.display = 'none';
								document.getElementById(e3).style.display = 'block';
							}
							else {
								el.style.display = 'block';
								document.getElementById(e2).style.display = 'block';
								document.getElementById(e3).style.display = 'none';
							}
						}



function newpopup(page){
 Popwin = window.open(page,'',
'width=550,height=460,scrollbars=1,'+ 
'resizable=0,status=0,menubar=0,toolbar=0,'+
'location=0,directories=0,copyhistory=0'); 
}






