(function(context,$) {

    "use strict";

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

        var logger = context.JK.logger;

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

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

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

        this.initialize = initialize;

    };
})(window,jQuery);
