(function() {

  $(function() {
    var box;
    box = function(className) {
      return $('<div>').addClass(className);
    };
    return $('.danger').click(function() {
      var dialog, me, modal, no_button, yes_button;
      me = $(this);
      yes_button = $('<a>').addClass('btn').addClass('danger').text('Yup, do it.').click(function() {
        return me.closest('form').submit();
      });
      no_button = $('<a>').addClass('btn').text('I\'ve changed my mind.').click(function() {
        return dialog.modal('hide');
      });
      dialog = box('modal fade').append(box('modal-header').append($('<a>').addClass('close').attr('href', '#').html('&times;')).append($('<h3>').text('Whoa, there.'))).append(box('modal-body').append($('<p>').text('Just so you know, there\'s no going back from this one. Are you sure you want to do this?'))).append(box('modal-footer').append(yes_button).append(no_button)).hide();
      $(document.body).append(dialog);
      modal = dialog.modal({
        backdrop: true,
        keyboard: true,
        show: true
      });
      return false;
    });
  });

}).call(this);

