title: Handle IE window close event in javascript
body: <p><br>
  I need to handle when Internet Explorer (6, 8 and 9) window is closed, in order to ask his confirmation on it. I tried the <code>unbeforeunload</code>, but, as you might know, it's triggered also when any link is clicked, o a form is submited. Some can say to use event mouse coordinates, but there are several ways to break such a validation (Alt+F4 for ex.). There's also a way to set some variable to true when clicking links and check if in the event, but that does not work neither, as I got lots of various links on my pages, and the event is triggered multiple times in some cases.<br>
  Also I tried to solve the problem using frames, like: make 2 frames, put my pages to one frame, and to the other (with zero size) put a page with <code>onbeforeunload</code> handler. That would work just fine, but we work with a set of environment js, that we can't prevent to download, and those scripts remove any frames on the page, putting the entire page in the main window - fail…<br>
  Can anybody, please, suggest anything else?</p>