PageSourceSearch

https://www.myrungis.com/wp-content/themes/rungis/js/fonctions.js

js myrungis.com collected 2026-10-06 11:20:09 UTC 37,525 bytes, 1,180 lines download raw bytes

1$(document).ready(function() {
2	// Afficher / Cacher le mot de passe
3	$(".eye_input").click(function() {
4		if ($(".mdp_compte_eye").prop('type') == 'password') {
5			// $(".mdp_compte_eye").css('font-size', '22px');
6			$(".mdp_compte_eye").prop('type', 'text');
7			$(".eye_input img").attr('src', globalPath +'/images/eye-close.png');
8		}
9		else {
10			// if ($(".mdp_compte_eye").val() != "") $(".mdp_compte_eye").css('font-size', '30px');
11			$(".mdp_compte_eye").prop('type', 'password');
12			$(".eye_input img").attr('src', globalPath +'/images/eye-open.png');
13		}
14	});
15});
16
17// Taggage
18function taggage_init(){
19	$('.taggageSend').on( "click", taggage_sendclick);
20	// $('.taggageSend').removeClass('taggageSend');
21
22	$('.taggageSendChange').on( "change", taggage_sendclick);
23	// $('.taggageSendChange').removeClass('taggageSendChange');
24
25	// Clic directement dans le menu
26	$('#menu-item-'+global_taggage_menu_creer_compte+' a').on( "click", taggage_send_event_creer_compte);
27	$('#menu-item-'+global_taggage_menu_acheter_en_ligne+' a').on( "click", taggage_send_event_acheter_en_ligne);
28}
29
30function taggage_sendclick_bis(moi){
31	var event = $(moi).attr('data-Event');
32	var eventCategory = $(moi).attr('data-eventCategory');
33	var eventAction = $(moi).attr('data-eventAction');
34	var eventLabel = $(moi).attr('data-eventLabel');
35	var eventValue = $(moi).attr('data-eventValue');
36
37	// Vide le tableau des valeurs existantes
38	// if (typeof(dataLayer) !== 'undefined') {
39	// 	dataLayer = dataLayer.filter(function (x) {
40	// 	  return !x.event;
41	// 	});
42	// }
43
44	taggage_send_event(event, eventCategory, eventAction, eventLabel, eventValue);
45}
46
47function taggage_sendclick(){
48	var event = $(this).attr('data-Event');
49	var eventCategory = $(this).attr('data-eventCategory');
50	var eventAction = $(this).attr('data-eventAction');
51	var eventLabel = $(this).attr('data-eventLabel');
52	var eventValue = $(this).attr('data-eventValue');
53	
54	// Vide le tableau des valeurs existantes
55	// if (typeof(dataLayer) !== 'undefined') {
56	// 	dataLayer = dataLayer.filter(function (x) {
57	// 	  return !x.event;
58	// 	});
59	// }
60
61	taggage_send_event(event, eventCategory, eventAction, eventLabel, eventValue);
62}
63
64function taggage_send_event_creer_compte(){
65	if (typeof(dataLayer) !== 'undefined') {
66		dataLayer.push({
67			'event': global_taggage_push_event,
68			'eventCategory': '[MR] Creer mon compte acheteur',
69			'eventAction': global_taggage_action_cta,
70			'eventLabel': 'Header',
71			'eventValue': null
72		});
73	}
74
75	// alert(dataLayer.toSource());
76}
77function taggage_send_event_acheter_en_ligne(){
78	if (typeof(dataLayer) !== 'undefined') {
79		dataLayer.push({
80			'event': global_taggage_push_event,
81			'eventCategory': '[MR] Acheter en ligne',
82			'eventAction': global_taggage_action_cta,
83			'eventLabel': 'Header',
84			'eventValue': null
85		});
86	}
87
88	// alert(dataLayer.toSource());
89}
90
91function taggage_send_event(event, eventCategory, eventAction, eventLabel, eventValue) {
92	var event = (event) ? event : null;
93	var eventCategory = (eventCategory) ? eventCategory : null;
94	var eventAction = (eventAction) ? eventAction : '';
95	var eventLabel = (eventLabel) ? eventLabel : null;
96	var eventValue = (eventValue) ? eventValue : null;
97
98	if (typeof(dataLayer) !== 'undefined') {
99		dataLayer.push({
100			'event': event,
101			'eventCategory': eventCategory,
102			'eventAction': eventAction,
103			'eventLabel': eventLabel,
104			'eventValue': eventValue
105		});
106	}
107
108	// alert(dataLayer.toSource());
109};
110// -- Taggage
111
112
113
114// Popup commande nouveau KBIS
115function openCommandeKbis() {
116	$.ajax({
117		url: globalPath + "/ajax/ajax-paiement-kbis.php",
118		type: 'POST',
119		data: { page: "nouveau" },
120		success: function(data) {
121			if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
122			else {
123				$('#alertcommandekbis').empty();
124				$('#alertcommandekbis').html(data);
125				$("#alertcommandekbis").dialog({
126					resizable: false,
127					height: "auto",
128					width: "800",
129					modal: true,
130					fluid: true,
131					draggable: false,
132					closeOnEscape: false,
133					open: function(event, ui) {
134						// Cacher la croix de fermeture
135						// $(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
136						// Cacher le titre
137						$(".ui-dialog-titlebar", ui.dialog | ui).hide();
138					},
139					'buttons': [{ text: lg_fonctions_23, click: function() { $(this).dialog('close'); $(this).html('<div class="loader_ajax"></div>'); } }]
140				});
141			}
142		}
143	});
144}
145
146// Ouvrir document GED
147function ouvrir_document_ged(id_document) {
148	window.open(globalPath + "/../../../securite-doc-pcc.php?id="+id_document, "_blank", "toolbar=0,location=0,menubar=0,height=700,width=700,top=0,left=0");
149}
150
151//Tester si champ vide
152function trim (myString){
153	return myString.replace(/^\s+/g,'').replace(/\s+$/g,'');
154}
155
156//Tester mail valide
157function verifMail(a){
158	testm = false ;
159	for (var j=1 ; j<(a.length) ; j++) {
160		if (a.charAt(j)=='@') {
161			if (j<(a.length-4)){
162				for (var k=j ; k<(a.length-2) ; k++) {
163					if (a.charAt(k)=='.') testm = true;
164				}
165			}
166		}
167	}
168	
169	if (testm==false) return false;
170	else return true;
171
172	return testm ;
173}
174
175//Page de connexion
176function make_password(value, max_length){
177	var lastvalue = document.getElementById('password').value;
178	if(document.getElementById('password').value.length < max_length) {
179		document.getElementById('password').value = document.getElementById('password').value + value;
180	}
181	if (document.getElementById('password').value.length > 0 && lastvalue.length == 0)
182		$('#password').focus();
183}
184
185function correct_password(){
186	newValue = document.getElementById('password').value;
187	newValue = newValue.slice(0, -1);
188	document.getElementById('password').value = newValue;
189	total -= 1;
190}
191
192function reset_form(){
193	document.getElementById('username').value = '';
194	document.getElementById('password').value = '';
195	total = 0;
196}
197
198
199// Formulaire de connexion
200function check_form(erreure_les2, erreure_id, erreure_mdp){
201	if(document.getElementById('username').value == '' && document.getElementById('password').value == ''){
202		$('#modal').html('<p class="padd15">'+erreure_les2+'</p>').dialog({
203			resizable: false, 
204			height: "auto",
205            width: "auto",
206			modal: true, 
207			fluid : true,
208            draggable : false,
209            closeOnEscape: false,
210            open: function(event, ui) {
211	              // Cacher la croix de fermeture
212	              // $(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
213	              // Cacher le titre
214	              $(".ui-dialog-titlebar", ui.dialog | ui).hide();
215			},
216			'buttons': [{ text: lg_fonctions_21, click: function() { $(this).dialog('close'); $(this).html('<div class="loader_ajax"></div>'); } }]
217		});
218		return false;
219	}
220	else if(document.getElementById('username').value == ''){
221		$('#modal').html('<p class="padd15">'+erreure_id+'</p>').dialog({
222			resizable: false, 
223			height: "auto",
224            width: "auto",
225			modal: true, 
226			fluid : true,
227            draggable : false,
228            closeOnEscape: false,
229            open: function(event, ui) {
230	              // Cacher la croix de fermeture
231	              // $(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
232	              // Cacher le titre
233	              $(".ui-dialog-titlebar", ui.dialog | ui).hide();
234			},
235			'buttons': [{ text: lg_fonctions_21, click: function() { $(this).dialog('close'); $(this).html('<div class="loader_ajax"></div>'); } }]
236		});
237		return false;
238	}
239	else if(document.getElementById('password').value == ''){
240		$('#modal').html('<p class="padd15">'+erreure_mdp+'</p>').dialog({
241			resizable: false, 
242			height: "auto",
243            width: "auto",
244			modal: true, 
245			fluid : true,
246            draggable : false,
247            closeOnEscape: false,
248            open: function(event, ui) {
249	              // Cacher la croix de fermeture
250	              // $(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
251	              // Cacher le titre
252	              $(".ui-dialog-titlebar", ui.dialog | ui).hide();
253			},
254			'buttons': [{ text: lg_fonctions_21, click: function() { $(this).dialog('close'); $(this).html('<div class="loader_ajax"></div>'); } }]
255		});
256		return false;
257	}
258
259	// $.mobile.loading('show'); 
260	// setTimeout(function(){
261	//	$(this).submit();
262	// }, 100);
263	
264	return true;
265}
266
267/*
268var blocActuel = "";
269var couleurActuelle = "";
270function affiche_bloc(libelle_bloc, couleur){
271	if( libelle_bloc != blocActuel ){
272		$("#"+libelle_bloc).toggle("slow");
273		if(blocActuel != ""){
274			$("#"+blocActuel).prev().children().css("background", "url("+globalPath +"/images/bg/fleche_"+couleurActuelle+".png) center right no-repeat");
275			$("#"+blocActuel).toggle("slow");
276		}
277		
278		//Changement du sens de la fleche
279		$("#"+libelle_bloc).prev().children().css("background", "url("+globalPath +"/images/bg/fleche_"+couleur+"_bas.png) center right no-repeat");
280		
281		blocActuel = libelle_bloc;
282		couleurActuelle = couleur;
283	}
284	else{
285		$("#"+libelle_bloc).toggle("slow");
286		$("#"+libelle_bloc).prev().children().css("background", "url("+globalPath +"/images/bg/fleche_"+couleur+".png) center right no-repeat");
287		blocActuel = "";
288		couleurActuelle = "";
289	}
290}
291*/
292
293function form_dossier(elt, class_div){
294	$("."+class_div+" span").each(function(){
295		if ($(this).attr('class') == 'C_ALERTESMS'){
296			var select_indicatif_mobile = $("#mobile_indicatif").html();
297			$(this).html('<br />'+select_indicatif_mobile+'&nbsp;
297<input type="text" value="'+$(this).html()+'" class="class_'+$(this).attr('class')+'" name="'+$(this).attr('class')+'" maxlength="20" size="20" placeholder="0(6|7)xxxxxxxx" />');
298		}
299		else if ($(this).attr('class') == 'C_TEL'){
300			var select_indicatif_telephone = $("#telephone_indicatif").html();
301			$(this).html('<br />'+select_indicatif_telephone+'&nbsp;<input type="text" value="'+$(this).html()+'" class="class_'+$(this).attr('class')+'" name="'+$(this).attr('class')+'" maxlength="20" size="20" placeholder="xxxxxxxxxx" />');
302		}
303		else if ($(this).attr('class') == 'C_FAX'){
304			var select_indicatif_fax = $("#fax_indicatif").html();
305			$(this).html('<br />'+select_indicatif_fax+'&nbsp;<input type="text" value="'+$(this).html()+'" class="class_'+$(this).attr('class')+'" name="'+$(this).attr('class')+'" maxlength="20" size="20" placeholder="xxxxxxxxxx" />');
306		}
307		else if($(this).attr('class') == 'C_EMAIL'){
308			$(this).html('<input readonly="readonly" type="text" value="' + $(this).html() + '" name="' + $(this).attr('class') + '" placeholder="[email protected]" maxlength="50" size="20" />');
309		}
310		else{
311			$(this).html('<input type="text" value="'+$(this).html()+'" name="'+$(this).attr('class')+'" size="20" />');
312		}
313	});
314
315	$(elt).children('button').html(lg_fonctions_3);
316	$(elt).attr('onclick','valid_form_dossier(this, "'+class_div+'")');
317}
318
319function form_infoConnexion(elt, class_div){
320	$("#"+class_div+" span").each(function(){
321		if ($(this).attr('class') == 'WC_PW' ) $(this).html('<input type="password" name="'+$(this).attr('class')+'" placeholder="******" size="27" maxlength="6" />');
322		else if($(this).attr('class') == 'WC_EMAIL_GESTION' ) $(this).html('<input type="text" value="'+$(this).html()+'" name="'+$(this).attr('class')+'" placeholder="[email protected]" size="27" />');
323	});
324	$(elt).children('button').html(lg_fonctions_3);
325	$(elt).attr('onclick','valid_form_infoConnexion(this, "'+class_div+'")');
326}
327
328function valid_form_infoConnexion(elt, class_div){
329	test_val_forum = true;
330	email = false;
331	var error = "";
332	var form = $("#"+class_div+" form");
333	$("#"+class_div+" input").each(function(){
334		var type = $(this).attr('name');
335		var taille = $(this).val().length;
336		var valeur = $(this).val();
337		$(this).css('background-color','white');
338		if (type == 'WC_PW' && taille != 0) {
339			if (/^[0-9]{6}$/.test(valeur) == false) {
340				$(this).css('background-color','red');
341				error += "<p class=\"center\">"+lg_fonctions_4+"</p>";
342				test_val_forum = false;
343			}
344		}
345	});
346
347	$(".errorFormDossier").html(error);
348	if (test_val_forum) {
349		$.ajax({
350			url : globalPath + "/ajax/ajax-infoConnexion.php",
351			type: 'POST',
352			data: form.serialize(),
353			success : function(data) {
354				if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
355				else{
356					$("#"+class_div+" ul li input").each(function(){
357						var valeur = $(this).val();					
358						if ($(this).attr('name') == 'WC_PW' ) $(this).parent().html("******");
359						else $(this).parent().html(valeur);
360					});
361
362					$(elt).children('button').html(lg_fonctions_7);
363					$(elt).attr('onclick','form_infoConnexion(this, "'+class_div+'")');
364					if (email) {
365						$(".successFormDossier").html(lg_fonctions_5);
366					}
367				}
368			},
369			error : function(xhr) {
370				var message = xhr && xhr.responseText ? trim(xhr.responseText) : "";
371				if (!message || message.indexOf("<") !== -1) message = document.documentElement.lang === "en-US" ? "The request failed. Reload the page and try again." : "La requête a échoué. Rechargez la page puis réessayez.";
372				$(".errorFormDossier").text(message);
373			}
374	        });
375	}
376}
377
378function form_option(elt, class_div){
379	$("."+class_div+" span").each(function(){
380		var id = $(this).attr('class');
381		var valeur = $(this).html();
382		var span = $(this);
383		$.ajax({
384			url : globalPath + "/ajax/ajax-option.php",
385			type: 'POST',
386			data: {id : id, valeur : valeur},
387			success : function(data) {
388				if (data == "deconnection") document.location.href = globalPath + "/deconnexion"; 
389				else span.html(data);
390			}
391		});
392	});
393	$(elt).children('button').html(lg_fonctions_3);
394	$(elt).attr('onclick','valid_form_option(this, "'+class_div+'")');
395}
396
397function valid_form_option(elt, class_div){
398	var form = $("."+class_div+" form");
399	test_val_form = true;
400	$("."+class_div+" select").each(function(){
401		$(this).css('background-color','white');
402		var testClasse = $(this).attr('class');
403		var value = $(this).val();
404		if (/obligatoire/.test(testClasse)) {
405			if (value == 0 ) {
406				test_val_form = false;
407				$(this).css('background-color','red');
408				$(".error").html(lg_fonctions_6);
409			}
410		}
411	});
412
413	if (test_val_form) {
414		$.ajax({
415			url : globalPath + "/ajax/ajax-modifier.php",
416			type: 'POST',
417			data: form.serialize(),
418			success : function(data) {
419				if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
420				else{
421					$("."+class_div+" ul li select").each(function(){
422						var valeur = $(this).val();
423						if (valeur == 0) {
424							$(this).parent().html("");
425						}
426						else
427							$(this).parent().html(valeur);
428					});
429
430					$(elt).children('button').html(lg_fonctions_7);
431					$(elt).attr('onclick','form_option(this, "'+class_div+'")');
432					$(".error").html("");
433				}
434			}
435        });
436	}
437}
438
439function valid_form_dossier(elt, class_div){
440	test_val_forum = true;
441	var error = "";
442	var message = "";
443
444	$(".class_mobile_indicatif").css('border','1px solid #7a7a7a');
445	$(".class_telephone_indicatif").css('border','1px solid #7a7a7a');
446	$(".class_fax_indicatif").css('border','1px solid #7a7a7a');
447
448	// Indicatif obligatoire si numéros saisis
449	if( $(".class_C_ALERTESMS").val() != '' ){
450		if( $(".C_ALERTESMS .class_mobile_indicatif").val() == '' ){
451			$(".C_ALERTESMS .class_mobile_indicatif").css('border','1px solid red');
452			test_val_forum = false;
453		}
454	}
455	if( $(".class_C_TEL").val() != '' ){
456		if( $(".C_TEL .class_telephone_indicatif").val() == '' ){
457			$(".C_TEL .class_telephone_indicatif").css('border','1px solid red');
458			test_val_forum = false;
459		}
460	}
461	if( $(".class_C_FAX").val() != '' ){
462		if( $(".C_FAX .class_fax_indicatif").val() == '' ){
463			$(".C_FAX .class_fax_indicatif").css('border','1px solid red');
464			test_val_forum = false;
465		}
466	}
467
468
469	$("."+class_div+" input").each(function(){
470		var type = $(this).attr('name');
471		var taille = $(this).val().length;
472		var valeur = $(this).val();
473		$(this).css('border','1px solid #7a7a7a');
474
475		if (type == 'C_ALERTESMS' && $(".C_ALERTESMS .class_mobile_indicatif").val() != "" && taille != 0) {
476			$.ajax({
477				url : globalPath + "/ajax/ajax-verifier-coordonnees.php",
478				type: 'POST',
479				async: false,
480				data: {type:type, numero:valeur, indicatif:$(".C_ALERTESMS .class_mobile_indicatif").val()},
481				success : function(data) {
482					if (trim(data) == "deconnection") document.location.href = globalPath + "/deconnexion";
483					else if( trim(data) == "false" ){
484						error += "<p style=\"margin:0;\">"+lg_fonctions_8+"</p>";
485						$(".class_C_ALERTESMS").css('border','1px solid red');
486						test_val_forum = false;
487					}
488				},
489				error : function(xhr) {
490					var message = xhr && xhr.responseText ? trim(xhr.responseText) : "";
491					if (!message || message.indexOf("<") !== -1) message = document.documentElement.lang === "en-US" ? "The request failed. Reload the page and try again." : "La requête a échoué. Rechargez la page puis réessayez.";
492					$(".errorFormDossier").text(message);
493					test_val_forum = false;
494				}
495            });
496		}
497		else if (type == 'C_TEL' && $(".C_TEL .class_telephone_indicatif").val() != "" && taille != 0) {
498			$.ajax({
499				url : globalPath + "/ajax/ajax-verifier-coordonnees.php",
500				type: 'POST',
501				async: false,
502				data: {type:type, numero:valeur, indicatif:$(".C_TEL .class_telephone_indicatif").val()},
503				success : function(data) {
504					if (trim(data) == "deconnection") document.location.href = globalPath + "/deconnexion";
505					else if( trim(data) == "false" ){
506						error += "<p style=\"margin:0;\">"+lg_fonctions_8+"</p>";
507						$(".class_C_TEL").css('border','1px solid red');
508						test_val_forum = false;
509					}
510				}
511			});
512		}
513		else if (type == 'C_FAX' && $(".C_FAX .class_fax_indicatif").val() != "" && taille != 0) {
514			$.ajax({
515				url : globalPath + "/ajax/ajax-verifier-coordonnees.php",
516				type: 'POST',
517				async: false,
518				data: {type:type, numero:valeur, indicatif:$(".C_FAX .class_fax_indicatif").val()},
519				success : function(data) {
520					if (trim(data) == "deconnection") document.location.href = globalPath + "/deconnexion";
521					else if( trim(data) == "false" ){
522						error += "<p style=\"margin:0;\">"+lg_fonctions_8+"</p>";
523						$(".class_C_FAX").css('border','1px solid red');
524						test_val_forum = false;
525					}
526				}
527			});
528		}
529		else if (type == 'C_EMAIL') {
530			if (/^[a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,6}$/.test(valeur) == false || taille == 0 || taille > 50) {
531				error += "<p style=\"margin:0;\">"+lg_fonctions_9+"</p>";
532				$(this).css('border','1px solid red');
533				test_val_forum = false;
534			}
535			else message="<p>"+lg_fonctions_10+"<p>";
536		}
537	});
538
539	// alert(error);
540	$('.'+class_div+' .errorFormDossier').html(error);
541	if (test_val_forum) {
542		var form = $("."+class_div+" form");
543		$.ajax({
544			url : globalPath + "/ajax/ajax-modifier.php",
545			type: 'POST',
546			data: form.serialize(),
547			success : function(data) {
548				if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
549				else{
550					$("."+class_div+" ul li input").each(function(){
551						var valeur = $(this).val();
552						$(this).parent().html(valeur);
553					});
554
555					$(elt).children('button').html(lg_fonctions_13);
556					$(elt).attr('onclick','form_dossier(this, "'+class_div+'")');
557					if (data == "emailModifie") {
558						$('.'+class_div+' .successFormDossier').html(message);
559					}
560				}
561			},
562			error : function(xhr) {
563				var message = xhr && xhr.responseText ? trim(xhr.responseText) : "";
564				if (!message || message.indexOf("<") !== -1) message = document.documentElement.lang === "en-US" ? "The request failed. Reload the page and try again." : "La requête a échoué. Rechargez la page puis réessayez.";
565				$('.'+class_div+' .errorFormDossier').text(message);
566			}
567        });
568	}
569}
570
571function message(id, modal){
572	$("#messagerie").html("<div class=\"loader\"></div>");
573	if (typeof(id) != 'undefined' && id!=0) {
574		if (typeof(modal) == 'undefined') {
575			$.ajax({
576				url : globalPath + "/ajax/ajax-message.php",
577				type: 'POST',
578				data: {idMessage : id},
579				success : function(data) {
580					if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
581					else $("#messagerie").html(data);
582				}
583            });
584        }
585        else{
586			$.ajax({
587				url : globalPath + "/ajax/ajax-message.php",
588				type: 'POST',
589				data: {idMessage : id, modal:modal},
590				success : function(data) {
591					if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
592					else $("#alert").html(data);
593				}
594            });
595		}
596	}
597	else{
598		if (typeof(modal) != 'undefined') {
599			$.ajax({
600				url : globalPath + "/ajax/ajax-messagerie.php",
601				type: 'POST',
602				data: {modal:'true'},
603				success : function(data) {
604					if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
605					else $("#alert").html(data);
606				}
607			});
608		}
609		else{
610			$.ajax({
611				url : globalPath + "/ajax/ajax-messagerie.php",
612				type: 'POST',
613				data: {retour : 'retour'},
614				success : function(data) {
615					if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
616					else $("#messagerie").html(data);
617				}
618			});
619		}
620		
621	}
622}
623
624function switch_mdp(){
625	$('.pwdLost').toggle();
626	$('.formulaire_connexion').toggle();
627}
628
629function afficherDossier(){
630	if ($('#idDossier').length == 0) {
631		$("<div id=\"idDossier\"><div class=\"loader\"></div></div>").css('display','none').appendTo($("#page")).slideDown();
632		$.ajax({
633			url : globalPath + "/ajax/ajax-dossier.php",
634			cache: false,
635			success : function(data) {
636				if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
637				else $('#idDossier').html(data);
638			}
639        });
640    }
641    else {
642		$('#idDossier').slideUp();
643		$('#idDossier').remove();
644    }
645    return false;
646}
647
648function afficherConnexion(){
649	if ($('#infoConnexion').length == 0) {
650		$("<div id=\"infoConnexion\"><div class=\"loader\"></div></div>").css('display','none').appendTo($("#page")).slideDown();
651		$.ajax({
652			url : globalPath + "/ajax/ajax-infoConnexion.php",
653			success : function(data) {
654				if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
655				else $('#infoConnexion').html(data);
656			}
657        });
658    }
659    else {
660		$('#infoConnexion').slideUp();
661		$('#infoConnexion').remove();
662    }
663    return false;
664}
665
666function afficherMessagerie(){
667	if ($('#messagerie').length == 0) {
668		$("<div id=\"messagerie\"><div class=\"loader\"></div></div>").css('display','none').appendTo($(".mails")).slideDown();
669		$.ajax({
670			url : globalPath + "/ajax/ajax-messagerie.php",
671			success : function(data) {
672				if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
673				else $('#messagerie').html(data);
674			}
675        });
676    }
677	else $('#messagerie').remove();
678}
679
680function testMdpPerdu(){
681	$('#email').css('background-color','white');
682	$('#codeClient').css('background-color','white');
683	$('#mobile').css('background-color','white');
684
685	var email = $('#email').val();
686	var code = $('#codeClient').val();
687	var mobile = $('#mobile').val();
688	var erreur = 0;
689
690	// if (verifMail(email) && $.isNumeric(code)) return true;
691	// else{
692		if ($.isNumeric(code) == false) {
693			$('#codeClient').css('background-color','red');
694			erreur++;
695		}
696		if( email == "" && mobile == "" ){
697			$('#mobile').css('background-color','red');
698			$('#email').css('background-color','red');
699			erreur++;
700		}
701		if (email !="" && verifMail(email) == false) {
702			$('#email').css('background-color','red');
703			erreur++;
704		}
705
706		if( erreur == 0 ) return true;
707		else return false;
708
709		// if (mobile.length != 10 || $.isNumeric(mobile)) {
710		// 	$('#mobile').css('background-color','red');
711		// }
712
713		// $('#errormodal').html('L\'adresse mail n\'est pas valide').dialog({
714		//	modal: true, 
715		//	resizable: false, 
716		//	draggable: false, 
717		//	width: 400, 
718		//	height: 110, 
719		//	position: 'center', 
720		//	'buttons': [ { text: lg_fonctions_21, click: function() { $(this).dialog('close'); $(this).html('<div class=\'loader\'></div>'); } } ]
721		// });
722		
723		// return false;
724	// }
725}
726
727function miseEnPanier(){
728	var form = $('#formRechargement');
729	$( '#modal' ).empty();
730	$.ajax({
731        url : globalPath + "/ajax/ajax-panier.php",
732        type: 'POST',
733        data: form.serialize(),
734        success : function(data) {
735			if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
736			else{
737                // Tag Boryl
738                if (typeof(dataLayer) !== 'undefined') {
739	                dataLayer.push({
740					  "event": "add_to_cart",
741					  "product_type":"rechargement carte"
742					});
743				}
744				
745				$( '#modal' ).dialog({buttons: [ { text: lg_fonctions_14, click: function() { $( this ).dialog( "close" ); document.location.reload(); } } ] });
746				$( '#modal' ).dialog({ closeOnEscape: false });
747                $( '#modal' ).empty();
748                $( '#modal' ).html(data);
749                $( '.ui-dialog.ui-corner-all.ui-widget.ui-widget-content.ui-front.ui-dialog-buttons.ui-draggable.ui-resizable' ).css("display", "none");
750            }
751        }
752    });
753}
754
755function miseEnPanierMobile(){
756	$('#formRechargement').get(0).setAttribute('action', globalPath + '/ajax/mobile-ajax-panier.php');
757	$('#formRechargement').submit();
758}
759
760$( "#popup_alert" ).dialog({
761    resizable: false,
762    height: "auto",
763    width: "auto",
764    modal: true,
765    fluid : true,
766    draggable : false,
767    closeOnEscape: false,
768    open: function(event, ui) {
769      // Cacher la croix de fermeture
770      // $(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
771      // Cacher le titre
772      $(".ui-dialog-titlebar", ui.dialog | ui).hide();
773    },
774	'buttons': [ { text: 'Close', click: function() { $(this).dialog('close'); $(this).html('<div class="loader_ajax"></div>'); } } ]
775});
776
777
778function supprimerAchatRechargement(codeCarte){
779	$( "#modal" ).html("<p class='padd15'>"+lg_fonctions_15+" "+codeCarte+" "+lg_fonctions_16+"</p>").dialog({
780		resizable: false,
781	    height: "auto",
782	    width: "auto",
783	    modal: true,
784	    fluid : true,
785	    draggable : false,
786	    closeOnEscape: false,
787	    open: function(event, ui) {
788	      // Cacher la croix de fermeture
789	      // $(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
790	      // Cacher le titre
791	      $(".ui-dialog-titlebar", ui.dialog | ui).hide();
792	    },
793      	buttons: [
794		    {
795		        text: lg_fonctions_17,
796		        click: function() { $.ajax({
797				url : globalPath + "/ajax/ajax-supAchat.php",
798				type: 'POST',
799				data: {codeCarte:codeCarte},
800				success : function(data) {
801					if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
802					else window.location.reload(true);
803				}
804			}); }
805		    },
806		    {
807		        text: lg_fonctions_18,
808		        click: function() { $(this).dialog('close'); }
809		    }
810		]
811    });
812}
813
814function supprimerInactivation(codeCarte){
815	$( "#modal" ).html("<p class='padd15'>"+lg_fonctions_24+" "+codeCarte+" "+lg_fonctions_16+"</p>").dialog({
816		resizable: false,
817	    height: "auto",
818	    width: "auto",
819	    modal: true,
820	    fluid : true,
821	    draggable : false,
822	    closeOnEscape: false,
823	    open: function(event, ui) {
824	      // Cacher la croix de fermeture
825	      // $(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
826	      // Cacher le titre
827	      $(".ui-dialog-titlebar", ui.dialog | ui).hide();
828	    },
829      	buttons: [
830		    {
831		        text: lg_fonctions_17,
832		        click: function() { $.ajax({
833				url : globalPath + "/ajax/ajax-supInactivation.php",
834				type: 'POST',
835				data: {codeCarte:codeCarte},
836				success : function(data) {
837					if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
838					else window.location.reload(true);
839				}
840			}); }
841		    },
842		    {
843		        text: lg_fonctions_18,
844		        click: function() { $(this).dialog('close'); }
845		    }
846		]
847    });
848}
849
850function supprimerChangementVehicule(codeCarte) {
851	$( "#modal" ).html("<p class='padd15'>"+lg_fonctions_25+" "+codeCarte+" "+lg_fonctions_16+"</p>").dialog({
852		resizable: false,
853	    height: "auto",
854	    width: "auto",
855	    modal: true,
856	    fluid : true,
857	    draggable : false,
858	    closeOnEscape: false,
859	    open: function(event, ui) {
860	      // Cacher la croix de fermeture
861	      // $(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
862	      // Cacher le titre
863	      $(".ui-dialog-titlebar", ui.dialog | ui).hide();
864	    },
865      	buttons: [
866		    {
867		        text: lg_fonctions_17,
868		        click: function() { $.ajax({
869				url : globalPath + "/ajax/ajax-supChangementVehicule.php",
870				type: 'POST',
871				data: {type:'vehicule',codeCarte:codeCarte},
872				success : function(data) {
873					if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
874					else window.location.reload(true);
875				}
876			}); }
877		    },
878		    {
879		        text: lg_fonctions_18,
880		        click: function() { $(this).dialog('close'); }
881		    }
882		]
883    });
884}
885
886function supprimerChangementAdresse() {
887	$( "#modal" ).html("<p class='padd15'>"+lg_fonctions_26+" "+lg_fonctions_16+"</p>").dialog({
888		resizable: false,
889	    height: "auto",
890	    width: "auto",
891	    modal: true,
892	    fluid : true,
893	    draggable : false,
894	    closeOnEscape: false,
895	    open: function(event, ui) {
896	      // Cacher la croix de fermeture
897	      // $(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
898	      // Cacher le titre
899	      $(".ui-dialog-titlebar", ui.dialog | ui).hide();
900	    },
901      	buttons: [
902		    {
903		        text: lg_fonctions_17,
904		        click: function() { $.ajax({
905				url : globalPath + "/ajax/ajax-supChangementVehicule.php",
906				type: 'POST',
907				data: {type:'adresse'},
908				success : function(data) {
909					if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
910					else window.location.reload(true);
911				}
912			}); }
913		    },
914		    {
915		        text: lg_fonctions_18,
916		        click: function() { $(this).dialog('close'); }
917		    }
918		]
919    });
920}
921
922function supprimerAchatRenouvellement(codeCarte, form){
923	$( "#modal" ).html("<p class='padd15'>"+lg_fonctions_19+" "+codeCarte+" "+lg_fonctions_20+"</p>").dialog({
924	    resizable: false,
925	    height: "auto",
926	    width: "auto",
927	    modal: true,
928	    fluid : true,
929	    draggable : false,
930	    closeOnEscape: false,
931	    open: function(event, ui) {
932			// Cacher la croix de fermeture
933			// $(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
934			// Cacher le titre
935			$(".ui-dialog-titlebar", ui.dialog | ui).hide();
936	    },
937      	buttons: [
938		    {
939		        text: lg_fonctions_17,
940		        click: function() { if (form && form.submit) form.submit(); }
941		    },
942		    {
943		        text: lg_fonctions_18,
944		        click: function() { $(this).dialog('close'); }
945		    }
946		]
947    });
948}
949function supprimerAchatRenouvellementBadge(codeBadge, form){
950	$( "#modal" ).html("<p class='padd15'>"+lg_fonctions_19_1+" "+codeBadge+" "+lg_fonctions_20+"</p>").dialog({
951	    resizable: false,
952	    height: "auto",
953	    width: "auto",
954	    modal: true,
955	    fluid : true,
956	    draggable : false,
957	    closeOnEscape: false,
958	    open: function(event, ui) {
959			// Cacher la croix de fermeture
960			// $(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
961			// Cacher le titre
962			$(".ui-dialog-titlebar", ui.dialog | ui).hide();
963	    },
964      	buttons: [
965		    {
966		        text: lg_fonctions_17,
967		        click: function() { if (form && form.submit) form.submit(); }
968		    },
969		    {
970		        text: lg_fonctions_18,
971		        click: function() { $(this).dialog('close'); }
972		    }
973		]
974    });
975}
976
977function supprimerAchatMobile(codeCarte){
978	$( "#popupDialog" ).popup("open");
979	$('.close').click(function() {
980		$.ajax({
981			url : globalPath + "/ajax/ajax-supAchat.php",
982			type: 'POST',
983			data: {codeCarte:codeCarte},
984			success : function(data) {
985				if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
986				else window.location.reload(true);
987			}
988		});
989	});
990}
991
992function changeSelectTest(element){
993    var form = element ? $(element).closest('form') : $('#formRechargement');
994    var modal = form.closest('#modal');
995    if (!modal.length) modal = $('#modal');
996
997    $.ajax({
998        url : globalPath + "/ajax/ajax-rechargement.php",
999        type: 'POST',
1000        data: form.serialize(),
1001        success : function(data) {
1002            if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
1003            else {
1004                modal.empty();
1005                modal.html(data);
1006            }
1007        }
1008    });
1009}
1010function rechargement(codeCarte, nbPassage, width, height){
1011    var params = { codeCarte: codeCarte };
1012    if (typeof nbPassage != 'undefined') params.valInput = nbPassage;
1013    
1014    $( '#modal' ).empty();
1015    $( 'body' ).prepend("<div class=\"loader_ajax\"></div>");
1016    $.ajax({
1017        url : globalPath + "/ajax/ajax-rechargement.php",
1018        type: 'POST',
1019        data: params,
1020        success : function(data) {
1021			if (data == "deconnection") {
1022				document.location.href = globalPath + "/deconnexion";
1023			}
1024			else{
1025                $( '.loader_ajax' ).remove();
1026				$( '#modal' ).empty();
1027				$( '#modal' ).html(data);
1028			    $( '#modal' ).dialog({
1029                    resizable: false,
1030                    height: "auto",
1031                    width: "auto",
1032                    modal: true,
1033                    fluid : true,
1034                    draggable : false,
1035                    closeOnEscape: false, 
1036                    open: function(event, ui) {
1037                        // Cacher la croix de fermeture
1038                        // $(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
1039                        // Cacher le titre
1040                        $(".ui-dialog-titlebar", ui.dialog | ui).hide();
1041                    },
1042			        buttons: [ { text: lg_fonctions_21, click: function() { $(this).dialog( 'close' );$(this).html('<div class="loader"></div>'); } } ]
1043			    });
1044			}
1045        }
1046    });  
1047}
1048
1049function viderPanier(){
1050	$( "#modal" ).html('<div class="padd15">'+lg_fonctions_1+'</div>').dialog({
1051		resizable: false,
1052		height: "auto",
1053		width: "auto",
1054		modal: true,
1055		fluid : true,
1056		draggable : false,
1057		closeOnEscape: false, 
1058		open: function(event, ui) {
1059		    // Cacher la croix de fermeture
1060		    // $(".ui-dialog-titlebar-close", ui.dialog | ui).hide();
1061		    // Cacher le titre
1062		    $(".ui-dialog-titlebar", ui.dialog | ui).hide();
1063		},
1064		buttons: [
1065		    {
1066		        text: lg_fonctions_22,
1067		        click: function() { $.ajax({
1068			 	url : globalPath + "/ajax/ajax-supAchat.php",
1069			 	type: 'POST',
1070			 	data: {action:"viderPanier"},
1071			 	success : function(data) {
1072					  if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
1073			 		else window.location.reload(true);
1074			 	}
1075			 }); }
1076		    },
1077		    {
1078		        text: lg_fonctions_23,
1079		        click: function() { $(this).dialog('close'); }
1080		    }
1081		]
1082    });
1083}
1084
1085function viderPanierMobile(){
1086	$.ajax({
1087        url : globalPath + "/ajax/ajax-supAchat.php",
1088        type: 'POST',
1089        data: {action:"viderPanier"},
1090        success : function(data) {
1091			if (data == "deconnection") document.location.href = globalPath + "/deconnexion";
1092			else window.location.reload(true);
1093        }
1094	});
1095}
1096
1097$(document).on('pageinit', function() {
1098	$('input.rungisbouton').parent().addClass("rungisbouton");
1099	// $('.whitebackground').parent().addClass("whitebackground");
1100
1101	$('a').click(function(){
1102		changePage($(this).attr('href'), $(this));
1103	});
1104
1105	$('form.form_payer').submit(function(){
1106		$.mobile.loading( 'show'); 
1107		setTimeout(function(){
1108			$(this).submit();
1109		}, 100);
1110	});
1111	
1112	$('.accordeongroup').hide();
1113	$('.checkedaccordeon').parent().parent().show();
1114	$('.checkedaccordeon').parent().parent().prev().addClass('down');
1115	$('.accordeoncategory').click(function(){
1116		$(this).next().slideToggle();
1117		if ($(this).hasClass('down')) $(this).removeClass('down');
1118		else $(this).addClass('down');
1119	});
1120
1121	$('.rungisbouton').bind('touchstart', function(){
1122		$(this).addClass('greyover');
1123	});
1124	$('.rungisbouton').bind('touchend', function(){
1125		$(this).removeClass('greyover');
1126	});
1127	$('.fondRose').bind('touchstart', function(){
1128		$(this).addClass('greyover');
1129	});
1130	$('.fondRose').bind('touchend', function(){
1131		$(this).removeClass('greyover');
1132	});
1133});	
1134
1135/*
1136function checkLinkForRedirection(obj, zoom){
1137	if (versionMobile) return true;
1138	else
1139	{
1140		if (zoom) changePage('/mobile-lien-externe/?zoom=' + zoom + '&src=' + encodeURIComponent($(obj).attr('href')), null);
1141		else changePage('/mobile-lien-externe/?src=' + encodeURIComponent($(obj).attr('href')), null);
1142		return false;
1143	}
1144}*/
1145
1146function changePage(url, obj){
1147	if (obj && obj.attr('target') !== undefined)
1148		return false;
1149	if (!obj || obj.attr('data-ajax') !== undefined || obj.attr('rel') !== undefined){
1150		$.mobile.loading( 'show'); 
1151		
1152		// $('body').append('<div class="ui-loader ui-corner-all ui-body-b ui-loader-default"><span class="ui-icon-loading"></span><h1>chargement</h1></div>');
1153
1154		setTimeout(function(){
1155			document.location.href = url;
1156		}, 100);
1157	}
1158}
1159
1160function addDataLayer(appel_mp6, gtm, str) {
1161	if (appel_mp6 == 1) {		
1162		dataLayer = [{
1163			'ezUID': globalEzUID+'-0',
1164			'ezREF1': str,
1165			'device': global_device,
1166			'customerTyp': global_customertyp,
1167			'visitorLoginState': global_visitorLoginState,
1168			'customerEmail': global_customerEmail,
1169			'customerId': global_customerId,
1170			'site': 'My Rungis'
1171		}];
1172		// console.log(dataLayer[0], gtm);
1173	
1174		(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
1175			new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
1176			j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
1177			'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
1178			})(window,document,'script','dataLayer',gtm);
1179	}	
1180}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.