title: SimpleModal confirm before closing dialog
body: <p>I'm using SimpleModal (<a href="http://www.ericmmartin.com/projects/simplemodal/" rel="noreferrer">http://www.ericmmartin.com/projects/simplemodal/</a>) and I have a form that displays in a dialog. What I want to do is be able to have a confirmation come up each time that the user tries to close the dialog (either by escape or clicking on the close icon) and asks them if they really want to close it without saving the form data. I tried the following:</p>
  
  <pre><code>onClose: function (dialog) {
      if (confirm('Are you sure you want to close without saving?')) {
          $.modal.close();
      }
  }
  </code></pre>
  
  <p>But it only triggers once. If you hit cancel then fails to close again later, which kind of makes sense. Anybody have a suggestion or solution? Any help would be greatly appreciated. :)</p>