jquery beforeunload messages depending on button clicked
<p>Im having problem altering jQuerys <code>beforeunload()</code> functionality, depending on user actions.</p>

<pre><code>$(document).ready(function() {
    $(window).bind('beforeunload', function() {
        if (billChanged == false) {
            return false;                    
        }
        else if ( savebutton was clicked ) {
            return false;
        }
        else { 
            return "refreshing page without saving, huh? you're a bad boy!";
        }
    }); 
}); 
</code></pre>

<p>The issue im having, that i can't come up with a way to check if 'savebutton' was clicked, as typed in <code>else if</code> clause in the snippet above.</p>

<p>The form itself is quite complicated, and i'm not able to alter it that much. </p>
