[jQuery] Simplemodal close confirm

[jQuery] Simplemodal close confirm


Hi, I want create a confirmation of close in Simple modal. I try make
this code:
$(\"#content\").modal({onClose: function (dialog) {
if (confirm(\"Realy close?\")){
dialog.data.fadeOut('slow', function () {
dialog.container.slideUp('slow', function () {
         dialog.overlay.fadeOut('slow', function () {
             $.modal.close();
         });
     });
});
}
}});
It works, but only for first time. When i click to close button second
time, is makes nothing. Can You help me? Thanks