I am trying to give an alert confirm dialog box when users try to navigate away...I have the following code but it doesn't quite work...

```
    jQuery(window).unload(function() {
        var yes = confirm("You're about to end your session, are you sure?");
        if (yes) {
            return true;
        } else {
            return false;   
        }
    });

```

The popup comes up fine but when I click "NO", it still navigates away...

Thanks for looking...