var newWindow;
function popup(page,nom,xw,xh) {
	var tools = 'width='+xw+',height='+xh+',top='+((window.screen.height-xh)/2)+',left='+((window.screen.width-xw)/2)+',toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No';
	newWindow = window.open(page, nom, tools);
	if (!newWindow) {
		newWindow.focus();
	}
}
function windowWidth()
{
  if(navigator.userAgent.indexOf("MSIE") != -1)
  {
    return document.body.clientWidth;
  } else {
    return window.innerWidth;
  }
}

function windowHeight()
{
  if(navigator.userAgent.indexOf("MSIE") != -1)
  {
    return document.body.clientHeight;
  } else {
    return window.innerHeight;
  }
}
function format_window(FormWidth, FormHeight)
{
  window.resizeBy(FormWidth - windowWidth(), FormHeight - windowHeight());
  x = (screen.width - windowWidth()) / 2;
  y = (screen.height - windowHeight()) / 2;
  window.moveTo(x,y);
}
