//		This script was originally called spamtrap.js and was
//		written by Hamilton Ford on 19/05/2004.
//		This release, spamblock2.js, adds a CSS class option
//		and was written by Hamilton Ford on 25/09/2007.
//		It is intended to provide basic SpamBot protection to
//		email addresses diplayed on web pages.
//		Visit: http://www.HamiltonFord.com.

//		In the <head> Element of your HTML document add:
//		<script type="text/javascript" src="spamblock2.js"></script>
//		Then save this text as spamblock.js and add it to the
//		same directory as the HTML document.
//		Please include these notes also.

var tld = new Array('net', 'com', 'co.uk', 'info');

function emailLink(name,domain,tldCode,subject,linkText,linkClass) {
	emailAddress = (name + '&#064;' + domain + '.' + tld[tldCode]);
	if (subject && subject.length != 0) linkEmailAddress = (emailAddress + '?subject=' + subject);
	else linkEmailAddress = emailAddress;
	if (linkClass && linkClass.length != 0) linkStart = '<a class="' + linkClass + '" href="mailto:' + linkEmailAddress + '">';
	else linkStart = '<a href="mailto:' + linkEmailAddress + '">';
	if (linkText && linkText.length != 0) linkEnd = linkText + '<\/a>';
	else linkEnd = emailAddress + '<\/a>';
	document.write(linkStart + linkEnd);
}

//		In the appropriate body element add:
//		<script type="text/javascript"><!--
//		emailLink('EmailName','EmailDomain','EmailTLDCode','EmailSubject','LinkText','LinkClass');
//		//--></script><noscript>Email address hidden - JavaScript required.</noscript>

//		e.g. emailLink('SpamBlock','HamiltonFord','1','','Write to HF');