Window resizing problem
<p>When  i resize my window popup stays at center position. It show adjust depending on the window size. Whats wrong in my code     </p>

<pre><code>.Popup
        {

            display: none;
            height: 400px;
            width: 400px;
            position: fixed;
            background-color: white;
            z-index: 9999;
        }
    &lt;/style&gt;
    &lt;script type="text/javascript"&gt;
        onload = function () {
            var height = "innerHeight" in window
               ? window.innerHeight
               : document.documentElement.offsetHeight;
            $('#popup').css({
                'margin-top': (height / 2) - (200),
                'margin-left': (document.body.offsetWidth / 2) - (200)
            });

            document.getElementById("popup").style.display = "inline";
        }
    &lt;/script&gt;
</code></pre>
