function myOnChange() {
	//alert("onChange [id : "+ this.id + "]");         
	check_champ(this.id);
}

function myOnSubmit() {
	//alert("onSubmit");
	return check_form();
}

function check_champ(idChamp) {

	var typeChamp = tabType[idChamp];
	// alert("checkChamp : " + idChamp + " - type : " + typeChamp);
	switch (typeChamp) {

	case "string":
		return check_string(idChamp);
		break;

	case "date":
		return check_date(idChamp);
		break;

	case "int":
		return check_int(idChamp);
		break;

	case "float":
		return check_float(idChamp);
		break;

	case "phoneNumber":
		return check_phoneNumber(idChamp);
		break;

	case "mail":
		return check_mail(idChamp);
		break;

	case "zipCode":
		return check_zipCode(idChamp);
		break;

	case "url":
		return check_url(idChamp);
		break;

	default:
		return false;
		break;
	}

}

function check_champ2(idChamp) {

	var typeChamp = tabType2[idChamp];

	//alert("checkChamp : " + idChamp + " - type : " + typeChamp);

	switch (typeChamp) {

	case "string":
		return check_string(idChamp);
		break;

	case "date":
		return check_date(idChamp);
		break;

	case "int":
		return check_int(idChamp);
		break;

	case "float":
		return check_float(idChamp);
		break;

	case "phoneNumber":
		return check_phoneNumber(idChamp);
		break;

	case "mail":
		return check_mail(idChamp);
		break;

	case "zipCode":
		return check_zipCode(idChamp);
		break;

	case "url":
		return check_url(idChamp);
		break;

	default:
		return false;
		break;

	}

}

function check_string(idChamp) {

	var champs = $("#" + idChamp);
	if (champs.size() > 0 && typeof (champs) != "undefined") {
		if (typeof (champs.val()) != "undefined") {
			if (champs.val() != "") {
				var valeur = champs.val();
				var bChampValide = true;
				var regExp = "";
				if (tabMaxSize[idChamp] != null) {
					if (valeur.length > tabMaxSize[idChamp]) {
						bChampValide = false;
					}
				}
				if ((bChampValide) && (tabScan[idChamp] != null)) {
					regExp = tabScan[idChamp];
					if (!(valeur.match(regExp))) {
						bChampValide = false;
					}
				}
				if (bChampValide) {
					set_Valide(idChamp);
					return true;
				} else {
					set_Invalide(idChamp);
					return false;
				}
			} else {
				set_Invalide(idChamp);
				return false;
			}
		} else {
			set_Invalide(idChamp);
			return false;
		}
	} else {
		//alert("string invalide");
		set_Invalide(idChamp);
		return false;
	}
}

function check_date(idChamp) {
	//alert("check_date");
	var valeur = $("#" + idChamp).val();
	valeur = convertDate(valeur);
	if (valeur != false) {
		set_Valide(idChamp);
		$("#" + idChamp).val(valeur);
		return true;
	} else {
		set_Invalide(idChamp);
		return false;
	}
}

function check_int(idChamp) {
	//alert("check_int");
	var valeur = parseInt($("#" + idChamp).val());
	var bChampValide = true;

	if (tabMini[idChamp] != null) {
		//alert("mini : " + tabMini[idChamp]);

		if (valeur < tabMini[idChamp]) {
			bChampValide = false;
		}
	}
	if ((bChampValide) && (tabMaxi[idChamp] != null)) {
		//alert("maxi : " + tabMaxi[idChamp]);
		if (valeur > tabMaxi[idChamp]) {
			bChampValide = false;
		}
	}
	if (bChampValide) {
		set_Valide(idChamp);
		return true;
	} else {
		set_Invalide(idChamp);
		return false;
	}
}

function check_float(idChamp) {
	//alert("check_float");
	var valeur = parseFloat($("#" + idChamp).val());
	var bChampValide = true;

	if (tabMini[idChamp] != null) {
		//alert("mini : " + tabMini[idChamp]);
		if (valeur < tabMini[idChamp]) {
			bChampValide = false;
		}
	}
	if ((bChampValide) && (tabMaxi[idChamp] != null)) {
		//alert("maxi : " + tabMaxi[idChamp]);
		if (valeur > tabMaxi[idChamp]) {
			bChampValide = false;
		}
	}
	if (bChampValide) {
		set_Valide(idChamp);
		return true;
	} else {
		set_Invalide(idChamp);
		return false;

	}

}

function check_zipCode(idChamp) {
	/*alert(idChamp);*/
	var champ = $("#" + idChamp);
	/*alert(champ.val());*/
	if (typeof (champ) != "undefined" && typeof (champ.val()) != "undefined") {

		if (champ.val().length < 5 || champ.val().length > 5) {
			set_Invalide(idChamp);
			return false;
		} else {

			if (champ.val().match("[0-9]{5}")) {
				set_Valide(idChamp);
				return true;
			} else {
				set_Invalide(idChamp);
				return false;
			}
		}
	} else {
		set_Invalide(idChamp);
		return false;
	}
}

function check_url(idChamp) {
	//alert("check_url(" + idChamp + ")");
	var champ = $("#" + idChamp);
	if (typeof (champ.val()) != "undefined"
			&& typeof (champ.val()) != "undefined") {
		if (champ.value != "") {
			var regExp = new RegExp(
					"(http|https|ftp){1}://[a-zA-Z\-\._]{2,}\.[a-zA-Z]{2,}",
					"g");
			if (regExp.test(champ.val())) {
				set_Valide(idChamp);
				return true;
			} else {
				set_Invalide(idChamp);
				return false;
			}
		} else {
			set_Invalide(idChamp);
			return false;
		}
	} else {
		set_Invalide(idChamp);
		return false;
	}
}

function str_replace(stringToFind, stringReplacement, stringToReplaceIn) {
	var stringToFind = new String(stringToFind);
	var stringReplacement = new String(stringReplacement);
	var stringToReplaceIn = new String(stringToReplaceIn);
	var findLength = stringToFind.length;
	var startPos = stringToReplaceIn.indexOf(stringToFind);
	return stringToFind.substring(0, startPos) + stringReplacement
			+ stringToReplaceIn.substring(startPos + stringToFind.length);
}

function str_replace_all(stringToFind, stringReplacement, stringToReplaceIn) {
	var stringToReturn = stringToReplaceIn;
	var i = 0;
	while (stringToReturn.indexOf(stringToFind) != -1
			|| i < stringToReplaceIn.length) {
		i++;
		stringToReturn = str_replace(stringToFind, stringReplacement,
				stringToReturn);
	}
	return stringToReturn;
}

function check_phoneNumber(idChamp) {
	var phoneNumber = $("#" + idChamp);
	var internationnalPhoneRegExp_old = new RegExp(
			"(^\\+[0-9]{2,4}|^00[0-9]{2,4})[0-9]{2,15}");
	//var internationnalPhoneRegExp = new RegExp("^\\+[0-9]{1,255}");
	var internationnalPhoneRegExp = new RegExp("^\\+[0-9]{10}");
	var frenchPhoneRegExp_old = new RegExp("^0[0-9]{9}", "gi");
	//var frenchPhoneRegExp = new RegExp("^[0-9]{1,255}", "gi");
	var frenchPhoneRegExp = new RegExp("^[0-9]{10}", "gi");
	var uniformFieldRegExp = new RegExp("[^\\+0-9]", "gi");
	var uniformedField = phoneNumber.val().replace(uniformFieldRegExp, "");
	if (frenchPhoneRegExp.test(uniformedField)) {
		set_Valide(idChamp);
		phoneNumber.value = uniformedField;
		return true;
	} else if (internationnalPhoneRegExp.test(uniformedField)) {
		set_Valide(idChamp);
		phoneNumber.val() = uniformedField;
		return true;
	} else {
		set_Invalide(idChamp);
		return false;
	}
}

function check_mail(idChamp) {
	emailId = $("#" + idChamp);
	var regExp = new RegExp(
			"^[A-Za-z0-9](([_\\.\\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\\.\\-]?[a-zA-Z0-9]+)*)\\.[A-Za-z]{2,5}$",
			"gi");
	if (!regExp.test(emailId.val())) {
		set_Invalide(idChamp);
		return false;
	} else {
		set_Valide(idChamp);
		return true;
	}
}

