function animation(){
	if (layer_noir<6){
		opacite-=2;
		int_opacite=Math.floor(opacite);
		if ((opacite<60)&&(layer_noir<4)){
			$("noir"+(eval(layer_noir)+1)).style.opacity="0."+(int_opacite+40);
			$('noir'+(eval(layer_noir)+1)).style.filter="alpha(opacity="+(int_opacite+40)+")";
		}
		if (opacite==10){
			$("noir"+layer_noir).style.opacity="0";
			$('noir'+layer_noir).style.filter="alpha(opacity=0)";
			layer_noir+=1;
			if (layer_noir==6){
				//$('sourire').style.display="block";
			}
			if (layer_noir<5) opacite=50; else opacite=98;
				
		}else{
			$("noir"+layer_noir).style.opacity="0."+int_opacite;
			$('noir'+layer_noir).style.filter="alpha(opacity="+int_opacite+")";
		}
	}else if ($('vague').offsetHeight<450){
			$('vague').style.height=($('vague').offsetHeight+8)+"px";
	}else if ($('photo1').offsetHeight<172){
			$('photo1').style.top=($('photo1').offsetTop-4)+"px";
			$('photo1').style.height=($('photo1').offsetHeight+8)+"px";
			$('photo1').style.left=($('photo1').offsetLeft-8)+"px";
	}else if ($('photo2').offsetHeight<146){
			$('photo2').style.top=($('photo2').offsetTop-4)+"px";
			$('photo2').style.height=($('photo2').offsetHeight+8)+"px";
			$('photo2').style.left=($('photo2').offsetLeft-8)+"px";
	}else if ($('photo3').offsetHeight<130){
			$('photo3').style.top=($('photo3').offsetTop-4)+"px";
			$('photo3').style.height=($('photo3').offsetHeight+8)+"px";
			$('photo3').style.left=($('photo3').offsetLeft-8)+"px";
	}else if ($('bleu').style.opacity<'0.90'){
		opacite-=2;
		int_opacite=Math.floor(opacite);
		if (opacite>10){
			$('avant_plan').style.opacity='0.'+int_opacite;
			$('avant_plan').style.filter="alpha(opacity="+int_opacite+")";
		}else{
			$('avant_plan').style.opacity='0.1';
			$('avant_plan').style.filter="alpha(opacity=10)";
		}
		$('bleu').style.opacity='0.'+(100-int_opacite);
		$('bleu').style.filter="alpha(opacity="+(100-int_opacite)+")";
		if (opacite==90){
			$('bleu').style.display='block';
		}
	/*}else if ($('douve').offsetLeft>-270){
		//$('douve').style.left=($('douve').offsetLeft-3)+"px";
		$('douve').style.left="-270px";
		
		opacite=10;*/
	/*}else if(prompteur/10<texte_carte.length){
		if (prompteur%10==0){
			$("texte").innerHTML+=texte_carte[prompteur/10];
		}
		prompteur+=2;*/
	}else if ($('douve').style.opacity>0){
		opacite+=1;
		int_opacite=Math.ceil(opacite);
		if (opacite<45){
			$('douve').style.opacity='0.'+(100-int_opacite*2);
			$('douve').style.filter="alpha(opacity="+(100-int_opacite*2)+")";
			if (opacite>10){
				$('douve2').style.opacity='0.'+int_opacite;
				$('douve2').style.filter="alpha(opacity="+int_opacite+")";
			}
		}else{
			$('douve').style.opacity='0';
			$('douve').style.filter="alpha(opacity=0)";
			opacite=10;
		}
	}else if ($('texte').style.opacity<1){
		opacite+=2;
		int_opacite=Math.ceil(opacite);
		if (opacite<54){
			$('douve2').style.opacity='0.'+(35+int_opacite);
			$('douve2').style.filter="alpha(opacity="+(35+int_opacite)+")";
		}else{
			$('douve2').style.opacity='1';
			$('douve2').style.filter="alpha(opacity=100)";
			$('nom_latin').style.display='block';
		}	
		if (opacite<80){
			$('texte').style.opacity='0.'+int_opacite;
			$('texte').style.filter="alpha(opacity="+int_opacite+")";
		}else{
			$('texte').style.opacity='1';
			$('texte').style.filter="alpha(opacity=100)";
			opacite=10;
		}	
	}else if ($('bonne_annee').style.opacity<1){
		//opacite+=0.5;
		opacite+=2;
		int_opacite=Math.floor(opacite);
		if (opacite!=100){
			$('bonne_annee').style.opacity='0.'+int_opacite;
			$('bonne_annee').style.filter="alpha(opacity="+int_opacite+")";
			//$('bonne_annee').style.width=($('bonne_annee').offsetWidth+2)+'px';
			//$('bonne_annee').style.top=($('bonne_annee').offsetTop-1)+'px';
			//$('bonne_annee').style.left=($('bonne_annee').offsetLeft-1)+'px';
		}else{
			$('bonne_annee').style.opacity='1';
			$('bonne_annee').style.filter="alpha(opacity=100)";
		}	
	}
}
function lance_animation(){
	for (var i=-1; i<6; i++){
		$('noir'+i).style.opacity=1;
		$('noir'+i).style.filter="alpha(opacity=100)";
	}
	$("sourire").style.display='none';
	$("vague").style.height='0px';
	$("photo1").style.height='0px';
	$("photo1").style.top='86px';
	$("photo1").style.left='172px';
	$("photo2").style.height='0px';
	$("photo2").style.top='245px';
	$("photo2").style.left='148px';
	$("photo3").style.height='0px';
	$("photo3").style.top='385px';
	$("photo3").style.left='132px';
	//$('douve').style.left="0px";
	$('douve').style.opacity="100";
	$('douve').style.filter="alpha(opacity=100)";
	$('douve2').style.opacity="0";
	$('douve2').style.filter="alpha(opacity=0)";
	$('bleu').style.display="none";
	$('bleu').style.opacity="0";
	$('bleu').style.filter="alpha(opacity=0)";
	$('avant_plan').style.opacity="1";
	$('avant_plan').style.filter="alpha(opacity=100)";
	//$('texte').innerHTML="";
	$('texte').style.opacity='0';
	$('texte').style.filter="alpha(opacity=0)";
	$('bonne_annee').style.opacity="0";
	$('bonne_annee').style.filter="alpha(opacity=0)";
	//$('bonne_annee').style.width='0px';
	//$('bonne_annee').style.top='340px';
	//$('bonne_annee').style.left='460px';
	//$('bonne_annee').style.display="none";
	$('nom_latin').style.display='none';
	prompteur=0;
	layer_noir=-1;
	opacite=100;
}
function initialisation(){
	lance_animation();
	var_animation=setInterval("animation()",40);
}

var layer_noir;
var opacite;
var var_animation;
var prompteur;
var texte_carte="Le Conservatoire Botanique National de Brest vous souhaite une"
