// ELYWEB PRELOAD IMAGES -->

	Plus = new Image();
	Plus.src = "/central/menu/plus.gif";

	Moins = new Image();
	Moins.src = "/central/menu/moins.gif";

	Menu = new Image();
	Menu.src = "/central/menu/menu.png";

	PrevOff = new Image();
	PrevOff.src = "/central/interface/previous-off.png";

	PrevOn = new Image();
	PrevOn.src = "/central/interface/previous-on.png";

	PrevOver = new Image();
	PrevOver.src = "/central/interface/previous-over.png";

	NextOff = new Image();
	NextOff.src = "/central/interface/next-off.png";

	NextOn = new Image();
	NextOn.src = "/central/interface/next-on.png";

	NextOver = new Image();
	NextOver.src = "/central/interface/next-over.png";

// End -->

function ShowGalerie(what,DivID)
{
	if ( document.getElementById && document.getElementById(DivID) )
		{
		var Galerie = document.getElementById(DivID);
		var State = true;
		}
	else
		{		
		var State = false;
		}

	if (State)
		{
		Galerie.className = ( Galerie.className == 'HiddenDiv' ) ? '' : 'HiddenDiv';
		Galerie.style.visibility = ( Galerie.style.visibility == 'visible' ) ? 'hidden' : 'visible';
		}
	LoadImages(DivID);
	ChangeButton(what,DivID);
}


function LoadImages(DivID)
{
	var div = document.getElementById(DivID);
	var image = div.getElementsByTagName('img');

	for (i=0;i<image.length;i++)
	{
	var URL = image.item(i).getAttribute('lowsrc');
	image.item(i).src = URL
	}
}

function ChangeButton(what,DivID)
{
	var Galerie = document.getElementById(DivID);
	what.className = ( Galerie.className == 'HiddenDiv' ) ? 'Plus' : 'Moins';
}

function Download(what)
{
	var PictureURL = what.getAttribute('src').replace("/miniatures/","/");
	popupImage = window.open(PictureURL,'_blank');
}

function Maximize(what)
{
	var PictureLocation = what.getAttribute('src');
	
	if (PictureLocation == undefined)
		{
		var PictureURL = what.getAttribute('href');
		}

	else if (PictureLocation != undefined && PictureLocation.match('/miniatures/') == '/miniatures/')
		{
		var PictureURL = what.getAttribute('src').replace("/miniatures/","/");
		}

	Popup(PictureURL);
	return false;
}

function Popup(URL)
{
	var Popup = document.getElementById("Popup");

	if(!Popup)
		{
		document.body.innerHTML+= '<div id="Popup"></div>';
		ShowPopup(URL);
		}
	else
		{
		Popup.style.display = "";
		ShowPopup(URL);
		}
}


function ShowPopup(URL)
{
	var PageHeight = document.body.scrollHeight+150;
	var WindowHeight = window.innerHeight||document.body.parentNode.scrollHeight||0;

	if(PageHeight<WindowHeight)
		{
		PageHeight = WindowHeight;
		}

	var PagePosition = window.pageYOffset||document.documentElement.scrollTop||0;

	Picture = new Image;
	Picture.src = URL;

	var PopupContent = '<div class="PopupCache" style="width:100%;height:' + PageHeight + 'px"></div>';
		PopupContent+= '<div class="PopupTable" style="top:' + PagePosition + 'px">';
		PopupContent+= '<table width="100%" height="100%">';
		PopupContent+= '<tr><td align="center">';
		PopupContent+= '<img class="PopupImage" src="' + URL + '" alt="" />';
		PopupContent+= '<div id="PopupClose" onclick="ClosePopup()"></div>';
		PopupContent+= '</td></tr></table></div>';

	var Popup = document.getElementById("Popup");
	Popup.innerHTML = PopupContent;
}

function ClosePopup()
{
	var Popup = document.getElementById("Popup");
	Popup.style.display = "none";
	Popup.innerHTML = "";
}