PageSourceSearch

https://www.bavarianinnsd.com/scripts/booking.js

js bavarianinnsd.com collected 2026-10-08 05:52:55 UTC 3,853 bytes, 126 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()+1);
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
75			$(departure + ', ' + arrival).attr('readonly', 'true');
76
77			$(".arrival-container .calendar, .arrival-container label").on("click", function() {
78				$(arrival).datepicker("show");
79			});
80
81
82			$(".departure-container .calendar, .departure-container label").on("click", function() {
83				$(departure).datepicker("show");
84			});
85
86			//Submit the form
87			$("#submit_booking").on("click", function (e) {
88				if ($(arrival).val() == "Arrival" || $(departure).val() == "Departure") {
89					alert("Please enter a valid date.")
90				} else {
91					//Add tracking script here
92					//try{ pageTracker._trackEvent("Track Booking", "Reservations Redirect"); } catch(err) {}
93					//End tracking script
94
95					$(this).closest('form').submit();
96				}
97
98				e.preventDefault();
99			});
100
101
102			$('#booking').submit(function() {
103				if (c_compareDatesFlex(this.dateStart.value, this.dateEnd.value, "MDY", "/", 2)) {
104                    var startDate = this.dateStart.value;
105                    var endDate = this.dateEnd.value;
106                    
107                    startDate = startDate.substring(6, 10) + '-' + startDate.substring(0, 2) + '-' + startDate.substring(3, 5);
108                    endDate = endDate.substring(6, 10) + '-' + endDate.substring(0, 2) + '-' + endDate.substring(3, 5);
109                    
110                    var search = '{%22checkIn%22:%22' + startDate + '%22,%22checkOut%22:%22' + endDate + '%22,%22guests%22:[{%22adults%22:1,%22children%22:0}],%22multi%22:false,%22step%22:0}';
111                    var fullURL = 'https://bavarianinnsd.client.innroad.com/#search=' + search;
112                    $("#booking").attr('action', fullURL);
113
114					this.submit();
115				}
116				return false;
117			});
118
119			// Prevents on-screen keyboard from displaying on mobile/tablet
120			if ($('html').is('.touch')) {
121				$(arrival).attr('readonly', true);
122				$(departure).attr('readonly', true);
123			}
124
125		})('#arrival', '#departure');
126	});

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.