PageSourceSearch

http://rjrvtravels.com/js/hb_custom_core68b3.js

js rjrvtravels.com collected 2026-09-26 05:59:07 UTC 188,902 bytes, 4,063 lines download raw bytes

1var month3Str = [];
2month3Str['01'] = 'Jan';
3month3Str['02'] = 'Feb';
4month3Str['03'] = 'Mar';
5month3Str['04'] = 'Apr';
6month3Str['05'] = 'May';
7month3Str['06'] = 'Jun';
8month3Str['07'] = 'Jul';
9month3Str['08'] = 'Aug';
10month3Str['09'] = 'Sep';
11month3Str['10'] = 'Oct';
12month3Str['11'] = 'Nov';
13month3Str['12'] = 'Dec';
14
15var productCurrency = [];
16productCurrency['$'] = 'USD';
17productCurrency['£'] = 'GBP';
18productCurrency['€'] = 'EUR';
19productCurrency['CAD $'] = 'CAD';
20productCurrency['AUD $'] = 'AUD';
21
22var affiliatePropId = [];
23affiliatePropId['hbbosco'] = '/boston/';
24affiliatePropId['hbchico'] = '/chicago/';
25affiliatePropId['hbnyco'] = '/new-york/';
26affiliatePropId['hbsfco'] = '/san-francisco/';
27affiliatePropId['hblonco'] = '/london/';
28affiliatePropId['hbsdco'] = '/san-diego/';
29affiliatePropId['hbwashdcco'] = '/washington-dc/';
30affiliatePropId['hbbalco'] = '/baltimore/';
31affiliatePropId['hbberco'] = '/berkeley/';
32affiliatePropId['hblbco'] = '/long-beach/';
33affiliatePropId['hbmdrco'] = '/marina-del-rey/';
34affiliatePropId['hbnpbco'] = '/newport-beach/';
35affiliatePropId['hbnorfco'] = '/norfolk/';
36affiliatePropId['hbphico'] = '/philadelphia/';
37affiliatePropId['hbsacco'] = '/sacramento/';
38affiliatePropId['hprcco'] = '/alexandria/';
39affiliatePropId['hbtorco'] = '/toronto/';
40affiliatePropId['hncco'] = '/niagara/';
41affiliatePropId['hbganaco'] = '/gananoque/';
42affiliatePropId['hbpoole'] = '/poole/';
43affiliatePropId['hbyork'] = '/york/';
44affiliatePropId['default'] = '/';
45
46
47var hidePhoneForBrands = []; //['Walks', 'Devour Tours'];
48var allTranslations = ['en','ar','da','de','es','fr','he','hi','it','ja','ko','ms','nl','pt','ru','sw','tr','vi','zh'];
49
50var ceAlertBannerJson = { 
51	"/" : { 
52		title: 'Homepage',
53		property_id: 'hbcorp'
54	},
55	"/alexandria/city-cruises/" : { 
56		title: 'Alexandria',
57		property_id: 'halxndra'
58	},
59	"/baltimore/" : { 
60		title: 'Baltimore',
61		property_id: 'hbbalco'
62	},
63	"/berkeley/" : { 
64		title: 'Berkeley',
65		property_id: 'hbberco'
66	},
67	"/boston/" : { 
68		title: 'Boston',
69		property_id: 'hbbosco'
70	},
71	"/chicago/" : { 
72		title: 'Chicago',
73		property_id: 'hbchico'
74	},
75	"/gananoque/" : { 
76		title: 'Gananoque',
77		property_id: 'hbganaco'
78	},
79	"/london/" : { 
80		title: 'London',
81		property_id: 'hblonco'
82	},
83	"/long-beach/" : { 
84		title: 'Long Beach',
85		property_id: 'hblbco'
86	},
87	"/marina-del-rey/" : { 
88		title: 'Marina del Rey',
89		property_id: 'hbmdrco'
90	},
91	"/newport-beach/" : { 
92		title: 'Newport Beach',
93		property_id: 'hbnpbco'
94	},
95	"/new-jersey/" : { 
96		title: 'New Jersey',
97		property_id: 'hbnjco'
98	},
99	"/new-york/" : { 
100		title: 'New York',
101		property_id: 'hbnyco'
102	},
103	"/new-orleans/" : { 
104		title: 'New Orleans',
105		property_id: 'hwlkusla'
106	},
107	"/niagara/" : { 
108		title: 'Niagara',
109		property_id: 'hncco'
110	},
111	"/norfolk/" : { 
112		title: 'Norfolk',
113		property_id: 'hbnorfco'
114	},
115	"/philadelphia/" : { 
116		title: 'Philadelphia',
117		property_id: 'hbphico'
118	},
119	"/poole/" : { 
120		title: 'Poole',
121		property_id: 'hbpoole'
122	},
123	"/sacramento/" : { 
124		title: 'Sacramento',
125		property_id: 'hbsacco'
126	},
127	"/san-diego/" : { 
128		title: 'San Diego',
129		property_id: 'hbsdco'
130	},
131	"/san-francisco/" : { 
132		title: 'San Francisco',
133		property_id: 'hbsfco'
134	},
135	"/toronto/" : { 
136		title: 'Toronto',
137		property_id: 'hbtorco'
138	},
139	"/washington-dc/" : { 
140		title: 'Washington DC',
141		property_id: 'hbwashdcco'
142	},
143	"/york/" : { 
144		title: 'York',
145		property_id: 'hbyork'
146	},
147	"/san-francisco/city-cruises/alcatraz/" : { 
148		title: 'Alcatraz Cruise',
149		property_id: 'hacco'
150	},
151	"/new-york/city-cruises/statue/" : { 
152		title: 'Statue Cruise',
153		property_id: 'hstatueco'
154	}
155}
156
157var ukGeoPortList = ['hbyork','hbpoole','hblonco','loncityex'];
158var isUkGeoPort = false;
159
160var hbCityLandingPage = [{
161		"city": "Sacramento",
162		"hasCityLandingPage": true,
163		"city_url": "/sacramento/"
164	},
165	{
166		"city": "San Francisco",
167		"hasCityLandingPage": true,
168		"city_url": "/san-francisco/"
169	},
170	{
171		"city": "Vatican City",
172		"hasCityLandingPage": false,
173		"city_url": ""
174	},
175	{
176		"city": "London (Central)",
177		"hasCityLandingPage": true,
178		"city_url": "/london/"
179	},
180	{
181		"city": "Boston",
182		"hasCityLandingPage": true,
183		"city_url": "/boston/"
184	},
185	{
186		"city": "Chicago",
187		"hasCityLandingPage": true,
188		"city_url": "/chicago/"
189	},
190	{
191		"city": "Washington DC",
192		"hasCityLandingPage": true,
193		"city_url": "/washington-dc/"
194	},
195	{
196		"city": "San Diego",
197		"hasCityLandingPage": true,
198		"city_url": "/san-diego/"
199	},
200	{
201		"city": "Philadelphia",
202		"hasCityLandingPage": true,
203		"city_url": "/philadelphia/"
204	},
205	{
206		"city": "Weehawken",
207		"hasCityLandingPage": true,
208		"city_url": "/weehawken/"
209	},
210	{
211		"city": "Baltimore",
212		"hasCityLandingPage": true,
213		"city_url": "/baltimore/"
214	},
215	{
216		"city": "New York City",
217		"hasCityLandingPage": true,
218		"city_url": "/new-york/"
219	},
220	{
221		"city": "Madrid",
222		"hasCityLandingPage": true,
223		"city_url": "/madrid/"
224	},
225	{
226		"city": "St. Petersburg",
227		"hasCityLandingPage": false,
228		"city_url": ""
229	},
230	{
231		"city": "Poole",
232		"hasCityLandingPage": true,
233		"city_url": "/poole/"
234	},
235	{
236		"city": "Norfolk",
237		"hasCityLandingPage": true,
238		"city_url": "/norfolk/"
239	},
240	{
241		"city": "Orlando",
242		"hasCityLandingPage": false,
243		"city_url": ""
244	},
245	{
246		"city": "London (Central)",
247		"hasCityLandingPage": true,
248		"city_url": "/london/"
249	},
250	{
251		"city": "York",
252		"hasCityLandingPage": true,
253		"city_url": "/york/"
254	},
255	{
256		"city": "Marina del Rey",
257		"hasCityLandingPage": true,
258		"city_url": "/marina-del-rey/"
259	},
260	{
261		"city": "Charleston",
262		"hasCityLandingPage": false,
263		"city_url": ""
264	},
265	{
266		"city": "Miami",
267		"hasCityLandingPage": false,
268		"city_url": ""
269	},
270	{
271		"city": "Long Beach",
272		"hasCityLandingPage": true,
273		"city_url": "/long-beach/"
274	},
275	{
276		"city": "Berkeley",
277		"hasCityLandingPage": true,
278		"city_url": "/berkeley/"
279	},
280	{
281		"city": "Toronto",
282		"hasCityLandingPage": true,
283		"city_url": "/toronto/"
284	},
285	{
286		"city": "Rome",
287		"hasCityLandingPage": true,
288		"city_url": "/rome/"
289	},
290	{
291		"city": "Newport Beach",
292		"hasCityLandingPage": true,
293		"city_url": "/newport-beach/"
294	},
295	{
296		"city": "Barcelona",
297		"hasCityLandingPage": true,
298		"city_url": "/barcelona/"
299	},
300	{
301		"city": "Key West",
302		"hasCityLandingPage": false,
303		"city_url": ""
304	},
305	{
306		"city": "Los Angeles",
307		"hasCityLandingPage": false,
308		"city_url": ""
309	},
310	{
311		"city": "Gananoque",
312		"hasCityLandingPage": true,
313		"city_url": "/gananoque/"
314	},
315	{
316		"city": "Paris",
317		"hasCityLandingPage": true,
318		"city_url": "/paris/"
319	},
320	{
321		"city": "Athens",
322		"hasCityLandingPage": false,
323		"city_url": ""
324	},
325	{
326		"city": "St. Augustine",
327		"hasCityLandingPage": false,
328		"city_url": ""
329	},
330	{
331		"city": "Port Everglades",
332		"hasCityLandingPage": false,
333		"city_url": ""
334	},
335	{
336		"city": "Venice",
337		"hasCityLandingPage": true,
338		"city_url": "/venice/"
339	},
340	{
341		"city": "Seattle",
342		"hasCityLandingPage": false,
343		"city_url": ""
344	},
345	{
346		"city": "Seville",
347		"hasCityLandingPage": false,
348		"city_url": "/seville/devour-tours/"
349	},
350	{
351		"city": "Tampa",
352		"hasCityLandingPage": false,
353		"city_url": ""
354	},
355	{
356		"city": "San Jose",
357		"hasCityLandingPage": false,
358		"city_url": ""
359	},
360	{
361		"city": "Milan",
362		"hasCityLandingPage": false,
363		"city_url": ""
364	},
365	{
366		"city": "Florence",
367		"hasCityLandingPage": false,
368		"city_url": ""
369	},
370	{
371		"city": "Austin",
372		"hasCityLandingPage": false,
373		"city_url": ""
374	},
375	{
376		"city": "San Sebastian",
377		"hasCityLandingPage": false,
378		"city_url": ""
379	},
380	{
381		"city": "Jersey City",
382		"hasCityLandingPage": true,
383		"city_url": "/jersey-city/"
384	},
385	{
386		"city": "New Orleans",
387		"hasCityLandingPage": true,
388		"city_url": "/new-orleans/"
389	},
390	{
391		"city": "Napa",
392		"hasCityLandingPage": false,
393		"city_url": ""
394	},
395	{
396		"city": "Niagara Falls (CA)",
397		"hasCityLandingPage": true,
398		"city_url": "/niagara/"
399	},
400	{
401		"city": "Niagara Falls (US)",
402		"hasCityLandingPage": true,
403		"city_url": "/niagara-us/city-cruises/niagara-jet/"
404	},						 
405	{
406		"city": "Lisbon",
407		"hasCityLandingPage": false,
408		"city_url": ""
409	},
410	{
411		"city": "Palm Beach",
412		"hasCityLandingPage": false,
413		"city_url": ""
414	},
415	{
416		"city": "London Bridge",
417		"hasCityLandingPage": true,
418		"city_url": "/london/"
419	},
420	{
421		"city": "Pompeii",
422		"hasCityLandingPage": false,
423		"city_url": ""
424	},
425	{
426		"city": "Dallas",
427		"hasCityLandingPage": false,
428		"city_url": ""
429	},
430	{
431		"city": "Las Vegas",
432		"hasCityLandingPage": false,
433		"city_url": ""
434	},
435	{
436		"city": "Provincetown",
437		"hasCityLandingPage": true,
438		"city_url": "/boston/city-cruises/provincetown-ferry/"
439	},
440	{
441		"city": "Cape Cod",
442		"hasCityLandingPage": true,
443		"city_url": "/boston/city-cruises/provincetown-ferry/"
444	},
445	{
446		"city": "City Cruises (all)",
447		"hasCityLandingPage": true,
448		"city_url": "/city-cruises/"
449	}
450];
451
452var hbPortPhoneNumber = [
453	{
454		"name": "Main Page",
455		"path" : "/",
456		"phone": "800-459-8105",
457		"phoneToDial": "800-459-8105",
458		"sms":"833-997-5300",
459		"id": "",
460		"hideIcon": false
461	},
462	{
463		"name": "City Cruises Live",
464		"path" : "/city-cruises/live/",
465		"phone": "888-741-0285",
466		"phoneToDial": "888-741-0285",
467		"sms":"",
468		"id": "",
469		"hideIcon": false
470	},
471	{
472		"name": "Alcatraz",
473		"path" : "/san-francisco/city-cruises/alcatraz/",
474		"phone": "877-443-5547",
475		"phoneToDial": "877-443-5547",
476		//"sms":"833-416-2577",
477		"id": "hacco",
478		"hideIcon": false
479	},
480	{
481		"name": "Alexandria",
482		"path" : "/alexandria/",
483		//"phone": "866-302-2469",
484		//"phoneToDial": "866-302-2469",
485		"phone": "202-804-7577",
486		"phoneToDial": "202-804-7577",
487		"sms":"833-997-5254",
488		"id": "halxndra",
489		"hideIcon": false
490	},
491	{
492		"name": "Baltimore",
493		"path" : "/baltimore/",
494		"phone": "866-312-2469",
495		"phoneToDial": "866-312-2469",
496		"sms":"833-550-4024",
497		"id": "hbbalco",
498		"hideIcon": false
499	},
500	{
501		"name": "Berkeley",
502		"path" : "/berkeley/",
503		"phone": "800-668-4322",
504		"phoneToDial": "800-668-4322",
505		"sms":"833-997-5258",
506		"id": "hbberco",
507		"hideIcon": false
508	},
509	{
510		"name": "Boston",
511		"path" : "/boston/",
512		"phone": "866-307-2469",
513		"phoneToDial": "866-307-2469",
514		"sms":"833-997-5299",
515		"id": "hbbosco",
516		"hideIcon": false
517	},
518	{
519		"name": "Chicago",
520		"path" : "/chicago/",
521		//"phone": "888-957-2634",
522		//"phoneToDial": "888-957-2634",
523		"phone": "312-815-1798",
524		"phoneToDial": "312-815-1798",
525		"sms":"833-997-5256",
526		"id": "hbchico",
527		"hideIcon": false
528	},
529	{
530		"name": "Gananoque",
531		"path" : "/gananoque/",
532		"phone": "888-717-4837",
533		"phoneToDial": "888-717-4837",
534		"sms":"833-997-5298",
535		"id": "hbganaco",
536		"hideIcon": false
537	},
538	{
539		"name": "Greater Washington",
540		"path" : "/washington-dc/",
541		//"phone": "866-302-2469",
542		//"phoneToDial": "866-302-2469",
543		"phone": "771-223-5700",
544		"phoneToDial": "771-223-5700",
545		"sms":"833-997-5254",
546		"id": "hbwashdcco",
547		"hideIcon": false
548	},
549	{
550		"name": "Long Beach",
551		"path" : "/long-beach/",
552		"phone": "877-846-8278",
553		"phoneToDial": "877-846-8278",
554		"sms":"833-997-5261",
555		"id": "hblbco",
556		"hideIcon": false
557	},
558	{
559		"name": "Marina del Rey",
560		"path" : "/marina-del-rey/",
561		"phone": "855-594-7226",
562		"phoneToDial": "855-594-7226",
563		"sms":"833-997-5260",
564		"id": "hbmdrco",
565		"hideIcon": false
566	},
567	{
568		"name": "Newport Beach",
569		"path" : "/newport-beach/",
570		"phone": "855-559-3569",
571		"phoneToDial": "855-559-3569",
572		"sms":"833-997-5262",
573		"id": "hbnpbco",
574		"hideIcon": false
575	},
576	{
577		"name": "New York",
578		"path" : "/new-york/",
579		//"phone": "855-647-9714",
580		//"phoneToDial": "855-647-9714",
581		"phone": "646-566-1380",
582		"phoneToDial": "646-566-1380",
583		"sms":"833-997-5297",
584		"id": "hbnyco",
585		"hideIcon": false
586	},
587	{
588		"name": "Weehawken",
589		"path" : "/weehawken/",
590		"phone": "855-647-9714",
591		"phoneToDial": "855-647-9714",
592		"sms":"833-997-5297",
593		"id": "hbnyco",
594		"hideIcon": false
595	},
596	{
597		"name": "Jersey City",
598		"path" : "/new-jersey/",
599		"phone": "855-647-9714",
600		"phoneToDial": "855-647-9714",
601		"sms":"833-997-5297",
602		"id": "hbnyco",
603		"hideIcon": false
604	},
605	{
606		"name": "Norfolk",
607		"path" : "/norfolk/",
608		"phone": "866-304-2469",
609		"phoneToDial": "866-304-2469",
610		"sms":"833-997-5255",
611		"id": "hbnorfco",
612		"hideIcon": false
613	},
614	{
615		"name": "Philadelphia",
616		"path" : "/philadelphia/",
617		"phone": "866-455-3866",
618		"phoneToDial": "866-455-3866",
619		"sms":"833-550-3975",
620		"id": "hbphico",
621		"hideIcon": false
622	},
623	{
624		"name": "Paris",
625		"path" : "/paris/",
626		"phone": "0044 1513 081772",
627		"phoneToDial": "+44 1513 081772",
628		"id": "hwlkfr",
629		"hideIcon": false
630	},
631	{
632		"name": "Rome",
633		"path" : "/rome/",
634		"phone": "0044 1513 081772",
635		"phoneToDial": "+44 1513 081772",
636		"id": "hwlkit",
637		"hideIcon": false
638	},
639	{
640		"name": "Vatican City",
641		"path" : "/vatican-city/",
642		"phone": "0044 1513 081772",
643		"phoneToDial": "+44 1513 081772",
644		"id": "hwlkit",
645		"hideIcon": false
646	},
647	{
648		"name": "Sacramento",
649		"path" : "/sacramento/",
650		"phone": "877-467-2846",
651		"phoneToDial": "877-467-2846",
652		"sms":"833-997-5259",
653		"id": "hbsacco",
654		"hideIcon": false
655	},
656	{
657		"name": "San Diego",
658		"path" : "/san-diego/",
659		//"phone": "855-552-9059",
660		//"phoneToDial": "855-552-9059",
661		"phone": "619-333-7192",
662		"phoneToDial": "619-333-7192",
663		"sms":"833-997-5263",
664		"id": "hbsdco",
665		"hideIcon": false
666	},
667	{
668		"name": "San Francisco",
669		"path" : "/san-francisco/",
670		"phone": "888-467-6256",
671		"phoneToDial": "888-467-6256",
672		"sms":"833-997-5257",
673		"id": "hbsfco",
674		"hideIcon": false
675	},
676	{
677		"name": "Statue",
678		"path" : "/new-york/city-cruises/statue/",
679		"phone": "877-523-9849",
680		"phoneToDial": "877-523-9849",
681		"sms":"833-528-0792",
682		"id": "hstatueco",
683		"hideIcon": false
684	},
685	{
686		"name": "Toronto",
687		"path" : "/toronto/",
688		"phone": "416-203-0178",
689		"phoneToDial": "416-203-0178",
690		"sms":"833-997-5296",
691		"id": "hbtorco",
692		"hideIcon": false
693	},
694	{
695		"name": "Venice",
696		"path" : "/venice/",
697		"phone": "0044 1513 081772",
698		"phoneToDial": "+44 1513 081772",
699		"id": "hwlkit",
700		"hideIcon": false
701	},
702	{
703		"name": "London",
704		"path" : "/london/",
705		"phone": "44 207 7400 400",
706		"phoneToDial": "+44 207 7400 400",
707		"id": "hblonco",
708		"hideIcon": false
709	},
710	{
711		"name": "Poole",
712		"path" : "/poole/",
713		"phone": "44 207 7400 400",
714		"phoneToDial": "+44 207 7400 400",
715		"id": "hbpoole",
716		"hideIcon": false
717	},
718	{
719		"name": "York",
720		"path" : "/york/",
721		"phone": "44 207 7400 400",
722		"phoneToDial": "+44 207 7400 400",
723		"id": "hbyork",
724		"hideIcon": false
725	},
726	{
727		"name": "UK Info",
728		"path" : "/uk-information/",
729		"phone": "0207 7400 400",
730		"phoneToDial": "+44 207 7400 400",
731		"id": "",
732		"hideIcon": false
733	},
734	{
735		"name": "UK City Cruises",
736		"path" : "/uk/city-cruises/",
737		"phone": "0207 7400 400",
738		"phoneToDial": "+44 207 7400 400",
739		"id": "",
740		"hideIcon": false
741	},
742	{
743		"name": "Niagara Homepage",
744		"path" : "/niagara/",
745		"phone": "855-264-2427",
746		"phoneToDial": "855-264-2427",
747		"id": "",
748		"hideIcon": false
749	},
750	{
751		"name": "Niagara CA",
752		"path" : "/niagara-ca/",
753		"phone": "855-264-2427",
754		"phoneToDial": "855-264-2427",
755		"id": "hncco",
756		"hideIcon": false
757	},
758	{
759		"name": "Pool Private Hire",
760		"path" : "/poole/city-cruises/private-hire/",
761		"phone": "07483 038487",
762		"phoneToDial": "+44 7483 038487",
763		"id": "hbpoole",
764		"hideIcon": false
765	},
766	{
767		"name": "Niagara Jet",
768		"path" : "/niagara-us/city-cruises/niagara-jet/",
769		"phone": "716-745-7121",
770		"phoneToDial": "716-745-7121",
771		"id": "",
772		"hideIcon": false
773	},
774	{
775		"name": "Bordeaux",
776		"path" : "/bordeaux/",
777		"phone": "0044 1513 081772",
778		"phoneToDial": "+44 1513 081772",
779		"id": "",
780		"hideIcon": false
781	},
782	{
783		"name": "Athens",
784		"path" : "/athens/",
785		"phone": "0044 1513 081772",
786		"phoneToDial": "+44 1513 081772",
787		"id": "",
788		"hideIcon": false
789	},
790	{
791		"name": "Lisbon",
792		"path" : "/lisbon/",
793		"phone": "0044 1513 081772",
794		"phoneToDial": "+44 1513 081772",
795		"id": "",
796		"hideIcon": false
797	},
798	{
799		"name": "Bologna",
800		"path" : "/bologna/",
801		"phone": "0044 1513 081772",
802		"phoneToDial": "+44 1513 081772",
803		"id": "",
804		"hideIcon": false
805	},
806	{
807		"name": "Milan",
808		"path" : "/milan/",
809		"phone": "0044 1513 081772",
810		"phoneToDial": "+44 1513 081772",
811		"id": "",
812		"hideIcon": false
813	},
814	{
815		"name": "Naples",
816		"path" : "/naples/",
817		"phone": "0044 1513 081772",
818		"phoneToDial": "+44 1513 081772",
819		"id": "",
820		"hideIcon": false
821	},
822	{
823		"name": "Pompeii",
824		"path" : "/pompeii/",
825		"phone": "0044 1513 081772",
826		"phoneToDial": "+44 1513 081772",
827		"id": "",
828		"hideIcon": false
829	},
830	{
831		"name": "Amsterdam",
832		"path" : "/amsterdam/",
833		"phone": "0044 1513 081772",
834		"phoneToDial": "+44 1513 081772",
835		"id": "",
836		"hideIcon": false
837	},
838	{
839		"name": "Dublin",
840		"path" : "/dublin/",
841		"phone": "0044 1513 081772",
842		"phoneToDial": "+44 1513 081772",
843		"id": "",
844		"hideIcon": false
845	},
846	{
847		"name": "San Sebastian",
848		"path" : "/san-sebastian/",
849		"phone": "0044 1513 081772",
850		"phoneToDial": "+44 1513 081772",
851		"id": "",
852		"hideIcon": false
853	},
854    {
855		"name": "Seville",
856		"path" : "/seville/",
857		"phone": "0044 1513 081772",
858		"phoneToDial": "+44 1513 081772",
859		"id": "",
860		"hideIcon": false
861	},
862    {
863		"name": "Florence",
864		"path" : "/florence/",
865		"phone": "0044 1513 081772",
866		"phoneToDial": "+44 1513 081772",
867		"id": "",
868		"hideIcon": false
869	},
870    {
871		"name": "Barcelona",
872		"path" : "/barcelona/",
873		"phone": "0044 1513 081772",
874		"phoneToDial": "+44 1513 081772",
875		"id": "",
876		"hideIcon": false
877	},
878    {
879		"name": "Madrid",
880		"path" : "/madrid/",
881		"phone": "0044 1513 081772",
882		"phoneToDial": "+44 1513 081772",
883		"id": "",
884		"hideIcon": false
885	},
886];
887
888
889
890
891var propsUseFrontendV2 = ['hstatueco', 'hbnyco', 'hbbalco', 'hbberco', 'hbbosco', 'hbchico', 'hbganaco', 'hbhcco', 'hblbco', 'hblonco', 'hbmdrco', 'hbnorfco', 'hbnpbco', 'hbphico', 'hbpoole', 'hbsacco', 'hbsdco', 'hbsdogco', 'hbsfco', 'hbtorco', 'hbwashdcco', 'hbyork', 'hacco', 'hncco', 'hprcco'];
892
893function postToTealiumAfterloaded(mode, data, retry=5) {
894	retry--;
895	if (typeof utag === 'undefined' && retry > 0) {
896		//console.log('utag-not-loaded');
897		setTimeout(function() { postToTealiumAfterloaded(mode, data, retry) }, 1000);
898	} else if (typeof utag !== 'undefined') {
899		//console.log('utag-loaded');
900		if(mode === 'view') {
901			utag.view(data);
902			//console.log('utag-view-sent', data);
903		}
904	}
905}
906
907var selected_currency = '';
908function getCurrentCurrency() {
909	var initState = getCookie('hb-currency') === '';
910	var defaultCurrency = 'USD';
911	var urlMode = getUrlParam('mode','');
912	initState = urlMode === 'no-checkout' ? false : initState;
913	if(false && initState) {
914		jQuery.get( 'https://my.hornblower.com/api/nearbyCities?idx=ventureashore' + overrideLatLonForNearbyCity(), function( portList ) {
915			console.log('portList',portList);
916			selected_currency = portList.length > 0 ? portList[0].currency : defaultCurrency;
917			setCookie("hb-currency", selected_currency, 1);
918			window.location = window.location;
919			console.log('selected_currency', selected_currency);
920			return selected_currency;
921		});
922
923	} else {
924		selected_currency = selected_currency || (getCookie('hb-currency') !== '' ? getCookie('hb-currency') : null) || defaultCurrency;
925		if(typeof setCookie_performance === 'function') {
926			setCookie_performance("hb-currency", selected_currency, 1);
927		} else {
928			setTimeout(function() { waitForCookiePerformanceToLoad(setHbCurrency, selected_currency, 1) }, 2000);
929		}
930		return selected_currency;
931	}
932}
933
934var mkInlineStyles = {
935	".RecommendedTourPrice": {
936		fontSize: "14px",
937		color: "rgba(0, 0, 0, 0.87)"
938	},
939	".RecommendedTourTitle": {
940		color: "rgba(0, 0, 0, 0.87) !important"
941	},
942	".removeIconColor": {
943		color: "rgba(0, 0, 0, 0.87) !important;"
944	},
945	".addOnsCartButton": {
946		backgroundColor: "#177998",
947		color: "#FFFFFF !important"
948	},
949	".addOnsCartButton:hover": {
950		backgroundColor: "#177998",
951		color: "#FFFFFF !important"
952	},
953	".listItemMKLayout": {
954      "padding-left": "0px"
955    },
956    ".summaryTitleMKLayout": {
957      "text-align": "center",
958      "color": "rgba(0, 0, 0, 0.87)"
959    },
960	".addOnsCartButton": {
961		"backgroundColor": "#146FF8 !important",
962		"color": "#FFFFFF !important",
963		"textTransform": "capitalize !important"
964	},
965	".checkoutButtonLayout": {
966		"backgroundColor": "#146FF8 !important",
967		"fontFamily": "Rubik !important",
968		"fontWeight": "500 !important"
969	},
970	".bottomLeftCta": {
971		"backgroundColor": "#146FF8 !important",
972		"textTransform": "capitalize !important"
973	}
974};
975
976var myCheckTopNavTimeout;
977var myCheckTopNavCount = 0;
978
979function checkTopNavSearchXp() {
980	var found = jQuery('.activate-searchxp.statue-cruises #search-autocomplete-top input.searchBoxInput').length > 0;
981	var found2 = jQuery('.activate-searchxp.statue-cruises #search-autocomplete-mobile input.searchBoxInput').length > 0;
982	var found3 = jQuery('.activate-searchxp.statue-cruises #search-autocomplete-onhomepage input.searchBoxInput').length > 0;
983	//console.log('found-xp', found, myCheckTopNavCount, jQuery('.activate-searchxp.statue-cruises #search-autocomplete-top input.searchBoxInput'));
984	myCheckTopNavCount++;
985	if(found) {
986		jQuery('.activate-searchxp.statue-cruises #search-autocomplete-top input.searchBoxInput').attr('placeholder', 'Search');
987	}
988	if(found2) {
989		jQuery('.activate-searchxp.statue-cruises #search-autocomplete-mobile input.searchBoxInput').attr('placeholder', 'Search');
990	}
991	if(found3) {
992		jQuery('.activate-searchxp.statue-cruises #search-autocomplete-onhomepage input.searchBoxInput').attr('placeholder', 'Search');
993	}
994	if(found && found2 && found3) {
995		myCheckTopNavCount = 6;
996	}
997	if(myCheckTopNavCount > 5) {
998		//console.log('clearing-xp');
999		clearInterval(myCheckTopNavTimeout);
1000	}
1001}
1002
1003function getPageTranslation() {
1004    var thisPath = window.location.pathname.split('/').filter(Boolean);
1005    if(thisPath.length === 0) {
1006		//console.log('getPageTranslation-length-0')
1007        return 'en';
1008    } else {
1009        if(allTranslations.includes(thisPath[0])) {
1010			//console.log('getPageTranslation-includes', thisPath[0])
1011            return thisPath[0];
1012        } else {
1013			//console.log('getPageTranslation-not-includes', thisPath[0])
1014            return 'en';
1015        }
1016    }
1017}
1018
1019function setHbCurrency(selected_currency, numDay) {
1020	//console.log('hb-currency-loaded');
1021	setCookie_performance("hb-currency", selected_currency, numDay);
1022}
1023
1024function setIsUkGeoPort(isUkGeoPort, numDay) {
1025	//console.log('isUkGeoPort-loaded');
1026	setCookie_performance('isUkGeoPort', isUkGeoPort, numDay)
1027}
1028
1029function waitForCookiePerformanceToLoad(arg1, arg2, arg3, arg4, arg5) {
1030	if(typeof setCookie_performance === 'function') {
1031		arg1(arg2, arg3, arg4, arg5);
1032	} else {
1033		setTimeout(function() { waitForCookiePerformanceToLoad(arg1, arg2, arg3, arg4, arg5) }, 2000);
1034	}
1035}
1036
1037function addOnClickAnchorFilter(id) {
1038	jQuery( '#' + id + ' a.anchor-to-filter' ).on('click', function(e) {
1039		jQuery( '#' + id + ' a.anchor-to-filter' ).removeClass('selected');
1040		jQuery(this).addClass('selected');
1041        e.preventDefault();
1042		var thisTerm = jQuery(this).attr('data-term');
1043		console.log('thisTerm', thisTerm);
1044		jQuery('#' + id + ' ul.glisting li.glisting-item').each(function(e) {
1045			if(jQuery(this).hasClass(thisTerm)) {
1046				jQuery(this).removeClass('hide');
1047			} else {
1048				jQuery(this).addClass('hide');				
1049			}
1050		});
1051    });
1052}
1053
1054function addOnClickAnchor(id) {
1055    jQuery( '#' + id + ' a.anchor-to-deck' ).on('click', function(e) {
1056        e.preventDefault();
1057        if (this.hash !== "") {
1058            //console.log('jQuery(this.hash)',this.hash);
1059            goToAnchor(this.hash);
1060            /*jQuery('html, body').animate({
1061                scrollTop: jQuery(this.hash).offset().top - document.getElementById('masthead').offsetHeight - 50
1062            }, 800, function(e){
1063            });*/
1064        }
1065    });
1066}
1067
1068function getTodayDate() {
1069    var today = new Date();
1070    var dd = String(today.getDate()).padStart(2, '0');
1071    var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
1072    var yyyy = today.getFullYear();
1073
1074    return mm + '/' + dd + '/' + yyyy;
1075}
1076
1077function getTodayDateOrUrlParam(urlParam,format) {
1078    var selUrlParam = decodeURIComponent(getUrlParam(urlParam,''));
1079    var today = new Date();
1080    var dd = String(today.getDate()).padStart(2, '0');
1081    var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
1082    var yyyy = today.getFullYear();
1083	//console.log('format',format);
1084	var thisDateStr = mm + '/' + dd + '/' + yyyy;
1085	if(format !== undefined && format === 'YYYYMMDD') {
1086		thisDateStr = yyyy + '' + mm + dd;
1087	} else if(format !== undefined && format === 'DD MMM YYYY') {
1088		thisDateStr = dd + '' + month3Str[mm] + yyyy;
1089	}
1090    return selUrlParam.length ? selUrlParam : thisDateStr;
1091}
1092
1093function getUrlVars() {
1094    var vars = {};
1095    var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
1096        vars[key] = value;
1097    });
1098	//console.log('vars',vars);
1099    return vars;
1100}
1101
1102function getUrlParam(parameter, defaultvalue){
1103    var urlparameter = defaultvalue;
1104	//console.log('defaultvalue',defaultvalue);
1105    if(window.location.href.indexOf(parameter) > -1){
1106        urlparameter = getUrlVars()[parameter] || defaultvalue;
1107    }
1108	//console.log('urlparameter',urlparameter);
1109    return urlparameter;
1110}
1111
1112function parseUrlParams(str) {
1113	var urlParams = [];
1114	return urlParams;
1115}
1116
1117function getLinkerParam() {
1118	if (typeof(window["ga"]) !== "undefined" && typeof(window["ga"]["getAll"]) !== "undefined") {
1119		var firstTracker = window.ga.getAll()[0];
1120		if (firstTracker) {
1121			var linker_parameter = firstTracker.get("linkerParam");
1122			var linker_param_value = (linker_parameter||'').split('=');
1123			return linker_param_value.length > 1 ? linker_param_value[1] : null;
1124		}
1125	}
1126
1127	return null;
1128}
1129
1130function getOneTrustSettings(myObj) {
1131	var otFlag = getUrlParam('ot') === '1' || true;
1132	var otEnabled = otFlag ? true : false;
1133	var otCookieConsent = otFlag ? (getCookie('OptanonConsent') || '').split('&').filter(Boolean) : [];
1134	for(var i = 0; i < otCookieConsent.length; i++ ) {
1135		var eachOt = otCookieConsent[i].split('=');
1136		if(eachOt[0] === 'groups') {
1137			var groupArr = decodeURIComponent(eachOt[1]).split(',');
1138			//console.log('groupArr', groupArr);
1139			for( var j = 0; j < groupArr.length; j++ ) {
1140				var eachOt = groupArr[j].split(':');
1141				//console.log('eachOt', eachOt);
1142				if(eachOt[0] === 'C0002' && eachOt[1] === '1') {
1143					otEnabled = false;
1144				}
1145			}
1146		}
1147	}
1148	//console.log('getOneTrustSettings', otEnabled, otCookieConsent);
1149	//var otEnabled = ( typeof otPerformanceEnabled === 'undefined' || (typeof otPerformanceEnabled !== 'undefined' && !otPerformanceEnabled) ) ? false : true;
1150	//console.log('getOneTrustSettings', otEnabled, typeof otPerformanceEnabled === 'undefined', typeof otPerformanceEnabled !== 'undefined', !otPerformanceEnabled);
1151	//console.log('final-output', otEnabled);
1152	myObj.oneTrustCookiesCheckEnabled = otEnabled;
1153}
1154
1155function setCookie(cname, cvalue, exdays) {
1156    var d = new Date();
1157    d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
1158    var expires = "expires="+d.toUTCString();
1159	var cookieStr = cname + "=" + cvalue + ";" + expires + ";domain=.cityexperiences.com;path=/";
1160	var devCookieStr = '';
1161	var liveCookieStr = '';
1162    document.cookie = cookieStr;
1163	if(cname === 'googtrans') {
1164		devCookieStr = cname + "=" + cvalue + ";" + expires + ";path=/";
1165    	document.cookie = devCookieStr;
1166	}
1167	//console.log(cookieStr);
1168}
1169
1170function getCookie(cname) {
1171    var name = cname + "=";
1172    var ca = document.cookie.split(';');
1173    for(var i = 0; i < ca.length; i++) {
1174        var c = ca[i];
1175        while (c.charAt(0) == ' ') {
1176            c = c.substring(1);
1177        }
1178        if (c.indexOf(name) == 0) {
1179            return c.substring(name.length, c.length);
1180        }
1181    }
1182    return "";
1183}
1184
1185function checkCookie() {
1186    var user = getCookie("username");
1187    if (user != "") {
1188        alert("Welcome again " + user);
1189    } else {
1190        user = prompt("Please enter your name:", "");
1191        if (user != "" && user != null) {
1192            setCookie("username", user, 365);
1193        }
1194    }
1195}
1196
1197function getCartMode() {
1198	return true;
1199	if(false)
1200		return parseInt(getUrlParam('cart',0)) === 1;
1201	else
1202		return window.location.pathname.match('/chicago/') || window.location.pathname.match('/boston/') || window.location.pathname.match('/san-diego/') || window.location.pathname.match('/london/') || window.location.pathname.match('/experiences/');
1203}
1204
1205function isJson(str) {
1206    try {
1207        JSON.parse(str);
1208    } catch (e) {
1209        return false;
1210    }
1211    return true;
1212}
1213
1214function anchorCartChange(itemsTotal) {
1215	// get cart DOM element by ID
1216	//const cartIcon = document.getElementById('someId');
1217	if(itemsTotal > 0) {
1218		jQuery('span.cart-item').addClass('has-item');
1219		jQuery('span.cart-item').html(itemsTotal);
1220	} else {
1221		jQuery('span.cart-item').removeClass('has-item');
1222		jQuery('span.cart-item').html('');
1223	}
1224	//setCookie("cart_total", itemsTotal, 1);
1225}
1226
1227function getCartInfo() {
1228	var anchorMetaStr = decodeURIComponent(getCookie('_anchorcidmeta'));
1229	var anchorMeta = isJson(anchorMetaStr) ? JSON.parse(anchorMetaStr) : { };
1230	return anchorMeta;
1231}
1232
1233function getCartCount() {
1234	//var count = getCookie('cart_total') === '' ? 0 : getCookie('cart_total');
1235	var anchorMetaStr = decodeURIComponent(getCookie('_anchorcidmeta'));
1236	//console.log('anchorMetaStr', anchorMetaStr, isJson(anchorMetaStr));
1237	var anchorMeta = isJson(anchorMetaStr) ? JSON.parse(anchorMetaStr) : { };
1238	var count = anchorMeta.totalItems !== undefined ? anchorMeta.totalItems : 0;
1239	//console.log('getCartCount', anchorMeta, count);
1240	return anchorMeta.totalItems !== undefined ? anchorMeta.totalItems : 0;
1241}
1242
1243function searchPhoneNumberByPath() {
1244	var selectedPhone = {
1245		"name": "Main Page",
1246		"phone": "800-459-8105",
1247		"sms": "",
1248		"path": "/",
1249		"id": ""
1250	}
1251	var foundLen = 0;
1252	for( var idx = 0; idx < hbPortPhoneNumber.length; idx++ ) {
1253		var thisPortNumber = hbPortPhoneNumber[idx];
1254		var thisPathName = hbPortPhoneNumber[idx].path;
1255		var found = location.pathname.match(hbPortPhoneNumber[idx].path);
1256		var thisFoundLen = 0;
1257		if(location.pathname == "/search-results/"){
1258			var foundPort = (new URLSearchParams(location.href)).getAll("city");
1259			thisFoundLen = (foundPort.length == 1 && foundPort[0] == hbPortPhoneNumber[idx].name ? hbPortPhoneNumber[idx].name : "").length;
1260		}
1261		if(thisPathName === '/bordeaux/') {
1262			//console.log('checking', {thisPortNumber,thisPathName,found,thisFoundLen})
1263		}
1264		if(thisFoundLen || found) {
1265			/* Move it outside so it checks for /search-results/ path first
1266			 * if(location.pathname == "/search-results/"){
1267                var foundPort = (new URLSearchParams(location.href)).getAll("city");
1268        		found[0] = foundPort.length == 1 && foundPort[0] == hbPortPhoneNumber[idx].name ? hbPortPhoneNumber[idx].name : "";
1269            }*/
1270			
1271			if(thisFoundLen > foundLen) {
1272				selectedPhone = hbPortPhoneNumber[idx];
1273				foundLen = thisFoundLen;
1274				//console.log('foundbysearch', {found, selectedPhone, thisPathName});
1275			}
1276			if(thisFoundLen === 0 && thisPathName === hbPortPhoneNumber[idx].path) {
1277				selectedPhone = hbPortPhoneNumber[idx];	
1278				foundLen = thisPathName.length;
1279				//console.log('foundbyPath', {found, selectedPhone, thisPathName});
1280			}
1281		}
1282	}
1283	if (!selectedPhone.sms) {
1284		selectedPhone.sms = "";
1285	}
1286	//console.log('selectedPhone',selectedPhone);
1287	return selectedPhone;
1288}
1289
1290function emailValidated(email) {
1291	var mailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
1292	if(email.match(mailformat)) {
1293		return true;
1294	} else {
1295		return false;
1296	}
1297}
1298
1299var excludePortIdForRealPort = ['viator','cityp','fhb','hbfrnds','glxy911','hexco','bbs','ingso','hllf','hstatueco','hbphi','hncco','hbbal','hbwashdc','trusted','hbnorf','hbchi','haq','hvc'];
1300
1301function getFirstRealPort(portList) {
1302	if(portList.length) {
1303		for(var idx = 0; idx < portList.length; idx++ ) {
1304			if(portList[idx].hideFromGeoSearch === undefined && !excludePortIdForRealPort.includes(portList[idx].id)) {
1305				return portList[idx];
1306			}
1307		}
1308	}
1309	return { };
1310}
1311
1312function determineGeoRegion(portList) {
1313	var geoRegion = { is_uk_region: false, is_us_region: false, is_non_uk_region: false, distance: 0 };
1314	if(portList.length) {
1315		var firstRealPort = getFirstRealPort(portList);
1316		//console.log('firstRealPort',firstRealPort);
1317		geoRegion.closest_prop_id = firstRealPort.id;
1318		geoRegion.distance = firstRealPort.distance;
1319		if(ukGeoPortList.includes(firstRealPort.id)) {
1320			isUkGeoPort = true;
1321			geoRegion.is_uk_region = true;
1322			//setCookie('isUkGeoPort', isUkGeoPort, 1)
1323			//console.log('uk region');
1324			jQuery('body').addClass('uk-region');
1325		} else {
1326			isUkGeoPort = false;
1327			geoRegion.is_non_uk_region = true;
1328			geoRegion.is_us_region = true;
1329			//setCookie('isUkGeoPort', isUkGeoPort, 1)
1330			//console.log('non-uk region');
1331		}
1332		if(typeof setCookie_performance === 'function') {
1333			setCookie_performance('isUkGeoPort', isUkGeoPort, 1)
1334		} else {
1335			//console.log('isUkGeoPort-not-loaded-first-time');
1336			setTimeout(function() { waitForCookiePerformanceToLoad(setIsUkGeoPort, isUkGeoPort, 1) }, 2000);
1337		}
1338	}
1339	return geoRegion;
1340}
1341
1342
1343function overrideLatLonForNearbyCity() {
1344	var latLonUrl = '';
1345	if(getCookie('useNavGeo') !== '' && getCookie('geoLat') !== '' && getCookie('geoLon') !== '') {
1346		var thisLat = getCookie('geoLat');
1347		var thisLong = getCookie('geoLon');
1348		latLonUrl = '&lat='+thisLat+'&lng='+thisLong;
1349	}
1350	return latLonUrl;
1351}
1352
1353function renderNearBySDK(myObj) {
1354	//console.log('renderNearBySDK', myObj);
1355	if(typeof HBCommerce === 'function') {
1356		//console.log('defined');
1357		renderSDK(myObj);
1358		clearInterval(window.nearBySdk[myObj.element_id]);
1359	} else {
1360		if(window.retryNearBySdk[myObj.element_id] > 5) {
1361			clearInterval(window.nearBySdk[myObj.element_id]);
1362		}
1363		window.retryNearBySdk[myObj.element_id]++;
1364		//console.log('not defined', window.retryNearBySdk[myObj.element_id]);
1365	}
1366}
1367
1368function renderSDK(myObj) {
1369	console.log('renderSDK-myObj',myObj);
1370	myObj.inlineStyles = { };
1371	myObj.shoppingCartV2 = true;
1372	myObj.enableQuickAddInRecommendedTours = true;
1373	myObj.showRecommendedTours = true;
1374	myObj.enableLoginWithPhoneNumber = getUrlParam('use_tel','').length > 0 ? true : true;
1375	myObj.singleFormCheckoutV3 = parseInt(getUrlParam('singleFormCheckoutV3', 0)) === 1 ? true : false;
1376	myObj.singleFormCheckoutV2 = parseInt(getUrlParam('singleFormCheckoutV2', 0)) === 1 ? true : false;
1377	myObj.skipSingleFormCheckout = parseInt(getUrlParam('skipSingleFormCheckout', 0)) === 1 ? false : true;
1378	myObj.skipLanguageChecker = parseInt(getUrlParam('skipLanguageChecker', 0)) === 1 ? true : false;
1379	myObj.retrieveBookingValidation = parseInt(getUrlParam('retrieveBookingValidation', 0)) === 1 ? true : false;
1380	myObj.disableGooglePay = parseInt(getUrlParam('disableGooglePay', 0)) === 1 ? false : null;
1381	myObj.disableApplePay = parseInt(getUrlParam('disableGooglePay', 0)) === 1 ? false : null;
1382	myObj.hideRadioBtnFromPaymentOptions = parseInt(getUrlParam('hideRadioBtnFromPaymentOptions', 0)) === 1 ? true : false;
1383	myObj.showPhoto = getUrlParam('showPhoto', 'false') === 'true';
1384	myObj.photo = getUrlParam('photo', '');
1385	myObj.dev2Testing = getUrlParam('dev2Testing', 'false') === 'true';
1386	myObj.disableGroupBookingSelfServiceRefund = myObj.settings.disableGroupBookingSelfServiceRefund || true;
1387	myObj.hideBookWithConfidenceSections = "{ \"hacco\": [\"ticketAssurance\"] }";
1388	//console.log('isjson?', JSON.parse(myObj.hideBookWithConfidenceSections));
1389	if(myObj.sdk_type === 'Sign Proposal') {
1390		myObj.initial_page = HBCommerce.ROUTES.SIGNPROPOSAL;
1391	} else if(myObj.sdk_type === 'Add Enhancements') {
1392		myObj.initial_page = HBCommerce.ROUTES.UPSELLCHECKOUTDIRECT;
1393		myObj.singleFormCheckoutV3 = true;
1394		myObj.singleFormCheckoutV2 = true;
1395		myObj.skipSingleFormCheckout = false;
1396		myObj.enableEnhancementPush = true;
1397		myObj.addTicketOrEnhancementLayoutV2 = true;
1398		myObj.enableCustomerStoredPayments = true;
1399		myObj.displayProductDetailsInUpsellCheckoutDirect = true;
1400	} else if(myObj.sdk_type === 'See Quote') {
1401		myObj.initial_page = HBCommerce.ROUTES.SIGNPROPOSAL;
1402	} else if(myObj.sdk_type === 'Waiver Form') {
1403		myObj.initial_page = HBCommerce.ROUTES.SIGNWAIVER;
1404	} else if(myObj.sdk_type === 'Search Experience') {
1405		myObj.initial_page = '/search-experiences';
1406		myObj.stickyTopOffset = -70;
1407		myObj.search_prop = myObj.settings.search_prop || {};
1408		myObj.search_prop.featuredFilters = myObj.search_prop.featuredFilters || {};
1409		myObj.search_prop.city = getUrlParam('city', '').length > 0 ? '' : myObj.search_prop.city;
1410		myObj.search_prop.nearMe = getUrlParam('nearMe', '').length > 0 ? getUrlParam('nearMe', '') : (myObj.search_prop.nearMe || '');
1411		myObj.search_prop.searchState = myObj.search_prop.searchState || {};
1412		myObj.search_prop.excludePartnerProducts = myObj.search_prop.excludePartnerProducts || false;
1413		myObj.search_prop.onlyOwnedProducts = myObj.search_prop.onlyOwnedProducts || false;
1414		myObj.search_prop.sortIndex = myObj.search_prop.sortIndex || '';
1415		myObj.search_prop.searchIndex = myObj.search_prop.searchIndex || '';
1416		myObj.search_prop.propertyIds = myObj.search_prop.propertyIds || [];
1417		myObj.search_prop.categoryTheme = getUrlParam('categoryTheme', '').length > 0 ? '' : (myObj.search_prop.categoryTheme || '');
1418		myObj.search_prop.specialCouponCategories = getUrlParam('specialCouponCategories', '').length > 0 ? '' : (myObj.search_prop.specialCouponCategories || '');
1419		myObj.search_prop.ignoreHideInWebsiteSearch = myObj.search_prop.ignoreHideInWebsiteSearch || false;
1420		myObj.search_prop.recentBookingsThreshold = myObj.search_prop.recentBookingsThreshold || null;
1421		myObj.search_prop.sellOutThreshold = myObj.search_prop.sellOutThreshold || null;
1422		myObj.search_prop.tourCurrencies = myObj.search_prop.tourCurrencies || { };
1423		myObj.search_prop.excludedPropBookingType = myObj.search_prop.excludedPropBookingType || [];
1424		myObj.search_prop.showHierarchical = myObj.search_prop.showHierarchical || false;
1425		myObj.search_prop.autoShowDiscount = myObj.search_prop.autoShowDiscount || false;
1426		myObj.search_prop.autoShowDiscountLimit = myObj.search_prop.autoShowDiscountLimit || 3;
1427		myObj.search_prop.autoDiscountPercentLimit = myObj.search_prop.autoDiscountPercentLimit || 0.2;
1428		myObj.search_prop.shouldShowFiltersInHalfWindows = true;
1429		myObj.showInfiniteScrollOnTileListing = myObj.settings.showInfiniteScrollOnTileListing !== undefined ? myObj.settings.showInfiniteScrollOnTileListing : true;
1430		myObj.sortFeaturedFiltersByDate = myObj.settings.sortFeaturedFiltersByDate || true;
1431		myObj.showDynamicTitle = myObj.settings.showDynamicTitle || false;
1432		myObj.enableProductsOnTheHorizon = myObj.settings.enableProductsOnTheHorizon || false;
1433		myObj.showNewTextForNoResultFound = true;
1434		//myObj.showNewTextForNoResultFound = myObj.settings.showNewTextForNoResultFound || false;
1435		//myObj.search_prop.showPriceWithFeesToggle = parseInt(getUrlParam('showPriceWithFeesToggle', 0)) === 1 ? true : false;
1436		myObj.search_prop.showPriceWithFeesToggle = myObj.settings.showPriceWithFeesToggle ? true : false;
1437		//myObj.search_prop.searchExperienceV3IsEnabled = parseInt(getUrlParam('searchExperienceV3IsEnabled', 0)) === 1 ? true : false;
1438		myObj.search_prop.searchExperienceV3IsEnabled = myObj.settings.searchExperienceV3IsEnabled ? true : true;
1439		myObj.search_prop.searchExperienceV2IsEnabled = myObj.settings.noSearchExperienceV2IsEnabled ? false : false;
1440		myObj.search_prop.hideRefinements = myObj.search_prop.hideRefinements || [];
1441		myObj.search_prop.hideRefinementsInUrl = myObj.search_prop.hideRefinementsInUrl || [];
1442		myObj.enableDarkThemeTiles = myObj.settings.enableDarkThemeTiles || false;
1443		myObj.hideMobileSearchComponents = myObj.settings.hideMobileSearchComponents || false;
1444		myObj.showUKCityQuickFilters = myObj.settings.showUKCityQuickFilters || false;
1445		myObj.showCalendarFilterViewOnMobile = myObj.settings.showCalendarFilterViewOnMobile || false;
1446		myObj.hideDatePickerPills = myObj.settings.hideDatePickerPills || false;
1447		myObj.hideSearchBar = myObj.settings.hideSearchBar || false;
1448		myObj.disableCalendars = myObj.settings.disableCalendars || false;
1449		myObj.search_prop.sortLocationFiltersByDistance = myObj.search_prop.sortLocationFiltersByDistance || false;
1450		myObj.search_prop.customInclusiveCalendarEndDate = myObj.search_prop.customInclusiveCalendarEndDate || ''; //Needs to be in format of YYYY/MM/DD
1451		myObj.search_prop.customInclusiveCalendarStartDate = myObj.search_prop.customInclusiveCalendarStartDate || ''; //Needs to be in format of YYYY/MM/DD
1452		myObj.search_prop.overrideCalendarStartMonth = myObj.search_prop.overrideCalendarStartMonth || ''; //Needs to be in format of YYYY/MM/DD
1453		myObj.search_prop.overrideShownMonths = myObj.search_prop.overrideShownMonths || '';
1454		myObj.search_prop.availableCities = myObj.search_prop.availableCities || [];
1455		myObj.showBrandQuickFilters = myObj.settings.showBrandQuickFilters || false;
1456		myObj.showChooseDestinationDropdownMobile = myObj.settings.showChooseDestinationDropdownMobile || false;
1457		myObj.showFullWidthMobileSortByDrawer = myObj.settings.showFullWidthMobileSortByDrawer || false;
1458		myObj.showFullLengthDatePickerMobile = myObj.settings.showFullLengthDatePickerMobile || false;
1459		myObj.search_prop.blockCalendarChange = myObj.search_prop.blockCalendarChange || false;
1460		myObj.search_prop.mobileQuickFilterCruiseTypes = myObj.settings.search_prop.mobileQuickFilterCruiseTypes || {};
1461		myObj.search_prop.defaultSortOption = myObj.search_prop.defaultSortOption || ''
1462		myObj.search_prop.onlyShowSpecialFilterCouponProducts = myObj.search_prop.onlyShowSpecialFilterCouponProducts || '';
1463		myObj.search_prop.specialCouponNonFilterCategory = myObj.search_prop.specialCouponNonFilterCategory || [];
1464		myObj.search_prop.algoliaPromoTags = myObj.search_prop.algoliaPromoTags || [];
1465		myObj.search_prop.paramSchedule = myObj.search_prop.paramSchedule || {};
1466		myObj.searchBarHeaderText = myObj.settings.searchBarHeaderText || null;
1467		myObj.search_prop.overrideModalToHighlightColors = myObj.search_prop.overrideModalToHighlightColors || false;
1468		//myObj.enableMobileTileVariant2Flag = parseInt(getUrlParam('enableMobileTileVariant2', 0)) === 1 ? true : false;
1469		//myObj.enableMobileTileVariant3 = parseInt(getUrlParam('enableMobileTileVariant3', 0)) === 1 ? true : false;
1470		myObj.enableMobileTileVariant2Flag = myObj.settings.enableMobileTileVariant2 ? myObj.settings.enableMobileTileVariant2 : false;
1471		myObj.enableMobileTileVariant3 = myObj.settings.enableMobileTileVariant3 ? myObj.settings.enableMobileTileVariant3 : false;
1472		//myObj.showCategoryQuickFilters = parseInt(getUrlParam('showCategoryQuickFilters', 0)) === 1 ? true : false;
1473		myObj.showCategoryQuickFilters = myObj.settings.showCategoryQuickFilters ? myObj.settings.showCategoryQuickFilters : false;
1474		myObj.disableScrollUp = myObj.settings.disableScrollUp ? myObj.settings.disableScrollUp : false;
1475		myObj.use_dev_shop = myObj.settings.use_dev_shop ? 'dev' : false;
1476		
1477		var showCurrentlyViewingInclusions = ["/alexandria/city-cruises/", "/baltimore/city-cruises/", "/berkeley/city-cruises/", "/boston/city-cruises/", "/chicago/city-cruises/", "/long-beach/city-cruises/","/marina-del-rey/city-cruises/","/newport-beach/city-cruises/","/new-york/city-cruises/","/norfolk/city-cruises/","/philadelphia/city-cruises/","/sacramento/city-cruises/","/san-diego/city-cruises/","/san-francisco/city-cruises/","/washington-dc/city-cruises/","/weehawken/city-cruises/"];
1478		var showCurrentlyViewingExclusions = ["/san-francisco/city-cruises/alcatraz/", "/new-york/city-cruises/statue/"];  // Add exclusions
1479		if (showCurrentlyViewingInclusions.some(e => location.pathname.includes(e)) && 
1480			!showCurrentlyViewingExclusions.some(e => location.pathname.includes(e))) {
1481				myObj.showCurrentlyViewing = true;	
1482				myObj.showBookedToday = parseInt(getUrlParam('showBookedToday', 0)) === 1 ? true : false;
1483		}
1484		
1485		myObj.search_prop.searchBarPlaceholderText = myObj.settings.search_prop.searchBarPlaceholderText || 'Search for an Experience';
1486		for( var idx = 0; idx < (myObj.search_prop.featuredFilters || []).length; idx++ ) {
1487			myObj.search_prop.featuredFilters[idx].filter = (myObj.search_prop.featuredFilters[idx].filter || '').replaceAll('&amp;', '&').replaceAll('&gt;', '>');
1488			myObj.search_prop.featuredFilters[idx].label = (myObj.search_prop.featuredFilters[idx].label || myObj.search_prop.featuredFilters[idx].filter).replaceAll('&amp;', '&').replaceAll('&gt;', '>');
1489			myObj.search_prop.featuredFilters[idx].searchQuery = (myObj.search_prop.featuredFilters[idx].searchQuery || '').replaceAll('&amp;', '&').replaceAll('&gt;', '>');
1490		}
1491		for( var idx = 0; idx < (myObj.search_prop.searchState.refinementList.categoryTheme || []).length; idx++ ) {
1492			myObj.search_prop.searchState.refinementList.categoryTheme[idx] = myObj.search_prop.searchState.refinementList.categoryTheme[idx].replaceAll('&amp;', '&').replaceAll('&gt;', '>');
1493		}
1494		for( var idx = 0; idx < (myObj.search_prop.searchState.refinementList.specialCouponCategories || []).length; idx++ ) {
1495			myObj.search_prop.searchState.refinementList.specialCouponCategories[idx] = myObj.search_prop.searchState.refinementList.specialCouponCategories[idx].replaceAll('&amp;', '&').replaceAll('&gt;', '>');
1496		}
1497
1498		function getUrlParamsArray(param) {
1499			const params = new URLSearchParams(window.location.search);
1500			return params.getAll(param); // Returns an array of all values
1501		}
1502		myObj.search_prop.hideCategoryTheme = getUrlParamsArray('hideCategoryTheme').length > 0 
1503			? getUrlParamsArray('hideCategoryTheme') 
1504			: (myObj.search_prop.hideCategoryTheme || []);
1505		
1506
1507
1508		myObj.experiencesSearchParams = {
1509			featuredFilters: myObj.search_prop.featuredFilters,
1510			searchState: myObj.search_prop.searchState,
1511			searchUrl: window.location.search,
1512			excludePartnerProducts: myObj.search_prop.excludePartnerProducts,
1513			onlyOwnedProducts: myObj.search_prop.onlyOwnedProducts,
1514			sortIndex: myObj.search_prop.sortIndex,
1515			searchIndex: myObj.search_prop.searchIndex,
1516			propertyIds: myObj.search_prop.propertyIds,
1517			ignoreHideInWebsiteSearch: myObj.search_prop.ignoreHideInWebsiteSearch,
1518			recentBookingsThreshold: myObj.search_prop.recentBookingsThreshold,
1519			sellOutThreshold: myObj.search_prop.sellOutThreshold,
1520			tourCurrencies: myObj.search_prop.tourCurrencies,
1521			excludedPropBookingType: myObj.search_prop.excludedPropBookingType,
1522			hidePromotions: myObj.search_prop.hidePromotions || true,
1523			showHierarchical: myObj.search_prop.showHierarchical,
1524			autoShowDiscount: myObj.search_prop.autoShowDiscount,
1525			autoShowDiscountLimit: myObj.search_prop.autoShowDiscountLimit,
1526			autoDiscountPercentLimit: myObj.search_prop.autoDiscountPercentLimit,
1527			adsTile: myObj.search_prop.adsTile || [],
1528			showAdsTile: myObj.search_prop.showAdsTile || false,
1529			hideAdsChip: myObj.search_prop.hideAdsChip || false,
1530			addCtaButton: myObj.search_prop.addCtaButton || false,
1531			enableRedirectAdbutton: myObj.search_prop.enableRedirectAdbutton || false,
1532			shouldShowFiltersInHalfWindows: myObj.search_prop.shouldShowFiltersInHalfWindows,
1533			showPriceWithFeesToggle: myObj.search_prop.showPriceWithFeesToggle,
1534			searchExperienceV3IsEnabled: myObj.search_prop.searchExperienceV3IsEnabled,
1535			searchExperienceV2IsEnabled: myObj.search_prop.searchExperienceV2IsEnabled,
1536			hideRefinements: myObj.search_prop.hideRefinements,
1537			showNewTextForNoResultFound: myObj.showNewTextForNoResultFound,
1538			sortLocationFiltersByDistance: myObj.search_prop.sortLocationFiltersByDistance,
1539			availableCities: myObj.search_prop.availableCities,
1540			customInclusiveCalendarEndDate: myObj.search_prop.customInclusiveCalendarEndDate,
1541			customInclusiveCalendarStartDate: myObj.search_prop.customInclusiveCalendarStartDate,
1542			overrideCalendarStartMonth: myObj.search_prop.overrideCalendarStartMonth,
1543			overrideShownMonths: myObj.search_prop.overrideShownMonths,
1544			blockCalendarChange: myObj.search_prop.blockCalendarChange,
1545			mobileQuickFilterCruiseTypes: myObj.search_prop.mobileQuickFilterCruiseTypes,
1546			defaultSortOption: myObj.search_prop.defaultSortOption,
1547			onlyShowSpecialFilterCouponProducts: myObj.search_prop.onlyShowSpecialFilterCouponProducts,
1548			specialCouponNonFilterCategory: myObj.search_prop.specialCouponNonFilterCategory,
1549			algoliaPromoTags: myObj.search_prop.algoliaPromoTags,
1550			paramSchedule: myObj.search_prop.paramSchedule,
1551			overrideModalToHighlightColors: myObj.search_prop.overrideModalToHighlightColors,
1552			disableScrollUp: myObj.disableScrollUp,
1553			allowFilterDatesWithPermalink: true,
1554			hideCategoryTheme: myObj.search_prop.hideCategoryTheme,
1555		}
1556		//console.log('myObjmyObj',myObj);
1557		myObj.experiencesSearchParams.city = myObj.search_prop.city;
1558	}
1558 else if(myObj.sdk_type === 'Check Coupon') {
1559		myObj.initial_page = HBCommerce.ROUTES.CHECKCOUPON;
1560	} else if(myObj.sdk_type === 'Gift Cards') {
1561		myObj.initial_page = HBCommerce.ROUTES.GIFTCARD;
1562		myObj.hideApplyGiftCardForGiftCardCheckout = true;
1563	}  else if(myObj.sdk_type === 'Gift Cards Balance') {
1564		myObj.property_id = 'hbsdco';
1565		myObj.initial_page = '/giftcard-balance';
1566	} else if(myObj.sdk_type === 'Order Details') {
1567		myObj.initial_page = myObj.url_iid.length ? HBCommerce.ROUTES.ITINERARY_DETAILS : HBCommerce.ROUTES.SERVICE;
1568		myObj.url_id = myObj.url_oid.length ? myObj.url_oid : myObj.url_id;
1569	} else if(myObj.sdk_type === 'Supplier Registration') {
1570		myObj.initial_page = HBCommerce.ROUTES.SIGNDOCUMENT;
1571	} else if(myObj.sdk_type === 'My Account') {
1572		myObj.initial_page = HBCommerce.ROUTES.MYACCOUNT;
1573		myObj.directUserToMyAccount = true;
1574		myObj.showEmailSignUpOption = true;
1575		myObj.showWelcomeModal = true;
1576		myObj.renderProfile = getUrlParam('mode') === 'profile';
1577		myObj.renderTrips = getUrlParam('mode') === 'trips';
1578		myObj.renderRewards = getUrlParam('mode') === 'rewards';
1579		myObj.renderOffers = getUrlParam('mode') === 'offers';
1580		myObj.myAccountV2 = true;
1581		myObj.hideMembershipInMyAccount = true;
1582		myObj.singleFormCheckoutV3 = true;
1583		myObj.singleFormCheckoutV2 = true;
1584		myObj.showGiftCardUsage = true;
1585		myObj.hideTripPlannerInMyAccount = parseInt(getUrlParam('hideTripPlannerInMyAccount', 0)) === 1 ? false : true;
1586		myObj.addTAInAddItemsCheckout = parseInt(getUrlParam('addTAInAddItemsCheckout', 0)) === 1 ? true : true;
1587		myObj.addTAInAddEnhCheckout = parseInt(getUrlParam('addTAInAddEnhCheckout', 0)) === 1 ? true : true;
1588		myObj.skipSingleFormCheckout = false;
1589		myObj.skipLanguageChecker = true;
1590		myObj.disableGooglePay = false;
1591		myObj.disableApplePay = false;
1592		myObj.hideRadioBtnFromPaymentOptions = true;
1593		myObj.displayItineraryDetailsV2CancelModifyButtons = true;
1594		//myObj.redirectToMyAccountV2 = parseInt(getUrlParam('redirectToMyAccountV2', 0)) === 1 ? true : false;
1595		//myObj.renderTripPlanner = !myObj.renderProfile;
1596		myObj.mmbPhase2 = true;
1597		myObj.mmbPhase1 = true;
1598		myObj.hideAdditionalEnhancementOptions = parseInt(getUrlParam('hideAdditionalEnhancementOptions', 0)) === 1 ? true : true;
1599		myObj.mmbPhase3 = true;
1600		myObj.specialRequestV2 = true;
1601		myObj.transferActionMmbPhase3 = true;
1602		myObj.shouldRedirectToMMB = parseInt(getUrlParam('shouldRedirectToMMB', 0)) === 1 ? true : false;
1603		myObj.mmbTrendingNearCarousal = true;
1604		//myObj.mmbExclusiveDealCarousal = parseInt(getUrlParam('mmbExclusiveDealCarousal', 0)) === 1 ? true : false;
1605		myObj.canUpgradeTickets = true;
1606		myObj.renderRefundPayment = true;
1607		myObj.showExclusiveDealsInMyOffers = true ;
1608		myObj.enableCustomerStoredPayments = true;
1609		myObj.hideWaitlistForAdditionalSpecialityEvents = true;
1610		myObj.defaultToLoginByPassword = true;
1611		myObj.useSignInPopupFlow = true;
1612		myObj.displayAddEnhancementsBtnInMMB = parseInt(getUrlParam('displayAddEnhancementsBtnInMMB', 0)) === 1 ? true : false;
1613		myObj.showCountOnAccountTabs = true;
1614		if (["/toronto/", "/niagara/", "/gananouque/"].some(e => location.pathname.includes(e))) {
1615			myObj.showRefundToNewCardBoxInMMB = parseInt(getUrlParam('showRefundToNewCardBoxInMMB', 0)) === 1 ? true : false;
1616		}
1617	} else if(myObj.sdk_type === 'Account') {
1618		myObj.initial_page = HBCommerce.ROUTES.SELFSERVICE;
1619		myObj.myAccountV2 = true;
1620		myObj.addTAInAddEnhCheckout = parseInt(getUrlParam('addTAInAddEnhCheckout', 0)) === 1 ? true : true;
1621		myObj.addTAInAddItemsCheckout = parseInt(getUrlParam('addTAInAddItemsCheckout', 0)) === 1 ? true : true;
1622		myObj.mmbPhase2 = true;
1623		myObj.singleFormCheckoutV3 = true;
1624		myObj.singleFormCheckoutV2 = true;
1625		myObj.skipSingleFormCheckout = false;
1626		myObj.skipLanguageChecker = true;
1627		myObj.disableGooglePay = false;
1628		myObj.disableApplePay = false;
1629		myObj.hideRadioBtnFromPaymentOptions = true;
1630		myObj.displayItineraryDetailsV2CancelModifyButtons = true;
1631		//myObj.redirectToMyAccountV2 = parseInt(getUrlParam('redirectToMyAccountV2', 0)) === 1 ? true : false;
1632		myObj.mmbPhase1 = true;
1633		myObj.hideAdditionalEnhancementOptions = parseInt(getUrlParam('hideAdditionalEnhancementOptions', 0)) === 1 ? true : true;
1634		myObj.mmbPhase3 = true;
1635		myObj.specialRequestV2 = true;
1636		myObj.transferActionMmbPhase3 = true;
1637		//myObj.shouldRedirectToMMB = parseInt(getUrlParam('shouldRedirectToMMB', 0)) === 1 ? true : false;
1638		myObj.shouldRedirectToMMB = true;
1639		myObj.canUpgradeTickets = true;
1640		myObj.renderRefundPayment = true;
1641		myObj.enableCustomerStoredPayments = true;
1642		myObj.hideWaitlistForAdditionalSpecialityEvents = true;
1643		myObj.url_id = myObj.url_oid.length ? myObj.url_oid : myObj.url_id;
1644		myObj.displayAddEnhancementsBtnInMMB = parseInt(getUrlParam('displayAddEnhancementsBtnInMMB', 0)) === 1 ? true : false;
1645		if (["/toronto/", "/niagara/", "/gananouque/"].some(e => location.pathname.includes(e))) {
1646			myObj.showRefundToNewCardBoxInMMB = parseInt(getUrlParam('showRefundToNewCardBoxInMMB', 0)) === 1 ? true : false;
1647		}
1648	} else if(myObj.sdk_type === 'Cart Payment') {
1649		myObj.initial_page = HBCommerce.ROUTES.CART_CHECKOUT;
1650		myObj.make_cart_payment = true;
1651		myObj.singleItemCheckoutEnabled = false;
1652		myObj.shoppingCartV2 = false;
1653		myObj.enableQuickAddInRecommendedTours = false;
1654		myObj.showRecommendedTours = false;
1655		myObj.isQuickQuoteRequestType = true;
1656		myObj.cartOrderIdToEdit = '';
1657		myObj.shoppingCartId = '';
1658	} else if(myObj.sdk_type === 'Shopping Cart') {
1659		myObj.initial_page = HBCommerce.ROUTES.CART_CHECKOUT;
1660		myObj.singleItemCheckoutEnabled = false;
1661		myObj.displayHelpIconForTaxes = true;
1662		myObj.alternateMKLayout = true;
1663		myObj.inlineStyles = myObj.alternateMKLayout ? mkInlineStyles : { };
1664		myObj.showPackagedAndRecentlyViewedTours = true;
1665		myObj.singleFormCheckoutV3 = false;
1666		myObj.showSameHeightCardsRecentlyViewed = true;
1667		myObj.shoppingCartSummaryFooterV2 = true;
1668		myObj.showSignInWidgetOnCart = parseInt(getUrlParam('showSignInWidgetOnCart', 0)) === 1 ? true : true;
1669		myObj.showWelcomeModal = parseInt(getUrlParam('showWelcomeModal', 0)) === 1 ? true : true;
1670		myObj.withPackageInfo = true;
1671		myObj.shoppingCartV3 = true;
1672		myObj.showYellowColorOnRecommendation = parseInt(getUrlParam('showYellowColorOnRecommendation', 0)) === 1 ? true : false;
1673		myObj.enableMakeMostOfYourVisit = parseInt(getUrlParam('enableMakeMostOfYourVisit', 0)) === 1 ? true : false;
1674		myObj.cartCheckoutAds = [{
1675		//	"imgUrl": "https://assets.cityexperiences.com/wp-content/uploads/2023/02/2023_429650_CC_Search-Results-Promo-Banner-CEX_01_Cyan.jpg",
1676		//	"linkTo": "https://www.cityexperiences.com/city-experiences-rewards-program/"
1677		},{
1678		//	"imgUrl": "https://assets.cityexperiences.com/wp-content/uploads/2023/02/2023_429650_CC_Search-Results-Promo-Banner-CEX_01_Blue.jpg",
1679		//	"linkTo": "https://www.cityexperiences.com/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&city=&categoryTheme=Packages&audience=&durationTiming=&webCategoriesMain=&country=&brandTag=&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0="
1680		}];
1681		//myObj.cartCheckoutAds = null;
1682		myObj.cartCheckoutDisabledStrikethrough = [
1683			{"propertyId": "hwlkusny", "bookingType": 1000398},
1684			{"propertyId": "glxy911", "bookingType": 1109391},
1685			{"propertyId": "hbnyco", "bookingType": 1000566},
1686			{"propertyId": "glxy911", "bookingType": 1109391},
1687			{"propertyId": "hstatueco", "bookingType": 3},
1688			{"propertyId": "glxy911", "bookingType": 1109391},
1689		];
1690		myObj.hideWaitlistForAdditionalSpecialityEvents = true;
1691		myObj.specialRequestV2 = true;
1692		myObj.allowUsingStoredPayments = parseInt(getUrlParam('allowUsingStoredPayments', 0)) === 1 ? true : false;
1693		myObj.allowStoredPaymentInCart = parseInt(getUrlParam('allowStoredPaymentInCart', 0)) === 1 ? true : false;
1694		myObj.hideAddNewCardOnFile = parseInt(getUrlParam('hideAddNewCardOnFile', 0)) === 1 ? true : false;
1695		myObj.displayAddEnhancementConfirmationModal = true;
1696		myObj.enableSplitViewOnCartPage = true;
1697		myObj.showBookWithConfidenceUnderCartPageSummary = true;
1698		myObj.showCheckoutButtonInCartPageSummary = true;
1699		myObj.cartDollarsPerPointToDisplay = ".1";
1700
1701		// The code below checks to see if the items in the cart are CA prop tours. If so, it adds flags to expand fees by default.
1702		function getCookieValue(cookieName) {
1703			const cookieString = document.cookie;
1704			const cookieArray = cookieString.split("; ");
1705			for (const cookie of cookieArray) {
1706				const [name, value] = cookie.split("=");
1707				if (name === cookieName) {
1708				return decodeURIComponent(value);
1709				}
1710			}
1711			return null;
1712		}
1713		// Get the value of the '_anchorcidmeta' cookie
1714		const cookieValue = getCookieValue('_anchorcidmeta');
1715		// Check if the cookie value exists
1716		if (cookieValue) {
1717			// Parse the JSON data
1718			const decodedCookieValue = decodeURIComponent(cookieValue);
1719			const cartData = JSON.parse(decodedCookieValue);
1720			const cartItems = cartData.cartItems;
1721
1722			//This is a list of all CA properties to be used later to expand fees
1723			const targetPropertyIds = ["hbberco", "hblbco", "hbmdrco", "hbnpbco", "hbsacco", "hbsdco", "hbsfco", "hacco"];
1724
1725			// This checks if the tours are CA property tours, and if so, sets a flag to true for expanding fees.
1726			for (const cartItem of cartItems) {
1727				if (targetPropertyIds.includes(cartItem.propertyId)) {
1728					myObj.cartCheckoutDefaultSummaryExpanded = true;
1729					break; // Exit the loop since we found a matching propertyId
1730				} else {
1731					myObj.cartCheckoutDefaultSummaryExpanded = false;
1732				}
1733			}
1734		} else {
1735			//console.log("Cookie '_anchorcidmeta' not found.");
1736		}            
1737		// End check 
1738
1739		// Check localStorage item from onVwoEvent trigger exists, if it does, fire off an event to VWO
1740		const storedVwoEvent = localStorage.getItem('toTriggerVwoEvent');
1741		const fallbackStoredVwoEvent = localStorage.getItem('onCartChangeTriggerVwoEvent');
1742
1743		if (storedVwoEvent) {
1744			// Parse the stored event data
1745			const { eventName, data } = JSON.parse(storedVwoEvent);
1746			console.log('triggering vwo event using onVwoEvent', eventName, data);
1747	
1748			// Trigger the VWO event with the stored data
1749			window.VWO = window.VWO || [];
1750			VWO.event = VWO.event || function () {VWO.push(['event'].concat([].slice.call(arguments)))};
1751			VWO.event(eventName, data);
1752	
1753			// Remove the item from localStorage so it doesn't fire again
1754			localStorage.removeItem('toTriggerVwoEvent');
1755			localStorage.removeItem('onCartChangeTriggerVwoEvent');
1756		} else if (fallbackStoredVwoEvent) {
1757			// Parse the stored event data
1758			const { eventName, data } = JSON.parse(fallbackStoredVwoEvent);
1759			console.log('triggering vwo event using onCartChange fallback', eventName, data);
1760	
1761			// Trigger the VWO event with the stored data
1762			window.VWO = window.VWO || [];
1763			VWO.event = VWO.event || function () {VWO.push(['event'].concat([].slice.call(arguments)))};
1764			VWO.event(eventName, data);
1765	
1766			// Remove the item from localStorage so it doesn't fire again
1767			localStorage.removeItem('onCartChangeTriggerVwoEvent');
1768		}
1769
1770	} else if(myObj.sdk_type === 'Redeem Go City Pass') {
1771		myObj.initial_page = '/redeem-go-city-pass';
1772		myObj.enableGoCityWebRedeem = true;
1773	}  else if(myObj.sdk_type === 'Checkout Go City Pass') {
1774		//console.log('Checkout Go City Pass', myObj);
1775		jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .loading-event' ).fadeOut( 'slow', function() {
1776			HBCommerce.launch({
1777				propertyId: myObj.settings.gocity_checkout_sdk_prop.property_id,
1778				locale: 'en',
1779				bookingTypeId: myObj.settings.gocity_checkout_sdk_prop.booking_type_id,
1780				flags: {
1781					useThirdPartyLayout: true,
1782					tpCode: myObj.settings.gocity_checkout_sdk_prop.tpCode,
1783					b2cNoOfDaysToLoadEnabledDates: myObj.settings.gocity_checkout_sdk_prop.b2cNoOfDaysToLoadEnabledDates,
1784					skipSingleFormCheckout: true,
1785					disableExpressCheckout: true,
1786				},
1787			}, myObj.settings.gocity_checkout_sdk_prop.redeem_placeholder).then(function (instance) {
1788				_HBCOMMERCEINSTANCE_ = instance;
1789				}).catch(function (err) {
1790				console.log("Error launching commerce sdk", err);
1791			});
1792		});
1793	} else {
1794		myObj.initial_page = HBCommerce.ROUTES.SELFSERVICE;
1795		myObj.enableAddMoreInItineraryDetails = true;
1796		myObj.disableSingleItemCheckoutInSource = true;
1797	}
1798	
1799	if (myObj.settings.new_algolia && myObj.sdk_type === 'Search Experience') {
1800		window.ceSearchExperiencesParams = {
1801			locale: getPageTranslation(),
1802			searchParams: myObj.experiencesSearchParams,
1803			hideRefinementsInUrl: myObj.search_prop.hideRefinementsInUrl,
1804			showInfiniteScrollOnTileListing: myObj.showInfiniteScrollOnTileListing,
1805			sortFeaturedFiltersByDate: myObj.sortFeaturedFiltersByDate,
1806			showDynamicTitle: myObj.showDynamicTitle,
1807			enableProductsOnTheHorizon: myObj.enableProductsOnTheHorizon,
1808			showNewTextForNoResultFound: myObj.showNewTextForNoResultFound,
1809			enableDarkThemeTiles: myObj.enableDarkThemeTiles,
1810			hideMobileSearchComponents: myObj.hideMobileSearchComponents,
1811			showUKCityQuickFilters: myObj.showUKCityQuickFilters,
1812			showCalendarFilterViewOnMobile: myObj.showCalendarFilterViewOnMobile,
1813			hideDatePickerPills: myObj.hideDatePickerPills,
1814			hideSearchBar: myObj.hideSearchBar,
1815			disableCalendars: myObj.disableCalendars,
1816			showBrandQuickFilters: myObj.showBrandQuickFilters,
1817			showChooseDestinationDropdownMobile: myObj.showChooseDestinationDropdownMobile,
1818			showFullWidthMobileSortByDrawer: myObj.showFullWidthMobileSortByDrawer,
1819			showFullLengthDatePickerMobile: myObj.showFullLengthDatePickerMobile,
1820			searchBarHeaderText: myObj.searchBarHeaderText,
1821			enableMobileTileVariant2Flag: myObj.enableMobileTileVariant2Flag,
1822			enableMobileTileVariant3: myObj.enableMobileTileVariant3,
1823			showCategoryQuickFilters: myObj.showCategoryQuickFilters,
1824			mmbPhase3: myObj.mmbPhase3,
1825			specialRequestV2: myObj.specialRequestV2,
1826			transferActionMmbPhase3: myObj.transferActionMmbPhase3,
1827			overrideEnvTag: myObj.use_dev_shop,
1828			searchBarPlaceholderText: myObj.search_prop.searchBarPlaceholderText,
1829			showCurrentlyViewing: myObj.showCurrentlyViewing,
1830			showBookedToday: myObj.showBookedToday,
1831			fullScreenCalendarForMobile: true,
1832			enableAdTiles: true,
1833			onExperiencesSearchParamsChange: function(evt) {
1834				// The code below is used to extract the city from the URL and add it to the module title
1835					// Get the current URL
1836					const currentURL = window.location.href;
1837					// Create a function to extract URL parameters as an array
1838					function getUrlParameter(name) {
1839						name = name.replace(/[[]/, '\\[').replace(/[\]]/, '\\]');
1840						const regex = new RegExp('[\\?&]' + name + '=([^&#]*)', 'g');
1841						const results = [];
1842						let match;
1843						while ((match = regex.exec(currentURL))) {
1844							const value = decodeURIComponent(match[1].replace(/\+/g, ' '));
1845							if (value.trim() !== '') {
1846								results.push(value);
1847							}
1848						}
1849						return results;
1850					}
1851					// Get the "city" parameter value(s) as an array (excluding blank values)
1852					const cityParam = getUrlParameter('city');
1853					var cityParamString = cityParam.length === 1 ? ' in ' + cityParam[0] : '';
1854					if(!jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span').length) {
1855						cityParamString = '<span class="hide">' + cityParamString + '</span>';
1856						jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title').append(cityParamString);
1857					} else {
1858						jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span').html(cityParamString);
1859					}
1860					if((cityParam.length === 1) || (cityParam.length)) {
1861						jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span').removeClass('hide');
1862						
1863						if (myObj.settings.hide_quick_filters_on_city_selection) {
1864							jQuery('.featured-filters-container').addClass('hide');
1865						}
1866					} else {
1867						jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span' ).addClass('hide');
1868						
1869						if (myObj.settings.hide_quick_filters_on_city_selection) {
1870							jQuery('.featured-filters-container').removeClass('hide');
1871						}
1872					}
1873				
1874				// The code below is to select the default city in the filters
1875					if (!myObj.experiencesSearchParams.searchState.refinementList.city) {
1876						myObj.experiencesSearchParams.searchState.refinementList.city = [];
1877						if (myObj.experiencesSearchParams.city !== undefined && myObj.experiencesSearchParams.city !== null && myObj.experiencesSearchParams.city !== '') {
1878							myObj.experiencesSearchParams.searchState.refinementList.city.push(myObj.experiencesSearchParams.city);
1879						}
1880					}
1881				  
1882				  
1883
1884				
1885            },
1886			onHitCountChange: function(numberOfHits) {
1887				//console.log("number of results", numberOfHits);
1888				// Create the string based on the number of hits
1889				var resultsAmountString = numberOfHits === 1 ? ' (' + numberOfHits + ' Result)' : ' (' + numberOfHits + ' Results)';
1890
1891				// Target the title element
1892				var $titleElement = jQuery('.' + myObj.settings.hb_module_name + '.' + myObj.element_first + ' .module-header .title');
1893			
1894				// Remove any previous results string (if exists)
1895				$titleElement.find('.results-amount').remove();
1896			
1897				if (numberOfHits > 0) {
1898					// Append the new string wrapped in a span
1899					$titleElement.append('<em class="results-amount">' + resultsAmountString + '</em>');
1900				}
1901				
1902				// Move marketing tiles to underneath title
1903				if(!jQuery(".hbg-custom-sdk.algolia-search-by-city .module-header + .vc_row.vc_row-fluid").length){
1904					jQuery(".hbg-generic-listing.generic-tile-list-v3").parents(".vc_row-fluid").insertAfter(".hbg-custom-sdk.algolia-search-by-city .module-header");
1905				}
1906			},
1907		}
1908		console.log('searchParams', window.ceSearchExperiencesParams);
1909    	// Create a new script element
1910		var script = document.createElement("script");
1911		// Set the type attribute
1912		script.type = "text/javascript";
1913		// Set the src attribute to the URL of the external JavaScript file
1914		script.src = "/algolia-search.latest.js";
1915		// Append the script element to the document's head or body
1916		// Choose the appropriate location based on your needs
1917
1918		document.body.appendChild(script); // Add to the body
1919		
1920		var searchState = myObj.experiencesSearchParams.searchState;
1921		var searchUrl = myObj.experiencesSearchParams.searchUrl;
1922		var searchCities = (myObj.experiencesSearchParams || { }).city || (myObj.experiencesSearchParams.searchState.refinementList || { }).city || [];
1923		var searchCitiesStr = (searchCities.length === 1 ? ' in ' + searchCities[0] : '') || (searchCities.length ? ' in ' + searchCities : '');
1924		//console.log('city filled', searchCities);
1925		//console.log('city string', searchCitiesStr);
1926		if(!jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span').length) {
1927			searchCitiesStr = '<span class="hide">' + searchCitiesStr + '</span>';
1928			jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title').append(searchCitiesStr);
1929		} else {
1930			jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span').html(searchCitiesStr);
1931		}
1932		if((searchCities.length === 1) || (searchCities.length)) {
1933			jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span').removeClass('hide');
1934			
1935			if (myObj.settings.hide_quick_filters_on_city_selection) {
1936				jQuery('.featured-filters-container').addClass('hide');
1937			}
1938		} else {
1939			jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span' ).addClass('hide');
1940			
1941			if (myObj.settings.hide_quick_filters_on_city_selection) {
1942				jQuery('.featured-filters-container').removeClass('hide');
1943			}
1944		}
1945
1946
1947	} else if (myObj.sdk_type !== 'Checkout Go City Pass') {
1948		jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .loading-event' ).fadeOut( 'slow', function() {
1949			console.log('custom-sdk111', myObj);
1950			HBCommerce.launch({
1951				locale: getPageTranslation(),
1952				propertyId: myObj.property_id,
1953				cartId: getUrlParam('id', ''),
1954				flags: {
1955					initialPage: myObj.initial_page,
1956					controlledScroll: true,
1957					initAction: myObj.url_ac,
1958					hideTripPlannerInMyAccount: myObj.hideTripPlannerInMyAccount,
1959					viewCheckoutV2: true,
1960					makeCartPayment: myObj.make_cart_payment,
1961					singleItemCheckoutEnabled: myObj.singleItemCheckoutEnabled,
1962					cartMode: true,
1963					shoppingCartV2: myObj.shoppingCartV2,
1964					cartCheckoutExpandableSummary: true,
1965					disableSingleItemCheckoutInSource: myObj.disableSingleItemCheckoutInSource || false,
1966					singleFormCheckoutV3: myObj.singleFormCheckoutV3 || false,
1967					singleFormCheckoutV2: myObj.singleFormCheckoutV2 || false,
1968					skipSingleFormCheckout: myObj.skipSingleFormCheckout,
1969					skipLanguageChecker: myObj.skipLanguageChecker || false,
1970					cartCheckout: {
1971						showRecommendedTours: myObj.showRecommendedTours,
1972						enableQuickEditOrdersInCart: true,
1973						enableQuickAddInRecommendedTours: myObj.enableQuickAddInRecommendedTours,
1974						cartCheckoutAds: myObj.cartCheckoutAds,
1975						hideBookWithConfidenceSections: myObj.hideBookWithConfidenceSections,
1976					},
1977					showEmailSignUpOption: myObj.showEmailSignUpOption,
1978					enableAddMoreInItineraryDetails: myObj.enableAddMoreInItineraryDetails,
1979					oneTrustCookiesCheckEnabled: myObj.oneTrustCookiesCheckEnabled || false,
1980					directUserToMyAccount: myObj.directUserToMyAccount || false,
1981					showWelcomeModal: myObj.showWelcomeModal || false,
1982					countryWithinDestinationEnabled: true,
1983					searchExperienceV2IsEnabled: myObj.search_prop.searchExperienceV2IsEnabled,
1984					displayHelpIconForTaxes: myObj.displayHelpIconForTaxes || false,
1985					showSignInWidgetOnCart: myObj.showSignInWidgetOnCart || false,
1986					showWelcomeModal: myObj.showWelcomeModal || false,
1987					searchExperienceV3IsEnabled: myObj.search_prop.searchExperienceV3IsEnabled,
1988					useOtpLogin: true,
1989					alternateMKLayout: myObj.alternateMKLayout || false,
1990					showPackagedAndRecentlyViewedTours: myObj.showPackagedAndRecentlyViewedTours || false,
1991					//skipSingleFormCheckout: true,
1992					stickyTopOffset: myObj.stickyTopOffset,
1993					myAccountV2: myObj.myAccountV2,
1994					hideMembershipInMyAccount: myObj.hideMembershipInMyAccount,
1995					shoppingCartV3: myObj.shoppingCartV3,
1996					shoppingCartSummaryFooterV2: myObj.shoppingCartSummaryFooterV2,
1997					showSameHeightCardsRecentlyViewed: myObj.showSameHeightCardsRecentlyViewed,
1998					myAccount: {
1999						renderProfile: myObj.renderProfile || false,
2000						renderTrips: myObj.renderTrips || false,
2001						renderRewards: myObj.renderRewards || false,
2002						renderOffers: myObj.renderOffers || false,
2003					},
2004					enableLoginWithPhoneNumber: myObj.enableLoginWithPhoneNumber,
2005					sellOutThreshold: 0.2,
2006					retrieveBookingValidation: myObj.retrieveBookingValidation,
2007					cartCheckoutDisabledStrikethrough: myObj.cartCheckoutDisabledStrikethrough,
2008					withPackageInfo: myObj.withPackageInfo,
2009					showYellowColorOnRecommendation: myObj.showYellowColorOnRecommendation,
2010					enableMakeMostOfYourVisit: myObj.enableMakeMostOfYourVisit,
2011					filterRecentViewWthTourAvailability: false,
2012					customDialogPosition: true,
2013					displayItineraryDetailsV2CancelModifyButtons: myObj.displayItineraryDetailsV2CancelModifyButtons || false,
2014					showGiftCardUsage: myObj.showGiftCardUsage,
2015					disableGooglePay: myObj.disableGooglePay,
2016					disableApplePay: myObj.disableApplePay,
2017					hideRadioBtnFromPaymentOptions: myObj.hideRadioBtnFromPaymentOptions,
2018					enableGoCityWebRedeem: myObj.enableGoCityWebRedeem || false,
2019					showPhoto: myObj.showPhoto || false,
2020					photo: myObj.photo,
2021					dev2Testing: myObj.dev2Testing || false,
2022					addTAInAddItemsCheckout: myObj.addTAInAddItemsCheckout,
2023					addTAInAddEnhCheckout: myObj.addTAInAddEnhCheckout,
2024					mmbPhase2: myObj.mmbPhase2,
2025					mmbPhase1: myObj.mmbPhase1,
2026					//redirectToMyAccountV2 : myObj.redirectToMyAccountV2,
2027					hideAdditionalEnhancementOptions: myObj.hideAdditionalEnhancementOptions,
2028					mmbPhase3: myObj.mmbPhase3,
2029					specialRequestV2: myObj.specialRequestV2,
2030					transferActionMmbPhase3: myObj.transferActionMmbPhase3,
2031					shouldRedirectToMMB: myObj.shouldRedirectToMMB,
2032					mmbTrendingNearCarousal: myObj.mmbTrendingNearCarousal || false,
2033					//mmbExclusiveDealCarousal: myObj.mmbExclusiveDealCarousal || false,
2034					canUpgradeTickets: myObj.canUpgradeTickets,
2035					renderRefundPayment: myObj.renderRefundPayment,
2036					showExclusiveDealsInMyOffers: myObj.showExclusiveDealsInMyOffers,
2037					enableCustomerStoredPayments: myObj.enableCustomerStoredPayments,
2038					allowUsingStoredPayments: myObj.allowUsingStoredPayments,
2039					allowStoredPaymentInCart: myObj.allowStoredPaymentInCart,
2040					hideAddNewCardOnFile: myObj.hideAddNewCardOnFile,
2041					hideWaitlistForAdditionalSpecialityEvents: myObj.hideWaitlistForAdditionalSpecialityEvents,
2042					disableMMBForExperienceBooking: true,
2043					stripePaymentInfo: {
2044						payment_intent: myObj.url_payment_intent,
2045						payment_intent_client_secret: myObj.url_payment_intent_client_secret,
2046						redirect_status: myObj.url_redirect_status,
2047					},
2048					cartCheckoutDefaultSummaryExpanded: myObj.cartCheckoutDefaultSummaryExpanded,
2049					hideApplyGiftCardForGiftCardCheckout: myObj.hideApplyGiftCardForGiftCardCheckout,
2050					defaultToLoginByPassword: myObj.defaultToLoginByPassword,
2051					useSignInPopupFlow: myObj.useSignInPopupFlow,
2052					displayAddEnhancementConfirmationModal: myObj.displayAddEnhancementConfirmationModal,
2053					enableSplitViewOnCartPage: myObj.enableSplitViewOnCartPage,
2054					showBookWithConfidenceUnderCartPageSummary: myObj.showBookWithConfidenceUnderCartPageSummary,
2055					showCheckoutButtonInCartPageSummary: myObj.showCheckoutButtonInCartPageSummary,
2056					displayProductDetailsInUpsellCheckoutDirect: myObj.displayProductDetailsInUpsellCheckoutDirect,
2057					displayAddEnhancementsBtnInMMB: myObj.displayAddEnhancementsBtnInMMB,
2058					showCountOnAccountTabs: myObj.showCountOnAccountTabs,
2059					enableEnhancementPush: myObj.enableEnhancementPush,
2060					addTicketOrEnhancementLayoutV2: myObj.addTicketOrEnhancementLayoutV2,
2061					cartDollarsPerPointToDisplay: myObj.cartDollarsPerPointToDisplay,
2062					disableGroupBookingSelfServiceRefund: myObj.disableGroupBookingSelfServiceRefund || true,
2063					enableCharterGroupUpdates: true,
2064					showRefundToNewCardBoxInMMB: myObj.showRefundToNewCardBoxInMMB
2065				},
2066				proposalId: myObj.url_id,
2067				documentId: myObj.document_id,
2068				waiverId: myObj.url_id,
2069				theme: 'cityexperiences',
2070				customerInfo: {
2071					orderId: myObj.url_id,
2072					itineraryId: myObj.url_iid,
2073					//isQuickQuoteRequestType: myObj.isQuickQuoteRequestType || false,
2074					//shoppingCartId: myObj.shoppingCartId || '',
2075					//cartOrderIdToEdit: myObj.cartOrderIdToEdit || '',
2076				},
2077				experiencesSearchParams: myObj.experiencesSearchParams,
2078				inlineStyles: myObj.inlineStyles,
2079				onExperiencesSearchParamsChange: function(evt) {
2080					//console.log('evtttt',evt);
2081					var searchState = evt.payload.searchState;
2082					var searchUrl = evt.payload.searchUrl;
2083					var searchCities = (evt.payload.searchState.refinementList || { }).city || [];
2084					var searchCitiesStr = searchCities.length === 1 ? ' in ' + searchCities[0] : '';
2085					//console.log('searchCitiesStr',searchCities);
2086					if(!jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span').length) {
2087						searchCitiesStr = '<span class="hide">' + searchCitiesStr + '</span>';
2088						jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title').append(searchCitiesStr);
2089					} else {
2090						jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span').html(searchCitiesStr);
2091					}
2092					if((searchCities.length === 1) || (searchCities.length)) {
2093						jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span').removeClass('hide');
2094						
2095						if (myObj.settings.hide_quick_filters_on_city_selection) {
2096							jQuery('.featured-filters-container').addClass('hide');
2097						}
2098					} else {
2099						jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span' ).addClass('hide');
2100						
2101						if (myObj.settings.hide_quick_filters_on_city_selection) {
2102							jQuery('.featured-filters-container').removeClass('hide');
2103						}
2104					}
2105					if(window.history) {
2106						window.history.pushState(searchState, 'Search Results', '?'+searchUrl)
2107					}
2108				},
2109				onScrollUp: function() {
2110					var widgetTopOffset = jQuery('.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .hb-sdk-place-holder').offset().top;
2111					var stickyHeaderOffset = document.getElementById('masthead').offsetHeight;
2112					jQuery( "html, body" ).animate( { scrollTop: widgetTopOffset - stickyHeaderOffset } );
2113				},
2114				onCartChange: function(event) {
2115					var totalItemsInCart = (((event || {}).payload || {}).cartItems || []).length;
2116					var rerenderSdk = (((event || {}).payload || {}).continueShopping || false);
2117					console.log('onCartChange',{totalItemsInCart,event});
2118					if(totalItemsInCart === 0) {
2119						jQuery('.continue-to-checkout' ).addClass('hide');
2120						jQuery('.countdown-timer' ).html('');
2121						jQuery('.countdown-timer-wrapper' ).addClass('hide');
2122						//location.href = location.href;
2123					}
2124					anchorCartChange(totalItemsInCart);
2125					if(rerenderSdk) {
2126						window.location.href = '/';
2127					}
2128				},
2129				onQuickAddToCart: function(evt) {
2130					var addCartProp = evt.payload || {};
2131					console.log('onQuickAddToCart', addCartProp);
2132					jQuery('.calendar-drawer-wrapper').addClass('open');
2133					var orderId = addCartProp.cartOrderIdToEdit || null;
2134					var settings = {};
2135					settings.isAddon = addCartProp.isAddon || false;
2136					addToCartDrawer(addCartProp.propertyId, addCartProp.bookingTypeId, orderId, settings);
2137				},
2138				onGoToHome: function(event) {
2139					console.log('onGoToHome', event);
2140					if( event.payload.goBackLastPage || false ) {
2141						history.back();
2142					} else {
2143						location.href = '/';
2144					}
2145				},
2146				onContinueToCheckout: function(event) {
2147					console.log('onContinueToCheckout', event);
2148					window.location.href = '/checkout/?cart=1';
2149				},
2150				onAuthChange: function(event) {
2151					console.log('onAuthChange', event);
2152					if(event.payload.isLoggedIn) {
2153						var loggedStr = decodeURIComponent(getCookie('_anchorguest'));
2154						var loggedInfo = loggedStr.length ? JSON.parse(loggedStr) : {};
2155						console.log('onAuthChange', event, loggedInfo);
2156						jQuery('.user-not-login').addClass('hide');
2157						jQuery('.show-logged-section').removeClass('hide');
2158						jQuery('.show-login-section').addClass('hide');
2159						jQuery('.nav-account-login').removeClass('hide');
2160						jQuery('.nav-logged-in').removeClass('hide');
2161						jQuery('.nav-logged-in span').html(loggedInfo.name);
2162						var userOffers = decodeURIComponent(getCookie('_anchorcustomeraccount'));
2163						var userHasOffers = userOffers.length ? JSON.parse(userOffers) : {};
2164						if(userHasOffers.numberOfOffers > 0) {
2165							jQuery('.offers-count').removeClass('d-none');
2166							jQuery('.offers-count').html(userHasOffers.numberOfOffers);
2167						}
2168					} else {
2169						var loggedStr = decodeURIComponent(getCookie('_anchorguest'));
2170						var loggedInfo = loggedStr.length ? JSON.parse(loggedStr) : {};
2171						//console.log('onAuthChange', event, loggedInfo);
2172						jQuery('.user-not-login').removeClass('hide');
2173						jQuery('.show-logged-section').addClass('hide');
2174						jQuery('.show-login-section').removeClass('hide');
2175						jQuery('.nav-account-login').removeClass('hide');
2176						jQuery('.nav-logged-in').addClass('hide');
2177						jQuery('.nav-logged-in span').html('');
2178					}
2179				},
2180				openChatWithUs: function () {
2181					const button = document.getElementsByClassName('helpButtonEnabled')[0];
2182					if (button) {
2183						button.click();
2184					}
2185				},
2186				onGoCityWebRedeem: function(event) {
2187					//console.log('onGoCityWebRedeem', event);
2188					var tourProp = {
2189						propertyID: myObj.property_id,
2190						bookingTypeId: (event.payload || []).bookingTypeId || '0',
2191						companyId: (event.payload || []).companyId || '0',
2192						goCityPasscode: (event.payload || []).goCityPasscode || '',
2193						isLookupUsage: (event.payload || []).isLookupUsage || false,
2194					}
2195					openGoCityCheckoutSdk(myObj,tourProp);
2196				},
2197				redirectToPage: function(event) {
2198					console.log('redirecting to page for', event);	
2199					window.location.href = ((event || {}).payload || {}).url;
2200				},
2201				onFetchCartSuccess: function(event) {
2202					console.log('onFetchCartSuccess', event);
2203					function getCurrencySymbol(currency) {
2204						switch (currency) {
2205							case 'USD':
2206								return '$';
2207							case 'GBP':
2208								return '£';
2209							case 'EUR':
2210								return '€';
2211							case 'CAD':
2212								return 'C$';
2213							case 'AUD':
2214								return 'A$';
2215							default:
2216								return '$'; // Default to USD symbol if unknown
2217						}
2218					}
2219					if (event.payload.cartItems.length) {
2220						var productCurrency = getCurrencySymbol(event.payload.currency);
2221						var formattedTotal = parseFloat(event.payload.cartSummary.total).toFixed(2);
2222						jQuery('.sticky-cart-bar-total').html(productCurrency + formattedTotal);
2223						jQuery('.sticky-cart-bar').removeClass('hide');
2224					} else {
2225						jQuery('.sticky-cart-bar').addClass('hide');
2226					}
2227				},
2228			}, myObj.settings.sdk_placeholder_id)
2229				.then(function (instance) {_HBCOMMERCEINSTANCE_ = instance;})
2230				.catch(function (err) { console.log("Error launching commerce sdk", err); });
2231		});
2232	}
2233
2234    if(myObj.settings.show_scroll_up) {
2235        window.addEventListener("scroll", function(event) {
2236            var top = this.scrollY;
2237            scrollElementTopY = jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first ).offset().top;
2238            var height = jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first ).height();
2239            scrollElementBottomY = scrollElementTopY + height - window.innerHeight + 100;
2240            //console.log('top', top, scrollElementTopY, scrollElementBottomY, height, window.innerHeight);
2241            if(top >= scrollElementTopY + window.innerHeight && top <= scrollElementBottomY) {
2242                jQuery('.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' a.element-scroll-up').addClass('show');
2243            } else {
2244                jQuery('.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' a.element-scroll-up').removeClass('show');
2245            }
2246        }, false);
2247        jQuery('.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' a.element-scroll-up').on('click', function(e) {
2248            e.preventDefault();
2249            goToAnchor('#hb-commerce-root');
2250        });
2251    }
2252	
2253	jQuery('.anchor-to-algolia-search').on('click', function(e) {
2254		e.preventDefault();
2255		var algoliaId = myObj.element_id;
2256		myObj.newSearchTerm = jQuery(this).attr('data-term');
2257		myObj.newSearchTerm = myObj.newSearchTerm.split("|");
2258		
2259		myObj.newSearchTerm2 = jQuery(this).attr('data-term2') || '';
2260		myObj.newSearchTerm3 = jQuery(this).attr('data-term3') || '';
2261		myObj.newSearchTerm4 = jQuery(this).attr('data-term4') || '';
2262		myObj.newSearchTerm5 = jQuery(this).attr('data-term5') || '';
2263		
2264		myObj.newSearchGroup = jQuery(this).attr('data-group');
2265		myObj.newSearchGroup = myObj.newSearchGroup.split("|");
2266		
2267		myObj.newSearchQuery = jQuery(this).attr('data-query');
2268		goToAnchor('#'+algoliaId);
2269		if (myObj.settings.new_algolia && myObj.sdk_type === 'Search Experience') {
2270			myObj.experiencesSearchParams.searchState = myObj.experiencesSearchParams.searchState || {};
2271			myObj.experiencesSearchParams.searchState.refinementList = myObj.experiencesSearchParams.searchState.refinementList || {};
2272			myObj.experiencesSearchParams.searchState.refinementList.categoryTheme = myObj.experiencesSearchParams.searchState.refinementList.categoryTheme || [];
2273			myObj.experiencesSearchParams.searchState.refinementList.city = myObj.experiencesSearchParams.searchState.refinementList.city || [];
2274			myObj.experiencesSearchParams.searchState.query = myObj.newSearchQuery || '';
2275			//if(myObj.newSearchGroup === 'categoryTheme') {
2276			if(myObj.newSearchGroup.indexOf('categoryTheme') > -1) {
2277				var ctIndex = myObj.newSearchGroup.indexOf('categoryTheme');
2278				myObj.experiencesSearchParams.searchState.refinementList.categoryTheme = [];
2279				if(!myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.includes(myObj.newSearchTerm[ctIndex])) {
2280					myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.push(myObj.newSearchTerm[ctIndex]);
2281				}
2282				if (myObj.newSearchTerm2 && !myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.includes(myObj.newSearchTerm2)) {
2283					myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.push(myObj.newSearchTerm2);
2284				}
2285				if (myObj.newSearchTerm3 && !myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.includes(myObj.newSearchTerm3)) {
2286					myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.push(myObj.newSearchTerm3);
2287				}
2288				if (myObj.newSearchTerm4 && !myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.includes(myObj.newSearchTerm4)) {
2289					myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.push(myObj.newSearchTerm4);
2290				}
2291				if (myObj.newSearchTerm5 && !myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.includes(myObj.newSearchTerm5)) {
2292					myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.push(myObj.newSearchTerm5);
2293				}
2294			}
2295			if(myObj.newSearchGroup.indexOf('specialCouponCategories') > -1) {
2296				var couponIndex = myObj.newSearchGroup.indexOf('specialCouponCategories');
2297				myObj.experiencesSearchParams.searchState.refinementList.specialCouponCategories = [];
2298				if(!myObj.experiencesSearchParams.searchState.refinementList.specialCouponCategories.includes(myObj.newSearchTerm[couponIndex])) {
2299					myObj.experiencesSearchParams.searchState.refinementList.specialCouponCategories.push(myObj.newSearchTerm[couponIndex]);
2300				}
2301			} 
2302			//else if (myObj.newSearchGroup === 'city') {
2303			if (myObj.newSearchGroup.indexOf('city') > -1) {
2304				var cityIndex = myObj.newSearchGroup.indexOf('city');
2305				myObj.experiencesSearchParams.searchState.refinementList.city = [];
2306				if(!myObj.experiencesSearchParams.searchState.refinementList.city.includes(myObj.newSearchTerm[cityIndex])) {
2307					myObj.experiencesSearchParams.searchState.refinementList.city.push(myObj.newSearchTerm[cityIndex]);
2308				}
2309			}  
2310			//else if (myObj.newSearchGroup === 'date') {
2311			if (myObj.newSearchGroup.indexOf('date') > -1) {
2312				var dateIndex = myObj.newSearchGroup.indexOf('date');
2313				myObj.experiencesSearchParams.searchState.range = { availableDates: { min: myObj.newSearchTerm[dateIndex], max: myObj.newSearchTerm2 } };
2314			}  
2315			//else if (myObj.newSearchGroup === 'searchQuery') {
2316			if (myObj.newSearchGroup.indexOf('searchQuery') > -1) {
2317				var sqIndex = myObj.newSearchGroup.indexOf('searchQuery');
2318				myObj.experiencesSearchParams.searchState.query = myObj.newSearchTerm[sqIndex];
2319			}
2320			
2321			myObj.experiencesSearchParams.searchUrl = '';
2322			window.initSearchExperiences('search-experiences-root');
2323			window.ceSearchExperiencesParams = {
2324				searchParams: myObj.experiencesSearchParams,
2325				onHitCountChange: function(numberOfHits) {
2326					//console.log("number of results", numberOfHits);
2327					// Create the string based on the number of hits
2328					var resultsAmountString = numberOfHits === 1 ? ' (' + numberOfHits + ' Result)' : ' (' + numberOfHits + ' Results)';
2329	
2330					// Target the title element
2331					var $titleElement = jQuery('.' + myObj.settings.hb_module_name + '.' + myObj.element_first + ' .module-header .title');
2332				
2333					// Remove any previous results string (if exists)
2334					$titleElement.find('.results-amount').remove();
2335				
2336					if (numberOfHits > 0) {
2337						// Append the new string wrapped in a span
2338						$titleElement.append('<em class="results-amount">' + resultsAmountString + '</em>');
2339					}
2340					
2341					// Move marketing tiles to underneath title
2342					if(!jQuery(".hbg-custom-sdk.algolia-search-by-city .module-header + .vc_row.vc_row-fluid").length){
2343						jQuery(".hbg-generic-listing.generic-tile-list-v3").parents(".vc_row-fluid").insertAfter(".hbg-custom-sdk.algolia-search-by-city .module-header");
2344					}
2345				},
2346			}
2347			console.log('updatedsearchParams', window.ceSearchExperiencesParams);
2348		}
2349		console.log('anchor-to-algolia-search', myObj);
2350		if (!myObj.settings.new_algolia) {
2351			reloadSDKSearch(myObj);
2352		}
2353	}); 
2354	jQuery('#departure-location').on('change', function() {
2355		var selectedOption = jQuery(this).find(':selected');
2356		var algoliaId = myObj.element_id;
2357		myObj.newSearchTerm = selectedOption.attr('data-term'); // Now correctly stores the full string
2358		myObj.newSearchGroup = selectedOption.attr('data-group');
2359	
2360		goToAnchor('#' + algoliaId);
2361	
2362		if (myObj.settings.new_algolia && myObj.sdk_type === 'Search Experience') {
2363			myObj.experiencesSearchParams.searchState = myObj.experiencesSearchParams.searchState || {};
2364			myObj.experiencesSearchParams.searchState.refinementList = myObj.experiencesSearchParams.searchState.refinementList || {};
2365			myObj.experiencesSearchParams.searchState.refinementList.categoryTheme = myObj.experiencesSearchParams.searchState.refinementList.categoryTheme || [];
2366			myObj.experiencesSearchParams.searchState.refinementList.city = myObj.experiencesSearchParams.searchState.refinementList.city || [];
2367			myObj.experiencesSearchParams.searchState.query = myObj.newSearchQuery || '';
2368	
2369			if (myObj.newSearchGroup.indexOf('city') > -1) {
2370				myObj.experiencesSearchParams.searchState.refinementList.city = [];
2371	
2372				// Directly push the string instead of treating it like an array
2373				if (!myObj.experiencesSearchParams.searchState.refinementList.city.includes(myObj.newSearchTerm)) {
2374					myObj.experiencesSearchParams.searchState.refinementList.city.push(myObj.newSearchTerm);
2375				}
2376			}
2377	
2378			myObj.experiencesSearchParams.searchUrl = '';
2379			window.initSearchExperiences('search-experiences-root');
2380			window.ceSearchExperiencesParams = {
2381				searchParams: myObj.experiencesSearchParams,
2382				onHitCountChange: function(numberOfHits) {
2383					var resultsAmountString = numberOfHits === 1 ? ' (' + numberOfHits + ' Result)' : ' (' + numberOfHits + ' Results)';
2384					var $titleElement = jQuery('.' + myObj.settings.hb_module_name + '.' + myObj.element_first + ' .module-header .title');
2385					$titleElement.find('.results-amount').remove();
2386	
2387					if (numberOfHits > 0) {
2388						$titleElement.append('<em class="results-amount">' + resultsAmountString + '</em>');
2389					}
2390	
2391					if (!jQuery(".hbg-custom-sdk.algolia-search-by-city .module-header + .vc_row.vc_row-fluid").length) {
2392						jQuery(".hbg-generic-listing.generic-tile-list-v3").parents(".vc_row-fluid").insertAfter(".hbg-custom-sdk.algolia-search-by-city .module-header");
2393					}
2394				},
2395			};
2396			console.log('updatedsearchParams', window.ceSearchExperiencesParams);
2397		}
2398	
2399		console.log('departure-location change detected:', myObj);
2400	
2401		if (!myObj.settings.new_algolia) {
2402			reloadSDKSearch(myObj);
2403		}
2404	});
2405	
2406	
2407
2408	jQuery(function(){
2409		let start_date, end_date ;
2410		jQuery("#cc-search-date").daterangepicker({
2411			autoUpdateInput: false,
2412			minDate: new Date()
2413		})
2414		jQuery('#cc-search-date').on('apply.daterangepicker', function(ev, picker) {
2415		  jQuery("input#cc-search-date").val(`${picker.startDate.format('MM/DD/YYYY')} → ${picker.endDate.format('MM/DD/YYYY')}`);
2416		  start_date = picker.startDate.format('YYYYMMDD');
2417		  end_date = picker.endDate.format('YYYYMMDD');
2418		});
2419	
2420		jQuery('#cc-search-submit').on('click', function(e) {
2421			e.preventDefault();
2422			var algoliaId = myObj.element_id;
2423			myObj.newSearchTerm = jQuery('#cc-search-city').val();
2424			//console.log('selected value', myObj.newSearchTerm);
2425			//myObj.newSearchTerm = myObj.newSearchTerm.split("|");
2426			
2427			myObj.newSearchGroup = jQuery('#cc-search-date').val();
2428			console.log('start_date', start_date, 'end_date', end_date);
2429			//myObj.newSearchGroup = myObj.newSearchGroup.split("|");
2430			
2431			//myObj.newSearchQuery = jQuery(this).attr('data-query');
2432			goToAnchor('#'+algoliaId);
2433			if (myObj.settings.new_algolia && myObj.sdk_type === 'Search Experience') {
2434				myObj.experiencesSearchParams.searchState = myObj.experiencesSearchParams.searchState || {};
2435				myObj.experiencesSearchParams.searchState.refinementList = myObj.experiencesSearchParams.searchState.refinementList || {};
2436				myObj.experiencesSearchParams.searchState.refinementList.categoryTheme = myObj.experiencesSearchParams.searchState.refinementList.categoryTheme || [];
2437				myObj.experiencesSearchParams.searchState.refinementList.city = myObj.experiencesSearchParams.searchState.refinementList.city || [];
2438				//myObj.experiencesSearchParams.searchState.query = myObj.newSearchQuery || '';
2439				
2440				
2441				//else if (myObj.newSearchGroup === 'city') {
2442				if (myObj.newSearchTerm && myObj.newSearchTerm.length) {
2443					var cityIndex = myObj.newSearchTerm;
2444					myObj.experiencesSearchParams.searchState.refinementList.city = [];
2445					if(!myObj.experiencesSearchParams.searchState.refinementList.city.inclu
2445des(cityIndex)) {
2446						myObj.experiencesSearchParams.searchState.refinementList.city.push(cityIndex);
2447					}
2448				} 
2449				//else if (myObj.newSearchGroup === 'date') {
2450				//if (myObj.newSearchGroup.indexOf('date') > -1) {
2451				if (start_date && start_date.length) {
2452					//var dateIndex = myObj.newSearchGroup.indexOf('date');
2453					myObj.experiencesSearchParams.searchState.range = { availableDates: { min: start_date, max: end_date } };
2454				}  
2455				
2456				myObj.experiencesSearchParams.searchUrl = '';
2457				window.initSearchExperiences('search-experiences-root');
2458				window.ceSearchExperiencesParams = {
2459					searchParams: myObj.experiencesSearchParams,
2460					onExperiencesSearchParamsChange: function(evt) {
2461						// The code below is used to extract the city from the URL and add it to the module title
2462							// Get the current URL
2463							const currentURL = window.location.href;
2464							// Create a function to extract URL parameters as an array
2465							function getUrlParameter(name) {
2466								name = name.replace(/[[]/, '\\[').replace(/[\]]/, '\\]');
2467								const regex = new RegExp('[\\?&]' + name + '=([^&#]*)', 'g');
2468								const results = [];
2469								let match;
2470								while ((match = regex.exec(currentURL))) {
2471									const value = decodeURIComponent(match[1].replace(/\+/g, ' '));
2472									if (value.trim() !== '') {
2473										results.push(value);
2474									}
2475								}
2476								return results;
2477							}
2478							// Get the "city" parameter value(s) as an array (excluding blank values)
2479							const cityParam = getUrlParameter('city');
2480							var cityParamString = cityParam.length === 1 ? ' in ' + cityParam[0] : '';
2481							if(!jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span').length) {
2482								cityParamString = '<span class="hide">' + cityParamString + '</span>';
2483								jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title').append(cityParamString);
2484							} else {
2485								jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span').html(cityParamString);
2486							}
2487							if((cityParam.length === 1) || (cityParam.length)) {
2488								jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span').removeClass('hide');
2489								
2490								if (myObj.settings.hide_quick_filters_on_city_selection) {
2491									jQuery('.featured-filters-container').addClass('hide');
2492								}
2493							} else {
2494								jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span' ).addClass('hide');
2495								
2496								if (myObj.settings.hide_quick_filters_on_city_selection) {
2497									jQuery('.featured-filters-container').removeClass('hide');
2498								}
2499							}
2500						
2501						// The code below is to select the default city in the filters
2502							if (!myObj.experiencesSearchParams.searchState.refinementList.city) {
2503								myObj.experiencesSearchParams.searchState.refinementList.city = [];
2504								if (myObj.experiencesSearchParams.city !== undefined && myObj.experiencesSearchParams.city !== null && myObj.experiencesSearchParams.city !== '') {
2505									myObj.experiencesSearchParams.searchState.refinementList.city.push(myObj.experiencesSearchParams.city);
2506								}
2507							}
2508						  
2509						  
2510		
2511						
2512					},
2513				}
2514				console.log('updatedsearchParams', window.ceSearchExperiencesParams);
2515			}
2516			console.log('anchor-to-algolia-search', myObj);
2517			if (!myObj.settings.new_algolia) {
2518				reloadSDKSearch(myObj);
2519			}
2520		}); 
2521	})
2522		
2523}
2524
2525function openGoCityCheckoutSdk(myObj, tourProp) {
2526	//console.log('openCheckoutSdk', myObj, tourProp);
2527	jQuery('#'+myObj.settings.gocityCheckoutContainer).html('');
2528	HBCommerce.launch({
2529		propertyId: tourProp.propertyID,
2530		locale: getPageTranslation(),
2531		bookingTypeId: tourProp.bookingTypeId,
2532		customStyles: customStyles,
2533		companyCustomerId: getCookieCompanyId(),
2534		theme: 'cityexperiences',
2535		onReserveTimeout: function(event) {
2536			console.log("onReserveTimeout", event);
2537			window.history.go(-1);
2538		},
2539		flags: {
2540			initialPage: HBCommerce.ROUTES.CHECKOUT,
2541			oneTrustCookiesCheckEnabled: myObj.oneTrustCookiesCheckEnabled || false,
2542			skipSingleFormCheckout: true,
2543			tpCode: 'OMNI_NEW_YORK_PASS_WEB',
2544			useThirdPartyLayout: true,
2545			virginRedeemLayout: false,
2546		},
2547		onStageChange: function(event) {
2548			try {
2549				if (event && event.payload && event.payload.position && event.payload.position.top) {
2550					var widgetTopOffset = jQuery("#checkoutGocity").offset().top;
2551					var stickyHeaderOffset = 90;
2552					jQuery( "html, body" ).animate( { scrollTop: widgetTopOffset + event.payload.position.top - stickyHeaderOffset } );
2553				}
2554			} catch (err) {
2555				console.log("Commerce:onStageChange:error", err);
2556			}
2557		},
2558	}, myObj.settings.gocityCheckoutContainer).then(function(instance) {
2559		_HBCOMMERCEINSTANCE_ = instance;
2560	}).catch(function(err) {
2561		console.log("Error launching commerce sdk", err);
2562	});
2563}
2564
2565var loading_event_html = '<div class="loading-event"><div class="skeleton-sdk-search-wrapper"><div class="skeleton-sdk-search-filter"><span class="sdk-search-bubble"><span class="skeleton-box"></span></span><span class="sdk-search-bubble"><span class="skeleton-box"></span></span><span class="sdk-search-bubble"><span class="skeleton-box"></span></span></div><div class="skeleton-sdk-search-content row"><div class="col-sm-3"><span class="sdk-search-textbox skeleton-box"></span><span class="sdk-search-textbox skeleton-box"></span><span class="sdk-search-textbox skeleton-box"></span><span class="sdk-search-textbox skeleton-box"></span><span class="sdk-search-textbox skeleton-box"></span><span class="sdk-search-textbox skeleton-box"></span><span class="sdk-search-textarea skeleton-box"></span></div><div class="col-sm-9"><div class="sdk-search-tiles row"><div class="col-sm-4"><div class="sdk-search-tile"><div class=""><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span></div></div></div><div class="col-sm-4"><div class="sdk-search-tile"><div class=""><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span></div></div></div><div class="col-sm-4"><div class="sdk-search-tile"><div class=""><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span></div></div></div><div class="col-sm-4"><div class="sdk-search-tile"><div class=""><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span></div></div></div><div class="col-sm-4"><div class="sdk-search-tile"><div class=""><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span></div></div></div><div class="col-sm-4"><div class="sdk-search-tile"><div class=""><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span></div></div></div><div class="col-sm-4"><div class="sdk-search-tile"><div class=""><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span></div></div></div><div class="col-sm-4"><div class="sdk-search-tile"><div class=""><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span></div></div></div><div class="col-sm-4"><div class="sdk-search-tile"><div class=""><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span><span class="sdk-search-thintextbox skeleton-box"></span></div></div></div></div></div></div></div></div>';
2566
2567function reloadSDKSearch(myObj) {
2568	jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' #' + myObj.settings.sdk_placeholder_id ).html(loading_event_html);
2569	console.log('reloadSDKSearch', myObj.experiencesSearchParams);
2570	myObj.experiencesSearchParams.searchState = myObj.experiencesSearchParams.searchState || {};
2571	myObj.experiencesSearchParams.searchState.refinementList = myObj.experiencesSearchParams.searchState.refinementList || {};
2572	myObj.experiencesSearchParams.searchState.refinementList.categoryTheme = myObj.experiencesSearchParams.searchState.refinementList.categoryTheme || [];
2573	myObj.experiencesSearchParams.searchState.refinementList.city = myObj.experiencesSearchParams.searchState.refinementList.city || [];
2574	myObj.experiencesSearchParams.searchState.query = myObj.newSearchQuery || '';
2575	if(myObj.newSearchGroup === 'categoryTheme') {
2576		myObj.experiencesSearchParams.searchState.refinementList.categoryTheme = [];
2577		if(!myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.includes(myObj.newSearchTerm)) {
2578			myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.push(myObj.newSearchTerm);
2579		}
2580		if (myObj.newSearchTerm2 && !myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.includes(myObj.newSearchTerm2)) {
2581			myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.push(myObj.newSearchTerm2);
2582		}
2583		if (myObj.newSearchTerm3 && !myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.includes(myObj.newSearchTerm3)) {
2584			myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.push(myObj.newSearchTerm3);
2585		}
2586		if (myObj.newSearchTerm4 && !myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.includes(myObj.newSearchTerm4)) {
2587			myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.push(myObj.newSearchTerm4);
2588		}
2589		if (myObj.newSearchTerm5 && !myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.includes(myObj.newSearchTerm5)) {
2590			myObj.experiencesSearchParams.searchState.refinementList.categoryTheme.push(myObj.newSearchTerm5);
2591		}
2592	} else if (myObj.newSearchGroup === 'city') {
2593		myObj.experiencesSearchParams.searchState.refinementList.city = [];
2594		if(!myObj.experiencesSearchParams.searchState.refinementList.city.includes(myObj.newSearchTerm)) {
2595			myObj.experiencesSearchParams.searchState.refinementList.city.push(myObj.newSearchTerm);
2596		}
2597	}  else if (myObj.newSearchGroup === 'date') {
2598		myObj.experiencesSearchParams.searchState.range = { availableDates: { min: myObj.newSearchTerm, max: myObj.newSearchTerm2 } };
2599	}
2600	myObj.experiencesSearchParams.searchUrl = '';
2601	jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .loading-event' ).fadeOut( 'slow', function() {
2602        HBCommerce.launch({
2603            locale: getPageTranslation(),
2604            propertyId: myObj.property_id,
2605            flags: {
2606                initialPage: myObj.initial_page,
2607				controlledScroll: true,
2608                initAction: myObj.url_ac,
2609                hideTripPlannerInMyAccount: myObj.hideTripPlannerInMyAccount,
2610                viewCheckoutV2: true,
2611                makeCartPayment: myObj.make_cart_payment,
2612                singleItemCheckoutEnabled: myObj.singleItemCheckoutEnabled,
2613                cartMode: true,
2614                shoppingCartV2: true,
2615                cartCheckoutExpandableSummary: true,
2616                cartCheckout: {
2617                    showRecommendedTours: true,
2618                    enableQuickEditOrdersInCart: true,
2619                    enableQuickAddInRecommendedTours: true,
2620					cartCheckoutAds: myObj.cartCheckoutAds,
2621                },
2622                showEmailSignUpOption: myObj.showEmailSignUpOption,
2623                enableAddMoreInItineraryDetails: myObj.enableAddMoreInItineraryDetails,
2624                oneTrustCookiesCheckEnabled: myObj.oneTrustCookiesCheckEnabled || false,
2625                directUserToMyAccount: myObj.directUserToMyAccount || false,
2626                showWelcomeModal: myObj.showWelcomeModal || false,
2627				countryWithinDestinationEnabled: true,
2628				searchExperienceV2IsEnabled: false,
2629				searchExperienceV3IsEnabled: true,
2630            },
2631            proposalId: myObj.url_id,
2632            documentId: myObj.document_id,
2633            waiverId: myObj.url_id,
2634            theme: 'cityexperiences',
2635            customerInfo: {
2636                orderId: myObj.url_id
2637            },
2638            experiencesSearchParams: myObj.experiencesSearchParams,
2639            onExperiencesSearchParamsChange: function(evt) {
2640                //console.log('evtttt',evt);
2641                var searchState = evt.payload.searchState;
2642                var searchUrl = evt.payload.searchUrl;
2643                var searchCities = (evt.payload.searchState.refinementList || { }).city || [];
2644                var searchCitiesStr = searchCities.length === 1 ? ' in ' + searchCities[0] : '';
2645                //console.log('searchCitiesStr',searchCities);
2646                if(!jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span').length) {
2647                    searchCitiesStr = '<span class="hide">' + searchCitiesStr + '</span>';
2648                    jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title').append(searchCitiesStr);
2649                } else {
2650                    jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span').html(searchCitiesStr);
2651                }
2652                if((searchCities.length === 1) || (searchCities.length)) {
2653                    jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span').removeClass('hide');
2654					
2655					if (myObj.settings.hide_quick_filters_on_city_selection) {
2656						jQuery('.featured-filters-container').addClass('hide');
2657					}
2658                } else {
2659                    jQuery( '.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .module-header .title span' ).addClass('hide');
2660					
2661					if (myObj.settings.hide_quick_filters_on_city_selection) {
2662						jQuery('.featured-filters-container').removeClass('hide');
2663					}
2664                }
2665                if(window.history) {
2666                    window.history.pushState(searchState, 'Search Results', '?'+searchUrl)
2667                }
2668            },
2669            onScrollUp: function() {
2670                var widgetTopOffset = jQuery('.'+myObj.settings.hb_module_name+'.'+myObj.element_first + ' .hb-sdk-place-holder').offset().top;
2671                var stickyHeaderOffset = document.getElementById('masthead').offsetHeight;
2672                jQuery( "html, body" ).animate( { scrollTop: widgetTopOffset - stickyHeaderOffset } );
2673            },
2674            onCartChange: function(event) {
2675                console.log('onCartChange',event);
2676                var totalItemsInCart = (((event || {}).payload || {}).cartItems || []).length;
2677                var rerenderSdk = (((event || {}).payload || {}).continueShopping || false);
2678                if(totalItemsInCart === 0) {
2679                    jQuery('.continue-to-checkout' ).addClass('hide');
2680                }
2681                anchorCartChange(totalItemsInCart);
2682                if(rerenderSdk) {
2683                    window.location.href = '/';
2684                }
2685            },
2686            onQuickAddToCart: function(evt) {
2687                var addCartProp = evt.payload || {};
2688                console.log('onQuickAddToCart', addCartProp);
2689                jQuery('.calendar-drawer-wrapper').addClass('open');
2690                var orderId = addCartProp.cartOrderIdToEdit || null;
2691                var settings = {};
2692                settings.isAddon = addCartProp.isAddon || false;
2693                addToCartDrawer(addCartProp.propertyId, addCartProp.bookingTypeId, orderId, settings);
2694            },
2695			onGoToHome: function(event) {
2696				console.log('onGoToHome', event);
2697				if( event.payload.goBackLastPage || false ) {
2698					history.back();
2699				} else {
2700					location.href = '/';
2701				}
2702            },
2703        }, myObj.settings.sdk_placeholder_id)
2704            .then(function (instance) {_HBCOMMERCEINSTANCE_ = instance;})
2705            .catch(function (err) { console.log("Error launching commerce sdk", err); });
2706    });
2707}
2708
2709function goToAnchor(objId) {
2710	//console.log('calling go to anchor');
2711	//var scrollTopPx = jQuery(objId).offset().top - document.getElementById('masthead').offsetHeight - 50;
2712	var scrollTopPx = jQuery(objId).offset().top - 110;
2713	//console.log('scrollTopPx',scrollTopPx);
2714	jQuery('html, body').animate({
2715		//scrollTop: jQuery(objId).offset().top - document.getElementById('masthead').offsetHeight - 50
2716		scrollTop: jQuery(objId).offset().top - 110
2717	}, 800, function(e){
2718		
2719	});
2720	
2721}
2722
2723var testGoogtrans = getUrlParam('goog', '0') === '1';
2724if(testGoogtrans) {
2725	var newGoogTrans = '/en/'+getPageTranslation();
2726	console.log('newGoogTrans1', newGoogTrans);
2727	setCookie("googtrans", newGoogTrans, 1);
2728	console.log('newGoogTrans2', getCookie('googtrans'));	
2729}
2730
2731function closeJustAddedCartBanner() {
2732	jQuery('.just-added-to-cart-wrapper').removeClass('open');
2733	jQuery('.countdown-timer-wrapper').removeClass('hide');
2734	//console.log('removing-class-cart');
2735}
2736
2737let countDownInterval;
2738function getCountdownTimerAgainstNow(countDownDate) {
2739	var now = new Date().getTime();
2740	var distance = countDownDate - now;
2741	return distance;
2742}
2743
2744function addCountdownTimer(countDownDate, notInCartPage) {
2745	var x = setInterval(function() {
2746		// Get today's date and time
2747		var now = new Date().getTime();
2748		// Find the distance between now and the count down date
2749		var distance = countDownDate - now;
2750		// Time calculations for days, hours, minutes and seconds
2751		var days = Math.floor(distance / (1000 * 60 * 60 * 24));
2752		var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
2753		var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
2754		var seconds = Math.floor((distance % (1000 * 60)) / 1000);
2755		// If the count down is finished, write some text
2756		//console.log('distance', {distance, x});
2757		if (distance < 1) {
2758			console.log('distance less than 1');
2759			clearInterval(x);
2760			window.HBCommerceClearCart();
2761			anchorCartChange(getCartCount());
2762
2763			// Start - VWO snippet to send event when countdown expires
2764			window.VWO = window.VWO || [];
2765			VWO.event = VWO.event || function () {VWO.push(["event"].concat([].slice.call(arguments)))};
2766			VWO.event("countdown_timeout");
2767			// END - VWO snippet to send event when countdown expires
2768
2769			setCookie('cart_starts', '', 0.04167);
2770			if(jQuery('.countdown-timer').length && !notInCartPage) {
2771				location.href = location.href;
2772			}
2773		} else {
2774			// Display the result in the element with id="demo"
2775			jQuery('.countdown-timer').html( minutes + ":" + (seconds < 10 ? '0' : '') + seconds );
2776		}
2777	}, 1000);
2778}
2779
2780
2781var redirectFromCCPropList = [
2782	'hbbosco',
2783	'hbchico',
2784	'hbnyco',
2785	'hbsfco',
2786	'hblonco',
2787	'hbsdco',
2788	'hbwashdcco',
2789	'hbbalco',
2790	'hbberco',
2791	'hblbco',
2792	'hbmdrco',
2793	'hbnpbco',
2794	'hbnorfco',
2795	'hbphico',
2796	'hbsacco',
2797	'hprcco',
2798	'hbtorco',
2799	'hncco',
2800	'hbganaco',
2801	'hbpoole',
2802	'hbyork'
2803];
2804var redirectFromCCPropListUrl = [];
2805redirectFromCCPropList['hbbosco'] = '/boston/city-cruises/';
2806redirectFromCCPropList['hbchico'] = '/chicago/city-cruises/';
2807redirectFromCCPropList['hbnyco'] = '/new-york/city-cruises/';
2808redirectFromCCPropList['hbsfco'] = '/san-francisco/city-cruises/';
2809redirectFromCCPropList['hblonco'] = '/london/city-cruises';
2810redirectFromCCPropList['hbsdco'] = '/san-diego/city-cruises/';
2811redirectFromCCPropList['hbwashdcco'] = '/washington-dc/city-cruises/';
2812redirectFromCCPropList['hbbalco'] = '/baltimore/city-cruises/';
2813redirectFromCCPropList['hbberco'] = '/berkeley/city-cruises/';
2814redirectFromCCPropList['hblbco'] = '/long-beach/city-cruises/';
2815redirectFromCCPropList['hbmdrco'] = '/marina-del-rey/city-cruises/';
2816redirectFromCCPropList['hbnpbco'] = '/newport-beach/city-cruises/';
2817redirectFromCCPropList['hbnorfco'] = '/norfolk/city-cruises/';
2818redirectFromCCPropList['hbphico'] = '/philadelphia/city-cruises/';
2819redirectFromCCPropList['hbsacco'] = '/sacramento/city-cruises/';
2820redirectFromCCPropList['hprcco'] = '/alexandria/city-cruises/';
2821redirectFromCCPropList['hbtorco'] = '/toronto/city-cruises/';
2822redirectFromCCPropList['hncco'] = '/niagara/';
2823redirectFromCCPropList['hbganaco'] = '/gananoque/city-cruises/';
2824redirectFromCCPropList['hbpoole'] = '/poole/city-cruises/';
2825redirectFromCCPropList['hbyork'] = '/york/city-cruises/';
2826redirectFromCCPropList['default'] = '/';
2827
2828function redirectedFromCityCruisesDotCom() {
2829	jQuery.get( 'https://my.hornblower.com/api/nearbyCities?' +  Math.random() + overrideLatLonForNearbyCity(), function( portList ) {
2830		//console.log('redirectedFromCityCruisesDotCom',portList);
2831		for ( idx = portList.length - 1; idx >= 0; idx-- ) {
2832			if(!redirectFromCCPropList.includes(portList[idx].id || '')) {
2833				portList.splice(idx, 1);
2834			}
2835		}
2836		var redirectUrl = portList.length ? redirectFromCCPropList[portList[0].id] : redirectFromCCPropList['default'];
2837		//console.log('portList', redirectUrl);
2838		location.href = redirectUrl;
2839	});
2840}
2841
2842function findMatchingCityForLandingUrl(city) {
2843	var landingURL = {
2844		"city": city,
2845        "hasCityLandingPage": false,
2846        "city_url": ""
2847	};
2848	//hbCityLandingPage
2849	for( var idx = 0; idx < hbCityLandingPage.length; idx++ ) {
2850		if(hbCityLandingPage[idx].city === city) {
2851			landingURL.hasCityLandingPage = hbCityLandingPage[idx].hasCityLandingPage;
2852			landingURL.city_url = hbCityLandingPage[idx].city_url;
2853		}
2854	}
2855	return landingURL;
2856}
2857
2858function getAllCitiesFromSearch(search) {
2859	var cityProps = [];
2860	for( var idx = 0; idx < search.length; idx++ ) {
2861		if(!foundCityInJsonArray(cityProps, search[idx])) {
2862			if(search[idx].city !== undefined && search[idx].state !== undefined && search[idx].country !== undefined) {
2863				var cityLandingPage = findMatchingCityForLandingUrl(search[idx].city);
2864				search[idx].city_url = '';
2865				if(cityLandingPage.hasCityLandingPage) {
2866					search[idx].city_url = cityLandingPage.city_url;
2867				}
2868				cityProps.push({ city: search[idx].city, state: search[idx].state, country: search[idx].country, city_url: search[idx].city_url});
2869			}
2870		}
2871	}
2872	return cityProps;
2873}
2874
2875function returnCookieBoolean(cookieVal) {
2876	var thisVal = cookieVal || false;
2877	if(cookieVal === 'false') {
2878		return false;
2879	}
2880	if(cookieVal === 'true') {
2881		return true;
2882	}
2883	return thisVal;
2884}
2885
2886function setAffiliateCompanyProp(company, myObj) {
2887	setCookie("affiliate_company_id", company.customerId, 1);
2888	setCookie("affiliate_company_name", company.name, 1);
2889	setCookie("affiliate_contact_fname", company.contact.firstName, 1);
2890	setCookie("affiliate_contact_lname", company.contact.lastName, 1);
2891	setCookie("affiliate_contact_email", company.contact.email, 1);
2892	setCookie("affiliate_contact_phone", (company.settings.affiliateWebPhoneNumber || company.contact.phoneNumber || ''), 1);
2893	var affiliateLogo = (company.settings.affiliateLogo || '').length ? myObj.affiliateCompanyLogoPre + company.settings.affiliateLogo : '';
2894	setCookie("affiliate_logo", affiliateLogo, 1);
2895	setCookie("affiliate_logo_active", returnCookieBoolean(company.settings.afflilateIsCompanyWhiteLabelAffiliate || false), 1);	
2896	setCookie("affiliate_disable_agent_login", returnCookieBoolean(company.settings.afflilateDisableAgentLogin || false), 1);
2897	setCookie("affiliate_disable_contact_us", returnCookieBoolean(company.settings.afflilateDisableContactUs || false), 1);
2898	setCookie("affiliate_hide_about_us", returnCookieBoolean(company.settings.afflilateHideAboutUs || false), 1);
2899	setCookie("affiliate_hide_contact_us", returnCookieBoolean(company.settings.afflilateHideContactUs || false), 1);
2900	setCookie("affiliate_hide_faq", returnCookieBoolean(company.settings.afflilateHideFAQ || false), 1);
2901	setCookie("affiliate_hide_phone_number", returnCookieBoolean(company.settings.afflilateHidePhoneNumber || false), 1);
2902	setCookie("affiliate_hide_social_icons", returnCookieBoolean(company.settings.afflilateHideSocialIcons || false), 1);
2903	setCookie("affiliate_hide_work_with_us", returnCookieBoolean(company.settings.afflilateHideWorkWithUs || false), 1);
2904	if( (myObj.cpn_id || '') !== '') {
2905		setCookie("affiliate_cpn_id", myObj.cpn_id, 1);
2906	}
2907}
2908
2909function setAffiliateAgentProp(myObj) {
2910	setCookie("affiliate_company_id", myObj.company_id, 1);
2911	setCookie("affiliate_user_id", myObj.user_id, 1);
2912}
2913
2914function getCookieCompanyId() {
2915	var companyId = getCookie('affiliate_company_id');
2916	//console.log('companyId-cokkie', companyId);
2917	return companyId;
2918}
2919
2920function getCookieUserId() {
2921	var userId = getCookie('affiliate_user_id');
2922	//console.log('userId-cookie', userId);
2923	return userId;
2924}
2925
2926let searchBoxProp = { payload: {}, type: '', match_city: {} };
2927
2928function focusAndOpenKeyboard(el, timeout) {
2929  if(!timeout) {
2930    timeout = 100;
2931  }
2932  if(el) {
2933    // Align temp input element approximately where the input element is
2934    // so the cursor doesn't jump around
2935    var __tempEl__ = document.createElement('input');
2936    __tempEl__.style.position = 'absolute';
2937    __tempEl__.style.top = (el.offsetTop + 7) + 'px';
2938    __tempEl__.style.left = el.offsetLeft + 'px';
2939    __tempEl__.style.height = 0;
2940    __tempEl__.style.opacity = 0;
2941    // Put this temp element as a child of the page <body> and focus on it
2942    document.body.appendChild(__tempEl__);
2943    __tempEl__.focus();
2944
2945    // The keyboard is open. Now do a delayed focus on the target element
2946    setTimeout(function() {
2947      el.focus();
2948      el.click();
2949      // Remove the temp element
2950      document.body.removeChild(__tempEl__);
2951    }, timeout);
2952  }
2953}
2954
2955function renderNavTopExperiences(listing) {
2956	var html = '';
2957	var commerceAssetUrl = 'https://images.hornblower.com/186x110/';
2958	var maxDisplay = 10;
2959	var maxListCount = listing.length > maxDisplay ? maxDisplay : listing.length;
2960	for( var i = 0; i < maxListCount; i++) {
2961		html += '<div>';
2962		html += '<a href="'+listing[i].permalink+'">';
2963		html += '<img src="'+commerceAssetUrl+listing[i].media.images.url+'" />';
2964		html += '</a>';
2965		html += '<a href="'+listing[i].permalink+'">';
2966		html += listing[i].localizedInfo.en.title;
2967		html += '</a>';
2968		html += '</div>';
2969		/*<div>
2970<a href="#"><img src="https://assets.cityexperiences.com/wp-content/uploads/2023/08/alacatraz-flyer.jpg" alt="Featured Experience - Alcatraz"></a>
2971<a href="#">Alcatraz</a>
2972</div>*/
2973	}
2974	return html;
2975}
2976
2977function top_experiences_loaded() {
2978	if(jQuery('.nav-top-experiences-wrapper').length) {
2979		jQuery.get( 'https://my.hornblower.com/api/nearbyCities?' + Math.random() + overrideLatLonForNearbyCity(), function( portList ) {
2980			portList = overrideNearByCities(portList, 0);
2981			var myObj = {};
2982			myObj.listing = cex_top_experiences_tours.unavailable;
2983			var experiencesPortList = [];
2984			portList = portList.filter(function(item) {
2985				if(item.city.startsWith('experiences')) { experiencesPortList.push(item); }
2986				return !item.city.startsWith('experiences');
2987			});
2988			portList = portList.concat(experiencesPortList);
2989			myObj.listing = arrangeListByGeoLoc(myObj.listing, portList);
2990			var navTopExperiencesHtml = renderNavTopExperiences(myObj.listing);
2991			//console.log('top_experiences_loaded', {myObj,portList,navTopExperiencesHtml});
2992			jQuery('.nav-top-experiences-wrapper').html(navTopExperiencesHtml);
2993		});
2994	}
2995}
2996
2997var hideDateJustAddedCart = [];
2998hideDateJustAddedCart['hexco'] = [0,2];	// array of bookingTypeId
2999
3000function showDateJustAddedCart(item) {
3001	var showDate = true;
3002	showDate = hideDateJustAddedCart[item.propertyId] === undefined || !hideDateJustAddedCart[item.propertyId].includes(item.bookingTypeId) ? showDate : false;
3003	console.log('showDateJustAddedCart', {item, showDate});
3004	return showDate;
3005}
3006
3007function isJSON(str) {
3008    try {
3009        return (JSON.parse(str) && !!str);
3010    } catch (e) {
3011        return false;
3012    }
3013}
3014
3015function getMyTripCount() {
3016	var tripCookieStr = getCookie('_mytripcount');
3017	var tripCookie = isJSON(decodeURIComponent(tripCookieStr)) ? jQuery.parseJSON(decodeURIComponent(tripCookieStr)) : {};
3018	var tripCount = tripCookie.tripCount || 0;
3019	//console.log('tripCount', tripCount);
3020	return tripCount;
3021}
3022
3023function updateMyTripcount() {
3024	var myTripCount = getMyTripCount();
3025	var userLoggedStr = decodeURIComponent(getCookie('_anchorguest'));
3026	var userLoggedIn = userLoggedStr.length ? JSON.parse(userLoggedStr) : {};
3027	//console.log('updateMyTripcount', myTripCount);
3028	if(userLoggedIn.isLoggedIn && myTripCount > 0) {
3029		jQuery('ul.logged-user-menu li.my-trip .trip-count').html(myTripCount);
3030		jQuery('ul.logged-user-menu li.my-trip .trip-count').addClass('open');
3031		jQuery('#mobile-account-modal .trip-count').html(myTripCount);
3032		jQuery('#mobile-account-modal .trip-count').addClass('open');
3033	}
3034}
3035
3036(function ($) {
3037    $(document).ready(function () {
3038
3039		selected_currency = getCurrentCurrency();
3040		
3041		/*if(getCookie('dest-language') === '' ||  getCookie('dest-language') !== getPageTranslation()) {
3042			setCookie("dest-language", getPageTranslation(), 1);
3043			setCookie("googtrans", '/en/'+getPageTranslation(), 1);
3044			console.log('setting translation', getCookie('googtrans'))
3045		}*/
3046		//console.log('getPageTranslation', getPageTranslation());
3047		
3048		var dclid = getUrlParam('dclid', '');
3049		if(dclid.length) {
3050			setCookie("dclid", dclid, 1);
3051		}
3052		
3053		
3054		var userLoggedStr = decodeURIComponent(getCookie('_anchorguest'));
3055		var userLoggedIn = userLoggedStr.length ? JSON.parse(userLoggedStr) : {};
3056		var enableLoginWithPhoneNumber = getUrlParam('use_tel','').length > 0 ? true : true;
3057		var defaultToLoginByPassword = true;
3058		var useSignInPopupFlow = true;
3059		var showCountOnAccountTabs = true;
3060		if(userLoggedIn.isLoggedIn) {
3061			$('.user-not-login').addClass('hide');
3062			$('#mobile-account-modal .show-login-section').addClass('hide');
3063			$('.show-logged-section').removeClass('hide');
3064			$('.nav-account-login').removeClass('hide');
3065			$('.nav-logged-in span').html(userLoggedIn.name);
3066			$('.nav-logged-in-mobile span.initial').html('<img src="https://assets.cityexperiences.com/wp-content/uploads/2023/07/user-check-blue.png" style="width: 23px;">');
3067			// The code below is used to show the default user icon with checkmark if the user's name is Guest, and first initial if user has a name assigned to profile.
3068			/* var firstInitial = userLoggedIn.name.substring(0, 1);
3069			if (userLoggedIn.name === "Guest") {
3070				$('.nav-logged-in-mobile span.initial').html('<img src="https://assets.cityexperiences.com/wp-content/uploads/2023/07/user-check-blue.png" style="width: 23px;">');
3071			} else {
3072				var firstInitial = userLoggedIn.name.substring(0, 1);
3073				$('.nav-logged-in-mobile span.initial').html(firstInitial);
3074			} */
3075			var userOffers = decodeURIComponent(getCookie('_anchorcustomeraccount'));
3076			var userHasOffers = userOffers.length ? JSON.parse(userOffers) : {};
3077			if(userHasOffers.numberOfOffers > 0) {
3078				$('.offers-count').removeClass('d-none');
3079				$('.offers-count').html(userHasOffers.numberOfOffers);
3080			}
3081		} else {
3082			//console.log('show-login-section');
3083			$('.nav-logged-in').addClass('hide');
3084			$('.nav-logged-in-mobile').addClass('hide');
3085			$('.nav-account-login').removeClass('hide');
3086			//$('.nav-account-login').addClass('pointer');
3087			//$('.show-login-section').removeClass('hide');
3088		}
3089		$('.nav-login-link').on('click', function(e) {
3090			e.preventDefault();
3091			$('#modalLogin').modal('toggle');
3092			$('#modalSdkLogin').html('');
3093			console.log('calling-here');
3094			HBCommerce.launch({
3095				locale: getPageTranslation(),
3096				theme: 'cityexperiences',
3097				flags: {
3098					initialPage: HBCommerce.ROUTES.MYACCOUNT,
3099					controlledScroll: true,
3100					useOtpLogin: true,
3101					viewCheckoutV2: true,
3102					showEmailSignUpOption: true,
3103					accountNavLogin: true,
3104					enableLoginWithPhoneNumber: enableLoginWithPhoneNumber,
3105					defaultToLoginByPassword: defaultToLoginByPassword,
3106					useSignInPopupFlow: useSignInPopupFlow,
3107					showCountOnAccountTabs: showCountOnAccountTabs,
3108					onlyFetchLoginCookies: true,
3109				},
3110				onAuthChange: function(event) {
3111					if(event.payload.isLoggedIn) {
3112						var loggedStr = decodeURIComponent(getCookie('_anchorguest'));
3113						var loggedInfo = loggedStr.length ? JSON.parse(loggedStr) : {};
3114						console.log('onAuthChange-1', event, loggedInfo);
3115						$('.user-not-login').addClass('hide');
3116						$('.show-logged-section').removeClass('hide');
3117						$('.show-login-section').addClass('hide');
3118						$('.nav-account-login').removeClass('hide');
3119						$('.nav-logged-in').removeClass('hide');
3120						$('.nav-logged-in span').html(loggedInfo.name);
3121						$('.nav-logged-in-mobile span.initial').html('<img src="https://assets.cityexperiences.com/wp-content/uploads/2023/07/user-check-blue.png" style="width: 23px;">');
3122						//$('#modalLogin').modal('toggle');
3123						//$('.nav-account-login').removeClass('pointer');
3124						//console.log('logged-in', event);
3125						//updateMyTripcount();
3126						//location.href = location.href;
3127						
3128						
3129						setTimeout(function() {
3130							var userOffers = decodeURIComponent(getCookie('_anchorcustomeraccount'));
3131							var userHasOffers = userOffers.length ? JSON.parse(userOffers) : {};
3132							if(userHasOffers.numberOfOffers > 0) {
3133								$('.offers-count').removeClass('d-none');
3134								$('.offers-count').html(userHasOffers.numberOfOffers);
3135							}
3136						}, 2000);
3137					}
3138				},
3139				onFetchCustomerAccount: function(event) {
3140					console.log('onFetchCustomerAccount', event);
3141					//$('#modalLogin').modal('toggle');		// why need to toggle modal????
3142					$('.nav-account-login').removeClass('pointer');
3143					updateMyTripcount();
3144					//location.href = location.href;
3145				},
3146			}, 'modalSdkLogin')
3147				.then(function (instance) {_HBCOMMERCEINSTANCE_ = instance;})
3148				.catch(function (err) { console.log("Error launching commerce sdk", err); });
3149			console.log('login modal');
3150		});
3151		$('.nav-account-login-disabled').hover(function(e) {
3152			if(!$('.show-login-section').hasClass('hide') && !$('.show-login-section-inner').html().length) {
3153				HBCommerce.launch({
3154					locale: getPageTranslation(),
3155					theme: 'cityexperiences',
3156					flags: {
3157						initialPage: HBCommerce.ROUTES.MYACCOUNT,
3158						controlledScroll: true,
3159						useOtpLogin: true,
3160						viewCheckoutV2: true,
3161						showEmailSignUpOption: true,
3162						accountNavLogin: true,
3163						enableLoginWithPhoneNumber: enableLoginWithPhoneNumber,
3164						defaultToLoginByPassword: defaultToLoginByPassword,
3165						useSignInPopupFlow: useSignInPopupFlow,
3166						showCountOnAccountTabs: showCountOnAccountTabs
3167					},
3168					onAuthChange: function(event) {
3169						if(event.payload.isLoggedIn) {
3170							var loggedStr = decodeURIComponent(getCookie('_anchorguest'));
3171							var loggedInfo = loggedStr.length ? JSON.parse(loggedStr) : {};
3172							console.log('onAuthChange', event, loggedInfo);
3173							$('.user-not-login').addClass('hide');
3174							$('.show-logged-section').removeClass('hide');
3175							$('.show-login-section').addClass('hide');
3176							$('.nav-account-login').removeClass('hide');
3177							$('.nav-logged-in').removeClass('hide');
3178							$('.nav-logged-in span').html(loggedInfo.name);
3179							$('.nav-logged-in-mobile span.initial').html('<img src="https://assets.cityexperiences.com/wp-content/uploads/2023/07/user-check-blue.png" style="width: 23px;">');
3180							setTimeout(function() {
3181								var userOffers = decodeURIComponent(getCookie('_anchorcustomeraccount'));
3182								var userHasOffers = userOffers.length ? JSON.parse(userOffers) : {};
3183								if(userHasOffers.numberOfOffers > 0) {
3184									$('.offers-count').removeClass('d-none');
3185									$('.offers-count').html(userHasOffers.numberOfOffers);
3186								}
3187							}, 2000);
3188						}
3189					},
3190					}, 'navSdkLogin')
3191						.then(function (instance) {_HBCOMMERCEINSTANCE_ = instance;})
3192						.catch(function (err) { console.log("Error launching commerce sdk", err); });
3193			}
3194		});
3195		$('a.user-logout-action').on('click', function(e) {
3196			e.preventDefault();
3197			$('a.user-logout-action').addClass('hide');
3198			$('.logging-out').removeClass('hide');
3199			console.log('user-logout-action-1');
3200			HBCommerce.launch({
3201				locale: getPageTranslation(),
3202				flags: {
3203					initialPage: '/logout',
3204					controlledScroll: true,
3205					forceLogout: true,
3206				},
3207				onAuthChange: function(event) {
3208					var loggedStr = decodeURIComponent(getCookie('_anchorguest'));
3209					var loggedInfo = loggedStr.length ? JSON.parse(loggedStr) : {};
3210					console.log('onAuthChange-logout', {event, loggedStr, loggedInfo});
3211					if(event.payload.isLoggedIn) {
3212						$('.user-not-login').removeClass('hide');
3213						$('.show-logged-section').addClass('hide');
3214						$('.show-login-section').removeClass('hide');
3215						$('.nav-account-login').removeClass('hide');
3216						$('.nav-logged-in').addClass('hide');
3217						$('.nav-logged-in-mobile').addClass('hide');
3218						$('.nav-logged-in span').html('');
3219						$('.nav-logged-in-mobile span').html('');
3220						$('.show-login-section-inner').html('');
3221						$('a.user-logout-action').removeClass('hide');
3222						$('.logging-out').addClass('hide');
3223						$('#mobile-account-modal').modal('hide');
3224						//location.href = location.href;
3225						setTimeout(function() {
3226							location.href = location.href;
3227						}, 1000);
3228					}
3229				},
3230			}, 'logoutSDK')
3231				.then(function (instance) {_HBCOMMERCEINSTANCE_ = instance;})
3232				.catch(function (err) { console.log("Error launching commerce sdk", err); });
3233		});
3234		$('.mobile-account').on('click', function(e) {
3235			if(!$('.modal .show-login-section').hasClass('hide') && !$('.modal .show-login-section-inner').html().length) {
3236				HBCommerce.launch({
3237					locale: getPageTranslation(),
3238					flags: {
3239						initialPage: HBCommerce.ROUTES.MYACCOUNT,
3240						controlledScroll: true,
3241						useOtpLogin: true,
3242						viewCheckoutV2: true,
3243						showEmailSignUpOption: true,
3244						accountNavLogin: true,
3245						enableLoginWithPhoneNumber: enableLoginWithPhoneNumber,
3246						defaultToLoginByPassword: defaultToLoginByPassword,
3247						useSignInPopupFlow: useSignInPopupFlow,
3248						showCountOnAccountTabs: showCountOnAccountTabs,
3249						onlyFetchLoginCookies: true,					
3250					},
3251					onAuthChange: function(event) {
3252						if(event.payload.isLoggedIn) {
3253							var loggedStr = decodeURIComponent(getCookie('_anchorguest'));
3254							var loggedInfo = loggedStr.length ? JSON.parse(loggedStr) : {};
3255							console.log('onAuthChange-login', event, loggedInfo);
3256							$('.user-not-login').addClass('hide');
3257							$('.show-logged-section').removeClass('hide');
3258							$('.show-login-section').addClass('hide');
3259							$('.nav-account-login').removeClass('hide');
3260							$('.nav-logged-in').removeClass('hide');
3261							$('.nav-logged-in-mobile').removeClass('hide');
3262							$('.nav-logged-in-mobile span.initial').html('<img src="https://assets.cityexperiences.com/wp-content/uploads/2023/07/user-check-blue.png" style="width: 23px;">');
3263							$('#modalLogin').modal('toggle');
3264							$('.nav-account-login').removeClass('pointer');
3265							location.href = location.href;
3266							setTimeout(function() {
3267								var userOffers = decodeURIComponent(getCookie('_anchorcustomeraccount'));
3268								var userHasOffers = userOffers.length ? JSON.parse(userOffers) : {};
3269								if(userHasOffers.numberOfOffers > 0) {
3270									$('.offers-count').removeClass('d-none');
3271									$('.offers-count').html(userHasOffers.numberOfOffers);
3272								}
3273							}, 2000);
3274							// The code below is used to show the default user icon with checkmark if the user's name is Guest, and first initial if user has a name assigned to profile.
3275							/* var firstInitial = loggedInfo.name.substring(0, 1);
3276							if (loggedInfo.name === "Guest") {
3277								$('.nav-logged-in-mobile span.initial').html('<img src="https://assets.cityexperiences.com/wp-content/uploads/2023/07/user-check-blue.png" style="width: 23px;">');
3278							} else {
3279								var firstInitial = loggedInfo.name.substring(0, 1);
3280								$('.nav-logged-in-mobile span.initial').html(firstInitial);
3281							} */
3282						}
3283					},
3284					}, 'modalSdkLogin')
3285						.then(function (instance) {_HBCOMMERCEINSTANCE_ = instance;})
3286						.catch(function (err) { console.log("Error launching commerce sdk", err); });
3287			}
3288		});
3289		//console.log('userLoggedIn', userLoggedIn);
3290
3291		if ($('.algolia-search-by-city').length > 0) {
3292			$('.new-nav-menu20-top .mobile-search').hide();
3293			$('.search-xperience-new').hide();
3294		}
3295		
3296		
3297		$(window).click(function() {
3298			if($('a.above-nav-searchxp').hasClass('hide')) {
3299				$('a.above-nav-searchxp').removeClass('hide');
3300				$('.above-nav-section ul.actual-searchxp').addClass('hide');
3301				$('.top-search-suggestion-wrapper').removeClass('focus')
3302				$('li.my-account span').addClass('show');
3303				$('li.nav-gift a span span').removeClass("hide").addClass('show');
3304				$('li.nav-phone-number .pnumber').addClass('show');
3305			}
3306			if($('ul.onepress-menu > li.menu-item-has-children.menu-clicked').length) {
3307				$('ul.onepress-menu > li.menu-item-has-children.menu-clicked').removeClass('menu-clicked')
3308			}
3309		});
3310		
3311		$('a.fake-link-behind-nav').on('click', function(e) {
3312			e.preventDefault();
3313			$('body').removeClass('onepress-menu-mobile-opening');
3314			$('ul.onepress-menu').removeClass('onepress-menu-mobile');
3315			$('#nav-toggle').removeClass('nav-is-visible');
3316		});
3317
3318		
3319		// The code below dynamically adds the submenu items for Our Brands City Cruises, Walks, and Devour
3320		var classesToCheck = ["statue-cruises"];
3321		// Check if body contains any of the specified classes
3322		var bodyContainsClass = $('body').is(function() {
3323			var bodyClasses = $(this).attr('class') || '';
3324			return classesToCheck.some(function(className) {
3325				return bodyClasses.split(' ').includes(className);
3326			});
3327		});
3328		// If body doesn't contain any of the specified classes, execute code
3329		if (!bodyContainsClass) {
3330			// Your code to run if body doesn't contain any of the specified classes
3331		
3332			if ($('.new-nav-menu20-left .onepress-menu > li > a:contains("Our Brands")').length > 0) {	
3333				// Submenu for City Cruises under Our Brands
3334				$(".new-nav-menu20-left .onepress-menu > li > .dropdown-menu ul > li > a").filter(function() {
3335					return $(this).text().trim() === "City Cruises";
3336				}).each(function() {
3337					//console.log($(this));
3338					$(this).parent().addClass("nav-submenu2 menu-item-has-children dropdown child-dropdown");
3339					$(this).before(
3340						'<div class="nav-toggle-subarrow"><i class="fa fa-angle-down" aria-hidden="true"></i></div>'
3341					);
3342					$(this).after(
3343						"<div class='dropdown-menu sub-dropdown-menu'><ul role='menu'><li id='' class='d-block d-sm-none close-main-nav menu-item menu-item-type-custom menu-item-object-custom'><a href='#'>Close Menu</a></li><li id='' class='d-block d-sm-none nav-back-link-sub2 menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item'><a href='/'>Back</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom d-md-none'><a href='/city-cruises/'>All City Cruises Destinations</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/alexandria/city-cruises/'>Alexandria</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/baltimore/city-cruises/'>Baltimore</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/berkeley/city-cruises/'>Berkeley</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/boston/city-cruises/'>Boston</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/chicago/city-cruises/'>Chicago</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/gananoque/city-cruises/'>Gananoque</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/london/city-cruises/'>London</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/long-beach/city-cruises/'>Long Beach</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/marina-del-rey/city-cruises/'>Marina del Rey</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/newport-beach/city-cruises/'>Newport Beach</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/new-york/city-cruises/'>New York City</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/niagara/'>Niagara Falls (Canada)</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/norfolk/city-cruises/'>Norfolk</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/philadelphia/city-cruises/'>Philadelphia</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/sacramento/city-cruises/'>Sacramento</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/san-diego/city-cruises/'>San Diego</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/san-francisco/city-cruises/'>San Francisco</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/toronto/city-cruises/'>Toronto</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/washington-dc/city-cruises/'>Washington DC</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/weehawken/city-cruises/'>Weehawken</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/york/city-cruises/'>York</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/city-cruises/live/'>LIVE Experiences</a></li></ul></div>"
3344					);
3345				});
3346
3347				// Submenu for Walks under Our Brands
3348				$(".new-nav-menu20-left .onepress-menu > li > .dropdown-menu ul > li > a").filter(function() {
3349					return $(this).text().trim() === "Walks";
3350				}).each(function() {
3351					//console.log($(this));
3352					$(this).parent().addClass("nav-submenu2 menu-item-has-children dropdown child-dropdown");
3353					$(this).before(
3354						'<div class="nav-toggle-subarrow"><i class="fa fa-angle-down" aria-hidden="true"></i></div>'
3355					);
3356					$(this).after(
3357						"<div class='dropdown-menu sub-dropdown-menu'><ul role='menu'><li id='' class='d-block d-sm-none close-main-nav menu-item menu-item-type-custom menu-item-object-custom'><a href='#'>Close Menu</a></li><li id='' class='d-block d-sm-none nav-back-link-sub2 menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item'><a href='/'>Back</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom d-md-none'><a href='/walks/'>All Walks Destinations</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Amsterdam&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=Devour%20Tours&brandTag=Walks&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Amsterdam</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/barcelona/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Barcelona&&audience=&durationTiming=&webCategoriesMain=&brandTag=Devour%20Tours&brandTag=Walks&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Barcelona</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Bologna&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false&showSpecialOffers=false'>Bologna</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Bordeaux&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false&showSpecialOffers=false'>Bordeaux</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/boston/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Boston&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Boston</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Dublin&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Dublin</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/edinburgh/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Edinburgh&audie
3357nce=&durationTiming=&webCategoriesMain=&brandTag=Walks&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Edinburgh</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/florence/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Florence&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Florence</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&specialCouponCategories=&city=Lisbon&country=&categoryTheme=&webCategoriesMain=&durationTiming=&brandTag=Walks&brandTag=Devour%20Tours&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Lisbon</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/london/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=London%20(Central)&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>London (Central)</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&specialCouponCategories=&city=London%20Bridge&country=&categoryTheme=&webCategoriesMain=&durationTiming=&brandTag=Walks&brandTag=Devour%20Tours&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>London Bridge</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/madrid/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Madrid&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false+'>Madrid</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Milan&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Milan</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Naples&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Naples</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/new-york/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=New%20York&city=New%20York%20City&city=Jersey%20City&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>New York City</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/niagara/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Niagara%20Falls%20(CA)&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Niagara Falls (CA)</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/paris/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Paris&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Paris</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Pompeii&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Pompeii</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/rome/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Rome&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Rome</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&specialCouponCategories=&city=San%20Sebastian&country=&categoryTheme=&webCategoriesMain=&durationTiming=&brandTag=Walks&brandTag=Devour%20Tours&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>San Sebastian</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&specialCouponCategories=&city=Seville&country=&categoryTheme=&webCategoriesMain=&durationTiming=&brandTag=Walks&brandTag=Devour%20Tours&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Seville</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&specialCouponCategories=&city=Vatican%20City&country=&categoryTheme=&webCategoriesMain=&durationTiming=&brandTag=Walks&brandTag=Devour%20Tours&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Vatican City</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/venice/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Venice&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Venice</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/washington-dc/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Washington%20DC&city=Alexandria&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Washington DC</a></li></ul></div>"
3358					);
3359				});
3360
3361				// Submenu for Devour Tours under Our Brands
3362				$(".new-nav-menu20-left .onepress-menu > li > .dropdown-menu ul > li > a").filter(function() {
3363					return $(this).text().trim() === "Devour Tours";
3364				}).each(function() {
3365					//console.log($(this));
3366					$(this).parent().addClass("nav-submenu2 menu-item-has-children dropdown child-dropdown");
3367					$(this).before(
3368						'<div class="nav-toggle-subarrow"><i class="fa fa-angle-down" aria-hidden="true"></i></div>'
3369					);
3370					$(this).after(
3371						"<div class='dropdown-menu sub-dropdown-menu'><ul role='menu'><li id='' class='d-block d-sm-none close-main-nav menu-item menu-item-type-custom menu-item-object-custom'><a href='#'>Close Menu</a></li><li id='' class='d-block d-sm-none nav-back-link-sub2 menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item'><a href='/'>Back</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom d-md-none'><a href='/devour-tours/'>All Devour Tours Destinations</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Amsterdam&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=Devour%20Tours&brandTag=Walks&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Amsterdam</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/barcelona/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Barcelona&&audience=&durationTiming=&webCategoriesMain=&brandTag=Devour%20Tours&brandTag=Walks&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Barcelona</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Bologna&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false&showSpecialOffers=false'>Bologna</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Bordeaux&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false&showSpecialOffers=false'>Bordeaux</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/boston/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Boston&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Boston</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Dublin&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Dublin</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/florence/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Florence&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Florence</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&specialCouponCategories=&city=Lisbon&country=&categoryTheme=&webCategoriesMain=&durationTiming=&brandTag=Walks&brandTag=Devour%20Tours&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Lisbon</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/london/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=London%20(Central)&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>London (Central)</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&specialCouponCategories=&city=London%20Bridge&country=&categoryTheme=&webCategoriesMain=&durationTiming=&brandTag=Walks&brandTag=Devour%20Tours&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>London Bridge</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/madrid/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Madrid&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false+'>Madrid</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Milan&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Milan</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Naples&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Naples</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/new-york/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=New%20York&city=New%20York%20City&city=Jersey%20City&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>New York City</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/niagara/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Niagara%20Falls%20(CA)&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Niagara Falls (CA)</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/paris/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Paris&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Paris</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Pompeii&categoryTheme=&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Pompeii</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/rome/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Rome&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Rome</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&specialCouponCategories=&city=San%20Sebastian&country=&categoryTheme=&webCategoriesMain=&durationTiming=&brandTag=Walks&brandTag=Devour%20Tours&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>San Sebastian</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&specialCouponCategories=&city=Seville&country=&categoryTheme=&webCategoriesMain=&durationTiming=&brandTag=Walks&brandTag=Devour%20Tours&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Seville</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/search-results/?pageNo=1&query=&sortBy=prodv3_ce_experiences&specialCouponCategories=&city=Vatican%20City&country=&categoryTheme=&webCategoriesMain=&durationTiming=&brandTag=Walks&brandTag=Devour%20Tours&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Vatican City</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/venice/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Venice&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&brandTag=Devour%20Tours&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Venice</a></li><li id='' class='menu-item menu-item-type-custom menu-item-object-custom'><a href='/washington-dc/?pageNo=1&query=&sortBy=prodv3_ce_experiences&destination=&country=&city=Washington%20DC&city=Alexandria&&audience=&durationTiming=&webCategoriesMain=&brandTag=Walks&priceMin=&priceMax=&dateMin=&dateMax=&hierarchical.lvl0=&showPriceWithFees=false'>Washington DC</a></li></ul></div>"
3372					);
3373				});
3374			}
3375		}
3376		
3377
3378		var top_search_prop = [];
3379		top_search_prop.start_date = getTodayDateOrUrlParam('nodate','YYYYMMDD');
3380		//top_search_prop.start_date = '';
3381		top_search_prop.end_date = getTodayDateOrUrlParam('nodate','YYYYMMDD');
3382		//top_search_prop.end_date = '';
3383		top_search_prop.end_date = top_search_prop.end_date < top_search_prop.start_date ? top_search_prop.start_date : top_search_prop.end_date;
3384		//top_search_prop.start_date_str = convertDateByFormat(top_search_prop.start_date,'YYYYMMDD','MM/DD/YYYY');
3385		//top_search_prop.start_date_str = '';
3386		//top_searc
3386h_prop.end_date_str = convertDateByFormat(top_search_prop.end_date,'YYYYMMDD','MM/DD/YYYY');
3387		//top_search_prop.end_date_str = '';
3388
3389		/*$('#searchxpdate').daterangepicker({
3390			maxSpan: {
3391				days: 7
3392			},
3393			singleDatePicker: true,
3394			autoApply: true,
3395			autoUpdateInput: true,
3396			locale: {
3397				format: 'DD MMM YYYY',
3398				cancelLabel: 'Clear'
3399			},
3400		}, function(start, end, label) {
3401			top_search_prop.start_date = start.format('YYYYMMDD');
3402			top_search_prop.end_date = end.format('YYYYMMDD');
3403		});
3404		$('#searchxpdate').focus(function() {
3405			$('.top-search-suggestion-wrapper').removeClass('focus');
3406			//console.log('focus-cal');
3407			$('.daterangepicker.show-calendar').on('click', function(e) {
3408				//console.log('cal-clicked');
3409				event.stopPropagation();
3410			});
3411		});
3412		$('#searchxpdate').on('cancel.daterangepicker', function(ev, picker) {
3413			$(this).val('');
3414			top_search_prop.start_date = '';
3415			top_search_prop.end_date = '';
3416			event.stopPropagation();
3417		});
3418		$('#searchxpdate').on('apply.daterangepicker', function(ev, picker) {
3419			//$(this).val(picker.startDate.format('DD MMM YYYY') + ' - ' + picker.endDate.format('DD MMM YYYY'));
3420			$(this).val(picker.startDate.format('DD MMM YYYY'));
3421			top_search_prop.start_date = picker.startDate.format('YYYYMMDD');;
3422			top_search_prop.end_date = picker.endDate.format('YYYYMMDD');;
3423			event.stopPropagation();
3424		});
3425
3426		// Add a change event to the date range picker to show/hide the clear button (x)
3427		$('#searchxpdate').on('change', function() {
3428			if ($(this).val().length > 0) {
3429				$('.clearDateHeader').show();
3430			} else {
3431				$('.clearDateHeader').hide();
3432			}
3433		});
3434
3435		// Add a click event to the clear button to clear the date field
3436		$('.clearDateHeader').click(function() {
3437			$('#searchxpdate').val('');
3438			top_search_prop.start_date = '';
3439			top_search_prop.end_date = '';
3440			event.stopPropagation();
3441			$(this).hide();
3442		});
3443
3444		// Add a change event to the date range picker to show/hide the clear button (x)
3445		$('#searchxpdate').on('change', function() {
3446			if ($(this).val().length > 0) {
3447				$('.clearDateHeader').show();
3448			} else {
3449				$('.clearDateHeader').hide();
3450			}
3451		});*/
3452
3453		$("input#searchxpword").on('keyup', function (e) {
3454			if (e.key === 'Enter' || e.keyCode === 13) {
3455				addKeywordToPreviousResultCookie($('#searchxpword').val());
3456				location.href = '/search-results/?query=' + $('#searchxpword').val() + '&dateMin=' + top_search_prop.start_date + '&dateMax=' + top_search_prop.end_date + '&city=';
3457			}
3458		});
3459		
3460		function convertSearchDateToTourDate(str) {
3461			var newStr = str === undefined ? '' : str.slice(4,6) + '/' + str.slice(6,8) + '/' + str.slice(0,4);
3462			return newStr;
3463		}
3464		
3465		$('#searchxpbtn').on('click', function(e) {
3466			top_search_prop.start_date = $('#search-autocomplete-top .dateBoxInput').attr("data-start-date");
3467			top_search_prop.end_date = $('#search-autocomplete-top .dateBoxInput').attr("data-end-date");
3468			e.preventDefault();
3469			var q = $('#search-autocomplete-top input.searchBoxInput').val();
3470			var countryCityStr = '';
3471			window.addRecentSearchToIdb({ query: q, type: 'manual' })
3472			var useCountry = $('#search-exp-use-country').val() !== undefined && $('#search-exp-use-country').val() === 'true';
3473			var countryName = $('#search-exp-country').val() !== undefined && $('#search-exp-country').val() !== '' ? $('#search-exp-country').val() : '';
3474			var cityName = $('#search-exp-city').val() !== undefined && $('#search-exp-city').val() !== '' ? $('#search-exp-city').val() : '';
3475			if(useCountry && countryName.length) {
3476				countryCityStr = '&country='+countryName;
3477			}
3478			if(!useCountry && cityName.length) {
3479				countryCityStr = '&city='+cityName;
3480			}
3481			var searchURL = '/search-results/?query=' + q + '&dateMin=' + top_search_prop.start_date + '&dateMax=' + top_search_prop.end_date + countryCityStr;
3482			//console.log('searchURL', top_search_prop, searchURL);
3483			/*if(parseInt(getUrlParam('new_search', 0)) === 1) {*/
3484				//console.log('searchBoxProp', {searchBoxProp,top_search_prop,searchURL});
3485				if (searchBoxProp.type === 'experience') {
3486					//console.log('experience');
3487					var p = (searchBoxProp.payload.crossSellPermalinks.cityexperiences || searchBoxProp.payload.permalink) + '?date=' + convertSearchDateToTourDate(top_search_prop.start_date);
3488					//location.href = p;
3489				} else if (searchBoxProp.type === 'eventSpace') {
3490					//console.log('eventSpace');
3491					location.href = searchBoxProp.payload.permalink;
3492				} else if (searchBoxProp.type === 'destination') {
3493					searchURL = '/search-results/?city=' + searchBoxProp.match_city.city + '&dateMin=' + top_search_prop.start_date + '&dateMax=' + top_search_prop.end_date + countryCityStr;
3494					//console.log('destination',searchURL);
3495					location.href = searchURL;
3496				} else {
3497					//console.log('else');
3498					location.href = searchURL;
3499				}
3500			/*} else {
3501				location.href = searchURL;
3502			}*/
3503			return false;
3504		});
3505
3506		$('#searchxpbtn-onhomepage').on('click', function(e) {
3507			top_search_prop.start_date = $('#search-autocomplete-onhomepage .dateBoxInput').attr("data-start-date");
3508			top_search_prop.end_date = $('#search-autocomplete-onhomepage .dateBoxInput').attr("data-end-date");
3509			e.preventDefault();
3510			var q = $('#search-autocomplete-onhomepage input.searchBoxInput').val();
3511			var countryCityStr = '';
3512			window.addRecentSearchToIdb({ query: q, type: 'manual' })
3513			var useCountry = $('#search-exp-use-country').val() !== undefined && $('#search-exp-use-country').val() === 'true';
3514			var countryName = $('#search-exp-country').val() !== undefined && $('#search-exp-country').val() !== '' ? $('#search-exp-country').val() : '';
3515			var cityName = $('#search-exp-city').val() !== undefined && $('#search-exp-city').val() !== '' ? $('#search-exp-city').val() : '';
3516			if(useCountry && countryName.length) {
3517				countryCityStr = '&country='+countryName;
3518			}
3519			if(!useCountry && cityName.length) {
3520				countryCityStr = '&city='+cityName;
3521			}
3522			var searchURL = '/search-results/?query=' + q + '&dateMin=' + top_search_prop.start_date + '&dateMax=' + top_search_prop.end_date + countryCityStr;
3523			//console.log('searchURL', top_search_prop, searchURL);
3524			/*if(parseInt(getUrlParam('new_search', 0)) === 1) {*/
3525				//console.log('searchBoxProp', {searchBoxProp,top_search_prop,searchURL});
3526				if (searchBoxProp.type === 'experience') {
3527					console.log('experience');
3528					var p = (searchBoxProp.payload.crossSellPermalinks.cityexperiences || searchBoxProp.payload.permalink) + '?date=' + convertSearchDateToTourDate(top_search_prop.start_date);
3529					//location.href = p;
3530				} else if (searchBoxProp.type === 'eventSpace') {
3531					//console.log('eventSpace');
3532					location.href = searchBoxProp.payload.permalink;
3533				} else if (searchBoxProp.type === 'destination') {
3534					searchURL = '/search-results/?city=' + searchBoxProp.match_city.city + '&dateMin=' + top_search_prop.start_date + '&dateMax=' + top_search_prop.end_date + countryCityStr;
3535					//console.log('destination',searchURL);
3536					location.href = searchURL;
3537				} else {
3538					console.log('else');
3539					location.href = searchURL;
3540				}
3541			/*} else {
3542				location.href = searchURL;
3543			}*/
3544			return false;
3545		});
3546				
3547		/*$('#searchxpdate-mobile').daterangepicker({
3548			maxSpan: {
3549				days: 7
3550			},
3551			singleDatePicker: true,
3552			autoApply: true,
3553			autoUpdateInput: true,
3554			locale: {
3555				format: 'DD MMM YYYY',
3556				cancelLabel: 'Clear'
3557			},
3558		}, function(start, end, label) {
3559			top_search_prop.start_date = start.format('YYYYMMDD');
3560			top_search_prop.end_date = end.format('YYYYMMDD');
3561		});*/
3562		/*$('#searchxpdate-mobile').on('cancel.daterangepicker', function(ev, picker) {
3563			$(this).val('');
3564			top_search_prop.start_date = '';
3565			top_search_prop.end_date = '';
3566			event.stopPropagation();
3567		});
3568		$('#searchxpdate-mobile').on('apply.daterangepicker', function(ev, picker) {
3569			//$(this).val(picker.startDate.format('DD MMM YYYY') + ' - ' + picker.endDate.format('DD MMM YYYY'));
3570			$(this).val(picker.startDate.format('DD MMM YYYY'));
3571			top_search_prop.start_date = picker.startDate.format('YYYYMMDD');;
3572			top_search_prop.end_date = picker.endDate.format('YYYYMMDD');;
3573			event.stopPropagation();
3574		});*/
3575
3576		$('#searchxpbtn-mobile').on('click', function(e) {
3577			top_search_prop.start_date = $('#search-autocomplete-mobile .dateBoxInput').attr("data-start-date");
3578			top_search_prop.end_date = $('#search-autocomplete-mobile .dateBoxInput').attr("data-end-date");
3579			e.preventDefault();
3580			var q = $('#search-autocomplete-mobile input.searchBoxInput').val();
3581			window.addRecentSearchToIdb({ query: q, type: 'manual' })
3582			var countryCityStr = '';
3583			var useCountry = $('#search-exp-use-country').val() !== undefined && $('#search-exp-use-country').val() === 'true';
3584			var countryName = $('#search-exp-country').val() !== undefined && $('#search-exp-country').val() !== '' ? $('#search-exp-country').val() : '';
3585			var cityName = $('#search-exp-city').val() !== undefined && $('#search-exp-city').val() !== '' ? $('#search-exp-city').val() : '';
3586			if(useCountry && countryName.length) {
3587				countryCityStr = '&country='+countryName;
3588			}
3589			if(!useCountry && cityName.length) {
3590				countryCityStr = '&city='+cityName;
3591			}
3592			location.href = '/search-results/?query=' + q + '&dateMin=' + top_search_prop.start_date + '&dateMax=' + top_search_prop.end_date + countryCityStr;
3593			return false;
3594		});
3595
3596		$('.activate-searchxp a.above-nav-searchxp').on('click', function(e) {
3597			e.preventDefault();
3598			$('.activate-searchxp a.above-nav-searchxp').addClass('hide');
3599			$('.activate-searchxp ul.actual-searchxp').removeClass('hide');
3600			$('li.my-account span').removeClass('show');
3601			$('li.nav-gift a span span').removeClass('show').addClass("hide");
3602			$('li.nav-phone-number .pnumber').removeClass('show');
3603			event.stopPropagation();
3604		});
3605
3606		// Add a change event to the date range picker to show/hide the clear button (x)
3607		$('#searchxpdate-mobile').on('change', function() {
3608			if ($(this).val().length > 0) {
3609				$('.clearDateHeaderMobile').show();
3610			} else {
3611				$('.clearDateHeaderMobile').hide();
3612			}
3613		});
3614
3615		// Add a click event to the clear button to clear the date field
3616		$('.clearDateHeaderMobile').click(function() {
3617			$('#searchxpdate-mobile').val('');
3618			top_search_prop.start_date = '';
3619			top_search_prop.end_date = '';
3620			$(this).hide();
3621		});
3622		
3623		myCheckTopNavTimeout = setInterval(checkTopNavSearchXp, 1000);
3624
3625		$('a.mobile-close-nav').on('click', function(e) {
3626			e.preventDefault();
3627			$('body').removeClass('onepress-menu-mobile-opening');
3628			$('ul.onepress-menu').removeClass('onepress-menu-mobile');
3629			$('#nav-toggle').removeClass('nav-is-visible');
3630		});
3631		
3632		$('li.nav-back-link > a').on('click', function(e) {
3633			e.preventDefault();
3634			$('li.child-dropdown').removeClass('nav-toggle-dropdown');
3635			console.log('inhere-back');
3636			event.stopPropagation();
3637		});
3638		$('li.nav-back-link-sub > a').on('click', function(e) {
3639			e.preventDefault();
3640			$('li.child-dropdown.nav-submenu').removeClass('nav-toggle-dropdown');
3641			console.log('inhere2');
3642		});
3643		$('li.nav-back-link-sub2 > a').on('click', function(e) {
3644			e.preventDefault();
3645			console.log('closing sub sub nav');
3646			$('li.child-dropdown.nav-submenu2').removeClass('nav-toggle-dropdown');
3647		});
3648		$('li.close-main-nav > a').on('click', function(e) {
3649			e.preventDefault();
3650			$('li.child-dropdown').removeClass('nav-toggle-dropdown');
3651			$('li.child-dropdown.nav-submenu').removeClass('nav-toggle-dropdown');
3652			$('li.child-dropdown.nav-submenu2').removeClass('nav-toggle-dropdown');
3653			$('body').removeClass('onepress-menu-mobile-opening');
3654			$('ul.onepress-menu').removeClass('onepress-menu-mobile');
3655			$('#nav-toggle').removeClass('nav-is-visible');
3656		})
3657		
3658		$('li.developer-link a').on('click', function(e) {
3659			e.preventDefault();
3660			window.open("https://devshop.hornblower.com/docs");
3661		});
3662
3663		var cartMode = getCartMode();
3664		
3665		if(cartMode) {
3666			var cartCount = getCartCount();
3667			anchorCartChange(cartCount);
3668		}
3669
3670		/*$('li.mobile-searchxp').click(function(event){
3671			if($('a.above-nav-searchxp').hasClass('hide')) {
3672				event.stopPropagation();
3673			}
3674			//console.log('stop click');
3675		});*/
3676		$('li.search-xperience').click(function(event){
3677			if($('a.above-nav-searchxp').hasClass('hide')) {
3678				event.stopPropagation();
3679			}
3680		});
3681
3682		$('a.dest-nav-region-link').on('click', function(e) {
3683			e.preventDefault();
3684			if(!$(this).hasClass('selected')) {
3685				var divName = $(this).attr('data-name');
3686				$('a.dest-nav-region-link').removeClass('selected');
3687				$('.dest-nav-region-wrapper').removeClass('open')
3688				$(this).addClass('selected')
3689				$('.dest-nav-region-wrapper.'+divName).addClass('open')
3690			}
3691		});
3692
3693		function setDefaultDestinationNav() {
3694			$.get( 'https://my.hornblower.com/api/nearbyCities?idx=cealgolia&' + Math.random(), function( portList ) {
3695
3696				if (portList.length > 0 && portList[0].state !== 'California') {
3697					$('body').addClass('ca-not-closest-port');
3698				}
3699			});
3700
3701			var usaDestinations = ['/berkeley/', '/long-beach/', '/marina-del-rey/', '/newport-beach/', '/sacramento/', '/san-diego/', '/san-francisco/', '/alexandria/', '/washington-dc/', '/boston/', '/chicago/', '/new-jersey/', '/new-york/', '/weehawken/', '/philadelphia/', '/baltimore/', '/norfolk/'];
3702			var ukDestinations = ['/london/', '/poole/', '/york/', '/paris/', '/florence/', '/rome/', '/venice/', '/barcelona/', '/madrid/', '/edinburgh/'];
3703			var canadaDestinations = ['/gananoque/', '/toronto/', '/niagara-ca/'];
3704			// Get current page URL
3705			var currentPageUrl = window.location.href;
3706			// Check for matches in each array
3707			var matchedArray = null;
3708			var matchedDestination = null;
3709			$.each([usaDestinations, ukDestinations, canadaDestinations], function(index, destinationArray) {
3710				for (var i = 0; i < destinationArray.length; i++) {
3711					if (currentPageUrl.indexOf(destinationArray[i]) !== -1) {
3712						matchedArray = index;
3713						matchedDestination = destinationArray[i];
3714						break;
3715					}
3716				}
3717				if (matchedArray !== null) {
3718					return false; // Break out of the loop if a match is found
3719				}
3720			});
3721			// Output result
3722			if (matchedArray !== null) {
3723				if (matchedArray === 0) {
3724					//console.log("Current page is a USA destination: " + matchedDestination);
3725					//console.log('USA appears first in the list for nav');
3726					$('.dest-nav-region-link').removeClass('selected');
3727					$('.dest-nav-region-link[data-name="region-usa"]').addClass('selected');
3728					$('.dest-nav-region-wrapper').removeClass('open');
3729					$('.dest-nav-region-wrapper.region-usa').addClass('open');
3730				} else if (matchedArray === 1) {
3731					//console.log("Current page is a UK destination: " + matchedDestination);
3732					//console.log('UK appears first in the list for nav');
3733					$('.dest-nav-region-link').removeClass('selected');
3734					$('.dest-nav-region-link[data-name="region-europe"]').addClass('selected');
3735					$('.dest-nav-region-wrapper').removeClass('open');
3736					$('.dest-nav-region-wrapper.region-europe').addClass('open');
3737				} else if (matchedArray === 2) {
3738					//console.log("Current page is a Canada destination: " + matchedDestination);
3739					//console.log('Canada appears first in the list for nav');
3740					$('.dest-nav-region-link').removeClass('selected');
3741					$('.dest-nav-region-link[data-name="region-canada"]').addClass('selected');
3742					$('.dest-nav-region-wrapper').removeClass('open');
3743					$('.dest-nav-region-wrapper.region-canada').addClass('open');
3744				}
3745			} else {
3746				//console.log("Current page is not a destination.");
3747				$.get( 'https://my.hornblower.com/api/nearbyCities?idx=cealgolia&' + Math.random(), function( portList ) {
3748					let ukFirst = false;
3749					let usaFirst = false;
3750					let canadaFirst = false;
3751
3752					for (let i = 0; i < portList.length; i++) {
3753						const portInfo = portList[i];
3754						if (portInfo.countryCode === 'UK') {
3755							ukFirst = true;
3756							break;
3757						} else if (portInfo.countryCode === 'USA') {
3758							usaFirst = true;
3759							break;
3760						} else if (portInfo.countryCode === 'CAN') {
3761							canadaFirst = true;
3762							break;
3763						}
3764					}
3765					// Check to see which one appears first and set classes for corresponding divs
3766					if (ukFirst) {
3767						//console.log('UK appears first in the list for nav');
3768						$('.dest-nav-region-link').removeClass('selected');
3769						$('.dest-nav-region-link[data-name="region-europe"]').addClass('selected');
3770						$('.dest-nav-region-wrapper').removeClass('open');
3771						$('.dest-nav-region-wrapper.region-europe').addClass('open');
3772					} else if (canadaFirst) {
3773						//console.log('Canada appears first in the list for nav');
3774						$('.dest-nav-region-link').removeClass('selected');
3775						$('.dest-nav-region-link[data-name="region-canada"]').addClass('selected');
3776						$('.dest-nav-region-wrapper').removeClass('open');
3777						$('.dest-nav-region-wrapper.region-canada').addClass('open');
3778					} else {
3779						//console.log('USA appears first in the list for nav');
3780						$('.dest-nav-region-link').removeClass('selected');
3781						$('.dest-nav-region-link[data-name="region-usa"]').addClass('selected');
3782						$('.dest-nav-region-wrapper').removeClass('open');
3783						$('.dest-nav-region-wrapper.region-usa').addClass('open');
3784					}
3785				});
3786			}
3787		}
3788		setDefaultDestinationNav();
3789		
3790		$('ul.onepress-menu > li.menu-item-has-children > a').on('mouseover', function(e) {
3791			//e.preventDefault();
3792			//event.stopPropagation();
3793			var parentMenu = $(this).parent();
3794			//if(parentMenu.hasClass('menu-clicked')) {
3795				//parentMenu.removeClass('menu-clicked')
3796			//} else {
3797				$('ul.onepress-menu > li.menu-item-has-children').removeClass('menu-clicked');
3798				parentMenu.addClass('menu-clicked')
3799			// }
3800		});
3801		$('body').on('mouseleave', ".onepress-menu, .onepress-menu>li.menu-clicked > .dropdown-menu", function(e) {
3802			$('ul.onepress-menu > li.menu-item-has-children').removeClass('menu-clicked');
3803			//$('ul.onepress-menu > li.menu-item-has-children.new-dest-nav').addClass('menu-clicked');
3804		});
3805		$('ul.onepress-menu > li:not(.menu-item-has-children) > a').on('mouseover', function(e) {
3806			$('ul.onepress-menu > li.menu-item-has-children').removeClass('menu-clicked');
3807		});
3808		$('.destination-nav-region-wrapper').on('click', function(e) {
3809			event.stopPropagation();
3810		});
3811		
3812		
3813		// open chat manually
3814		$(".chat-btn-manual-trigger").on("click", function(e){
3815			e.preventDefault();
3816			$(".embeddedServiceHelpButton .helpButton .uiButton").click();
3817		})
3818		
3819		var selectedPhoneNumber = searchPhoneNumberByPath();
3820		$('li.nav-phone-number a.nav-phone-link .pnumber').html(selectedPhoneNumber.phone);
3821		$('li.nav-phone-number a.nav-phone-link .tool-tip').html(selectedPhoneNumber.phone);
3822		$('li.nav-phone-number a.nav-phone-link').attr('href','tel:'+selectedPhoneNumber.phoneToDial);
3823		var phoneNumberOr = selectedPhoneNumber.sms ? " or" : "";
3824		$('li.main-nav-phone-number > a').html('Call ' + selectedPhoneNumber.phone + phoneNumberOr);
3825		$('li.main-nav-phone-number > a').attr('href','tel:'+selectedPhoneNumber.phoneToDial);
3826		if(selectedPhoneNumber.sms) {
3827			$('li.nav-phone-number a.nav-phone-link .tool-tip').addClass('has-sms');
3828			$('li.nav-phone-number a.nav-phone-link .tool-tip').html('Phone Number<br><span class="underline">'+selectedPhoneNumber.phone+'<span>');
3829			$('li.nav-phone-number a.nav-phone-link .tool-tip-sms').html('<a href="sms:' + selectedPhoneNumber.sms + '">Text Message<br><span class="underline">' + selectedPhoneNumber.sms + '</span></a>');
3830			$('li.main-nav-sms-number > a').html('Text ' + selectedPhoneNumber.sms);
3831			$('li.main-nav-sms-number > a').attr('href','sms:'+selectedPhoneNumber.sms);
3832		}
3833		if(!selectedPhoneNumber.sms) {
3834			$('li.nav-phone-number a.nav-phone-link .tool-tip-sms').remove();
3835			$('li.main-nav-sms-number > a').remove();
3836		}
3837		$("li.nav-phone-number.nav-phone-number-expanded .pnumber-wrapper span").html(selectedPhoneNumber.phone);
3838		//console.log('selectedPhoneNumber', selectedPhoneNumber);
3839		if(selectedPhoneNumber.hideSearch || false) {
3840			$('li.search-xperience-new').addClass('hide');
3841		}
3842		if(!selectedPhoneNumber.hideIcon) {
3843			$('li.nav-phone-number').removeClass('hide');
3844		}
3845		if(selectedPhoneNumber.hideIcon) {
3846			$('li.main-nav-phone-number').addClass('d-none');
3847		}
3848		
3849		let topInterval;
3850		topInterval = setInterval(() => {
3851			if (window.initSearchAutoComplete) {
3852				if($('#search-autocomplete-top').length) {
3853					withRotatingPopularSearch = true;
3854					animatedRotatingTerms = true;
3855					// Check if the device is iPad portrait orientation or smaller
3856					function isIPadPortraitOrSmaller() {
3857						return window.matchMedia("(max-width: 820px) and (orientation: portrait)").matches;
3858					}
3859					
3860					// Run code if the device is iPad portrait orientation or smaller
3861					if (isIPadPortraitOrSmaller()) {
3862						// Your code here
3863						//console.log("Running code for iPad portrait orientation or smaller.");
3864						window.initSearchAutoComplete('search-autocomplete-top', {withDatePicker: true, orientation: 'vertical'});
3865					} else {
3866						//console.log('this part of the code is firing');
3867						//console.log(withRotatingPopularSearch);
3868
3869						if (withRotatingPopularSearch && animatedRotatingTerms) {
3870							window.initSearchAutoComplete('search-autocomplete-top', {withDatePicker: true, withRotatingPopularSearch: withRotatingPopularSearch, animatedRotatingTerms: animatedRotatingTerms, isManualRotatingSearchTermsEnable: 'Statue of Liberty, Alcatraz, Niagara Falls, Things to do in New York, Holidays in San Francisco, Fireworks, Historic cruise, Sightseeing Cruise, Holiday Cruise'});
3871						} else if (withRotatingPopularSearch) {
3872							window.initSearchAutoComplete('search-autocomplete-top', {withDatePicker: true, withRotatingPopularSearch: withRotatingPopularSearch, isManualRotatingSearchTermsEnable: 'Statue of Liberty, Alcatraz, Niagara Falls, Things to do in New York, Holidays in San Francisco, Fireworks, Historic cruise, Sightseeing Cruise, Holiday Cruise'});
3873						} else {
3874							window.initSearchAutoComplete('search-autocomplete-top', {withDatePicker: true, withRotatingPopularSearch: withRotatingPopularSearch });
3875						}
3876					}  
3877					
3878				}
3879				clearInterval(topInterval);
3880			}
3881		}, 500);
3882
3883		let onhomepageInterval;
3884		onhomepageInterval = setInterval(() => {
3885			if (window.initSearchAutoComplete) {
3886				if($('#search-autocomplete-onhomepage').length) {
3887					withRotatingPopularSearch = true;
3888					// Check if the device is iPad portrait orientation or smaller
3889					function isIPadPortraitOrSmaller() {
3890						return window.matchMedia("(max-width: 820px) and (orientation: portrait)").matches;
3891					}
3892					
3893					// Run code if the device is iPad portrait orientation or smaller
3894					if (isIPadPortraitOrSmaller()) {
3895						// Your code here
3896						//console.log("Running code for iPad portrait orientation or smaller.");
3897						window.initSearchAutoComplete('search-autocomplete-onhomepage', {withDatePicker: true, orientation: 'vertical'});
3898					} else {
3899						window.initSearchAutoComplete('search-autocomplete-onhomepage', {withDatePicker: true, withRotatingPopularSearch: true});
3900					}  
3901					
3902				}
3903				clearInterval(onhomepageInterval);
3904			}
3905		}, 500);
3906		
3907		let mobileInterval;
3908		mobileInterval = setInterval(() => {
3909			if (window.initSearchAutoComplete) {
3910				if($('#search-autocomplete-mobile').length) {
3911					window.initSearchAutoComplete('search-autocomplete-mobile', {withDatePicker: true});
3912					$('#mobile-search-modal').on('shown.bs.modal', function () {
3913						//$('#search-autocomplete-mobile input.searchBoxInput').focus().click();
3914					});
3915				}
3916				clearInterval(mobileInterval);
3917			}
3918		}, 500);
3919				
3920		window.onSearchAutoCompleteSubmit = function(payload) {
3921			//console.log('onSearchAutoCompleteSubmit',payload);
3922			top_search_prop.start_date = $('#search-autocomplete-top .dateBoxInput').attr("data-start-date");
3923			top_search_prop.end_date = $('#search-autocomplete-top .dateBoxInput').attr("data-end-date");
3924			var inCity = $('#search-exp-city').length ? $('#search-exp-city').val() : '';
3925			var t = payload.type || '';
3926			var q = payload.query || '';
3927			var c = payload.city || '';
3928			console.log('type',t);
3929			if (t === 'destination') {
3930				var matchedCity = findMatchingCityForLandingUrl(c);
3931				searchBoxProp.match_city = matchedCity;
3932				searchBoxProp.type = t;
3933				//console.log('store-data',searchBoxProp);
3934				/*if(parseInt(getUrlParam('new_search', 0)) !== 1) {
3935					if(matchedCity.hasCityLandingPage) {
3936							location.href = matchedCity.city_url;
3937					} else {
3938						location.href = '/search-results/?city='+c;
3939					}
3940				}*/
3941			} else {
3942				if(t === 'popular') {
3943					//location.href = '/search-results/?query='+q;
3944				} else if (t === 'experience') {
3945					var p = (payload.crossSellPermalinks.cityexperiences || payload.permalink) + '?date=' + convertSearchDateToTourDate(top_search_prop.start_date);
3946					location.href = p;
3947				} else if (t === 'manual') {
3948					location.href = '/search-results/?query='+q+'&city='+inCity;
3949				} else if (t === 'eventSpace') {
3950					location.href = payload.permalink;
3951				}
3952			}
3953			//hbCityLandingPage
3954		};
3955
3956
3957		
3958
3959
3960
3961
3962		/*$('.mobile-search').on('click', function(e) {
3963			e.preventDefault();
3964			$('a#nav-toggle').addClass('nav-is-visible');
3965			$('body').addClass('onepress-menu-mobile-opening');
3966			$('ul.onepress-menu').addClass('onepress-menu-mobile');
3967		});*/
3968		
3969		var justAddedCart = parseInt(getUrlParam('added','0')) === 1;
3970		var justAddedComboCart = parseInt(getUrlParam('addedcombo','0')) === 1;
3971		var alreadyInCart = parseInt(getUrlParam('already','0')) === 1;
3972		var notInCartPage = parseInt(getUrlParam('notInCart','0')) === 1;
3973		var thisCartInfo = getCartInfo();
3974		
3975		var cartStartStr = getCookie('cart_starts');
3976		var cartStart = cartStartStr.length ? new Date(cartStartStr) : new Date();
3977		if(!cartStartStr.length && (thisCartInfo.cartItems||[]).length ) {
3978			setCookie('cart_starts', cartStart, 0.04167);
3979		}
3980		
3981		var countdownTimerStartAt = 20;		// this number is in minutes
3982		
3983		if( justAddedCart || justAddedComboCart || alreadyInCart || (thisCartInfo.totalItems || 0 ) > 0 ) {
3984			//console.log('cart-timer', cartStart);
3985			if(justAddedCart) {
3986				var lastCartItem = thisCartInfo.cartItems[thisCartInfo.cartItems.length-1];
3987				$('.just-added-item-image img').attr('src', 'https://images.hornblower.com/fit-in/400x300/' + lastCartItem.tourImage);
3988				$('.just-added-item-title').html(lastCartItem.tourName);
3989				$('.just-added-item-date').html( (showDateJustAddedCart(lastCartItem) ? lastCartItem.tourDateTimeFormatted : '') );
3990				$('.just-added-to-cart-wrapper').addClass('open');
3991				var overrideUrl = location.href.replace('added=1', '');			
3992				window.history.pushState('removeAdded', '', overrideUrl);
3993				setTimeout(closeJustAddedCartBanner, 7000);
3994				cartStart = new Date();
3995				setCookie('cart_starts', cartStart, 0.04167);
3996			}
3997			if(justAddedComboCart) {
3998				var lastCartItem = thisCartInfo.cartItems[thisCartInfo.cartItems.length-1];
3999				var lastAddedCombo = getCookie('last_visit_combo').length ? JSON.parse(getCookie('last_visit_combo')) : { };
4000				var lastAddedComboBookId = (lastAddedCombo.booking_ids || []).split(',');
4001				//console.log('justAddedComboCart', {lastAddedCombo, lastCartItem, lastAddedComboBookId});
4002				if(lastAddedComboBookId.includes(lastCartItem.bookingTypeId + '')) {
4003					$('.just-added-item-image img').attr('src', 'https://images.hornblower.com/fit-in/400x300/' + lastAddedCombo.tourImage);
4004					$('.just-added-item-title').html(lastAddedCombo.tourName);
4005					$('.just-added-item-date').html('');
4006					$('.just-added-to-cart-wrapper').addClass('open');
4007					var overrideUrl = location.href.replace('addedcombo=1', '');			
4008					window.history.pushState('removeAdded', '', overrideUrl);				
4009					setTimeout(closeJustAddedCartBanner, 7000);
4010				}
4011				cartStart = new Date();
4012				setCookie('cart_starts', cartStart, 0.04167);
4013			}
4014			var countDownDate = new Date();
4015			countDownDate.setTime(cartStart.getTime() + (countdownTimerStartAt * 60 * 1000));
4016			addCountdownTimer(countDownDate, false);
4017			if(!justAddedCart && !justAddedComboCart && !alreadyInCart) {
4018				$('.countdown-timer-wrapper').removeClass('hide');
4019			}
4020		}
4021		if( notInCartPage && (thisCartInfo.totalItems || 0 ) ) {
4022			//console.log('notInCartPage', notInCartPage);
4023			var oldDateObj = new Date();
4024			var countDownDate = new Date();
4025			countDownDate.setTime(oldDateObj.getTime() + (countdownTimerStartAt * 60 * 1000));
4026			if(true && cartStartStr.length) {
4027				addCountdownTimer(countDownDate, notInCartPage);
4028			}
4029		}
4030		
4031		if($('.redirect-from-cc-action').length) {
4032			redirectedFromCityCruisesDotCom();
4033		}
4034		
4035
4036// 		$(".new-nav-menu20-top .mobile-search, .mobile-search-cta .btn.btn-primary").on("click", function(){
4037// 			var myElement = document.querySelector('#search-autocomplete-mobile input.searchBoxInput');
4038// 			var modalFadeInDuration = 300;
4039// 			focusAndOpenKeyboard(myElement, modalFadeInDuration);
4040// 		})
4041		
4042		
4043		//updateMyTripcount();
4044		var myTripCount = getMyTripCount();
4045		if ( userLoggedIn.isLoggedIn && myTripCount > 0 ) {
4046			//console.log('myTripCount');
4047			$('ul.logged-user-menu li.my-trip .trip-count').html(myTripCount);
4048			$('ul.logged-user-menu li.my-trip .trip-count').addClass('open');
4049		}
4050		
4051		if(location.pathname === '/thank-you-for-subscribing/') {
4052			setCookie("newsletter_signedup", '1', 1);
4053		}
4054		
4055		if(getCookie('newsletter_signedup') === '1') {
4056			$('.full-newsletter-row').addClass('hide');
4057		} else {
4058			console.log('newsletter-not-sign');
4059		}
4060
4061		
4062	});
4063})(jQuery);

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.