	function checkform(dform) {
		if (trim(dform.first_name.value)=='') {
			alert("Please fill in your first name!");
			return false;
		} else if (trim(dform.last_name.value)=='') {
			alert("Please fill in your last name!");
			return false;
		} else if (trim(dform.city.value)=='') {
			alert("Please fill in your city!");
			return false;
		} else if (trim(dform.email.value)=='') {
			alert("Please fill in your email address!");
			return false;
		} else if (!validemail(trim(dform.email.value))) {
			alert("The email address seems to be invalid!\nPlease try again!");
			return false;
		}	else if ((!dform.are_you_a_realtor[0].checked) && (!dform.are_you_a_realtor[1].checked)) {
			alert("Please tell us if you are a realtor or not!");
			return false;
		} else if (trim(dform.how_did_you_hear_about_us.value)=='') {
			alert("Please tell us how did you here about the Islands of Rockport!");
			return false;
		} 
		
	
		return true;
	}
	
	
	function checkform2(dform) {
		if (trim(dform.name.value)=='') {
			alert("Please fill in your name!");
			return false;
		} else if (trim(dform.email.value)=='') {
			alert("Please fill in email address!");
			return false;
		} else if (trim(dform.comments.value)=='') {
			alert("Please fill in your comments!");
			return false;
		}
	
		return true;
	}
	
	
	function checkform3(dform) {
		if (trim(dform.first_name.value)=='') {
			alert("Please fill in your first name!");
			return false;
		} else if (trim(dform.last_name.value)=='') {
			alert("Please fill in your last name!");
			return false;
		} else if (trim(dform.phone.value)=='') {
			alert("Please fill in your phone number!");
			return false;
		} else if (trim(dform.email.value)=='') {
			alert("Please fill in your email address!");
			return false;
		} else if (!validemail(trim(dform.email.value))) {
			alert("The email address seems to be invalid!\nPlease try again!");
			return false;
		} else if (trim(dform.number_of_guests.value)=='') {
			alert("Please fill in the number of people that are attending the event!");
			return false;
		} 
	
		return true;
	}
	
	function trim(stringToTrim) {
		return stringToTrim.replace(/^\s+|\s+$/g,"");
	}
	
	function validemail(demail) {
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(demail)){
			return true;
		}
		return false;
	}