1$(function () { 2 $('[name="whatsectorisyourprojectfor"]').click(function () { 3 var otherSelect = $(this).val(); 4 5 if (otherSelect == 'Other') { 6 $('[name="othersector"]').before('<label id="othersectorlabel">Please tell us the sector you\'re in</label>'); 7 $('[name="othersector"]').attr('type', 'text'); 8 $('[name="othersector"]').addClass('medium'); 9 } else { 10 if ($('#othersectorlabel').length > 0) { 11 $('#othersectorlabel').remove(); 12 } 13 14 $('[name="othersector"]').attr('type', 'hidden'); 15 $('[name="othersector"]').val(''); 16 } 17 }); 18 $(document).ready(function () { 19 $("img.lazyload").lazyload(); 20 }); 21 $(window).on("load resize", function (e) { 22 if ($(window).width() < 992) { 23 // $("#sticky_item").trigger("sticky_kit:detach"); 24 $("#sticky_item").unstick(); 25 $(".hdLHS").next().slideUp(); 26 } else { 27 // $("#sticky_item").stick_in_parent({ 28 // parent: ".contentWrap-inner", 29 // inner_scrolling: true, 30 // offset_top: 160 31 // }); 32 $(".hdLHS").next().slideDown(); 33 $("#sticky_item").sticky({ 34 topSpacing: 160, 35 className: 'is_stuck', 36 bottomSpacing: 700, 37 getWidthFrom: '.pageNav' 38 }); 39 } 40 }); 41 42 if ($('#productFilters').length) { 43 $('#productFilters .filterList a').on('click', function (e) { 44 e.preventDefault(); 45 var section = $('#product-filter-title'); 46 $("html, body").animate({ 47 scrollTop: $(section).offset().top - 115 48 }); //$("#sticky_item").trigger("sticky_kit:recalc"); 49 50 $("#sticky_item").sticky('update'); 51 }); 52 } 53 54 function processMainNavigation() { 55 $(".mainNavList").each(function () { 56 var children = $(".mainNavList li.haschildren > a"); 57 var CloneButton = $('<button type="button" class="toggleSubmenu"><i class="fa fa-plus"></i></button>'); 58 $(children).after($(CloneButton)); //show/hide submenu nav 59 60 $(".toggleSubmenu").click(function () { 61 $(this).parent().toggleClass("open"); 62 }); 63 }); 64 } 65 66 processMainNavigation(); //hamburger animation 67 68 $("#hamburger").click(function () { 69 $(this).toggleClass("hamburger__open"); 70 $(".mainNav").toggleClass("open"); 71 $(".topNavContainer").toggleClass("nav-display-on"); 72 $("html").toggleClass("fixed"); 73 }); 74 $(".product-search a").click(function () { 75 $('.search-wrapper').toggleClass("open"); 76 }); 77 $(document).keyup(function (e) { 78 if (e.keyCode == 27) { 79 // Esc keycode 80 //your code to hide the search 81 $(".search-wrapper.open").removeClass("open"); 82 } 83 }); //open-close the subnavigation on hover 84 //principle is that the shadow of the header broke the constant hover. 85 // $(".haschildren").mouseover(function () { 86 // $("ul.js-toggle-visibility").removeClass("js-toggle-visibility"); 87 // $( this ).find(".subNavList1").addClass("js-toggle-visibility"); 88 // }); 89 90 $(".header").mouseleave(function () { 91 $(this).find(".subNavList1").removeClass("js-toggle-visibility"); 92 }); // revealing the features -> climb the tree then jump on the pool 93 // revealing the features -> climb the tree then jump on the pool 94 95 $(document).on("click", ".js-features", function () { 96 $(this).closest('.flex-item').find('.features__inner').toggleClass("reveal"); 97 $(this).children().toggleClass('fa-list-ul fa-times'); 98 }); // if ($('.see_products').length) { 99 // var scrollTrigger = 800, 100 // backToTop = function () { 101 // var scrollTop = $(window).scrollTop(); 102 // if (scrollTop > scrollTrigger) { 103 // $('.see_products').addClass('show'); 104 // } else { 105 // $('.see_products').removeClass('show'); 106 // } 107 // }; 108 // backToTop(); 109 // $(window).on('scroll', function () { 110 // backToTop(); 111 // }); 112 // $('.see_products').on('click', function (e) { 113 // e.preventDefault(); 114 // var section = $(this).attr("href"); 115 // $("html, body").animate({ 116 // scrollTop: $(section).offset().top - 95 117 // }); 118 // }); 119 // } 120 //why not slide 121 122 $(".hdLHS").click(function () { 123 $(this).next().slideToggle(); 124 }); 125 126 if ($('.option').length) { 127 $('.option').parent().addClass('is-checkbox'); 128 } 129 130 if ($('.table-container').length) { 131 $('.table-container table').basictable({ 132 breakpoint: 992 133 });
134 } // if($('.collapse').length) { 135 // $('.collapse table').basictable({ 136 // breakpoint: 992, 137 // }); 138 // } 139 140 141 if ($('a[data-toggle="collapse"]').length == 1) { 142 $(".main .collapse").collapse("show"); 143 } 144 145 $(".eventSlider").slick({ 146 dots: false, 147 arrows: true, 148 autoplay: true, 149 infinite: true, 150 slidesToShow: 1, 151 slidesToScroll: 1, 152 delay: 2 // nextArrow: '<i class="fa fa-angle-right slick-next"></i>', 153 // prevArrow: '<i class="fa fa-angle-left slick-prev"></i>' 154 155 }); //banner slider 156 157 $(".bannerSlider").slick({ 158 dots: false, 159 lazyLoad: 'ondemand', 160 autoplay: true, 161 infinite: true, 162 dots: false, 163 slidesToShow: 1, 164 slideswToScroll: 1, 165 arrows: false 166 }); // $('.news_items').slick({ 167 // dots: false 168 // , arrows:true 169 // , infinite: true 170 // , slidesToShow: 6 171 // , slidesToScroll: 1 172 // , nextArrow: '<i class="fa fa-angle-right slick-next"></i>' 173 // prevArrow: '<i class="fa fa-angle-left slick-prev"></i>' 174 // }); 175 //product slider 176 177 $('.featured_product__slider').slick({ 178 dots: false, 179 draggable: false, 180 swipe: false, 181 touchMove: false, 182 arrows: true // , infinite: true 183 , 184 slidesToShow: 4, 185 slidesToScroll: 1, 186 nextArrow: '<button type="button" class="slick-next"><svg width="28" height="48" viewBox="0 0 28 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.99313 0C3.60825 0 3.17525 0.19239 2.8866 0.480965L0.481098 2.88578C0.192439 3.17435 0 3.60722 0 3.99199C0 4.37675 0.192439 4.80962 0.481098 5.0982L19.3883 24L0.481098 42.9018C0.192439 43.1904 0 43.6232 0 44.008C0 44.4409 0.192439 44.8257 0.481098 45.1142L2.8866 47.519C3.17525 47.8076 3.60825 48 3.99313 48C4.37801 48 4.811 47.8076 5.09966 47.519L27.5189 25.1062C27.8076 24.8176 28 24.3848 28 24C28 23.6152 27.8076 23.1824 27.5189 22.8938L5.09966 0.480965C4.811 0.19239 4.37801 0 3.99313 0Z" fill="#1D3686"/></svg></button>', 187 prevArrow: '<button type="button" class="slick-prev"><svg width="28" height="48" viewBox="0 0 28 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24.0069 0C24.3918 0 24.8247 0.19239 25.1134 0.480965L27.5189 2.88578C27.8076 3.17435 28 3.60722 28 3.99199C28 4.37675 27.8076 4.80962 27.5189 5.0982L8.61169 24L27.5189 42.9018C27.8076 43.1904 28 43.6232 28 44.008C28 44.4409 27.8076 44.8257 27.5189 45.1142L25.1134 47.519C24.8247 47.8076 24.3918 48 24.0069 48C23.622 48 23.189 47.8076 22.9003 47.519L0.481102 25.1062C0.192442 24.8176 0 24.3848 0 24C0 23.6152 0.192442 23.1824 0.481102 22.8938L22.9003 0.480965C23.189 0.19239 23.622 0 24.0069 0Z" fill="#1D3686"/></svg></button>', 188 responsive: [ 189 /* { 190 breakpoint: 2100, 191 settings: { 192 slidesToShow: 5, 193 slidesToScroll: 1, 194 infinite: true 195 } 196 }, 197 { 198 breakpoint: 2000, 199 settings: { 200 slidesToShow: 4, 201 slidesToScroll: 1, 202 infinite: true 203 } 204 }, */ 205 { 206 breakpoint: 1200, 207 settings: { 208 slidesToShow: 3, 209 slidesToScroll: 1 // infinite: true 210 211 } 212 }, { 213 breakpoint: 992, 214 settings: { 215 slidesToShow: 2, 216 slidesToScroll: 1 217 } 218 }, { 219 breakpoint: 768, 220 settings: { 221 slidesToShow: 1, 222 slidesToScroll: 1, 223 autoplay: true 224 } 225 }] 226 }); 227 $('.featured_product__slider').on('beforeChange', function (event, slick, currentSlide, nextSlide) { 228 $('.featured_product__slider .slick-slide.prevSlide').removeClass('prevSlide'); 229 $('.featured_product__slider .slick-slide.nextSlide').removeClass('nextSlide'); 230 }); 231 $('.featured_product__slider').on('afterChange', function (event, slick, currentSlide, nextSlide) { 232 $('.featured_product__slider .slick-slide[data-slick-index="' + currentSlide + '"]').prev().addClass('prevSlide'); 233 $('.featured_product__slider .slick-slide.slick-active').last().next().addClass('nextSlide'); 234 }); 235 /*$('.panelExpertise .item a').hover(function () { 236 $("img", this).src = '../../images/default/icons/icon-playBlue.png'; 237 }, function () { 238 $("img", this).src = '../../images/default/icons/icon-play.png'; 239 });*/ 240 // dot after homepage about block 241 242 /* $("#dotdot").dotdotdot({ 243 wrap: 'word', 244 after: 'a.readmore' 245 }); */ 246 247 if ($('.filterSelect').length > 0) { 248 $('#leftNav').addClass("m_modal_style"); 249 $('.pageNav').prepend('<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fa fa-times-circle" aria-hidden="true"></i></button>'); 250 } // $(window).on('load resize', function() { 251 // if (screen.width < 768) { 252 // $('#leftNav').detach(); 253 // } 254 // else { 255 // $('#leftNav').prepend('content.col-xs-12.col-md-9.main'); 256 // } 257 // }); 258 259 260 $('.news_event__slider').slick({ 261 dots: false, 262 draggable: false, 263 swipe: false, 264 touchMove: false, 265 arrows: true // , infinite: true 266 , 267 slidesToShow: 3, 268 slidesToScroll: 1, 269 nextArrow: '<button type="button" class="slick-next"><svg width="28" height="48" viewBox="0 0 28 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.99313 0C3.60825 0 3.17525 0.19239 2.8866 0.480965L0.481098 2.88578C0.192439 3.17435 0 3.60722 0 3.99199C0 4.37675 0.192439 4.80962 0.48
2691098 5.0982L19.3883 24L0.481098 42.9018C0.192439 43.1904 0 43.6232 0 44.008C0 44.4409 0.192439 44.8257 0.481098 45.1142L2.8866 47.519C3.17525 47.8076 3.60825 48 3.99313 48C4.37801 48 4.811 47.8076 5.09966 47.519L27.5189 25.1062C27.8076 24.8176 28 24.3848 28 24C28 23.6152 27.8076 23.1824 27.5189 22.8938L5.09966 0.480965C4.811 0.19239 4.37801 0 3.99313 0Z" fill="#1D3686"/></svg></button>', 270 prevArrow: '<button type="button" class="slick-prev"><svg width="28" height="48" viewBox="0 0 28 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24.0069 0C24.3918 0 24.8247 0.19239 25.1134 0.480965L27.5189 2.88578C27.8076 3.17435 28 3.60722 28 3.99199C28 4.37675 27.8076 4.80962 27.5189 5.0982L8.61169 24L27.5189 42.9018C27.8076 43.1904 28 43.6232 28 44.008C28 44.4409 27.8076 44.8257 27.5189 45.1142L25.1134 47.519C24.8247 47.8076 24.3918 48 24.0069 48C23.622 48 23.189 47.8076 22.9003 47.519L0.481102 25.1062C0.192442 24.8176 0 24.3848 0 24C0 23.6152 0.192442 23.1824 0.481102 22.8938L22.9003 0.480965C23.189 0.19239 23.622 0 24.0069 0Z" fill="#1D3686"/></svg></button>', 271 responsive: [{ 272 breakpoint: 1200, 273 settings: { 274 slidesToShow: 3, 275 slidesToScroll: 1 // infinite: true 276 277 } 278 }, { 279 breakpoint: 992, 280 settings: { 281 slidesToShow: 2, 282 slidesToScroll: 1 283 } 284 }, { 285 breakpoint: 768, 286 settings: { 287 slidesToShow: 1, 288 slidesToScroll: 1, 289 autoplay: true 290 } 291 }] 292 }); 293 /* $('.filter_product .accordion_title').on('click', function (e) { 294 $(this).next().slideToggle(); 295 }); */ 296 297}); 298$(document).ready(function () { 299 $('.filterSelect select, .salesFilter select').niceSelect(); 300 $(".lnkPrint").bind("click", function () { 301 window.print(); 302 }); 303 304 if ($(window).width() < 991) { 305 $(".hdLHS").next().toggle(); 306 } 307}); //For checking if a string is blank or contains only white-space 308 309String.prototype.isEmpty = function () { 310 return this.length === 0 || !this.trim(); 311}; 312 313if (typeof String.prototype.trim !== 'function') { 314 String.prototype.trim = function () { 315 return this.replace(/^\s+|\s+$/g, ''); 316 }; 317} 318 319String.prototype.isEmail = function () { 320 var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; 321 322 if (!emailReg.test(this)) { 323 return false; 324 } else { 325 return true; 326 } 327}; 328 329String.prototype.isAddressSafe = function () { 330 var regExp = /^[a-zA-Z0-9\_\-\.\(\)\ \[\]\,\"\'\&\/\#\@\+]+$/; 331 return this.match(regExp); 332}; 333 334String.prototype.isNotAddressSafe = function () { 335 var regExp = /^[a-zA-Z0-9\_\-\.\(\)\ \[\]\,\"\'\&\/\#\@\+]+$/; 336 return !this.match(regExp); 337}; 338 339function isNumeric(x) { 340 var y = parseInt(x); 341 342 if (isNaN(y)) { 343 return false; 344 } else { 345 return true; 346 } 347} 348 349function LoadingAjax(txt) { 350 if (typeof txt == "undefined") { 351 txt = "Loadingââ¬Â¦"; 352 } 353 354 return "<div class='ajaxMsg' id='widgetAjaxMsg'> " + txt + "</div>"; 355} 356 357function closeCookiePolicy() { 358 var url = "index.cfm?action=cart_ajax_removeCookiePolicy"; 359 $.ajax({ 360 url: url, 361 asynchronous: true, 362 success: function (r) { 363 $("#stickycookiePolicy").fadeOut(); 364 } 365 }); 366} 367 368nodalAlert = function (message, messageClass, title, btn1text, btn2text, btn2onclick) { 369 if (title == undefined) title = ""; 370 $("#messageBg").show(); 371 $("#messageTitle").html(title); 372 $("#messageText").html(message); 373 $("#messageBg input.btn1").focus(); 374 375 if (btn1text != undefined) { 376 $("#messageBg .btn1").html(btn1text); 377 } else { 378 $("#messageBg .btn1").html("OK"); 379 } 380 381 if (messageClass != undefined) { 382 $("#messageBg").removeClass(); 383 $("#messageBg").addClass('alert ' + messageClass); 384 } else { 385 $("#messageBg").removeClass(); 386 $("#messageBg").addClass('alert success'); 387 } 388 389 if (btn2text != undefined) { 390 $("#messageBg .btn2").css("display", "inline-block"); 391 $("#messageBg .btn2").html(btn2text); 392 } else { 393 $("#messageBg .btn2").css("display", "none"); 394 $("#messageBg .btn2").html(''); 395 } 396 397 if (btn2onclick != undefined) { 398 $("#messageBg .btn2").click(btn2onclick); 399 } else { 400 $("#messageBg .btn2").click(''); 401 } 402
403 var inst = $('[data-remodal-id= modal-alert]').remodal(); 404 inst.open(); 405 setTimeout(function () { 406 inst.close(); 407 }, 5000); 408 return false; 409}; //Pushes homepage content down under fixed position header 410 411/* 412$(document).ready(function() { 413 $('body:not(#home) .wrapper').css('margin-top', $('.header').height() + 'px'); 414}); 415$(window).resize(function() { 416 $('body:not(#home) .wrapper').css('margin-top', $('.header').height() + 'px'); 417}); 418*/ 419 420$(function () { 421 initListeners(); 422 initVideoLinks(); 423}); 424 425function initListeners(){ 426 $('.filter_product__dropdown_title .title').on('click', function (e) { 427 $(this).parent().toggleClass('open'); 428 $('.filter_product__dropdown_contant').slideToggle(); 429 }); 430 431 $('.filter_product__list_table tbody .more > .link').on('click', function (event) { 432 event.preventDefault(); 433 $(this).parent().toggleClass('open'); 434 435 if ($(this).parent().hasClass('open') == true) { 436 $(this).find('span').text($(this).attr('data-up')); 437 } else { 438 $(this).find('span').text($(this).attr('data-down')); 439 } 440 441 var productId = $(this).attr("data-productid"); 442 443 $('.filter_product__list_table tr.product_detail_tr_' + productId).slideToggle(); 444 }); 445} 446 447 448function initVideoLinks() { 449 $(".video--homepage-block:not(.processed)").each(function () { 450 var oLink = $(this); 451 var oVideoMatch = getVideoMatch($(oLink).attr("href")); 452 var sNewURL = ""; 453 454 // Test if we have a match 455 if (oVideoMatch.success) { 456 if (oVideoMatch.type == "youtube") { 457 sNewURL = "https://www.youtube.com/embed/" + oVideoMatch.code + "?enablejsapi=1&html5=1&rel=0&autoplay=1"; 458 } else if (oVideoMatch.type == "vimeo") { 459 sNewURL = "https://player.vimeo.com/video/" + oVideoMatch.code + "?autoplay=1&title=0&byline=0&portrait=0"; 460 } 461 if (sNewURL != ""){ 462 $(oLink).attr("href", sNewURL); 463 } 464 } 465 466 $(oLink).addClass("processed"); 467 }); 468} 469 470function getVideoMatch(url) { 471 var regExp = {}; 472 var match = []; 473 var oReturn = { 474 success: false, 475 code: "", 476 type: "invalid" 477 }; 478 479 // Youtube 480 if ((!oReturn.success)) { 481 regExp = /.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#\&\?]*).*/; 482 match = url.match(regExp); 483 if (match && match[1].length) { 484 oReturn.success = true; 485 oReturn.code = match[1]; 486 oReturn.type = "youtube"; 487 } 488 } 489 490 // Vimeo 491 if ((!oReturn.success)) { 492 regExp = /.+vimeo.com\/(.*\/)?([^#\?]*)/; 493 match = url.match(regExp); 494 if (match && match.length) { 495 if (match[1] && match[1].length) { 496 oReturn.code = match[1]; 497 } else if (match[2] && match[2].length) { 498 oReturn.code = match[2]; 499 } 500 oReturn.success = true; 501 oReturn.type = "vimeo"; 502 } 503 } 504 505 return oReturn; 506}
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.