var positionFinale = 0 ;
var posActuelle = 0 ;
var pas = 5 ;
var largeurPhotoFond = 785 ;
var posActuellePhoto = 0 ;
var positionFinalePhoto = 100 ;
var pasPhoto = 5 ;
var contenuOuvert = true ;
var sonOuvert = true ;

function changePage(page)
{
	if(page=="reservation") window.location="http://www.france-sud-gite.fr/st_joseph/html/fr/reservation_1.php";
	else window.location = page+".php?son="+sonOuvert ;
}

function son()
{
	divSon = document.getElementById("son") ;
	if(sonOuvert)
	{
		divSon.innerHTML = '<a href="#" onClick="son()"><img src="img/speaker_off.gif" border="0"></a>' ;
		sonOuvert = false ;
	}
	else
	{
		divSon.innerHTML = '<embed src="cigales.mp3" hidden="true" autostart="true" /><noembed><BGSOUND SRC="cigales.mp3"></noembed><a href="#" onClick="son()"><img src="img/speaker.gif" border="0"></a>' ;
		sonOuvert = true ;
	}
}

function fermeContenu()
{
	div = document.getElementById("contenu") ;
	div2 = document.getElementById("contenu2") ;
	divFleche = document.getElementById("fleche") ;

	if(contenuOuvert)
	{
		div.style.left = posActuelle - div.offsetWidth + 17 ;
		div2.style.left = posActuelle - div2.offsetWidth + 17 ;
		divFleche.src = "img/flecheDroite.gif" ;
		divFleche.alt = "Afficher le texte" ;
		
		contenuOuvert = false ;
	}
	else
	{
		div.style.left = posActuelle ;
		div2.style.left = posActuelle ;
		divFleche.src = "img/flecheGauche.gif" ;
		divFleche.alt = "Cacher le texte" ;
		
		contenuOuvert = true ;
	}
}

function animContenu()
{
	div = document.getElementById("contenu") ;
	div2 = document.getElementById("contenu2") ;
	if(posActuelle<positionFinale)
	{
		posActuelle += pas ;
		div.style.left = posActuelle ;
		div2.style.left = posActuelle ;
		
		setTimeout('animContenu()', 10) ;
	}
}

function animContenu2()
{
	div = document.getElementById("contenu") ;
	div2 = document.getElementById("contenu2") ;
	if(posActuelle<positionFinale)
	{
		posActuelle += pas ;
		div.style.left = posActuelle ;
		div2.style.left = posActuelle ;
		
		setTimeout('animContenu2()', 10) ;
	}
	else animPhoto() ;
}

function animPhoto()
{
	div = document.getElementById("photo") ;
	if(posActuellePhoto<positionFinalePhoto)
	{
		posActuellePhoto += pasPhoto ;
		div.style.opacity=posActuellePhoto/100;
		div.style.filter='alpha(opacity='+posActuellePhoto+')';
		div.style.MozOpacity=posActuellePhoto/100;
		
		setTimeout('animPhoto()', 10) ;
	}
	else
	{
		div.style.opacity=1;
		div.style.filter='alpha(opacity=100)';
		div.style.MozOpacity=1;
	}
}

function init2(largeur, pageOuverte)
{
	document.getElementById(pageOuverte).className = "menuOuvert" ;
	document.getElementById("contenu").style.width = largeur ;
	document.getElementById("contenu2").style.width = largeur ;
	positionFinale = document.getElementById("transpGauche").offsetWidth + 20 + 13 ;
	posActuelle = positionFinale - largeur ;
	
	document.getElementById("imgCache").style.width = positionFinale - 13 ;
	
	document.getElementById("contenu").style.left = positionFinale ;
	animContenu2() ;
}

function init(largContenu, pageOuverte)
{
	document.getElementById(pageOuverte).className = "menuOuvert" ;
	document.getElementById("contenu").style.width = largContenu ;
	document.getElementById("contenu2").style.width = largContenu ;
	positionFinale = document.getElementById("transpGauche").offsetWidth + 20 + 13 ;
	posActuelle = positionFinale - largContenu ;
	
	document.getElementById("imgCache").style.width = positionFinale - 13 ;
	
	document.getElementById("contenu").style.left = positionFinale ;
	animContenu() ;
}
