
	function popupWin(url, winname, attribs)
	{
		var popupWin = null;
		
		popupWin = window.open(url, winname, attribs);
	}
	
	function popupWindows(pageName)
	{
		if(!document.getElementsByTagName)
		{
			return;
		}
		
		var scrW = screen.availWidth;
		var scrH = screen.availHeight;
		if (pageName == 'schedule')
		{
			var anchors = document.getElementById("pop_icons").getElementsByTagName("a");
		}
		else if (pageName == 'lounge')
		{
			var anchors = document.getElementsByTagName("area");
		}
		else if (pageName == 'fears')
		{
			var anchors = document.getElementById("pop_links").getElementsByTagName("a");
		}
		else if (pageName == 'pcd')
		{
			var anchors = document.getElementById("pop_links").getElementsByTagName("a");
		}
    	
		for (var i = 0; i < anchors.length; i++)
		{
			var anchor = anchors[i];
			var linkDest = anchor.getAttribute("href");
			var relIndex = anchor.getAttribute("rel");
			var relSplit = relIndex.split("|");
			var windowAttributes = "";
			
			if(relSplit[0] == "popup")
			{
				if (relSplit[1] > scrW)
				{
					pW = scrW - 10;
				}
				else
				{
					pW = relSplit[1];
				}
				
				if (relSplit[2] > scrH)
				{
					pH = scrH - 40;
				}
				else
				{
					pH = relSplit[2];
				}
				
				scrX = (scrW - pW - 10) * .5;
              	scrY = (scrH - pH - 30) * .5;
              	
              	var windowAttributes = "width=" + pW + ",height=" + pH + ",left=" + scrX + ",top=" + scrY + ",screenX=" + scrX + ",screenY=" + scrY;
              	windowAttributes += ",location=" + relSplit[3] + ",resizable=" + relSplit[4] + ",menubar=" + relSplit[5] + ",scrollbars=" + relSplit[6] + ",status=" + relSplit[7];
              	
              	anchor.setAttribute("href", "javascript:popupWin('" + linkDest + "','" + relSplit[8] + "','" + windowAttributes + "')");
              	
              	/*if (navigator.userAgent.indexOf("MSIE") >= 0)
				{
					anchor.href = "javascript:popupWin('" + linkDest + "','" + relSplit[8] + "','" + windowAttributes + "')";
					//anchor.href = "javascript:popupWin('" + linkDest + "','" + relSplit[8] + "','')";
				}
				else
				{
					anchor.setAttribute("href", "javascript:popupWin('" + linkDest + "','" + relSplit[8] + "','" + windowAttributes + "')");
				}*/
			}
		}
	}