// 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);

/* Divs Calendrier */
function divCal(steack){
	document.getElementById("cal1").style.display="none";
	document.getElementById("cal2").style.display="none";
	document.getElementById("cal3").style.display="none";
	document.getElementById("cal4").style.display="none";
	document.getElementById(""+steack).style.display="block";
}

/* Popup encart Livre sur l'accueil */
function encartLivre() {
	titre="Toulouse secret et insolite";
	w=open("popup-toulouse-secret-et-insolite.php","enc","width=500,height=500,toolbar=no,scrollbars=yes,resizable=no,top=100,left=100");
	w.document.close();
}

/* Ajouter au favoris */
function favoris() {
	/* IE */
	if ( navigator.appName != 'Microsoft Internet Explorer' ){ 
		window.sidebar.addPanel("titre","http://url/",""); 
	}
	/* FireFox */
	else { 
		window.external.AddFavorite("http://url/","titre"); 
	} 
}
/* Menu */
function afficheCache(qui,combien) {
	for(i = 1; i<= combien; i++ ){
		if (qui=="bloc"+i){
			document.getElementById("layer"+i).style.display="block";
		}else{
			document.getElementById("layer"+i).style.display="none";
		}
	}
}

/* Popup image centré + lien fermer */
function PopupImage(img) {
	titre="Agrandissement";
	w=open("popup-agrandissement.php?img="+img,"image","width=400,height=400,toolbar=no,scrollbars=no,resizable=no,top=0,left=0");
	w.document.close();
}
/* Chargement des pages ŕ partir d'un menu Flash */
function chargePage(page) {
	top.location.href=page+".php";
}
/* Validation javascript des champs */
function arobaceok(email)
{
	if(document.formVousEtes.email.value == ""){
		alert("Il manque votre adresse e-mail!");
		return false;
	}
	var a=document.forms[0].email.value;
	var test="" + a;
	for(var k = 0; k < test.length;k++)
		{
		var c = test.substring(k,k+1);
		if(c == "@")
		{
		return true;
		}
	}
	alert("La syntaxe de votre e-mail est incorrect !");
	return false;
}