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 += '<span><img src="/images/site/puce/puce_fleche_noire.gif" alt="" height="10" width="8" class="puce_menu_hp" /><a href="#" onclick="ChangeMenuHP(' + (i+1) + ', 0);">' + aLibelleMenuHp[i] + '</a></span>\n';
		else
			sHtml += '<span><img src="/images/vide.gif" alt="" height="10" width="8" class="puce_menu_hp" /><a href="#" onclick="ChangeMenuHP(' + (i+1) + ', 0);">' + aLibelleMenuHp[i] + '</a></span>\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);
}

