var popupBox = null;
function openWindow(urlJsp, pWidth, pHeight)
{
  var isNN = (navigator.appName.indexOf("Netscape")!=-1);
  var x=y=0;
  if (isNN)
  {
      x = screenX + innerWidth/2 - (pWidth/2);
      y = screenY + innerHeight/2 - (pHeight/2);
  }
  else if (!isNN)
  {
    if (parseInt(navigator.appVersion.charAt(22)) >= 5) 
    {
      x = window.screenLeft + document.body.clientWidth/2 - (pWidth/2);
      y = window.screenTop + document.body.clientHeight/2 - (pHeight/2);
    }
    else 
    {
      x = screen.width/2 - (pWidth/2);
      y = screen.height/2 - (pHeight/2);
    }
  }
  if (!popupBox || popupBox.closed)
  {
    popupBox = window.open (urlJsp,'','scrollbars=yes,resizable,width=' + pWidth + ',height=' + pHeight + ',left=' + x + ',top=' + y);
  }
  else
  {
    popupBox.focus();
  }
}

function openWindowToolbar(urlJsp, pWidth, pHeight)
{
  var isNN = (navigator.appName.indexOf("Netscape")!=-1);
  var x=y=0;
  if (isNN)
  {
      x = screenX + innerWidth/2 - (pWidth/2);
      y = screenY + innerHeight/2 - (pHeight/2);
  }
  else if (!isNN)
  {
    if (parseInt(navigator.appVersion.charAt(22)) >= 5) 
    {
      x = window.screenLeft + document.body.clientWidth/2 - (pWidth/2);
      y = window.screenTop + document.body.clientHeight/2 - (pHeight/2);
    }
    else 
    {
      x = screen.width/2 - (pWidth/2);
      y = screen.height/2 - (pHeight/2);
    }
  }
  if (!popupBox || popupBox.closed)
  {
    popupBox = window.open (urlJsp,'','scrollbars=yes,menubar,toolbar,resizable,width=' + pWidth + ',height=' + pHeight + ',left=' + x + ',top=' + y);
  }
  else
  {
    popupBox.focus();
  }
}

function openWindowTop(urlJsp, pWidth, pHeight)
{
  var isNN = (navigator.appName.indexOf("Netscape")!=-1);
  var x=y=0;
  if (isNN)
  {
      x = screenX + innerWidth/2 - (pWidth/2);
  }
  else if (!isNN)
  {
    if (parseInt(navigator.appVersion.charAt(22)) >= 5) 
    {
      x = window.screenLeft + document.body.clientWidth/2 - (pWidth/2);
    }
    else 
    {
      x = screen.width/2 - (pWidth/2);
    }
  }
  if (!popupBox || popupBox.closed)
  {
    popupBox = window.open (urlJsp,'','status,scrollbars=yes,resizable,width=' + pWidth + ',height=' + pHeight + ',left=' + x + ',top=0');
  }
  else
  {
    popupBox.close();
    popupBox = window.open (urlJsp,'','status,scrollbars=yes,resizable,width=' + pWidth + ',height=' + pHeight + ',left=' + x + ',top=0');
  }
}