function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function FormValidator(theForm)
{


  if (theForm.B_name.value == "")
  {
    alert("Please enter your name.");
    theForm.B_name.focus();
    return (false);
  }

  if (theForm.C_email.value == "")
  {
    alert("Please enter your email address.");
    theForm.C_email.focus();
    return (false);
  }



  if (!isEmailAddr(theForm.C_email.value))
  {
    alert("Please enter a Correct Email Address!");
    theForm.C_email.focus();
    return (false);
  }
   
  if (theForm.C_email.value.length < 3)
  {
    alert("Please enter at least 3 characters in the Email field.");
    theForm.C_email.focus();
    return (false);
  }


  if (theForm.D_company.value == "")
  {
    alert("Please enter your Company Name.");
    theForm.D_company.focus();
    return (false);
  }

  if (theForm.G_enquiry.value == "")
  {
    alert("Please enter your enquiry.");
    theForm.G_enquiry.focus();
    return (false);
  }

  if (theForm.H_company1.value == "")
  {
    alert("Please enter your address.");
    theForm.G_enquiry.focus();
    return (false);
  }

  if (theForm.I_Postcode.value == "")
  {
    alert("Please enter the Post Code.");
    theForm.G_enquiry.focus();
    return (false);
  }
  return (true);
}