<!--


function validate()
{
var check1,check2,flag;
var url;
url=window.location.href;
name=document.query.txtName.value;
phone=document.query.txtPhone.value;

document.query.url.value=url;

flag=true;
var mail=document.query.txtMail.value;

var invalidChar = " *|,\":<>/[]{}`\';()&$#%";
if(name=="")
{
	alert("Please Enter Your Name");
	flag=false;
	document.query.txtName.focus();
	return false;
}
else
{
	flag=true;
}

// phone number validation
  var digits = "0123456789";

  if (document.query.txtPhone.value== "")
  {
    alert("Please fill in a Phone Number.");
	flag=false;
	document.query.txtPhone.focus();
	return false;
  }
 
  for (var i = 0; i < document.query.txtPhone.value.length; i++)
  {
    temp = document.query.txtPhone.value.substring(i, i+1)

    if (digits.indexOf(temp) == -1 && document.query.txtPhone.value != "")
    {
      alert("The phone number must be a number.");
	  flag=false;
	  document.query.txtPhone.value="";
	  document.query.txtPhone.focus();
	  return false;
      break;
    }
  } 
 if(document.query.txtPhone.value.length<8)
  {
	alert("Please enter a valid phone number( minimum 8 digits).");
	flag=false;
	document.query.txtPhone.focus();
	return false;
  }
  
  //end  phone validation


   for (var i = 0; i < mail.length; i++) 
   {
      if (invalidChar.indexOf(mail.charAt(i)) != -1)
      	{
         alert("Invalid Mail ID");
				flag=false;
				document.query.txtMail.focus();
				return false;
       }
   }
			

if(mail!="")
	{
		check1=mail.indexOf("@");
		check2=mail.indexOf(".");
		if(check1==-1 || check2==-1)
			{
				alert("Invalid Mail ID");
				flag=false;
				document.query.txtMail.focus();
				return false;
			}
		if((check1-check2)==1 || (check1-check2)==-1)
			{
				alert("Invalid Mail ID");
				flag=false;
				document.query.txtMail.focus();
				return false;
			}
		
	}

if(mail=="")
{
				alert("Invalid Mail ID");
				flag=false;
				document.query.txtMail.focus();
				return false;
}

if(flag==true)
	{
		document.query.submit();
	}
}


// end the hiding comment --> 
