var Base64 = {
	table: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",

	encode: function(s) {
		var out = "", c1, c2, c3, e1, e2, e3, e4;
		for (var i = 0; i < s.length; ) {
			c1 = s.charCodeAt(i++);
			c2 = s.charCodeAt(i++);
			c3 = s.charCodeAt(i++);
			e1 = c1 >> 2;
			e2 = ((c1 & 3) << 4) + (c2 >> 4);
			e3 = ((c2 & 15) << 2) + (c3 >> 6);
			e4 = c3 & 63;
			if (isNaN(c2))
				e3 = e4 = 64;
			else if (isNaN(c3))
				e4 = 64;
			out += this.table.charAt(e1) + this.table.charAt(e2) + this.table.charAt(e3) + this.table.charAt(e4);
		}
		return out;
	},

	decode: function(s) {
		var out = "", c1, c2, c3, e1, e2, e3, e4;
		for (var i = 0; i < s.length; ) {
			e1 = this.table.indexOf(s.charAt(i++));
			e2 = this.table.indexOf(s.charAt(i++));
			e3 = this.table.indexOf(s.charAt(i++));
			e4 = this.table.indexOf(s.charAt(i++));
			c1 = (e1 << 2) + (e2 >> 4);
			c2 = ((e2 & 15) << 4) + (e3 >> 2);
			c3 = ((e3 & 3) << 6) + e4;
			out += String.fromCharCode(c1);
			if (e3 != 64)
				out += String.fromCharCode(c2);
			if (e4 != 64)
				out += String.fromCharCode(c3);
		}
		return out;
	}
};

function mk_maddr(addr, title, tagparm)
{
	addr = Base64.decode(addr);

	var decoded = "";
	var len = addr.length;
	for (var i = 0; i < len; i++)
		decoded += String.fromCharCode(addr.charCodeAt(i) ^ 156);
	if (title == null || title == '')
		title = decoded;

	decoded = decoded.replace(/</g, '&lt;');
	decoded = decoded.replace(/>/g, '&gt;');

	title = title.replace(/</g, '&lt;');
	title = title.replace(/>/g, '&gt;');

	document.write('<a ' + tagparm + ' hr' + 'ef="mai' + 'lto' + ':' + decoded + '">' + title + '</a>');
}

