function validate_fields(Form)
{

  if (Form.name.value == "")
  {
    alert("Please enter your Name in the \"Name\" field.");
    Form.name.focus();
    return (false);
  }

  if (Form.name.value.length < 3)
  {
    alert("Please enter your Name in the \"Name\" field.");
    Form.name.focus();
    return (false);
  }

 

 if (Form.email.value == "")
  {
    alert("Please enter a valid e-mail address in the \"E-mail\" field.");
    Form.email.focus();
    return (false);
  }

  if (Form.email.value.length < 8)
  {
    alert("Please enter a valid e-mail address in the \"E-mail\" field.");
    Form.email.focus();
    Form.email.value = "";
    return (false);
  }

var checkEml = Form.email.value;
required = /@/i;
isOk = required.exec(checkEml);
if (isOk == null)

  {
    alert("Please enter a valid e-mail address in the \"E-mail\" field.");
    Form.email.focus();
    Form.email.value = "";
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@-._";
  var checkStr = Form.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;
    }
  }
  if (!allValid)
  {
    alert("Please enter a Valid e-mail address in the \"E-mail\" field.");
    Form.email.focus();
    return (false);
  }



  if (Form.telephone.value == "")
  {
    alert("Please enter your Telephone No. in the \"Telephone No.\" field.");
    Form.telephone.focus();
    return (false);
  }

  if (Form.telephone.value.length < 11)
  {
    alert("Please include STD code in the \"Telephone No.\" field.");
    Form.telephone.focus();
    return (false);
  }

  if (Form.telephone.value.length > 18)
  {
    alert("Please enter a valid length Telephone number in the \"Telephone No.\" field.");
    Form.telephone.focus();
    return (false);
  }

  var checkOK = "0123456789-()+ ";
  var checkStr = Form.telephone.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 digits in the \"Telephone No.\" field.");
    Form.telephone.focus();
    return (false);
  }

  var checkOK = "0123456789-()+ ";
  var checkStr = Form.fax.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 digits in the \"Fax No.\" field.");
    Form.fax.focus();
    return (false);
  }

  if (Form.comments.value.length < 8)
  {
    alert("Please enter your \"Comments\" or \"Feedback\".");
    Form.comments.focus();
    return (false);
  }

  if (Form.comments.value.length > 500)
  {
    alert("\"Comments\" are restricted to 500 characters");
    Form.comments.focus();
    return (false);
  }

var checkStr = " ";
checkStr += Form.name.value +" ";
checkStr += Form.email.value +" ";
checkStr += Form.comments.value +" ";
checkStr += Form.address.value +" ";
badWords = /fucker|fuck|\scunt|wanker|wank|prick|penis|cock|tit\s|whore|arse|bastard|fart|shite|shit|lesbian|poofter|poof|shagger|shag|tosser|toss/i;
anySwears = badWords.exec(checkStr);
if (anySwears != null)
{

Form.method = "POST";
Form.action = "feedback/monitor/confirms.asp";
Form.target = "_self";
Form.submit = "true";
}
  return (true);
}