capturing window.close event

Hi,I am trying to call a logout function (which is in logout.jsp) when I click the window.close button.But I am not able to capture the window.close event.Please let me know if there is any way to do this or suggest me any work around.Thanks in advance.
[288 byte] By [srilkrishnaa] at [2007-11-26 20:30:03]
# 1
you may try to use the onunload event of the body tag. Try it and share what happened ;-)
benubacha at 2007-7-10 1:19:31 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
usage on window.close() is not a good practice.because you have to write onUnload() method in each and every page.....use [b]SessionListener[/b]Krishna
krish1315a at 2007-7-10 1:19:31 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...