= 0){
				var objImgNote = allImg[i];
				if(objImgNote.src == gCONFIG["BASE_URL"]+"system/application/resources/images/vitrines/star_note_avis.png"){
					Note = Note + 1;
				}
			}
		}
		if(Note <= 0){
			afficherFenetreMessage("Note du commerce", "
Veuillez noter le commerce !
"+afficherBoutonOkFenetreMessage('OK')+"
", 0, 200, 300);
			return false;
		}
		
		if(areOK == false){
			return false;
		}
		jQuery("#IDhdnNote",_prt).val(Note);
        avant_enregistrement_avis(_prt);
		jQuery.post(gCONFIG["SITE_URL"]+"/accueil/valider_avis/" + prmIdNumero + "/" + prmIdQuoi, _prt.serialize(), function(data){
			cacherFonce();
			reset_form_avis();
			eval(data);
		});
	}
    function reset_form_avis() {
		jQuery(".inp-valider").css("display","block");
        jQuery(".inp-enreg").css("display","none");
        jQuery(".input-accroche").val("Accroche de votre avis (ex : Un accueil chaleureux dans un cadre sympa...)");
        jQuery(".input-avis").val("Argumentez votre avis. Les internautes pourront juger votre avis donc merci d'être le plus clair possible et d'éviter le langage SMS");
		jQuery(".notes_coeurs").attr("src",gCONFIG["BASE_URL"]+"system/application/resources/images/vitrines/star_avis.png");
		jQuery(".input-note").val(0);
        document.location="#___entete";
    }
    function avant_enregistrement_avis(parent) {
        jQuery("#enreg_avis",jQuery(parent)).css("display","block");
		jQuery("#valide_avis",jQuery(parent)).css("display","none");
    }
	
	function checkNote(prmObject){
		var curId = prmObject.id;
		var TabId = curId.split("_");
		var IndexNote = parseInt(TabId[1]);
		if(prmObject.src == gCONFIG["BASE_URL"]+"system/application/resources/images/vitrines/star_avis.png"){
			prmObject.src = gCONFIG["BASE_URL"]+"system/application/resources/images/vitrines/star_note_avis.png";
			for(qq = 1; qq < IndexNote; qq++){
				jQuery("#coeur_"+qq,jQuery(prmObject).closest("td")).attr("src",gCONFIG["BASE_URL"]+"system/application/resources/images/vitrines/star_note_avis.png");
			}
		}else{
			prmObject.src = gCONFIG["BASE_URL"]+"system/application/resources/images/vitrines/star_avis.png";
			for(qq = 5; qq > IndexNote; qq--){
				jQuery("#coeur_"+qq,jQuery(prmObject).closest("td")).attr("src",gCONFIG["BASE_URL"]+"system/application/resources/images/vitrines/star_avis.png");
			}
		}
	}
	
	function displayListAvis(){
		document.getElementById("liste_avis").style.display = "block";
		document.getElementById("crit_tri_avis").style.display = "block";
		document.getElementById("lien_afficher_liste_avis").style.display = "none";
	}
	
	function TrierAvis(prmIdNumero, prmIdQuoi, prmOrderBy){
		loadDynamicContent(gCONFIG["SITE_URL"]+'/accueil/listes_avis/'+prmIdNumero+'/'+prmIdQuoi+'/'+prmOrderBy, 'liste_avis');
	}
	
	function setUtiliteAvis(prmIdAvis, prmEstUtilite, prmTarget){
		loadDynamicContent(gCONFIG["SITE_URL"]+'/accueil/maj_utilite_avis/'+prmIdAvis+'/'+prmEstUtilite, prmTarget);
	}
    
	function ValidateInscription(prmIdOrganisme){
		ClearErrMsgInscription();
		var MsgError = "";
		var isValid = true;
			document.getElementById("IDSexeError").innerHTML = "";
			if ((document.getElementById("IDchkHomme").checked == false) && (document.getElementById("IDchkFemme").checked == false)){
				MsgError = "- Le sexe est obligatoire.
";
				document.getElementById("IDSexeError").innerHTML = MsgError;
				isValid = false;
			}
			if (isEmpty(document.getElementById("IDtxtNom").value)){
				MsgError = "- Le Nom est obligatoire.
";
				document.getElementById("IDNomPrenomError").innerHTML = MsgError;
				document.getElementById("IDtxtNom").className = "invalid_field";
				isValid = false;
			}
			
			if(isEmpty(document.getElementById("IDtxtPortable").value) == false){
				if((document.getElementById("IDtxtPortable").value == "06") || (document.getElementById("IDtxtPortable").value == "07")){
					document.getElementById("IDtxtPortable").value = "";
				}else{
					if(document.getElementById("IDtxtPortable").value.length < 10){
						MsgError = "- Le numero portable est incorrect.";
						document.getElementById("IDPortableError").innerHTML += MsgError;
						document.getElementById("IDtxtPortable").className = "invalid_field";
						isValid = false;
					}
				}
			}
			
			if (isEmpty(document.getElementById("IDtxtPrenom").value)){
				MsgError = "- Le Prenom est obligatoire.";
				document.getElementById("IDNomPrenomError").innerHTML += MsgError;
				document.getElementById("IDtxtPrenom").className = "invalid_field";
				isValid = false;
			}
			if (isEmpty(document.getElementById("IDtxtVille").value)){
            MsgError = "Le Code postal est obligatoire.";
            document.getElementById("IDVilleError").innerHTML = MsgError;
            document.getElementById("IDtxtVille").className = "invalid_field";
            isValid = false;
        }else{
			if(document.getElementById('IDhdnIdVille')){
				if (isEmpty(document.getElementById("IDhdnIdVille").value)){
					MsgError = "La ville est obligatoire.";
					document.getElementById("IDVilleError").innerHTML = MsgError;
					document.getElementById("IDhdnIdVille").className = "invalid_field";
					isValid = false;
				}
			}else{
				MsgError = "La ville est obligatoire.";
				document.getElementById("IDVilleError").innerHTML = MsgError;
				document.getElementById("IDtxtVille").className = "invalid_field";
				isValid = false;
			}
		}
			if (isEmpty(document.getElementById("IDtxtEmail").value)){
				MsgError = "L'adresse email est obligatoire.";
				document.getElementById("IDEmailError").innerHTML = MsgError;
				document.getElementById("IDtxtEmail").className = "invalid_field";
				isValid = false;
			}else{
				if (isEmail(document.getElementById("IDtxtEmail").value) == false) {
					MsgError = "L'adresse email est incorrecte.";
					document.getElementById("IDEmailError").innerHTML = MsgError;
					document.getElementById("IDtxtEmail").className = "invalid_field";
					isValid = false;    
				}
			}
			if (isEmpty(document.getElementById("IDtxtPseudo").value)){
				MsgError = "Le Pseudo est obligatoire.";
				document.getElementById("IDPseudoError").innerHTML = MsgError;
				document.getElementById("IDtxtPseudo").className = "invalid_field";
				isValid = false;
			}
			if (isEmpty(document.getElementById("IDtxtMotDePasse").value)){
				MsgError = "Le mot de passe est obligatoire.";
				document.getElementById("IDMotDePasseError").innerHTML = MsgError;
				document.getElementById("IDtxtMotDePasse").className = "invalid_field";
				isValid = false;
			}else{
				if (document.getElementById("IDtxtMotDePasse").value.length < 6){
					MsgError = "Le mot de passe doit etre constitué de 6 caracteres au minimum est obligatoire.";
					document.getElementById("IDMotDePasseError").innerHTML = MsgError;
					document.getElementById("IDtxtMotDePasse").className = "invalid_field";
					isValid = false;
				}
			}
			if (isEmpty(document.getElementById("IDtxtConfirmation").value)){
				MsgError = "La confirmation du mot de passe est obligatoire.";
				document.getElementById("IDConfirmationError").innerHTML = MsgError;
				document.getElementById("IDtxtConfirmation").className = "invalid_field";
				isValid = false;
			}else{
				if (document.getElementById("IDtxtConfirmation").value != document.getElementById("IDtxtMotDePasse").value){
					MsgError = "La confirmation et le mot de passe doivent etre identique.";
					document.getElementById("IDConfirmationError").innerHTML = MsgError;
					document.getElementById("IDtxtConfirmation").className = "invalid_field";
					isValid = false;
				}
			}
		if (isEmpty(document.getElementById("IDtxtCaptcha").value)){
			MsgError = "Le Pseudo est obligatoire.";
			document.getElementById("IDCaptchaError").innerHTML = "Ce champ ne peut pas etre vide.";
			document.getElementById("IDtxtCaptcha").className = "invalid_field";
			isValid = false;
		}
		if(isValid){
			if (document.getElementById('IDchkConfirmationInscription').checked){
			processAjaxData("IDfrmInscriptionMembre", gCONFIG["SITE_URL"]+"/accueil/is_mail_and_captcha_ok/", "POST", "proccess_running", "submitInscription(xhr.responseText,"+prmIdOrganisme+");");
			}else{
				afficherFenetreMessage("Conditions générales d'utilisation", "
Pour pouvoir continuer, vous devez accepter les « Conditions générales d'utilisation », pour cela veuillez cocher la case et confirmer par la même occasion votre souhait de devenir membre de Citymalin.com! 
"+afficherBoutonOkFenetreMessage('OK')+"
", 0, 200, 300);
				return false;
			}
		}
	}
	function refreshCaptchaInscription(prmFunction) {
		updateModule(gCONFIG["SITE_URL"] + "/accueil/generate_captcha", "trCaptcha", prmFunction);
	}
	var SerializedFormToSubmit = null;
	function submitInscription(prmResult,prmIdOrganisme){
		prmResult = prmResult.split("");
		var OkMail = true;
		var OkCapthca = true;
		var OkPseudo = true;
		if(prmResult[0] == "1"){
			document.getElementById("IDEmailError").innerHTML = "Cet adresse Email existe deja.";
			document.getElementById("IDtxtEmail").className = "invalid_field";
			OkMail = false;
		}
		if(prmResult[1] == "0"){
			refreshCaptchaInscription("displayCaptchaErrorInscription()");
			OkCapthca = false;
		}
		if(prmResult[2] == "1"){
			document.getElementById("IDPseudoError").innerHTML = "Cet identifiant est deja pris.";
			document.getElementById("IDtxtPseudo").className = "invalid_field";
			OkPseudo = false;
		}
		
		if((OkMail == true) && (OkCapthca == true) && (OkPseudo == true)){
			SerializedFormToSubmit = $("IDfrmInscriptionMembre").serialize();
			show_popup(450,150, "Quels sont vos centres d'interêts ?",gCONFIG["SITE_URL"]+"/accueil/liste_categorie/"+prmIdOrganisme);
		}
	}
	function FinalizeInscription(prmIdOrganisme){
		if(SerializedFormToSubmit != null){
			afficherFenetreMessage('Traitement en cours ...', '
 Création de votre compte
Ce compte n'est pas encore activé,
pour l'activer, veuillez cliquer sur le lien qui vous a été envoyé par mail lors de votre inscription.
"+afficherBoutonOkFenetreMessage('OK')+"
", 0, 200, 300);
	}
	
	function send_psw(prmResult){
		var OkMail = true;
		var OkCapthca = true;
		if(prmResult[0] == "0"){
			document.getElementById("IDEmailError").innerHTML = "Cet adresse Email n'a pas encore été inscrit.";
			document.getElementById("IDtxtEmail").className = "invalid_field";
			OkMail = false;
		}
		if(prmResult[1] == "0"){
			displayCaptchaErrorInscription();
			OkCapthca = false;
		}
		if((OkMail == true) && (OkCapthca == true)){
			afficherFenetreMessage('Traitement en cours ...', '
 Envoi de votre mot de passe.
Vous êtes maintenant ami de '+gCONFIG["NOM_COMMERCE"]+' ('+gCONFIG["CP_VILLE_COMMERCE"]+')
Il vous enverra tous ses bons plans et événements en avant-première.
';
			$("popupTitleText").update("Félicitations !");
		} else if (rep == 1){
			$("popupTitleText").update("Information");
			content = 'Vous êtes déjà ami de '+gCONFIG["NOM_COMMERCE"]+'
';
		}
		if(content != "") {
			$("popupcontent").update(content);
		}
	}
	
	function afficherFenetreMessage(titre, contenu, offsetX, offsetY, width) {
		afficherFonce();
		afficherInfobulle(titre, contenu, offsetX, offsetY, width);
	}
	function afficherFonce() {
		var mySize = getSize();
		var myOffset = getScrollXY();
		hei = ietruebody().scrollTop;
		var ie=document.all;
		if (ie) {
			var newHeight=document.documentElement.scrollHeight;
		} else {
			if (window.scrollMaxY) {
				var newHeight = window.scrollMaxY + window.innerHeight;
			} else {
				var newHeight = document.body.scrollHeight;
			}
		}
		if (document.getElementById('div_fond_fenetre')) {
			document.getElementById('div_fond_fenetre').style.display="block";
			document.getElementById('div_fond_fenetre').style.width=mySize[0] +'px';
			document.getElementById('div_fond_fenetre').style.height=(newHeight + 80)+'px';
		}
		if (document.getElementById('confirm_frame')) {
			document.getElementById('confirm_frame').style.display="block";
			document.getElementById('confirm_frame').style.width=mySize[0]+'px';
			document.getElementById('confirm_frame').style.height=(newHeight + 80)+'px';
		}
	}
	function afficherFonce2(div_fond_fenetre, confirm_frame, zIndex) {
		var mySize = getSize();
		var myOffset = getScrollXY();
		hei = ietruebody().scrollTop;
		var ie=document.all;
		if (ie) {
			var newHeight=document.documentElement.scrollHeight;
		} else {
			if (window.scrollMaxY) {
				var newHeight = window.scrollMaxY + window.innerHeight;
			} else {
				var newHeight = document.body.scrollHeight;
			}
		}
		if (document.getElementById(div_fond_fenetre)) {
			document.getElementById(div_fond_fenetre).style.display="block";
			document.getElementById(div_fond_fenetre).style.width=mySize[0] +'px';
			document.getElementById(div_fond_fenetre).style.height=(newHeight + 80)+'px';
			document.getElementById(div_fond_fenetre).style.zIndex=zIndex;
		}
		if (document.getElementById(confirm_frame)) {
			document.getElementById(confirm_frame).style.display="block";
			document.getElementById(confirm_frame).style.width=mySize[0]+'px';
			document.getElementById(confirm_frame).style.height=(newHeight + 80)+'px';
		}
	}
	function cacherFonce2(div_fond_fenetre, bulle_interview, confirm_frame) {
		if (document.getElementById(div_fond_fenetre)) {
			document.getElementById(div_fond_fenetre).style.display="none";
		}
		if (document.getElementById(bulle_interview)) {
			document.getElementById(bulle_interview).style.display="none";
		}
		if (document.getElementById(confirm_frame)) {
			document.getElementById(confirm_frame).style.display="none";
		}
	}
	function afficherInfobulle(titre, contenu, offsetX, offsetY, width) {
		var top=document.all? iecompattest().scrollTop : pageYOffset;
		top+=offsetY;
		var left=((screen.width-width)/2) + offsetX;
		$("bulle_interview").style.left=left+'px';
		$("bulle_interview").style.top=top+'px';
		$("bulle_interview").style.width=width+'px';
		$("bulle_interview").style.display="block";
		$("bulle_titre").innerHTML=titre;
		$("bulle_contenu").innerHTML=contenu;
	}
	function cacherFonce() {
		if (document.getElementById('div_fond_fenetre')) {
			document.getElementById('div_fond_fenetre').style.display="none";
		}
		if (document.getElementById('bulle_interview')) {
			document.getElementById('bulle_interview').style.display="none";
		}
		if (document.getElementById('confirm_frame')) {
			document.getElementById('confirm_frame').style.display="none";
		}
	}
	function checkAmisActions(prmId,prmStr){
		var isFound = false;
		var strListId = document.getElementById("IDhdnColIdCommerceAmis").value;
		if(strListId == ""){
			isFound = false;
		}else{
			var tabId = strListId.split(",");
			for(q = 0; q < tabId.length; q++){
				if(parseFloat(prmId) == parseFloat(tabId[q])){
					isFound = true;
				}
			}
		}
		if(isFound){
            if (prmStr == "amis") {
                confirmationInscription("amis",prmId);
            } else {
			confirmationInscription("deja_amis",prmId);
            }
		}else{
			fiche_authentification(1,prmId,prmStr);
		}
	}
	
	function updateListIdOrganisme(prmObjectId, prmIdToAdd){
		var separator = "";
		if(document.getElementById(prmObjectId).value == ""){
			separator = "";
		}else{
			separator = ",";
		}
		document.getElementById(prmObjectId).value = document.getElementById(prmObjectId).value + separator + prmIdToAdd;
	}
	
	function confirmationInscription(prmType,prmId){
		close_fenetre_flottante2('div_fond_fenetre_2', 'confirm_frame_2', 'confirm_frame');
		var Title = "Citymalin.com";
		show_popup(450,150, Title,gCONFIG["SITE_URL"]+'/accueil/confirmation_inscription/' + prmType + '/'+prmId);
	}
	
	function setParentTitle(prmType,prmTitle){
		var Title = "Citymalin.com";
		switch(prmType){
			case "inscription":
				Title = "Confirmation inscription";
				break;
			case "psw":
				Title = "Recuperation mot de passe";
				break;
			case "amis":
				Title = "Félicitations!";
				break;
			case "avis":
				Title = "Merci d'avoir donn\u00E9 votre avis";
				break;
			case "deja_amis":
				Title = "Information";
				break;
			case "modif_profil":
				Title = "Information";
				break;
			default:
				Title = "Citymalin.com";
				break;
		}
		if(prmTitle != null){
			Title = prmTitle;
		}
		$("popupTitleText").update(Title);
	}
	function close_fenetre_flottante2(div_fond_fenetre_2, confirm_frame_2, confirm_frame) {
		var objPopUp = $("scontentmain");
		$("popupcontent").innerHTML = "";
		objPopUp.style.zIndex = "1000";
		objPopUp.style.width = "600px"; 
		objPopUp.style.display="none";
		if (document.getElementById(confirm_frame_2)) {
			document.getElementById(confirm_frame_2).style.display="none";
		}
		if (document.getElementById(confirm_frame)) {
			document.getElementById(confirm_frame).style.display="none";
		}
		if (document.getElementById(div_fond_fenetre_2)) {
			document.getElementById(div_fond_fenetre_2).style.display="none";
		}
	}
	function getOrganismeAvis(prmIdOrganisme, prmLimit) {
		if (prmLimit != null) {
			show_loading("vitrine_avis_content");
			processAjaxData("", gCONFIG["SITE_URL"] + "/organismes/mes_avis/" + prmIdOrganisme + "/" + prmLimit, "GET", "vitrine_avis_content", "$('vitrine_avis_content').update(xhr.responseText);");
		} else {
			show_popup(600, 400, "Tous les avis", gCONFIG["SITE_URL"] + "/accueil/listes_avis/" + prmIdOrganisme + "/1/1", "");
		}
	}
	
	function inprocess(prmCaption, prmWidth){
		if(prmCaption == null){
			prmCaption = "Traitement en cours...";
		}
		if(prmWidth == null){
			prmWidth = "205px";
		}
		popup({noeffect:true, width:prmWidth,content:' ' + prmCaption + '
  ' + prmCaption + ''+number+'
',
			top : _t,
			sender : sender
		});
	}
	function mobDropdown(options)
	{
		jQuery(".main-overlay").remove(); jQuery("#popup-bloc").remove();
		jQuery(".m-ovrl").remove(); jQuery("#m-drpdwn").remove();
		
		jQuery("body").append('');
		jQuery("body").append('');
		var _sndr = null;
		if(options != null){
			if(options.title !== null && options.title !== undefined){
				if(options.title != ""){
					jQuery("#m-drpdwn-title").html(options.title);
				}else{
					jQuery(".m-drpdwn-header").remove();	
				}
			}else{
				jQuery(".m-drpdwn-header").remove();
			}
			if(options.content){
				jQuery("#m-drpdwn-content").html(options.content);
			}
			if(options.top){
				jQuery("#m-drpdwn").css("top",options.top);
			}
			if(options.left){
				jQuery("#m-drpdwn").css("left",options.left);
			}
			if(options.sender){
				jQuery(options.sender).addClass("m-b-dwn");
				_sndr = jQuery(options.sender);
			}
		}
		jQuery(".m-ovrl").data("sender",_sndr).height(jQuery(document).outerHeight(true));
		jQuery(".m-ovrl").on("click",function(e){
			var _o = jQuery(this).data("sender");
			_o.removeClass("m-b-dwn");
			jQuery("#m-drpdwn").remove();
			jQuery(".m-ovrl").remove(); 
		});
	}
	
	
	function mentionsLegales(url)
	{
		inprocess("Chargement en cours", "205px");
		jQuery.post(url, {}, function (data){
			var str = '';
			popup({
				width : 	"600px",
				title :		"Mentions Légales",
				content : 	'' + str+data + '
'
			});
		});
	}
	function mentionsLegalesSite(i,p)
	{
		inprocess("Chargement en cours", "205px");
		jQuery.post('https://www.latrattoria-cesson.fr/index.php/organismes/replace_fusion/'+i+'/'+p+'/9', {}, function (data){
			var str = '';
			popup({
				width : 	"600px",
				title :		"Mentions Légales",
				content : 	'' + str+data + '
'
			});
		});
	}
	
	function refreshCaptcha(prmFunction) {
		updateModule(gCONFIG["SITE_URL"] + "/acces/generate_captcha", "trCaptcha", prmFunction);
	}
	function frmFormulaireContactIsvalid(prmCaptcha) {
		msg = "";
		if ($("txtCaptcha").value == prmCaptcha) {
			$("ErrorCaptcha").style.display= "none";
		} else {
			refreshCaptcha("$('ErrorCaptcha').style.display= 'block';");
			msg += "1";
		}
		if (!isEmpty($("VotreNom").value)) {
			$("divErrorFCNom").style.display= "none";
		} else {
			$("divErrorFCNom").style.display= "block";
			msg += "1";
		}
		 
		if (!isEmpty($("VotrePrenom").value)) {
			$("divErrorFCPrenom").style.display= "none";
		} else {
			$("divErrorFCPrenom").style.display= "block";
			msg += "1";
		}
		if (!isEmpty($("VotreVille").value)) {
			$("divErrorFCVille").style.display= "none";
		} else {
			$("divErrorFCVille").style.display= "block";
			msg += "1";
		}
		if (!isEmpty($("VotreEmail").value)) {
			if (isEmail($("VotreEmail").value)) {
				$("divErrorFCEmail").style.display= "none";
			} else {
				$("divErrorFCEmail").style.display= "block";
				msg += "1";
			}
		}
		if (!isEmpty($("ObjetContact").value)) {
			$("divErrorFCObjet").style.display= "none";
		} else {
			$("divErrorFCObjet").style.display= "block";
			msg += "1";
		}
		if (!isEmpty($("VotreMessage").value)) {
			$("divErrorFCMessage").style.display= "none";
		} else {
			$("divErrorFCMessage").style.display= "block";
			msg += "1";
		}
		if (msg == "") {
			return true;
		} else {
			return false;
		}
	}
	function participer_jeu(prmId, prmIdjeu, prmMode){
		if(prmId == 0){
			var Mode = (prmMode) ? prmMode : 4;
			fiche_authentification(Mode,0,'Identifiez-vous pour participer au jeu.',prmIdjeu);
		}else{
			popup_participation_jeu(prmIdjeu);
		}
	}
	
	function popup_participation_jeu(IdJeux, IdOrganisme){
		prmIdJeux = (IdJeux != null) ? IdJeux : 0;
		prmIdOrganisme = (IdOrganisme != null) ? IdOrganisme : 0;
		afficherFonce2('div_fond_fenetre_popup', 'confirm_frame_popup', 800);
		show_popup(480,150, 'Inscription',gCONFIG["SITE_URL"]+'/accueil/popup_participation_jeu/' + prmIdJeux + '/' + prmIdOrganisme);
	}
	function enregistrer_participation_jeu(prmIdJeu, prmIdOrganisme){
		afficherFenetreMessage('Traitement en cours ...', '
 Enregistrement de votre participation.
";
			document.getElementById("IDNomError").innerHTML = MsgError;
			document.getElementById("IDtxtNom").className = "invalid_field";
			isValid = false;
		}
		
		if (isEmpty(document.getElementById("IDtxtPrenom").value)){
			MsgError = "- Le Prenom est obligatoire.";
			document.getElementById("IDPrenomError").innerHTML += MsgError;
			document.getElementById("IDtxtPrenom").className = "invalid_field";
			isValid = false;
		}
		if(isEmpty(document.getElementById("IDtxtPortable").value) == false){
			if((document.getElementById("IDtxtPortable").value == "06") || (document.getElementById("IDtxtPortable").value == "07")){
				document.getElementById("IDtxtPortable").value = "";
			}else{
				if(document.getElementById("IDtxtPortable").value.length < 10){
					MsgError = "- Le numero portable est incorrect.";
					document.getElementById("IDPortableError").innerHTML += MsgError;
					document.getElementById("IDtxtPortable").className = "invalid_field";
					isValid = false;
				}
			}
		}
		if (isEmpty(document.getElementById("IDtxtVille").value)){
			MsgError = "Le Code postal est obligatoire.";
			document.getElementById("IDVilleError").innerHTML = MsgError;
			document.getElementById("IDtxtVille").className = "invalid_field";
			isValid = false;
		}else{
			if(document.getElementById('IDhdnIdVille')){
				if (isEmpty(document.getElementById("IDhdnIdVille").value)){
					MsgError = "La ville est obligatoire.";
					document.getElementById("IDVilleError").innerHTML = MsgError;
					document.getElementById("IDhdnIdVille").className = "invalid_field";
					isValid = false;
				}
			}else{
				MsgError = "La ville est obligatoire.";
				document.getElementById("IDVilleError").innerHTML = MsgError;
				document.getElementById("IDtxtVille").className = "invalid_field";
				isValid = false;
			}
		}
		if (isEmpty(document.getElementById("IDtxtEmail").value)){
			MsgError = "L'adresse email est obligatoire.";
			document.getElementById("IDEmailError").innerHTML = MsgError;
			document.getElementById("IDtxtEmail").className = "invalid_field";
			isValid = false;
		}else{
			if (isEmail(document.getElementById("IDtxtEmail").value) == false) {
				MsgError = "L'adresse email est incorrecte.";
				document.getElementById("IDEmailError").innerHTML = MsgError;
				document.getElementById("IDtxtEmail").className = "invalid_field";
				isValid = false;    
			}
		}
		if(isValid){
			var OnComplete = "confirmationInscription('modif_profil',xhr.responseText);";
			if(prmMode == "participation_jeu"){
            if ((prmIdJeu == null) && (prmIdOrganisme == null)) {
                OnComplete = "";
            } else {
                OnComplete = "enregistrer_participation_jeu("+prmIdJeu+", "+prmIdOrganisme+");";
            }
			}else{
				OnComplete = "confirmationInscription('modif_profil',xhr.responseText);";
			}
			afficherFenetreMessage('Traitement en cours ...', '
 Enregistrement des modifications
"+strContent+"
"+afficherBoutonCancelFenetreMessage('Annuler')+' '+afficherBoutonOkFenetreMessage('OK')+"
", 0, 200, 300);
			jQuery("#divOk").unbind();
			jQuery("#divOk").click(function () {
				var objFileToUpload = document.getElementById("IDflAvatar");
				if (objFileToUpload.value != ""){
					ajax_light_uploadfileCompleteEvent(
						"IDflAvatar",
						"https://www.latrattoria-cesson.fr/index.php/accueil/uploadAvatar/"+prmId,
						"cacherFonce();document.getElementById('IDimgMonAvatar').src=prm.responseText;document.getElementById('IDPictoSupprimerAvatar').style.display='block';"
					);
					afficherFenetreMessage('Traitement en cours ...', '
 Mise a jour de votre photo.
"+strContent+"
"+afficherBoutonCancelFenetreMessage('Annuler')+' '+afficherBoutonOkFenetreMessage('OK')+"
", 0, 200, 300);
			jQuery("#divOk").unbind();
			jQuery("#divOk").click(function () {
				processAjaxData("IDfrmAvatar", "https://www.latrattoria-cesson.fr/index.php/accueil/updateAvatar/"+prmId+"/delete/", "POST", "proccess_running", "cacherFonce();document.getElementById('IDimgMonAvatar').src='https://www.latrattoria-cesson.fr/system/application/resources/images/avatars/no_photo.gif';document.getElementById('IDPictoSupprimerAvatar').style.display='none';");				
			});
		}
	}
	
	function ClearErrMsgInscription2(){
		document.getElementById("IDNomError").innerHTML = "";
		document.getElementById("IDPrenomError").innerHTML = "";
		document.getElementById("IDtxtNom").className = "";
		document.getElementById("IDtxtPrenom").className = "";
		
		document.getElementById("IDVilleError").innerHTML = "";
		document.getElementById("IDtxtVille").className = "";
		
		document.getElementById("IDEmailError").innerHTML = "";
		document.getElementById("IDtxtEmail").className = "";
		if(document.getElementById('IDPortableError')){
			document.getElementById("IDPortableError").innerHTML = "";
			document.getElementById("IDtxtPortable").className = "";
		}
		
		if(document.getElementById('IDhdnIdVille')){
			document.getElementById("IDVilleError").innerHTML = "";
			document.getElementById("IDhdnIdVille").className = "";
		}
	}
	
	function afficherBoutonCancelFenetreMessage(txt) {
		return ''+txt+'';
	}
	function iecompattest(){
		return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	}
	function RemoveAlphabeticChars(prmValue){
		var tmpValue = prmValue.replace(/[^0-9]/g,"");
		var prefixe = tmpValue.substr(0,2);
		if((prefixe == "06") || (prefixe == "07")){
			return tmpValue.substr(0,10);
		}else{
			if(prefixe == "0"){
				return 0;
			}else{
				return "06" + tmpValue.substr(0,8);
			}
		}	
	}
	
	function AutocompleteCp(prmObject,prmContainerID){
		prmObject.value = prmObject.value.replace(/[^0-9]/g,"");
		if(document.getElementById(prmContainerID)){
			if((prmObject.value != "") && (prmObject.value.length == 5)){
				document.getElementById(prmContainerID).innerHTML = " ";
				var Cp = prmObject.value;
				zUrl = gCONFIG["SITE_URL"]+"/villes/autocomplete_cp/"+Cp;
				zFunction = "";
				updateModule(zUrl, prmContainerID, zFunction);
			}else{
				document.getElementById(prmContainerID).innerHTML = "";
			}
		}
	}	
	function ajax_light_uploadfileCompleteEvent(prmInputName, prmUrl, prmOnCmpltFunction){
		jQuery.ajaxFileUpload ({
            url:prmUrl,
            secureuri:false,
            fileElementId:prmInputName,
            dataType: 'json',
            complete:function(prm){
                eval(prmOnCmpltFunction);
            },
            success: function (data, status) {
            },
            error: function (data, status, e) {
            }
        })
        
        return false;
	}
    
    function getNbClic(prmIdOrganisme, prmIdMembre, prmTypeActivite) {
        processAjaxData("", gCONFIG["SITE_URL"] + "/organismes/getCountClick/" + prmIdOrganisme + "/" + prmIdMembre + "/" + prmTypeActivite, "GET", "nousC", "");
    }
	
	
	function afficher_cacher(id){ if(document.getElementById(id).style.visibility=="hidden"){ document.getElementById(id).style.visibility="visible"; document.getElementById('bouton_'+id).innerHTML=''; } else { document.getElementById(id).style.visibility="hidden"; document.getElementById('bouton_'+id).innerHTML='Afficher le nº de téléphone'; }; return true; } 
	
	
		function fb_share(sender)
		{
												var eid = jQuery(sender).data("eid");
			var type = jQuery(sender).data("type");
			var _titre = "";
			var _strTitre = '';
			if(jQuery("#evt-accr-"+eid).length>0){
				_title = jQuery("#evt-accr-"+eid).text();
				_title= encodeURIComponent(_title);
				_strTitre = '&t='+_title;
			}
			strUrl = jQuery("#evt-url-"+eid).attr("href");
			window.open('https://www.facebook.com/sharer.php?u='+encodeURIComponent(strUrl)+_strTitre,'facebook-share-dialog','width=630,height=440');
						
		}
		
		function gp_share(sender)
		{
			var eid = jQuery(sender).data("eid");
			var type = jQuery(sender).data("type");
			strUrl = jQuery("#evt-url-"+eid).attr("href");
			window.open('https://plus.google.com/share?url='+encodeURIComponent(strUrl),'google-plus-share-dialog','width=626,height=436');
		}
		
		function tw_share(sender)
		{
			var eid = jQuery(sender).data("eid");
			var type = jQuery(sender).data("type");
			strUrl = jQuery("#evt-url-"+eid).attr("href");
			window.open('https://www.twitter.com/share?url='+encodeURIComponent(strUrl) + '&text=' + encodeURIComponent("Découvrez notre actualité : "),'twitter-share-dialog','width=626,height=436');
		}
		
		jQuery(function(){ jQuery.fn.center = function () { this.css("position","absolute"); this.css("top", ( jQuery(window).height() - this.height() ) / 2+jQuery(window).scrollTop() + "px"); this.css("left", ( jQuery(window).width() - this.width() ) / 2+jQuery(window).scrollLeft() + "px"); return this; }; }); function popup(options) { var strContent = ""; if(options != null){ if(options.content){ strContent = options.content; }; }; jQuery(".main-overlay").remove(); jQuery("#popup-bloc").remove(); jQuery("body").append(''); jQuery("body").append('');jQuery(".main-overlay").height(jQuery(document).height()); var obj = jQuery("#popup-editor"); var IsNoEffect = false; if(options != null){ if(options.width){ obj.css({"width":options.width}); obj.css({"width":obj.width() + 20}); }; if(options.height){ obj.css({"height":options.height}); obj.css({"height":obj.height() + 20}); }; if(options.title){ jQuery("#popup-editor-title").html(options.title); }else{ jQuery(".popup-editor-header").remove(); }; if(options.noeffect){ IsNoEffect = options.noeffect; }; }else{ jQuery(".popup-editor-header").remove(); }; jQuery("#popup-bloc").center(); jQuery("#popup-bloc").shadow('raised'); if(IsNoEffect){ jQuery("#popup-bloc").attr("data-noeffect","noeffect").show(); if(options != null){ jQuery(options).trigger("complete"); }; jQuery(".main-overlay").height(jQuery(document).height()); }else{ jQuery("#popup-bloc").show("drop",{direction:"left"}, 300, function(){ jQuery(".main-overlay").height(jQuery(document).height()); if(options != null){ jQuery(options).trigger("complete"); }; }); }; return obj; }; function closePopup() { if(jQuery("#popup-bloc").attr("data-noeffect") == "noeffect"){ xeffect = "fade"; }else{ xeffect = "drop"; }; jQuery("#popup-bloc").hide(xeffect, 200, function(){ jQuery(".ui-effects-wrapper").remove(); jQuery(this).remove(); jQuery(".main-overlay").remove(); }); };
";
				var Cp = prmObject.value;
				zUrl = gCONFIG["SITE_URL"]+"/villes/autocomplete_cp/"+Cp;
				zFunction = "";
				updateModule(zUrl, prmContainerID, zFunction);
			}else{
				document.getElementById(prmContainerID).innerHTML = "";
			}
		}
	}	
	function ajax_light_uploadfileCompleteEvent(prmInputName, prmUrl, prmOnCmpltFunction){
		jQuery.ajaxFileUpload ({
            url:prmUrl,
            secureuri:false,
            fileElementId:prmInputName,
            dataType: 'json',
            complete:function(prm){
                eval(prmOnCmpltFunction);
            },
            success: function (data, status) {
            },
            error: function (data, status, e) {
            }
        })
        
        return false;
	}
    
    function getNbClic(prmIdOrganisme, prmIdMembre, prmTypeActivite) {
        processAjaxData("", gCONFIG["SITE_URL"] + "/organismes/getCountClick/" + prmIdOrganisme + "/" + prmIdMembre + "/" + prmTypeActivite, "GET", "nousC", "");
    }
	
	
	function afficher_cacher(id){ if(document.getElementById(id).style.visibility=="hidden"){ document.getElementById(id).style.visibility="visible"; document.getElementById('bouton_'+id).innerHTML=''; } else { document.getElementById(id).style.visibility="hidden"; document.getElementById('bouton_'+id).innerHTML='Afficher le nº de téléphone'; }; return true; } 
	
	
		function fb_share(sender)
		{
												var eid = jQuery(sender).data("eid");
			var type = jQuery(sender).data("type");
			var _titre = "";
			var _strTitre = '';
			if(jQuery("#evt-accr-"+eid).length>0){
				_title = jQuery("#evt-accr-"+eid).text();
				_title= encodeURIComponent(_title);
				_strTitre = '&t='+_title;
			}
			strUrl = jQuery("#evt-url-"+eid).attr("href");
			window.open('https://www.facebook.com/sharer.php?u='+encodeURIComponent(strUrl)+_strTitre,'facebook-share-dialog','width=630,height=440');
						
		}
		
		function gp_share(sender)
		{
			var eid = jQuery(sender).data("eid");
			var type = jQuery(sender).data("type");
			strUrl = jQuery("#evt-url-"+eid).attr("href");
			window.open('https://plus.google.com/share?url='+encodeURIComponent(strUrl),'google-plus-share-dialog','width=626,height=436');
		}
		
		function tw_share(sender)
		{
			var eid = jQuery(sender).data("eid");
			var type = jQuery(sender).data("type");
			strUrl = jQuery("#evt-url-"+eid).attr("href");
			window.open('https://www.twitter.com/share?url='+encodeURIComponent(strUrl) + '&text=' + encodeURIComponent("Découvrez notre actualité : "),'twitter-share-dialog','width=626,height=436');
		}
		
		jQuery(function(){ jQuery.fn.center = function () { this.css("position","absolute"); this.css("top", ( jQuery(window).height() - this.height() ) / 2+jQuery(window).scrollTop() + "px"); this.css("left", ( jQuery(window).width() - this.width() ) / 2+jQuery(window).scrollLeft() + "px"); return this; }; }); function popup(options) { var strContent = ""; if(options != null){ if(options.content){ strContent = options.content; }; }; jQuery(".main-overlay").remove(); jQuery("#popup-bloc").remove(); jQuery("body").append(''); jQuery("body").append('');jQuery(".main-overlay").height(jQuery(document).height()); var obj = jQuery("#popup-editor"); var IsNoEffect = false; if(options != null){ if(options.width){ obj.css({"width":options.width}); obj.css({"width":obj.width() + 20}); }; if(options.height){ obj.css({"height":options.height}); obj.css({"height":obj.height() + 20}); }; if(options.title){ jQuery("#popup-editor-title").html(options.title); }else{ jQuery(".popup-editor-header").remove(); }; if(options.noeffect){ IsNoEffect = options.noeffect; }; }else{ jQuery(".popup-editor-header").remove(); }; jQuery("#popup-bloc").center(); jQuery("#popup-bloc").shadow('raised'); if(IsNoEffect){ jQuery("#popup-bloc").attr("data-noeffect","noeffect").show(); if(options != null){ jQuery(options).trigger("complete"); }; jQuery(".main-overlay").height(jQuery(document).height()); }else{ jQuery("#popup-bloc").show("drop",{direction:"left"}, 300, function(){ jQuery(".main-overlay").height(jQuery(document).height()); if(options != null){ jQuery(options).trigger("complete"); }; }); }; return obj; }; function closePopup() { if(jQuery("#popup-bloc").attr("data-noeffect") == "noeffect"){ xeffect = "fade"; }else{ xeffect = "drop"; }; jQuery("#popup-bloc").hide(xeffect, 200, function(){ jQuery(".ui-effects-wrapper").remove(); jQuery(this).remove(); jQuery(".main-overlay").remove(); }); };