title: Positioning pop up windows on screen: how to make them not overlay?
body: <p>I use such script to open pop-ups :</p>
  <pre><code>&lt;script&gt;
  var wins = [];
  openWin = function(name, width, height, left, top){
      left=left+1;
      top=top+1;
      var file='./'+name+'.flv?action=read';
      var settings='width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top+'';
       wins.push(window.open(file, name, settings));
           
             for (var i = 0; i &lt; wins.length; ++i)
              wins[i].focus();
  
  }
  &lt;/script&gt;
  </code></pre>
  <p>This is only function I use to open pop-ups, but I'd love to get rid of <code>left, top</code> params to make them more automated... for them to calculate themselves based on number of previously opened windows and <code>screen.width</code> and <code>screen.height</code>. So generally I want to achieve some kind of grid of pop-ups.</p>
  <p>My main problem - I do not see how to change horizontal rows with JS knowing that height and width may vary.</p>
  <p>How to do such thing?</p>