
	var popupwin = null;

	function popUpWin( winName, winWidth, winHeight, winProperties, urlPath )
	{
		var name = winName; 	// popup name
		var width = winWidth; 	// popup width
		var height = winHeight; // popup height
		var left = (screen.width - width) / 2 ;
		var top = (screen.height - height) / 2;

		var windowproperties = "";
		if (winProperties == "")
			windowproperties = "width="+ width +",height="+ height +",left="+ left +",top="+ top + ",scrollbars=1,resizable=no,toolbar=no,status=yes";
		else
			windowproperties = "width="+ width +",height="+ height +",left="+ left +",top="+ top + "," + winProperties;

		popupwin = window.open(urlPath, name, windowproperties);
	    
	    if ( (document.window != null) && (!popupwin.opener) ) 
	    	popupwin.opener = document.window;
	}
    	
    if (!document.all)
    {
     	document.captureEvents (Event.CLICK);
    }
    
    document.onclick = function() 
    {
	    if (popupwin != null && !popupwin.closed) 
     	{
        		popupwin.focus();
     	}
    }
    
