// JavaScript Document

function open_index_popup() {
	var element = document.getElementById("priorities");
	
	if (element.style.display == "block") {
		element.style.display = "none";
	} else {
		element.style.display = "block";
	}
	
	return false;
}

function close_index_popup() {
	var element = document.getElementById("priorities");
	element.style.display = "none";
	return false;
}

function quickLinks() {
    var quick  = document.getElementById("quick");
    var newURL = quick.options[quick.selectedIndex].value;
    if (newURL) {
        window.open(newURL, "_self");
    }
}

function externalLinks() {
    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" || anchor.getAttribute("rel") == "pdf"){
            anchor.target = "_blank";
            anchor.title = "opens in a new window";
        }
    }
}

function initialise() {
    externalLinks();
}

window.onload=initialise;
