Javascript not displaying popup
<p>I want to make a pop up window appear on the center of the screen,however when i use marginTop property the window does not appear.If remove marginTop property it appears always on upper left side corner. I use php 5.4 . What am I doing wrong?</p>

<pre><code>function show_popup(id) {
        if (document.getElementById){
            obj = document.getElementById(id);

            if (obj.style.display == "none") {
               obj.style.marginTop = 20%;  //if i remove this line it works 
               obj.style.display = "";

            }
        }

    }
</code></pre>
