/**
 * Decrypts encrypted mail links/addresses inside normal text.
 * 
 * @param encryptedMail
 *        The encrypted mail link/address.
 * @return
 *        The decrypted mail link/address.
 */
function decryptMail(encryptedMail)
{
  var mail = '';
  var char;
  
  // The encrypted mail address is URI decoded
  encryptedMail = decodeURIComponent(encryptedMail);
  for (var i = 0; i < encryptedMail.length; i++) {
    // Each character in the mail address is
    // ...converted to its decimal ASCII code
    char = encryptedMail.charCodeAt(i);
    // ...XORed with a "magic number"
    char ^= (31 - (i % 5));
    // ...converted to a character and appended to the final string
    char = String.fromCharCode(char);
    mail += char;
  }
  
  return mail;
}

