﻿var lock, category, description, anchor;
var refDisplay = nombre= Math.floor(Math.random() * refSequence.length);

function bottomMenu(){
	if(p!='accueil' && p!='mentions'){
		$('bottommenu').style.display = 'block';
		$('footer').style.height = '35px';
	} else {
		$('bottommenu').style.display = 'none';
		$('footer').style.height = '18px';
	}
}

function divswitch(divId){
	Effect.toggle('content'+divId, 'slide', {duration:0.1});
}

function runShow(){
	refNumber = refDisplay%refSequence.length;
	activeView = refDisplay%2;
	current = refSequence[refNumber];
	
	$('refCategory').update(current.category);
	$('refDescription').update(current.description);
	$('refAnchor').update('>>&nbsp;<a href="./' + current.anchor + '">En savoir plus</a>');
	$('refBg'+activeView).setStyle({background: 'url(./images/content/references_visuels/' + current.bg + ') right no-repeat'});
	
	new Effect.Opacity('refBg1',  { duration:0.6, to:activeView } )
	
	refDisplay++;
	setTimeout('runShow()', current.delay);
}

window.onload = function(){
	bottomMenu();
	runShow();
}
