<!--
/* <[CDATA[ */
function NewsletterValidation(theForm,theDetails)
{	
if(theDetails.indexOf("Firstname")!=-1)
{
   // FistName
  if (theForm.Firstname.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.Firstname.focus();
    return (false);
  }

  if (theForm.Firstname.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"First Name\" field.");
    theForm.Firstname.focus();
    return (false);
  }

  if (theForm.Firstname.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"First Name\" field.");
    theForm.Firstname.focus();
    return (false);
  }
}

if(theDetails.indexOf("Surname")!=-1)
{
// Surname
  if (theForm.Surname.value == "")
  {
    alert("Please enter a value for the \"Surname\" field.");
    theForm.Surname.focus();
    return (false);
  }

  if (theForm.Surname.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Surname\" field.");
    theForm.Surname.focus();
    return (false);
  }

  if (theForm.Surname.value.length > 25)
  {
    alert("Please enter at most 25 characters in the \"Surname\" field.");
    theForm.Surname.focus();
    return (false);
  }
}

if(theDetails.indexOf("Email")!=-1)
{ 
//Email
  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email Address\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Email Address\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length > 100)
  {
    alert("Please enter at most 100 characters in the \"Email Address\" field.");
    theForm.Email.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-@._";
  var checkStr = theForm.Email.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;
    }
  }
  
  var i = 1;
  var sLength = checkStr.length;
  
  // look for @
  while ((i < sLength) && (checkStr.charAt(i) != "@"))
  { i++;}
  diff=sLength-i;
  if(diff<1)
  {
     alert("You have not used an \"@\" symbol in your email address.Please use one.")
     theForm.Email.focus();
     return (false);
  }
  
  // look for .
  i = 1;
  while ((i < sLength) && (checkStr.charAt(i) != "."))
  { i++;}
  diff=sLength-i;
  if(diff<1)
  {
     alert("You have not used an \".\" symbol in your email address.Please use one.")
     theForm.Email.focus();
     return (false);
  }
  
  if (!allValid)
  {
    alert("Please enter only letter, digit and \"@._\" characters in the \"Email Address\" field.");
    theForm.Email.focus();
    return (false);
  }
}

if(theDetails.indexOf("JobTitle")!=-1)
{ 
// JobTitle
  if (theForm.JobTitle.value == "")
  {
    alert("Please enter a value for the \"Job Title\" field.");
    theForm.JobTitle.focus();
    return (false);
  }

  if (theForm.JobTitle.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Job Title\" field.");
    theForm.JobTitle.focus();
    return (false);
  }
}

if(theDetails.indexOf("Company")!=-1)
{ 
// Company
  if (theForm.Company.value == "")
  {
    alert("Please enter a value for the \"Company\" field.");
    theForm.Company.focus();
    return (false);
  }

  if (theForm.Company.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Company\" field.");
    theForm.Company.focus();
    return (false);
  }
}

if(theDetails.indexOf("CompanyType")!=-1)
{ 
// CompanyType

  if (theForm.CompanyType.selectedIndex < 0)
  {
    alert("Please select one of the \"Company Type\" options.");
    theForm.CompanyType.focus();
    return (false);
  }

  if (theForm.CompanyType.selectedIndex == 0)
  {
    alert("The first \"Company Type\" option is not a valid selection.  Please choose one of the other options.");
    theForm.CompanyType.focus();
    return (false);
  }
}

if(theDetails.indexOf("AddressStreet")!=-1)
{ 
// Street Address
  if (theForm.AddressStreet.value == "")
  {
    alert("Please enter a value for the \"Street Address\" field.");
    theForm.AddressStreet.focus();
    return (false);
  }

  if (theForm.AddressStreet.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Street Address\" field.");
    theForm.AddressStreet.focus();
    return (false);
  }

  if (theForm.AddressStreet.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Street Address\" field.");
    theForm.AddressStreet.focus();
    return (false);
  }
}

if(theDetails.indexOf("AddressCity")!=-1)
{ 
// City
  if (theForm.AddressCity.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.AddressCity.focus();
    return (false);
  }

  if (theForm.AddressCity.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"City\" field.");
    theForm.AddressCity.focus();
    return (false);
  }

  if (theForm.AddressCity.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"City\" field.");
    theForm.AddressCity.focus();
    return (false);
  }
}

if(theDetails.indexOf("AddressState")!=-1)
{ 
// State
  if (theForm.AddressState.value == "")
  {
    alert("Please enter a value for the \"State\" field.");
    theForm.AddressState.focus();
    return (false);
  }

  if (theForm.AddressState.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"State\" field.");
    theForm.State.focus();
    return (false);
  }

  if (theForm.AddressState.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"State\" field.");
    theForm.AddressState.focus();
    return (false);
  }  
}

