// JavaScript Document

function parse_links () {
	// ---	cycle all document links
	for ( i = 0;  i < document.links.length;  i++ ) {
		currHref 	= document.links[ i ].href;
		currText 	= document.links[ i ].innerHTML;
		if ( currHref && currHref.indexOf ( "{" ) != -1 ) 	document.links[ i ].href 		= parse_eml ( currHref );
		if ( currText && currText.indexOf ( "{" ) != -1 ) 	document.links[ i ].innerHTML 	= parse_eml ( currText );
	}
}
function parse_eml ( str ) {
	posBegin 	= str.indexOf ( "{" );
	posEnd 		= str.indexOf ( "}" );
	strBegin 	= str.substr ( 0, posBegin );
	strEnd 		= str.substr ( posEnd +2 );
	strParse 	= str.substr ( ( posBegin +1 ), ( posEnd - ( posBegin +1 ) ) );
	arrParse 	= strParse.split ( "," );
	strEml 		= strBegin + arrParse[ 2 ] + "@" + arrParse[ 1 ] + "." + arrParse[ 0 ] + strEnd;
	return strEml;
}
window.onload = function() { parse_links (); };
