/* ---------------------------------------------------------------
	Affichage des affiches
 --------------------------------------------------------------- */

function affichageAffiche1(){
	$("#zone_evenement").fadeIn(2000);
	var myAjax = $.ajax({
		url: 'ajax/accueil/affiche_1.php',
		type: 'POST',
		success: function(retour){$('#zone_evenement').html(retour);},
		complete: function(){

			$('a.adele').click( function(){
				gestionAncre($(this));
				
				$("#demo_tel").removeClass("affichage_off");					
				$("#demo_tel").addClass("affichage_on");					
				var myAjax = $.ajax({
					url: 'ajax/session_id.php',
					data: 'clef=roman_id' + '&valeur=' + '27',
					type: 'POST',
					complete: function(){
						demoTel("ajax/accueil/roman.php");
					}
				});
			}); 

			setTimeout( function(){
				$("#zone_evenement").hide();
				affichageAffiche2();
			} , 20000);
		}
	});
}
function affichageAffiche2(){
	$("#zone_evenement").fadeIn(2000);
	var myAjax = $.ajax({
		url: 'ajax/accueil/affiche_2.php',
		type: 'POST',
		success: function(retour){$('#zone_evenement').html(retour);},
		complete: function(){

			$('a.couteau').click( function(){
				gestionAncre($(this));
				
				$("#demo_tel").removeClass("affichage_off");					
				$("#demo_tel").addClass("affichage_on");					
				var myAjax = $.ajax({
					url: 'ajax/session_id.php',
					data: 'clef=roman_id' + '&valeur=' + '69',
					type: 'POST',
					complete: function(){
						demoTel("ajax/accueil/roman.php");
					}
				});
			}); 

			setTimeout( function(){
				$("#zone_evenement").hide();
				affichageAffiche1();
			} , 20000);
		}
	});
}

/* ---------------------------------------------------------------
	FONCTIONS A LANCER LORS DU CHARGEMENT DE LA PAGE
 --------------------------------------------------------------- */
$(document).ready(function(){

	// AFFICHAGE DES AFFICHE
	affichageAffiche2();

	// AFFICHAGE DU TELEPHONE
	$("#demo_tel").fadeIn(1500);

	// Cower flow des Romans decouvertes
	$("#scroller").simplyScroll({
			speed: 1,
			autoMode: "loop"
		});

		
	$('#scroller li a').each( function(noeud){
		gestionAncre($(this));
		
		$(this).click( function(){
		
			$("#demo_tel").removeClass("affichage_off");					
			$("#demo_tel").addClass("affichage_on");					
			var myAjax = $.ajax({
				url: 'ajax/session_id.php',
				data: 'clef=roman_id' + '&valeur=' + $(this).attr('id'),
				type: 'POST',
				complete: function(){
					demoTel("ajax/accueil/roman.php");
				}
			});
		}); 
	});
		
});
// -------------------------------------------------------------