/**
 * @author quangntenemy
 * Encrypt email addresses using a variation of the Ceasar cipher
 * to protect them from robots/crawlers/spiders that collect email
 * addresses in websites for mail spamming
 * It's a rot13 so the decryption is the same as encryption
 **/

function crypt(text) {
	var result="";
	for (var i = 0; i < text.length; i++) {
		var c = text.charCodeAt(i);
		if (c > 96 && c < 123) c = (c - 84) % 26 + 97;
		else if (c > 64 && c < 91) c = (c - 52) % 26 + 65;
		result += String.fromCharCode(c);
	}
	return result;
}

// my email
var ea = crypt("dhnatagrarzl@tznvy.pbz");

function mailLink(text) {
	document.write("<a href=\"mailto:" + ea + "\">" + text + "<\/a>");
}