function check_form_investisseur(param_langCode) {
	//alert("check_form");
	var key = "";
	var bValid = true;
	var bOblig = true;
	var message = "";
	var valeur = "";
	var libelle = "";

	//Vérification de la validité des champs    

	for (key in tabType) {
		if (!(check_champ(key))) {
			if (tabOblig !== null) {
				if (tabOblig[key] !== null) {
					if ($("#" + key).size() > 0) {
						libelle = $("#" + key).attr("title");
						message += "<li>" + libelle + "</li>\n";
						bValid = false;
					}
				}
			}
			if (tabMaxSize !== null) {
				if (tabMaxSize[key] !== null) {
					if ($("#" + key).size() > 0) {
						lengthValue = $("#" + key).val().length;
						libelle = $("#" + key).attr("title");
						if (lengthValue > tabMaxSize[key]) {
							message += "<li>" + libelle + "</li>\n";
							bValid = false;
						}
					}
				}
			}
		}
	}

	//Vérification que les champs obligatoires sont présents

	if (bValid) {
		for (key in tabOblig) {
			if ($("#" + key).szie() > 0) {
				valeur = $("#" + key).val();
				libelle = $("#" + key).attr("title");
				if (valeur === "") {
					message += "<li>" + libelle + "</li>\n";
					bOblig = false;
				}
			}
		}
	}

	// Possibilité de choisir de rentrer le téléphone fixe ou le portable

	if (typeof (telChoix) !== "undefined") {
		if ($('#tel').val() === '' && $('#mob').val() === '') {
			message += "<li> Le numéro de téléphone fixe ou de portable doit être rempli.</li>\n";
			bOblig = false;
		}
	}

	//Verification Champ E-mail
	var mail1 = $('#mail1').val();
	var mail2 = $('#mail2').val();
	if (mail1 !== mail2) {
		if (param_langCode === "fr") {
			message += "<li>Les champs e-mail doivent être identiques.</li>\n";
		} else {
			message += "<li>Invalid E-mail</li>\n";
		}
	}
	message = "<ul>" + message + "</ul>";
	if (param_langCode === "fr") {
		if (!(bOblig)) {
			messageErreur(
					"Champs obligatoires non remplis",
					"Les champs obligatoires suivants n'ont pas été renseignés :",
					message, param_langCode);
			return false;
		}
		if (!(bValid)) {
			messageErreur("Champs au format invalide",
					"Un ou plusieurs champs ont un format invalide.", message,
					param_langCode);
		}
	} else if (param_langCode === "en") {
		if (!(bOblig)) {
			messageErreur(
					"Champs obligatoires non remplis",
					"Les champs obligatoires suivants n'ont pas été renseignés :",
					message, param_langCode);
			return false;
		}
		if (!(bValid)) {
			messageErreur("Invalid field format",
					"One or more fields have an invalid format.", message,
					param_langCode);
		}
	} else if (param_langCode === "it") {
		if (!(bOblig)) {
			messageErreur(
					"Champs obligatoires non remplis",
					"Les champs obligatoires suivants n'ont pas été renseignés :",
					message, param_langCode);
		}
		if (!(bValid)) {
			messageErreur("Campi al formato invalido",
					"Compilate per favore i seguenti campi.", message,
					param_langCode);
		}
	}
	bValid = ((bValid) && (bOblig));

	return bValid;

}

function check_form(param_langCode) {

	var key = "";
	var bValid = true;
	var bOblig = true;
	var message = "";
	var valeur = "";
	var libelle = "";

	//Vérification de la validité des champs    
	for (key in tabType) {
		if (!(check_champ(key))) {
			if (tabOblig) {
				if (tabOblig[key]) {
					if ($("#" + key).size() > 0) {
						libelle = $("#" + key).attr("title");
						message += "<li>" + libelle + "</li>\n";
						bValid = false;
					}
				}
			}
			if (tabMaxSize !== null) {
				if (tabMaxSize[key] !== null) {
					if ($("#" + key).size() > 0) {
						lengthValue = $("#" + key).val().length;
						libelle = $("#" + key).attr("title");
						if (lengthValue > tabMaxSize[key]) {
							message += "<li>" + libelle + "</li>\n";
							bValid = false;
						}
					}
				}
			}
		}
	}

	//Vérification que les champs obligatoires sont présents
	if (bValid) {
		for (key in tabOblig) {
			if ($("#" + key).size() > 0) {
				valeur = $("#" + key).val();
				libelle = $("#" + key).attr("title");
				if (valeur === "") {
					message += "<li>" + libelle + "</li>\n";
					bOblig = false;
				}
			}
		}
	}

	// Possibilité de choisir de rentrer le téléphone fixe ou le portable

	if (typeof (telChoix) !== "undefined") {
		if ($('#tel').val() === '' && $('#mob').val() == '') {
			message += "<li> Le numéro de téléphone fixe ou de portable doit être rempli.</li>\n";
			bOblig = false;
		}
	}
	message = "<ul>" + message + "</ul>";
	if (param_langCode === "fr") {
		if (!(bOblig)) {
			messageErreur(
					"Champs obligatoires non remplis",
					"Les champs obligatoires suivants n'ont pas été renseignés :",
					message, param_langCode);
		}
		if (!(bValid)) {
			messageErreur("Champs au format invalide",
					"Un ou plusieurs champs ont un format invalide.", message,
					param_langCode);
		}
	} else if (param_langCode === "en") {
		if (!(bOblig)) {
			messageErreur(
					"Champs obligatoires non remplis",
					"Les champs obligatoires suivants n'ont pas été renseignés :",
					message, param_langCode);
		}
		if (!(bValid)) {
			messageErreur("Invalid field format",
					"One or more fields have an invalid format.", message,
					param_langCode);
		}
	} else if (param_langCode === "it") {
		if (!(bOblig)) {
			messageErreur(
					"Champs obligatoires non remplis",
					"Les champs obligatoires suivants n'ont pas été renseignés :",
					message, param_langCode);
		}
		if (!(bValid)) {
			messageErreur("Campi al formato invalido",
					"Compilate per favore i seguenti campi.", message,
					param_langCode);
		}
	}

	bValid = ((bValid) && (bOblig));
	return bValid;

}

function check_majeur(clickedField) {
	var ArrayField = [ "Avenir", "Lancement", "Travaux", "Immediat" ];
	var clicked = false;
	for ( var i = 0; i < ArrayField.length; i++) {
		if (document.getElementById(ArrayField[i]).checked == true
				&& document.getElementById(ArrayField[i]) != document
						.getElementById(clickedField)) {
			document.getElementById(ArrayField[i]).checked = false;
		}
	}
	if ($('#Avenir').is(':checked')) {
		$('#tdAdresse1').html('Adresse 1');
	} else {
		$('#tdAdresse1').html('Adresse 1*');
	}
}

function check_mineur(clickedField) {
	var ArrayField = [ "IdealInvestissement", "Scellier", "Primo",
			"Secondaire", "Prestige", "Tva", "HEQ", "ResidenceService" ];
	var clicked = 0;
	for ( var i = 0; i < ArrayField.length; i++) {
		if (document.getElementById(ArrayField[i]).checked == true) {
			clicked++;
		}
	}
	if (clicked > 4) {
		alert('Limite de 4 dépassée !');
		document.getElementById(clickedField).checked = false;
	}
}

function check_form_programme(lang) {
	var ArrayMajeur = [ "Avenir", "Lancement", "Travaux", "Immediat" ];
	var clickedMajeur = 0;
	var ArrayMineur = [ "IdealInvestissement", "Scellier", "Primo",
			"Secondaire", "Prestige", "Tva", "HEQ", "ResidenceService" ];
	var clickedMineur = 0;
	var bvalid = true;
	var message = "";

	for ( var i = 0; i < ArrayMajeur.length; i++) {
		if (document.getElementById(ArrayMajeur[i]).checked == true) {
			clickedMajeur++;
		}
	}

	if (clickedMajeur == 0) {
		bvalid = false;
		message = '<li>Un Segment Majeur doit être coché</li>\n';
	}

	for ( var j = 0; j < ArrayMineur.length; j++) {
		if (document.getElementById(ArrayMineur[j]).checked == true) {
			clickedMineur++;
		}
	}

	if (!bvalid)
		messageErreur("Champs obligatoires non remplis",
				"Les champs obligatoires suivants n'ont pas été renseignés :",
				message, lang);

	return bvalid;
}

