
/*
 * CsmRadio By DEMOLON Aurélien
 * Copyright (c) 2008, CsmRadio.fr
 */

/* -----------------------------------------------------------------------------*/
/* INITIALISATIONS D'EVENEMENTS                                                 */
/* -----------------------------------------------------------------------------*/
Event.observe( window, 'load', EnCeMoment, false ) ;
Event.observe( window, 'load', aSuivre, false ) ;
Event.observe( window, 'load', affichagePhotosMenu, false ) ;


/* -----------------------------------------------------------------------------*/
/* AFFICHE IMAGE "EN CE MOMENT"                                                 */
/* -----------------------------------------------------------------------------*/
function EnCeMoment() {
	/* Affiche la barre de chargement */
	$('affiche_sujets').style.display = 'none' ;
	$('loading_sujets').style.display = 'block' ;
	
	/* Traitement du formulaire */
	new Ajax.Request( 'rota_live.php', {
		method:'post',
		asynchronous:true,
		
		/* Retour OK */
		onSuccess: function( t ) {
			$('loading_sujets').style.display = 'none';
			$('affiche_sujets').innerHTML = t.responseText ;
			new Effect.Appear($('affiche_sujets'));
		}
	} ) ;
	
	window.setTimeout( "EnCeMoment()", 30000 );
}


/* -----------------------------------------------------------------------------*/
/* AFFICHE IMAGE "A SUIVRE"                                                     */
/* -----------------------------------------------------------------------------*/
function aSuivre() {
	/* Affiche la barre de chargement */
	$('affiche_sujets_second').style.display = 'none' ;
	$('loading_sujets_second').style.display = 'block' ;
	
	/* Traitement du formulaire */
	new Ajax.Request( 'rota_live_avenir.php', {
		method:'post',
		asynchronous:true,
		
		/* Retour OK */
		onSuccess: function( t ) {
			$('loading_sujets_second').style.display = 'none';
			$('affiche_sujets_second').innerHTML = t.responseText ;
			new Effect.Appear($('affiche_sujets_second'));
		}
	} ) ;
	
	window.setTimeout( "aSuivre()", 30000 );
}


/* -----------------------------------------------------------------------------*/
/* AFFICHE LA ROTATION DE NEWS FLASH PRICIPALE                                  */
/* -----------------------------------------------------------------------------*/
function affichagePhotosMenu() {
	/* Affiche la barre de chargement */
	$('affichePhotos').style.display = 'none' ;
	$('loadingPhotos').style.display = 'block' ;
	
	/* Traitement du formulaire */
	new Ajax.Request( 'plv_flash_acc.php', {
		method:'post',
		asynchronous:true,
		
		/* Retour OK */
		onSuccess: function( t ) {
			$('loadingPhotos').style.display = 'none';
			$('affichePhotos').innerHTML = t.responseText ;
			new Effect.Appear($('affichePhotos'));
		}
	} ) ;
	
	window.setTimeout( "affichagePhotosMenu()", 500000 );
}


