// Javascript Base-64 Decoding
//  for E-mail Address Hiding

// (c) 2004 Spamvortex
/// DO NOT REMOVE THIS MESSAGE, KEEP INTACT

var base64s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+=";

// encStr = Base64-String
// object to change .innerHTML to e-mail, usually <span> tag
// eText is visible part of link, set to '' for e-mail (after decoded)
function de(encStr, object, eText) {
  var bits;
  var decOut = '';
  var i = 0;
  
  for(i=0; i<encStr.length; i += 4){
    bits =
     ((base64s.indexOf(encStr.charAt(i))    & 0xff) <<18) |
     ((base64s.indexOf(encStr.charAt(i +1)) & 0xff) <<12) | 
     ((base64s.indexOf(encStr.charAt(i +2)) & 0xff) << 6) |
      (base64s.indexOf(encStr.charAt(i +3)) & 0xff);
    decOut += String.fromCharCode(
     (bits & 0xff0000) >>16, (bits & 0xff00) >>8, bits & 0xff);
   }
  if(encStr.charCodeAt(i -2) == 61)
    decOut = decOut.substring(0, decOut.length -2);
  else if(encStr.charCodeAt(i -1) == 61)
    decOut = decOut.substring(0, decOut.length -1);
  
  if (eText == "") eText = decOut;
  object.innerHTML = '<a href="mailto:' + decOut + '">' + eText + '</a>';
}
