function init_hsrc() {
  if (!document.getElementById) return
  var imgOriginSrc;
  var MouseOverHappened;
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
	if (imgarr[i].getAttribute('hsrc')) {
		imgTemp[i] = new Image();
		imgTemp[i].src = imgarr[i].getAttribute('hsrc');
		imgarr[i].onmouseover = function() {
			imgOriginSrc = this.getAttribute('src');			
			this.setAttribute('src',this.getAttribute('hsrc'));
			MouseOverHappened=true;
		}
		imgarr[i].onmouseout = function() {
			if(MouseOverHappened)
				this.setAttribute('src',imgOriginSrc);
		}
	}
  }
}

startList = function() {
	var sfEls = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
	//document.getElementById("page").style.height=700;
}
if (window.attachEvent) window.attachEvent("onload", startList);

function validDemande()
{
	if (IsEmpty(document.formulaire.nom,"Veuillez entrer votre nom!")) return(false);
	if (IsEmpty(document.formulaire.prenom,"Veuillez entrer votre prénom!")) return(false);
	if (IsEmpty(document.formulaire.email,"Veuillez entrer votre adresse de courriel!")) return(false);
	if (IsEmpty(document.formulaire.tel,"Veuillez entrer votre numéro de téléphone!")) return(false);
	if (IsEmpty(document.formulaire.message,"Veuillez entrer votre message!")) return(false);
	return(true);
}

function openReal(ferme,img)
{
	window.open('photos.asp?ferme='+ferme+'&img='+img,'zoom','width=750,height=500');	
}

var arr = "";
var laferme = "";
var arrpos = 0;

function initSlideShow(arrImg,selImg,ferme)
{
	arr = arrImg;
	laferme = ferme;
	for(var i=0; i<arr.length; i++){
		if(arr[i]==selImg) arrpos=i;
	}
	
	document.getElementById("slideShow").style.backgroundImage = "url(secure128/realisation/" + selImg +")";
	document.getElementById("slideShow").style.backgroundPosition = "center center";
	document.getElementById("slideShow").style.backgroundRepeat = "no-repeat";
	document.getElementById("slideShow").style.backgroundColor = "#B2C1D3";
}
function gotoimg(sens)
{
	var imgsrc = "";
	
	if(sens!="next"){
		if((arrpos-1)==-1){
			imgsrc = arr[arr.length-1];
			arrpos=arr.length-1;
		}else{
			imgsrc = arr[arrpos-1];
			arrpos=arrpos-1;
		}
	}else{
		if((arrpos+1)==arr.length){
			imgsrc = arr[0];
			arrpos=0;
		}else{
			imgsrc = arr[arrpos+1];
			arrpos=arrpos+1;
		}
	}
	document.getElementById("slideShow").style.backgroundImage =  "url(secure128/realisation/" +  imgsrc +")";
}