// dropdown select location change

function selsub(Url) {
  Url=document.subsites.sites[document.subsites.sites.selectedIndex].value;
  document.location = Url;
}

function openExternalLink(href, target) {
  var newwin = window.open('/util/exit-notice.shtml?url=' + encodeURIComponent(href) + '&target=' + encodeURIComponent(target),'openlink','width=480,height=300,screenX=100,screenY=100,top=100,left=100,resizable=yes,toolbar=no,scrollbars=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;
            }

    }
  }
}

function excludeUrl(url){
  var excludeUrls = Array(
              'http://cws.huginonline.com',
              'http://dominoext.novartis.com',
              'http://download.macromedia.com',
              'http://search.novartis.com',
'http://www.novartisoncology.nl',
'http://www.tobi.nl',
 'http://www.novartis.nl',
 'http://www.novartiscardiovasculair.nl',
'http://www.novartispharma.nl/registrar.php'
              
              );

  for(var l = 0; l < excludeUrls.length; l++){
    if(url.indexOf(excludeUrls[l]) == 0){
      return true;
    }
  }

  return false;
}


