function logIn(prmMode, prmId, prmIdJeu){ document.getElementById('txtPseudoErrMsg').innerHTML = ""; document.getElementById('txtMotDePasseErrMsg').innerHTML = ""; document.getElementById('GlobalErrMsg').innerHTML = ""; if (prmIdJeu) { processAjaxData("IDfrmAuthentificationMembre", gCONFIG["SITE_URL"]+"/accueil/process_login/" + prmMode + "/" + prmId + "/" + prmIdJeu, "POST", "authentification_process_running", "eval(xhr.responseText);"); } else { processAjaxData("IDfrmAuthentificationMembre", gCONFIG["SITE_URL"]+"/accueil/process_login/" + prmMode + "/" + prmId, "POST", "authentification_process_running", "eval(xhr.responseText);"); } } function fiche_recuperation_psw(){ afficherFonce2('div_fond_fenetre_popup', 'confirm_frame_popup', 800); show_popup(450,150, 'Mot de passe oublié?',gCONFIG["SITE_URL"]+'/accueil/recuperation_psw/'); } function fiche_authentification(prmMode, prmIdOrganisme, prmTitle, prmIdJeu){ var Width = 600; if(prmMode != "1" && prmMode != "5"){ Width = 450; } afficherFonce2('div_fond_fenetre_popup', 'confirm_frame_popup', 800); if (prmIdJeu) { show_popup(Width,400, prmTitle,gCONFIG["SITE_URL"]+'/accueil/authentification/'+prmMode+'/'+prmIdOrganisme+'/'+prmIdJeu); } else { show_popup(Width,400, prmTitle,gCONFIG["SITE_URL"]+'/accueil/authentification/'+prmMode+'/'+prmIdOrganisme); } } function afficherBoutonOkFenetreMessage(txt) { return ''+txt+''; } function fiche_inscription(prmIdOrganisme){ afficherFonce2('div_fond_fenetre_popup', 'confirm_frame_popup', 800); show_popup(980,400, 'Inscrivez-vous : c\'est SIMPLE et GRATUIT',gCONFIG["SITE_URL"]+'/accueil/inscription/'+prmIdOrganisme); } function ClearErrMsgInscription(){ document.getElementById("IDNomPrenomError").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 = ""; document.getElementById("IDPseudoError").innerHTML = ""; document.getElementById("IDtxtPseudo").className = ""; document.getElementById("IDMotDePasseError").innerHTML = ""; document.getElementById("IDtxtMotDePasse").className = ""; document.getElementById("IDConfirmationError").innerHTML = ""; document.getElementById("IDtxtConfirmation").className = ""; document.getElementById("IDCaptchaError").innerHTML = ""; document.getElementById("IDtxtCaptcha").className = ""; } function fiche_avis(prmIdNumero, prmIdQuoi, prmNomCommerce){ var imageObj = new Image(); imageObj.src = gCONFIG["BASE_URL"]+"system/application/resources/images/vitrines/default/coeur.png"; afficherFonce2('div_fond_fenetre_popup', 'confirm_frame_popup', 800); show_popup(600,400, 'Donnez votre avis sur '+prmNomCommerce,gCONFIG["SITE_URL"]+'/accueil/fiche_avis/' + prmIdNumero + '/' + prmIdQuoi); } function aciton_avis(prmIdNumero, prmIdQuoi,sender){ var areOK = true; var _prt = jQuery(sender).closest("form"); jQuery("#IDtxtAccrocheErrorMsg",_prt).html(""); jQuery("#IDtxtAvisErrorMsg",_prt).html(""); if(jQuery("#IDtxtAccroche",_prt).val() == ""){ jQuery("#IDtxtAccrocheErrorMsg",_prt).html("L'accroche ne peut pas etre vide."); areOK = false; }else{ if (jQuery("#IDtxtAccroche",_prt).val().indexOf("Accroche de votre avis") == 0) { jQuery("#IDtxtAccrocheErrorMsg",_prt).html("Veuillez saisir votre accroche."); areOK = false; } } if(jQuery("#IDtxtAvis",_prt).val() == ""){ jQuery("#IDtxtAvisErrorMsg",_prt).html("L'avis ne peut pas etre vide."); areOK = false; }else{ if(jQuery("#IDtxtAvis",_prt).val().indexOf("Argumentez votre avis") == 0){ jQuery("#IDtxtAvisErrorMsg",_prt).html("Veuillez saisir votre avis."); areOK = false; } } if ((jQuery("#IDtxtPrenom",_prt))) { if(jQuery("#IDtxtPrenom",_prt).val() == ""){ jQuery("#IDtxtPrenomErrorMsg",_prt).html("Votre pénom ne peut pas etre vide."); areOK = false; }else{ if(jQuery("#IDtxtPrenom",_prt).val().indexOf("Argumentez votre avis") == 0){ jQuery("#IDtxtPrenomErrorMsg",_prt).html("Veuillez saisir votre pénom."); areOK = false; } else { jQuery("#IDtxtPrenomErrorMsg",_prt).html(""); } } } if ((jQuery("#IDtxtVille",_prt))) { if(jQuery("#IDtxtVille",_prt).val() == ""){ jQuery("#IDtxtVilleErrorMsg",_prt).html("Votre ville ne peut pas etre vide."); areOK = false; }else{ if(jQuery("#IDtxtVille",_prt).val().indexOf("Argumentez votre avis") == 0){ jQuery("#IDtxtVilleErrorMsg",_prt).html("Veuillez saisir votre ville."); areOK = false; } else { jQuery("#IDtxtVilleErrorMsg",_prt).html(""); } } } //var formContainer = document.getElementById("IDfrmFicheMembre"); var formContainer = _prt.get(0); var allImg = formContainer.getElementsByTagName("img"); var Note = 0; for(i=0 ; i= 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
', 0, 180, 200); var InputContainer = document.getElementById("IDChoixCategorie"); var InputList = InputContainer.getElementsByTagName("input"); var InputCount = InputList.length; var CentreInteret = ""; var separator = ""; if(InputCount > 0){ for(q = 0; q < InputCount; q++){ var oneInput = InputList[q]; if((oneInput.type == "checkbox") && (oneInput.className == "choix_categorie") && (oneInput.checked)){ CentreInteret += separator + oneInput.value; separator = "_"; } } } processSerializedData(SerializedFormToSubmit, gCONFIG["SITE_URL"]+"/accueil/commit_inscription/"+prmIdOrganisme+"/"+CentreInteret, "POST", "proccess_running", "cacherFonce();confirmationInscription('inscription',xhr.responseText);SerializedFormToSubmit = null;"); } } function processSerializedData(updtParams, prmUrl, prmMethode, prmOutElmnt, prmCmpltFunction) { var ouputElmt = $(prmOutElmnt); if (ouputElmt) { var AjaxRequest = new Ajax.Request( prmUrl, { method: prmMethode, parameters: updtParams, asynchronous: true, on404: function (xhr) { ouputElmt.innerHTML = "
"; }, onFailure: function (xhr) { ouputElmt.innerHTML = "
"; }, onException: function (xhr, exception) { ouputElmt.innerHTML = "
"; }, onComplete: function (xhr, json) { if (prmMethode == "GET") { ouputElmt.innerHTML = xhr.responseText; } if (prmCmpltFunction != null){ eval(prmCmpltFunction); } } } ); } } function log_status(prmMode){ if(prmMode == "in"){ document.getElementById('IDLoginBloc').style.display = "block"; document.getElementById('IDLogoutBloc').style.display = "none"; document.getElementById('IDLogTitle').className = "city_membre"; }else{ document.getElementById('IDLoginBloc').style.display = "none"; document.getElementById('IDLogoutBloc').style.display = "block"; document.getElementById('IDLogTitle').className = "city_membre_online"; loadDynamicContent(gCONFIG["SITE_URL"]+'/accueil/logout_view/vitrine', 'IDLogoutBloc'); } } function setReverseSexeValue(prmObj,prmId){ if(prmObj.checked){ document.getElementById(prmId).checked = false; } } function submit_recuperation_psw(){ var isValid = true; 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; }else{ document.getElementById("IDEmailError").innerHTML = ""; document.getElementById("IDtxtEmail").className = ""; } } if(isValid){ processAjaxData("IDfrmRecupPswMembre", gCONFIG["SITE_URL"]+"/accueil/is_mail_and_captcha_ok/", "POST", "proccess_running", "send_psw(xhr.responseText);"); } } function popup_info_compte(){ afficherFenetreMessage("Information", "
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.
', 0, 180, 200); processAjaxData("IDfrmRecupPswMembre", gCONFIG["SITE_URL"]+"/accueil/sendPswByMail/", "POST", "proccess_running", "cacherFonce();close_fenetre_flottante();confirmationInscription('psw',0);"); } } function displayCaptchaErrorInscription(){ document.getElementById("IDCaptchaError").innerHTML = "Le code Image est incorrecte."; document.getElementById("IDtxtCaptcha").className = "invalid_field"; } function confirmationInscription(prmType,prmId){ close_fenetre_flottante2('div_fond_fenetre_2', 'confirm_frame_2', 'confirm_frame'); show_popup(450,150, 'Citymalin.com',gCONFIG["SITE_URL"]+'/accueil/confirmation_inscription/' + prmType + '/'+prmId); } function ClearErrMsgInscription(){ document.getElementById("IDNomPrenomError").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 = ""; document.getElementById("IDPseudoError").innerHTML = ""; document.getElementById("IDtxtPseudo").className = ""; document.getElementById("IDMotDePasseError").innerHTML = ""; document.getElementById("IDtxtMotDePasse").className = ""; document.getElementById("IDConfirmationError").innerHTML = ""; document.getElementById("IDtxtConfirmation").className = ""; document.getElementById("IDCaptchaError").innerHTML = ""; document.getElementById("IDtxtCaptcha").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 checkAuthentificationReturn(rep){ var content = ""; if (rep == 0) { content = '
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 + '
'}); } function nousContacter(prmIdOrganisme,sender) { inprocess("Chargement en cours", "205px"); jQuery.post(gCONFIG["SITE_URL"] + "/acces/nous_contacter_vitrine/" + prmIdOrganisme, {}, function (data){ var str = ''; // popup({ // title : "Formulaire contact", // content : str+data // }); if(jQuery(sender).hasClass("m-h-ico")){ var _t = jQuery(sender).offset().top + jQuery(sender).outerHeight(true) + 19; mobDropdown({ title : "Formulaire contact", content : data, top : _t, sender : sender }); }else{ popup({ title : "Formulaire contact", content : str+data }); } }); } function showPhoneNumber(sender,number,o,m,t) { getNbClic(o,m,t); var _t = jQuery(sender).offset().top + jQuery(sender).outerHeight(true) + 19; mobDropdown({ title : null, content : '
'+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.terresdesurf-lannion.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.
', 0, 200, 280); processAjaxData("", gCONFIG["SITE_URL"]+"/accueil/participer_jeu/" + prmIdJeu + "/" + prmIdOrganisme, "POST", "proccess_running", "cacherFonce(); if (xhr.responseText == 'ERREUR') { confirmationInscription('deja_participe',xhr.responseText); } else if (xhr.responseText == 'RESPONSABLE') { confirmationInscription('participation_non',xhr.responseText); } else { confirmationInscription('participation_jeu',xhr.responseText); }"); } function popup_reglement_jeu(){ afficherFonce2('div_fond_fenetre_popup', 'confirm_frame_popup', 800); show_popup(900,600, 'Réglement du jeu',gCONFIG["SITE_URL"]+'/accueil/popup_reglement_jeu/'); } 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 mon_profil(prmMode, prmIdJeu, prmIdOrganisme){ if(prmMode == null){ prmMode = ''; } afficherFonce2('div_fond_fenetre_popup', 'confirm_frame_popup', 800); if ((prmIdJeu == null) && (prmIdOrganisme == null)) { show_popup(550,450, 'Mon profil',gCONFIG["SITE_URL"]+'/accueil/mon_profil/'+prmMode); } else { show_popup(550,450, 'Mon profil',gCONFIG["SITE_URL"]+'/accueil/mon_profil/'+prmMode+'/'+prmIdJeu+'/'+prmIdOrganisme); } } function update_profil(prmMode, prmIdJeu, prmIdOrganisme){ ClearErrMsgInscription2(); var MsgError = ""; var isValid = true; if (isEmpty(document.getElementById("IDtxtNom").value)){ MsgError = "- Le Nom est obligatoire.
"; 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
', 0, 180, 200); processAjaxData("IDfrmMonProfilMembre", gCONFIG["SITE_URL"]+"/accueil/update_profil", "POST", "proccess_running", "cacherFonce();"+OnComplete); } } function popup_edit_avatar(prmMode,prmId){ if(prmMode == "update"){ var strContent = ""; strContent += '
'; strContent += "Photo : "; strContent += "
"; afficherFenetreMessage("Choisir une autre photo", "
"+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.terresdesurf-lannion.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.
', 0, 180, 200); }else{ return false; } }); }else{ var strContent = '
'; strContent += "Cette action ne peut pas être annulé, voulez-vous vraiment supprimer votre photo ?"; strContent += "
"; afficherFenetreMessage("Choisir une autre photo", "
"+strContent+"

"+afficherBoutonCancelFenetreMessage('Annuler')+' '+afficherBoutonOkFenetreMessage('OK')+"

", 0, 200, 300); jQuery("#divOk").unbind(); jQuery("#divOk").click(function () { processAjaxData("IDfrmAvatar", "https://www.terresdesurf-lannion.fr/index.php/accueil/updateAvatar/"+prmId+"/delete/", "POST", "proccess_running", "cacherFonce();document.getElementById('IDimgMonAvatar').src='https://www.terresdesurf-lannion.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(); }); };