That works if you have other items on the body that you want to play with, textboxes and text areas can also trigger this behavior. links as well. So either send their result to the parent or to a new blank window.
If the scrollbar is the only window element that you want to interact with then try this fix;
In IE this will trigger a close event on any click that is not on the scrollbar or the window's chrome.