//Allow you to add multiple events to the onload event handler - props to simon willison
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function screener() {
	if(!document.getElementById('panel')) return false;
	
	if (screen.height > 600) {
		var block = document.getElementById("panel");
		block.style.display = "block";
	}
} addLoadEvent(screener);

//Makes link elements with class 'popup' 'pdf' 'word' or 'ext' open in a new browser window
function doPopups() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("popup") || links[i].className.match("ext") || links[i].className.match("pdf") || links[i].className.match("word")) {
      links[i].onclick = function() {
        window.open(this.getAttribute("href"));
        return false;
      }
    }
  }
}
addLoadEvent(doPopups);