Onbeforeunload

Get your visitor to confirm that they have finished before leaving the page.

<script type="text/javascript">
<!--
function quit(){
event.returnValue="Are you sure you have finished?"
}
// add "onbeforeunload=quit()" to the opening body tag
// -->
</script>
<body onbeforeunload="quit()">