function fermePhoto(){
	document.getElementById("telechargeTete").style.display="none";
}
function ouvrePhoto(){
	document.getElementById("telechargeTete").style.display="block";
}



	function verifClient(){
		var form=document.formClient;
		champ=true;
		if(form.nomf.value==""){
			champ=false;
		}
		if(form.prenomf.value==""){
			champ=false;
		}
		if(form.adressef.value==""){
			champ=false;
		}
		if(form.numerof.value==""){
			champ=false;
		}
		
		if(form.localitef.value==""){
			champ=false;
		}
		if(form.noml.value==""){
			champ=false;
		}
		if(form.prenoml.value==""){
			champ=false;
		}
		if(form.adressel.value==""){
			champ=false;
		}
		if(form.numerol.value==""){
			champ=false;
		}
		
		if(form.localitel.value==""){
			champ=false;
		}
		if(form.identifiant.value==""){
			champ=false;
		}
		if(form.motdepasse.value==""){
			champ=false;
		}
		if(form.mail1.value==""){
			champ=false;
		}
		if(form.pre1.value==""){
			champ=false;
		}
		if(form.tel1.value==""){
			champ=false;
		}
		if(!champ){
			alert("Merci de remplir tout les champs obligatoires (en rose) !");	
		}
		return champ;
	}
	function verifTyphusMessage(){
		var form=document.completion_form;
		champ=true;
		if(form.completion_text.value==""){
			champ=false;
		}
		if(form.TitreMail.value==""){
			champ=false;
		}
		if(form.contenuMsg.value==""){
			champ=false;
		}
		
		if(!champ){
			alert("Merci de compléter tout les champs");
		}else{
			form.submit();
		}
	}
	// nombre de caractere minimum à tapé avant de lancer la recherche Ajax
	var minimum_caractere = 0;
	// on se moque la hauteur de case
	var case_sensitive    = 0 ;
	function cocheToutTyphusien(fin){
		for(i=0;i<fin;i++){
			document.getElementById("check"+i).checked=true;
		}
	}
	function DeCocheToutTyphusien(fin){
		for(i=0;i<fin;i++){
			document.getElementById("check"+i).checked=false;
		}
	}
	function valideAction(fin,typeA){
		var cpt=0;
		for(i=0;i<fin;i++){
			if(document.getElementById("check"+i).checked){
				cpt++;
			}
		}
		
		if(cpt>0){
			document.getElementById("ActionValue").value=typeA;
			document.formTyphusien.submit();
		}else{
			alert("Pour continuer, veuillez séléctionner un ou plusieurs typhusien.");
		}
		
	}
	
	function valideActionMessage(fin,typeA){
		alert(fin+' -- '+typeA);
		var cpt=0;
		for(i=0;i<fin;i++){
			if(document.getElementById("check"+i).checked){
				cpt++;
			}
		}
		
		if(cpt>0){
			document.getElementById("ActionValueMessage").value=typeA;
			document.formMessage.submit();
		}else{
			alert("Pour continuer, veuillez séléctionner un ou plusieurs message.");
		}
	}
	
	function ouvreAutreDestinataire(){
		document.getElementById("autreDestinataire").style.display="block";
	}
	var cptPJ=1;
	function AjoutePieceJointe(){
		
		cptPJ++;
		if(cptPJ<6){
			document.getElementById("PlusFichier").innerHTML+="<br />"+cptPJ+". <input type='file' name='fichier"+cptPJ+"' id='fichier"+cptPJ+"' value='' />";	
			document.getElementById("NombrePieceJointe").value=cptPJ;
		}else{
			alert("Vous avez atteint le maximum de pièce jointe!");
		}
	}
	function ouvreFichierPlus(){
		document.getElementById("PlusFichier").style.display="block";
		document.getElementById("PlusBouton").style.display="block";
		document.completion_form.NombrePieceJointe.value=cptPJ;
		
	}
	