/* form validation */

function isEmpty(field) {
	if ((field.value.length==0) || (field.value==null)) {
		return true;
	}
	else { return false; }
}

function isValidEmail(str) {
	return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}

function validateContactForm(form) {
	if (isEmpty(form.realname)) {
		form.realname.focus();		
		alert('Please enter your name.');
		return false; 
	}
	
	if (isEmpty(form.email)) {
		form.email.focus();		
		alert('Please enter your e-mail address.');
		return false; 
	}
	
	if (!isValidEmail(form.email.value)) {
		form.email.focus();
		alert('Your e-mail address does not appear to be valid.');
		return false;
	}
	
	if (isEmpty(form.phone)) {
		form.phone.focus();		
		alert('Please enter your phone number.');
		return false; 
	}
	
	return true;
}

/* popup */

function popup() {window.open("/lifestyle/map.html", "map", "toolbar=no,scrollbars=yes,height=700,width=1010");return false;}
