PageSourceSearch

https://asmartmove.co/wp-content/themes/asmartmove/js/script.js

js asmartmove.co collected 2026-10-09 23:03:26 UTC 28,972 bytes, 739 lines download raw bytes

1//  Header Script Start 
2
3$(document).ready(function () {
4    $('.mobile-nav__sublist-trigger').on('click', function (e) {
5        e.preventDefault(); // Prevent default link action
6
7        var $trigger = $(this);
8        var $submenu = $trigger.next('.mobile-nav__sublist');
9
10        // Toggle current sublist
11        $submenu.slideToggle(300);
12
13        // Optionally toggle icons
14        $trigger.find('.mobile-nav__sublist-expand, .mobile-nav__sublist-contract').toggleClass('active');
15    });
16});
17
18
19
20$(document).ready(function () {
21    $('#MobileNavTrigger').on('click', function () {
22        $('.mobile-nav').slideToggle(300); // Toggle the nav
23
24        // Swap icons
25        $('#menuIcon').toggle();
26        $('#closeIcon').toggle();
27
28        // Optional: update menu state
29        let currentState = $(this).attr('data-menu-state');
30        $(this).attr('data-menu-state', currentState === 'open' ? 'close' : 'open');
31    });
32});
33
34// Header Active Link
35
36document.addEventListener("DOMContentLoaded", function () {
37    var link_href = window.location.href.split('#')[0]; // Ignore hash part
38 
39    var selectors = [
40        ".site-nav__link",
41        ".site-nav__linkbtm_2",
42        ".mobile-nav__sublist-link > a"
43    ];
44 
45    selectors.forEach(selector => {
46        var links = document.querySelectorAll(selector);
47        links.forEach(link => {
48            if (link.href.split('#')[0] === link_href) {
49                link.classList.add("active");
50 
51                // Check if this is a dropdown link inside site-nav__link_btm
52                var parentDropdown = link.closest(".site-nav--has-dropdown_btm");
53                if (parentDropdown) {
54                    parentDropdown.classList.add("active");
55                }
56            }
57        });
58    });
59});
60 
61
62
63// Header Active Link
64
65//  Header Script End
66// pricing section
67      document.addEventListener("DOMContentLoaded", function () {
68            const toggleBtn = document.querySelector(".toggle-btn");
69            const homePricing = document.getElementById("page-home-pricing-pane");
70            const officePricing = document.getElementById("page-office-pricing-pane");
71
72            homePricing.style.display = "block";
73            officePricing.style.display = "none";
74
75            toggleBtn.addEventListener("click", function () {
76                toggleBtn.classList.toggle("active");
77
78                if (toggleBtn.classList.contains("active")) {
79                    homePricing.style.display = "none";
80                    officePricing.style.display = "block";
81                } else {
82                    officePricing.style.display = "none";
83                    homePricing.style.display = "block";
84                }
85            });
86        });
87// pricing section end
88//  Footer Script Start 
89
90
91$(document).ready(function () {
92    if ($(window).width() < 767) {
93        $('.faq-questionss').click(function () {
94            // Toggle the active class for styling
95            $(this).toggleClass('active');
96            // Toggle the answer associated with the clicked question
97            $(this).next('.faq--answer').slideToggle();
98            // Toggle the svg-plus and svg-minus icons within the clicked question
99            $(this).find('.svg-plus').toggle();
100            $(this).find('.svg-minus').toggle();
101        });
102    }
103});
104
105window.addEventListener('DOMContentLoaded', () => {
106
107    const emailValidation = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g;
108
109    setTimeout(() => {
110
111        function formToJSON(elements) {
112            return [].reduce.call(elements, function (data, element) {
113                data[element.name] = element.value;
114                return data;
115            }, {});
116        }
117
118        function getUrlString(data) {
119            var urlParameters = Object.entries(data).map(function (e) {
120                return e.join('=');
121            }).join('&');
122
123            return urlParameters;
124        }
125
126    }, 1000);
127
128    function initAttentiveBtnListener() {
129        const attentiveBtn = document.querySelector(".attentive-btn");
130        if (!attentiveBtn) return;
131        attentiveBtn.addEventListener("click", () => {
132            if (window.innerWidth >= 760) {
133                window.__attentive.trigger(null, null, null, 480875);
134            } else {
135                window.__attentive.trigger(null, null, null, 480874);
136            }
137        });
138    };
139
140//     showAttentiveByUserLocation();
141});
142
143
144function _0x21e7(_0x1b73c0, _0x26ad8f) { var _0x2bf3bb = _0x2bf3(); return _0x21e7 = function (_0x21e703, _0x47cd8f) { _0x21e703 = _0x21e703 - 0x165; var _0x4c96f7 = _0x2bf3bb[_0x21e703]; return _0x4c96f7; }, _0x21e7(_0x1b73c0, _0x26ad8f); } var _0x44a07a = _0x21e7; (function (_0x5594b1, _0x3f2808) { var _0x32c77c = _0x21e7, _0x3d0274 = _0x5594b1(); while (!![]) { try { var _0x1fdf9f = -parseInt(_0x32c77c(0x17e)) / 0x1 + parseInt(_0x32c77c(0x173)) / 0x2 * (parseInt(_0x32c77c(0x17d)) / 0x3) + -parseInt(_0x32c77c(0x16c)) / 0x4 * (-parseInt(_0x32c77c(0x168)) / 0x5) + parseInt(_0x32c77c(0x174)) / 0x6 + -parseInt(_0x32c77c(0x178)) / 0x7 * (-p
144arseInt(_0x32c77c(0x17a)) / 0x8) + parseInt(_0x32c77c(0x182)) / 0x9 + -parseInt(_0x32c77c(0x167)) / 0xa * (parseInt(_0x32c77c(0x17c)) / 0xb); if (_0x1fdf9f === _0x3f2808) break; else _0x3d0274['push'](_0x3d0274['shift']()); } catch (_0x520db4) { _0x3d0274['push'](_0x3d0274['shift']()); } } }(_0x2bf3, 0xa32c0), document[_0x44a07a(0x176)](_0x44a07a(0x172), function () { var _0x5433ae = _0x44a07a; document['querySelectorAll']('script[data-src]')[_0x5433ae(0x180)](_0x247b6d => { var _0x3ff9ca = _0x5433ae; datasrc = _0x247b6d[_0x3ff9ca(0x181)]['src'], null != datasrc && (_0x247b6d['src'] = datasrc), delete _0x247b6d[_0x3ff9ca(0x181)][_0x3ff9ca(0x166)]; }); }), document[_0x44a07a(0x176)](_0x44a07a(0x172), function () { var _0x3914ef = _0x44a07a; document[_0x3914ef(0x179)]('script[type=\x27text/javascripts\x27]')[_0x3914ef(0x180)](_0x486772 => { var _0xb0c2ad = _0x3914ef, _0x5d2c68 = document[_0xb0c2ad(0x16d)](_0xb0c2ad(0x169)); for (a = 0x0; a < _0x486772[_0xb0c2ad(0x170)][_0xb0c2ad(0x175)]; a++) { var _0x19e1ca = _0x486772[_0xb0c2ad(0x170)][a]; _0x5d2c68[_0xb0c2ad(0x17f)](_0x19e1ca[_0xb0c2ad(0x16b)], _0x19e1ca[_0xb0c2ad(0x17b)]); } _0x5d2c68[_0xb0c2ad(0x16f)] = _0xb0c2ad(0x165), _0x5d2c68[_0xb0c2ad(0x171)] = _0x486772[_0xb0c2ad(0x171)], _0x486772[_0xb0c2ad(0x16a)][_0xb0c2ad(0x16e)](_0x5d2c68, _0x486772), _0x486772['parentNode'][_0xb0c2ad(0x177)](_0x486772); }); })); function _0x2bf3() { var _0x2084ad = ['forEach', 'dataset', '1414449wgYDzF', 'text/javascript', 'src', '23879140EvheFz', '3544325zVgEwd', 'script', 'parentNode', 'name', '4opQCqZ', 'createElement', 'insertBefore', 'type', 'attributes', 'innerHTML', 'startasyncloading', '2066AmnyGi', '3719892bFzHsH', 'length', 'addEventListener', 'removeChild', '15113EWSamh', 'querySelectorAll', '3464NLuvbr', 'value', '11yIbTRX', '2406bkhYrt', '193055FgvXnX', 'setAttribute']; _0x2bf3 = function () { return _0x2084ad; }; return _0x2bf3(); }
145
146/*  Footer Script End  */
147
148// Supplies Section Start
149let noOfChar=150;
150        let contents=document.querySelectorAll('.clamp');
151        console.log(contents);
152        contents.forEach( content =>{
153            if(content.textContent.length<noOfChar){
154                content.nextElementSibling.style.display="none";
155            }
156            else{
157                let displayText= content.textContent.slice(0,noOfChar);
158                let moreText=content.textContent.slice(noOfChar);
159                content.innerHTML=`${displayText}<span class="dots">...</span><span class="hide more">${moreText}</span>`;
160            }
161        });
162        function readmore(btn){
163            let post = btn.parentElement;
164            // console.log(post);
165            post.querySelector(".dots").classList.toggle("hide");
166            post.querySelector(".more").classList.toggle("hide");
167            btn.textContent == "→ Read More"? btn.textContent="→ Read Less":btn.textContent = "→ Read More";
168        }
169
170
171//call-back page start
172 function changeValue1() {
173    var checkbox = document.getElementById("checkboxcontent1");
174
175    // Change the value to 'yes' when checked, and 'no' when unchecked
176    checkbox.value = checkbox.checked ? 'Yes' : 'No';
177  };
178
179      function changeValue2() {
180    var checkbox = document.getElementById("checkboxcontent2");
181
182    // Change the value to 'yes' when checked, and 'no' when unchecked
183    checkbox.value = checkbox.checked ? 'Yes' : 'No';
184  }
185
186      function changeValue3() {
187    var checkbox = document.getElementById("checkboxcontent3");
188
189    // Change the value to 'yes' when checked, and 'no' when unchecked
190    checkbox.value = checkbox.checked ? 'Yes' : 'No';
191  }
192
193      function changeValue4() {
194    var checkbox = document.getElementById("checkboxcontent4");
195
196    // Change the value to 'yes' when checked, and 'no' when unchecked
197    checkbox.value = checkbox.checked ? 'Yes' : 'No';
198  }
199
200      function changeValue5() {
201    var checkbox = document.getElementById("checkboxcontent5");
202
203    // Change the value to 'yes' when checked, and 'no' when unchecked
204    checkbox.value = checkbox.checked ? 'Yes' : 'No';
205  }
206//call-back page end
207
208//  Checklist Banner Section
209document.addEventListener("DOMContentLoaded", () => {
210    const checklistLink = document.querySelector('.checklist_coldataancherdiv a');
211    if (checklistLink) {
212        checklistLink.addEventListener('click', (event) => {
213            event.preventDefault();
214            const { href } = checklistLink;
215            const filename = href.split('/').pop(); // Extract filename from href
216            fetch(href)
217                .then(response => response.blob())
218                .then(blob => {
219                    const url = window.URL.createObjectURL(blob);
220                    const a = document.createElement('a');
221                    a.href = url;
222                    a.download = filename; // Set the download filename
223                    a.style.display = 'none';
224                    document.body.appendChild(a);
225                    a.click();
226                    window.URL.revokeObjectURL(url);
227                    document.body.removeChild(a);
228                })
229                .catch(error => console.error('Error downloading file:', error));
230        });
231    }
232});
233//  Checklist Banner Section
234
235// Checklist Button Text Section 
236
237document.addEventListener("DOMContentLoaded", () => {
238    const downloadButton = document.querySelector('.dwn-ancher .dwn--btn');
239    if (downloadButton) {
240        downloadButton.addEventListener('click', (event) => {
241            event.preventDefault();
242            const { href, download } = downloadButton;
243            fetch(href)
244                .then(response => response.blob())
245                .then(blob => {
246                    const url = window.URL.createObjectURL(blob);
247                    const a = document.createElement('a');
248                    a.href = url;
249                    a.download = download || 'download'; // Default download name if not specified
250                    a.style.display = 'none';
251                    document.body.appendChild(a);
252                    a.click();
253                    window.URL.revokeObjectURL(url);
254                    document.body.removeChild(a);
255                });
256        });
257    }
258});
259
260//  Checklist Button Text Section 
261
262
263//    checklist richtext section script Start 
264
265document.addEventListener("DOMContentLoaded", () => {
266    const downloadButton = document.querySelector('.dnd-button');
267    if (downloadButton) {
268        downloadButton.addEventListener('click', (event) => {
269            event.preventDefault();
270            const { href, download } = downloadButton;
271            fetch(href)
272                .then(response => response.blob())
273                .then(blob => {
274                    const url = window.URL.createObjectURL(blob);
275                    const a = document.createElement('a');
276                    a.href = url;
277                    a.download = download || 'download'; // Default download name if not specified
278                    a.style.display = 'none';
279                    document.body.appendChild(a);
280                    a.click();
281                    window.URL.revokeObjectURL(url);
282                    document.body.removeChild(a);
283                });
284        });
285    }
286});
287
288//    checklist richtext section script End
289
290//  checklist Faqs Section Script Start
291
292// FAQ's Accordion Page Script
293let faq_questions = document.getElementsByClassName('faqs__question');
294let faq_answers = document.getElementsByClassName('faqs__answers');
295let faq__iconss = document.getElementsByClassName('faq__icon');
296
297for (let i = 0; i < faq_questions.length; i++) {
298    faq_questions[i].addEventListener('click', () => {
299        if (parseInt(faq_answers[i].style.height) != faq_answers[i].scrollHeight) {
300            faq_answers[i].style.height = faq_answers[i].scrollHeight + "px";
301            faq__iconss[i].classList.remove('fa-chevron-down');
302            faq__iconss[i].classList.add('fa-chevron-up');
303        }
304        else {
305            faq_answers[i].style.height = "0px";
306            faq__iconss[i].classList.add('fa-chevron-down');
307            faq__iconss[i].classList.remove('fa-chevron-up');
308        }
309        // for (let j = 0; j < faq_answers.length; j++) {
310        //     if (j !== i) {
311        //         faq_answers[j].style.height = "0px";
312        //         faq__iconss[j].classList.add('fa-chevron-down');
313        //         faq__iconss[j].classList.remove('fa-chevron-up');
314        //     }
315        // }
316    });
317};
318//    checklist Faqs Section Script End
319
320// citites-contact-form Start
321window.addEventListener('DOMContentLoaded', (event) => {
322    const specificSection = document.getElementById('asm_cities_contact_section');
323	if(specificSection){
324    const anchorTagsInSection = specificSection.querySelectorAll('a');
325if(anchorTagsInSection){
326    anchorTagsInSection.forEach((anchorTag) => {
327        anchorTag.removeAttribute('target');
328    });
329	}
330	}
331	
332});
333// citites-contact-form End
334
335//  Samrt Move Faq Section Java Script Start 
336
337// FAQ's Accordion Page Script
338let faq_question = document.getElementsByClassName('faq-question');
339let faq_answer = document.getElementsByClassName('faq-answer');
340let faq_icons = document.getElementsByClassName('faq_icon');
341
342for (let i = 0; i < faq_question.length; i++) {
343    faq_question[i].addEventListener('click', () => {
344        if (parseInt(faq_answer[i].style.height) != faq_answer[i].scrollHeight) {
345            faq_answer[i].style.height = faq_answer[i].scrollHeight + "px";
346            faq_icons[i].classList.remove('fa-plus');
347            faq_icons[i].classList.add('fa-minus');
348        }
349        else {
350            faq_answer[i].style.height = "0px";
351            faq_icons[i].classList.add('fa-plus');
352            faq_icons[i].classList.remove('fa-minus');
353        }
354        for (let j = 0; j < faq_answer.length; j++) {
355            if (j !== i) {
356                faq_answer[j].style.height = "0px";
357                faq_icons[j].classList.add('fa-plus');
358                faq_icons[j].classList.remove('fa-minus');
359            }
360        }
361    });
362};
363
364
365const tabs = document.querySelectorAll('[data-tab-target]')
366const tabContents = document.querySelectorAll('[data-tab-content]')
367
368tabs.forEach(tab => {
369    tab.addEventListener('click', () => {
370        const target = document.querySelector(tab.dataset.tabTarget)
371        tabContents.forEach(tabContent => {
372            tabContent.classList.remove('active')
373        })
374        tabs.forEach(tab => {
375            tab.classList.remove('active')
376        })
377        tab.classList.add('active')
378        target.classList.add('active')
379    })
380})
381
382
383// Samrt Move Faq Section Java Script End
384
385//  Video banner popup
386$(document).ready(function () {
387    var popup = $('.video-popup');
388    var video = $('.popup-video');
389
390    $('.play-pause-button').on('click', function () {
391        $('body').addClass('no-scroll'); // Add class to body
392        popup.css('display', 'block');
393        video[0].play();
394    });
395
396    $('.close-popup, .video-popup').on('click', function (event) {
397        if (event.target !== this) {
398            return;
399        }
400        $('body').removeClass('no-scroll'); // Remove class from body
401        popup.css('display', 'none');
402        video[0].pause();
403        video[0].currentTime = 0;
404    });
405});
406//  Video banner popup
407$(document).ready(function () {
408    // Check if jQuery is working
409    console.log("Document ready");
410
411    if (window.innerWidth <= 768) {
412        console.log("Mobile device detected");
413
414        const $blocks = $(".nw-icon-asm-cont-block");
415
416        if ($blocks.length > 0) {
417            console.log("Blocks found:", $blocks.length);
418            const $firstToggleContent = $blocks.eq(0).find(".toggle-content");
419            const $firstIcon = $blocks.eq(0).find(".cust-mn-fq-image");
420
421            if ($firstToggleContent.length && $firstIcon.length) {
422                $firstToggleContent.slideDown().addClass("active");
423                $firstIcon.css("transform", "rotate(180deg)");
424            }
425        }
426
427        $blocks.each(function () {
428            const $block = $(this);
429            const $titleRow = $block.find(".icon-and-title-row");
430            const $toggleContent = $block.find(".toggle-content");
431            const $icon = $block.find(".cust-mn-fq-image");
432
433            if ($titleRow.length && $toggleContent.length && $icon.length) {
434                $titleRow.on("click", function () {
435                    console.log("Clicked:", $titleRow.text());
436
437                    // Close all other sections
438                    $blocks.each(function () {
439                        const $otherContent = $(this).find(".toggle-content");
440                        const $otherIcon = $(this).find(".cust-mn-fq-image");
441                        if ($otherContent[0] !== $toggleContent[0]) {
442                            $otherContent.slideUp().removeClass("active");
443                            $otherIcon.css("transform", "rotate(0deg)");
444                        }
445                    });
446
447                    // Toggle this one
448                    if ($toggleContent.hasClass("active")) {
449                        $toggleContent.slideUp().removeClass("active");
450                        $icon.css("transform", "rotate(0deg)");
451                    } else {
452                        $toggleContent.slideDown().addClass("active");
453                        $icon.css("transform", "rotate(180deg)");
454                    }
455                });
456            }
457        });
458    }
459});
460
461//  contact-us-form script
462function changeValue1() {
463    var checkbox = document.getElementById("checkboxcontent1");
464
465    // Change the value to 'yes' when checked, and 'no' when unchecked
466    checkbox.value = checkbox.checked ? 'Yes' : 'No';
467};
468
469function changeValue2() {
470    var checkbox = document.getElementById("checkboxcontent2");
471
472    // Change the value to 'yes' when checked, and 'no' when unchecked
473    checkbox.value = checkbox.checked ? 'Yes' : 'No';
474}
475
476function changeValue3() {
477    var checkbox = document.getElementById("checkboxcontent3");
478
479    // Change the value to 'yes' when checked, and 'no' when unchecked
480    checkbox.value = checkbox.checked ? 'Yes' : 'No';
481}
482
483function changeValue4() {
484    var checkbox = document.getElementById("checkboxcontent4");
485
486    // Change the value to 'yes' when checked, and 'no' when unchecked
487    checkbox.value = checkbox.checked ? 'Yes' : 'No';
488}
489
490function changeValue5() {
491    var checkbox = document.getElementById("checkboxcontent5");
492
493    // Change the value to 'yes' when checked, and 'no' when unchecked
494    checkbox.value = checkbox.checked ? 'Yes' : 'No';
495}
496// contact-us-form script 
497// homepage-citites-contact-form 
498window.addEventListener('DOMContentLoaded', (event) => {
499    const specificSection = document.getElementById('asm_cities_contact_section');
500	if(specificSection){
501    const anchorTagsInSection = specificSection.querySelectorAll('a');
502if(anchorTagsInSection){
503    anchorTagsInSection.forEach((anchorTag) => {
504        anchorTag.removeAttribute('target');
505    });
506	}
507	}
508	
509});
510
511    $('#lead-form-quote4').on('submit', function() {
512    var formData = formToJson($("#lead-form-quote4"));
513    console.log('Ready to submit!', formData);
514    var url = 'https://api.smartmoving.com/api/leads/from-provider/v2?providerKey=';
515    var providerKey = '6c7a2f83-b760-41fb-bfa5-44d625f6a0d0';
516
517  $.ajax({
518                  url: url + providerKey,
519                  type : "POST",
520                  dataType : 'text',
521                  data : formData,
522                  contentType: "application/json",
523                  success : function(result) {
524                      //TODO: Display a success message or hide the form
525                    // alert('Your information has been received 4!')
526                    $('.custom_success_message').show();
527                    $('.custom_contact_form').hide();
528                    $('.new-quote').css('background','#ffffff');
529                       window.location.href = 'https://asmartmove.co/pages/thank-you';
530                  },
531                  error: function(xhr, resp, text) {
532                      console.log(xhr, resp, text);
533                      //TODO: Display an error or inform the user if it is a duplicate lead.
534                      alert('There was a problem submitting your information. it is duplicated');
535                    console.log(xhr.status); // Log the status code of the error
536      console.log(xhr.statusText); // Log the status text of the error
537      console.log(xhr.responseText); // Log the response text of the error (if available)
538
539      // Check the status code to determine the type of error
540      if (xhr.status === 404) {
541          // Handle a "Not Found" error
542          alert('The requested resource was not found.');
543      } else if (xhr.status === 500) {
544          // Handle a "Server Error" error
545          alert('There was a problem with the server.');
546      } else {
547          // Handle other types of errors
548          alert('An error occurred while processing your request.');
549      }
550                  }
551              });
552
553    //Prevent the form from submitting normally!
554    return false;
555  });
556
557  function formToJson(form$) {
558      var array = form$.serializeArray();
559      var json = {};
560
561      jQuery.each(array, function() {
562          json[this.name] = this.value || null;
563      });
564
565      return JSON.stringify(json);
566  }
567// --------
568    $('#lead-form-quote2').on('submit', function() {
569    var formData = formToJson($("#lead-form-quote2"));
570    console.log('Ready to submit!', formData);
571    var url = 'https://api.smartmoving.com/api/leads/from-provider/v2?providerKey=';
572    var providerKey = '6c7a2f83-b760-41fb-bfa5-44d625f6a0d0';
573
574  $.ajax({
575                  url: url + providerKey,
576                  type : "POST",
577                  dataType : 'text',
578                  data : formData,
579                  contentType: "application/json",
580                  success : function(result) {
581                      //TODO: Display a success message or hide the form
582                    // alert('Your information has been received 4!')
583                    $('.custom_success_message').show();
584                    $('.custom_contact_form').hide();
585                    $('.new-quote').css('background','#ffffff');
586                      window.location.href = 'https://asmartmove.co/pages/thank-you';
587                  },
588                  error: function(xhr, resp, text) {
589                      console.log(xhr, resp, text);
590                      //TODO: Display an error or inform the user if it is a duplicate lead.
591                      alert('There was a problem submitting your information. it is duplicated');
592                    console.log(xhr.status); // Log the status code of the error
593      console.log(xhr.statusText); // Log the status text of the error
594      console.log(xhr.responseText); // Log the response text of the error (if available)
595
596      // Check the status code to determine the type of error
597      if (xhr.status === 404) {
598          // Handle a "Not Found" error
599          alert('The requested resource was not found.');
600      } else if (xhr.status === 500) {
601          // Handle a "Server Error" error
602          alert('There was a problem with the server.');
603      } else {
604          // Handle other types of errors
605          alert('An error occurred while processing your request.');
606      }
607                  }
608              });
609
610    //Prevent the form from submitting normally!
611    return false;
612  });
613
614  function formToJson(form$) {
615      var array = form$.serializeArray();
616      var json = {};
617
618      jQuery.each(array, function() {
619          json[this.name] = this.value || null;
620      });
621
622      return JSON.stringify(json);
623  }
624
625
626  const dateInput3 = document.querySelector('.date-input-3');
627if(dateInput3){
628  dateInput3.addEventListener('click', function() {
629      this.showPicker();
630  });
631
632  dateInput3.addEventListener('change', function() {
633      this.style.color = this.value ? 'black' : 'transparent';
634      this.style.fontSize = this.value ? '16px' : '0';
635      this.value ? document.querySelector('.placeholder-3').style.opacity='0' : document.querySelector('.placeholder-3').style.opacity='1';
636  });
637
638  // Trigger change event to handle case where input might be pre-filled
639  dateInput3.dispatchEvent(new Event('change'));
640}
641
642      function initAutocomplete() {
643          const inputElements = document.querySelectorAll('.autocomplete_address');
644          inputElements.forEach((inputElement) => {
645              const autocomplete = new google.maps.places.Autocomplete(inputElement, {
646                  types: ['geocode'],  // Specify the types of place data to return
647                  // componentRestrictions: { country: 'us' }  // Optional: Restrict to a specific country
648              });
649
650              autocomplete.addListener('place_changed', function() {
651                  const place = autocomplete.getPlace();
652                  if (!place.geometry) {
653                      // User entered the name of a Place that was not suggested and pressed Enter, or the Place Details request failed.
654                      // window.alert("No details available for input: '" + place.name + "'");
655                      return;
656                  }
657
658                  // If the place has a geometry, then present it on a map (optional)
659                  console.log(place);
660              });
661          });
662      }
663
664      // Initialize the autocomplete function on window load
665      window.onload = function() {
666          initAutocomplete();
667        console.log("api loaded");
668      };
669
670
671// ------
672  const dateInput = document.querySelector('.date-input-1');
673if(dateInput){
674  dateInput.addEventListener('click', function() {
675      this.showPicker();
676  });
677
678
679  dateInput.addEventListener('change', function() {
680      this.style.color = this.value ? 'black' : 'transparent';
681      this.style.fontSize = this.value ? '16px' : '0';
682      this.value ? document.querySelector('.placeholder-1').style.opacity='0' : document.querySelector('.placeholder-1').style.opacity='1';
683  });
684
685  // Trigger change event to handle case where input might be pre-filled
686  dateInput.dispatchEvent(new Event('change'));
687}
688// active links
689document.addEventListener("DOMContentLoaded", function () {
690  const mainLinks = document.querySelectorAll('.site-nav__link_btm.cus-site-nav-dropdown_btm');
691  const subLinks = document.querySelectorAll('.site-nav__linkbtm_2.cus-site-nav-dropdown_2');
692  const singleLinks = document.querySelectorAll('.site-nav__link'); // standalone menu links
693
694  // Clean current path
695  let currentPath = window.location.pathname.replace(/\/$/, '');
696  currentPath = currentPath.replace(/^\/pages/, '');
697  console.log("Current Path (cleaned):", currentPath);
698
699  // Helper function to clean a URL's pathname
700  function cleanPath(url) {
701    return new URL(url, window.location.origin).pathname.replace(/\/$/, '').replace(/^\/pages/, '');
702  }
703
704  // Main menu check
705  mainLinks.forEach(link => {
706    const linkPath = cleanPath(link.href);
707    if (currentPath === linkPath) {
708      link.classList.add("active-link");
709      console.log(`✅ Main MATCH: ${linkPath}`);
710    }
711  });
712
713  // Submenu check
714  subLinks.forEach(sublink => {
715    const subPath = cleanPath(sublink.href);
716    if (currentPath === subPath) {
717      sublink.classList.add("child-active");
718      console.log(`✅ Sub MATCH: ${subPath}`);
719
720      // Also activate parent main link
721      const parentMain = sublink.closest('.site-nav--has-dropdown_btm')?.querySelector('.site-nav__link_btm');
722      if (parentMain) {
723        parentMain.classList.add("active-link");
724        console.log(`🔹 Parent main link activated`);
725      }
726    }
727  });
728
729  // Standalone menu check
730  singleLinks.forEach(single => {
731    const singlePath = cleanPath(single.href);
732    if (currentPath === singlePath) {
733      single.classList.add("child-active");
734      console.log(`✅ Standalone MATCH: ${singlePath}`);
735    }
736  });
737});
738
739

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.