email_decrypt = {
	tooltip_js_on : 'Send e-mail',
	tooltip_js_off : 'To reveal this e-mail address, you will need to answer a simple question',
	init : function () {
		if (!document.getElementById || !document.createTextNode) {	return;	}
		email_decrypt.map = email_decrypt.rot13init ();
		var links = document.getElementsByTagName ('a');
		for (var l = 0; l < links.length; l++) {
			// Encode links when clicked
			links[l].onclick = function () {
				email_decrypt.geo_decode (this);
			}
			links[l].onmouseover = function () { // Display tooltip when links are hovered
				if (this.getAttribute ('title') == email_decrypt.tooltip_js_off) { // Set custom tooltip if specified
					this.setAttribute ('title', email_decrypt.tooltip_js_on);
					email_decrypt.geo_decode (this); // Encode links when hovered (so that the address appears correctly in the browser's status bar)
				}
			}
		}
	},
	// function to recompose the orginal address
	geo_decode : function (anchor) {
		var href = anchor.getAttribute ('href');
		var address = href.replace (/.*econt\/([a-z0-9._%-]+)\+([a-z0-9._%-]+)\+([a-z.]+)/i, '$1' + '@' + '$2' + '.' + '$3');
		var linktext = anchor.innerHTML; // IE Fix
		if (href != address) {
			anchor.setAttribute ('href', 'mailto:' + email_decrypt.str_rot13 (address)); // Add mailto link
			anchor.innerHTML = linktext; // IE Fix
		}
	},
	rot13init : function () {
		var map = new Array ();
		var s = "abcdefghijklmnopqrstuvwxyz";
		for (var i = 0 ; i < s.length ; i++) {
		 map[s.charAt(i)] = s.charAt((i+13)%26);
		}
		for (var i = 0 ; i < s.length ; i++) {
		 map[s.charAt (i).toUpperCase ()] = s.charAt ((i + 13) % 26).toUpperCase ();
		}
		return map;
	},
	str_rot13 : function (a) {
		var s = "";
		for (var i = 0; i < a.length; i++) {
			var b = a.charAt (i);
			s += (b >= 'A' && b <= 'Z' || b >= 'a' && b <= 'z' ? email_decrypt.map[b] : b);
		}
		return s;
	}
}