window.onload = function() {



	// check to see that the browser supports the getElementsByTagName method

	// if not, exit the loop

	if (!document.getElementsByTagName) {

		return false;

	}

	// create an array of objects of each link in the document

	var popuplinks = document.getElementsByTagName("a");

	// loop through each of these links (anchor tags)

	for (var i=0; i < popuplinks.length; i++) {

		// if the link has a class of "popup"...

		if (popuplinks[i].className == "popup") {	 //className vs. getAttribute: className works in IE

			// add an onclick event on the fly to pass the href attribute

			// of the link to our second function, openPopUp



			popuplinks[i].onclick = function() {

				openPopUp(this.getAttribute("href"));

				return false;

			}

		}

	}

	// create an array of objects of each link in the document

	var popuplinks = document.getElementsByTagName("area");

	// loop through each of these links (anchor tags)

	for (var i=0; i < popuplinks.length; i++) {

		// if the link has a class of "popup"...

		if (popuplinks[i].className == "popupMap") {	 //className vs. getAttribute: className works in IE

			// add an onclick event on the fly to pass the href attribute

			// of the link to our second function, openPopUp



			popuplinks[i].onclick = function() {

				openPopUpMap(this.getAttribute("href"));

				return false;

			}

		}

	}



	// for new window links that aren't glossary (semantic/standards compliant solution)

	if (!document.getElementsByTagName) return;



	var anchors = document.getElementsByTagName("a");

	for (var i=0; i<anchors.length; i++) {

		var anchor = anchors[i];

		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") { // find all anchor tags with rel="external"

			anchor.target = "_blank";

			// replace with target="blank"

		}

	}



};

function openPopUp(linkURL) {

window.open(linkURL,'glossaryTerm','height=450,width=800,resizable=0,scrollbars=yes,top=0,left=0');

}

function openPopUpMap(linkURL) {

window.open(linkURL,'_blank','height=230,width=530,resizable=0,scrollbars=0,top=0,left=0');

}