// JavaScript Document



/* ===================================== OUVERTURE / FERMETURE DU MENU MAIRIE */
	function ouvrirFermeMairie()
	{
		if(document.getElementById("menuVotreMairie").className == "ferme")
		{
			document.getElementById("menuVotreMairie").className = "ouvert";
			document.getElementById("lienVotreMairie").style.backgroundPosition = "0 -32px"; 
		}
		else
		{
			document.getElementById("menuVotreMairie").className = "ferme";
			document.getElementById("lienVotreMairie").style.backgroundPosition = "0 0";
		}
	}
/* ===================================== OUVERTURE / FERMETURE DU MENU MAIRIE */


/* ===================================== OUVERTURE / FERMETURE DU MENU AU QUOTIDIEN */
	function ouvrirFermeQuotidien()
	{
		if(document.getElementById("menuQuotidien").className == "ferme")
		{
			document.getElementById("menuQuotidien").className = "ouvert";
			document.getElementById("lienQuotidien").style.backgroundPosition = "0 -47px"; 
		}
		else
		{
			document.getElementById("menuQuotidien").className = "ferme";
			document.getElementById("lienQuotidien").style.backgroundPosition = "0 0";
		}
	}
/* ===================================== OUVERTURE / FERMETURE DU MENU AU QUOTIDIEN */


/* ============================== FONCTIONNEMENT DU MENU HAUT */
	/*var sousMenu;
	var hauteur;
	
	unction transitionPlus()
	{
		if(opacite < 100)
		{
			opacite += 5;
			sousMenu.filter = 'alpha(opacity='+opacite+')';
		}
		else
		{
			sousMenu.filter = 'alpha(opacity=100)';
			opacite = 100;
			clearInterval('transitionPlus()');
		}
	}*/
	
	function hover(obj){
	  
		UL = obj.getElementsByTagName('ul');
		if(UL.length > 0){
		  sousMenu = UL[0].style;
		  if(sousMenu.display == 'none' || sousMenu.display == '')
		  {
			sousMenu.display = 'block';
			//if(sousMenu =="sousMenu1.style" ||
			//hauteur = 
			//sousMenu.height = "1";
			//setInterval('transitionPlus()',200);
		  }
		  else{
			sousMenu.display = 'none';
			//opacite = 0;
		  }
	  }
	}
	
	function setHover(){
	  LI = document.getElementById('menu').getElementsByTagName('li');
	  nLI = LI.length;
	  for(i=0; i < nLI; i++){
		LI[i].onmouseover = function(){
		  hover(this);
		}
		LI[i].onmouseout = function(){
		  hover(this);
		}
	  }
	}
/* ============================== FONCTIONNEMENT DU MENU HAUT */


/* ============================== CENTRAGE VERTICAL */
	function centrageVertical()
	{
		hauteurPage = document.getElementById("repere").offsetTop + 1;
		hauteurContenu = 642;
		
		if(hauteurPage > hauteurContenu)
		{
			difference = hauteurPage - hauteurContenu;
			document.body.style.paddingTop = (difference/2) +"px";
		}
		else
		{
			document.body.style.paddingTop = 0;
		}
	}
	
	function centrageVertical2()
	{
		hauteurPage = document.getElementById("repere").offsetTop + 1;
		hauteurContenu = 642;
		
		if(hauteurPage > hauteurContenu)
		{
			difference = hauteurPage - hauteurContenu;
			document.body.style.paddingTop = (difference/2) +"px";
		}
		else
		{
			document.body.style.paddingTop = 0;
		}
	}
/* ============================== CENTRAGE VERTICAL */


/* ============================== AFFICHAGE DES FLASH */
	function afficheFlash(version,nom,largeur,hauteur){
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+',0,0,0" width='+largeur+' height='+hauteur+'>\n');
		document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
		document.write('<param name="movie" value='+nom+' />\n');
		document.write('<param name="quality" value="high" />\n');
		document.write('<param name="wmode" value="transparent" />\n');
		document.write('<embed src='+nom+' quality="high" wmode="transparent" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width='+largeur+' height='+hauteur+'></embed>\n');
		document.write('</object>\n');
	}
/* ============================== AFFICHAGE DES FLASH */



/* ============================== verification du foprmulaire */
function verifform()
{
 	if (document.SONDAGE.nom.value=="")
 		{
  		alert("Merci de saisir votre nom.");
  		document.SONDAGE.nom.focus();
  		return false;
 		}
	if (document.SONDAGE.prenom.value=="")
 		{
  		alert("Merci de saisir votre prénom.");
  		document.SONDAGE.prenom.focus();
  		return false;
 		}
	if (document.SONDAGE.mail.value=="")
 		{
  		alert("Merci de saisir votre adresse e-mail.");
  		document.SONDAGE.mail.focus();
  		return false;
 		}
	if (document.SONDAGE.q1.value=="")
 		{
  		alert("Votre visite est-elle sans but défini ?");
  		document.SONDAGE.q1.focus();
  		return false;
 		}
	if (document.SONDAGE.q2.value=="")
 		{
  		alert("Venez-vous visiter une rubrique en particulier ?");
  		document.SONDAGE.q2.focus();
  		return false;
 		}
	if (document.SONDAGE.q4.value=="")
 		{
  		alert("Votre avis sur la facilité de navigation sur le site");
  		document.SONDAGE.q4.focus();
  		return false;
 		}
	if (document.SONDAGE.q5.value=="")
 		{
  		alert("Quelles rubriques souhaiteriez-vous trouver ?");
  		document.sondage.q5.focus();
  		return false;
 		}
	if (document.SONDAGE.q6.value=="")
 		{
  		alert("Quels services en ligne aimeriez-vous avoir à votre disposition ?");
  		document.SONDAGE.q6.focus();
  		return false;
 		}
	if (document.SONDAGE.q10.value=="")
 		{
  		alert("Habitez-vous Saint Doulchard ?");
  		document.SONDAGE.q10.focus();
  		return false;
 		}
	return true	
}

/* ============================== verification du foprmulaire */
