function ValidateForm()
{

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

  if (form.name.value == "")
  {
    alert("Please enter a value for the \"name\" field.");
    form.name.focus();
    return (false);
  }

  if (form.name.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"name\" field.");
    form.name.focus();
    return (false);
  }

  if (form.name.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"name\" field.");
    form.name.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz. \t\r\n\f";
  var checkStr = form.name.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, whitespace and \".\" characters in the \"name\" field.");
    form.name.focus();
    return (false);
  }

  if (form.address.value == "")
  {
    alert("Please enter a value for the \"address\" field.");
    form.address.focus();
    return (false);
  }

  if (form.address.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"address\" field.");
    form.address.focus();
    return (false);
  }

  if (form.address.value.length > 100)
  {
    alert("Please enter at most 100 characters in the \"address\" field.");
    form.address.focus();
    return (false);
  }

var checkOK = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-/, ";
  var checkStr = form.address.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,digit, whitespace, \".\" , \"/\" and \"-\" characters in the \"address\" field.");
    form.address.focus();
    return (false);
  }

  if (form.email.value == "")
  {
    alert("Please enter a value for the \"email\" field.");
    form.email.focus();
    return (false);
  }

  if (form.email.value.length < 4)
  {
    alert("Please enter at least 4 characters in the \"email\" field.");
    form.email.focus();
    return (false);
  }

  if (form.email.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"email\" field.");
    form.email.focus();
    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 only letter, digit and \"@ . - _\" characters in the \"email\" field.");
    form.email.focus();
    return (false);
  }



  if (form.comment.value == "")
  {
    alert("Please enter a value for the \"comment\" field.");
    form.comment.focus();
    return (false);
  }

  if (form.comment.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"comment\" field.");
    form.comment.focus();
    return (false);
  }

  if (form.comment.value.length > 100)
  {
    alert("Please enter at most 100 characters in the \"comment\" field.");
    form.comment.focus();
    return (false);
  }

 if (form.strCAPTCHA.value == "")
  {
    alert("Please enter a value for the \"code\" field.");
    form.strCAPTCHA.focus();
    return (false);
  }


var checkOK = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-/, ";
  var checkStr = form.comment.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,digit, whitespace , \".\" , \"/\" and \"-\" characters in the \"comment\" field.");
    form.comment.focus();
    return (false);
  }

var emailID=document.form.email
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true

  return (true);
}

