title: Positioning relative to an element and window
body: <p>I currently have a dialog with a bunch of options defined. It is shown when the user clicks on a button. My dialog is defined as:</p>
  
  <pre class="lang-js prettyprint-override"><code>    $('#newIssueDialog').dialog({
          autoOpen: false,
          modal: true,
          closeOnEscape: true,
          draggable: false,
          resizable: false,
          width: 415,
          height: 175,
          position: {my: "top", at: "bottom", of: "#btnNewIssue"}
      });
  </code></pre>
  
  <p>This pops my dialog up, centered below my button.<br>
  What I'd actually like to do is pop the dialog below the button, but centered on my <em>window</em>.</p>
  
  <p>Any ideas on how to do that?</p>
  
  <p>Edit: Also, is it possible to take into account the position of the window relative to the document? As in, if there are scrollbars on the page and the user has scrolled the page vertically or horizontally, can we calculate the position of the button and where we are on the page so that it is still below the button and centered?</p>