1// JQuery 2var jQ = jQuery.noConflict(); 3jQ(document).ready(function() { 4 5 ///// GENERAL SITEWIDE JS 6 7 //set path's if VSM or live 8 var loc = window.location; 9 vsmURL = loc.protocol + '//' + loc.hostname + '/'; 10 if (vsmURL.indexOf('vsmtools') > -1) { 11 vsmURL = vsmURL + 'U/626/'; 12 } else { 13 vsmURL = ''; 14 } 15 16 // Hide Modal 17 jQ('body').on('click', '.close-modal', function(e) { 18 e.stopPropagation(); 19 jQ("body").removeClass("modal-open"); 20 jQ('.site-modal-wrap').html(""); 21 sessionStorage.removeItem('consultClicked'); 22 sessionStorage.removeItem('positionClicked'); 23 }); 24 25 // Prevent click on modal from closing the modal 26 jQ('body').on('click', '.site-modal-wrap', function(e) { 27 e.stopPropagation(); 28 }); 29 30 // Show/Load Contact Modal 31 jQ('body').on('click', '.contact-button', function(e) { 32 e.preventDefault(); 33 jQ(".site-modal-wrap").fadeIn(); 34 jQ("body").addClass("modal-open"); 35 jQ('.site-modal-wrap').load("../CustomControls/contact-form.aspx"); 36 }); 37 38 // if form sent, show for modal with thank you message 39 if(window.location.href.indexOf("k=0") > -1) { 40 jQ(".site-modal-wrap").fadeIn(); 41 jQ("body").addClass("modal-open"); 42 jQ('.site-modal-wrap').html("<div class='close-modal' aria-label='Close'>×</div><div class='modal-inner'><div class='modal-content' style='text-align:center'><h6>Thank you for contact us!</h6><p>We will be in touch shortly.</p></div></div>"); 43 } 44 45 46 // add classes to body for specific page 47 // add name of current selected nav page class to body 48 jQ("nav a.selected").each (function () { 49 var currentPage = jQ(this).text().toLowerCase().replace(/(^\s+|[^a-zA-Z0-9 ]+|\s+$)/g,"").replace(/\s+/g, "-"); 50 jQ('body').addClass(currentPage); 51 }); 52 // add name of current page title class to body 53 var currentPageTitle = jQ("h1.pagename").text().toLowerCase().replace(/(^\s+|[^a-zA-Z0-9 ]+|\s+$)/g,"").replace(/\s+/g, "-"); 54 // add id of current page as well (sicne this doesn't change) 55 var currentPageID = jQ('#divNavPath').attr('class'); 56 jQ('body').addClass(currentPageTitle + ' page'+currentPageID); 57 58 59 // scroll to any anchor location 60 jQ('body').on('click','.scroll-to',function(event){ 61 event.preventDefault(); 62 63 var target = this.hash; 64 var $target = jQ(target); 65 var target_offset = jQ(this.hash).offset() ? jQ(this.hash).offset().top : 0; 66 var customoffset = 170 // Header Height. 67 68 jQ('html, body').animate({scrollTop:target_offset - customoffset}, 900, 'swing'); 69 window.location.hash = target; 70 }); 71 72 if(window.location.hash) { 73 var target = window.location.hash; 74 var $target = jQ(target); 75 jQ(target).addClass('active'); 76 var target_offset = jQ(target).offset() ? jQ(target).offset().top : 0; 77 var customoffset = 170 // Header Height. 78 jQ('html, body').animate({ scrollTop: target_offset - customoffset }, 900, 'swing'); 79 } 80 81 // Notification 82 if (sessionStorage.getItem("hideNotice") === 'yes') { 83 jQ("body").addClass('hide-notification'); 84 } 85 86 if (jQ('#notification p').length) { 87 jQ('#notification .close-button').click(function() { 88 jQ("body").addClass('hide-notification'); 89 sessionStorage.setItem("hideNotice", "yes"); 90 }); 91 } else { 92 jQ("body").addClass('hide-notification'); 93 } 94 95 96 // for all nav links, detect if it should have a selected class & load sub nav based on selected 97 function setSelectedNav() { 98 // ref all main nav areas as needed 99 jQ('nav a, .sub-nav a, .breadcrumbs a, #mainCats a').each (function (){ 100 var navitem = jQ(this); 101 102 // get last part of URL 103 var url = jQ(location).attr('href'); 104 urlParts = url.split("/"); 105 urlPartLast = urlParts[urlParts.length-1].split("&")[0]; 106 107 // get last part of nav link 108 var navURL = navitem.attr('href'),
109 navParts = navURL.split("/"), 110 navPartLast = navParts[navParts.length-1]; 111 112 // if URL and nav match , set as selected up the tree 113 if (urlPartLast === navPartLast) { 114 navitem.addClass('selected').parentsUntil('.ul1').addClass('selected'); 115 } 116 117 // if MAIN NAV link selected and has subs, load on page 118 if (navitem.hasClass('selected') && navitem.parent('.l1').length) { 119 var navSubs = navitem.parent().parent().clone(); 120 jQ('.sub-nav').html(navSubs); 121 } 122 123 }); 124 } 125 setSelectedNav(); 126 127 ///// HOME JS 128 129 if (jQ('body.page-home').length) { 130 131 // Stick Nav Header 132 jQ(window).scroll(function() { 133 134 if (jQ(this).scrollTop() > 1){ 135 jQ("body").addClass('stuck'); 136 } else { 137 jQ("body").removeClass('stuck'); 138 } 139 }); 140 141 // Hero Slider 142 if (jQ('.hero-slider').length) { 143 144 // Hero Slider 145 // Clean out inputs within VSM generated gallery 146 jQ('.hero-slider input').remove(); 147 var heroSlider = jQ(".hero-slider"); 148 149 heroSlider.owlCarousel({ 150 items:1, 151 dots:false, 152 nav:false, 153 animateIn:'fadeIn', 154 animateOut:'fadeOut', 155 lazyLoad:true, 156 margin:0, 157 loop:true, 158 autoplay:true, 159 autoplayTimeout:2000, 160 //autoplayHoverPause:true, 161 responsiveRefreshRate:0 162 }); 163 164 } 165 166 // Service Slider 167 if (jQ('.services td').length) { 168 169 jQ('.services td').each (function (){ 170 var serviceLink = jQ(this).find('.button').attr('href'); 171 jQ(this).wrapInner("<a class='service-link' href='"+serviceLink+"' />"); 172 }); 173 174 var servicesSlider = tns({ 175 container: '.services-table tbody', 176 items: 1, 177 mouseDrag: true, 178 nav: false, 179 autoplay: true, 180 autoplayButtonOutput: false, 181 controlsText: ["<i class='fa-solid fa-chevron-left'></i>", "<i class='fa-solid fa-chevron-right'></i>"], 182 autoplayTimeout: 8000, 183 onInit: buttonFix, 184 }); 185 186 } 187 188 // Home Featured Slider 189 if (jQ('.featured-slider').length) { 190 191 var featuredSlider = tns({ 192 container: '.featured-slider', 193 items: 1, 194 mouseDrag: true, 195 nav: false, 196 autoplay: true, 197 onInit: buttonFix, 198 }); 199 200 } 201 202 } 203 204 ///// STATIC PAGES JS 205 206 if (jQ('body.page-pages').length) { 207 208 // Has no sub nav then make full width 209 if (!jQ('#sub-nav2 .ul3').length) { 210 jQ('#sub-nav2').remove(); 211 } 212 213 } 214});
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.