//==============================================================================
// XHTML Compatability functions by www.squidfingers.com

onLoadFuncs = new Array();
function addOnLoad(func){
	onLoadFuncs[onLoadFuncs.length] = func;
}
function runOnLoad(){
	for(i in onLoadFuncs){
		eval(onLoadFuncs[i]+"()");
	}
}
window.onload = runOnLoad;

function handleExternalLinks() {
	var anchors = document.getElementsByTagName("a");
	var i, href;
	for(i=0; i < anchors.length; i++){
		if(!anchors[i].href) continue;
		href = anchors[i].href;
		if(href.indexOf("clients.jplprod.com") == -1 && href.indexOf("state.pa.us") == -1 && href.indexOf("dot.state.pa") == -1){ // Href is not a file on my server
			if(href.indexOf("javascript:") == -1){ // Href is not a javascript call
				if(!anchors[i].onclick){ // Href does not have an onclick event
					if(href.indexOf("mailto:") == -1){ // Href is not a mailto:
						if(href.indexOf("http://") != -1){ // Href is not relative (for Safari)
							anchors[i].setAttribute("target","_blank");
						}
					}
				}
			}
		}

		// redirect.asp has to open in a new browser window.
		if (href.indexOf(".pdf") > 0) anchors[i].setAttribute("target","_blank");

	}
}

if(document.getElementsByTagName){
	addOnLoad("handleExternalLinks");
}
//==============================================================================
// Popup Description Window
function openBrWindow(theURL) { //v2.0
  oPopWindow=window.open(theURL,'windowname','scrollbars=no,width=300,height=170');
  oPopWindow.focus()
}
