PageSourceSearch

https://tamarackidaho.com/wp-content/themes/Tamarack/js/ecommwidget3.js?v=1790265063

js tamarackidaho.com collected 2026-09-25 23:37:15 UTC 8,204 bytes, 182 lines download raw bytes

1
2
3// 48 Hour Window Link https://tamarack.axess.shop/en/Home
4// Else to Inntopia: same thing as activites, just change link to Calander instead
5// /ecomm/shop/calendar/etc...
6$(document).ready(function () {
7    var widgetHTML;
8
9    var liStyle;
10    if (inntopiaVariables3.widgetLayout=='vertical') {
11        liStyle = 'unstyled';
12    }
13    else {
14        liStyle = 'inline';
15    }
16
17    if (inntopiaVariables3.widgetType == 1 || inntopiaVariables3.widgetType == 3) {
18        widgetHTML = '<ul class="' + liStyle + '"><li><label for="from">' + inntopiaVariables3.arrivalDateLabel + '</label><input type="text" id="arrivalDate" name="arrivalDate" class="input-small"/></li><li><label for="to">' + inntopiaVariables3.departureDateLabel + '</label><input type="text" id="departureDate" name="departureDate" class="input-small"/></li><li><label for="to">' + inntopiaVariables3.adultLabel + '</label><input type="number" id="adultCount" name="adultCount" class="input-mini" min="0"  value="2"/></li><li><label for="to">' + inntopiaVariables3.childLabel + '</label><input type="number" id="childCount" name="childCount" class="input-mini" min="0"  value="0"/></li><li><label for="submit"></label><button  class="btn btn-info btn-orange" id="checkAvailability">' + inntopiaVariables3.buttonText + '</button></li></ul><span id="formError"></span>';
19    }
20
21    else if (inntopiaVariables3.widgetType == 2) {
22        widgetHTML = '<ul class="' + liStyle + '"><li><label for="from">' + inntopiaVariables3.startDateLabel + '</label><input  autocomplete="off" type="text" id="startDate" name="startDate" class="input-small"/><svg data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="16.5" height="16.5"><path d="M4.5.8v2.5M12 .8v2.5M5.3 7.8h-.8M5.3 10.8h-.8M8.7 7.8h-.8M8.7 10.8h-.8M12 7.8h-.8M12 10.8h-.8" fill="none" stroke="#9f9f9f" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><rect x=".8" y="2" width="15" height="13.8" rx="3" ry="3" fill="none" stroke="#9f9f9f" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/></svg></li><li><label for="submit"></label><button  class="btn btn-info" id="searchDates">' + inntopiaVariables3.buttonText + '</button></li></ul><span id="formError"></span>';
23    }
24
25
26    $("#inntopiaWidget3").html(widgetHTML);
27
28    $("#inntopiaWidget3 #checkAvailability").click(function () {
29
30        $("#formError").html('');
31        var thisArrivalDate = $("#inntopiaWidget3 #arrivalDate").val();
32        var thisDepartureDate = $("#inntopiaWidget3 #departureDate").val();
33        var thisAdultCount = $("#inntopiaWidget3 #adultCount").val();
34        var thisChildCount = $("#inntopiaWidget3 #childCount").val();
35        var thisChildAgeArray = null;
36
37        var hasError = false;
38        if (thisArrivalDate == '') {
39            $("#formError").html('<div class="text-error">Please Enter Arrival Date</div>');
40            hasError = true;
41        }
42        if (thisDepartureDate == '') {
43            $("#formError").html('<div class="text-error">Please Enter Departure Date</div>');
44            hasError = true;
45        }
46        if (isNaN(thisAdultCount)) {
47            $("#formError").html('<div class="text-error">Please Enter Number of Adults</div>');
48            hasError = true;
49        }
50        if (isNaN(thisChildCount)) {
51            $("#formError").html('<div class="text-error">Please enter Number of Children</div>');
52            hasError = true;
53        }
54        if ((thisAdultCount === '0') && (thisAdultCount === '0')) {
55            $("#formError").html('<div class="text-error"> Please enter the Number of Guests</div>');
56            hasError = true;
57
58        }
59        if (thisAdultCount === '') {
60            $("#formError").html('<div class="text-error">Please Enter Number of Adults</div>');
61            hasError = true;
62        }
63
64
65        var today = new Date();
66        today.setHours(0,0,0,0);
67        var arrivalDateDT = new Date(thisArrivalDate);
68
69        var departureDateDT = new Date(thisDepartureDate);
70
71
72        if (arrivalDateDT < today) {
73            $("#inntopiaWidget3 #formError").html('<div class="text-error">Arrival Date must be today or later</div>');
74            hasError = true;
75        }
76
77        if (arrivalDateDT >= departureDateDT) {
78            $("#inntopiaWidget3 #formError").html('<div class="text-error">Departure Date must be after Arrival Date</div>');
79            hasError = true;
80        }
81
82        if (hasError === false) {
83            // setDefaultsCookie(thisArrivalDate, thisDepartureDate, thisAdultCount, thisChildCount, thisChildAgeArray, null);
84            // $.blockUI({ message: $("#waitMessage") });
85            var inntopiaSearchURL;
86            if (inntopiaVariables3.widgetType==1) {
87                inntopiaSearchURL = 'http://' + inntopiaVariables3.domain + '/ecomm/shop/lodging/' + inntopiaVariables3.s
87alesId + '/' + inntopiaVariables3.language + '/?arrivalDate=' + thisArrivalDate + '&departureDate=' + thisDepartureDate + '&adultcount=' + thisAdultCount + '&childCount=' + thisChildCount;
88            }
89            else if (inntopiaVariables3.widgetType==3) {
90                inntopiaSearchURL = 'http://' + inntopiaVariables3.domain + '/ecomm/listings/supplierdetail/' + inntopiaVariables3.salesId + '/' + inntopiaVariables3.language + '/?supplierid=' + inntopiaVariables3.supplierId + '&arrivalDate=' + thisArrivalDate + '&departureDate=' + thisDepartureDate + '&adultcount=' + thisAdultCount + '&childCount=' + thisChildCount + '#Availability';
91            }
92            window.location = inntopiaSearchURL;
93        }
94
95        return false;
96    });
97
98
99    $("#inntopiaWidget3 #searchDates").click(function () {
100
101        $("#inntopiaWidget3 #formError").html('');
102        var thisStartDate = $("#inntopiaWidget3 #startDate").val();
103
104
105        var hasError = false;
106
107        if (thisStartDate == '') {
108            $("#inntopiaWidget3 #formError").html('<div class="text-error">Please Enter Start Date</div>');
109            hasError = true;
110        }
111
112
113        var today = new Date();
114        today.setHours(0,0,0,0);
115        var startDateDT = new Date(thisStartDate);
116
117        if (startDateDT < today) {
118            $("#inntopiaWidget3 #formError").html('<div class="text-error">Start Date must be today or later</div>');
119            hasError = true;
120        }
121
122
123
124        if (hasError === false) {
125
126            window.location = 'http://' + inntopiaVariables3.domain + '/ecomm/shop/activities/' + inntopiaVariables3.salesId + '/' + inntopiaVariables3.language + '/?startDate=' + thisStartDate + '&productcategoryid=' + inntopiaVariables3.productCategoryId + '&productsupercategoryid=' + inntopiaVariables3.productSuperCategoryId;
127
128        }
129
130        return false;
131
132    });
133
134    var arrivalDateElement = $("#inntopiaWidget3 #arrivalDate");
135    var departureDateElement = $("#inntopiaWidget3 #departureDate");
136    var startDateElement = $("#inntopiaWidget3 #startDate");
137
138    arrivalDateElement.datepicker({
139        defaultDate: "+1w",
140        minDate: 0,
141        changeMonth: true,
142        numberOfMonths: 1,
143        regional: inntopiaVariables3.language,
144        onClose: function (selectedDate) {
145            departureDateElement.datepicker("option", "minDate", selectedDate);
146        }
147    });
148
149    departureDateElement.datepicker({
150        defaultDate: "+1w",
151        changeMonth: true,
152        numberOfMonths: 1,
153        regional: inntopiaVariables3.language,
154        minDate: 0,
155        onClose: function (selectedDate) {
156            arrivalDateElement.datepicker("option", "maxDate", selectedDate);
157        }
158    });
159
160
161    let today = new Date();
162    today.setHours(0,0,0,0);
163    let weekAhead = new Date();
164    let closeDate = new Date();
165    closeDate.setDate(closeDate.getDate() + inntopiaVariables3.closeDayLimit);
166    let datePicker = new Litepicker({
167        element: document.querySelector('#inntopiaWidget3 #startDate'),
168        singleMode: true,
169        firstDay: 0,
170        format: 'MM/DD/YY',
171        //Tomorrow
172        startDate: ''
173    });
174
175    datePicker.on('selected', (date) => {
176        let button = $("#inntopiaWidget3 #searchDates");
177        $(button).removeClass('btn-orange');
178        $(button).text(inntopiaVariables3.buttonText);
179    });
180
181
182});

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.