// PNG transparent sous internet Explorer
function IE_CorrectAlpha_PNG(){ 
	for(i=0; i<document.images.length; i++){ 
		img    = document.images[i]; 
		imgExt  = img.src.substring(img.src.length-3, img.src.length); 
		imgExt  = imgExt.toUpperCase(); 
		if (imgExt == "PNG"){ 
			imgID    = (img.id) ? "id='" + img.id + "' " : ""; 
			imgClass= (img.className) ? "class='" + img.className + "' " : ""; 
			imgTitle= (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "; 
			imgStyle= "display:inline-block;" + img.style.cssText; 
			if (img.align == "left") { 
				imgStyle = "float:left;"  + imgStyle;
			}else if (img.align == "right"){
				imgStyle = "float:right;" + imgStyle;
			} 
			if (img.parentElement.href){ 
				imgStyle = "cursor:hand;" + imgStyle;
			}        
			strNewHTML    = '<span '+imgID+imgClass+imgTitle+' style="width:'+img.width+'px; height:'+img.height+'px;'+imgStyle+';'+'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+img.src+'\', sizingMethod=\'scale\');"></span>'; 
			img.outerHTML = strNewHTML; 
			i = i-1; 
		}
	}
} 
window.attachEvent("onload", IE_CorrectAlpha_PNG);
/* Pages */
function espacesetvolumes(){
	document.location.href = "index.php?temporaire=1";
}
function signum(){
	document.location.href = "index.php?temporaire=2";
}
function iparespace(){
	document.location.href = "index.php?temporaire=3";
}
function impcont(){
	document.location.href = "implantations-et-contacts.php";
}
function ungroupe(){
	document.location.href = "un-groupe.php";
}
function desprest(leLien){
	document.location.href = leLien+".php";
}

// affiche le diaporama
function affichDiapo(chaine,couleur,legende){
	document.getElementById("caseDiapo").innerHTML='<div id="diaporamaProduits" align="center"><strong>Vous devez installer Flash player pour visualiser cette animation.</strong> Rendez vous sur le site de <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&amp;Lang=French&amp;P5_Language=French" target="_blank">Macromédia</a> pour télécharger ce plugin.</div>';
	
	var so = new SWFObject("flash/diaporama-photos.swf", "diaporamaProduits", "542", "150", "8", "#FFFFFF");
	so.addVariable("tabImage", chaine);
	so.addVariable("couleurPrincipale", couleur);
	so.addVariable("ttt", legende);
	so.addParam("wmode", "transparent");
	so.addParam("quality","high");
	so.write("diaporamaProduits");
}

function encodeMailto(a,b,c,d){
	var name=a;
	var at="@";
	var host=b;
	document.write('<a hr'+'ef="mai'+'lto:'+name+at+host+'" title="'+c+'"><img src="images/contact/'+d+'.jpg" alt="'+c+'" border="0" /></a>');
}


// Changement image "des prestations"
/*
function changeImage(leNum){
	document.getElementById("zoomImg").src = "images/des-prestations/imgG"+leNum+".jpg";
	document.getElementById("legende").innerHTML = tabLegende[leNum];
}
// Div
function afficheCache(qui, couleur, chaine, couleur2) {
	for(i=1;i<=document.getElementById("nbMC").value;i++){
		document.getElementById("layer"+i).style.display="none";
		document.getElementById("fleche"+i).src="images/picto/flecheDroite"+couleur+".jpg";
	}
	document.getElementById("layer"+qui).style.display="block";
	document.getElementById("fleche"+qui).src="images/picto/flecheDiagonale"+couleur+".jpg";
	
	affichDiapo(chaine,couleur2);
}*/

function affiche(el, couleur){
	document.getElementById(el+"Bleu").style.display = "none";
	document.getElementById(el+"Vert").style.display = "none";
	document.getElementById(el+"Rouge").style.display = "none";
	document.getElementById(el+couleur).style.display = "block";
}

function afficheForm(couleur){
	document.getElementById("formulaireCT").style.display = "block";
	document.getElementById("ville"+couleur).checked = true;
}