<!--//

// this script will set the title attribute for links that point to non-government webservers
// it will also set target="_blank" to force a new window
// and it will insert the 'popping up in a new window' icon, at no additional charge. 

if (document.getElementById) {

// does this page have #main or #mainNoNav?

	if (document.getElementById('main') == null) {
		var AllLinks = document.getElementById('mainNoNav').getElementsByTagName('A');
		// window.alert("yes you can test the null condition, duh!");
	}
		else {
			var AllLinks = document.getElementById('main').getElementsByTagName('A');
	}
	// var AllLinks = document.getElementsByTagName("A");
	var numAllLinks = AllLinks.length;

		if (numAllLinks > 0) {
	
			for (i=0; i < numAllLinks; i++) {
	
			// pictureName is how we build the popup image node for insertion as a child of the relevant link. 
			var pictureName =	new Array();
				pictureName[i] = document.createElement("img");
				pictureName[i].setAttribute("src", "images/popup.gif");
				pictureName[i].setAttribute("alt", "this link opens in a new window");
			  pictureName[i].style.width = "16px";
			  pictureName[i].style.height = "14px";
				pictureName[i].style.padding = "0px";
				pictureName[i].style.margin = "0px";
	
			var LinkAddr = AllLinks[i].href;
	
	// testing: link isn't null, it's not an e-mail link, it doesn't point to a .gov or .mil address, and it's not 'localhost'
			if ((LinkAddr != "") && (LinkAddr.indexOf("&#064;")< 0) && (LinkAddr.indexOf("@")< 0) && ((LinkAddr.indexOf(".gov")< 0) && (LinkAddr.indexOf(".mil")< 0) && (LinkAddr.indexOf("localhost")< 0))) {
	//			if ((LinkAddr.indexOf(".gov") < 0) && (LinkAddr.indexOf(".mil")< 0) && (LinkAddr.indexOf("localhost")< 0) || (LinkAddr.indexOf(".gov.") > 0)) {
					AllLinks[i].title = "This link opens a non-government website in a new window.";
					AllLinks[i].target = "_blank";
					AllLinks[i].appendChild(pictureName[i]);
			}

		}

	}

}

//-->