

// Validation Email.
function check_email(e) {
 ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
  for(i=0; i < e.length ;i++){
      if(ok.indexOf(e.charAt(i))<0){ 
        return (false);
      }	
  } 
  if (document.images) {
      re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
      re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
      if (!e.match(re) && e.match(re_two)) {
        return (-1);		
      } 
  }
}



function validation()
{

var theform = document.inscript;

if (theform.nom.value == '')
{
	document.getElementById("nom").focus();
	document.getElementById("nom").style.background = "#FFD5D5";
	alert('Veuillez preciser votre nom');
	return false;
}

if (theform.prenom.value == '')
{
	document.getElementById("prenom").focus();
	document.getElementById("prenom").style.background = "#FFD5D5";
	alert('Veuillez preciser votre prénom');
	return false;
}

if (theform.ville.value == '')
{
	document.getElementById("ville").focus();
	document.getElementById("ville").style.background = "#FFD5D5";
	alert('Veuillez preciser votre ville');
	return false;
}

if (theform.cp.value == '')
{
	document.getElementById("cp").focus();
	document.getElementById("cp").style.background = "#FFD5D5";
	alert('Veuillez preciser votre code postal');
	return false;
}

if(!check_email(theform.email.value))
{
	document.getElementById("email").focus();
		document.getElementById("email").style.background = "#FFD5D5";
	alert('Veuillez preciser votre adresse email');
	return false;
}

return true;

}

function identification()
{

if (document.identif.login.value == '')
{
	document.getElementById("login").focus();
	document.getElementById("login").style.background = "#FFD5D5";
	alert('Veuillez saisir votre identifiant');
	return false;
}

if (document.identif.motpasse.value == '')
{
	document.getElementById("motpasse").focus();
	document.getElementById("motpasse").style.background = "#FFD5D5";
	alert('Veuillez saisir votre mot de passe');
	return false;
}

return true;

}

function identification2()
{

if (document.identif2.login2.value == '')
{
	document.getElementById("login2").focus();
	document.getElementById("login2").style.background = "#FFD5D5";
	alert('Veuillez saisir votre identifiant');
	return false;
}

if (document.identif2.motpasse2.value == '')
{
	document.getElementById("motpasse2").focus();
	document.getElementById("motpasse2").style.background = "#FFD5D5";
	alert('Veuillez saisir votre mot de passe');
	return false;
}

return true;

}



