var MultiCheckBox = function() {
    var areObjectsChecked = function (objects) {
        var allChecked = true;

        objects.each(function () {
            if ($(this).is(":checked") === false) {
                allChecked = false;
                return false;
            }
        });

        return allChecked;
    };

    var handleInit = function (inputsObject, allInputObject) {
        inputsObject.on("switchChange.bootstrapSwitch", function () {
            allInputObject.bootstrapSwitch("state", areObjectsChecked(inputsObject), true);
        });

        allInputObject.on("switchChange.bootstrapSwitch", function () {
            var isAllInputChecked = allInputObject.is(":checked");

            inputsObject.each(function () {
                $(this).bootstrapSwitch("state", isAllInputChecked, true);
            });
        });
    };

    return {
        handle: function(inputsObject, allInputObject) {
            handleInit(inputsObject, allInputObject);
        }
    };
}();