function validate_form(frm)
{
	var st=frm.email.value;
	if(frm.name.value=="")
	{
		alert("Please Enter Your  Name");
		frm.name.focus();
		return false;
	}
	
	var stripped = frm.phone.value.replace(/[\(\)\.\-\ ]/g, ''); 
	var illegalChars = /[\W_a-zA-Z]/;	
	if(frm.phone.value== "" )
	{
	alert("phone Number should not be left blank.");
	frm.phone.focus();
	frm.phone.select();
	return false;
	}else if (isNaN(parseInt(stripped)) || (illegalChars.test(frm.phone.value))) {
        alert("The Telephone Number should be digit.\n");
        frm.phone.focus();
		frm.phone.select();
		return false;
    }
	
	
	if(frm.email.value=="")
	{
		alert("Please enter your Email");
		frm.email.focus();
		frm.email.select();
		return false;
	}	
	else
	{			
		if(checkEmail(st)!=true)
		{
			alert("Invalid E-Mail  \n"+st);
			frm.email.focus();
			frm.email.select();
			return false; 
		}
	}
	
	
  function checkEmail(str)
{
	if((str.indexOf("@")==-1))
	{
		fstr="Please Enter @ or .";
		return false;
	}
	else
	{
		if((str.indexOf("@") == 0) )
		{
			fstr="@  Cannot Be first";
			alert(fstr);
			return false;
		}
	
		if((str.indexOf("@") == (str.length-1)))
		{
			fstr="@ Cannot Be Last";
			return false;
		}
	
		if((str.indexOf("@")+1) == str.indexOf("."))
		{
			fstr="@. IS Invalid Email";
			return false;
		}

	}

	var cp=0;					
	if(cp==2)
	{
		fstr="@ cannnot be repeated";
		return false;
	}
	return true;
}
	

}


