


	// ================================================================================================================================================================
	// ------------------------------------------------------------
	// ### HEADER DIAPORAMA ... WITH PRELOAD AT PAGE LOAD;
	// ------------------------------------------------------------
	//
	var a_diapos_img = new Array();
	//
	var i_NB_OF_DIAPOS  = 13;
	//
	for(var i=0; i < i_NB_OF_DIAPOS; i++)
	{
		a_diapos_img[i] = new Image();
	//	a_diapos_img[i].src = "./images/diapos/expo_v1_"+i+".png";
	//	a_diapos_img[i].src = "./images/diapos/expo_v2_"+((i<10)?'0'+i:i)+".jpg";
		a_diapos_img[i].src = "./images/diapos/expo_v3_"+((i<10)?'0'+i:i)+".jpg";
	};
	//
	// ------------------------------------------------------------
	//
	function run_header_photo_changer( i_nb  , f_onFinished )
	{
		var o_img = document.getElementById( "diapo_accueil_img" );

		 o_img.src = a_diapos_img[i_nb].src;

		if((typeof f_onFinished)=="function") f_onFinished();

		// console.log(o_img.src);
	};
	//
	// ------------------------------------------------------------
	//
	function init_header_diaporama( i_nb_start )
	{
	//	run_header_photo_changer( 0 );
	//	fade_header_diaporama( true );
	//	var timeout_pointer = setTimeout(function(){   run_header_diaporama(0);   },10000);

		var o_img = document.getElementById( "diapo_accueil_img" );
		// o_img.src = "";

		// run_opacity_fader("diapo_accueil_text" , 0.00 , 0.50 , 50 , 0.20 , function(){
			run_header_diaporama(i_nb_start);
		// } );
	};
	//
	// ------------------------------------------------------------
	//
	function fade_header_diaporama( b_flag , i_max , f_onFinished )
	{
		i_max = i_max || 0.60;

		if(b_flag) run_opacity_fader("diapo_accueil" , 0.00  , i_max , 25 , 0.30 , f_onFinished );
		else       run_opacity_fader("diapo_accueil" , i_max , 0.00  , 25 , 0.30 , f_onFinished );
	};
	//
	//
	//
	// ------------------------------------------------------------
	//
	function fade_header_logo( b_flag , f_onFinished )
	{
		if(b_flag) run_opacity_fader("header_logo" , 0.00 , 1.00 , 25 , 0.10 , f_onFinished );
		else       run_opacity_fader("header_logo" , 1.00 , 0.00 , 25 , 0.10 , f_onFinished );
	};
	//
	//
	//
	// ------------------------------------------------------------
	//
	function fade_header_text( b_flag , f_onFinished )
	{
		if(b_flag) run_opacity_fader("header_logo" , 0.00 , 1.00 , 25 , 0.10 , f_onFinished );
		else       run_opacity_fader("header_logo" , 1.00 , 0.00 , 25 , 0.10 , f_onFinished );
	};
	//
	//
	// ------------------------------------------------------------
	//
	function run_header_diaporama_with_fader( i_nb )
	{
	//	if ( i_nb == 0 ) setTimeout(function(){   fade_header_logo( false );    },1 );
	//	if ( i_nb == 3 ) setTimeout(function(){   fade_header_logo( true  );    },1 );

	//	if ( i_nb!=3 ) var i_max = 1.00; else i_max = 0.60;

		var i_max = 1.00;

		// start fade out ...

		fade_header_diaporama(	false
				,	i_max
				,	function()
					{

						// ON FINISHED ...
						// change photo ...

						run_header_photo_changer(	i_nb
									,	function()
										{
											// ON FINISHED ...
											// start fade in ...

											fade_header_diaporama( true  , i_max );

											i_nb++;

											if (i_nb == i_NB_OF_DIAPOS) i_nb = 0;

											// WAIT 15s ...
											// AND start again with next photo ...

											setTimeout( function(){run_header_diaporama(i_nb);} , 5000 );
										}
						);
					}
		);

		//	setTimeout(function(){   fade_header_diaporama( false , i_max );   } ,     1);
		//	setTimeout(function(){   run_header_photo_changer( i_nb );         } ,  5000);
		//	setTimeout(function(){   fade_header_diaporama( true  , i_max );   } , 10000);
		//	i_nb++;
		//	if (i_nb > 3) i_nb = 0;
		//	setTimeout(function(){   run_header_diaporama(i_nb);   },15000);

	};
	//
	// ------------------------------------------------------------
	//
	function run_header_diaporama( i_nb )
	{
		if (i_nb == i_NB_OF_DIAPOS) i_nb = 0;

		run_header_photo_changer(	i_nb
					,	function()
						{
							// ON FINISHED ...
							// start fade in ...

							i_nb++;

							if (i_nb == i_NB_OF_DIAPOS) i_nb = 0;

							// WAIT 15s ...
							// AND start again with next photo ...

							setTimeout( function(){run_header_diaporama(i_nb);} , 5000 );
						}
		);
	};
	//
	// ------------------------------------------------------------
	// ================================================================================================================================================================



