var titre = new Array();
function fade(id, color){ 	
	if(color<255) { //If color is not white yet
		color+=11; // increase color darkness
		$(id).setStyle({color:"rgb("+color+","+color+","+color+")"});
		setTimeout("fade('"+id+"', "+color+")",10); 
	}
	else color=0; //reset colorTitre value
}
function flux(i, nb) {
		$('sp').update(titre[i]);
		//$('sp'+i).fade({ duration: 1, from: 0, to: 1  });
		fade("sp"+i, 0);
		if(i<nb-1) i++;
		else i=0;
		setTimeout("flux("+i+","+nb+")",6000); 
}
function openBandeau(){
	$('livenews').setStyle({width: '100%'});
	$('opened').show(); 
	$('closed').hide();
	eraseCookie('footerBandeau'); 
}
function closeBandeau(){
	$('livenews').setStyle({width: '70px'});

	$('opened').hide(); 
	$('closed').show();
	createCookie('footerBandeau','close',1); 
}


function init(nbItem){flux(0, nbItem);}

Event.observe(window,'load',function(e){
	var x = readCookie('footerBandeau');
	if (x) {
		if (x=='close')closeBandeau();
	}
});
