function CheckName(Name)
{
  var legalChars = /[a-zA-Z]{2,}/; // two or more letters

//  if (Name == "") {
//    alert('Please enter your name');
//    return false;
//  }
  if (Name.length < 2 || !(legalChars.test(Name))) {
//    alert('Please check that the name you have entered is correct');
    return false;
  }
  return true;
}       



function CheckMail(Mail)
{
  var emailFilter=/^.+@.+\..{2,3}$/;
  var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/

  if (Mail == "") {
//    alert('Please enter an e-mail address');
    return false;
  }
  if (!(emailFilter.test(Mail)) || Mail.match(illegalChars)) {
//    alert('Please check that the e-mail address you have entered is correct');
    return false;
  }
  return true;
}



function CheckCountry(Country) 
{
  var GoodChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ. ";
  var i = 0;

  if (Country == "") {
//    alert('Please enter your country');
    return false;
  }
  if (Country.length < 2) {
//    alert('Please check that the country you have entered is correct');
    return false;
  }
  for (i=0; i<=Country.length-1; i++) {
    if (GoodChars.indexOf(Country.charAt(i)) == -1) {
//      alert('Please check that the country you have entered is correct');
      return false;
    }
  }
  return true;
}



function checkform()
{
  if (!CheckName(document.contact_us.realname.value) || !CheckMail(document.contact_us.email.value) || !CheckCountry(document.contact_us.country.value)) {
    alert('Some of the required information (name, e-mail, and country) is missing or incorrect');
    return false;
  }
  return true;
}
