/*
Fonctions JS de l'index du site
*/

// Switcher 1 (En dessous une)
var cbase = 1;
var timer;
function change_c1(c, a) {
	$('#c1_'+cbase+'_contenu').css("margin-left", "0px").animate({opacity: 'hide', marginRight: '100px'}, 200);
	$('#c1_'+cbase).css({
		background: 'url("./vf/images/tableau/haut_multi2.png") no-repeat',
		color: '#444'
	});
	cbase = c;
	$('#c1_'+cbase+'_contenu').css({marginRight: "0px", marginLeft: "100px"}).animate({opacity: 'show', marginLeft: '0px'}, 200);
	$('#c1_'+cbase).css({
		background: 'url("./vf/images/tableau/haut_multi.png") no-repeat',
		color: '#fff'
	});
	if(a == 1) clearTimeout(timer);
	timer_change_c1();
}

// Automatisation du Switcher
function timer_change_c1() {
	var cnext = (cbase == 4) ? 1 : (cbase + 1);
	timer = setTimeout("change_c1("+cnext+", 0)", 8000); 
}

$(function() {
	timer_change_c1();
});