//console.log();

function carousel1_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    jQuery('#projects .next').bind('click', function() {
        carousel.startAuto(0);
    }).bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#projects .prev').bind('click', function() {
        carousel.startAuto(0);
    }).bind('click', function() {
        carousel.prev();
        return false;
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

jQuery(document).ready(function() {
    jQuery("#projects #carousel1").jcarousel({
        scroll: 1,
		auto: 3,
		animation: 1000,
		wrap: 'both',
        initCallback: carousel1_initCallback,
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
});

function carousel2_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    jQuery('#clients .next').bind('click', function() {
        carousel.startAuto(0);
    }).bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#clients .prev').bind('click', function() {
        carousel.startAuto(0);
    }).bind('click', function() {
        carousel.prev();
        return false;
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

jQuery(document).ready(function() {
    jQuery("#clients #carousel2").jcarousel({
        scroll: 1,
		auto: 0,
		animation: 0,
		wrap: 'both',
        initCallback: carousel2_initCallback,
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
});