
var timeout=500;
var closetimer	= 0;

function showdiv()
{
	cancelclose();
		var ddm = document.getElementById('dropdown');
			ddm.style.display="block";
	
}
function hidediv()
{
	
	var ddm = document.getElementById('dropdown');
			
			ddm.style.display="";
	
}
function mclosetime()
{
	closetimer = window.setTimeout(hidediv,timeout);
}

function cancelclose()
{

		window.clearTimeout(closetimer);
		closetimer = null;
}

	if(document.images)
	{
		
		var offImg = new Image(10,10);
		var onImg = new Image(10,10);

		offImg.src = "images/mini-add.gif";
		onImg.src = "images/mini-minus.gif";
	}
	

// BOOLEAN VALUE
var boolean=true;

function hNsdiv(thistag, imgName)
{	

    var allHTMLTags=document.getElementsByTagName('*');
	
	
    for (i=0; i<allHTMLTags.length; i++) {

	if(allHTMLTags[i].className==thistag){

		if(boolean==true)
		{
			allHTMLTags[i].style.display='none';
			document.images[imgName].src = offImg.src;
			boolean=false;
		}
		else if(boolean==false)
		{
			allHTMLTags[i].style.display='';
			document.images[imgName].src = onImg.src;
			boolean=true;
		}
	}	
    }
    
	
}
    function validation()
    {
	  var nom_annon = document.vinfo.nom_annon.value;
	  var mail_annon  = document.vinfo.mail_annon.value;
      var tel_annon  = document.vinfo.tel_annon.value;
	  var tit_annon  = document.vinfo.tit_annon.value;
	  var cont_annon   = document.vinfo.cont_annon .value;
	  var valid = document.vinfo.valid.value;

	  var verifmail    = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/	 
	  var veriftel    = /^[0-9]+$/	 
	  
	   if(nom_annon == '' )
	  {
		alert('Indiquez votre Nom et Prénom SVP');
		return(false);
	  }
	   if(mail_annon != '' )
	  {
		if (verifmail.exec(mail_annon) == null)
      {
        alert("Votre email est incorrecte");
        return false;
      }
	  }
	  if(veriftel.exec(tel_annon) == null )
	  {
		alert('Indiquez votre téléphone pour vous contacter');
		return(false);
	  }
	  if(tit_annon == '' )
	  {
		alert('Indiquez le Titre de l\'annonce');
		return(false);
	  }
	  if(cont_annon  == '' )
	  {
		alert('Indiquez le Titre de l\'annonce');
		return(false);
	  }
	  if(valid  != '1' )
	  {
		alert('test valid');
		return(false);
	  }
    }
	function valid_etrecontact()
    {
	  var nom_etcont = document.vcontacter.nom_etcont.value;
	  var prenom_etcont = document.vcontacter.prenom_etcont.value;
	  var adresse_etcont = document.vcontacter.adresse_etcont.value;
	  var email_etcont = document.vcontacter.email_etcont.value;
	  var tel_etcont = document.vcontacter.tel_etcont.value;
	  var cp_etcont = document.vcontacter.cp_etcont.value;
	  var ville_etcont = document.vcontacter.ville_etcont.value;
	  var comment_etcont = document.vcontacter.comment_etcont.value;
	  var verifmail = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/	 
	  var veriftel = /^[0-9]+$/	 
	  var verifcp = /^[0-9]+$/	 
	  	  
	   if(nom_etcont == '' )
	  {
		alert('Indiquez votre Nom SVP');
		return(false);
	  }
	   if(prenom_etcont == '' )
	  {
		alert('Indiquez votre Prénom SVP');
		return(false);
	  }	  
	  if(adresse_etcont == '' )
	  {
		alert('Indiquez Votre Adresse SVP');
		return(false);
	  }
	  if(verifcp.exec(cp_etcont) == null )
	  {
		alert('Indiquez votre Code Postale');
		return(false);
	  }
	  if(ville_etcont  == '' )
	  {
		alert('Indiquez Votre Ville');
		return(false);
	  }
	  if(email_etcont != '' )
	  {
		if (verifmail.exec(email_etcont) == null)
      {
        alert("Votre email est incorrecte");
        return false;
      }
	  }	  
	  if(veriftel.exec(tel_etcont) == null )
	  {
		alert('Indiquez votre téléphone pour vous contacter');
		return(false);
	  }	  
	  if(comment_etcont  == '' )
	  {
		alert('Indiquez Le contenu de votre demande');
		return(false);
	  }
    }
	function valid_contact()
    {
	  var nom = document.cinf.nom.value;
      var tel  = document.cinf.tel.value;
	  var cont  = document.cinf.cont.value;
	  var mail  = document.cinf.mail.value;
	  var verifmail    = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/	 
	  var veriftel    = /^[0-9]+$/	 
	  
	  if(mail != '' )
	  {
		if (verifmail.exec(mail) == null)
      {
        alert("Votre email est incorrecte");
        return false;
      }
	  }
	   if(nom == '' )
	  {
		alert('Indiquez votre Nom et Prénom SVP');
		return(false);
	  }
	  if(veriftel.exec(tel) == null )
	  {
		alert('Indiquez votre téléphone pour vous contacter');
		return(false);
	  }
	  if(cont == '' )
	  {
		alert('Indiquez le contenu');
		return(false);
	  }
    }

