/* JCarousel Página Inicial*/

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();
    });
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        auto: 4,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });
});


/* Imagens detalhes do veiculo */

function switch_product_img(divName, totalImgs) {
			for (var i=1; i<=totalImgs; i++) {
				var showDivName = 'imagem_' + i;
				var showObj = document.getElementById(showDivName);
				if (showDivName == divName)
					showObj.style.display = 'block';
				else
					showObj.style.display = 'none';
				}
			}
			
/* Imagens detalhes do veiculo - LightBox */		
			
$(function() {
	//Class da galeria de fotos.
	$('#fotos-lightbox a').lightBox(); // Select all links in object with gallery ID
	
	//Links com esta class abrem com lightbox.
	$('a.lightbox').lightBox(); // Select all links with lightbox class
});