var Main = function(parameters) {
    var _params = parameters

    var objects = {
        common: {
            _ajax_conf: function() {
                $.ajaxSetup({
                    data: {
//                        csrf_token: $.cookie('hts_csrf_cookie_name')
                    }
                });
                $(document).ajaxError(function() {
                    $.hideAll();
                    $.serverError()
                })
            },
            _ajax_loader: function() {
                $(document).ajaxStart(function() {
                    $.blockPage()
                }).ajaxStop(function() {
                    $.unblockPage()
                })
            },
            _bind: function() {
                this._ajax_conf();
                this._ajax_loader()
            },
            _init: function() {
                this._bind()
            }
        },
        alert: {
            _hide_alert_success: function(selector) {
                if (selector) {
                    setTimeout(function() {
                        selector.fadeOut(1000)
                    }, 1700)
                }
            },
            _bind: function() {
                this._hide_alert_success($('.alert-success'))
            },
            _init: function() {
                this._bind()
            }
        },
    }

    return {
        /**
         * Initializer
         * @returns {undefined}
         */
        init: function() {
            objects.common._init()
            objects.alert._init()
        }
    }
}