Event.observe(window,'load',externalLinks);

// Detect Monitor Resolution and Open Popup Win To Scale In Center of Screen
function scaleWin(url,winName){
	
	screenwidth = 750;
	screenheight = 720;	
		
	// Calculate Horizontal Postion of Window
	hPos = (screen.width/2) - (screenwidth/2);
	theWin = window.open(url, winName, "width=" + screenwidth + ", height=" + screenheight + ",scrollbars=yes,resizable=yes");
	theWin.moveTo(hPos,0);
}


function externalLinks() {
  if (document.getElementsByTagName) {
    var links = document.getElementsByTagName("a");
    for (var i=0; i < links.length; i++) {
      if (links[i].className.match("popup")) {
        links[i].onclick = function() {
		  scaleWin(this.getAttribute("href"),'newwin');
          return false;
        };
      }
    }
  }
}
