// Functions that occur when the body of the page loads.
function init() {
	externalLinks();
}

// Standards-compliant replacement for target="_blank".
function externalLinks() {
	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.target = "_blank"; 
     }
}

function toggleDisplay(tag) {
	// Check that the element actually exists, to avoid a JavaScript error if it doesn't.
	if (document.getElementById(tag)) {
		// If it's hidden, show it. Otherwise it's not hidden, so hide it.
		if (document.getElementById(tag).style.display == "block") {
			document.getElementById(tag).style.display = "none";
		} else {
			document.getElementById(tag).style.display = "block";
		}
	}
}