Centering a Javascript pop-up window
<p>I want to center a pop-up window within a browser. However, I'd like it to work regardless of the browser size and the browsers position within the users screen. </p>

<p>Position within a browser is straightforward, for example (with jQuery) : </p>

<pre><code>var left = ($(window).width()/2)-(width/2);
..
uwin = window.open(...., left=...);
</code></pre>

<p>etc. But if the users browser is not full screen, then it positions relative to full screen rather than browser. </p>

<p>I can get screen using</p>

<pre><code>screen.width()
</code></pre>

<p>but that will just position on screen so that's no better. </p>

<p>Anyone ?</p>
