$(document).ready( function () {
	if ($("#presentation img.presentation").length > 1) {
		$("#presentation img.presentation:last").addClass('current');
		//chargerImagePresentation();
		alternerImagePresentation();
	}
	
	$("#sondage form").submit( function () {
		if ($("input:radio:checked", this).length)
			$(this).html('<p>Merci pour votre réponse.</p>');
		
		return false;
	} ) ;
} ) ;

/*
function chargerImagePresentation() {
	var iI = 0;
	if ($("#presentation img").length < 19)
		$("#presentation img:first").load( function () {
			iI = $("#presentation img").length + 1;
			$("#presentation").prepend('<img src="img/presentation/' + (iI < 10 ? '0' + iI : iI) + '.gif" alt="Présentation : image n°' + iI + '" />');
			chargerImagePresentation();
		} ) ;
	else
		alternerImagePresentation();
}
*/
function alternerImagePresentation() {
	$("#presentation img.presentation:last").animate( { opacity: 1 }, 3000, '', function () {
		$(this).animate( { opacity: 0 }, 2000, '', function () {
			$(this).prependTo("#presentation");
			$(this).css('opacity', 1);
			alternerImagePresentation();
		} ) ;
	} ) ;
}
