function popFolder(){
  var e = document.getElementById('wrapper');
  if (e){
    var a=e.getElementsByTagName('a');
    for (var i=0;i<a.length;i++){
    if (a[i].getAttribute('href') != null && a[i].getAttribute('href').toUpperCase().indexOf("LEARN") >= 0){
        a[i].className=a[i].className?' popup':'popup';
        a[i].title=' (opens in new window)';
        a[i].onclick=function(){newWin=window.open(this.href,'Win','menubar=no,status=yes,toolbar=no,scrollbars=yes,resizable=yes,width=500,height=475');if(window.focus){newWin.focus()} return false;}
      }
    }
  }
}

function popAppPdf(){
var zA=document.getElementsByTagName("a");
	for (var i=0;i<zA.length;i++){
	// if the type value contains "application/pdf" or if the href value contains "PDF" or if the file is in a "PDF" folder then we have a winner
		if (zA[i].getAttribute("href") != null && (zA[i].getAttribute("type") == "application/pdf" || zA[i].getAttribute("href").toUpperCase().indexOf(".PDF") >= 0 || zA[i].getAttribute("href").toUpperCase().indexOf("PDF/") >= 0)){
		zA[i].title=" (opens in new window)";
		zA[i].className=zA[i].className?" pdfFile":"pdfFile";
		// This spawns multiple windows, but works fine with popup blockers
		//zA[i].target="_blank";
		// This opens a unique window and brings it in front of the opener each time the user clicks on the link
		// Note that the new window opens without a toolbar. This is to avoid further conusion for the visitor 
		zA[i].onclick=function() {newWin=window.open(this.href,"Win","toolbar=no");if( window.focus){newWin.focus()} return false;}
		}
	}
}

function TJKpop(){ // v1.0 | www.TJKDesign.com
	var e = document.getElementById('content');
	if (e){
		var a=e.getElementsByTagName('a');
		for (var i=0;i<a.length;i++){
			if (a[i].getAttribute('href') != null && a[i].getAttribute('href').indexOf("://") >= 0 && a[i].getAttribute('href').toLowerCase().indexOf(document.domain.toLowerCase()) == -1){
					a[i].className=a[i].className?' outlink':'outlink';
					a[i].title=' (opens in new window)';
//					a[i].target='_blank';  //	spawns multiple windows, but works fine with popup blockers
					a[i].onclick=function(){newWin=window.open(this.href,'TJKWin');if(window.focus){newWin.focus()} return false;}
//	ONKEYPRESS
//					a[i].onkeypress=function(){newWin=window.open(this.href,'TJKWin');if(window.focus){newWin.focus()} return false;}
			}
		}
	}
}
// From Simon Willison's Weblog
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
addLoadEvent(function() {if(document.getElementById) popFolder();});
addLoadEvent(function(){if(document.getElementById) TJKpop();});
addLoadEvent(function() {if(document.getElementById) popAppPdf();});