<html>
        <head>
                <script type="text/javascript" language="javascript">
                     function doclose() {
                        alert("I'm going to try and close you down now.");
                        top.opener = false;
                        top.close();
                     }
                </script>
                <title>Well dodgy JavaScript</title>
        </head>
        <body onbeforeunload="return doclose();">
                <a href="javascript: doclose();">Directly call the doclose method.</a><br/>
                <a href="http://www.brunningonline.net/simon/blog/">Try and navigate away from this page. Under IE, this should <b>also</b> call the doclose method.</a>
        </body>
</html>