function openExternalLink(href, target) {

  var newwin = window.open('/Popup/ch/exit-question_de.htm?url=' + encodeURIComponent(href) + '&target=' + encodeURIComponent(target),'openlink','width=400,height=220,screenX=350,screenY=250,top=250,left=350,resizable=yes,toolbar=no,scrollbars=no,location=no')

  newwin.focus();

}


function setupExternalLinks() {
  var links = document.getElementsByTagName('a');
  for (var i = links.length; i != 0; i--) {
    var a = links[i-1];
    if (!a.href) continue;

    if (a.href.indexOf('http') != -1 &&
            a.href.indexOf(window.location.hostname) == -1 &&
            !excludeUrl(a.href)) {
                a.onclick = function() {
                openExternalLink(this.href, this.target);
                return false;
            }
    }
  }
}


var excludeUrls = Array();

function excludeUrl(url){
  re = /www./gi;
  for(var l = 0; l < excludeUrls.length; l++){
    if(url.indexOf(excludeUrls[l]) == 0 || url.indexOf(excludeUrls[l].replace(re, "")) == 0){
      return true;
    }
  }
  return false;
}

var excludeUrls = Array(
'http://www.e-mepha.ch/',
'http://www.mepha.com/',
'http://www.mepha.pt/',
'http://www.mepha-champion.ch/',
'http://www.mepha-online-praxis.ch/',
'http://www.mepha-treasure.ch/',
'http://events.mepha.ch/',
'http://mepha-panter.ch/',
'http://www.cephalon.com/'
);