/*GENERIC FUNCTIONS*/

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

/*SITE SPECIFIC*/

//Makes link elements with class 'popup' 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].onclick = function() {
        window.open(this.getAttribute("href"));
        return false;
      }
    }
  }
}
addLoadEvent(doPopups);