function openWindow(){
  var newWindow = window.open(this.getAttribute('href'));
  newWindow.focus();
  return false; 
}
   
var aTags = document.getElementsByTagName('a');

for(i=0;i<aTags.length;i++){
  if(aTags[i].className == "aExternal"){
    link = aTags[i];
    link.onclick=openWindow;
  }
}
