//alert("test");

startList = function() {
	var sfEls = document.getElementById("nav").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"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", startList);



var displayed="commerce_service";

function displayMenu1(x){
	if (displayed != "0") document.getElementById(displayed).style.display = "none";
	if (displayed != x) {
		document.getElementById(x).style.display="";
		displayed = x;
	} else {
		document.getElementById(x).style.display="none";
		displayed = "0";
	}
}

var arr = "";
var arrpos = 0;
var thetimeout = "";

function initSlideShow(arrImg,selImg) {
	arr = arrImg;
	for(var i=0; i<arr.length; i++){
		if(arr[i]==selImg) arrpos=i;
	}
	
	document.getElementById("slideShow").style.backgroundImage = "url(images/maison/big/" + selImg +")";
	document.getElementById("slideShow").style.backgroundPosition = "center center";
	document.getElementById("slideShow").style.backgroundRepeat = "no-repeat";
	document.getElementById("slideShow").style.backgroundColor = "#C8BC9D";
}
function gotoimg(sens) {
	if (window.thetimeout) clearTimeout(thetimeout);
	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;
		}
	}
	thetimeout = setTimeout("document.getElementById('slideShow').style.backgroundImage = 'url(images/maison/big/" + imgsrc + ")';",5);
}