function enquiryValidation()
{
var d = document.getElementById('ename');
if(d.value == "")
{
    alert("Please enter Name");
    d.focus();
    return false;
}


  if (d.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Name\" field.");
    d.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
  var checkStr = d.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 letter and whitespace characters in the \"Name\" field.");
    d.focus();
    return (false);
  }


var email = document.getElementById('email');
if(email.value == "")
{
    alert("Please enter Email Address.");
    email.focus();
    return false;
}

if(email.value!="")
{pass = email.value.indexOf('@',0);
if(pass==-1)
{
alert("Not a valid E-mail Address");
 email.focus();
 return (false);
}
}

  if (email.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Email\" field.");
    email.focus();
    return (false);
  }
  
var phone = document.getElementById('phone');
if(phone.value == "")
{
    alert("Please enter Phone no.");
    phone.focus();
    return false;
} 

if (phone.value.length < 6)
  {
    alert("Please enter at least 6 characters in the \"Phone\" field.");
    phone.focus();
    return (false);
  }

 var checkOK = "0123456789";
  var checkStr = phone.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 digit and \"-\" characters in the \"Phone\" field.");
    phone.focus();
    return (false);
  }

return true;
}

