jquery leave domain?

jquery leave domain?

Hello,
  i need to open a popup, when the user leaves a website. i mena the complet site/domain and not  a single page.


 i try this


<script type="text/javascript">
    jQuery(document).ready(function() {
        $(window).unload( function () {
            alert('unload');
            });
        $('a').unbind('unload');
        });
</script>







but the popup appears  always, when i leave the page and when i click a link inside the page

What is wrong in this code?