// JavaScript Document
function setSelected()
{
  aObj = document.getElementById('leftSide').getElementsByTagName('a');
  for(i=0;i<aObj.length;i++) { 
    if(document.location.href.indexOf(aObj[i].href)>=0) {
      aObj[i].className='active';
    }
  }
}
window.onload = setSelected;
function Form1Validator(theForm)
{
  if (theForm.Title.selectedIndex == 0)
  {
    alert("Please enter your \"Title\".");
    theForm.Title.focus();
    return (false);
  }

  if (theForm.Name.value == "")
  {
    alert("Please enter your \"Name\".");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Name.value.length < 5)
  {
    alert("Please enter at least 5 characters for your \"Name\".");
    theForm.Name.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-- \t\r\n\f";
  var checkStr = theForm.Name.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 use only letter, digit, whitespace and \"-\" characters for your \"Name\".");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Address_1.value == "")
  {
    alert("Please enter the \"First line of your address\".");
    theForm.Address_1.focus();
    return (false);
  }

  if (theForm.Address_1.value.length < 5)
  {
    alert("Please enter at least 5 characters for the \"First line of your address\".");
    theForm.Address_1.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-, . - \t\r\n\f";
  var checkStr = theForm.Address_1.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, whitespace and \", . -\" characters for the \"First line of your address\".");
    theForm.Address_1.focus();
    return (false);
  }

  if (theForm.Town_City.value == "")
  {
    alert("Please enter your \"Town or City\".");
    theForm.Town_City.focus();
    return (false);
  }

  if (theForm.Town_City.value.length < 3)
  {
    alert("Please enter at least 3 characters for your \"Town or City\".");
    theForm.Town_City.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ,.- \t\r\n\f";
  var checkStr = theForm.Town_City.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, whitespace and \",.-\" characters for your \"Town or City\".");
    theForm.Town_City.focus();
    return (false);
  }

  if (theForm.Postcode.value == "")
  {
    alert("Please enter your \"Postcode\".");
    theForm.Postcode.focus();
    return (false);
  }

  if (theForm.Postcode.value.length < 3)
  {
    alert("Please enter at least 3 characters for your \"Postcode\".");
    theForm.Postcode.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = theForm.Postcode.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 whitespace characters for your \"Postcode\".");
    theForm.Postcode.focus();
    return (false);
  }

  if (theForm.Country.selectedIndex < 0)
  {
    alert("Please select your \"Country\".");
    theForm.Country.focus();
    return (false);
  }

  if (theForm.Country.selectedIndex == 0)
  {
    alert("The first \"Country\" option is not a valid selection. Please choose one of the other options.");
    theForm.Country.focus();
    return (false);
  }

  if (theForm.Telephone.value == "")
  {
    alert("Please enter your \"Telephone Number\".");
    theForm.Telephone.focus();
    return (false);
  }

  if (theForm.Telephone.value.length < 7)
  {
    alert("Please enter at least 7 characters for your \"Telephone Number\".");
    theForm.Telephone.focus();
    return (false);
  }

  var checkOK = "0123456789--() \t\r\n\f";
  var checkStr = theForm.Telephone.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 use only digit, whitespace and \"-()\" characters for your \"Telephone Number\".");
    theForm.Telephone.focus();
    return (false);
  }

  var checkOK = "0123456789--() \t\r\n\f";
  var checkStr = theForm.Fax.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 use only digit, whitespace and \"-()\" characters for your \"Fax Number\".");
    theForm.Fax.focus();
    return (false);
  }

  if (theForm.email.value.length < 8)
  {
    alert("Please enter at least 8 characters for your \"E-mail address\".");
    theForm.email.focus();
    return (false);
  }
  return (true);
}