/**
 * Mail.js, spam-free mailto:
 *
 * Works in conjunction with mail.php, a two-line script, to 
 * provide "mailto" links without exposing my address to spam-bots.
 *
 * To use it, create a link like this:
 * <a href="/contact/" onclick="return mail();">mail me</a>.
 *
 * The 'href' part of the link is a real link for those without
 * javascript. Unfortunately, they'll have to type my address
 * the old-fashioned way.
 *
 * The function mail(), below, opens a new window at mail.php,
 * sets a timeout to close it, then returns false. This stops the
 * link from loading a new page.
 *
 * Mail.php dies like this:
 * die(header("Location: mailto:me@jamessocol.com"));
 *
 * This has the WAMD warantee. It works here.
 */
function mail (who) {
	var url=(who==null)?'':'?to='+who;
	m=window.open('http://jamessocol.com/contact/mail.php'+url, 'mwin');
	window.setTimeout('m.close();', 1000);
	
	// stop the link from loading.
	return false;
}