// Copyright 2003 David Wolfe <Dave_Wolfe@computer.org>. May be freely
// used, modified, and redistributed under the same terms as Perl so
// long as this copyright notice remains intact and any modifications
// are clearly noted. Absolutely no warranty of any kind. Author is not
// responsible for any damage or loss caused by use of this program.

// Function to invoke a mailer to simulate a mailto link without
// actually having a mailto link for spammers to harvest. Use in an
// onClick attribute of a link, e.g.:
// <a href="/cgi/nospam.pl?nobody+example.net"
// onclick="return nospam('nobody+example.net')">nobody</a>

function nospam(addr) {
  addr = addr.replace(/\+/, '@');
  var win = window.open('mailto:' + addr, '_blank',
			'dependent,height=1,width=1');    
  if (win) win.close();       
  return false;
}
