/* ------------------------------------------------
-- EXTERNAL LINK POPUP WINDOWS
------------------------------------------------ */

function prepareLinks() {
	if (!document.getElementsByTagName) return false;
	var links = document.getElementsByTagName("a");
	for (var i=0; i<links.length; i++) {
		// if an anchor in the array contains the attribute "rel" with the value "external"
		if (links[i].getAttribute("rel") == "external") {
			links[i].onclick = function() {
				// apply the popUp function to this anchor and get the href attribute
				popUp(this.getAttribute("href"));
				return false;
			}
		}
	}
}
		
// popUp function used by prepareLinks
function popUp(winURL) {
	window.open(winURL,"popup","width=800, height=570");
}

addLoadEvent(prepareLinks); //requires the addLoadEvent function