/*
	creates a pop up window fro any link in the class popUp.
	if there is a class name of the form xNNN-yNNN where NNN
	are the dimentions of the popup in pixels the window will 
	use the given dimentions. Otherewise the window will be 
	500*250 

*/

addEvent(window, "load", doPopups);

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].onclick = function() {
      	var windowWidth=this.className.match(/x([0-9]+)/);
    	var windowHeight=this.className.match(/y([0-9]+)/);
    	if (!windowWidth) 
    		{
    			xWidth=500;
    		}
    		else
    		{
    			xWidth=windowWidth[1];
    		}
    	if (!windowHeight) 
    		{
    			yHeight=250;
    		}
    		else
    		{
    			yHeight=windowHeight[1];
    		}
    	
      	var properties="location=0,status=1,scrollbars=1,width="+xWidth+",height="+yHeight;
        window.open(this.href, "", properties);
        return false;
      }
      }
    }
  }