function validate(){

	var dt=".";
		var x=document.frm;
		str =document.frm.txtEmail.value;
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
	if(document.frm.name.value=="")	{
		alert("Please enter your Name");
		document.frm.name.focus();
		return false;
	}

	if(document.frm.phone.value=="") 
		{
			alert("Enter Phone number");
			document.frm.phone.focus();
			return false;
		}
		else
		{
			  var iChars = "!@#$%^&*()+=-_[]\\\';./{}|\":<>?abcdefghijklmnopqrstuvdxyz ABCDEFGHIJKLMNOPQRSTUPWXYZ";
			  for (var i = 0; i < document.frm.phone.value.length; i++)
			   {
				if (iChars.indexOf(document.frm.phone.value.charAt(i)) != -1) 
				{
				alert ("Special characters are not allowed in Phone number.\nYou can use only Numbers.");
				document.frm.phone.focus();
				return false;
				}
			  }
		}
	
		
	if(document.frm.txtEmail.value=="")	{ 
			alert("Enter Email id");
			document.frm.txtEmail.focus(); 
			return false;
		}	
		else		{
				if (str.indexOf(at)==-1)
				{
				   alert("Invalid E-mail ID");
				   document.frm.txtEmail.focus();
				   return false;
				}
				if
				 (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
				   alert("Invalid E-mail ID");
				   document.frm.txtEmail.focus();
				   return false;
				}
				if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
				    alert("Invalid E-mail ID");
				    document.frm.txtEmail.focus();
				    return false;
				}
				 if (str.indexOf(at,(lat+1))!=-1){
				    alert("Invalid E-mail ID");
				    document.frm.txtEmail.focus();
				    return false;
				 }
				 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
				    alert("Invalid E-mail ID");
				    document.frm.txtEmail.focus();
				    return false;
				 }
				 if (str.indexOf(dot,(lat+2))==-1){
				    alert("Invalid E-mail ID");
				    document.frm.txtEmail.focus();
				    return false;
				 }						
				if (str.indexOf(" ")!=-1){
				   alert("Invalid E-mail ID");
				   document.frm.txtEmail.focus();
				   return false;
				}			
		}		
		if(document.frm.msg.value=="")		{
			alert("Please enter your message");
			document.frm.msg.focus();
			return false;
		}
return true;
}