var lancement;
function Timer() {
	//Tableau contenant les swf
	var animations = new Array(
		{
			src: 'animations/brabra.swf',
			time: 5000
		},
		{
			src: 'animations/lulu.swf',
			time: 5000
		},
		{
			src: 'animations/dandan.swf',
			time: 5000
		}
	);
	
	var anim = Math.round(Math.random()*2);
	var temps = (Math.random()*30000)+animations[anim].time + 30000;
	//alert('tempus '+temps);
	var anim = Math.round(Math.random()*2);
	//alert ('num anim ' + anim);
	ChargerAnimation(animations[anim].src);
	setTimeout( DechargerAnimation, animations[anim].time );
	lancement = setTimeout( Timer, temps );
}
LancerCalculateur();

function DechargerAnimation (){
	var anim = document.getElementById('mymovie');
	if( anim && anim.parentNode )
		anim.parentNode.removeChild(anim);
}

function ChargerAnimation (anim){
	var so = new SWFObject(anim, 'mymovie', 1000, 750, 7, ""); 
	so.addParam("wmode", "transparent");
	so.addParam('loop', 'false');	
	//so.useExpressInstall('animations/expressinstall.swf');
	so.write("flashcontent");
}

function LancerCalculateur (){
	var socal = new SWFObject('animations/fete-aux-totaux.swf', 'calculateur', 880, 750, 9, ""); 
	socal.addParam("wmode", "transparent");
	socal.addParam('loop', 'false');
	socal.addParam('salign','b');	
	//so.useExpressInstall('animations/expressinstall.swf');
	socal.write("flashcontent");
	window.clearTimeout(lancement)
}