


/* navig deroulante */
window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=6; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}

var alsa =
{
	display: function()
	{
		if( !document.getElementById || !document.getElementsByTagName ) return false;
		var oDl = document.getElementById('menu').getElementsByTagName('dl'),
			oList = document.getElementById('menu').getElementsByTagName('dd'),
			iI = oDl.length - 1,
			iJ = oList.length - 1;
		for( iJ; iJ>=0; iJ-- )
		{
			oList[iJ].style.display = 'none';
		}
		for( iI; iI>=0; iI-- )
		{
			if( oDl[iI].getElementsByTagName('dd')[0] )
			{
				oDl[iI].onmouseover = function()
				{
					this.getElementsByTagName('dd')[0].style.display = 'block';
				}

				oDl[iI].onmouseout = function()
				{
					this.getElementsByTagName('dd')[0].style.display = 'none';
				}
			}
		}
		return true;
	}
};

var addLoadEvent = function(func)
{
	var oldonload = window.onload;
	if( typeof window.onload != 'function' )
	{
		window.onload = func;
	}
	else
	{
		window.onload = function()
		{
			oldonload();
			func();
		}
	}
};

addLoadEvent(alsa.display);

/* credit */
SignCach=0;
function showHideCredits() {
 	if (SignCach==1) {
	   document.getElementById('signatureTxt').style.visibility='hidden';
	   SignCach=0;
    } else if (SignCach==0) {
       document.getElementById('signatureTxt').style.visibility='visible';
	   SignCach=1;
	}
 }
 
 /* rappel immédiat */
function verifsaisienum(monChamp) {
reg = new RegExp("[^0-9]", "i");
    if (!reg.test(monChamp.value)){
  		//un traitement quelconque 
   	}else{
      alert('Merci de saisir votre numéro sans espace ni tiret');
	  monChamp.value = monChamp.value.substring(0,monChamp.value.length-1);
	}
}


function Verifier_Numero_Telephone(num_tel) {
	var regex = new RegExp(/^(01|02|03|04|05|06|08)[0-9]{8}/gi);
	var match = false;
	if(regex.test(num_tel)) {
 		match = true;
	} else {
		match = false;
	}
 	return match;
}				
					
function validformrappel() {
	var teltxt = document.rappelform.num.value;
	var burtxt = document.rappelform.bur.value;
	if (burtxt == "000") {
		mesbur = "sélectionnez un bureau";
	} else {
		mesbur = "";
	}
	if (Verifier_Numero_Telephone(teltxt)) {
		if (mesbur=="") {
			return true;
		} else {
			alert(mesbur);
			return false;
		}
	} else {
		alert("votre numéro doit comporter 10 chiffres et être un numéro valide \n"+mesbur);
		return false;
	}
}