function validationcv()
    {
	  var verifmail    = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/	 
	  var verifnum    = /^[0-9]+$/
	  
	  
	  var titrecv = document.formcv.titrecv.value;
	  var poste1 = document.formcv.poste1.value;
	  var poste2 = document.formcv.poste2.value;
	  var cin = document.formcv.cin.value;
	  var civilite = document.formcv.civilite.value;
	  var nom = document.formcv.nom.value;
	  var prenom = document.formcv.prenom.value;
	  var email = document.formcv.email.value;
	  var nationalite = document.formcv.nationalite.value;
	  var stfamil = document.formcv.stfamil.value;
	  var adresse = document.formcv.adresse.value;
	  var codp = document.formcv.codp.value;
	  var tel = document.formcv.tel.value;
	  var mobile = document.formcv.mobile.value;
	  var nivoetud = document.formcv.nivoetud.value;
	  var anneedip = document.formcv.anneedip.value;
	  var diplome = document.formcv.diplome.value;
	  var etablissement = document.formcv.etablissement.value;
	  var autreform = document.formcv.autreform.value;
	  var experience = document.formcv.experience.value;
	  var nivoexperience = document.formcv.nivoexperience.value;
	  var poste = document.formcv.poste.value;
	  var contexperience = document.formcv.contexperience.value;
	  var lang1 = document.formcv.lang1.value;
	  var nivolang1 = document.formcv.nivolang1.value;
	  var lang2 = document.formcv.lang2.value;
	  var nivolang2 = document.formcv.nivolang2.value;
	  var burotique = document.formcv.burotique.value;
	  var motiv = document.formcv.motiv.value;
  	 
	 
	 
	   if(titrecv == '' )
	  {
		alert('Titre du poste souhaité');
		return(false);
	  }
	   if(poste1 == '1' )
	  {
		alert('Fonction souhaitée 1');
		return(false);
	  }
	   if(poste2 == '1' )
	  {
		alert('Fonction souhaitée 2');
		return(false);
	  }
	   if(cin == '' )
	  {
		alert('Numéro du carte d\'identité ou Passeport');
		return(false);
	  }
	   if(civilite == '1' )
	  {
		alert('Civilité ');
		return(false);
	  }
	   if(nom == '' )
	  {
		alert('Nom ');
		return(false);
	  }
	   if(prenom == '' )
	  {
		alert('Prénom ');
		return(false);
	  }
		if (verifmail.exec(email) == null)
      {
        alert("Votre e-mail est incorrecte");
        return false;
	  }	  
	   if(nationalite == '' )
	  {
		alert('Nationalité ');
		return(false);
	  }
	   if(stfamil == '1' )
	  {
		alert('Situation familiale ');
		return(false);
	  }	
	   if(adresse == '' )
	  {
		alert('Adresse ');
		return(false);
	  }
	  
 	   if(verifnum.exec(codp) == null )
	  {
		alert('Indiquez votre code postale');
		return(false);
	  }	
	    
 	   if(verifnum.exec(tel) == null )
	  {
		alert('Indiquez votre téléphone');
		return(false);
	  }	  
	   if(mobile != '' )
	  {
	   if(verifnum.exec(mobile) == null )
	  {
		alert('Indiquez votre téléphone portble');
		return(false);
	  }
	  }  
	   if(nivoetud == '1' )
	  {
		alert('Niveau d\'étude');
		return(false);
	  }
	   if(verifnum.exec(anneedip) == null )
	  {
		alert('Année Obtention du diplome ');
		return(false);
	  }
	   if(diplome == '' )
	  {
		alert('Intitulé diplôme');
		return(false);
	  }
	   if(etablissement == '' )
	  {
		alert('Etablissement ');
		return(false);
	  }
	   if(autreform == '' )
	  {
		alert('Autre formtion Description');
		return(false);
	  }
	   if(experience == '1' )
	  {
		alert('Années d’expérience ');
		return(false);
	  }
	   if(nivoexperience == '1' )
	  {
		alert('Niveau d’expérience');
		return(false);
	  }
	  
	   if(lang1 == '1' )
	  {
		alert('Langue 1 ');
		return(false);
	  }
	   if(nivolang1 == '1' )
	  {
		alert('Votre Niveau  dans la Langue 1');
		return(false);
	  }
	   if(lang2 == '1' )
	  {
		alert('Langue 2');
		return(false);
	  }
	   if(nivolang2 == '1' )
	  {
		alert('Votre Niveau dans la Langue 2');
		return(false);
	  }
	   if(burotique == '1' )
	  {
		alert('Competance bureautique');
		return(false);
	  }
	   if(motiv == '' )
	  {
		alert('Votre Motivation ');
		return(false);
	  }
   }  
   