/**
 * We use the initCallback callback
 * to assign functionality to the controls
 */
function mycarousel_initCallback_P(carousel) {
    $('.jcarousel-control-P a').bind('click', function() {
        carousel.scroll($.jcarousel.intval($(this).text()));
        return false;
    });
	$('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });
	$('.mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });
	$('.mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
	 // 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();
    });
};


function mycarousel_initCallback_M(carousel) {
    $('.jcarousel-control-M a').bind('click', function() {
        carousel.scroll($.jcarousel.intval($(this).text()));              
        return false;
    });
	$('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });
	$('.mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });
	$('.mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
	 // 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();
    });
};


function mycarousel_initCallback_A(carousel) {
    $('.jcarousel-control-A a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));              
        return false;
    });
	$('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });
	$('.mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });
	$('.mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
	 // 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();
    });
};

function mycarousel_initCallback_Pi(carousel) {
    $('.jcarousel-control-Pi a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));              
        return false;
    });
	$('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });
	$('.mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });
	$('.mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
	 // 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();
    });
};
// Ride the carousel...
$(document).ready(function() {

	
    $(".mycarouselP").jcarousel({
        scroll: 1,
		auto: 4,
        wrap: 'last',
        initCallback: mycarousel_initCallback_P,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
    
    
    $(".mycarouselM").jcarousel({
        scroll: 1,
		auto: 4,
        wrap: 'last',
        initCallback: mycarousel_initCallback_M,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
    $(".mycarouselA").jcarousel({
        scroll: 1,
		auto: 4,
        wrap: 'last',
        initCallback: mycarousel_initCallback_A,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
    $(".mycarouselPi").jcarousel({
        scroll: 1,
		auto: 4,
        wrap: 'last',
        initCallback: mycarousel_initCallback_Pi,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
    

	$('.Cprograma').css('display','block');
	$('.Cmoto').css('display','none');
	$('.Cavaliacao').css('display','none');
	$('.Cpista').css('display','none');

});

