you might wanna try 'watching' the window's 'closed' property
something like this:
Code:
window.watch("closed", someFunction());
i never tried it, maybe it works
but why would you log the user off when they close the window
they might have several windows with your site loaded
i'm sure there must be a workaround using sessions or sumtin