inside your pages, add an onunload event handler, it will load a leave.asp page. In this page, you will update your online list and display a message. For example, something like this:
leave.asp:
<%
'assume you saved this user's login name in a session variable
'now remove this user from the online list
'or you can do it in the Session_OnEnd, since the next call will trigger it
Session.Abandon
%>
<body>
Thank you for using our site. Hope you'll visit us again soon.
</body>
Of course, it will be tedious to add onunload event handlers to all pages, but you can certainly add the code to a hidden frame