Check which action detects browser window close:
- Click this Refresh link or the browser's Refresh button
- Navigate away from this page through a link
- Type another URL in the address bar
- Click Back or Forward button
- Click the Close (X) button in the top-rightmost corner of the browser
- Click the IE icon in the top-leftmost corner and choose Close. Or simply double-click the icon
- Press Alt+F4 key
In IE, the last 3 actions are correctly detected by the javascript code inside this page as browser close.