// Document JavaScript

// Charge les images
function ChargerImage()
{
	if (document.images)
	{
		this.length = ChargerImage.arguments.length;
		for (var i = 0; i < this.length; i++)
		{
			this[i+1] = new Image();
			this[i+1].src = ChargerImage.arguments[i]
		}
	}
}

// Change l'image
function ChangerImage(nom, src)
{
	document.images[nom].src = src
}

// Formate un chiffre en "00"
function Format00(Chiffre)
{
	var Sortie = (Chiffre.toString().length == 1) ? "0" + Chiffre : Chiffre
	return Sortie
}

// Ouvrir une photo dans une nouvelle fenętre

function OuvrirPhoto(Photo)
{
	window.open("photo.asp?src=" + Photo, 'Photo', 'width=800,height=600,toolbar=no,scrollbars=no,resizable=yes')
}

// Centrer la fenętre et la redimensionner selon la photo

function VerifierGrandeur()
{
	if (document.images[0].complete)
	{
		window.resizeTo(document.images[0].width + 12, document.images[0].height + 100);
		window.moveTo((screen.width - document.images[0].width - 12) / 2, (screen.height - document.images[0].height - 70) / 2);
		window.focus()
	}
	else
	{
		setTimeout('VerifierGrandeur()', 1)
	}
}

// Ouvrir et centrer une fenętre

function OuvrirFenetre(nUrl, nNom, Largeur, Hauteur, Option)
{
	var Gauche = (screen.width) ? (screen.width - Largeur) / 2 : 0;
	var Haut = (screen.height) ? (screen.height - Hauteur) / 2 : 0;
	var Fenetre = window.open(nUrl, nNom, "left=" + Gauche + ",top=" + Haut + ",width=" + Largeur + ",height=" + Hauteur + "," + Option)
}

// Désactive le clique droit de la souris

var msg = "Les photos utilis\351es sur ce site sont prot\351g\351es par des droits d'auteur!";
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
function no_click(e)
{
	if (navigator.appName == 'Netscape' && (e.which == 2 || e.which == 3))
	{
		alert(msg);
		return false
	}
	if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3))
	{
		alert(msg);
		return false
	}
}
window.onmousedown = no_click;
document.onmousedown = no_click