function popupwindow(fileloc, winname, winwidth, winheight, winscroll, winmenu, wintool, winlocation, winsize, winstatus, winfull) {
  if(!winheight) {winheight=450}
  if(!winwidth) {winwidth=400}
  if(!winscroll) {winscroll=0}
  if(!winmenu) {winmenu=0}
  if(!wintool) {wintool=0}
  if(!winlocation) {winlocation=0}
  if(!winsize) {winsize=0}
  if(!winstatus) {winstatus=0}
  if(!winfull) {winfull=0}
  var leftstart  = (screen.width - winwidth) / 2
  var topstart  = (screen.height - winheight) / 2
  windowbits = "left=" + leftstart + ",top=" + topstart + ",height=" + winheight + ",width=" + winwidth + ",scrollbars=" + winscroll + ",menubar=" + winmenu + ",toolbar=" + wintool + ",location=" + winlocation + ",resizable=" + winsize + ",status=" + winstatus + ",fullscreen=" + winfull
  var newwindow = window.open(fileloc,winname,windowbits)
  newwindow.focus()
}
function growingpopup(fileloc, winname, resizewidth, resizeheight, winscroll, winmenu, wintool, winlocation, winsize, winstatus, winfull) {
  if(!resizeheight) {resizeheight=450}
  if(!resizewidth) {resizewidth=400}
  if(!winscroll) {winscroll=0}
  if(!winmenu) {winmenu=0}
  if(!wintool) {wintool=0}
  if(!winlocation) {winlocation=0}
  if(!winsize) {winsize=0}
  if(!winstatus) {winstatus=0}
  if(!winfull) {winfull=0}
  var windowbits = ",scrollbars=" + winscroll + ",menubar=" + winmenu + ",toolbar=" + wintool + ",location=" + winlocation + ",resizable=" + winsize + ",status=" + winstatus + ",fullscreen=" + winfull
  var vspeed = 15;  // vertical resize speed
  var hspeed  = 15;   // horizontal resize speed
  var leftstart  = (screen.width - resizewidth) / 2
  var topstart  = (screen.height - resizeheight) / 2
  if (document.all) {
    var newwindow = window.open("",winname,"left=" + leftstart + ",top=" + topstart + ",width=4,height=4" + windowbits,"focus();")
    for (currentheight = 1; currentheight < resizeheight; currentheight += vspeed) {
      newwindow.resizeTo("1", currentheight)
    }
    for (currentwidth = 1; currentwidth < resizewidth; currentwidth += hspeed) {
      newwindow.resizeTo(currentwidth, currentheight)
    }
    newwindow.resizeTo(resizewidth, resizeheight)
    newwindow.location = fileloc
  } else {
    var newwindow = window.open(fileloc,winname,"left=" + leftstart + ",top=" + topstart + ",width=" + resizewidth + ",height=" + resizeheight + ",scrollbars=no,resizable=no,toolbar=no,menubar=no,location=no,status=no","focus();")
  }
  newwindow.focus()
}
