 var champspasvides = 0;
 var champsavecnombres = 0;
 var mail = 0;
 var tailleh = screen.height;
 var taillew = screen.width;
 var comp=4/3;
function surligne(champ, erreur){
	if(erreur)
		champ.style.backgroundColor = "#fba";
	else
	   champ.style.backgroundColor = "";
}

function verif(champ) {
 if((champ.value == "" ) || (champ.value == "--" ))
 {
	champspasvides = 0;
	surligne ( champ, true);
	return false;
	}
	else 
	{
	champspasvides = 1;
	surligne ( champ, false);
	return true;
	}
	
}

function verifnombre(champ) {
 if((champ.value == "") || (isNaN(champ.value)))
 {	
	champsavecnombres = 0;
	surligne ( champ, true);
	return false;
	}
	else 
	{
	champsavecnombres = 1;
	surligne ( champ, false);
	return true;
	}
	
}

function verifadresse_mail(champ){
   var regex = /^[a-zA-Z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$/;
   if(!regex.test(champ.value))
   {
	  mail = 0;			
      surligne(champ, true);
      return false;
   }
   else
   {
	  mail = 1;
      surligne(champ, false);
      return true;
   }
   
}

function verifForm(f){
  
  if(champspasvides=="1" && champsavecnombres=="1" && mail=="1" ) 
      return true
   else
   {
      alert("Veuillez svp remplir correctement tous les champs"+ champspasvides + champsavecnombres + mail);
      return false;
   }
}

function gesttaille(){
rap=taillew/tailleh;
if(rap==comp){

document.getElementById('cap').style.cssText='position:absolute; top:0%; left:10%';
}

}


function affiche_block(id){



document.getElementById(id).style.cssText='display:block; position:absolute; border-color:#020585; border-style:solid; border-width:1px; margin:0; padding:0; background-color:#ffffff;';

}

function masquer_block(id){



document.getElementById(id).style.cssText='display:none; position:absolute; border-color:#020585; border-style:solid; border-width:1px; margin:0; padding:0; background-color:#ffffff;';

}

function surligner(id){



document.getElementById(id).style.cssText='float:none; text-align:left;background-color:#E5E1E3;';

}
function non_surligner(id){



document.getElementById(id).style.cssText='float:none; text-align:left;';

}

function rev(page,total,nom){
var next=page+1;

document.getElementById('bout_droit').innerHTML='<img src="image/bouton_droit.png" id="bout_d" style="cursor:hand" onClick=javascript:rev('+next+','+total+',"'+nom+'");>';
document.getElementById('bout_gauche').innerHTML='<img src="image/bouton_gauche.png" id="bout_g" style="cursor:hand" onClick=javascript:prev('+next+','+total+',"'+nom+'");>';
document.getElementById('image').innerHTML='<img src="image/'+nom+'_'+next+'.jpg">';

if(next==total){
document.getElementById('bout_d').style.cssText='cursor:hand; visibility:hidden;';
}


}

function prev(page,total,nom){
var next=page-1;

document.getElementById('bout_droit').innerHTML='<img src="image/bouton_droit.png" id="bout_d" style="cursor:hand" onClick=javascript:rev('+next+','+total+',"'+nom+'");>';
document.getElementById('bout_gauche').innerHTML='<img src="image/bouton_gauche.png" id="bout_g" style="cursor:hand" onClick=javascript:prev('+next+','+total+',"'+nom+'");>';
document.getElementById('image').innerHTML='<img src="image/'+nom+'_'+next+'.jpg">';

if(next==1){
document.getElementById('bout_g').style.cssText='cursor:hand; visibility:hidden;';
}


}

function close_album(){

document.getElementById('album').style.cssText='position:absolute; left:20%; top:25%; padding:0; margin:0; visibility:hidden;';


}