/*
	This script was originally called spamtrap.js and was
	written by Hamilton Ford on 19/05/2004.
	This release, hf-antispam.js, was updated 19/02/2010.
	It is intended to provide basic SpamBot protection to
	email addresses diplayed on web pages.
	http://www.HamiltonFord.com
	
	Instructions for use:
	
	In the <head> Element of your HTML document add:
	<script type="text/javascript" src="hf-antispam.js"></script>
	
	Save this text as hf-antispam.js and add it to the
	associated directory. Please retain these notes.
*/
var tld = new Array('net', 'com', 'co.uk', 'info');
function emailLink(name,domain,tldCode,subject,linkText,linkId,linkClass) {
	var emailAddress = (name + '&#064;' + domain + '.' + tld[tldCode]);
	if (subject.length != 0) var linkEmailAddress = (emailAddress + '?subject=' + subject);
	else var linkEmailAddress = emailAddress;
	if (linkText.length != 0) document.write('<a id="' + linkId + '" class="' + linkClass + '" href="mailto:' + linkEmailAddress + '">' + linkText + '<\/a>');
	else document.write('<a id="' + linkId + '" class="' + linkClass + '" href="mailto:' + linkEmailAddress + '">' + emailAddress + '<\/a>');
}
/*
	In the appropriate body element add:
	<script type="text/javascript"><!--
	emailLink('EmailName','EmailDomain','EmailTLDCode','EmailSubject','AnchorText','AnchorID','AnchorClass');
	//--></script><noscript>Email address hidden - JavaScript required.</noscript>
*/

function emailMapArea(shape,coords,name,domain,tldCode,subject,linkTitle) {
if (subject.length != 0) var emailAddress = (name + '&#064;' + domain + '.' + tld[tldCode] + '?subject=' + subject);
else var emailAddress = (name + '&#064;' + domain + '.' + tld[tldCode]);
document.write('<area shape="' + shape + '" coords="' + coords + '" href="mailto:' + emailAddress + '" title="' + linkTitle + '" \/>');
}
/*
	In the appropriate body element add:
	<script language="javascript" type="text/javascript"><!--
	emailMapArea('MapShape','MapCoords','EmailName','EmailDomain','EmailTLDCode','EmailSubject');
	//--></script>
	replacing the words in inverted commas with the appropriate variables,
	keeping the inverted commas. See the above array for tldCodes (Note: first code = 0).
*/