

function validationok() {
	alert("Votre demande de contact a \351t\351 envoy\351e avec succ\350s");
}

function IsNumeric(sText){
	var ValidChars = "0123456789.- ";
	var IsNumber=true;
	var Char;
	for (i = 0; i < sText.length && IsNumber == true; i++){
		Char = sText.charAt(i);
		if (ValidChars.indexOf(Char) == -1){
			IsNumber = false;
		}
	}
	return IsNumber;
} 

function champsok() {
	val = true;
	message = "";

	if( document.formulaire.email.value != "" && document.formulaire.email.value.indexOf('@') == -1) {
		document.formulaire.email.focus();
		document.formulaire.email.style.backgroundColor = "#fae1e1";
		message = "\273 Ce n\'est pas une adresse \351lectronique valide!\n";
		val = false;
	}

	if(document.formulaire.email.value == "") {
		document.formulaire.email.focus();
		document.formulaire.email.style.backgroundColor = "#fae1e1";
		message = message + "\273 Veuillez saisir votre adresse \351lectronique!\n";
		val = false;
	}

	if(document.formulaire.prenom.value == "") {
		document.formulaire.prenom.focus();
		document.formulaire.prenom.style.backgroundColor = "#fae1e1";
		message = message + "\273 Veuillez saisir votre pr\351nom!\n";
		val = false;
	}

	if(document.formulaire.nom.value == "")  {
		document.formulaire.nom.focus();
		document.formulaire.nom.style.backgroundColor = "#fae1e1";
		message = message + "\273 Veuillez saisir votre nom!\n";
		val = false;
	}

	if(message != "") {
		alert(message);
	} else {
		if(confirm("E-mail : " + document.formulaire.email.value + "\n Si cette adresse est correcte, cliquez sur OK pour finaliser votre demande de contact.\n Cliquez sur Annuler pour revenir sur le formulaire.")) {
			return val;
		}
	}
}

// Formulaire de Contact

function Submit_Contact(){
	if(V_contact_email && V_contact_nom && V_contact_prenom && V_contact_portable && V_contact_telephone) {
		if(confirm("E-mail : " + document.formulaire.email.value + "\n Si cette adresse est correcte, cliquez sur OK pour finaliser votre demande de contact.\n Cliquez sur Annuler pour revenir sur le formulaire.")) {
			document.formulaire.submit();
		}
	} else
		alert("V\351rifier les champs obligatoires");
}

var V_contact_email;
var V_contact_nom;
var V_contact_prenom;
var V_contact_portable;
var V_contact_telephone;

function E_contact_nom(obj){
	if(obj.value == "" || obj.value == "Obligatoire") {
		obj.value = "Obligatoire";
		obj.style.color = "#fff";
		obj.style.backgroundColor = "#860303";
		obj.style.border = "1px solid #860303";
		V_contact_nom = false;
		obj.focus();
	}
}

function C_contact_nom(obj){
	obj.select();
	obj.style.color = "#860303";
	obj.style.backgroundColor = "#fff";
	obj.style.border = "1px solid #860303";
	V_contact_nom = true;
}

function E_contact_prenom(obj){
	if(obj.value == "" || obj.value == "Obligatoire") {
		obj.value = "Obligatoire";
		obj.style.color = "#fff";
		obj.style.backgroundColor = "#860303";
		obj.style.border = "1px solid #860303";
		V_contact_prenom = false;
		obj.focus();
	}
}

function C_contact_prenom(obj){
	obj.select();
	obj.style.color = "#860303";
	obj.style.backgroundColor = "#fff";
	obj.style.border = "1px solid #860303";
	V_contact_prenom = true;
}

function E_contact_email(obj) {
	if(obj.value != "" && (obj.value.indexOf('@') == -1 || obj.value.indexOf('.') == -1)) {
		obj.value = "Email invalide";
		obj.style.color = "#fff";
		obj.style.backgroundColor = "#860303";
		obj.style.border = "1px solid #860303";
		V_contact_email = false;
		obj.focus();
	}
	if(obj.value == "" || obj.value == "Obligatoire") {
		obj.value = "Obligatoire";
		obj.style.color = "#fff";
		obj.style.backgroundColor = "#860303";
		obj.style.border = "1px solid #860303";
		V_contact_email = false;
		obj.focus();
	}
}

function C_contact_email(obj) {
	obj.select();
	obj.style.color = "#860303";
	obj.style.backgroundColor = "#fff";
	obj.style.border = "1px solid #860303";
	V_contact_email = true;
}

function E_contact_portable(obj){
	if(obj.value.length > 0 && IsNumeric(obj.value) == false) {
		obj.value = "Numerique";
		obj.style.color = "#fff";
		obj.style.backgroundColor = "#860303";
		obj.style.border = "1px solid #860303";
		V_contact_portable = false;
		obj.focus()
	}
}

function C_contact_portable(obj) {
	obj.select();
	obj.style.color = "#860303";
	obj.style.backgroundColor = "#fff";
	obj.style.border = "1px solid #860303";
	V_contact_portable = true;
}

function E_contact_telephone(obj){
	if(obj.value.length > 0 && IsNumeric(obj.value) == false) {
		obj.value = "Numerique";
		obj.style.color = "#fff";
		obj.style.backgroundColor = "#860303";
		obj.style.border = "1px solid #860303";
		V_contact_telephone = false;
		obj.focus()
	}
}

function C_contact_telephone(obj) {
	obj.select();
	obj.style.color = "#860303";
	obj.style.backgroundColor = "#fff";
	obj.style.border = "1px solid #860303";
	V_contact_telephone = true;
}


