title: Javascript : open popup in the center of the screen (Chrome)
body: <p>i am using this code to open a popup in the center of the screen </p>
  
  <pre><code>  function popupwindow(url, title, w, h) {
        wLeft = window.screenLeft ? window.screenLeft : window.screenX;
        wTop = window.screenTop ? window.screenTop : window.screenY;
  
        var left = wLeft + (window.innerWidth / 2) - (w / 2);
        var top = wTop + (window.innerHeight / 2) - (h / 2);
        return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left + ', screenX=' + left + ', screenY=' + top);
    }
  </code></pre>
  
  <p>All works fine in Firefox, IE and Safari but in Chrome the popup shows up randomly.
  How can i make this works also in Chrome?</p>