OK....I found (but not yet tested) 2 options....
1) This is IE only apparently
function onClose()
{
if ((window.event.clientX<0) && (window.event.clientY<0))
alert("you closed me"

;
}
...
<body onunload="onClose()">
and
2) Use frames and dump the close logic in a frame that isn't visible so won't be impacted by POST or refresh.....
<html>
<head>
<title>frames example</title>
</head>
<noframes>To be viewed properly, this page requires frames.
</noframes>
<frameset rows="100%, *">
<frame src="dummy.html">
<frame src="leave.jsp">
</frameset>
</html>
<html>
<head>
</head>
<body onunload="leave()">
<!-- body onbeforeunload="leave()" -->here
</body>
</html>
<script language="JavaScript">
function leave() { document.location.href="
</script>
still seems like a pain in the &%$ though.....