// Formulaire de Modification des informations personnelles

function Submit_Modif(){
	if(V_modif_nom && V_modif_prenom && V_modif_adresse && V_modif_code_postal && V_modif_ville && V_modif_telephone) {
		if(confirm("Valider les modifications ?")) {
			document.modif.submit();
		}
	} else
		alert("V\351rifier les champs obligatoires");
}

var V_modif_nom = true;
var V_modif_prenom = true;
var V_modif_adresse = true;
var V_modif_code_postal = true;
var V_modif_ville = true;
var V_modif_telephone = true;
var V_modif_fax;
var V_modif_portable;


function E_modif_nom(obj){
	if(obj.value == "" || obj.value == "Obligatoire") {
		obj.value = "Obligatoire";
		obj.style.color = "#fff";
		obj.style.backgroundColor = "#860303";
		obj.style.border = "1px solid #860303";
		V_modif_nom = false;
		obj.focus();
	}
}

function C_modif_nom(obj){
	obj.select();
	obj.style.color = "#860303";
	obj.style.backgroundColor = "#fff";
	obj.style.border = "1px solid #860303";
	V_modif_nom = true;
}

function E_modif_prenom(obj){
	if(obj.value == "" || obj.value == "Obligatoire") {
		obj.value = "Obligatoire";
		obj.style.color = "#fff";
		obj.style.backgroundColor = "#860303";
		obj.style.border = "1px solid #860303";
		V_modif_prenom = false;
		obj.focus();
	}
}

function C_modif_prenom(obj){
	obj.select();
	obj.style.color = "#860303";
	obj.style.backgroundColor = "#fff";
	obj.style.border = "1px solid #860303";
	V_modif_prenom = true;
}

function E_modif_adresse(obj){
	if(obj.value == "" || obj.value == "Obligatoire") {
		obj.value = "Obligatoire";
		obj.style.color = "#fff";
		obj.style.backgroundColor = "#860303";
		obj.style.border = "1px solid #860303";
		V_modif_adresse = false;
		obj.focus();
	}
}

function C_modif_adresse(obj){
	obj.select();
	obj.style.color = "#860303";
	obj.style.backgroundColor = "#fff";
	obj.style.border = "1px solid #860303";
	V_modif_adresse = true;
}

function E_modif_code_postal(obj){
	if(obj.value == "" || obj.value == "Obligatoire") {
		obj.value = "Obligatoire";
		obj.style.color = "#fff";
		obj.style.backgroundColor = "#860303";
		obj.style.border = "1px solid #860303";
		V_modif_code_postal = false;
		obj.focus();
	}
}

function C_modif_code_postal(obj){
	obj.select();
	obj.style.color = "#860303";
	obj.style.backgroundColor = "#fff";
	obj.style.border = "1px solid #860303";
	V_modif_code_postal = true;
}

function E_modif_ville(obj){
	if(obj.value == "" || obj.value == "Obligatoire") {
		obj.value = "Obligatoire";
		obj.style.color = "#fff";
		obj.style.backgroundColor = "#860303";
		obj.style.border = "1px solid #860303";
		V_modif_ville = false;
		obj.focus();
	}
}

function C_modif_ville(obj){
	obj.select();
	obj.style.color = "#860303";
	obj.style.backgroundColor = "#fff";
	obj.style.border = "1px solid #860303";
	V_modif_ville = true;
}

function E_modif_telephone(obj){
	if(obj.value == "" || obj.value == "Obligatoire") {
		obj.value = "Obligatoire";
		obj.style.color = "#fff";
		obj.style.backgroundColor = "#860303";
		obj.style.border = "1px solid #860303";
		V_modif_telephone = false;
		obj.focus();
	}
}

function C_modif_telephone(obj){
	obj.select();
	obj.style.color = "#860303";
	obj.style.backgroundColor = "#fff";
	obj.style.border = "1px solid #860303";
	V_modif_telephone = true;
}

// Formulaire de validation d'un compte

function Submit_Valide(){
	if(V_valide_mpassword && V_valide_confirme) {
		document.valide.submit();
	} else
		alert("V\351rifier les champs obligatoires");
}

var V_valide_mpassword = false;
var V_valide_confirme = false;


function E_valide_mpassword(obj){
	if(obj.value == "") {
		obj.style.color = "#fff";
		obj.style.backgroundColor = "#860303";
		obj.style.border = "1px solid #860303";
		V_valide_mpassword = false;
		obj.focus();
	}
}

function C_valide_mpassword(obj){
	obj.select();
	obj.style.color = "#860303";
	obj.style.backgroundColor = "#fff";
	obj.style.border = "1px solid #860303";
	V_valide_mpassword = true;
}

function E_valide_confirme(obj){
	if(obj.value == "") {
		obj.style.color = "#fff";
		obj.style.backgroundColor = "#860303";
		obj.style.border = "1px solid #860303";
		V_valide_confirme = false;
		obj.focus();
	}
	else if(obj.value != document.valide.mpassword.value) {
		obj.style.color = "#fff";
		obj.style.backgroundColor = "#860303";
		obj.style.border = "1px solid #860303";
		V_valide_confirme = false;
		alert("Confirmation du mot de passe invalide");
		obj.focus();
	}

}

function C_valide_confirme(obj){
	obj.select();
	obj.style.color = "#860303";
	obj.style.backgroundColor = "#fff";
	obj.style.border = "1px solid #860303";
	V_valide_confirme = true;
}