document.addEvent('domready', function()
{
	/*
		DEFILEMENT DES CHANTIERS
	*/

		var tab = $$('#chantier_container .chantier');
		var run = true;
		actual = 1;
//		var visibles = 5;
//		var etapes = Math.ceil(tab.length/visibles);
		function test ()
		{
			if(run == true)
			{
				if (actual == tab.length)
				{
					var scroll = new Fx.Scroll('chantier_container', {
						wait: false,
						duration: 0,
						offset: {'x': 0, 'y': 0},
						transition: Fx.Transitions.Quad.easeInOut
					});
					actual = 0;
				}else{
					var scroll = new Fx.Scroll('chantier_container', {
						wait: false,
						duration: 1500,
						offset: {'x': 0, 'y': 0},
						transition: Fx.Transitions.Quad.easeInOut
					});
				}
				scroll.toElement(tab[actual]);
//				alert(actual);
				actual++;
			}
		}
		var go = (function(){
			test();
		}).periodical(1500);
		
	/*
		CLIGNOTEMENT TITRE
	*/
	var fx = new Fx.Styles($('theTitre'), {
		duration: 900,
		wait: false,
		transition: Fx.Transitions.Quad.easeOut,
		onComplete: function(){
//			alert("complete");
			fx.start({
				'color': ['#FF9935', '#306093']
			});
		}
	});
/*	fx.start({
		'color': ['#306093', '#FF9935']
	});*/
	var clignote = (
		function()
		{
			fx.start({
				'color': ['#306093', '#FF9935']
				//'opacity': [1, 0]
				});
		}).periodical(1801);
});


