
function windowLinks(url_base, hover_message) {
  if(!document.getElementsByTagName) {
    return;
  }
  
  var anchors = document.getElementsByTagName("a");
  for (var i = 0; i < anchors.length; i++) {
    anchor = anchors[i];
    str_anchor = new String(anchors[i]);
    //alert(anchor);
    if(!(anchor == "")){  //Check if empty
      var ext_check = str_anchor.search(url_base);
      //alert(url_base);
      if ( ext_check == -1 ) {
        var ext_check = str_anchor.search('javascript');
      }else{
        var ext_check_pdf = str_anchor.search('.pdf');
      }
      /*if (  ext_check_pdf > 1) {
        alert(anchor+' \n test'+ext_check_pdf);
      }*/
      if ( ext_check == -1 || ext_check_pdf > 1) {
        //alert(anchor+' \n test'+ext_check);
        anchor.target = "_blank";       // set it's 'target' attribute to '_blank'
        anchor.className = anchor.className + " external";    // attach a CSS class to it to allow us to style it
        anchor.title = hover_message + ": " + anchor.href;  // Add a new title attribute to warn the users of a new window
      }
    }
  }
} 

