(function($) { 
$.rot13 = function(string) {
    var newString = string;
    if (typeof string === 'string') {
      newString = newString.replace(/[a-z0-9]/ig, function(chr) {
          var cc = chr.charCodeAt(0);
          if (cc >= 65 && cc <= 90) cc = 65 + ((cc - 52) % 26);
          else if (cc >= 97 && cc <= 122) cc = 97 + ((cc - 84) % 26);
          else if (cc >= 48 && cc <= 57) cc = 48 + ((cc - 43) % 10); //rot5 for numerals
          return String.fromCharCode(cc);
      });
    }
    return newString;
}
})(jQuery);

$(document).ready(function (){
  if (jQuery.browser.msie && (jQuery.browser.version < 7)) {
   $('body').addClass('ie6');
  }
  
  $('a.email').each(function(){
    var newMail = $.rot13($(this).attr('href').replace('mailto:', ''));
    $(this).attr('href', 'mailto:'+newMail);
  });
  $('span.email').each(function(){
    var newMail = $.rot13($(this).text());
    $(this).empty().append(newMail);
  });
  
});

