<!--//--><![CDATA[//><!--
 sfHover = 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"), "");}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]>

function cacher(partie)
{ if(document.getElementById)
document.getElementById(partie).style.visibility = 'hidden'
}
function afficher(partie)
{ if(document.getElementById)
document.getElementById(partie).style.visibility = 'visible'
}
function cacherafficher(partie)
{ if(document.getElementById(partie).style.visibility == 'visible')
{document.getElementById(partie).style.visibility = 'hidden';}
else {document.getElementById(partie).style.visibility = 'visible';}
}
function CaracMax(texte, max)
{ if (texte.value.length >= max)
{ alert('Taille limite fixée à ' + max + ' caractères !') ; texte.value = texte.value.substr(0, max - 1) ;}
}
function couleur(obj) { obj.style.backgroundColor = "#FFFFFF";}
function check() { var msg = ""; if (document.formulaire.clecteurs_nom.value == "")
{ msg += "Veuillez saisir votre nom ou pseudonyme.\n"; document.formulaire.clecteurs_nom.style.backgroundColor = "#FFED6F";}
if (document.formulaire.clecteurs_ville.value == "")
{ msg += "Veuillez saisir votre ville.\n"; document.formulaire.clecteurs_ville.style.backgroundColor = "#FFED6F";}
if (document.formulaire.clecteurs_email.value == "")
{ msg += "Veuillez saisir votre email.\n"; document.formulaire.clecteurs_email.style.backgroundColor = "#FFED6F";}
if (msg == "") return(true); else { alert(msg); return(false);}
}

// Affichage d'un indicateur de chargement - Pour Prototype.js
// Parametre : showindicator="nom_cadre_a_afficher".

Ajax.Responders.register({
  onCreate: function() {
    if(Ajax.activeRequestCount>0 && showindicator) $(showindicator).style.display = 'block';
  },
  onComplete: function() {
    if(Ajax.activeRequestCount==0 && showindicator) $(showindicator).style.display = 'none';
	showindicator = '';
  }
});

// Change le style des onglets

function changestyle(id,listeOnglets)
{
	for(i = 0; i < listeOnglets.length; i++) {
		listeOnglets[i].style.background = '#e3f8e9';
		listeOnglets[i].style.border = '1px solid #000000';
	}
	$(id).style.background = '#74d190';
	$(id).style.borderBottom = '1px solid #74d190';
}