	var mwindow; // global variable to hold the window object created in the document.open function
	var popUpReturnVal // global variable to hold the return value from the window.showModalDialog;
	
	function OpenPopUpDialog( url, args, windowOptions )
	{
		popUpReturnVal = window.showModalDialog( '../common/popup.htm', new Array( url, args ), windowOptions ); 
	}
	function OpenPopUp( strPage, w, h )
		{
		   mwindow =  document.open (strPage,'popuppage', 'width=' + w + ',height=' + h + ',left=' + fLeftPos(w) + ',top=' + fTopPos(h) + ',status=no,toolbar=no,titlebar=no,dependent=yes,location=no,menu=no,scrollbars=no');	
		   mwindow.focus();	
		}	
		
	function OpenPage( strPage, w, h )
		{
			mwindow =  document.open (strPage,'page', 'width=' + w + ',height=' + h + ',left=' + fLeftPos(w) + ',top=' + fTopPos(h) + ',status=no,toolbar=no,titlebar=no,dependent=yes,location=no,menu=no,scrollbars=yes,resizable');		   
			mwindow.focus();	
		}			
		
	function fLeftPos( intWidth )
		{
			var intLeft;
			
			if (screen)
			    intLeft = ( screen.width - intWidth ) / 2;
			else
				intLeft = 100;    					
			return intLeft;	
		}
 
   function fTopPos( intHeight )
		{
			var intTop
			if (screen)
				intTop = ( screen.height - intHeight ) / 2;
			else
				intTop = 100;
			return intTop;	
					
		} 						