function precharger_images(){
	liste_image=0;
	var heavyImage= new Array();
	$$('.photo_liee_liste a').each(function(lien_image) {
		heavyImage[liste_image] = new Image(); 
		heavyImage[liste_image] = lien_image.get('alt');
		liste_image++;
	});
	
}

function agenda_defilant(){
	if($('contenu_evenements')){
		var nombre_items=0;
		$$('#contenu_evenements .evenement').each(function(el) {
			nombre_items++;
		});
		var marge=52;
		marge=parseInt(marge);
		
		
		marge_top=$('contenu_evenements').getStyle('margin-top');
		
		if(marge_top==undefined) marge_top=0;
		marge_top=parseInt(marge_top);
		marge_top_calcul=-(nombre_items-2)*marge;
		//alert('marge_top='+marge_top+' marge_top_calcul='+marge_top_calcul);
		if(i>2){
			if(marge_top>marge_top_calcul){
				
				nouvelle_marge=marge_top-marge;
				//alert('on bouge nouvelle_marge='+nouvelle_marge);
				$('contenu_evenements').set('tween', {
					duration: 500
				}).tween('marginTop',nouvelle_marge+'px');
				setTimeout(agenda_defilant,5000);
			}else{
				//alert('reset');
				$('contenu_evenements').set('tween', {
					duration: 500
				}).tween('marginTop','0px');
				setTimeout(agenda_defilant,3000);
			}
		}
	}
}


	function shadow_img2(){
		//var el=$('photo_apercu_786');
		 $$('.photo_cadre').each(function(el) {
			ombrer_element(el,'true');
		});
	}
		
	function ombrer_element(el,redimentionner){
		if(el.offsetWidth>0){
			
			var padding=8;
			var nombre_tours=8;
			var limite_affichage=380;
			if(redimentionner=='true'){
				taille_actuelle=el.offsetWidth;
				taille_finale=taille_actuelle-2*padding-4*nombre_tours;

				hauteur_actuelle=el.offsetHeight-2*padding;
				rapport_image=el.offsetWidth/el.offsetHeight
				hauteur_finale=taille_finale/rapport_image;
				hauteur_finale=hauteur_actuelle;
				//alert(rapport_image);
				if(taille_actuelle>limite_affichage){
					el.set('width',taille_finale);
					el.set('height',hauteur_finale);
				}else{
					taille_finale=taille_actuelle;
					hauteur_finale=taille_actuelle/rapport_image;
				}
				el.setStyle('padding',padding+'px');
				//alert('taille_actuelle='+taille_actuelle+' taille_finale='+taille_finale);	
			}else{
				taille_actuelle=el.getStyle('width').replace('px','');
				hauteur_actuelle=el.getStyle('height').replace('px','');
				taille_finale=taille_actuelle;
				hauteur_finale=hauteur_actuelle;
				el.setStyle('padding',padding+'px');
				//taille_finale=el.offsetWidth-2*padding-4*nombre_tours;
			}
		
			var destination=el;
			for (p=0;p<9;p++){
				var couleur=220+p*5;
				var taille=2*p+parseInt(taille_finale)+2*padding;
				var hauteur=2*p+parseInt(hauteur_finale)+2*padding;
				//alert(hauteur);
				var container = new Element('div').setStyles({
					border: 'solid 1px rgb('+couleur+','+couleur+','+couleur+')',
					width:taille+'px',
					height:hauteur+'px'

				}).injectBefore(destination).adopt(destination);
				container.addClass('div_ombre');
				destination=container;
			}
		}
	}