if(theDetails.indexOf("AddressCountry")!=-1)
{ 
// Country

  if (theForm.AddressCountry.selectedIndex < 0)
  {
    alert("Please select one of the \"Country\" options.");
    theForm.AddressCountry.focus();
    return (false);
  }

  if (theForm.AddressCountry.selectedIndex == 0)
  {
    alert("The first \"Country\" option is not a valid selection.  Please choose one of the other options.");
    theForm.AddressCountry.focus();
    return (false);
  }
}

if(theDetails.indexOf("AddressPostCode")!=-1)
{ 
// Postcode
  if (theForm.AddressPostCode.value == "")
  {
    alert("Please enter a value for the \"Postcode\" field.");
    theForm.AddressPostCode.focus();
    return (false);
  }

  if (theForm.AddressPostCode.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Postcode\" field.");
    theForm.AddressPostCode.focus();
    return (false);
  }

  if (theForm.AddressPostCode.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Postcode\" field.");
    theForm.Postcode.focus();
    return (false);
  }  
}

if(theDetails.indexOf("PhoneHome")!=-1)
{  
// Telephone
  if (theForm.PhoneHome.value == "")
  {
    alert("Please enter a value for the \"Telephone\" field.");
    theForm.PhoneHome.focus();
    return (false);
  }

  if (theForm.PhoneHome.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Telephone\" field.");
    theForm.PhoneHome.focus();
    return (false);
  }

  if (theForm.PhoneHome.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Telephone\" field.");
    theForm.PhoneHome.focus();
    return (false);
  }
}

if(theDetails.indexOf("PhoneMobile")!=-1)
{  
// Mobile Phone
  if (theForm.PhoneMobile.value == "")
  {
    alert("Please enter a value for the \"Mobile Phone\" field.");
    theForm.PhoneMobile.focus();
    return (false);
  }

  if (theForm.PhoneMobile.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Mobile Phone\" field.");
    theForm.PhoneMobile.focus();
    return (false);
  }

  if (theForm.PhoneMobile.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Mobile Phone\" field.");
    theForm.PhoneMobile.focus();
    return (false);
  }
}

if(theDetails.indexOf("AgeBracket")!=-1)
{ 
// AgeBracket

  if (theForm.AgeBracket.selectedIndex < 0)
  {
    alert("Please select one of the \"Age Bracket\" options.");
    theForm.AgeBracket.focus();
    return (false);
  }

  if (theForm.AgeBracket.selectedIndex == 0)
  {
    alert("The first \"Age Bracket\" option is not a valid selection.  Please choose one of the other options.");
    theForm.AgeBracket.focus();
    return (false);
  }
}

if(theDetails.indexOf("MemberCategory")!=-1)
{ 
// MemberCategory

  if (theForm.MemberCategory.selectedIndex < 0)
  {
    alert("Please select one of the \"Member Category\" options.");
    theForm.MemberCategory.focus();
    return (false);
  }

  if (theForm.MemberCategory.selectedIndex == 0)
  {
    alert("The first \"Member Category\" option is not a valid selection.  Please choose one of the other options.");
    theForm.MemberCategory.focus();
    return (false);
  }
}
 
if(theDetails.indexOf("NewsletterCategory")!=-1)
{ 
//Newsletter Category Array

  if (theForm.NewsCatID_Array.value == "")
  {
    alert("You have not selected a \"newsletter\". Please select one of the available \"newsletters\".");
    theForm.Category_0.focus();
    return (false);
  }

  if (theForm.NewsCatID_Array.value.length < 1)
  {
    alert("You have not selected a \"newsletter\". Please select one of the available \"newsletters\".");
    theForm.Category_0.focus();
    return (false);
  }
}

if(theDetails.indexOf("NewsletterType")!=-1)
{ 
// NewsletterType

  if (theForm.NewsletterType.selectedIndex < 0)
  {
    alert("Please select one of the \"Type of Newsletter\" options.");
    theForm.NewsletterType.focus();
    return (false);
  }

  if (theForm.NewsletterType.selectedIndex == 0)
  {
    alert("The first \"Type of Newsletter\" option is not a valid selection.  Please choose one of the other options.");
    theForm.NewsletterType.focus();
    return (false);
  }
}

  if(theForm.btnSubmit)
     theForm.btnSubmit.disabled = true;
     
  return (true);
}
/* ]]> */
//-->
