/*
	
	--- Legal Notice and License For Use ---
	This notice applies not only to this code, but also to any derivative thereof, collectively referred to as "this code".  
	This notice in full must remain with this code.  
	David L. Burkhart is the original author and sole owner of this code.  
	Permission is hereby granted for private, non-commercial use only.  
	Any other use of or public access to this code in part or in whole, whether commercial or otherwise, 
			is hereby prohibited except by explicit written permission directly by and from the owner.  
	
*/

if ( window.addEventListener ) window.addEventListener( "load", TranslateEMALinks, false );
else window.attachEvent( "onload", TranslateEMALinks );


function TranslateEMA(EMA) {
	var RegExp1 = /\[at\]/i;
	var RegExp2 = /\[dot\]/i;
	EMA = EMA.replace( RegExp1, "@" );
	EMA = EMA.replace( RegExp2, "." );
	EMA = EMA.replace( RegExp2, "." );
	return EMA;
	}
function TranslateEMALinks() {
	var x, LinkCnt = document.links.length, Link;
	for ( x=0; x<LinkCnt; x++ ) {
		Link = document.links[x];
		if ( Link.href.indexOf("mailto:") == 0 ) {
			Link.href		= TranslateEMA(Link.href);
			Link.innerHTML	= TranslateEMA(Link.innerHTML);
			}
		}
	}