function check_form2(param_langCode) {

	var key = "";
	var bValid = true;
	var bOblig = true;
	var message = "";
	var valeur = "";
	var libelle = "";

	//Vérification de la validité des champs    
	for (key in tabType2) {
		if (!(check_champ2(key))) {
			if (tabOblig2 != null) {
				if (tabOblig2[key] != null) {
					if (document.getElementById(key)) {
						libelle = document.getElementById(key).title;
						message += "<li>" + libelle + "</li>\n";
						bValid = false;
					}
				}
			}
		}
	}

	//Vérification que les champs obligatoires sont présents

	if (bValid) {
		for (key in tabOblig2) {
			if (document.getElementById(key)) {
				valeur = document.getElementById(key).value;
				libelle = document.getElementById(key).title;
				if (valeur == "") {
					// message += "<li> " + libelle + " (" + key + ")</li>\n";
					message += "<li> " + libelle + "</li>\n";
					bOblig = false;
				}
			}
		}
	}
	message = "<ul>" + message + "</ul>";
	if (param_langCode == "fr") {
		if (!(bOblig)) {
			messageErreur(
					"Champs obligatoires non remplis",
					"Les champs obligatoires suivants n'ont pas été renseignés :",
					message, param_langCode);
		}
		if (!(bValid)) {
			messageErreur(
					"Champs au format invalide",
					"Un ou plusieurs champs ont un format invalide check_form2.",
					message, param_langCode);
		}
	} else if (param_langCode == "en") {
		if (!(bOblig)) {
			messageErreur(
					"Champs obligatoires non remplis",
					"Les champs obligatoires suivants n'ont pas été renseignés :",
					message, param_langCode);
		}
		if (!(bValid)) {
			messageErreur("Invalid field format",
					"One or more fields have an invalid format.", message,
					param_langCode);
		}
	} else if (param_langCode == "it") {
		if (!(bOblig)) {
			messageErreur(
					"Champs obligatoires non remplis",
					"Les champs obligatoires suivants n'ont pas été renseignés :",
					message, param_langCode);
		}
		if (!(bValid)) {
			messageErreur("Campi al formato invalido",
					"Compilate per favore i seguenti campi.", message,
					param_langCode);
		}
	}
	bValid = ((bValid) && (bOblig));

	return bValid;
}

function set_Invalide(idChamp) {
	//alert("set_invalide");
	var classInvalide = "inptInvalid";
	//document.getElementById(idChamp).className = classInvalide;
}

function set_Valide(idChamp) {
	//alert("set_valide");
	var classValide = "inpt";
	//document.getElementById(idChamp).className = classValide;

}

function convertDate(szDate) {

	var annee, mois, jour, tmp;

	var pivot;

	var d; // utilisé pour la date pivot
	var start, pos;

	var dOut = "";

	// on parse la date pour récupérer les valeurs

	// par défaut JJ/MM/AA

	pos = start = 0;

	//test du format attaché JJMMAA ou JJMMAAAA

	if (!isNaN(szDate)) {

		tmp = szDate.substr(0, 2);

		if (tmp.substr(0, 1) == "0") {
			tmp = tmp.substr(1, 1);
		}

		jour = parseInt(tmp);

		tmp = szDate.substr(2, 2);

		if (tmp.substr(0, 1) == "0") {
			tmp = tmp.substr(1, 1);
		}

		mois = parseInt(tmp);

		tmp = szDate.substr(4, szDate.length - 4);

		if (tmp.substr(0, 1) == "0") {
			tmp = tmp.substr(1, 1);
		}

		annee = parseInt(tmp);

	}

	else {

		// premiere zone

		while (!isNaN(szDate.substr(pos, 1))) {

			pos++;

		}

		tmp = szDate.substr(start, pos - start);

		if (tmp.substr(0, 1) == "0") {
			tmp = tmp.substr(1, 1);
		}

		jour = parseInt(tmp);

		//alert("Jour : " + jour + " - start : " + start + " - pos : " + pos);

		start = ++pos;

		// zone centrale

		// ajout du contréle pos <= szDate.length pour éviter des pbs de boucles sans fin

		// En effet si un seul caractère alpha est présent dans la chaîne (ex: 05/1978),

		// la boucle incrémente pos indéfiniment. Le substr par rapport à une position en dehors de la chaine

		// ne renvoit pas d'erreur et la valeur renvoyée ('') n'est pas égale à NaN !

		while (!isNaN(szDate.substr(pos, 1)) && pos <= szDate.length) {

			pos++;

		}

		tmp = szDate.substr(start, pos - start);

		if (tmp.substr(0, 1) == "0") {
			tmp = tmp.substr(1, 1);
		}

		mois = parseInt(tmp);

		//alert("Mois : " + mois + " - start : " + start + " - pos : " + pos);

		start = ++pos;

		// derniere zone

		pos = szDate.length;

		tmp = szDate.substr(start, pos - start)

		if (tmp.substr(0, 1) == "0") {
			tmp = tmp.substr(1, 1);
		}

		annee = parseInt(tmp);

		//alert("Annee : " + annee + " - start : " + start + " - pos : " + pos);

	}

	if ((mois == 0) || (jour == 0) || isNaN(mois) || isNaN(jour)
			|| isNaN(annee))

		//on ne teste pas l'annee nulle : (annee == 0) qui correspond à 2000  

		return false;

	// on teste AA/MM/JJ

	if (jour > 31) {

		if (annee < 31) {
			tmp = annee;
			annee = jour;
			jour = tmp;
		} else {
			return false;
		}

	}

	// on teste MM/JJ/AA

	if (mois > 12) {

		if (jour < 13) {
			tmp = mois;
			mois = jour;
			jour = tmp;
		} else {
			return false;
		}

	}

	// on converti l'année en 4 chiffres

	// le pivot est l'année actuelle + 1

	if (annee < 100) {

		d = new Date();

		pivot = (d.getFullYear() % 100) + 1; // année pivot
		(annee > pivot) ? (annee += 1900) : (annee += 2000);

	}

	if (annee < 1000)

		return false;

	// on teste si le jour est supérieur au nombre de jours dans le mois

	if (jour > nbJM(mois, annee))

		return false;

	//objD.setFullYear(annee, mois - 1, jour);

	if (jour < 10) {
		jour = "0" + jour;
	}

	if (mois < 10) {
		mois = "0" + mois;
	}

	dOut = jour + "/" + mois + "/" + annee;

	return dOut;

}

function nbJM(mois, annee) {

	var nbJ = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

	if ((mois == 2) && (LeapYear(annee)))

		return nbJ[mois - 1] + 1;

	else

		return nbJ[mois - 1];

}

function LeapYear(y) {

	return (y % 4 == 0) == (y % 100 == 0) == (y % 400 == 0)

}

function messageErreur(titre, libelleCourt, libelleLong, lang) {
	var rpath = document.getElementById("rpath").value;

	var fenetre;

	var msg;

	msg = "<strong>" + libelleCourt + "</strong><br />" + libelleLong;

	fenetre = popupcentree(rpath + "error.php", 500, 400);

	fenetre.document.write('<?xml version="1.0" encoding="ISO-8859-15" ?>\n');

	fenetre.document
			.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n');

	fenetre.document
			.write('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">\n');

	fenetre.document.write('    <head>\n');

	fenetre.document.write('        <title>Erreur</title>\n');

	fenetre.document
			.write('        <meta http-equiv="Content-type" content="text/html; charset=iso-8859-15" />\n');

	fenetre.document
			.write('        <meta http-equiv="PRAGMA" content="NO-CACHE" />\n');

	fenetre.document
			.write('        <link rel="stylesheet" type="text/css" href="' + rpath + 'css/form.css" media="screen" title="Normal" />\n');

	fenetre.document.write('    </head>\n');

	fenetre.document.write('    <body>\n');

	fenetre.document.write('        <div class="formdoc">\n');

	fenetre.document.write('            <h1>' + titre + '</h1>\n');

	fenetre.document.write('            <p>\n');

	fenetre.document.write(msg);

	fenetre.document.write('            </p>\n');

	fenetre.document.write('        </div>\n');

	if (lang == "fr") {

		fenetre.document
				.write('        <div id="jsButton"><a href="javascript:self.close();">Fermer la fen&ecirc;tre</a></div>\n');

	}

	else if (lang == "en") {

		fenetre.document
				.write('        <div id="jsButton"><a href="javascript:self.close();">Close window</a></div>\n');

	}

	else if (lang == "it") {

		fenetre.document
				.write('        <div id="jsButton"><a href="javascript:self.close();">Chiudere finestra</a></div>\n');

	}

	fenetre.document.write('    </body>\n');

	fenetre.document.write('</html>\n');

}

function popupcentree(page, largeur, hauteur) {

	var top = (screen.height - hauteur) / 2;

	var left = (screen.width - largeur) / 2;

	var hdwnd;

	try {

		hdwnd = window
				.open(
						page,
						"",
						"toolbar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=yes, copyhistory=no,top="
								+ top
								+ ",left="
								+ left
								+ ",width="
								+ largeur
								+ ",height=" + hauteur);

	}

	catch (erreur) {

		//alert("erreur");

	}

	return hdwnd;

}

