var good;

function checkEmailAddress(field) {
	// the following expression must be all on one line...
	var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
  
  	if (goodEmail) {
    	good = true;
  	} else {
    	alert('Please enter a valid e-mail address.');
    	field.focus();
    	field.select();
    	good = false;
  	}
}

u = "<a href=\"" + window.location + "\">" + window.location + "</a>";
m = "I thought you would be interested in this page.";

function mailThisUrl() {
  good = false;
  
  checkEmailAddress(document.email_friend.addy);
  
  if (good) {
    window.location = "mailto:"+document.email_friend.addy.value+"?subject="+m+"&body="+u;
  }
}

