/*

	SAFE-MAIL-LINK FUNCTIONS

	usage:

	a mailto like this one:  
	<a href="mailto:someone@somehost.com">someone@somehost.com</a>

	(which is nice food for spambots..) has to be changed to 

	<a href="#" onmouseover="antispam(this, 'someone', 'somehost.com');">
		someone<span gid="hda">  </span>somehost.com
	</a>

	this way, there's no @ sign at all in the source.
	
	insert the following line in the head of every page that uses mailto links:
	
	<script src="safemailto.js" type="text/javascript"></script>	

	when the page loads the script puts an '@' sign in every found '<span gid="hda"> </span>',
	so that all mail links appear correctly.

	written by jan trueller
	this script may be used freely without permission, credits welcome

*/

var k, mailto="", mt=new Array(109,97,105,108,116,111,58);
for(k=0; k<mt.length; k++)
	mailto += String.fromCharCode(mt[k]);
function antispam(lnk, nam, hst)
{ 
	lnk.href = mailto + nam + String.fromCharCode(64) + hst;
}
function replaceAts()
{
	var at=String.fromCharCode(64), spans = document.getElementsByTagName("span");
	for(k=0; k<spans.length; k++)
		if(spans[k].getAttribute("gid") == "hda")
			spans[k].innerHTML = at;
}	
window.setTimeout("replaceAts()", 3000); // change span contents to @

