function Transition(){
	nMenuHpEnCours++;
	if(nMenuHpEnCours > nNbMenuHp) 
		nMenuHpEnCours = 1;
		
	ChangeMenuHP(nMenuHpEnCours, 1);	
}

function  ChangeMenuHP(nParamMenu, nParamTransition){
	// on change le background du menu.
	// on reconstruit le menu
	// on appel l'image de fond
	// on arrete le cycle de transition si dde
	
	nMenuHpEnCours = nParamMenu;
	AnimImageHP();
	
	oEltMenu.style.backgroundImage = 'url(/images/site/accueil/menu/' + nNbMenuHp + '-bg-menu-hp-' + nMenuHpEnCours + '.png)';
	
	var sHtml;
	
	sHtml = "<b>";
	
	for(var i = 0; i < aLibelleMenuHp.length; i++){
		if( i + 1 == nMenuHpEnCours )
			sHtml += '<h2><img src="/images/site/puce/puce_fleche_noire.gif" alt="" height="10" width="8" class="puce_menu_hp" /><a href="' + aLienMenuHp[i] + '">' + aLibelleMenuHp[i] + '</a></h2>\n';
		else
			sHtml += '<h2><img src="/images/vide.gif" alt="" height="10" width="8" class="puce_menu_hp" /><a href="' + aLienMenuHp[i] + '" onmouseover="ChangeMenuHP(' + (i+1) + ', 0);">' + aLibelleMenuHp[i] + '</a></h2>\n';
	}
	
	sHtml += "</b>";

	oEltMenu.innerHTML = sHtml;
	
	if(nParamTransition == 0){
		//pause de l'animation 
		clearInterval(oHpTransition);
		setTimeout("AnimationHP()", nTimerDelaitAnimationHP);
	}
}

function AnimImageHP(){
	var sHtml;
	sHtml = '<a href="' + aLienMenuHp[nMenuHpEnCours - 1] + '"><img src="/images/site/accueil/presentation/' + aImageMenuHp[nMenuHpEnCours - 1] +  '" width="708" height="411" alt="' + aSurvolMenuHp[nMenuHpEnCours - 1] +  '" title="' + aSurvolMenuHp[nMenuHpEnCours - 1] +  '" /></a>';
	
	//$('#image_presentation').fadeTo("fast", 0.5,  function(){oImgPres.innerHTML = sHtml;});
	//$('#image_presentation').fadeTo("fast", 1);
	
	$('#image_presentation').fadeOut("fast", function(){oImgPres.innerHTML = sHtml;});
	$('#image_presentation').fadeIn("fast");
	
	//$('#image_presentation').slideUp("fast", function(){oImgPres.innerHTML = sHtml;});
	//$('#image_presentation').slideDown("fast");
}

function AnimationHP(){
	clearInterval(oHpTransition);
	oHpTransition = setInterval("Transition()",nTimerAnimationHP);
}



//fonction d'affichage les + photoweb

function ChangeImage(nParam,bParam){
	if (bParam == true)
	{
		if (nParam == 1)
		{
			document.getElementById("img-1").src = "images/site/homepage/qualite-on.png";
			$("#cadre-1").css("border","1px solid #999999");
		}
		else if (nParam == 2)
		{
			document.getElementById("img-2").src = "images/site/homepage/meilleur-photo-on.png";
			$("#cadre-2").css("border","1px solid #999999");
		}
		else if (nParam == 3)
		{
			document.getElementById("img-3").src = "images/site/homepage/satisfaction-on.png";
			$("#cadre-3").css("border","1px solid #999999");
		}
		else if (nParam == 4)
		{
			document.getElementById("img-4").src = "images/site/homepage/mig-on.png";
			$("#cadre-4").css("border","1px solid #999999");
		}
	}
	
	else
	{
		if (nParam == 1)
		{
			document.getElementById("img-1").src = "images/site/homepage/qualite-off.png";
			$("#cadre-1").css("border","1px solid #DDDDDD");
		}
		else if (nParam == 2)
		{
			document.getElementById("img-2").src = "images/site/homepage/meilleur-photo-off.png";
			$("#cadre-2").css("border","1px solid #DDDDDD");
		}
		else if (nParam == 3)
		{
			document.getElementById("img-3").src = "images/site/homepage/satisfaction-off.png";
			$("#cadre-3").css("border","1px solid #DDDDDD");
		}
		else if (nParam == 4)
		{
			document.getElementById("img-4").src = "images/site/homepage/mig-off.png";
			$("#cadre-4").css("border","1px solid #DDDDDD");
		}
	}
}

//fin fonction les + photoweb
