function CenteredPopup(URL, name, width, height)
  {
  var myWidth, myHeight;
  var myOrgX, myOrgY;

  // My width
  if (window.innerWidth)
    myWidth=window.innerWidth;
  else if (document.documentElement && document.documentElement.clientWidth)
    myWidth=document.documentElement.clientWidth;
  else if (document.body)
    myWidth=document.body.clientWidth;

  // My height
  if (window.innerHeight)
    myHeight=window.innerHeight;
  else if (document.documentElement && document.documentElement.clientHeight)
    myHeight=document.documentElement.clientHeight;
  else if (document.body)
    myHeight=document.body.clientHeight;

  // My origin
  if (window.innerHeight) 
    {
    myOrgX=screenX+(window.outerWidth-window.innerWidth)/2;
    myOrgY=screenY+(window.outerHeight-window.innerHeight)/2;
    }
  else 
    {
    myOrgX=screenLeft;
    myOrgY=screenTop;  
    }

  var X = myOrgX + ((myWidth/2) - (width/2));
  var Y = myOrgY + ((myHeight/2) - (height/2));

  var features='"scrollbars=1, '+'width='+width+', '+'height='+height+', '+'top='+parseInt(Y)+', '+'left='+parseInt(X)+'"';

  var popup = window.open(URL, name, features);
  if (window.focus) popup.focus();
  }

