
//////////////////////////////////////////////////////////
// Author  : biase
// Website : http://www.biase.uni.cc/
// Download: http://www.biase.uni.cc/?mod=article&id=7
//////////////////////////////////////////////////////////
adf_id = 115159;
domains = [ 'adf.ly', 'twitter.com', 'facebook.com', 'tumblr.com', 'youtube.com', 'www2.clustrmaps.com', 'tunein.com', 'shoutcast.com', 'yourmuze.fm', 'webradiocentral.com', 'go.microsoft.com', 'radiodeck.com', 'musicgoal.com', 'apple.com', 'tm101radio.com', 'serverhostingcenter.com', 'player.radioloyalty.com', 'google.com', 'feeds.feedburner.com', 'socialmonkee.com', 'europe.nokia.com', 'indiehiphop.net', 'hiphopjunkiez.com', 'indiernb.net', 'relaxandtakenoteshiphop.com', 'latinrogers.com', 'feedburner.google.com', 'radiobunch.com', 'rapsearch.com', 'thugz-network.com',  'top100add.com', 'radiotopsites.com', 'internetradiotopsites.com',  'usa.ultimatetopsites.com',  'berm.co.nz', 'radiotoolbox.com',  'audiradio.com',  'netradiolist.com', 'internet-radio.org.uk', 'eepurl.com', ];

if (!Array.prototype.indexOf) {
  Array.prototype.indexOf = function(obj, start) {
       for (var i = (start || 0), j = this.length; i < j; i++) {
           if (this[i] === obj) { return i; }
       }
       return -1;
  }
}


window.onload = function() {
  a = document.getElementsByTagName('a');
  for (i = 0; i < a.length; i++) {
    if (typeof(a[i].onclick) != 'function' && domains.indexOf(a[i].href.replace(/^http\:\/\/|www\./gi, '').split('/')[0]) == -1) {
      a[i].onclick = function() {
 	o = this.href;
        this.href = o.replace(/^http\:\/\//i, 'http://adf.ly/'+adf_id+'/');
          this.onmouseout = function() {
            this.href = o;
            this.onmouseout = function() { };
          }
        return true;
      }
      a[i].onmousedown = function(e) {
        rc = false;
        e = e || window.event;
        if (e.which) rc = (e.which == 3);
        else if (e.button) rc = (e.button == 2);
        if (rc) this.onclick();
      }
    }
  }
}
