give your div a id such as "kas" then write this code in java script
<script type="text/javascript">
window.onbeforeunload = function()
{
document.getElementById('kas').style.visibility = 'visible';
}
</script>
but keep in mind that you will not be able to see that div becouse page will close itself right after displaying that div until you diplays any alert box or stops page from unloading