function getMediathequeSelectedMedia(openerField, textField, suffixe) {

	form = document.getElementById("frmWidget");

	if (typeof (form.fileToAdd) == "undefined") {

		alert("Aucun élément à sélectionner dans cette catégorie.");

		return false;

	}

	if (typeof (form.fileToAdd.length) != "undefined") {

		for (i = 0; i < form.fileToAdd.length
				&& !eval("form.fileToAdd[" + i + "].checked"); i++)
			;

		if (i == form.fileToAdd.length) {

			alert("Vous devez sélectionner un média à insérer");

			return false;

		}

		else {

			fieldValue = eval("form.fileToAdd[" + i + "].value");

		}

	}

	else {

		if (!form.fileToAdd.checked) {

			alert("Vous devez sélectionner un média à insérer");

		}

		else {

			fieldValue = form.fileToAdd.value;

		}

	}

	var reg = new RegExp("-", "g");

	var splittedString = fieldValue.split(reg);

	lenstring = splittedString.length;

	if (!opener.document.getElementById(textField)) {

		textField = textField + suffixe;

	}

	if (!opener.document.getElementById(openerField)) {

		openerField = openerField + suffixe;

	}

	textField = opener.document.getElementById(textField);

	openerField = opener.document.getElementById(openerField);

	eval("textField.value = '" + splittedString[0] + "';");

	eval("openerField.value = '" + splittedString[lenstring - 1] + "';");

	window.close();

}

function Selectionner(valeur) {

	//Selection du conteneur
	var tab = document.getElementsByTagName("input");
	for ( var i = 0; i < tab.length; i++) {
		if (tab[i].type == "checkbox") {
			tab[i].checked = valeur;
		}
	}
}

function check_form_popin(param_langCode) {

	var key = "";

	var bValid = true;

	var bOblig = true;

	var message = "";

	var valeur = "";

	var libelle = "";

	// Vérification de la validité des champs

	for (key in tabType) {

		if (!(check_champ(key))) {

			if (tabOblig != null) {

				if (tabOblig[key] != null) {

					if (document.getElementById(key)) {

						libelle = document.getElementById(key).title;

						// message += "<li>" + libelle + " (" + key +
						// ")</li>\n";

						message += "<li>" + libelle + "</li>\n";

						bValid = false;

					}

				}

			}

			if (tabMaxSize != null) {

				if (tabMaxSize[key] != null) {

					if (document.getElementById(key)) {

						lengthValue = document.getElementById(key).value.length;

						libelle = document.getElementById(key).title;

						if (lengthValue > tabMaxSize[key]) {

							message += "<li>" + libelle + "</li>\n";

							bValid = false;

						}

					}

				}

			}

		}

	}

	// Vérification que les champs obligatoires sont présents

	if (bValid) {

		for (key in tabOblig) {

			if (document.getElementById(key)) {

				valeur = document.getElementById(key).value;

				libelle = document.getElementById(key).title;

				if (valeur == "") {

					// message += "<li> " + libelle + " (" + key + ")</li>\n";

					message += "<li>" + libelle + "</li>\n";

					bOblig = false;

				}

			}

		}

	}

	// Possibilité de choisir de rentrer le téléphone fixe ou le portable

	if (typeof (telChoix) != "undefined") {

		if (document.getElementById('tel').value == ''
				&& document.getElementById('mob').value == '') {

			message += "<li> Le numéro de téléphone fixe ou de portable doit être rempli.</li>\n";

			bOblig = false;

		}

	}

	if (document.getElementById('telephone').value != '') {
		if (!check_phoneNumber('telephone')) {
			show_error_span('telephone', param_langCode, '');
			bValid = false;
		}
	}

	if (document.getElementById('telephone2').value != '') {
		if (!check_phoneNumber('telephone2')) {
			show_error_span('telephone2', param_langCode, '');
			bValid = false;
		}
	}

	if (document.getElementById('code').value != '') {
		if (!check_zipCode('code')) {
			show_error_span('code', param_langCode, '');
			bValid = false;
		}
	}

	message = "<ul>" + message + "</ul>";

	/*if (param_langCode == "fr") {

		if (!(bOblig)) {

			messageErreur("Champs obligatoires non remplis","Les champs obligatoires suivants n'ont pas été renseignés :",message, param_langCode);

		}

		if (!(bValid)) {

			messageErreur("Champs au format invalide","Un ou plusieurs champs ont un format invalide.", message,param_langCode);

		}

	}

	else if (param_langCode == "en") {

		if (!(bOblig)) {

			messageErreur("Champs obligatoires non remplis","Les champs obligatoires suivants n'ont pas été renseignés :",message, param_langCode);

		}

		if (!(bValid)) {

			messageErreur("Invalid field format","One or more fields have an invalid format.", message,param_langCode);

		}

	}

	else if (param_langCode == "it") {

		if (!(bOblig)) {

			messageErreur( "Champs obligatoires non remplis", "Les champs obligatoires suivants n'ont pas été renseignés :", message, param_langCode);

		}

		if (!(bValid)) {

			messageErreur("Campi al formato invalido", "Compilate per favore i seguenti campi.", message, param_langCode);

		}

	}*/

	bValid = ((bValid) && (bOblig));
	return bValid;

}

