function select_gerant(){
		document.getElementById("div_internaute").style.display="none";
}
function internaute(){
		document.getElementById("div_internaute").style.display="block"; 
}

function affiche_div(div){
	document.getElementById(div).style.display="block";
	//alert(document.getElementById(mail).value);
}

function cache_div(div){
	document.getElementById(div).style.display="none";	
}

function visible_div(div){
	document.getElementById(div).style.visibility="visible";
	//alert(document.getElementById(mail).value);
}

function hidden_div(div){
	document.getElementById(div).style.visibility="hidden";	
}

function affiche_2_div(div,div2){
	document.getElementById(div).style.display="block";
	document.getElementById(div2).style.display="block";
	//alert(document.getElementById(mail).value);
}

function cache_2_div(div,div2){
	document.getElementById(div).style.display="none";	
	document.getElementById(div2).style.display="none";	
}

function validate_alerte(form_contact){
	
	var Nom=trim(form_contact.nom.value);
	if (Nom=="")
	{
		alert("Le Champs Nom est vide");
		return false;
	}

	var Prenom=trim(form_contact.prenom.value);
	if (Prenom=="")
	{
		alert("Le Champs Prenom est vide");
		return false;
	}
	
	var tel=trim(form_contact.tel.value);
	if (tel=="")
	{
		alert("Le Champs Téléphone est vide");
		return false;
	}
	

	var Mail=trim(form_contact.email.value);
	if (Mail=="")
	{
		alert("Le Champs E-Mail est vide");
		return false;
	}
	
	var reponse = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
 	if(!reponse.test(Mail)){
		alert("L'adresse E-Mail n'est pas valide");
		return false;
	}

	
		
}

function validate_proprietaire(form_contact){
	
	var Tel=trim(form_contact.telephone.value);
	if (Tel=="")
	{
		alert("Le Champs Telephone est vide");
		return false;
	}

	var Mail=trim(form_contact.email.value);
	if (Mail=="")
	{
		alert("Le Champs E-Mail est vide");
		return false;
	}
	
	var reponse = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
 	if(!reponse.test(Mail)){
		alert("L'adresse E-Mail n'est pas valide");
		return false;
	}
	
	var Commentaire=trim(form_contact.commentaire.value);
	if (Commentaire=="")
	{
		alert("Le Champs Commentaire est vide");
		return false;
	}
	

	
		
}

function validate_v1(form_inscription){
	
	
	var Nom_camping=trim(form_inscription.nom_camping.value);
	if (Nom_camping=="")
	{
		alert("Le Champs Nom camping est vide");
		return false;
	}
	
	var Nom=trim(form_inscription.nom.value);
	if (Nom=="")
	{
		alert("Le Champs Nom est vide");
		return false;
	}

	var Prenom=trim(form_inscription.prenom.value);
	if (Prenom=="")
	{
		alert("Le Champs Prenom est vide");
		return false;
	}
	
	

	var fixe=trim(form_inscription.fixe.value);
	if (fixe=="")
	{
		alert("Le Champs Tel Fixe est vide");
		return false;
	}
	
	
	var Identifiant=trim(form_inscription.identifiant.value);
	if (Identifiant=="")
	{
		alert("Le Champs identifiant est vide");
		return false;
	}
	
	var Motdepasse=trim(form_inscription.motdepasse.value);
	if (Motdepasse=="")
	{
		alert("Le Champs mot de passe est vide");
		return false;
	}
	
	var Mail=trim(form_inscription.email.value);
	if (Mail=="")
	{
		alert("Le Champs E-Mail est vide");
		return false;
	}
	
	var reponse = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
 	if(!reponse.test(Mail)){
		alert("L'adresse E-Mail n'est pas valide");
		return false;
	}

	
		
}
	
function validate(form){
	var Nom=trim(form.nom.value);
	if (Nom=="")
	{
		alert("Le Champs Nom est vide");
		return false;
	}

	var Prenom=trim(form.prenom.value);
	if (Prenom=="")
	{
		alert("Le Champs Prenom est vide");
		return false;
	}

	var Mail=trim(form.mail.value);
	if (Mail=="")
	{
		alert("Le Champs E-Mail est vide");
		return false;
	}
	var reponse = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	if(!reponse.test(Mail)){
		alert("L'adresse E-Mail n'est pas valide");
		return false;
	}
	
	var message=trim(form.message.value);
	if (message=="")
	{
		alert("Le Champs Message est vide");
		return false;
	}
		
}
	
