title: How to fix window to parent window?
body: <p>How can I fix popup window (window.open()) to parent window? When I click to another tab my window is lost. </p>
  
  <pre><code>function popitup(url, w, h) {
  
      var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : window.screenX;
      var dualScreenTop = window.screenTop != undefined ? window.screenTop : window.screenY;
  
      var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
      var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
  
      var left = ((width / 2) - (w / 2)) + dualScreenLeft;
      var top = ((height / 2) - (h / 2)) + dualScreenTop;
  
      popupWindow = window.open(url, title,"resizeable=yes,location=no,width=" + w + ", height=" + h + ",top=" + top + ",left=" + left + ", overflow-x=hidden");
  
      popupWindow.pw = pw;
  
      if (window.focus) {
          popupWindow.focus()
      }
      return false;
  }
  </code></pre>