/*
	rot13.js
	This code is free for public use.
	
	I use it to disguise my email address on Web pages, so it's harder
	for spammers to screen-scrape it.
*/

function rot13 (string) {
  var aCode = 'a'.charCodeAt();
  var zCode = 'z'.charCodeAt();
  var ACode = 'A'.charCodeAt();
  var ZCode = 'Z'.charCodeAt();
  var result = '';
  for (var c = 0; c < string.length; c++) {
	var charCode = string.charCodeAt(c);
	if (charCode >= aCode && charCode <= zCode)
	  charCode = aCode + (charCode - aCode + 13) % 26;
	else if (charCode >= ACode && charCode <= ZCode)
	  charCode = ACode + (charCode - ACode + 13) % 26;
	result += String.fromCharCode(charCode);
  }
  return result;
}

function myEmailAddress() {
	var encodedAddress = 'arvy@sngnyrkprcgvba.bet';
	var myAddress = '<a href="mailto:';
	myAddress += rot13(encodedAddress);
	myAddress += '">' + rot13(encodedAddress) + '</a>';
	return myAddress;
}