/* matthias - pour l'antispam */ // les variables sont les champs obligatoires var nomSpam = prenomSpam = adresseSpam = cpSpam = telSpam = villeSpam = emailSpam = false; function activate(inputId) { if(inputId == "nom") nomSpam = true; else if(inputId == "prenom") prenomSpam = true; else if(inputId == "adresse") adresseSpam = true; else if(inputId == "cp") cpSpam = true; else if(inputId == "ville") villeSpam = true; else if(inputId == "tel") telSpam = true; else if(inputId == "email") emailSpam = true; // si tout est à true, on active la validation if(nomSpam === true && prenomSpam === true && adresseSpam === true && cpSpam === true && villeSpam === true && telSpam === true && emailSpam === true) { document.getElementById("spm2").value = "1"; } } /* matthias - inscription à newsletter */ function inscriptionNewsletter(domaine, cle, email) { if (email.match(/^[a-zA-Z0-9][a-zA-Z0-9._-]*@([a-zA-Z][a-zA-Z0-9_\-]*\.)*[a-z0-9]+[a-z0-9\-]+\.[a-z]{2,6}$/) == null) { alert("Veuillez vérifier votre adresse e-mail SVP."); document.getElementById('nlemail').focus(); return false; } else { $.get("http://"+domaine+".niouzletter.com/inscription.php?cle="+encodeURIComponent(cle)+"&email="+encodeURIComponent(email), function(data){ alert("Votre adresse mail est enregistrée, merci."); $("#cadreNL").slideToggle("fast"); }); } } /** * Vérification de l'email lors de la connexion */ function verifierEmailNewletter(mode) { var resultat = true; if (estEmail($('#NLemail').val())) { afficherMessageValidation('nlemail', true); } else { notifierErreur('nlemail', "L'email est incorrect", mode); resultat = false; } return resultat; } function validatePhone(fld) {     var error = "";     var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, '');    if (fld.value == "") {         error = "Veuillez saisir votre numéro de téléphone.\n";       //  fld.style.background = 'Yellow';     } else if (isNaN(parseInt(stripped))) {         error = "Le numéro de téléphone contient des caractères invalides.\n";       //  fld.style.background = '';     } else if (!(stripped.length == 10)) {         error = "Le numéro de téléphone n'a pas la taille attendue.\n";       //  fld.style.background = 'Yellow';     }     return error; } function validatecp(fld) {     var error = "";     var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, '');    if (fld.value == "") {         error = "Veuillez saisir votre code postal.\n";       //  fld.style.background = 'Yellow';     } else if (isNaN(parseInt(stripped))) {         error = "Le code postal contient des caractères invalides.\n";       //  fld.style.background = 'Yellow';     } else if (!(stripped.length == 5)) {         error = "Le code postal n'a pas la taille attendue.\n";       //  fld.style.background = 'Yellow';     }     return error; } // chargement de l'image d'un sous produit. function changeImage() { var ref_prod = $("#ref_prod").val(); var attribut1 = $("#attribut_un").val(); var attribut2 = $("#attribut_deux").val(); $.ajax( { type: 'GET', url: '/admin/tmpl/affiche_image_sous_prod.php', data: 'refProduit='+encodeURI(ref_prod)+'&attributUn='+encodeURI(attribut1)+'&attributDeux='+encodeURI(attribut2), async:true, success: function(msg) { $("#image_sous_produit").html(msg); $(document).ready(function(){ jQuery(function($){ }); }); MagicZoom.start(); } }); }