function init() {
	hoverProduits();
}

function changeDiaporama(no) {
	var diaporamas = document.getElementById("diaporamas");
	for (var i = 0; i < diaporamas.childNodes.length; i++) {
		var image = document.getElementById("portfolioImage");
		if (diaporamas.childNodes[i].firstChild) {
			if (diaporamas.childNodes[i].firstChild.className == "active") {
				var where = diaporamas.childNodes[i].className;
				where = where.substr(1,2);
			}
			diaporamas.childNodes[i].firstChild.className = "";
		}
	}
	for (var i = 0; i <diaporamas.childNodes.length; i++) {
		if (diaporamas.childNodes[i].firstChild && diaporamas.childNodes[i].className == "s" + no) {
			diaporamas.childNodes[i].firstChild.className = "active";
			var regEx = new RegExp (where, 'gi');
			oldSrc = image.firstChild.src;

			image.firstChild.src = "/cide/photo/scripts/0.gif";
			image.firstChild.style.width = "370";
			image.firstChild.style.height = "230";
			image.firstChild.src = oldSrc.replace(regEx, no);
		}
	}
}




function changeDiaporamaAp(no) {
	var diaporamas = document.getElementById("diaporamas");
	for (var i = 0; i < diaporamas.childNodes.length; i++) {
		var image = document.getElementById("appareilsImage");
		if (diaporamas.childNodes[i].firstChild) {
			if (diaporamas.childNodes[i].firstChild.className == "active") {
				var where = diaporamas.childNodes[i].className;
				where = where.substr(1,2);
			}
			diaporamas.childNodes[i].firstChild.className = "";
		}
	}
	for (var i = 0; i <diaporamas.childNodes.length; i++) {
		if (diaporamas.childNodes[i].firstChild && diaporamas.childNodes[i].className == "s" + no) {
			diaporamas.childNodes[i].firstChild.className = "active";
			var regEx = new RegExp (where, 'gi');
			oldSrc = image.firstChild.src;

			image.firstChild.src = "/cide/photo/scripts/0.gif";
			image.firstChild.style.width = "370";
			image.firstChild.style.height = "300";
			image.firstChild.src = oldSrc.replace(regEx, no);
		}
	}
}






function gotoURL(location) {
	document.location=location;
}



function hoverProduits() {
	var divs = document.getElementsByTagName("div");
	for(var q = 0; q < divs.length; q++) {
		if(divs[q].className == "produits un") {divs[q].onmouseover = function() {this.className = "produitsH unH";}; divs[q].onmouseout = function() {this.className = "produits un";};}
		if(divs[q].className == "produits deux") {divs[q].onmouseover = function() {this.className = "produitsH deuxH";}; divs[q].onmouseout = function() {this.className = "produits deux";};}
		if(divs[q].className == "produits trois") {divs[q].onmouseover = function() {this.className = "produitsH troisH";}; divs[q].onmouseout = function() {this.className = "produits trois";};}
		if(divs[q].className == "produits quatre") {divs[q].onmouseover = function() {this.className = "produitsH quatreH";}; divs[q].onmouseout = function() {this.className = "produits quatre";};}
		if(divs[q].className == "produits cinq") {divs[q].onmouseover = function() {this.className = "produitsH cinqH";}; divs[q].onmouseout = function() {this.className = "produits cinq";};}
	}
}

window.onload = init;
