jQuery.noConflict();

jQuery(document).ready(function () {

    var CarouselRandomStart = Math.floor(Math.random() * (jQuery('#mycarousel li').length + 1));

    jQuery('#mycarousel').jcarousel({
        wrap: 'circular',
        scroll: 2,
        visible: 5,
        auto: 2,
        animation: 'slow',
        initCallback: mycarousel_initCallback,
        start: CarouselRandomStart
    });

});

jQuery(window).load(function () {
    jQuery('#mycarousel img').each(function () {
        var logoMarginTop = Math.floor((75 - jQuery(this).height()) / 2);
        jQuery(this).css({ marginTop: logoMarginTop + 'px' });
    });
});

function mycarousel_initCallback(carousel) {
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function () {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function () {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function () {
        carousel.stopAuto();
    }, function () {
        carousel.startAuto();
    });
};