function validate2(form){

	var nom_camping=trim(form.nom_camping.value);
	if (nom_camping=="")
	{
		alert("Le Champs Nom Camping est vide");
		return false;
	}
	

	var Mail=trim(form.email.value);
	if (Mail=="")
	{
		alert("Le Champs E-Mail est vide");
		return false;
	}
	
	var reponse = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
 	if(!reponse.test(Mail)){
		alert("L'adresse E-Mail n'est pas valide");
		return false;
	}
	
	var dep=trim(form.dep.value);
	if (dep=="")
	{
		alert("Veuillez séléctionner un Département");
		return false;
	}
	
	
	
	var descriptif=trim(form.descriptif.value);
	if (descriptif=="")
	{
		alert("Le Champs Commentaire est vide");
		return false;
	}
	
	
		
}

function validate3(form){

	var nom_camping=trim(form.nom_camp.value);
	if (nom_camping=="")
	{
		alert("Le Champs Nom Camping est vide");
		return false;
	}
	
	var Mail=trim(form.mail.value);
	if (Mail=="")
	{
		alert("Le Champs E-Mail est vide");
		return false;
	}
	
	
	var reponse = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
 	if(!reponse.test(Mail)){
		alert("L'adresse E-Mail n'est pas valide");
		return false;
	}
	
	
	
	var descriptif=trim(form.descriptif.value);
	if (descriptif=="")
	{
		alert("Le Champs Commentaire est vide");
		return false;
	}
	
	var mdp=trim(form.mdp.value);
	if (mdp=="")
	{
		alert("Le Champs Mot de Passe est vide");
		return false;
	}
	
	
		
}

function validate4(form_rgsrg){
	
	var identifiant=trim(form_rgsrg.identifiant.value);
	if (identifiant=="")
	{
		alert("Le Champs Identifiant est vide");
		return false;
	}
	
	var mdp=trim(form_rgsrg.mdp.value);
	if (mdp=="")
	{
		alert("Le Champs Mot de Passe est vide");
		return false;
	}
}

function verif_focus()
{
	if(document.getElementById('identifiant_passe').value=="Champ Vide, insérez votre Email." || document.getElementById('identifiant_passe').value=="Email non valide." )
	{
		document.getElementById('identifiant_passe').value='';
	}
}

function validate5(form_rgsrg){
	var identifiant=trim(form_rgsrg.identifiant_passe.value);
	if (identifiant=="")
	{
		document.getElementById('identifiant_passe').value="Champ Vide, insérez votre Email.";
		return false;
	}	
	
	var reponse = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
 	if(!reponse.test(identifiant)){
		document.getElementById('identifiant_passe').value="Email non valide.";
		return false;
	}
}

function validate6(form){

	var nom_societe=trim(form.nom_societe.value);
	if (nom_societe=="")
	{
		alert("Le Champs Nom Societe est vide");
		return false;
	}
	
	var adresse_societe=trim(form.adresse_societe.value);
	if (adresse_societe=="")
	{
		alert("Le Champs Adresse Societe est vide");
		return false;
	}
	
	var cp_societe=trim(form.cp_societe.value);
	if (cp_societe=="")
	{
		alert("Le Champs CP societe est vide");
		return false;
	}
	var ville_societe=trim(form.ville_societe.value);
	if (ville_societe=="")
	{
		alert("Le Champs Ville Societe est vide");
		return false;
	}
	var tel_societe=trim(form.tel_societe.value);
	if (tel_societe=="")
	{
		alert("Le Champs Tel Societe est vide");
		return false;
	}
	

	var Mail=trim(form.email.value);
	if (Mail=="")
	{
		alert("Le Champs E-Mail est vide");
		return false;
	}
	
	var reponse = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
 	if(!reponse.test(Mail)){
		alert("L'adresse E-Mail n'est pas valide");
		return false;
	}
	
	var site=trim(form.site.value);
	if (site=="")
	{
		alert("Le Champs Site Internet est vide");
		return false;
	}
	
	
	
	var activite=trim(form.activite.value);
	if (activite=="")
	{
		alert("Le Champs Activite est vide");
		return false;
	}
	
	var accroche1=trim(form.accroche1.value);
	if (accroche1=="")
	{
		alert("Le Champs Accroche1 est vide");
		return false;
	}
	
	var descriptif=trim(form.descriptif.value);
	if (descriptif=="")
	{
		alert("Le Champs Descriptif est vide");
		return false;
	}
	
	var logo=trim(form.logo.value);
	if (logo=="")
	{
		alert("Le Logo doit etre inséré");
		return false;
	}
	
	
		
}

