function validate()
{
	var name=document.getElementById('contact_name').value;	
	var contact_email=document.getElementById('contact_email').value;	
	var captcha=document.getElementById('captcha').value;	
	
	if(name.match(/^[\s]*$/))
	{
		alert("Please enter your name");
		document.getElementById('contact_name').focus();
		return false;
	}
	if(!name.match(/^([A-Za-z][A-Za-z\. ]*){4,30}$/))
	{
		alert("Please enter alphabets in name field");
		document.getElementById('contact_name').focus();
		return false;
	}		
	if(contact_email.match(/^[\s]*$/))
	{
		alert("Please enter your email");
		document.getElementById('contact_email').focus();
		return false;
	}
	if(!contact_email.match(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i) || (contact_email.length<6 && contact_email.length>50) || (contact_email.match(/@mailinator.com/)) || (contact_email.match(/@example.com/)) || (contact_email.match(/@examples.com/)))
	{
		alert("Please enter valid email");
		document.getElementById('contact_email').focus();
		return false;
	}
	if(captcha.match(/^[\s]*$/))
	{
		alert("Please enter sum of expression");
		document.getElementById('captcha').focus();
		return false;
	}
	return true;
}

