PageSourceSearch

https://distanceenvoiture.fr/ajax/help2.js?v=2024-03-03

js distanceenvoiture.fr collected 2026-10-03 00:25:34 UTC 13,923 bytes, 418 lines download raw bytes

1	if(fuelTypeTemp!="")
2	{
3	  if(fuelTypeTemp==1) 
4	  { var initialPetrolPrice=fuelPriceTemp;	
5        var initialPetrolConsum=carConsumtionTemp;
6	  } 
7	   else if(fuelTypeTemp==2)
8       {	   
9	    var initialGazPrice=fuelPriceTemp;	
10		var initialGazConsum=carConsumtionTemp;		
11       }	   
12	   else if(fuelTypeTemp==3)
13	   {
14		var initialOilPrice=fuelPriceTemp;	
15		var initialOilConsum=carConsumtionTemp;	
16	   }
17	   else
18	   {
19		  var initialCNGPrice=fuelPriceTemp;	
20		  var initialCNGConsum=carConsumtionTemp;	
21	   }
22	}
23	
24    if(langFirst!="")
25	{
26	  jQuery("#langFirst").html("<a href='"+langFirst+"'>français </a>"); 
27	  jQuery("#langSecond").html("<a href='"+langSecond+"'>english </a>");
28	}
29	
30
31  jQuery("#fuelchoice").change(
32function()
33{
34
35		document.getElementsByName('ltorgallon')[0].options[0].innerHTML = "(lt/100km)";
36	document.getElementsByName('ltorgallon')[0].options[1].innerHTML = "(km/lt)";
37if(jQuery("#fuelchoice").find('option:selected').val()=="1")
38{
39  fuelPrice=initialPetrolPrice;
40  carConsumtion=initialPetrolConsum;
41   totalConsumption=Math.round((totalKM*carConsumtion/100)*100)/100;
42      jQuery('#pricePerPerson').html(' <strong>'+Math.round((tollPrice*100+totalConsumption*fuelPrice*100)/numOfPassengers)/100+'€</strong>');
43
44  }
45else if(jQuery("#fuelchoice").find('option:selected').val()=="2")
46{
47	fuelPrice=initialGazPrice;
48	carConsumtion=initialGazConsum;
49	 totalConsumption=Math.round((totalKM*carConsumtion/100)*100)/100;
50	    jQuery('#pricePerPerson').html(' <strong>'+Math.round((tollPrice*100+totalConsumption*fuelPrice*100)/numOfPassengers)/100+'€</strong>');
51
52
53}
54else if(jQuery("#fuelchoice").find('option:selected').val()=="3")
55{
56  fuelPrice=initialOilPrice;
57  carConsumtion=initialOilConsum;
58   totalConsumption=Math.round((totalKM*carConsumtion/100)*100)/100;
59      jQuery('#pricePerPerson').html(' <strong>'+Math.round((tollPrice*100+totalConsumption*fuelPrice*100)/numOfPassengers)/100+'€</strong>');
60
61
62 }
63 else if(jQuery("#fuelchoice").find('option:selected').val()=="4")
64{
65	document.getElementsByName('ltorgallon')[0].options[0].innerHTML = "(kg/100km)";
66	document.getElementsByName('ltorgallon')[0].options[1].innerHTML = "(km/kg)";
67  fuelPrice=initialCNGPrice;
68  carConsumtion=initialCNGConsum;
69   totalConsumption=Math.round((totalKM*carConsumtion/100)*100)/100;
70      jQuery('#pricePerPerson').html(' <strong>'+Math.round((tollPrice*100+totalConsumption*fuelPrice*100)/numOfPassengers)/100+'€</strong>');
71
72
73 }
74      createCookie("carConsumtion",carConsumtion,10);
75   createCookie("fuelPrice",fuelPrice,10);
76   createCookie("fuelType",jQuery("#fuelchoice").find('option:selected').val(),10); 
77 //calculateConsumptionFast();
78 printFuelConsumtpion(totalConsumption,fuelPrice);
79
80  }
81);
82
83
84jQuery("#plus").click(function(){
85 var pricePerLiter=parseFloat(fuelPrice);
86 if(pricePerLiter<=7.2)
87 {
88   pricePerLiter=Math.round((pricePerLiter+0.01)*100)/100;
89   fuelPrice=pricePerLiter;
90   printFuelConsumtpion(totalConsumption,fuelPrice);
91   createCookie("carConsumtion",carConsumtion,10);
92   createCookie("fuelPrice",fuelPrice,10);
93   createCookie("fuelType",jQuery("#fuelchoice").find('option:selected').val(),10);
94 
95 }
96});
97jQuery("#minus").click(function(){
98  var pricePerLiter=parseFloat(fuelPrice);
99 if(pricePerLiter>=0.3)
100 {
101   pricePerLiter=Math.round((pricePerLiter-0.01)*100)/100;
102   //jQuery("#fuelPrice").html(pricePerLiter+" €/lt");
103   fuelPrice=pricePerLiter;
104   printFuelConsumtpion(totalConsumption,fuelPrice);
105      createCookie("carConsumtion",carConsumtion,10);
106   createCookie("fuelPrice",fuelPrice,10);
107   createCookie("fuelType",jQuery("#fuelchoice").find('option:selected').val(),10);
108
109 }
110});
111
112jQuery("#plusConsum").click(function(){
113	
114 var carConsumTemp=parseFloat(carConsumtion);
115 if(carConsumTemp<=100)
116 {
117   carConsumTemp=Math.round((carConsumTemp+0.1)*10)/10;
118   jQuery("#carConsumption").html(carConsumTemp);
119   carConsumtion=carConsumTemp;
120   
121   totalConsumption=Math.round((totalKM*carConsumtion/100)*100)/100;
122   printFuelConsumtpion(totalConsumption,fuelPrice);
123      createCookie("carConsumtion",carConsumtion,10);
124   createCookie("fuelPrice",fuelPrice,10);
125   createCookie("fuelType",jQuery("#fuelchoice").find('option:selected').val(),10);
126
127 }
128});
129jQuery("#plus1Consum").click(function(){
130 var carConsumTemp=parseFloat(carConsumtion);
131 if(carConsumTemp<=100)
132 {
133   carConsumTemp=Math.round((carConsumTemp+1)*10)/10;
134   jQuery("#carConsumption").html(carConsumTemp);
135   carConsumtion=carConsumTemp;
136   
137   totalConsumption=Math.round((totalKM*carConsumtion/100)*100)/100;
138   printFuelConsumtpion(totalConsumption,fuelPrice);
139      createCookie("carConsumtion",carConsumtion,10);
140   createCookie("fuelPrice",fuelPrice,10);
141   createCookie("fuelType",jQuery("#fuelchoice").find('option:selected').val(),10);
142 }
143});
144jQuery("#minusConsum").click(function(){
145 var carConsumTemp=parseFloat(carConsumtion);
146 if(carConsumTemp>=2.1)
147 {
148   carConsumTemp=Math.round((carConsumTemp-0.1)*10)/10;
149   jQuery("#carConsumption").html(carConsumTemp);
150   carConsumtion=carConsumTemp;
151   totalConsumption=Math.round((totalKM*carConsumtion/100)*100)/100;
152   printFuelConsumtpion(totalConsumption,fuelPrice);
153      createCookie("carConsumtion",carConsumtion,10);
154   createCookie("fuelPrice",fuelPrice,10);
155   createCookie("fuelType",jQuery("#fuelchoice").find('option:selected').val(),10);
156
157 }
158});
159jQuery("#minus1Consum").click(function(){
160 var carConsumTemp=parseFloat(carConsumtion);
161 if(carConsumTemp>=2.1)
162 {
163   carConsumTemp=Math.round((carConsumTemp-1)*10)/10;
164   jQuery("#carConsumption").html(carConsumTemp);
165   carConsumtion=carConsumTemp;
166   totalConsumption=Math.round((totalKM*carConsumtion/100)*100)/100;
167   printFuelConsumtpion(totalConsumption,fuelPrice);
168      createCookie("carConsumtion",carConsumtion,10);
169   createCookie("fuelPrice",fuelPrice,10);
170   createCookie("fuelType",jQuery("#fuelchoice").find('option:selected').val(),10);
171
172 }
173});
174function printFuelConsumtpion(totalConsumption,fuelPrice)
175{
176	
177			for(i=0;i<3;i++)
178	{
179		if(kmInRoutes[i]!=0)
180		{
181			fuelCostForRoute=Math.round(((kmInRoutes[i][0]/1000.0)*carConsumtion/100)*fuelPrice*100)/100;
182
183			if (i==0)
184				jQuery("#fuelCostForRoute0").html(fuelCostForRoute+"€");
185			else if(i==1)
186				jQuery("#fuelCostForRoute1").html(fuelCostForRoute+"€");
187			else if(i==2)
188				jQuery("#fuelCostForRoute2").html(fuelCostForRoute+"€");
189			
190		}
191	}
192	if(jQuery("#fuelchoice").find('option:selected').val()==4)
193		var unitFuel="kg";
194	else
195		var unitFuel="lt";
196if(statusFullScreen==0 || isMobile)
197{
198	//jQuery("#consumptionMessage").html("Κατανάλωση: "); 
199	if(url_without_get.indexOf('franceNew/fr')!=-1 || url_without_get.indexOf('.fr/fr')!=-1)
200	{
201	jQuery("#liters").html("Consom. de carburant: <strong>"+totalConsumption+" "+unitFuel+"</strong>");
202jQuery("#fuelPrice").html("Prix du carburant: <strong>"+fuelPrice+" €/"+unitFuel+"</strong>");
203jQuery("#fuelCost").html("Coût du carburant: <strong>"+Math.round(totalConsumption*fuelPrice*100)/100+"€</strong>");
204
205	}
206	else
207	{
208			jQuery("#liters").html("Fuel consumption: <strong>"+totalConsumption+" "+unitFuel+"</strong>");
209			jQuery("#fuelPrice").html("Fuel price: <strong>"+fuelPrice+" €/"+unitFuel+"</strong>");
210			jQuery("#fuelCost").html("Fuel cost: <strong>"+Math.round(totalConsumption*fuelPrice*100)/100+"€</strong>");
211	}
212if(jQuery("#ltorgallon").find('option:selected').val()==1)
213	jQuery("#carConsumtion").html("<strong>"+carConsumtion+" "+unitFuel+"/100km</strong>");//Consumo medio: 
214else
215	jQuery("#carConsumtion").html("<strong>"+Math.round((100/carConsumtion)*10)/10+" km/"+unitFuel+"</strong>");//Consumo medio: 
216
217jQuery('#messageTolls').css({"display":"inline-block"});
218
219
220jQuery('#pricePerPerson').html(' <strong>'+Math.round((tollPrice*100+totalConsumption*fuelPrice*100)/numOfPassengers)/100+'€</strong>');
221
222}	
223else
224{
225	//jQuery("#consumptionMessage").html(""); 
226	jQuery("#liters").html("<strong>"+totalConsumption+" "+unitFuel+"</strong>");
227jQuery("#fuelPrice").html("<strong>"+fuelPrice+" €/"+unitFuel+"</strong>");
228
229if(jQuery("#ltorgallon").find('option:selected').val()==1)
230	jQuery("#carConsumtion").html("<strong>"+carConsumtion+" "+unitFuel+"/100km</strong>");
231else
232	jQuery("#carConsumtion").html("<strong>"+Math.round((100/carConsumtion)*10)/10+" km/"+unitFuel+"</strong>");
233
234jQuery("#fuelCost").html("<strong>"+Math.round(totalConsumption*fuelPrice*100)/100+"€</strong>");
235jQuery('#pricePerPerson').html(' <strong>'+Math.round((tollPrice*100+totalConsumption*fuelPrice*100)/numOfPassengers)/100+'€</strong>');
236jQuery('#messageTolls').css({"display":"none"});
237
238}	
239
240
241
242}
243		  jQuery("#selectSth").change(
244		function()
245		{  
246		if(jQuery("#selectSth").val()==1)
247		  { 
248		  
249		  carType=1;
250		  createCookie("carType",carType,10);
251		  var tempvehicle="url("+vehicleIcon+") left no-repeat";
252		  
253		 // jQuery("#selectSth").css({"background":tempvehicle});
254		  changeTypeOfVehicle();
255		  }
256		  else if(jQuery("#selectSth").val()==2)
257		  {
258		
259		  carType=2;
260		  createCookie("carType",carType,10);
261		  var tempvehicle2="url("+vehicleIcon2+") left no-repeat";
262		   // jQuery("#selectSth").css({"background": tempvehicle2});
263			  changeTypeOfVehicle();
264			} 
265			else if(jQuery("#selectSth").val()==3)
266		  {
267		
268		  carType=3;
269		  createCookie("carType",carType,10);
270		  var tempvehicle3="url("+vehicleIcon3+") left no-repeat";
271		   // jQuery("#selectSth").css({"background": tempvehicle3});
272			  changeTypeOfVehicle();
273			} 
274						else if(jQuery("#selectSth").val()==4)
275		  {
276		
277		  carType=4;
278		  createCookie("carType",carType,10);
279		  var tempvehicle4="url("+vehicleIcon4+") left no-repeat";
280		   // jQuery("#selectSth").css({"background": tempvehicle4});
281			  changeTypeOfVehicle();
282			} 
283									else if(jQuery("#selectSth").val()==0)
284		  {
285		
286		  carType=0;
287		  createCookie("carType",carType,10);
288		  var tempvehicle5="url("+vehicleIcon5+") left no-repeat";
289		   // jQuery("#selectSth").css({"background": tempvehicle5});
290			  changeTypeOfVehicle();
291			} 
292	if(carType==3 || carType==4/* || carType==5*/)
293	{
294	  jQuery("#messageForTrucks").html('**');
295	   if(language!='fr')
296	  	  jQuery("#lorryMessage").html('<span style="color:red">**</span>Route information for trucks only on estimated travel costs and not on the navigator. It is possible to contain broken roads for trucks (eg city center, vehicle weight limit, narrow streets).');
297	  else
298		  jQuery("#lorryMessage").html("<span style='color:red'>**</span>Les informations d'itinéraire pour les camions sont fournies uniquement pour estimer le coût de l'itinéraire. Les itinéraires suggérés peuvent inclure des camions (p. Ex. Centre-ville, routes légères) ou des routes étroites.");
299
300	 } 
301	 else 
302	 {
303	 jQuery("#messageForTrucks").html('');
304	 	  jQuery("#lorryMessage").html('');
305
306	 }
307		jQuery("#selectSth").blur();
308		});
309		if(fuelTypeTemp!="")
310{
311  if(fuelTypeTemp==1)
312  {
313     var fuelPrice=initialPetrolPrice;
314	 var carConsumtion=initialPetrolConsum;
315  }	 
316  else if(fuelTypeTemp==2)
317  {
318    var fuelPrice=initialGazPrice;
319	var carConsumtion=initialGazConsum;
320  }	
321  else if(fuelTypeTemp==3)
322  {
323   var fuelPrice=initialOilPrice;
324   var carConsumtion=initialOilConsum;
325  } 
326    else if(fuelTypeTemp==4)
327  {
328   var fuelPrice=initialCNGPrice;
329   var carConsumtion=initialCNGConsum;
330  } 
331} 
332else
333{
334 var fuelPrice=initialPetrolPrice;
335 var carConsumtion=initialPetrolConsum;
336}
337jQuery("#passengers").change(
338function()
339{
340	
341if(jQuery("#passengers").find('option:selected').val()=="1")
342{
343numOfPassengers=1;
344jQuery('#pricePerPerson').html(' <strong>'+Math.round((tollPrice*100+totalConsumption*fuelPrice*100)/numOfPassengers)/100+'€</strong>');
345
346  }
347else if(jQuery("#passengers").find('option:selected').val()=="2")
348{
349numOfPassengers=2;
350jQuery('#pricePerPerson').html(' <strong>'+Math.round((tollPrice*100+totalConsumption*fuelPrice*100)/numOfPassengers)/100+'€</strong>');
351
352
353}
354else if(jQuery("#passengers").find('option:selected').val()=="3")
355{
356numOfPassengers=3;
357jQuery('#pricePerPerson').html(' <strong>'+Math.round((tollPrice*100+totalConsumption*fuelPrice*100)/numOfPassengers)/100+'€</strong>');
358
359
360 }
361 else if(jQuery("#passengers").find('option:selected').val()=="4")
362{
363numOfPassengers=4;
364jQuery('#pricePerPerson').html(' <strong>'+Math.round((tollPrice*100+totalConsumption*fuelPrice*100)/numOfPassengers)/100+'€</strong>');
365}
366else if(jQuery("#passengers").find('option:selected').val()=="5")
367{
368numOfPassengers=5;
369jQuery('#pricePerPerson').html(' <strong>'+Math.round((tollPrice*100+totalConsumption*fuelPrice*100)/numOfPassengers)/100+'€</strong>');
370
371
372 }
373      createCookie("passengers",numOfPassengers,1);
374   /*createCookie("fuelPrice",fuelPrice,10);
375   createCookie("fuelType",jQuery("#fuelchoice").find('option:selected').val(),10); 
376 calculateConsumptionFast();*/
377  }
378);
379 function setCookie(cname, cvalue, exdays) {
380    var d = new Date();
381    d.setTime(d.getTime() + (exdays*24*60*60*1000));
382    var expires = "expires="+d.toGMTString();
383    document.cookie = cname + "=" + cvalue + "; " + expires;
384}
385function createCookie(name,value,days) {
386    if (days) {
387        var date = new Date();
388        //date.setTime(date.getTime()+(days*24*60*60*1000));
389		//3 days
390        date.setTime(date.getTime()+(3*24*60*60*1000));
391        var expires = "; expires="+date.toGMTString();
392    }
393    else var expires = "";
394    document.cookie = name+"="+value+expires+"; path=/";
395}
396jQuery("#ltorgallon").change(
397function()
398{
399if(jQuery("#ltorgallon").find('option:selected').val()==1)
400{
401	
402jQuery("#plusConsum").html("+");
403jQuery("#minusConsum").html("-");
404jQuery("#plus1Consum").html("+1");
405jQuery("#minus1Consum").html("-1");
406printFuelConsumtpion(totalConsumption,fuelPrice);
407
408  }
409else if(jQuery("#ltorgallon").find('option:selected').val()==2)
410{
411	jQuery("#plusConsum").html("-");
412jQuery("#minusConsum").html("+");
413	jQuery("#plus1Consum").html("-1");
414jQuery("#minus1Consum").html("+1");
415printFuelConsumtpion(totalConsumption,fuelPrice);
416}
417}
418);

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.