function validatename(theobj)
{
	var re_name=/^(\D)+$/i;
	var str;
	str=theobj.value;
	if(!str.match(re_name) && str!="")
	{
		alert("Characters only allowed!");
		theobj.value="";
		theobj.focus();
		return false;
	}
	else
		return true;		
}
function validateemail(theobj)
{
	var emailFilter=/^.+@.+\..{2,3}$/;
	var str;
	str=theobj.value;
	if (!(emailFilter.test(str)) && (str!=""))
	{ 
       alert("Please enter a valid email address");
	   theobj.value="";
	   theobj.focus();
	   return false;
	}

	else
		return true;		
}
function validate()
{	
    var email=document.frmcontact.email.value;	
	var fname=document.frmcontact.fname.value;	
	var lname=document.frmcontact.lname.value;	
	var address=document.frmcontact.address.value;	
	var country=document.frmcontact.country.value;	
	

	if(fname=="")
	{
		alert("Emter your first name");
		document.frmcontact.fname.focus();
		return false;
	}
	if(lname=="")
	{
		alert("Emter your last name");
		document.frmcontact.lname.focus();
		return false;
	}
	if(address=="")
	{
		alert("Emter your address");
		document.frmcontact.address.focus();
		return false;
	}
	if(country=="")
	{
		alert("Emter your country");
		document.frmcontact.country.focus();
		return false;
	}

	if(!validateemail(document.frmcontact.email))
	{
		//document.frmcontact.email.focus();
		return false;
	}
	if(email=="" || !validateemail(document.frmcontact.email))
	{		
		alert("Please enter your email id");
		document.frmcontact.email.focus();
		return false;
	}
	else
	{	
		document.frmcontact.submit();
		return true;
	}
}