var index=0;
var title = new Array("vox_title.jpg", "neumann_title.jpg", "macpro_title.jpg", "steinway_title.jpg", "apogee_title.jpg", "echorec_title.jpg", "minimoog_title.jpg", "mutron_title.jpg", "rhodes_title.jpg");
function carousel_initCallback(carousel) {

$('#carousel-next').bind('click', function() {
		$('#carousel-prev').removeClass('disabled');
        carousel.next();
		if(index < title.length-1)
			index++;
		if(index == title.length-1)
			$(this).addClass('disabled');

		$('#title1').children('img').attr('src', 'equipment/gallery/'+ title[index]);
        return false;
    });

    $('#carousel-prev').bind('click', function() {
		$('#carousel-next').removeClass('disabled');
        carousel.prev();
		if(index > 0)
			index--;
		if(index == 0)
			$(this).addClass('disabled');
		$('#title1').children('img').attr('src', 'equipment/gallery/'+ title[index]);
        return false;
    });

};




$(document).ready(function() {
    $('#carousel').jcarousel({
        // Configuration goes here
		scroll: 1,
		initCallback: carousel_initCallback,
		
	    // This tells jCarousel NOT to autobuild prev/next buttons
	    buttonNextHTML: null,
	    buttonPrevHTML: null
    });
});
