/*
    JavaScript file for containing the basic functionality for all pages and the window.onload function.
*/

var $id = function(id) {
	return document.getElementById(id);
}
var $tag = function(tag) {
    return document.getElementsByTagName(tag);
}

function newWindow(extURL) {
    window.open(extURL);
}
function externalLinks() {
    var links = $tag("a");
    for (i = 0; i < links.length; i++) {
        if (links[i].getAttribute("class") == "external") {
            links[i].onclick = function() {
                newWindow(this.getAttribute("href"));
                return false;
            }
        }
    }
}

window.onload = function() {
    externalLinks();
	if ($id("disable")) {
		$id("disable").onclick = noStyles;
	}
	//For scripts in timer.js
	if ($id("e404")) {
		$id("page").firstChild.nodeValue = window.location;
        countdown();
	}
}