is it possible these type of problem in javascript
No - because there are many ways a browser can be closed without giving JavaScript a chance to act.
This problem gets discussed
alot in this forum, browse over recent posts or use the search function to see more.
Bill