// JavaScript Document
function displayPics()
{
	var photos = document.getElementById('galerie_mini') ;
	
	var liens = photos.getElementsByTagName('a') ;
	
	var big_photo = document.getElementById('big_pict') ;
	

//	var titre_photo = document.getElementById('photo').getElementsByTagName('dt')[0] ;
	// Et enfin le titre de la photo de taille normale

	// Une boucle parcourant l'ensemble des liens contenu dans galerie_mini
	for (var i = 0 ; i < liens.length ; ++i) {
		// Au clique sur ces liens 
		liens[i].onclick = function() {
			big_photo.src = this.href; // On change l'attribut src de l'image en le remplaçant par la valeur du lien
		//	big_photo.alt = this.title; // On change son titre
		//	titre_photo.firstChild.nodeValue = this.title; // On change le texte de titre de la photo
			return false; // Et pour finir on inhibe l'action réelle du lien
		};
	}
}
function displayPics2()
{
	var photos = document.getElementById('galerie_mini2') ;
	
	var liens = photos.getElementsByTagName('a') ;
	
	var big_photo = document.getElementById('big_pict2') ;
	

//	var titre_photo = document.getElementById('photo').getElementsByTagName('dt')[0] ;
	// Et enfin le titre de la photo de taille normale

	// Une boucle parcourant l'ensemble des liens contenu dans galerie_mini
	for (var i = 0 ; i < liens.length ; ++i) {
		// Au clique sur ces liens 
		liens[i].onclick = function() {
			big_photo.src = this.href; // On change l'attribut src de l'image en le remplaçant par la valeur du lien
		//	big_photo.alt = this.title; // On change son titre
		//	titre_photo.firstChild.nodeValue = this.title; // On change le texte de titre de la photo
			return false; // Et pour finir on inhibe l'action réelle du lien
		};
	}
}
function imagehasard()
{
	ima = "images/cadreshasard/m_photo"+Math.floor(Math.random() * 34)
	document.getElementById('divimage').src = ima+".jpg"
  setTimeout("imagehasard()",5000)
}
function imagehasard2()
{
	ima = "images/cadreshasard/m_photo"+Math.floor(Math.random() * 34)
	document.getElementById('divimage2').src = ima+".jpg"
  setTimeout("imagehasard2()",5000)
}
function imagehasard3()
{
	ima = "images/cadreshasard/m_photo"+Math.floor(Math.random() * 34)
	document.getElementById('divimage3').src = ima+".jpg"
  setTimeout("imagehasard3()",5000)
}
function imagehasard4()
{
	ima = "images/cadreshasard/m_photo"+Math.floor(Math.random() * 34)
	document.getElementById('divimage4').src = ima+".jpg"
  setTimeout("imagehasard4()",5000)
}
function imagehasard5()
{
	ima = "images/cadreshasard/m_photo"+Math.floor(Math.random() * 34)
	document.getElementById('divimage5').src = ima+".jpg"
  setTimeout("imagehasard5()",5000)
}
function imagehasard6()
{
	ima = "images/cadreshasard/m_photo"+Math.floor(Math.random() * 34)
	document.getElementById('divimage6').src = ima+".jpg"
  setTimeout("imagehasard6()",5000)
}
function imagehasard7()
{
	ima = "images/cadreshasard/m_photo"+Math.floor(Math.random() * 34)
	document.getElementById('divimage7').src = ima+".jpg"
  setTimeout("imagehasard7()",5000)
}
function appelglobal()
{ 
imagehasard();
imagehasard2();
imagehasard3();
imagehasard4();
imagehasard5();
imagehasard6();
imagehasard7();
displayPics();
displayPics2();
}
window.onload = appelglobal;

// Il ne reste plus qu'à appeler notre fonction au chargement de la page
		

