(function(context,$) {

  "use strict";

  context.JK = context.JK || {};
  context.JK.ConfirmDialog = function(app, okButtonText, message, title, callback) {

    var logger = context.JK.logger;

    function events() {
      $('#btn-confirm-ok').unbind("click");
      $('#btn-confirm-ok').click(function(evt) {
        if (callback) {
          callback();
        }
      });

      $('#btn-confirm-cancel').unbind("click");
      $('#btn-confirm-cancel').click(function(evt) {
        app.layout.closeDialog('confirm');
      });
    }

    function initialize() {
      events();
      $('#btn-confirm-ok').text(okButtonText);
      $('#confirm-title').text(title);
      $('#confirm-message').html(message);
    }

    this.initialize = initialize;

  };
})(window,jQuery);
