var largeur_photo = 0 ;
var largeur_calque = 390 ;
var dep = 0;
var bof = 0;
var bif = 0;
var numero = 0;
function move ()

	{
	div0 = document.getElementById("photo0");
	div1 = document.getElementById("photo1");
	int0 = parseInt(div0.style.left) + dep;
	int1 = parseInt(div1.style.left) + dep;
	div0.style.left = int0.toString(10) + "px";
	div1.style.left = int1.toString(10) + "px";
	if (dep < 0)
		{
		if (parseInt(div0.style.left) < -largeur_photo) {int1 += largeur_photo; div0.style.left = int1.toString(10) + "px";}
		if (parseInt(div1.style.left) < -largeur_photo) {int0 += largeur_photo; div1.style.left = int0.toString(10) + "px";}
		}
	else
		{
		if (parseInt(div0.style.left) > largeur_calque) {int1 -= largeur_photo; div0.style.left = int1.toString(10) + "px";}
		if (parseInt(div1.style.left) > largeur_calque) {int0 -= largeur_photo; div1.style.left = int0.toString(10) + "px";}
		}
	setTimeout ("move ()", 40);
	}
	
function l ()
	{
	div0 = document.getElementById("photo0");
	div1 = document.getElementById("photo1");
	div0.style.left = "0px";
	div1.innerHTML = div0.innerHTML ;
	int0 = parseInt(div0.style.left) + largeur_photo;
	div1.style.left = int0.toString(10) + "px";
	div2 = document.getElementById("fondtransparent");
	largeur_calque = parseInt(div2.offsetWidth);
	move () ;
	}

function taille (largeur,hauteur,doc)
	{
	if (bof == 0)
		{
		docum="p"+doc;
		doc0 = document.getElementById(docum);
		nt = largeur_photo + 10;
		fac = largeur/hauteur;
		doc0.style.left = nt.toString(10) + "px";
		nl = Math.round(parseInt(200*fac)) + 10 ;
		largeur_photo += nl;
		}
	}

function chargeimage (doc)
	{
		adresse = location.href;
		posi = adresse.indexOf("&id_document");
		if (posi == -1)
			{
				location.href = location.href+"&id_document="+doc;
			}
		else
			{
				adresse = adresse.substring(0,posi);
				location.href = adresse + "&id_document="+doc;
			}
	}

function setOpacity(valuee,valuet,eti)
	{
	etiquette="etiquette"+eti;
	text = eti;
	div0 = document.getElementById(etiquette);
	div0.style.opacity = valuee/10;
	div0.style.filter = 'alpha(opacity=' + valuee*10 + ')';
	text0 = document.getElementById(text);
	text0.style.opacity = valuet/10;
	text0.style.filter = 'alpha(opacity=' + valuet*10 + ')';	
	}
	
function setOpacitymenu(valuee,valuet,eti)
	{
	if (eti != numero)
		{
		text = "menugal"+eti;
		etiquette="etiquettemenu"+eti;
		div0 = document.getElementById(etiquette);
		div0.style.opacity = valuee/10;
		div0.style.filter = 'alpha(opacity=' + valuee*10 + ')';
		text0 = document.getElementById(text);
		text0.style.opacity = valuet/10;
		text0.style.filter = 'alpha(opacity=' + valuet*10 + ')';
		}
	}

function numart(num)
	{
	numero = num;
	text = "menugal"+num;
	etiquette="etiquettemenu"+num;
	div0 = document.getElementById(etiquette);
	div0.style.backgroundColor ='white';
	div0.style.opacity = 0.5;
	div0.style.filter = 'alpha(opacity=' + 50 + ')';
	text0 = document.getElementById(text);
	text0.style.color = 'black';
	text0.style.opacity = 1;
	text0.style.filter = 'alpha(opacity=' + 100 + ')';	
	}

function montrecom()
	{
	comm = document.getElementById("commentaires");
	comm.style.visibility = "visible";
	}
function cachecom()
	{
	comm = document.getElementById("commentaires");
	comm.style.visibility = "hidden";
	}

