Yes, I believe it is the onUnload event that you wanna use in the body tag. Basically, it's the opposite of onLoad.

But you should still use the method you are imploying now as a failsafe. It is possible that the user may leave without exiting properly. If so, onUnload wont do any good.

L8r.