title: fitting absolute div popup in screen
body: <p>Sorry maybe I was not clear in my original question below... </p>
  
  <p>What I am looking for is a way to get a popup to move inside the windows viewable area (not actually create the popup itself). As seen in Google image's when you mouseover a image at the edge of the screen, somehow (which is what I want to know), the script detects that there is not enough space for the popup to appear in the window, so it pushes it inside the viewable range. </p>
  
  <p>So I want to know how this is determined and calculated.</p>
  
  <blockquote>
    <p>How can I use javascript to make sure
    a popup div fits inside the window
    when it appears? </p>
    
    <p>A good example is google's image
    search. When a image does not fit in
    the window (either it is the far right
    most or bottom most image), somehow it
    is pushed inside when the popup is
    opened with the mouseover event. How
    is this calculated and how can I
    create a script to calculate this.</p>
  </blockquote>