function checkcontact(frm)
{
	with(frm)
	{
		if(txtname.value == "")
		{
			alert("Please enter Name.");
			txtname.focus();
			return false;
		}
		if(txtemail.value == "")
		{
			alert("Please specify your Email.");
			txtemail.focus();
			return false;
		}
		if(txtemail.value != "")	// if email field is not empty
		{
			//	set the regular expression
			var emails=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
			var membermailid = eval("txtemail.value"); // get the email address from the email field

			result1=membermailid.search(emails);	// look for improper email address in email field
			if(result1==-1)	// email address in email field is not proper
			{
				alert("Please enter valid email address."); // Display the alert box
				txtemail.focus();	// set focus to email field
				return false;
			}
		} // email validation ends here		
		return true;
	}
}