How to Detect the Client Browser/Tab Closed

Also looking for the problem. I had just found how to solve this problem


Code:
<html>
<head>
<title>Detecting browser close in IE</title>
  <script type="text/javascript" src="/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
var validNavigation
...