
var win = null;
var last_w   = 450;
var last_h   = 625;

//--------+
// - show popup window with width=w, height=h, and content=url
// - repeated calls will reuse the same window, resized if necessary
// - defaults to width=450, height=625
//--------+
function pop(url,w,h)
{
   // new window size
   var w_dft = 450; // default width
   var h_dft = 625; // default height
   w = w ? w : w_dft;
   h = h ? h : h_dft;

   var params = "scrollbars,resizable,width=" + w + ",height=" + h;

   if (!win || win.closed) {
      win = window.open(url,"popWin",params);
   } else {
      if (last_w != w || last_h != h) {
         win.resizeTo(w,h); 
      }
      win.location.href = url;
   }
   win.focus();

   // save new window size
   last_w = w;
   last_h = h;
}
