// Fenêtres
function OuvrirFenetre(url)
{
	window.open(url);
}

function OuvrirPopup(url,l,h)
{
	var x=(screen.width-l)/2;
	var y=(screen.height-h)/2;
	window.open(url,"","top="+y+",left="+x+",width="+l+",height="+h+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes");
}



function OuvrirPopupScroll(url,l,h)
{
	var x=(screen.width-l)/2;
	var y=(screen.height-h)/2;
	window.open(url,"","top="+y+",left="+x+",width="+l+",height="+h+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
}



// Formulaires
function AfficherElement(id, mode)
{
	obj = document.getElementById(id);
	if(!obj)
		return false;
	if(mode == undefined)
	{
		if(obj.style.display == "")
			obj.style.display = "none";
		else
			obj.style.display = "";
	}
	if(mode == 0)
		obj.style.display = "none";
	if(mode == 1)
		obj.style.display = "";
}


// Diaporama
function diaporamaAuto()
{
	idActuel ++;
	if(idActuel > nombrePhotos)
		idActuel = 1;
	diaporamaAfficherPhoto();
	timeoutId = window.setTimeout("diaporamaAuto()", vitesse);
}
function diaporamaAfficherPhoto()
{
	document.getElementById("diaporama").src = dossierPhotos+idActuel+".jpg";
}
function diaporamaPrecedente()
{
	diaporamaStop();
	idActuel --;
	if(idActuel == 0)
		idActuel = nombrePhotos;
	diaporamaAfficherPhoto();
}
function diaporamaSuivante()
{
	diaporamaStop();
	idActuel ++;
	if(idActuel > nombrePhotos)
		idActuel = 1;
	diaporamaAfficherPhoto();
}
function diaporamaStop()
{
	window.clearTimeout(timeoutId);
	lecture = 0;
}
function diaporamaLecture()
{
	if(lecture == 1)
		diaporamaStop();
	else
	{
		lecture = 1;
		diaporamaAuto();
	}
}