// pre:
// - requires prototype.js

// displayEmail()
// Inserts the email address into document to prevent spam bots from grabbing it
// Inserts into all spans with class="email"
// pre:
// - requires prototype.js
function displayEmail()
{
  var spans = $$('span.email');
  
  // meaningless variable names used on purpose
  var a = 'ben';
  var b = 'farhner' + String.fromCharCode(46) + 'com';
  var c = a + String.fromCharCode(64) + b;
  
  // loop over each span and add the email link
  spans.each(function (span, i)
  {
    // create the link
    var anchor = new Element('a',
                             {'href': 'mailto' + String.fromCharCode(58) + c});
    
    // stick the link in the span
    span.update(anchor.update(c));
  });
}

// load email on page load
document.observe('dom:loaded', displayEmail);
