
function resize()
{
 
 if (document.layers)
 {
  if (window.innerHeight > document.layers.page.clip.height)
  {
   window.innerHeight = document.layers.page.clip.height;
  }
  if (window.innerWidth > document.layers.page.clip.width)
  {
   window.innerWidth = document.layers.page.clip.width;
  }
 }
 else
 {
  if (document.all)
  {
   var obj = document.all.page;
   var newHeight = document.body.clientHeight;
   var newWidth = document.body.clientWidth;
  }
  else
  {
   var obj = document.getElementById("page");
   var newHeight = window.innerHeight;
   var newWidth = window.innerWidth;
  }
  var dHeight = 0;
  var dWidth = 0;
  if (newHeight > obj.offsetHeight)
  {
   dHeight = (obj.offsetHeight + obj.offsetTop) - newHeight;
  }
  if (newWidth > obj.offsetWidth)
  {
   dWidth = (obj.offsetWidth + obj.offsetLeft) - newWidth;
  }
  window.resizeBy(dWidth,dHeight);
 }
 if (document.all)
 {
  newHeight = document.body.clientHeight;
  newWidth = document.body.clientWidth;
 }
 else
 {
  var newHeight = window.outerHeight;
  var newWidth = window.outerWidth;
 }
// alert("screen:"+screen.availHeight+","+screen.availWidth+"\n"+"Window:"+newHeight+","+newWidth);
 var y = (screen.availHeight/2) - (newHeight/2);
 var x = (screen.availWidth/2) - (newWidth/2);
// alert(x+"\n"+y);
 window.moveTo(x,y);
 window.focus();

 
}
