

function addLoadEvent(func)
{
  var oldonload = window.onload;
  if (typeof window.onload != 'function')
  {
    window.onload = func;
  }
  else
  {
    window.onload = function()
    {
      oldonload();
      func();
    }
  }
}

addLoadEvent(function()
{
        var emails = document.getElementsByClassName('span', 'Obfuscated');
       
        if (!emails) return;
       
        var title = '';
        var search = [' AT ', ' DOT '];
        var replace = ['@', '.'];
        var replaced_text = '';
       
        for (var i = 0; i < emails.length; i++)
        {
                /* get the text node
                 */
                var text = emails[i].childNodes[0];
               
                if (text)
                {
                        /* search & replace text
                         */
                        replaced_text = text.nodeValue;
                       
                        for (var j = 0; j < search.length; j++)
                        {
                                var reg_exp = new RegExp(search[j], 'g');
                                replaced_text = replaced_text.replace(reg_exp, replace[j]);
                        }
                       
                        /* create anchor node
                         */
                        var link = document.createElement('a');
                        link.setAttribute('title', title);
                        link.setAttribute('href', 'mailto:' + replaced_text);
                       
                        /* create new text node and append to anchor
                         */
                        var text_node = document.createTextNode(replaced_text);
                       
                        link.appendChild(text_node);
                       
                        /* swap in anchor for text
                         */
                        emails[i].replaceChild(link, emails[i].childNodes[0]);
                }
        }
});