/*
2005-09-26:
  - replace all -dot-'s instead of just one (mv)
2005-07-06:
  - created (mv)
*/

if (document.getElementsByTagName)
{
  links = document.getElementsByTagName('a');
  for (i in links)
  {
    oLink = links[i];
    if (oLink && oLink.className && oLink.className.indexOf('mailto-') == 0)
    {
      // todo: allow for other classes in classname
    
      href = oLink.className;
      href = href.replace('mailto-', 'mailto:');
      href = href.replace('-at-', '@');
      href = href.replace(/\-dot\-/g, '.');
      oLink.href = href;
      
      if (oLink.firstChild && oLink.firstChild.nodeValue && oLink.firstChild.nodeValue.match(/.* at .* dot .*/))
      {
        oLink.firstChild.nodeValue = oLink.firstChild.nodeValue.replace(' at ', '@').replace(/ dot /g, '.');
      }
    }
  }
}