	$(document).ready(init);
	
	function init(){
		initAccueil();
		initMur();
		resizeInit();/**/
	}
	function resizeInit(){
		$(window).resize(resizeAll);
		resizeAll();
	}
	function resizeAll(){
		
		var h=$(this).height();
		var w=$(this).width();
		var w0=$("#page").width();
		marge=(w-w0)/2;
		if (marge<0){
			marge=0;
		}
		$("#fond1").css({width: marge});
		$("#fond2").css({width: marge});
	}
	function initAccueil(){
		if ($("#prochainsConcerts").length==0) return;
		initPhotosConcerts();
		jQuery.easing.def = "easeOutExpo";
		rollOverConcertsAccueilInit();
		rollOverAutresAccueilInit();
	}
	function initPhotosConcerts(){
		$(".concert").each(function(){
			$("img",$(this)).hide();
			var src=$("img",$(this)).attr("src");
			$(this).css("background-image", "url("+src+")");
		});
		
	}
	function rollOverConcertsAccueilInit(){
		$("div.concert").each(rollOverConcertAccueilInit);
	}
	function rollOverConcertAccueilInit(){
		$("div.descriptif",$(this)).css({fontSize: 3});
		$("a.plus", this).mouseover(function(){
			rollOverConcertAccueil($(this).parent(".concert"));
		});
		$("a.plus", this).mouseout(function(){
			rollOutConcertAccueil($(this).parent(".concert"));
		});
	}
	function rollOverConcertAccueil(elt){
		$("div.descriptif",elt).stop().animate({fontSize: 12},300);
	}
	function rollOutConcertAccueil(elt){
		$("div.descriptif",elt).stop().animate({fontSize: 3},300);
	}
	
	
	function rollOverAutresAccueilInit(){
		$("div.autre").each(rollOverAutreAccueilInit);
	}
	function rollOverAutreAccueilInit(){
		$("a.plus", this).mouseover(function(){
			rollOverAutreAccueil($(this).parent(".autre"));
		});
		$("a.plus", this).mouseout(function(){
			rollOutAutreAccueil($(this).parent(".autre"));
		});
	}
	function rollOverAutreAccueil(elt){

		$("div.textes",elt).stop().animate({paddingBottom: 30},300,"");
	}
	function rollOutAutreAccueil(elt){
		$("div.textes",elt).stop().animate({paddingBottom: 10},300);
	}



// MUR

	function initMur(){
		if ($("#mur").length==0) return;
		$("#mur div.annee").each(initMurAnnee);
	}
	function initMurAnnee(){
		groupePar2($(this));
		placeLesVideos($(this));
//		initRollOverPhotos($(this));
	}
	function groupePar2(elt){
		cp=-1;
		$("h3, .photo",elt).each(function(){
			cp++;
			$(this).addClass("grp"+((cp-cp%2)/2));
		});
		cp++;
		var nb=(cp-cp%2)/2+1;
		for (var i=0; i<nb; i++){
			$(".grp"+i,elt).wrapAll("<div class='murCol'></div>");
		}
	}
	function placeLesVideos(elt){
		var nbVideos=$(".video",elt).length;
		var nbCol=$(".murCol",elt).length;
		var nb=Math.min(nbVideos,nbCol);
		for (var i=0; i<nb; i++){
			placeLaVideo(elt,i);
		}
	}
	function placeLaVideo(elt,num){
		var ligne=(num-num%2)/2; // car 2 videos par ligne
		var pair=(ligne%2)==0;
		if (pair){
			$(".video:eq("+num+")",elt).insertAfter($(".murCol:eq("+num+")",elt));
		} else {
			$(".video:eq("+num+")",elt).insertBefore($(".murCol:eq("+num+")",elt));
		}
	}
	function initRollOverPhotos(elt){
		$("a.photo",elt).each(function(){
			initRollOverPhoto($(this));
		});
	}
	function initRollOverPhoto(elt){
		$("span.titre",elt).hide();
		elt.mouseover(function(){
			rollOverPhoto($(this));
		});
		elt.mouseout(function(){
			rollOutPhoto($(this));
		});
		
		$("*",elt).mouseover(function(){
			$(this).stopPropagation();
		});
		$("*",elt).mouseout(function(){
			$(this).stopPropagation();
		});/**/
	}
	function rollOverPhoto(elt){
		$("span.titre",elt).show();
	}
	function rollOutPhoto(elt){
		$("span.titre",elt).hide();
	}
