if (document.getElementsByTagName && document.createElement) {

  window.onload = function() {
    var links = document.getElementsByTagName('a');
    for (var i=0; i<links.length; i++) {
      if (links[i].protocol.indexOf('http') > -1 && links[i].hostname.indexOf('dreamhost.com') > -1) {
      	
      	// track clicks
        links[i].onclick = function() {window.location = 'http://www.dreamhost-promo-code.com/track/?url='+escape(this.href)+'&location='+escape(location.href); return false;}
        
        /*
        // skjuler ikke links hvis ikke linket bliver blurred - giver problemer hvis der trykkes flere gange på linket
        // 19-09-2007: CTR = 1013/6245 = 16,22%
        links[i].oncontextmenu = function() {
        	if (this.href.indexOf('track') == -1) {
        		// window.location = 'http://www.promo-code.net/track/?url='+escape(this.href)+'&location='+escape(location.href)+'&action=righclick'; return false;
        		tmpurl = this.href;
        		this.href = 'http://www.promo-code.net/track/?url='+escape(this.href)+'&location='+escape(location.href)+'&action=righclick';
        		// this.id = 'last';
        		// setTimeout('reset()', 1000);
        	}
        }

        
        links[i].onblur = function() {
            if (typeof tmpurl != 'undefined') {
                this.href = tmpurl;
                delete tmpurl;
            }
        }
        */
      }
    }    
  }
}