Is there an equivalent to the IE onBeforeUnLoad() event for Netscape? I have tried onUnload() but that does not seem to work when the window is closed using the [X] (upper right hand close button), only when the page is refreshed or the user navigates away from the page.

What I want to accomplish is to ask a user if they are sure they want to close the window. If they say OK then close it, otherwise dont close it. Any suggestions?