var win02 = null;

function closePop() {
  if (win02!=null && !win02.closed) win02.close();
}

function pop(mypage, myname, w, h, status, toolbar, menubar, scrollbars, resizable) {
  var options="";
  options+=",width="+w;
  options+=",height="+h;
  winl=(screen.width-w)/2;
  if (winl<25) winl=0;
  wint=(screen.availHeight -h)/2;
  if (wint<50) wint=0;
  options+=",left="+winl;
  options+=",top="+wint;

  status = String(status).toLowerCase();
  if (status=="no") status=0;
  if (status=="yes") status=1;
  options+=",status="+status;

  toolbar = String(toolbar).toLowerCase();
  if (toolbar=="no") toolbar=0;
  if (toolbar=="yes") toolbar=1;
  options+=",toolbar="+toolbar;

  menubar = String(menubar).toLowerCase();
  if (menubar=="no") menubar=0;
  if (menubar=="yes") menubar=1;
  options+=",menubar="+menubar;

  scrollbars = String(scrollbars).toLowerCase();
  if (scrollbars=="no") scrollbars=0;
  if (scrollbars=="yes" || scrollbars=="auto") scrollbars=1;
  options+=",scrollbars="+scrollbars;

  resizable = String(resizable).toLowerCase();
  if (resizable=="no") resizable=0;
  if (resizable=="yes") resizable=1;
  options+=",resizable="+resizable;

  closePop();

  win02 = window.open(mypage, myname, options);
}
