var sourisX = 0; var sourisY = 0; var cursourisX = 0; var cursourisY = 0; $(document).mousemove ( function(event){ cursourisX = event.pageX; cursourisY = event.pageY; } ); function villepositionchps_click () { if ($('#villepositionchps').val() == $('#villepositionchps').attr('default')) { $('#villepositionchps').val(''); } } function villepositionchps_autocomplete_formatItem(row) { return row[0] + " (" + row[1].substring(0,2) + ")"; } function villepositionchps_autocomplete_formatResult(row) { return row[0]; } function valide_form_cadeau2() { $('#seconnectermsg').css('display', 'none'); $('#confirmationboutton').val('Patientez...'); $('#confirmationboutton').attr('disabled', true); $.post( 'http://www.pubeco.fr/cadeaux.asp', { faire:'enregistre', obtenir:'2', nom:$('#f_nom').val(), prenom:$('#f_prenom').val(), adresse1:$('#f_adresse1').val(), adresse2:$('#f_adresse2').val(), codepostal:$('#f_codepostal').val(), ville:$('#f_ville').val() }, function(data){ res = data; if((res != null) && (res.length!=0) && ((res.substr(0,16) == "") || res.substr(0,19) == "")){ resultat = res.substr(16,1) } switch(resultat) { case '0': $('#form_cadeau_contenu').css('display','none'); $('#confirmation_cadeau').css('display','block'); break; case '1': $('#seconnectermsg').html('Le nom n\'est pas saisie correctement'); $('#seconnectermsg').css('display','block'); break; case '2': $('#seconnectermsg').html('Le prenom n\'est pas saisie correctement'); $('#seconnectermsg').css('display','block'); break; case '3': $('#seconnectermsg').html('L\'adresse n\'est pas saisie correctement'); $('#seconnectermsg').css('display','block'); break; case '4': $('#seconnectermsg').html('Le codepostal n\'est pas saisie correctement'); $('#seconnectermsg').css('display','block'); break; case '5': $('#seconnectermsg').html('La ville n\'est pas saisie correctement'); $('#seconnectermsg').css('display','block'); break; default: $('#seconnectermsg').html('Erreur inconnue de traitement'); $('#seconnectermsg').css('display','block'); break; } if(resultat > 0){ $('#confirmationboutton').val('Confirmer ma demande'); $('#confirmationboutton').attr('disabled', false); } }); } function seconnecter_preciseou (oupreciser) { show_popupXY(590,115); $('#ou').val(oupreciser); $('#rechercher').submit(); } function lu(id){ $("table[lu='"+id+"']").each(function(index) { $(this).attr("className", $(this).attr("className").replace(/nonlu/g, 'lu')); }); $("td[lu='"+id+"']").each(function(index) { $(this).attr("className", $(this).attr("className").replace(/nonlu/g, 'lu')); }); $("div[lu='"+id+"']").each(function(index) { $(this).attr("className", $(this).attr("className").replace(/nonlu/g, 'lu')); }); $("h2[lu='"+id+"']").each(function(index) { $(this).attr("className", $(this).attr("className").replace(/nonlu/g, 'lu')); }); } function pop_obtenircadeau(lot){ show_popupXY(-1,-1); $.post( 'http://www.pubeco.fr//cadeaux.asp', { obtenir:lot }, function(data){ $('#scc').html(data); popup_placement('#cadeauxform',-1,-1); $('#f_prenom').focus(); }); } function rechercher_validation() { if (($('#quoi').val() == '') && ($('#ou').val() == '')) return false; show_popupXY(590,115); if ($('#quoi').val().substring(0,3) == 'go:') { $("#cse-search-box input[name=q]").val($('#quoi').val().substring(3) + ' ' + $('#ou').val()); $('#cse-search-box').submit(); return false; } else { if ($('#ou').val() == '') { return true; } else { $.ajax({ url:'http://www.pubeco.fr//module/defaut/seconnecter_verif.asp', type:'POST', data:{ faire:"verifou", ou:$('#ou').val() }, success:function(data) { if(data == 'OK'){ $('#rechercher').submit(); }else if (data == 'ERREUR') { return false; }else if (data == 'RES1') { $('#rechercher').submit(); }else if (data == 'RES0') { $('#scc').html('
La localisation saisie n\'est pas reconnue
'+ ''+ '