{% load i18n %}

//<![CDATA[
(function ($) {
 $(document).ready(function() {
     $("li.withdialog").find('a.confirm-button').bind('click', function() {
         var link = $(this);
         var container = $(this).parent();
         var message = container.find('.dialog').clone();
         message.dialog({
             width: 460,
             buttons: {
                 "{% trans "Yes, I am sure" %}": function() {
                     $(this).dialog("close");
                     $(window).attr('location', link.attr('href'));
                 },
                 "{% trans "Cancel" %}": function() {
                     $(this).dialog("close");
                 }
             },
             autoOpen: false,
             modal: true
         });
         message.dialog("open");
         return false;
     });
});
}(jQuery));
//]]>
