title: Centering modal window on the middle of a div
body: <p>I'm trying to center a modal dialog window in the middle (vertically and horizontally) of an outer div. I'm using a jquery plugin for the modal window. here is a picture of what I'm trying to accomplish</p>
  
  <p>As you can see with the current code that I have it is almost centered but not quiet. here is my javascript code</p>
  
  <pre><code>$(id).css('top', $('#pagecontent').position().top + ($('#pagecontent').height() / 2) - ($(id).height() / 2));
  $(id).css('left', $('#pagecontent').position().left + ($('#pagecontent').width() / 2) - ($(id).width() / 2));
  </code></pre>
  
  <p>pagecontent is the div rectangle where I'm trying to center the modal window</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>Thanks in advance
  Carlos</p>