//Makes the homepage clickable
Event.observe(window, "load", function(){
	$("corps").select(".clickable").each(function(element){
		element.observe("click", function(event){
			location = this.select("h3 a");
			Event.stop(event);
			return false;
		});
	});
});

//News
var actus = new Array();
var currentActu = 0;
Event.observe(window, "load", function(){
	if($("actus") != undefined){
		actusCount = actus.size();
		currentActu = Math.floor(Math.random() * actusCount);
		nextActu();
	}
});

function nextActu(){
	actusCount = actus.size();
	currentActu++;
	if(currentActu >= actusCount){
		currentActu = 0;
	}
	$("actus").fade({duration: 5.0, from:0, to:1});
	$("actus").innerHTML = actus[currentActu];
	$("actus").appear({duration: 5.0, from:0, to:1});
	window.setTimeout("nextActu()", 15000);
}


function checkForm(moi){
	for(var i = 0; i < moi.elements.length; i++){
		if(moi.elements[i].className){
			if(moi.elements[i].className == "obligatoire"){
				if(moi.elements[i].value == ""){
					alert('Veuillez remplir tous les champs obligatoires.');
					return false;
				}
			}

		}
	}
	return true;
}
