PageSourceSearch

https://www.thehotelgaribaldi.com/scripts/booking.js?1702336375

js thehotelgaribaldi.com collected 2026-10-10 02:44:46 UTC 3,488 bytes, 122 lines download raw bytes

1//Default Text
2	(function( $ ){
3	  $.fn.defaultText = function () {
4	    $(this).focus(function(srcc)
5	    {
6	        if ($(this).val() == $(this)[0].title)
7	        {
8	            $(this).removeClass("defaultTextActive");
9	            $(this).val("");
10	        }
11	    });
12	    
13	    $(this).blur(function()
14	    {
15	        if ($(this).val() == "")
16	        {
17	            $(this).addClass("defaultTextActive");
18	            $(this).val($(this)[0].title);
19	        }
20	    });
21	    
22	    $(this).blur();        
23	  };
24	})( jQuery );
25
26	jQuery(document).ready(function($) {
27		( function letCalendar (arrival, departure) {
28			$(arrival).defaultText();
29			$(departure).defaultText();
30			var today = new Date();
31			$(arrival).datepicker({
32				minDate : '0d',
33				defaultDate: +0,
34				setDate: '07/12/2014',
35				onSelect : function(dateStr) {
36					var arrivalDate = $(this).datepicker("getDate");
37					var departureDate = $(departure).datepicker("getDate");
38
39					if (arrivalDate >= departureDate)
40					{
41						arrivalDate.setDate(arrivalDate.getDate()+2);
42						$(departure).datepicker("setDate", arrivalDate);
43					}
44				}
45			});
46
47			/*	Sets the default arrival date to today's date. Uncomment to enable
48				$(arrival).datepicker("setDate", $(arrival).datepicker('option', 'minDate'));
49			*/
50
51			$(arrival).val('Arrival');
52			
53			$(departure).datepicker({
54				minDate : '0d+1',
55				altField  :  departure,
56				onSelect : function(dateStr) {
57					var departureDate = $(this).datepicker("getDate");
58					var arrivalDate = $(arrival).datepicker("getDate");
59
60					if (arrivalDate >= departureDate)
61					{
62						departureDate.setDate(departureDate.getDate()-1);
63						$(arrival).datepicker("setDate", departureDate);
64					}
65				},
66			});
67
68			/*	Sets the default departure date to today's date + 2. Uncomment to enable
69				$(departure).datepicker("setDate", $(departure).datepicker('option', 'minDate'));
70			*/
71
72			$(departure).val('Departure');
73
74			$(".arrival.container .calendar, .arrival-container label").on("click", function() {
75				$(arrival).datepicker("show");
76			});
77
78
79			$(".departure.container .calendar, .departure-container label").on("click", function() {
80				$(departure).datepicker("show");
81			});
82
83			//Submit the form
84			$("#submit_booking").on("click", function (e) {
85				if ($(arrival).val() == "Arrival" || $(departure).val() == "Departure") {
86					alert("Please enter a valid date.")
87				} else {
88					var action = 'https://hotels.cloudbeds.com/reservation/AwJlEF#';
89					
90					var aArrival = $(arrival).val().split("/");
91					var aDeparture = $(departure).val().split("/");
92
93					action += 'checkin=' + aArrival[2] + '-' + aArrival[0] + '-' + aArrival[1] + '&checkout=' + aDeparture[2] + '-' + aDeparture[0] + '-' + aDeparture[1];
94					
95					$(this).closest('form').attr('action', action);
96					$(this).closest('form').submit();
97				}
98
99				e.preventDefault();
100			});
101
102
103			$('#booking').submit(function() {
104				//Add tracking script here
105				try{ 
106					gtag('event', 'click', {
107								'event_category': 'Track Booking',
108								'event_label': 'Reservations Redirect'
109						});
110				} catch(err) {}
111				//End tracking script
112			});
113
114
115			// Prevents on-screen keyboard from displaying on mobile/tablet
116			if ($('html').is('.touch')) {
117				$(arrival).attr('readonly', true);
118				$(departure).attr('readonly', true);
119			}
120
121		})('#arrival', '#departure');
122	});

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.