function popInValidationEnvoyerAmi(param_langCode) {
	self.location.hash = "#";
	$('.champ_popin span').remove();
	$
			.ajax( {
				type : "POST",
				contentType : "application/x-www-form-urlencoded;charset=ISO-8859-15",
				scriptCharset : "charset=ISO-8859-15",
				beforeSend : function() {
					bValid = true;
					if ($('#civexp').val() == "") {
						show_error_span('civexp', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('nomexp')) {
						show_error_span('nomexp', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('prenomexp')) {
						show_error_span('prenomexp', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('mailexp')) {
						show_error_span('mailexp', param_langCode, '');
						bValid = false;
					}/*
								if( !check_champ('cpexp') && !check_zipCode('cpexp'))
								{	
									show_error_span('cpexp', param_langCode, '');
									bValid = false;
								}
								if( !check_champ('villeexp'))
								{	
									show_error_span('villeexp', param_langCode, '');
									bValid = false;
								}*/
					if (!check_champ('nomdes')) {
						show_error_span('nomdes', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('maildes')) {
						show_error_span('maildes', param_langCode, '');
						bValid = false;
					}
					/*if($('input[name="acceptcond"]:checked').length==0)
					{
						show_error_span('acceptcond_oui', param_langCode, '');
						bValid = false;				
					}*/
					return bValid;
				},
				url : '../immobilier/conseiller_immobilier_envoyer_ami_envoi_' + param_langCode + '.html',
				data : 'rpath=' + $('#rpath').val() + '&urlToSend='
						+ document.URL + '&idprog=' + $('#idprog').val()
						+ '&civexp=' + $('#civexp').val() + '&nomexp='
						+ encodeURIComponent($('#nomexp').val())
						+ '&prenomexp='
						+ encodeURIComponent($('#prenomexp').val())
						+ '&mailexp=' + $('#mailexp').val() +
						/*'&cpexp=' + $('#cpexp').val() +
						'&villeexp=' + encodeURIComponent($('#villeexp').val()) +
						'&paysexp=' + encodeURIComponent($('#paysexp').val() + ' | ' + $('#paysexp option:selected').text()) +*/
						'&nomdes=' + encodeURIComponent($('#nomdes').val())
						+ '&maildes=' + $('#maildes').val() + '&msg='
						+ $('#msg').val(),
				/*'&acceptcond=' + $('input[name="acceptcond"]:checked').val(),*/

				processData : false,

				success : function(response) {

					if (($('#civexp').val() != "") && $('#nomexp').val()
							&& $('#prenomexp').val() && $('#mailexp').val()
							&& $('#nomdes').val() && $('#maildes').val()
							&& check_champ('nomexp')
							&& check_champ('prenomexp')
							&& check_champ('mailexp') && check_champ('nomdes')
							&& check_champ('maildes')) {
						$('#popinGlobalglobal').html(response);
					}
					return false;
				},
				async : false
			});
	return false;
}

function popInValidationNewsletter(param_langCode) {
	self.location.hash = "#";
	$('.champ_popin span').remove();
	$
			.ajax( {
				type : "POST",
				contentType : "application/x-www-form-urlencoded;charset=ISO-8859-15",
				scriptCharset : "charset=ISO-8859-15",
				beforeSend : function() {
					bValid = true;
					if ($('#gauche_civ').val() == "") {
						show_error_span('gauche_civ', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('gauche_civ')) {
						show_error_span('gauche_civ', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('gauche_nom')) {
						show_error_span('gauche_nom', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('gauche_mail')) {
						show_error_span('gauche_mail', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('cp') && !check_zipCode('cp')) {
						show_error_span('cp', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('ville')) {
						show_error_span('ville', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('pays')) {
						show_error_span('pays', param_langCode, '');
						bValid = false;
					}
					if ($('#gauche_region_recherche').val() == "") {
						show_error_span('gauche_region_recherche',
								param_langCode, '');
						bValid = false;
					}
					if ($('input[name="acceptcond"]:checked').length == 0) {
						show_error_span('acceptcond_oui', param_langCode, '');
						bValid = false;
					}
					return bValid;
				},
				url : '../immobilier/abonnement_newsletter_envoi_' + param_langCode + '.html',
				data : 'rpath='
						+ $('#rpath').val()
						+ '&idLogementPRIMPROMO='
						+ $('#idLogementPRIMPROMO').val()
						+ '&idProgPRIMPROMO='
						+ $('#idProgPRIMPROMO').val()
						+ '&gauche_civ='
						+ $('#gauche_civ').val()
						+ '&gauche_nom='
						+ encodeURIComponent($('#gauche_nom').val())
						+ '&gauche_prenom='
						+ encodeURIComponent($('#gauche_prenom').val())
						+ '&gauche_tel='
						+ $('#gauche_tel').val()
						+ '&gauche_mail='
						+ $('#gauche_mail').val()
						+ '&cp='
						+ $('#cp').val()
						+ '&ville='
						+ encodeURIComponent($('#ville').val())
						+ '&pays='
						+ encodeURIComponent($('#pays').val() + ' | '
								+ $('#pays option:selected').text())
						+ '&gauche_region_recherche='
						+ $('#gauche_region_recherche').val() + '&acceptcond='
						+ $('input[name="acceptcond"]:checked').val(),

				processData : false,
				success : function(response) {
					if (($('#gauche_civ').val() != "")
							&& $('#gauche_nom').val()
							&& $('#gauche_mail').val()
							&& check_champ('gauche_civ')
							&& check_champ('gauche_nom')
							&& check_champ('gauche_mail')) {
						$('#popinGlobalglobal').html(response);
					}
				},
				async : false
			});
	return false;
}

function popInValidationAvantPremiere(param_langCode) {
	self.location.hash = "#";
	$('.champ_popin span').remove();
	$.ajax( {
		type : "POST",
		contentType : "application/x-www-form-urlencoded;charset=ISO-8859-15",
		scriptCharset : "charset=ISO-8859-15",
		beforeSend : function() {
			bValid = true;
			if ($('#civilite').val() == "") {
				show_error_span('civilite', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('prenom')) {
				show_error_span('prenom', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('nom')) {
				show_error_span('nom', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('tel1') && !check_phoneNumber('tel1')) {
				show_error_span('tel1', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('email')) {
				show_error_span('email', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('adresse1')) {
				show_error_span('adresse1', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('cp') && !check_zipCode('cp')) {
				show_error_span('cp', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('ville')) {
				show_error_span('ville', param_langCode, '');
				bValid = false;
			}
			if ($('input[name="acceptcond"]:checked').length == 0) {
				show_error_span('acceptcond_oui', param_langCode, '');
				bValid = false;
			}
			return bValid;
		},
		url : '../immobilier/avant_premiere_envoi_' + param_langCode + '.html',
		data : 'rpath='
				+ $('#rpath').val()
				+ '&progIdx='
				+ $('#idprog').val()
				+ '&contactconseil='
				+ verif_checkbox('contactconseil',
						'Etre contacte par un conseiller', 'non')
				+ '&etrealerte='
				+ verif_checkbox('etrealerte',
						'Etre alerte au lancement commercial du programme',
						'non')
				+ '&civilite='
				+ $('#civilite').val()
				+ '&prenom='
				+ encodeURIComponent($('#prenom').val())
				+ '&nom='
				+ encodeURIComponent($('#nom').val())
				+ '&tel1='
				+ $('#tel1').val()
				+ '&tel2='
				+ $('#tel2').val()
				+ '&email='
				+ $('#email').val()
				+ '&adresse1='
				+ encodeURIComponent($('#adresse1').val())
				+ '&adresse2='
				+ encodeURIComponent($('#adresse2').val())
				+ '&cp='
				+ $('#cp').val()
				+ '&ville='
				+ encodeURIComponent($('#ville').val())
				+ '&pays='
				+ encodeURIComponent($('#pays').val() + ' | '
						+ $('#pays option:selected').text()) + '&projet='
				+ encodeURIComponent($('#projet').val()) + '&budgetde='
				+ $('#budgetde').val() + '&budgeta=' + $('#budgeta').val()
				+ '&connupar=' + $('#connupar').val() + '&acceptcond='
				+ $('input[name="acceptcond"]:checked').val(),

		processData : false,
		success : function(response) {
			if (($('#civilite').val() != "") && $('#nom').val()
					&& $('#prenom').val() && $('#tel1').val()
					&& $('#email').val() && $('#adresse1').val()
					&& $('#cp').val() && $('#ville').val()
					&& check_champ('tel1') && check_champ('prenom')
					&& check_champ('nom') && check_champ('email')
					&& check_champ('adresse1') && check_champ('cp')
					&& check_champ('ville')) {
				$('#popinGlobalglobal').html(response);
			}

		},
		async : false
	});
	return false;
}

function popInValidationLandingRappel(param_langCode) {
	self.location.hash = "#";
	$('.champ_popin span').remove();
	$.ajax( {
		type : "POST",
		contentType : "application/x-www-form-urlencoded;charset=ISO-8859-15",
		scriptCharset : "charset=ISO-8859-15",
		beforeSend : function() {
			bValid = true;
			if ($('#civ').val() == "") {
				show_error_span('civ', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('nom')) {
				show_error_span('nom', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('prenom')) {
				show_error_span('prenom', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('tel')) {
				show_error_span('tel', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('mail')) {
				show_error_span('mail', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('cp_residence')) {
				show_error_span('cp_residence', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('ville')) {
				show_error_span('ville', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('adresse1')) {
				show_error_span('adresse1', param_langCode, '');
				bValid = false;
			}
			if ($('#cp_recherche').length > 0) {
				if (!check_champ('cp_recherche')) {
					show_error_span('cp_recherche', param_langCode, '');
					bValid = false;
				}
			}
			if ($('input[name="acceptcond"]:checked').length == 0) {
				show_error_span('acceptcond_oui', param_langCode, '');
				bValid = false;
			}
			return bValid;

		},
		url : '../landing-envoi-etre-appele_' + param_langCode + '.html',
		data : 'rpath='
				+ $('#rpath').val()
				+ '&xtor='
				+ $('#xtor').val()
				+ '&idProgPRIMPROMO='
				+ $('#idProgPRIMPROMO').val()
				+ '&civ='
				+ $('#civ').val()
				+ '&nom='
				+ encodeURIComponent($('#nom').val())
				+ '&prenom='
				+ encodeURIComponent($('#prenom').val())
				+ '&tel='
				+ $('#tel').val()
				+ '&tel2='
				+ $('#tel2').val()
				+ '&pref_horaire='
				+ $('#pref_horaire').val()
				+ '&mail='
				+ $('#mail').val()
				+ '&adresse1='
				+ encodeURIComponent($('#adresse1').val())
				+ '&adresse2='
				+ encodeURIComponent($('#adresse2').val())
				+ '&cp_residence='
				+ $('#cp_residence').val()
				+ '&ville='
				+ encodeURIComponent($('#ville').val())
				+ '&cp_recherche='
				+ $('#cp_recherche').val()
				+ '&pays='
				+ encodeURIComponent($('#pays').val() + ' | '
						+ $('#pays option:selected').text()) + '&projet='
				+ encodeURIComponent($('#projet').val()) + '&budgetde='
				+ $('#budgetde').val() + '&budgeta=' + $('#budgeta').val()
				+ '&connupar=' + $('#connupar').val() + '&acceptcond='
				+ $('input[name="acceptcond"]:checked').val(),

		processData : false,
		success : function(response) {

			if (($('#civ').val() != "") && $('#nom').val()
					&& $('#prenom').val() && $('#tel').val()
					&& $('#mail').val() && check_champ('civ')
					&& check_champ('prenom') && check_champ('nom')
					&& check_champ('mail') && check_champ('tel')
					&& check_champ('adresse1')) {
				$('#popinGlobalglobal').html(response);
			}
			return false;
		},
		async : false
	});
	return false;
}

function popInValidationRappel(param_langCode) {
	self.location.hash = "#";
	$('.champ_popin span').remove();
	$
			.ajax( {
				type : "POST",
				contentType : "application/x-www-form-urlencoded;charset=ISO-8859-15",
				scriptCharset : "charset=ISO-8859-15",
				beforeSend : function() {
					bValid = true;
					if ($('#civ').val() == "") {
						show_error_span('civ', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('nom')) {
						show_error_span('nom', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('prenom')) {
						show_error_span('prenom', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('tel')) {
						show_error_span('tel', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('mail')) {
						show_error_span('mail', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('cp_residence')) {
						show_error_span('cp_residence', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('ville')) {
						show_error_span('ville', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('adresse1')) {
						show_error_span('adresse1', param_langCode, '');
						bValid = false;
					}
					if ($('#cp_recherche').length > 0) {
						if (!check_champ('cp_recherche')) {
							show_error_span('cp_recherche', param_langCode, '');
							bValid = false;
						}
					}
					if ($('input[name="acceptcond"]:checked').length == 0) {
						show_error_span('acceptcond_oui', param_langCode, '');
						bValid = false;
					}
					return bValid;

				},
				url : '../immobilier/envois_conseiller_immobilier_' + param_langCode + '.html',
				data : 'rpath='
						+ $('#rpath').val()
						+ '&idProgPRIMPROMO='
						+ $('#idProgPRIMPROMO').val()
						+ '&civ='
						+ $('#civ').val()
						+ '&nom='
						+ encodeURIComponent($('#nom').val())
						+ '&prenom='
						+ encodeURIComponent($('#prenom').val())
						+ '&tel='
						+ $('#tel').val()
						+ '&tel2='
						+ $('#tel2').val()
						+ '&pref_horaire='
						+ $('#pref_horaire').val()
						+ '&mail='
						+ $('#mail').val()
						+ '&adresse1='
						+ encodeURIComponent($('#adresse1').val())
						+ '&adresse2='
						+ encodeURIComponent($('#adresse2').val())
						+ '&cp_residence='
						+ $('#cp_residence').val()
						+ '&ville='
						+ encodeURIComponent($('#ville').val())
						+ '&cp_recherche='
						+ $('#cp_recherche').val()
						+ '&pays='
						+ encodeURIComponent($('#pays').val() + ' | '
								+ $('#pays option:selected').text())
						+ '&projet=' + encodeURIComponent($('#projet').val())
						+ '&budgetde=' + $('#budgetde').val() + '&budgeta='
						+ $('#budgeta').val() + '&connupar='
						+ $('#connupar').val() + '&acceptcond='
						+ $('input[name="acceptcond"]:checked').val(),

				processData : false,
				success : function(response) {
					if (($('#civ').val() != "") && $('#nom').val()
							&& $('#prenom').val() && $('#tel').val()
							&& $('#mail').val() && check_champ('civ')
							&& check_champ('prenom') && check_champ('nom')
							&& check_champ('mail') && check_champ('tel')
							&& check_champ('adresse1')) {
						$('#popinGlobalglobal').html(response);
					}
					return false;
				},
				async : false
			});
	return false;
}

function popInValidationPrendreRDV(param_langCode) {
	self.location.hash = "#";
	$('.champ_popin span').remove();
	$
			.ajax( {
				type : "POST",
				contentType : "application/x-www-form-urlencoded;charset=ISO-8859-15",
				scriptCharset : "charset=ISO-8859-15",
				beforeSend : function() {
					bValid = true;
					if ($('#civilite').val() == "") {
						show_error_span('civilite', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('prenom')) {
						show_error_span('prenom', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('nom')) {
						show_error_span('nom', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('tel1') && !check_phoneNumber('tel1')) {
						show_error_span('tel1', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('email')) {
						show_error_span('email', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('adresse1')) {
						show_error_span('adresse1', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('cp') && !check_zipCode('cp')) {
						show_error_span('cp', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('ville')) {
						show_error_span('ville', param_langCode, '');
						bValid = false;
					}
					if ($('#cp_recherche').length > 0) {
						if (!check_champ('cp_recherche')) {
							show_error_span('cp_recherche', param_langCode, '');
							bValid = false;
						}
					}
					if ($('input[name="acceptcond"]:checked').length == 0) {
						show_error_span('acceptcond_oui', param_langCode, '');
						bValid = false;
					}
					return bValid;

				},
				url : '../immobilier/visite_appartement_maison_envoi_' + param_langCode + '.html',
				data : 'rpath='
						+ $('#rpath').val()
						+ '&idProgPRIMPROMO='
						+ $('#idProgPRIMPROMO').val()
						+ '&civilite='
						+ $('#civilite').val()
						+ '&prenom='
						+ encodeURIComponent($('#prenom').val())
						+ '&nom='
						+ encodeURIComponent($('#nom').val())
						+ '&tel1='
						+ $('#tel1').val()
						+ '&tel2='
						+ $('#tel2').val()
						+ '&email='
						+ $('#email').val()
						+ '&adresse1='
						+ encodeURIComponent($('#adresse1').val())
						+ '&adresse2='
						+ encodeURIComponent($('#adresse2').val())
						+ '&cp='
						+ $('#cp').val()
						+ '&cp_recherche='
						+ $('#cp_recherche').val()
						+ '&ville='
						+ encodeURIComponent($('#ville').val())
						+ '&pays='
						+ encodeURIComponent($('#pays').val() + ' | '
								+ $('#pays option:selected').text())
						+ '&pref_horaire=' + $('#pref_horaire').val()
						+ '&projet=' + encodeURIComponent($('#projet').val())
						+ '&budgetde=' + $('#budgetde').val() + '&budgeta='
						+ $('#budgeta').val() + '&connupar='
						+ $('#connupar').val() + '&acceptcond='
						+ $('input[name="acceptcond"]:checked').val(),

				processData : false,
				success : function(response) {
					if (($('#civilite').val() != "") && $('#nom').val()
							&& $('#prenom').val() && $('#tel1').val()
							&& $('#email').val() && $('#adresse1').val()
							&& $('#cp').val() && $('#ville').val()
							&& check_champ('tel1') && check_champ('prenom')
							&& check_champ('nom') && check_champ('email')
							&& check_champ('adresse1') && check_champ('cp')
							&& check_champ('ville')) {
						$('#popinGlobalglobal').html(response);
					}
				},
				async : false
			});
	return false;
}

function popInValidationDemandeDoc(param_langCode) {
	self.location.hash = "#";
	$('.champ_popin span').remove();

	$
			.ajax( {
				type : "POST",
				contentType : "application/x-www-form-urlencoded;charset=ISO-8859-15",
				scriptCharset : "charset=ISO-8859-15",
				beforeSend : function(xhr) {
					bValid = true;
					if ($('#civ').val() == "") {
						show_error_span('civ', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('prenom')) {
						show_error_span('prenom', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('nom')) {
						show_error_span('nom', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('telephone')) {
						show_error_span('telephone', param_langCode, '');
						bValid = false;
					}

					if (check_champ('telephone2')) {
						show_error_span('telephone2', param_langCode, '');
						bValid = false;
					}

					if (!check_champ('mail')) {
						show_error_span('mail', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('adress1')) {
						show_error_span('adress1', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('code') && !check_zipCode('code')) {
						show_error_span('code', param_langCode, '');
						bValid = false;
					}

					if (!check_champ('ville')) {
						show_error_span('ville', param_langCode, '');
						bValid = false;
					}
					if ($('input[name="acceptcond"]:checked').length == 0) {
						show_error_span('acceptcond_oui', param_langCode, '');
						bValid = false;
					}
					return bValid;
				},
				url : '../immobilier/programme_immobilier_documentation_envoi_' + param_langCode + '.html',
				data : 'rpath=' + $('#rpath').val() + '&idProg='
						+ $('#idProg').val() + '&progName='
						+ $('#progName').val() + '&progTown='
						+ $('#progTown').val() + '&civ=' + $('#civ').val()
						+ '&prenom=' + $('#prenom').val() + '&nom='
						+ $('#nom').val() + '&telephone='
						+ $('#telephone').val() + '&mail=' + $('#mail').val()
						+ '&adress1=' + $('#adress1').val() + '&adress2='
						+ $('#adress2').val() + '&code=' + $('#code').val()
						+ '&ville=' + $('#ville').val() + '&pays='
						+ $('#pays').val() + ' | '
						+ $('#pays option:selected').text() + '&projet='
						+ $('#projet').val() + '&budget=' + $('#budget').val()
						+ '&connu=' + $('#connu').val() + '&acceptcond='
						+ $('input[name="acceptcond"]:checked').val()
						+ '&idProgPRIMPROMO=' + $('#idProgPRIMPROMO').val(),
				processData : false,
				success : function(response) {
					$('#popinGlobalglobal').html(response);
				},
				async : false
			});
	return false;
}

function popInValidationContact(param_langCode) {
	self.location.hash = "#";
	$('.champ_popin span').remove();
	$
			.ajax( {
				type : "POST",
				contentType : "application/x-www-form-urlencoded;charset=ISO-8859-15",
				scriptCharset : "charset=ISO-8859-15",
				beforeSend : function() {
					bValid = true;
					if (!check_champ('nom')) {
						show_error_span('nom', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('prenom')) {
						show_error_span('prenom', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('civ')) {
						show_error_span('civ', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('mail')) {
						show_error_span('mail', param_langCode, '');
						bValid = false;
					}
					if (!check_champ('msg')) {
						show_error_span('msg', param_langCode, '');
						bValid = false;
					}
					return bValid;
				},
				url : '../immobilier/groupe_immobilier_cogedim_contact_envoi_' + param_langCode + '.html',
				data : 'rpath=' + $('#rpath').val() + '&civ=' + $('#civ').val()
						+ '&nom=' + $('#nom').val() + '&prenom='
						+ $('#prenom').val() + '&mail=' + $('#mail').val()
						+ '&msg=' + $('#msg').val(),
				processData : false,
				success : function(response) {
					if ($('#civ').val() && $('#nom').val()
							&& $('#prenom').val() && $('#mail').val()
							&& $('#msg').val() && check_champ('civ')
							&& check_champ('prenom') && check_champ('nom')
							&& check_champ('mail') && check_champ('msg')) {
						$('#popinGlobalglobal').html(response);
					}
				},
				async : false
			});
	return false;
}

function popInValidationAlerteProgramme(param_langCode) {
	self.location.hash = "#";
	$('.champ_popin span').remove();
	$.ajax( {
		type : "POST",
		contentType : "application/x-www-form-urlencoded;charset=ISO-8859-15",
		scriptCharset : "charset=ISO-8859-15",
		beforeSend : function() {
			bValid = true;
			if ($('#civ').val() == "") {
				show_error_span('civ', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('nom')) {
				show_error_span('nom', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('prenom')) {
				show_error_span('prenom', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('tel')) {
				show_error_span('tel', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('mail')) {
				show_error_span('mail', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('cp')) {
				show_error_span('cp', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('ville')) {
				show_error_span('ville', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('pays')) {
				show_error_span('pays', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('adresse1')) {
				show_error_span('adresse1', param_langCode, '');
				bValid = false;
			}
			if ($('input[name="acceptcond"]:checked').length == 0) {
				show_error_span('acceptcond_oui', param_langCode, '');
				bValid = false;
			}
			return bValid;
		},
		url : '../immobilier/alerte_programme_envoi_' + param_langCode
				+ '.html?rpath=' + $('#rpath').val() + '&idprog='
				+ $('#idprog').val() + '&idProgPRIMPROMO='
				+ $('#idProgPRIMPROMO').val() + '&civ=' + $('#civ').val()
				+ '&nom=' + $('#nom').val() + '&prenom=' + $('#prenom').val()
				+ '&tel=' + $('#tel').val() + '&tel2=' + $('#tel2').val()
				+ '&mail=' + $('#mail').val() + '&adresse1='
				+ $('#adresse1').val() + '&adresse2=' + $('#adresse2').val()
				+ '&cp=' + $('#cp').val() + '&ville=' + $('#ville').val()
				+ '&pays=' + $('#pays').val() + ' | '
				+ $('#pays option:selected').text() + '&projet='
				+ $('#projet').val() + '&budgetde=' + $('#budgetde').val() +
				/*'&budgeta=' + $('#budgeta').val() +*/
				'&connupar=' + $('#connupar').val() + '&acceptcond='
				+ $('input[name="acceptcond"]:checked').val(),
		processData : false,
		success : function(response) {
			$('#popinGlobalglobal').html(response);
		},
		async : false
	});
	return false;
}

function popInValidationInteresseLot(param_langCode) {
	self.location.hash = "#";
	$('.champ_popin span').remove();
	$.ajax( {
		type : "POST",
		beforeSend : function() {
			bValid = true;
			if ($('#civilite').val() == "") {
				show_error_span('civilite', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('prenom')) {
				show_error_span('prenom', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('nom')) {
				show_error_span('nom', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('tel1')) {
				show_error_span('tel1', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('email')) {
				show_error_span('email', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('adresse1')) {
				show_error_span('adresse1', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('cp') && !check_zipCode('cp')) {
				show_error_span('cp', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('ville')) {
				show_error_span('ville', param_langCode, '');
				bValid = false;
			}
			if ($('input[name="acceptcond"]:checked').length == 0) {
				show_error_span('acceptcond_oui', param_langCode, '');
				bValid = false;
			}

			return bValid;
		},
		url : '../immobilier/interesse_lot_envoi_'
				+ param_langCode
				+ '.html?rpath='
				+ $('#rpath').val()
				+ '&progIdx='
				+ $('#idprog').val()
				+ '&numlot='
				+ $('#numlot').val()
				+ '&numIdLot='
				+ $('#numIdLot').val()
				+ '&contactconseil='
				+ verif_checkbox('contactconseil',
						'Etre contacte par un conseiller', 'non')
				+ '&etrealerte='
				+ verif_checkbox('etrealerte',
						'Etre alerte au lancement commercial du programme',
						'non') + '&civilite=' + $('#civilite').val()
				+ '&prenom=' + $('#prenom').val() + '&nom=' + $('#nom').val()
				+ '&tel1=' + $('#tel1').val() + '&tel2=' + $('#tel2').val()
				+ '&email=' + $('#email').val() + '&adresse1='
				+ $('#adresse1').val() + '&adresse2=' + $('#adresse2').val()
				+ '&cp=' + $('#cp').val() + '&ville=' + $('#ville').val()
				+ '&pays=' + $('#pays').val() + ' | '
				+ $('#pays option:selected').text() + '&projet='
				+ $('#projet').val() + '&budgetde=' + $('#budgetde').val()
				+ '&budgeta=' + $('#budgeta').val() + '&connupar='
				+ $('#connupar').val() + '&acceptcond='
				+ $('input[name="acceptcond"]:checked').val(),

		processData : false,
		success : function(response) {
			if (($('#civilite').val() != "") && $('#nom').val()
					&& $('#prenom').val() && $('#tel1').val()
					&& $('#email').val() && $('#adresse1').val()
					&& $('#cp').val() && $('#ville').val()
					&& check_champ('tel1') && check_champ('prenom')
					&& check_champ('nom') && check_champ('email')
					&& check_champ('adresse1') && check_champ('cp')
					&& check_champ('ville')) {
				$('#popinGlobalglobal').html(response);
			}

		},
		async : false
	});
	return false;
}

function show_error_span(id_element, lang, message) {
	if (message == '') {
		var message = 'Champ invalide';
		if (lang == 'en') {
			message = 'Invalid field';
		}
	}

	$('#' + id_element).parent().append(
			'<span class="erreur">' + message + '</span>');
}

/*
 * Retourne message_positif si la checkbox "id_check" est cochée ou message_negatif si inversement
 * */
function verif_checkbox(id_check, message_positif, message_negatif) {
	if (message_positif == '' || message_positif == undefined) {
		message_positif == 'oui';
	}
	if (message_negatif == '' || message_negatif == undefined) {
		message_negatif == 'non';
	}

	var is_checked = ($('#' + id_check + ':checked').val() == 'oui') ? message_positif
			: message_negatif;

	return is_checked;
}

function closePopin() {
	$('.myPopinCogedim').fadeOut('normal', function() {
		$(this).remove();
	});
	$('.popin-voile').fadeOut('normal', function() {
		$(this).remove();
	});
}

// Evol 116

function popInValidationEtudePerso(param_langCode) {
	self.location.hash = "#";
	$('.champ_popin span').remove();
	$.ajax( {
		type : "POST",
		contentType : "application/x-www-form-urlencoded;charset=ISO-8859-15",
		scriptCharset : "charset=ISO-8859-15",
		beforeSend : function() {
			bValid = true;
			if ($('#civexp').val() == "") {
				show_error_span('civexp', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('nomexp')) {
				show_error_span('nomexp', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('prenomexp')) {
				show_error_span('prenomexp', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('mailexp')) {
				show_error_span('mailexp', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('adresse1')) {
				show_error_span('adresse1', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('cpexp')) {
				show_error_span('cpexp', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('villeexp')) {
				show_error_span('villeexp', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('epargneMensuelle')) {
				show_error_span('epargneMensuelle', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('revenuMensuel')) {
				show_error_span('revenuMensuel', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('revenuFiscal')) {
				show_error_span('revenuFiscal', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('apportPersonnel')) {
				show_error_span('apportPersonnel', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('situationFamiliale')) {
				show_error_span('situationFamiliale', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('enfantsACharge')) {
				show_error_span('enfantsACharge', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('tel')) {
				show_error_span('tel', param_langCode, '');
				bValid = false;
			}
			if ($('input[name="acceptcond"]:checked').length == 0) {
				show_error_span('acceptcond_oui', param_langCode, '');
				bValid = false;
			}
			return bValid;
		},
		url : '../immobilier/insert_perso_' + param_langCode + '.html',
		data : 'rpath=' + $('#rpath').val() + '&urlToSend=' + document.URL
				+ '&idprog=' + $('#idprog').val() + '&civexp='
				+ $('#civexp').val() + '&nomexp='
				+ encodeURIComponent($('#nomexp').val()) + '&prenomexp='
				+ encodeURIComponent($('#prenomexp').val()) + '&mailexp='
				+ $('#mailexp').val() + '&adresse1='
				+ encodeURIComponent($('#adresse1').val()) + '&adresse2='
				+ encodeURIComponent($('#adresse2').val()) + '&cpexp='
				+ $('#cpexp').val() + '&villeexp='
				+ encodeURIComponent($('#villeexp').val()) + '&msg='
				+ encodeURIComponent($('#msg').val()) + '&epargneMensuelle='
				+ $('#epargneMensuelle').val() + '&revenuMensuel='
				+ $('#revenuMensuel').val() + '&revenuFiscal='
				+ $('#revenuFiscal').val() + '&apportPersonnel='
				+ $('#apportPersonnel').val() + '&situationFamiliale='
				+ $('#situationFamiliale').val() + '&tel=' + $('#tel').val()
				+ '&acceptcond=' + $('input[name="acceptcond"]:checked').val()
				+ '&enfantsACharge=' + $('#enfantsACharge').val()
				+ '&diminuerImpot='
				+ verif_checkbox('diminuerImpot', 'oui', 'non')
				+ '&protegerFamille='
				+ verif_checkbox('protegerFamille', 'oui', 'non')
				+ '&batirPatrimoine='
				+ verif_checkbox('batirPatrimoine', 'oui', 'non')
				+ '&augmenterRevenus='
				+ verif_checkbox('augmenterRevenus', 'oui', 'non')
				+ '&preparerRetraite='
				+ verif_checkbox('preparerRetraite', 'oui', 'non')
				+ '&connuComment='
				+ encodeURIComponent($('#connuComment').val()),

		processData : false,
		success : function(response) {
			if (($('#civexp').val() != "") && $('#nomexp').val()
					&& $('#prenomexp').val() && $('#mailexp').val()
					&& $('#cpexp').val() && $('#villeexp').val()
					&& $('#epargneMensuelle').val()
					&& $('#revenuMensuel').val() && $('#revenuFiscal').val()
					&& $('#apportPersonnel').val()
					&& $('#situationFamiliale').val()
					&& $('#enfantsACharge').val() && $('#tel').val()
					&& check_champ('nomexp') && check_champ('prenomexp')
					&& check_champ('mailexp') && check_champ('cpexp')
					&& check_champ('villeexp')
					&& check_champ('epargneMensuelle')
					&& check_champ('revenuMensuel')
					&& check_champ('revenuFiscal')
					&& check_champ('apportPersonnel')
					&& check_champ('situationFamiliale')
					&& check_champ('enfantsACharge') && check_champ('tel')
					&& check_champ('adresse1')) {

				$('#popinGlobalglobal').html(response);
			}
			return false;
		},
		async : false
	});
	return false;
}

function popInValidationLandingPrendreRDV(param_langCode) {
	self.location.hash = "#";
	$('.champ_popin span').remove();
	$.ajax( {
		type : "POST",
		contentType : "application/x-www-form-urlencoded;charset=ISO-8859-15",
		scriptCharset : "charset=ISO-8859-15",
		beforeSend : function() {
			bValid = true;
			if ($('#civilite').val() == "") {
				show_error_span('civilite', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('prenom')) {
				show_error_span('prenom', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('nom')) {
				show_error_span('nom', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('tel1') && !check_phoneNumber('tel1')) {
				show_error_span('tel1', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('email')) {
				show_error_span('email', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('adresse1')) {
				show_error_span('adresse1', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('cp') && !check_zipCode('cp')) {
				show_error_span('cp', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('ville')) {
				show_error_span('ville', param_langCode, '');
				bValid = false;
			}
			if ($('#cp_recherche').length > 0) {
				if (!check_champ('cp_recherche')) {
					show_error_span('cp_recherche', param_langCode, '');
					bValid = false;
				}
			}
			if ($('input[name="acceptcond"]:checked').length == 0) {
				show_error_span('acceptcond_oui', param_langCode, '');
				bValid = false;
			}
			return bValid;

		},
		url : '../landing-envoi-prendre-rdv_' + param_langCode + '.html',
		data : 'rpath='
				+ $('#rpath').val()
				+ '&idProgPRIMPROMO='
				+ $('#idProgPRIMPROMO').val()
				+ '&xtor='
				+ $('#xtor').val()
				+ '&civilite='
				+ $('#civilite').val()
				+ '&prenom='
				+ encodeURIComponent($('#prenom').val())
				+ '&nom='
				+ encodeURIComponent($('#nom').val())
				+ '&tel1='
				+ $('#tel1').val()
				+ '&tel2='
				+ $('#tel2').val()
				+ '&email='
				+ $('#email').val()
				+ '&adresse1='
				+ encodeURIComponent($('#adresse1').val())
				+ '&adresse2='
				+ encodeURIComponent($('#adresse2').val())
				+ '&cp='
				+ $('#cp').val()
				+ '&cp_recherche='
				+ $('#cp_recherche').val()
				+ '&ville='
				+ encodeURIComponent($('#ville').val())
				+ '&pays='
				+ encodeURIComponent($('#pays').val() + ' | '
						+ $('#pays option:selected').text()) + '&pref_horaire='
				+ $('#pref_horaire').val() + '&projet='
				+ encodeURIComponent($('#projet').val()) + '&budgetde='
				+ $('#budgetde').val() + '&budgeta=' + $('#budgeta').val()
				+ '&connupar=' + $('#connupar').val() + '&acceptcond='
				+ $('input[name="acceptcond"]:checked').val(),

		processData : false,
		success : function(response) {
			if (($('#civilite').val() != "") && $('#nom').val()
					&& $('#prenom').val() && $('#tel1').val()
					&& $('#email').val() && $('#adresse1').val()
					&& $('#cp').val() && $('#ville').val()
					&& check_champ('tel1') && check_champ('prenom')
					&& check_champ('nom') && check_champ('email')
					&& check_champ('adresse1') && check_champ('cp')
					&& check_champ('ville')) {
				$('#popinGlobalglobal').html(response);
			}
		},
		async : false
	});
	return false;
}

function popInValidationLandingInvitation(param_langCode) {
	self.location.hash = "#";
	$('.champ_popin span').remove();
	$.ajax( {
		type : "POST",
		contentType : "application/x-www-form-urlencoded;charset=ISO-8859-15",
		scriptCharset : "charset=ISO-8859-15",
		beforeSend : function() {
			bValid = true;
			if ($('#civilite').val() == "") {
				show_error_span('civilite', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('prenom')) {
				show_error_span('prenom', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('nom')) {
				show_error_span('nom', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('tel1') && !check_phoneNumber('tel1')) {
				show_error_span('tel1', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('email')) {
				show_error_span('email', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('adresse1')) {
				show_error_span('adresse1', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('cp') && !check_zipCode('cp')) {
				show_error_span('cp', param_langCode, '');
				bValid = false;
			}
			if (!check_champ('ville')) {
				show_error_span('ville', param_langCode, '');
				bValid = false;
			}
			if ($('#cp_recherche').length > 0) {
				if (!check_champ('cp_recherche')) {
					show_error_span('cp_recherche', param_langCode, '');
					bValid = false;
				}
			}
			if ($('input[name="acceptcond"]:checked').length == 0) {
				show_error_span('acceptcond_oui', param_langCode, '');
				bValid = false;
			}
			return bValid;

		},
		url : '../landing-envoi-invitation-ap_' + param_langCode + '.html',
		data : 'rpath='
				+ $('#rpath').val()
				+ '&idProgPRIMPROMO='
				+ $('#idProgPRIMPROMO').val()
				+ '&xtor='
				+ $('#xtor').val()
				+ '&civilite='
				+ $('#civilite').val()
				+ '&prenom='
				+ encodeURIComponent($('#prenom').val())
				+ '&nom='
				+ encodeURIComponent($('#nom').val())
				+ '&tel1='
				+ $('#tel1').val()
				+ '&tel2='
				+ $('#tel2').val()
				+ '&email='
				+ $('#email').val()
				+ '&adresse1='
				+ encodeURIComponent($('#adresse1').val())
				+ '&adresse2='
				+ encodeURIComponent($('#adresse2').val())
				+ '&cp='
				+ $('#cp').val()
				+ '&cp_recherche='
				+ $('#cp_recherche').val()
				+ '&ville='
				+ encodeURIComponent($('#ville').val())
				+ '&pays='
				+ encodeURIComponent($('#pays').val() + ' | '
						+ $('#pays option:selected').text()) + '&pref_horaire='
				+ $('#pref_horaire').val() + '&projet='
				+ encodeURIComponent($('#projet').val()) + '&budgetde='
				+ $('#budgetde').val() + '&budgeta=' + $('#budgeta').val()
				+ '&connupar=' + $('#connupar').val() + '&acceptcond='
				+ $('input[name="acceptcond"]:checked').val(),

		processData : false,
		success : function(response) {
			if (($('#civilite').val() != "") && $('#nom').val()
					&& $('#prenom').val() && $('#tel1').val()
					&& $('#email').val() && $('#adresse1').val()
					&& $('#cp').val() && $('#ville').val()
					&& check_champ('tel1') && check_champ('prenom')
					&& check_champ('nom') && check_champ('email')
					&& check_champ('adresse1') && check_champ('cp')
					&& check_champ('ville')) {
				$('#popinGlobalglobal').html(response);
			}
		},
		async : false
	});
	return false;
}
