function changerImage(img, src, maxWidth, maxHeight)
{
	// img => identifiant de l'image
	// src => chemin de l'image
	// maxWidth => largeur maximale de la petite image
	// maxHeight => hauteur maximale de la petite image

	var image = new Image();

	// une fois l'image chargée :
	image.onload = function()
	{
		// si l'image est désignée par son id
		if(typeof img == "string") { img = document.getElementById(img); }

		// si l'image doit être redimensionnée
		var redux;
		redux = 1;
		
		if(maxWidth && maxHeight)
		{
			if(image.width > maxWidth || image.height > maxHeight)
			{
				redux = Math.max(image.width/maxWidth, image.height/maxHeight);
			}
		}

		// on affiche l'image
		img.src = image.src;
		img.width = Math.round(image.width / redux);
		img.height = Math.round(image.height / redux);

		img.style.cursor='pointer';
	}

	image.src = src;
}
