//The function validates a couple fields on the contact us form
function validateContact(){
	var error = "";
	
	//Check for name
	if(document.frmContactUs.name.value == "")
	{	error = error + "Please provide your name.\n";	}
	
	//Check for either phone or email
	if(document.frmContactUs.email.value == "")
	{	error = error + "Please provide your email address.\n";	}
	
	//Check for valid email
	if(document.frmContactUs.email.value > "")
	{	if(!isValidEmail(document.frmContactUs.email.value))
		{	error = error + "Please provide a valid email address.\n";	}	}
	
	if(error > "")
	{	alert(error);
		return false;	}
	
	return true;
}

//Simple function to validate email addresses
function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}

