// ************* NEW CODE TO LOAD A PDFs and FOREIGN LINKS IN ANOTHER WINDOW **************************
//Attach to Load event
window.attachEvent("onload", new Function("NewWin_OnLoad();")); 

//Change A Tags target attribute value to "_blank" when href ends in ".pdf" 
function NewWin_OnLoad()
{
try{
//Get all Tags named "A"
var aTags = document.getElementsByTagName("A");
//Look for "A" tags
for(var j=0;j< aTags.length;j++){
var aTag = aTags(j);

var thisDomain = window.location.hostname.toUpperCase( );
 
//if(aTag.getAttributeNode("href").value.toUpperCase( ).search(thisDomain) == -1) { 
//alert(aTag.getAttributeNode("href").value + ' ' +  aTag.getAttributeNode("href").value.search(thisDomain).toString());
//}

//alert(aTag.getAttributeNode("href").value.toUpperCase( ) + ' ' + aTag.getAttributeNode("href").value.toUpperCase( ).search("HTTP").toString())

if ( (aTag.getAttributeNode("href").value.search("\.pdf$","i") > -1) || ((aTag.getAttributeNode("href").value.toUpperCase( ).search(thisDomain) == -1) && (aTag.getAttributeNode("href").value.toUpperCase( ).search("HTTP") == 0) )     ) {
aTag.getAttributeNode("target").value="_blank";
}
}//end of for
}//try
catch(e){
//Do Nothing - if it doesn't work
}//end of try
}//end of function New Window 
// ************* END OF NEW CODE TO LOAD A PDFs and FOREIGN LINKS IN ANOTHER WINDOW ********************