$(document).ready(function () {
    $('.CustomDropDown').selectpicker();
});

// Partners
$('#Partners').on('slide.bs.carousel', function (e) {
    var $e = $(e.relatedTarget);
    var idx = $e.index();
    var itemsPerSlide = 6;
    var totalItems = $('#Partners .carousel-item').length;

    if (idx >= totalItems - (itemsPerSlide - 1)) {
        var it = itemsPerSlide - (totalItems - idx);
        for (var i = 0; i < it; i++) {
            // append slides to end
            if (e.direction == "left") {
                $('#Partners .carousel-item').eq(i).appendTo('#Partners .carousel-inner');
            }
            else {
                $('#Partners .carousel-item').eq(0).appendTo('#Partners .carousel-inner');
            }
        }
    }
});
