setting pop up div at the center of the screen
<p>i am creating a pop-up div</p>

<p>its size is 521px, and height 400px</p>

<p>now i want to set it get displayed at the center of the screen or browser window irrespective of the size of the browser window..</p>

<p>heres my javascripe code...</p>

<pre><code>&lt;script type="text/javascript"&gt;
function show_update_profile()
   {
       document.getElementById('black_fade').style.display='block';
       var dw = document.getElementById('div_register').style.width;
       alert(dw);
       document.getElementById('div_register').style.left= ((window.innerWidth)-dw)/2;
   }
&lt;/script&gt;
</code></pre>

<p>the line <code>alert(dw);</code> displays the div width....but the line after thaT ISNT WORKING...pls help me in this matter...</p>
