function validate(){
	
	if(document.frmcontact.txt_first_name.value=="" || document.frmcontact.txt_first_name.value==null || document.frmcontact.txt_first_name.value==0){
		alert("Please enter first name.");
		document.frmcontact.txt_first_name.focus();
		return false;
	}
	if(document.frmcontact.txt_last_name.value=="" || document.frmcontact.txt_last_name.value==null || document.frmcontact.txt_last_name.value==0){
		alert("Please enter last name.");
		document.frmcontact.txt_last_name.focus();
		return false;
	}
	if(document.frmcontact.txt_email.value=="" || document.frmcontact.txt_email.value==null || document.frmcontact.txt_email.value==0){
		alert("Please enter your email address.");
		document.frmcontact.txt_email.focus();
		return false;
	}
	else if(!isEmail(document.frmcontact.txt_email.value))
		{
			alert("Email address is invalid");
			document.frmcontact.txt_email.focus();
			return (false);
		}
	if(document.frmcontact.txt_location.value=="Other"){
		if(document.frmcontact.locationother.value=="" || document.frmcontact.locationother.value==0 || document.frmcontact.locationother.value==null){
			alert("Please enter other location.");
			document.frmcontact.locationother.focus();
			return false;
		}
	}
	if(document.frmcontact.txt_inquiry.value=="Other"){
	   if(document.frmcontact.queryother.value=="" || document.frmcontact.queryother.value==0 || document.frmcontact.queryother.value==null){
			alert("Please enter other query type.");
			document.frmcontact.queryother.focus();
			return false;
	   }
	}
	if(document.frmcontact.txt_message.value=="" || document.frmcontact.txt_message.value==null || document.frmcontact.txt_message.value==0){
		alert("Please enter message.");
		document.frmcontact.txt_message.focus();
		return false;
	}
	return true;
}
function displaylocationtextbox(val){
	if(val=="Other"){
		document.getElementById('otherlocation').style.display='block';
	}else{
		document.getElementById('otherlocation').style.display='none';
	}
}
function displayquerytextbox(val){
	if(val=="Other"){
		document.getElementById('otherquery').style.display='block';
	}else{
		document.getElementById('otherquery').style.display='none';
	}
}

function isEmail(aStr)
{
	var reEmail=/^[0-9a-zA-Z_'\.-]+\@[0-9a-zA-Z_\.-]+\.[0-9a-zA-Z_\.-]+$/;
	if(!reEmail.test(aStr))
	{
		return false;
	}
	return true;
}