//gestion du pied de page

function setframe() {

var contentHeight=
            	getWindowHeight();
var HautHeight=
		document.getElementById('haut').offsetHeight;
var BasHeight=
		document.getElementById('bas').offsetHeight;
                    
          document.getElementById('frame').style.height=
            contentHeight-HautHeight-BasHeight  - 20      +'px';   
          document.getElementById('gauche').style.height=
            contentHeight-HautHeight-BasHeight        +'px';   
          document.getElementById('droite').style.height=
            contentHeight-HautHeight-BasHeight        +'px';   
            
}

function getWindowHeight() {
    var windowHeight=0;
    if (typeof(window.innerHeight)=='number') {
        windowHeight=window.innerHeight;
    }
    else {
     if (document.documentElement&&
       document.documentElement.clientHeight) {
         windowHeight = document.documentElement.clientHeight;
    }
    else {
     if (document.body&&document.body.clientHeight) {
         windowHeight=document.body.clientHeight;
      }
     }
    }
    return windowHeight;
}


window.onload = function() {
setframe();
}
window.onresize = function() {
setframe();
}





function Visibilite(nr)
{

	if (document.layers)
	{
		vista = (document.layers[nr].visibility == 'hide') ? 'show' : 'hide'
		document.layers[nr].visibility = vista;
	}
	else if (document.all)
	{
		vista = (document.all[nr].style.visibility == 'hidden') ? 'visible'	: 'hidden';
		document.all[nr].style.visibility = vista;
	}
	else if (document.getElementById)
	{
		vista = (document.getElementById(nr).style.visibility == 'hidden') ? 'visible' : 'hidden';
		document.getElementById(nr).style.visibility = vista;

	}
}

function check() {
	var verrou1 = 1,verrou2 = 1,verrou3 = 1;
	var Point = 0 , Chiffre = 0;
	

		if (document.formContact.NomPrenom.value == "")	{
				document.formContact.NomPrenom.style.backgroundColor = "#F3C200";
		}
		else
		{	verrou1 = 0;
			document.formContact.NomPrenom.style.backgroundColor = "#FFFFFF";
 		}
 
 
	
		if (document.formContact.mail.value != "")	{
		indexAroba = document.formContact.mail.value.indexOf('@');
		indexPoint = document.formContact.mail.value.indexOf('.');

			if ((indexAroba < 0) || (indexPoint < 0))	
			{	document.formContact.mail.style.backgroundColor = "#F3C200";
			}
			else
			{	if (document.formContact.mail.value.length > 5)
				{	
					verrou2 = 0;
					document.formContact.mail.style.backgroundColor = "#FFFFFF";
				}
					
			}	

		}
		else	
		{	document.formContact.mail.style.backgroundColor = "#F3C200";
 		}
		
	

		
		if (document.formContact.Telephone.value == "")	{
			document.formContact.Telephone.style.backgroundColor = "#F3C200";
		}
		else{
			verrou2 = 1;
			

			
			for(var i = 0; i < document.formContact.Telephone.value.length; i++)
		   {
  		     s = document.formContact.Telephone.value.charAt(i);
       	  if ( s == '.') 				 Point ++;
			  if ((s >= 0) && (s <= 9)) Chiffre ++;						
				
  			  if (Point == 4 && Chiffre == 10 )
  			  {	verrou2 = 0;
  			  		document.formContact.Telephone.style.backgroundColor = "#FFFFFF";
  			  }
        	  else		
				{	document.formContact.Telephone.style.backgroundColor = "#F3C200";
					
				}



  		     if( !((s >= 0) && (s <= 9)) && (s != '.'))
     		  {	
					document.formContact.Telephone.style.backgroundColor = "#F3C200";
     		  }
     		  
     		  }
     		  
   		}
			
	if (document.formContact.Question.value == "")	{
			document.formContact.Question.style.backgroundColor = "#F3C200";
	}
		else
		{	verrou3 = 0;
			document.formContact.Question.style.backgroundColor = "#FFFFFF";
 		}
 		
		

 
//Si aucun message d'alerte a été initialisé on retourne TRUE
	if (verrou2 == 0 && verrou1 == 0 && verrou3 == 0 ){	
		document.formContact.validerbbt.disabled=false;
		return(false);
	}else{
		document.formContact.validerbbt.disabled=true;
		return(true);
	}
}


function GenererMail(nom, domaine, sujet)
{
	var subject = "subject=" + sujet ;
	document.write('<a href=\"mailto:' + nom + '@' + domaine + ' ?' + subject + '\">') ;
	document.write(nom + '@' + domaine + '</a>') ;
}


  function AfficherArticle(IDArticle)
  {
  if (document.getElementById(IDArticle).style.display == 'none') {
    document.getElementById(IDArticle).style.display='block';

  } else {
    document.getElementById(IDArticle).style.display='none';
  }
}

  function AfficherMenu(IDMenu)
  {
  if (document.getElementById(IDMenu).style.display == 'none') {
    document.getElementById(IDMenu).style.display='block';
}
  }
  
    function CacherMenu(IDMenu)
  {
  if (document.getElementById(IDMenu).style.display == 'block') {
    document.getElementById(IDMenu).style.display='none';
}
  }
  
  
  
