  var pop = null;

  function popdown() {
      if (pop && !pop.closed) pop.close();
  }


  function popup(obj,w,h) {

      var ns4up = (document.layers) ? 1 : 0
      var ie4up = (document.all) ? 1 : 0
      var xsize = screen.availWidth
      var ysize = screen.availHeight
      // var b0=xsize/2, h0=ysize/2, x0=(xsize-b0), y0=0
      var b0=xsize/2, h0=ysize, x0=(xsize-b0), y0=0

      var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
      if (!url) return true;
      // w = (w) ? w += 20 : 150;  // 150px*150px is the default size
      // h = (h) ? h += 25 : 150;
      // var args = 'width='+b0+',height='+h0+',screenX='+x0+',screenY='+y0+',top='+y0+',left='+x0+',resizable,scrollbars';
      var args = 'width='+w+',height='+h+',screenX='+x0+',screenY='+y0+',top='+y0+',left='+0+', resizable=no,scrollbars=no';
      // var args = 'width='+w+',height='+h+',resizable';
      popdown();
      pop = window.open(url,'',args);
      return (pop) ? false : true;
  }

  function popup_scrollbars(obj,w,h) {

      var ns4up = (document.layers) ? 1 : 0
      var ie4up = (document.all) ? 1 : 0
      var xsize = screen.availWidth
      var ysize = screen.availHeight
      // var b0=xsize/2, h0=ysize/2, x0=(xsize-b0), y0=0
      var b0=xsize/2, h0=ysize, x0=(xsize-b0), y0=0

      var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
      if (!url) return true;
      // w = (w) ? w += 20 : 150;  // 150px*150px is the default size
      // h = (h) ? h += 25 : 150;
      // var args = 'width='+b0+',height='+h0+',screenX='+x0+',screenY='+y0+',top='+y0+',left='+x0+',resizable,scrollbars';
      var args = 'width='+w+',height='+h+',screenX='+x0+',screenY='+y0+',top='+y0+',left='+0+', resizable=no,scrollbars=yes';
      // var args = 'width='+w+',height='+h+',resizable';
      popdown();
      pop = window.open(url,'',args);
      return (pop) ? false : true;
  }

  window.onunload = popdown;
  window.onfocus = popdown;
