function MailEncoder() {
	this.run = function() {
		for (var i = 0; i < document.links.length; i++) {
			var l= document.links[i];
			
			if (l.firstChild.nodeType == 3 && l.firstChild.nodeValue.indexOf('AT') != -1) {
				var address = document.links[i].firstChild.nodeValue.replace(/\s*AT\s*/, '@');
				document.links[i].firstChild.nodeValue = address;
				document.links[i].href = 'mailto:' + address;
			}			
		}
	}
}

window.onload = function() {
	if (document.getElementById) {
		encoder = new MailEncoder();
		encoder.run();
	}
}
