// This is a javascript file to make links with the class 'popup' open new browser windows.
// It also adds the new browser window message.
// If javascript is disabled, the link acts normally and the message disappears.
var detailsArr = new Array();
detailsArr[0] = Array("","scrollbars=yes,menubar=yes,resizable=yes");

function setDetails(name, attr){
	var alreadySet = false;
	for(var i=0; i<detailsArr.length;i++){
		if(detailsArr[i][0] == name){
			alreadySet = true;
			detailsArr[i] = Array(name, attr);
			break;
		}
	}
	if(!alreadySet){
		detailsArr.push(Array(name, attr));
	}
}
function popUp(winURL, name){
	var details = detailsArr[0][1];
	for(var i=0; i<detailsArr.length;i++){
		if(detailsArr[i][0] == name){
			details = detailsArr[i][1];
		}
	}
	window.open(winURL, name, details);
}
function doPopups() {
  if (!document.getElementsByTagName) return false;
  var links=document.getElementsByTagName("a");
 var text = ""	// For no message comment this out.
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("popup")) {
	  var browseText = document.createTextNode(text); 		// For no message comment this out.
	  insertAfter(browseText, links[i]);					// For no message comment this out.
      links[i].onclick=function() {
		var name = "";
		if(this.getAttribute("name") != undefined){
			name = this.getAttribute("name");
		}
        popUp(this.getAttribute("href"), name);
        return false;
      }
    }
  }
}
addLoadEvent(doPopups);