function getReport( sURL, sName, iWidth, iHeight, sParamList )
{
   var sVirDir = getVirDir();

   // Determine if the URL parameter was passed in with an initial "/"
   var sModURL;
   sModURL = ( sURL.indexOf( "/", 00 ) == 00 ) ? sURL.substr( 01 ) : sURL;

   // Open window and give focus to the window
   OpenWin( sVirDir + "/Reports/" + sModURL, sName, iWidth, iHeight, sParamList );
}

function getVirDir()
{
   // Get the path name of the current requested file
   var sPathName = location.pathname;
   
   // Determine the position of the second 
	var iPos = sPathName.indexOf( "/", 01 );
	
	// Extract the virtual directory
	// Example: /DMSTAT
	var sVirDir = sPathName.substr( 00, iPos );
	
	return sVirDir;
}

function OpenWin( sURL, sName, iWidth, iHeight, sParamList )
{
   // Declare top, left coordinates of window
   var iLeft = 00;
   var iTop = 00;
   
   // Declare window object
   var oWin;

   // Declare browser agent and major version number
   var sAgent = navigator.userAgent.toLowerCase();
   var iMajor = parseInt( navigator.appVersion );
   
   // Declare flag to determine if browser is Netscape
   // Note: Opera and WebTV spoof Navigator.  This performs strict client 
   // detection.  If you want to allow spoofing, take out the tests for 
   // opera and webtv.
   var lNS  = ( ( sAgent.indexOf( 'mozilla') != -1 ) && 
                ( sAgent.indexOf( 'spoofer') == -1 ) &&
                ( sAgent.indexOf( 'compatible') == -1 ) &&
                ( sAgent.indexOf( 'opera' ) == -1 ) &&
                ( sAgent.indexOf( 'webtv' ) == -1 ) &&
                ( sAgent.indexOf( 'hotjava' ) == -1 ) );

   // Declare flag to determine if browser is Netscape, version 4.0 or greater
   var lNS4Plus = ( lNS && ( iMajor >= 4 ) );

   // Declare flag to determine if browser is Internet Explorer
   var lIE = ( ( sAgent.indexOf( "msie" ) != -1 ) &&
               ( sAgent.indexOf( "opera" ) == -1 ) );

   // Declare flag to determine if browser is Internet Explorer, version 4.0 or greater
   var lIE4Plus = ( lIE && ( iMajor >= 4 ) );

   // Declare default parameter list
   if ( typeof( sParamList ) == "undefined" || sParamList == "" )
   {
      sParamList = "toolbar=no,location=no,directories=no,status=yes," +
                   "menubar=yes,scrollbars=yes,resizable=yes," +
                   "copyhistory=no,"
   }
           
   // Determine width and height of window Determine left, top position to center window
   if ( lIE4Plus || lNS4Plus )
   {
      if( iWidth > screen.availWidth )
      {
         iWidth = screen.availWidth;
      }

      if( iHeight > screen.availHeight )
      {
         iHeight = screen.availHeight;
      }

      iLeft = parseInt( ( screen.availWidth - iWidth ) / 02 );
      iTop = parseInt( ( screen.availHeight - iHeight ) / 02 );
   }

   // Declare optional parameter list
   if ( lIE4Plus )
   {
      sParamList = "width=" + iWidth + ",height=" + iHeight + 
                   ",left=" + iLeft + ",top=" + iTop + "," + sParamList;
   }
   else if ( lNS4Plus )
   {
      sParamList = "width=" + iWidth + ",height=" + iHeight + 
                   ",screenX=" + iLeft + ",screenY=" + iTop + "," + sParamList;
   }
   else
   {
      sParamList = "width=" + iWidth + ",height=" + iHeight + "," + sParamList;
   }

   // Open window and give focus to the window
   oWin = window.open( sURL, sName, sParamList );
   oWin.focus();
}
