How is it possible to identify that the browser\'s close button was clicked?
I agree with northsouthwhat, but be aware that onbeforeunload may not be supported in all the browsers you might want to use it in.