var xOffset, yOffset;
var toto;
function CenterWindow (width, height)
{
  if (screen.width && screen.height)
    var xMax = screen.width, yMax = screen.height;
  else
    if (window.outerWidth && window.outerHeight)
      var xMax = window.outerWidth, yMax = window.outerHeight;
    else
      var xMax = 640, yMax = 480;
      
  xOffset = (xMax - width)/2;
  yOffset = (yMax - height)/2;
  if (yOffset > 50) yOffset = yOffset - 30;
}

function CenterWindowAndOpen (url, winName, width, height, param)
{
  CenterWindow (width, height);
  popWin = window.open  (url, winName, 
                         "width=" + width + ",height=" + height + "," +
                         "screenX=" + xOffset + ",screenY=" + yOffset + "," +
                         "top=" + yOffset + ",left=" + xOffset + param);
  popWin.resizeTo (width, height);
  popWin.moveTo (xOffset, yOffset);
  popWin.focus ();
  return popWin;
}

function getHtmlPage(htmlPage, width, height)
{
CenterWindowAndOpen(htmlPage, 'htmlPage', width, height, ',toolbar=0,resizable=no,location=0,menubar=0,status=no');
}



