function inicializarCarouselHome(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.startAuto(0);
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).attr('rel')));
		jQuery('.jcarousel-control a').css('text-indent','0px');
		jQuery(this).css('text-indent','-14px');
		return false;
    });
    
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
        
    
};

function highlight(carousel, obejctli,liindex,listate){
    jQuery('.jcarousel-control a').css('text-indent','0px');
    $("#control-"+liindex).css("text-indent","-14px");
};

jQuery(document).ready(function() {
	if(jQuery('#carouselHome').length > 0){
		jQuery("#carouselHome").jcarousel({
			scroll: 1,
            auto: 2,
            wrap: 'last',
			initCallback: inicializarCarouselHome,
			buttonNextHTML: null,
			buttonPrevHTML: null,
            itemVisibleInCallback:  highlight
            
		});
	}
        
});
