function getWindowSize()
{
  if (self.innerHeight)
  {
    winW = self.innerWidth;
    winH = self.innerHeight;
  }
  else if (document.documentElement && document.documentElement.clientHeight)
  {
    // subtract scrollbar widths for IE
    winW = document.documentElement.clientWidth;
    winH = document.documentElement.clientHeight;
  }
  else if (document.body)
  {
    winW = document.body.clientWidth;
    winH = document.body.clientHeight;
  }
  
  var output = new Object();
  output.winW = winW;
  output.winH = winH;
  
  return output;
}


function popupWindow(URL, popupW, popupH)
{
  //alert("popup:"+url);
  
  winW = getWindowSize().winW;
  winH = getWindowSize().winH;

  popupLeft = winW/2 - popupW/2;
  popupTop = winH/2 - popupH/2;

  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width="+popupW+",height="+popupH+",left="+popupLeft+",top="+popupTop+"');");
}


function popUp(URL, w, h)
{
  day = new Date();
  id = day.getTime();
  t = (screen.height/2)-(h/2);
  l = (screen.width/2)-(w/2);
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,top="+t+",left="+l+",width="+w+",height="+h+"');");
}

