Here are some previous posts about dialog boxes:
2. Loading two frames with one link
10. Browser Window OffSets (scroll compensator)
These two handy functions are useful when you are trying to keep a dynamic element in view or find if the user has scrolled the page by returning the number of pixels the page has been scrolled.