// $Id: geo_filter.js,v 1.1.2.4 2010/05/18 05:36:12 jkenn99 Exp $
var Fresh = Fresh || {};
Fresh.email = Fresh.email || {};
Fresh.email.geo_filter = function(context) {
  
  $$('.schovka').each(function(item) { item.remove() });
  $$('a[href]').each(function(item) {
    if (item.readAttribute('processed') != 'processed') {
      var href = item.readAttribute("href");
      var address = href.replace(/.*contacts\/([a-z]+)\/([a-z0-9._%-]+)\/([a-z0-9._%-]+)/i,'$3' + '@' + '$2' + '.' + '$1');
      if (href != address)
      {
        item.writeAttribute('processed', 'processed');
        item.writeAttribute("href", 'mailto:' + address);
        item.writeAttribute("rel", 'nofollow');
      //  item.html($(this).html().replace(/([a-z0-9._%-]+)\[at\]([a-z0-9._%-]+)\[dot\]([a-z.]+)/i,'$1' + '@' + '$2' + '.' + '$3'));
      }
    }
  });

}

