PageSourceSearch

https://regent-petite-france.com/wp-content/plugins/fastbooking-wordpress-plugin/lib/fblib.min.js?ver=1

js regent-petite-france.com collected 2026-10-03 22:15:18 UTC 19,284 bytes, 606 lines download raw bytes

1/*****
2 * Copyright © FASTBOOKING  1999-2017
3 * 10/05/2017
4 *
5 * Please do NOT modify this file
6 * Please do NOT use the final IP adress for Fastbooking links:
7 * IP address may be changed at any time
8 *
9 */
10
11// use following parameters, declared before in a fbparam.js file
12// Mandatory parameters:
13// var FBRESA = "https://redirect.fastbooking.com/DIRECTORY/";
14// var FB_nb_day_delay = 0;
15// Optional parameters:
16//var FB_useGoogleAnalytics = false;
17
18if (typeof(FB_useGoogleAnalytics) == "undefined")
19    var FB_useGoogleAnalytics = false;
20//////////////////////////////////////////////////////////////
21// following code is used to optimize booking access and a better client experience
22var FB_book_image = new Image();
23FB_book_image.src = FBRESA + "trans.gif";
24
25//////////////////////////////////////////////////////////////
26// Fidelity program
27var FB_code_interface = "";
28var FB_profil = "";
29function hhotelProfil(code_interface, profil)
30{
31    FB_code_interface = code_interface;
32    FB_profil = profil;
33}
34
35// Form: show arrival date
36// this function to replace the traditional start function
37// in this case no update is required every year.
38function start() {
39    var nbm = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
40
41    thisform = document.idForm;
42
43    build_year_select(thisform);
44
45    MD = new Date();
46
47    nday = MD.getDate();
48    aday = MD.getDay();
49    amois = MD.getMonth();
50    ayear = takeYear(MD);
51    cur_year = ayear;
52
53    nday += FB_nb_day_delay;
54
55    if(nday > nbm[amois])
56    {
57        nday -= nbm[amois];
58        amois++;
59        if(amois > 11) {
60            ayear++;
61            amois = 0;
62        }
63    }
64
65    indexDay = nday - 1;
66    indexMois = amois;
67    indexYear = ayear - cur_year;
68
69    if(indexDay < 0 || indexDay > 30)
70        indexDay = 0;
71    if(indexMois < 0 || indexMois > 11)
72        indexMois = 0;
73    if(indexYear < 0 || indexYear > 1)
74        indexDay = 0;
75
76    thisform.fromday.selectedIndex = indexDay;
77    thisform.frommonth.selectedIndex = indexMois;
78    thisform.fromyear.selectedIndex = indexYear;
79
80    update_departure();
81}
82
83function generateSession()
84{
85    var time = new Date();
86    var sec  = time.getSeconds();
87    f = Math.floor(Math.random() * 1000000000) + '';
88    var sess = '' + sec + f;
89    return sess;
90}
91
92function transferGAdata(sessId, cname)
93{
94    var waction = FBRESA + "ga.phtml?clusterName="+cname + "&id=" + sessId;
95    pageTracker._initData();
96    new Image().src = pageTracker._getLinkerUrl(waction);
97    pageTracker._trackPageview('/FastBooking/ClicBook');
98}
99
100function fbOpenWindow(cname, waction, title, width, height)
101{
102    if(FB_useGoogleAnalytics)
103    {
104        sessId 	 = generateSession();
105        hhotelProfil("GoogleAnalytics", escape("SESSION=" + sessId));
106    }
107    if(FB_profil != "")
108    {
109        waction += "&code="+FB_code_interface;
110        waction += "&profil="+FB_profil;
111    }
112
113    window.open(waction, '_blank');
114
115    if(FB_useGoogleAnalytics)
116        transferGAdata(sessId, cname);
117}
118
119// standard booking function
120function hhotelPTC(cname, lg, codeprice, codetrack, cluster)
121{
122    hhotelResa(cname, lg, codeprice, "", "", codetrack, cluster, "", "");
123}
124
125// standard promotion function
126function hhotelPromo(cname, lg, theme)
127{
128    hhotelResa(cname, lg, "DYNPROMO", "", "", "", "", theme, "");
129}
130
131// reservation promotion function: To show one promotion
132function hhotelOnePromo(cname, lg, codeprice, codetrack, cluster)
133{
134    hhotelResa(cname, lg, codeprice, "", "", codetrack, cluster, "", "style=DIRECTPROMO");
135}
136
137// reservation page WITHOUT the individual access
138function hhotelNegociated(cname, lg, codeprice, codetrack, cluster)
139{
140    hhotelResa(cname, lg, codeprice, "", "", codetrack, cluster, "", "negociated=1");
141}
142
143// Main direct reservation function
144function hhotelResaDirect(cname, lg, codeprice, firstroom, codetrack, firstdate)
145{
146    hhotelResa(cname, lg, codeprice, firstroom, firstdate, codetrack, "", "", "style=DIRECT");
147}
148
149// standard search availabilities in a group
150function hhotelSearchGroup(cluster, lg, price, nights, title)
151{
152    hhotelSearch(cluster, lg, price, nights, title, "", "");
153}
154
155// standard search availabilities in a group for a partner
156function hhotelSearchPartner(cluster, lg, price, codetrack, title)
157{
158    if (codetrack != "") args = "&from="+codetrack;
159    else	args = "";
160    hhotelSearch(cluster, lg, price, "", title, "", args);
161}
162
163// search by giving the initial date
164function hhotelSearchPriceDate(cluster, price, nights, title, firstdate)
165{
166    // firstdate : format "YYMMDD"
167    var args="";
168    if (firstdate != "") args = "FirstDate="+firstdate;
169    hhotelSearch(cluster, "", price, nights, title, "", args);
170}
171
172function hhotelSearchPriceDateTrack(cluster, lg, price, codetrack, nights, title, firstdate)
173{
174    var args="";
175    if (codetrack != "") args = "from="+codetrack;
176    if (firstdate != "") args += "&FirstDate="+firstdate;
177    hhotelSearch(cluster, lg, price, nights, title, "", args);
178}
179
180// search by giving the initial date and persons for MSP
181function hhotelSearchAllMSP(cluster, price, nights, title, firstdate, mastercluster, cartID, adults, children)
182{
183    // firstdate : format "YYMMDD"
184    var args="";
185    if (firstdate != "") args = "FirstDate="+firstdate;
186    if (mastercluster != "") args += "&mastercluster=" + mastercluster;
187    if (cartID != "") args += "&cartID=" + cartID;
188    if (adults != "") args += "&adulteresa=" + adults;
189    if (children != "") args += "&enfantresa=" + children;
190    hhotelSearch(cluster, "", price, nights, title, "", args);
191}
192
193// search availabilities for selected promotions
194function hhotelSearchPromo(cluster, lg, theme)
195{
196    hhotelSearch(cluster, lg, "", "", "", theme, "");
197}
198
199// search availabilities with Extra Field
200function hhotelSearchExtra(cluster, lg, price, codetrack, extratitle, extraval, extrashow)
201{
202    var args = "Extrafield=" + escape(extratitle) + ";" + extraval + ";" + extrashow;
203    if (codetrack != "") args += "&from="+codetrack;
204    hhotelSearch(cluster, lg, price, "", "", "", args);
205}
206
207// go to the cancel reservation page
208function hhotelcancel(lg)
209{
210    if (typeof document.idForm.Hotelnames !== 'undefined') {
211        var cname = document.idForm.Hotelnames.value;
212        if (cname == 'All') {
213            alert('Please select a hotel');
214            return;
215        }
216        var waction = FBRESA + "cancel.phtml?state=77&Hotelnames="+cname;
217        if (lg != "") waction += "&langue="+lg;
218        fbOpenWindow(cname, waction, "reservation", 400, 350);
219    } else {
220        if (typeof document.idForm.property !== 'undefined') {
221            var hid = document.idForm.property.value;
222            if (hid == '') {
223                alert('Please select a hotel');
224                return;
225            }
226            waction = 'https://www.book-secure.com/index.php?s=cancel&property='+hid;
227            fbOpenWindow(hid, waction, "reservation", 400, 350);
228        }
229    }
230}
231
232// go to the extract reservation page
233function hhotelExtract(cname, lg)
234{
235    var waction = FBRESA + "getresa.phtml?Hotelnames="+cname+"&langue="+lg;
236    fbOpenWindow(cname, waction, "getresa", 700, 300);
237    return false;
238}
239
240// check interface
241function hhotelcheckrates(cname, lg)
242{
243    var waction = FBRESA + "crs.phtml?clusterName="+cname;
244    if (lg != "") waction += "&langue="+lg;
245    waction += "&checkPromo=1";
246    fbOpenWindow(cname, waction, "search", 800, 550);
247}
248
249// Main standard reservation function MSP
250function hhotelResaMSP(cname, lg, codeprice, firstroom, firstdate, codetrack, cluster, theme, args, mastercluster, cartID)
251{
252    if (mastercluster != "") args += "&mastercluster=" + mastercluster;
253    if (cartID != "") args += "&cartID=" + cartID;
254    hhotelResa(cname, lg, codeprice, firstroom, firstdate, codetrack, cluster, theme, args);
255}
256
257// Main Search function MSP
258function hhotelSearchMSP(cluster, lg, price, nights, title, theme, args, mastercluster, cartID)
259{
260    if (mastercluster != "") args += "&mastercluster=" + mastercluster;
261    if (cartID != "") args += "&cartID=" + cartID;
262    hhotelSearch(cluster, lg, price, nights, title, theme, args);
263}
264
265// Main standard reservation function
266function hhotelResa(cname, lg, codeprice, firstroom, firstdate, codetrack, cluster, theme, args)
267{
268    var waction = FBRESA+"preresa.phtml?Hotelnames="+cname;
269    if (lg != "") waction += "&langue="+lg;
270    if (firstroom != "") {
271        waction += "&FirstRoomName="+firstroom;
272        if (codeprice == "")
273            codeprice = "DIRECT";
274    }
275    if (firstdate != "") {
276        waction += "&FirstDate="+firstdate;
277        if (codeprice == "")
278            codeprice = "DIRECT";
279    }
280    if (codeprice != "") waction += "&FSTBKNGCode="+codeprice;
281    if (codetrack != "") waction += "&FSTBKNGTrackLink="+codetrack;
282    if (cluster != "") waction += "&clustername="+cluster;
283    if (theme != "") waction += "&theme="+theme;
284    if (args != "" && (args.indexOf("=")!= -1) ) waction += "&"+args;
285    waction += "&HTTP_REFERER="+escape(document.location.href);
286    fbOpenWindow(cname, waction, "reservation", 400, 350);
287}
288
289// Main Search function
290function hhotelSearch(cluster, lg, price, nights, title, theme, args)
291{
292    var waction = FBRESA + "crs.phtml?clusterName="+cluster;
293    if (lg != "") waction += "&langue="+lg;
294    if (price != "") waction += "&FSTBKNGCode="+price;
295    if (nights != "") waction += "&nights="+nights;
296    if (title != "") waction += "&title="+escape(title);
297    if (theme != "") waction += "&theme="+theme;
298    if (args != "" && (args.indexOf("=")!= -1) ) waction += "&"+args;
299    fbOpenWindow(cluster, waction, "search", 1000, 700);
300}
301
302// Main Search function for Multi Codes
303function hhotelSearchMultCode(cluster, lg, clecode, title, codetrack)
304{
305    var waction = FBRESA + "crs.phtml?clusterName="+cluster;
306    if (lg != "") waction += "&langue="+lg;
307    if (clecode != "") waction += "&AccessCode="+clecode;
308    if (title != "") waction += "&title="+escape(title);
309    if (codetrack != "") waction += "&FSTBKNGTrackLink="+codetrack;
310    waction += "&crossSelling=NO"; // CROSS SELLING DESACTIVATED
311    fbOpenWindow(cluster, waction, "search", 1000, 700);
312}
313
314// Main Search function for Cross Selling
315
316function hhotelSearchCrossSell(cluster, lg, codetrack, crossSelling)
317{
318    var waction = FBRESA + "crs.phtml?clusterName="+cluster;
319    if (lg != "") waction += "&langue="+lg;
320    if (codetrack != "") waction += "&FSTBKNGTrackLink="+codetrack;
321    if (crossSelling != "") waction += "&crossSelling="+crossSelling;
322    fbOpenWindow(cluster, waction, "search", 1000, 700);
323}
324
325// MAIN AVAILABILITY CHECK
326function hhotelDispopriceFHP(cname, lg, codetrack, year, month, day, nights, currency)
327{
328    var waction = FBRESA+"dispoprice.phtml?clusterName="+cname+"&Hotelnames="+cname;
329    if (lg != "") waction += "&langue="+lg;
330    if (codetrack != "") waction += "&FSTBKNGTrackLink="+codetrack;
331    if (year != "") waction += "&fromyear="+year;
332    if (month != "") waction += "&frommonth="+month;
333    if (day != "") waction += "&fromday="+day;
334    if (nights != "") waction += "&nbdays="+nights;
335    if (currency != "") waction += "&CurrencyLabel="+currency;
336    waction += "&showPromotions=3";
337    fbOpenWindow(cname, waction, "reservation", 1000, 700);
338}
339
340
341///////////////////////////////////////////////////////////////////////////////////////
342// Form functions
343// Simple form validation (used for compatibility issues)
344function hhotelDispoprice(myForm)
345{
346    hhotelFormValidation(myForm, 0);
347}
348
349// Form validation with control
350function hhotelFormValidation(myForm, mandatoryCode){
351    if (mandatoryCode == 1 && myForm.AccessCode.value == "") {
352        alert("You must type in your code ID");
353        return (false);
354    }
355    myForm.action = FBRESA + "dispoprice.phtml";
356    if (FB_useGoogleAnalytics) {
357        sessId = generateSession();
358        profilValue = escape("SESSION=" + sessId + "&CODE=GoogleAnalytics");
359        if ((typeof myForm.profil) == "undefined") {
360            var newInput = document.createElement("input");
361            newInput.setAttribute("type", "hidden");
362            newInput.setAttribute("name", "profil");
363            newInput.setAttribute("value", profilValue);
364            myForm.appendChild(newInput);
365        } else {
366            myForm.profil.value = profilValue;
367        }
368    }
369    myForm.target="_blank";
370    myForm.submit();
371    if (FB_useGoogleAnalytics) {
372        var cname = "";
373        if ((typeof myForm.AccountName) != "undefined" && myForm.AccountName.value != "")
374            cname = myForm.AccountName.value;
375        else
376            cname = myForm.Clusternames.value;
377        transferGAdata(sessId, cname);
378    }
379    return (true);
380}
381
382// Form: update the selected hotel name
383function hhotelFormUpdateHotelnames(myForm)
384{
385    menuNum = myForm.HotelList.selectedIndex;
386    if (menuNum == null)
387        return;
388    myForm.Hotelnames.value = myForm.HotelList.options[menuNum].value;
389}
390
391// Form: show the cancel page
392function hhotelFormCancel(myForm){
393    var CName = myForm.Hotelnames.value;
394    var languetype = typeof myForm.langue;
395    var langue;
396    if (languetype == "undefined")
397        langue = "";
398    else
399        langue = myForm.langue.value;
400    if (CName == null || CName == 'All' || CName == ''){ alert('Please select a hotel first'); return (false); }
401    return hhotelcancel(CName, langue);
402}
403
404// Form: show the extract page
405function hhotelFormExtract(myForm)
406{
407    var CName = myForm.Hotelnames.value;
408    var languetype = typeof myForm.langue;
409    var langue;
410    if (languetype == "undefined")
411        langue = "";
412    else
413        langue = myForm.langue.value;
414    if (CName == null || CName == 'All' || CName == ''){ alert('Please select a hotel first'); return (false); }
415    return hhotelExtract(CName, langue);
416}
417
418// Form: show languages ////////////////////////////////////////////
419function hhotelShowLang(lang)
420{
421    hhotelShowLang__(this.document, lang);
422}
423
424function hhotelShowLangOpener(lang)
425{
426    hhotelShowLang__(window.opener.document, lang);
427    window.close();
428}
429
430function hhotelShowLang__(mydoc, lang)
431{
432    mydoc.idForm.langue.value=lang;
433    var imgLang = hhotelLang2Img(lang);
434    if (imgLang != "") {
435        var formFlag = mydoc.selLgFlag;
436        if (formFlag != null)
437            mydoc.selLgFlag.src= "fastbooking/flags/"+imgLang+".gif";
438        var formFlag = mydoc.selLgTxt;
439        if (formFlag != null)
440            mydoc.selLgTxt.src= "fastbooking/flags/"+imgLang+"lg.gif";
441    }
442}
443
444// FastBooking language and image code
445var FBLangCode = new Array (
446    "uk", "france", "germany", "spain", "portuguese", "italy", "nether", "russian",
447    "dansk", "svensk", "islensk", "norsk", "turk", "hungria", "greek", "arab",
448    "china", "coreen", "japan","croate","czech","poland");
449var FBLangImg = new Array (
450    "grandbret", "france", "germany", "spain", "portuguese", "italy", "nether", "russia",
451    "denmark", "sweeden", "iceland", "norway", "turkey", "hungary", "greek", "arab",
452    "china", "coreen", "japan","croate","czech","poland");
453
454function hhotelLang2Img(lang)
455{
456    for(i = 0; i < FBLangCode.length; i++) {
457        if (FBLangCode[i] == lang)
458            break;
459    }
460    return FBLangImg[i];
461}
462
463function hhotelLangSelector()
464{
465    window.open('fastbooking/flags/langSelector.html', '', 'width=330,height=180');
466}
467
468
469var langcodes = new Array("en", "uk", "fr", "france", "de", "germany", "es", "spain ", "pt", "portuguese", "it", "italy", "nl", "nether", "ja", "japan ", "ko", "coreen", "zh", "china", "ar", "arab", "ru", "russian", "tr", "turk", "el", "greek", "hu", "hungria", "da", "dansk", "sv", "svensk", "is", "islensk", "no", "norsk", "hr", "croate", "cs", "czech", "pl", "poland", "iw", "hebrew");
470
471function selectLang()
472{
473    if(navigator.appName == "Microsoft Internet Explorer") UL = navigator.userLanguage.substring(0, 2);
474    else if(navigator.appName == "Netscape") UL = navigator.language;
475    else return;
476
477    for(i = 0; i < langcodes.length; i += 2)
478        if(UL == langcodes[i])
479            break;
480
481    lang = (i < langcodes.length) ? langcodes[i+1] : "uk";
482    hhotelShowLang(lang);
483}
484
485// date manager ////////////////////////////////////////////
486// build year select
487function build_year_select(thisform) {
488    var cur_date = new Date();
489    var cur_year = takeYear(cur_date);
490
491    cur_y = new Option(cur_year, cur_year, true, true);
492    thisform.fromyear.options[0] = cur_y;
493    if(thisform.toyear != null) {
494        cur_yb = new Option(cur_year, cur_year, true, true);
495        thisform.toyear.options[0] = cur_yb;
496    }
497
498    next_y = new Option(cur_year + 1, cur_year + 1, false, false);
499    thisform.fromyear.options[1] = next_y;
500    next_yb = new Option(cur_year + 1, cur_year + 1, false, false);
501    if(thisform.toyear != null) {
502        thisform.toyear.options[1] = next_yb;
503    }
504}
505
506// check departure date to arrival date + 1 day (every time the arrival date is changed)
507function check_departure() {
508    thisform = document.idForm;
509
510    if(thisform.today == null)
511        return;
512
513    var nbm = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
514
515    var ar_day = parseInt(thisform.fromday.value) + 1;
516    var ar_month = parseInt(thisform.frommonth.value);
517    var ar_year = parseInt(thisform.fromyear.value);
518
519    if(ar_day > nbm[ar_month - 1]) {
520        ar_day = 1;
521        ar_month += 1;
522        if(ar_month > 12) {
523            ar_month = 1;
524            ar_year += 1;
525        }
526    }
527
528    var cur_date = new Date();
529    var cur_year = takeYear(cur_date);
530
531    thisform.today.selectedIndex = ar_day - 1;
532    thisform.tomonth.selectedIndex = ar_month - 1;
533    thisform.toyear.selectedIndex = ar_year - cur_year;
534}
535
536// update departure : check
537function update_departure() {
538    thisform = document.idForm;
539
540    if(thisform.today == null)
541        return;
542
543    var ar_day = parseInt(thisform.fromday.value) + 1;
544    var ar_month = parseInt(thisform.frommonth.value);
545    var ar_year = parseInt(thisform.fromyear.value);
546
547    var de_day = parseInt(thisform.today.value) + 1;
548    var de_month = parseInt(thisform.tomonth.value);
549    var de_year = parseInt(thisform.toyear.value);
550
551    if(de_year < ar_year) {
552        check_departure();
553    } else {
554        if(de_year == ar_year) {
555            if(de_month < ar_month) {
556                check_departure();
557            } else {
558                if(de_month == ar_month) {
559                    if(de_day <= ar_day) {
560                        check_departure();
561                    }
562                }
563            }
564        }
565    }
566}
567
568function takeYear(theDate)
569{
570    x = theDate.getYear();
571    var y = x % 100;
572    y += (y < 38) ? 2000 : 1900;
573    return y;
574}
575
576// popup for quicksearch flash
577function popup(url)
578{
579    fbOpenWindow("", url, "", 1000, 700);
580}
581
582// ages chidren for quick form
583function ageschildren()
584{
585    var age = '';
586    var obj1 = '';
587    var n = document.idForm.enfantresa.options[document.idForm.enfantresa.selectedIndex].value;
588
589    for (i = 1; i<=n; i++)
590    {
591        if (i==1)
592        {
593            obj1 = document.getElementById("agechild"+i);
594            age += obj1.options[obj1.selectedIndex].value;
595        }
596        else
597        {
598            obj1 = document.getElementById("agechild"+i);
599            age += ',';
600            age += obj1.options[obj1.selectedIndex].value;
601        }
602    }
603    document.idForm.childrenAges1.value = age;
604}
605
606

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.