// toggle these window options from yes to know to see how they affect
var opts = 'toolbar=no'+
           ',scrollbars=yes'+
           ',location=no'+
           ',statusbar=no'+
           ',status=no'+
           ',menubar=no'+
           ',resizable=yes'+
           ',directories=no';

function newWin (url, name, width, height) {
  // use default window width unless it is too small
  if (width > 100) opts += ',width=' + width;
  // use default window height unless it is too small
  if (height > 100) opts += ',height=' + height;
  var w = window.open(url, name, opts);
  // bring the window up if it's behind others
  w.focus();
  // return reference to the window object to caller
  return w;
}

