// JavaScript Document
function btns ( position )
{
	verif_fonc = true;
	if( position == 'droite' && cpt <= nombre_croisiere )
	{
		cpt++;
		$( '#btn_gauche a:not(visible)' ).show();
		$( '#croisieres' ).animate({ "left" : '-=182px' }, "slow", function()
		{
			if( cpt == nombre_croisiere ) $( '#btn_droite a:visible' ).hide();
			verif_fonc = false;
		});
	}
	else if( position == 'gauche' && cpt >= 5 )
	{
		cpt--;
		$( '#btn_droite a:not(visible)' ).show();
		$( '#croisieres' ).animate({ "left" : '+=182px' }, "slow", function()
		{
			if( cpt == 5 ) $( '#btn_gauche a:visible' ).hide();
			verif_fonc = false;
		});
	}
}

$(document).ready(function()
{
	verif_fonc = false;
	nombre_croisiere = $( '#croisieres li' ).length;
	cpt = 5;
	$( '#btn_gauche a' ).click(function()
	{
		if( verif_fonc == false ) btns('gauche');
		return false;
	});
	$( '#btn_droite a' ).click(function()
	{
		if( verif_fonc == false ) btns('droite');
		return false;
	});
	
	if($('.infiniteCarousel .liste_bons_plans li').length>2)
		{
		$(".infiniteCarousel").jCarouselLite({
			auto: 1300,
			speed: 1300,
			visible: 2,
			pauseOnHover: true
			});
		}
	
});