function trim (str) {
   return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

var global= 2;
var DivLeft= 0;
var global2= 2;
var DivLeft2= 0;
function arret(div)
{
	global=2;
}
function arret2(div)
{
	global2=2;
}
function FindPosX(AObject)
{  
	if ((document.all))
	{
		return AObject.offsetHeight;
	}
	else return AObject.offsetTop;
} 
function FindPosX2(AObject)
{  
	if ((document.all))
	{
		return AObject.offsetHeight;
	}
	else return AObject.offsetTop;
} 
function debut(div,pas)
{
 	global=1;
	if ((document.all))
	{
		move(div,pas,200);
	}
	else move(div,pas,20);
}
function debut2(div,pas)
{
 	global2=1;
	if ((document.all))
	{
		move2(div,pas,200);
	}
	else move2(div,pas,20);
}
function move(id_div,pas,vitesse){
	var ns4 = (document.layers)? true:false;	  //NS 4
	var ie4 = (document.all)? true:false;	  //IE 4
	var dom = (document.getElementById)? true:false;	  //DOM	
	if(pas==-1 && DivLeft>=0){
			arret(id_div);
	}
	DivFin = FindPosX(document.getElementById('end'));
	if(DivFin!=0)
	{
		if (ie4){ DivFin = 418-120; }
		else{ DivFin = 418-144; }
		
		if(pas==1 && DivLeft<=-DivFin){
			arret(id_div);
		}
	}
	if(global==1){
			
		DivLeft = DivLeft - pas;
		
			if (dom){
					document.getElementById(id_div).style.top = DivLeft+'px';
					document.getElementById(id_div).style.display ='inline';
			}else if (ie4){
					document.all[id_div].style.posTop = DivLeft;
					document.getElementById(id_div).style.display ='inline';
			}else if (ns4){
					document.layers[id_div].pageY = DivLeft;
					document.getElementById(id_div).style.display ='inline';
			}
			
			
			setTimeout("move('"+id_div+"',"+pas+",15)",vitesse);
	}
}
function move2(id_div,pas,vitesse){
	var ns4 = (document.layers)? true:false;	  //NS 4
	var ie4 = (document.all)? true:false;	  //IE 4
	var dom = (document.getElementById)? true:false;	  //DOM	
	if(pas==-1 && DivLeft2>=0){
			arret2(id_div);
	}
	DivFin2 = FindPosX2(document.getElementById('end2'));
	if (ie4){ DivFin2 = 1786-50; }
	else{ DivFin2 = 1786-144; }
	if(DivFin2!=0)
	{
		if(pas==1 && DivLeft2<=-DivFin2){
			arret2(id_div);
		}
	}
	if(global2==1){
			
		DivLeft2 = DivLeft2 - pas;
		
			if (dom){
					document.getElementById(id_div).style.top = DivLeft2+'px';
					document.getElementById(id_div).style.display ='inline';
			}else if (ie4){
					document.all[id_div].style.posTop = DivLeft2;
					document.getElementById(id_div).style.display ='inline';
			}else if (ns4){
					document.layers[id_div].pageY = DivLeft2;
					document.getElementById(id_div).style.display ='inline';
			}			
			setTimeout("move2('"+id_div+"',"+pas+",15)",vitesse);
	}
}

function filtre_auto()
{
	if(document.filtrage.filtre.value=='region')
	{		
		document.getElementById("div_select_departement").style.display="none"; 
		document.getElementById("div_select_region").style.display="block"; 
	}
	else if(document.filtrage.filtre.value=='departement')
	{
		document.getElementById("div_select_departement").style.display="block"; 
		document.getElementById("div_select_region").style.display="none"; 
	}
}

function InitMenu(){
	closeForm('Aquatique');
	closeForm('Equipement');
	closeForm('Commentaire');
}

function checkCheckBox()
{

  if (document.getElementById("mail1").value == '' )
	{
	alert("Vous devez mettre un Email.");
    return false;
  }
	if (document.getElementById("mail1").value != '' )
	{
		resultat=verifMail(document.getElementById("mail1").value);
		if(!resultat){
			alert("Vous devez mettre un Email Valide.");
			return false;
		}
	}
  if (document.getElementById("accord").checked == false )
  {
    alert("Vous devez valider les conditions générales d'utiliisations.");
    return false;
  }
	if (document.getElementById("site").value == '' )
	{
		if(confirm("Votre site Web n'est pas renseigne.\n\rVoulez quand meme vous enregistrer?"))
		{
		return true;
		}else{
		return false;
		}
	}else{
    return true;}
}
function verifMail( email )
{
var maReg = new RegExp ( "^\\w[\\w+\.\-]*@[\\w\-]+\.\\w[\\w+\.\-]*\\w$", "gi" ) ;
 
if ( email.search( maReg ) == -1 )
return false;
else
return true;
}
