1$(function () { 2 3 "use strict"; 4 5 var $document = $(document), 6 $window = $(window), 7 windowWidth = window.innerWidth || $window.width(), 8 windowH = $window.height(); 9 10 // Template options 11 var templateOption = { 12 mobileMenuBreikpont: 1023, 13 smoothScroll: false, // smooth scroll enable (set 'false' for disable) 14 backToTop: true // back to top button enable (set 'false' for disable) 15 }, 16 // Google map options 17 googleMapOption = { 18 latitude: 59.3, 19 longitude: 18.0941403, 20 zoom: 14, 21 marker: [ 22 ['Our Clinic', 59.3, 18.0941403, 1, 'images/map-marker.png'] 23 ] 24 }, 25 26 // Template Blocks 27 blocks = { 28 mainSlider: $('.main-slider'), 29 servicesCarousel: $('.js-services-carousel'), 30 icnCarousel: $('.js-icn-carousel'), 31 icnAltCarousel: $('.js-icn-text-alt-carousel'), 32 counterCarousel: $('.js-counter-carousel'), 33 specialCarousel: $('.js-special-carousel'), 34 reviewsCarousel: $('.js-reviews-carousel'), 35 singleCarousel: $('.js-slider-single'), 36 googleMapHeader: 'googleMapDrop', 37 googleMapContact: 'googleMapContact', 38 galleryMain: '.js-slider-gallery-main', 39 galleryThumbs: '.js-slider-gallery-thumbs', 40 isotopeGallery: $('.gallery-isotope'), 41 specialistCarousel: $('.js-specialist-carousel'), 42 postGallery: $('.blog-isotope'), 43 counterBlock: $('.counter-box'), 44 postCarousel: $('.js-post-carousel'), 45 singleServiceCarousel: $('.js-single-service-carousel'), 46 testimonialCarousel: $('.js-testimonial-card-carousel'), 47 blogCarousel: $('.js-blog-grid-carousel'), 48 blogCarouselFull: $('.js-blog-grid-carousel-full'), 49 galleryHoverCarousel: $('.js-gallery-hover-carousel'), 50 reviewsTextCarousel: $('.js-reviews-text-carousel'), 51 serviceBoxRotator: $('.js-service-box-rotator'), 52 service2Carousel: $('.js-service-card-style2-carousel') 53 }; 54 55 56 // Detect Touch Devices 57 window.mobileCheck = function () { 58 var i = !1; 59 return function (a) { 60 (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) && (i = !0) 61 }(navigator.userAgent || navigator.vendor || window.opera), i 62 }; 63 var isTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints; 64 if (isTouch) { 65 $('body').addClass('touch'); 66 } 67 68 if (templateOption.preloader) { 69 $('.loading-body').delay(1500).fadeOut(750); 70 } else $('.loading-body').remove(); 71 72 // Time Out Resize (Debouncer) 73 function debouncer(func, timeout) { 74 var timeoutID, 75 timeout = timeout || 500; 76 return function () { 77 var scope = this, 78 args = arguments; 79 clearTimeout(timeoutID); 80 timeoutID = setTimeout(function () { 81 func.apply(scope, Array.prototype.slice.call(args)); 82 }, timeout); 83 }; 84 } 85 86 // Main Slider 87 if (blocks.mainSlider.length) { 88 var $el = blocks.mainSlider; 89 $el.each(function () { 90 $el.find('.slide').first().find('.img--holder').imagesLoaded({ 91 background: true 92 }, function () { 93 setTimeout(function () { 94 $el.on('init', function (e, slick) { 95 var $firstAnimatingElements = $('div.slide:first-child').find('[data-animation]'); 96 doAnimations($firstAnimatingElements); 97 }); 98 $el.on('beforeChange', function (e, slick, currentSlide, nextSlide) { 99 var $currentSlide = $('div.slide[data-slick-index="' + nextSlide + '"]'); 100 var $animatingElements = $currentSlide.find('[data-animation]'); 101 doAnimations($animatingElements); 102 }); 103 $el.slick({ 104 autoplay: true, 105 autoplaySpeed: 6000, 106 cssEase: 'ease-in-out', 107 fade: true, 108 speed: 2000,
109 pauseOnHover: false 110 }); 111 $el.parent().find('.loading-content').addClass('disable'); 112 }, 500); 113 }) 114 }) 115 } 116 117 // Sticky Elements 118 $.fn.stickyEl = function () { 119 var $stickyNav, 120 $stickyForm, 121 offset = $('#mainSliderWrapper').length ? $('#mainSliderWrapper').height() : 0, 122 stickyNavHeight = 98, 123 headerContentPad = 9; 124 125 if ($.cookie('closePanel') == 'closed') { 126 setTimeout(function () { 127 var shiftY = (stickyNavHeight - headerContentPad * 2 - $('.header-content').height()) * -1 - 2; 128 $('.js-quickLinks').css({ 129 'transform': 'translateY(' + shiftY + 'px)' 130 }) 131 $('.js-quickLinks').addClass('closed') 132 }, 500); 133 } 134 135 $.fn.stickyEl.init = function () { 136 if (windowWidth > templateOption.mobileMenuBreikpont) { 137 if ($('.js-quickLinks').length) { 138 $('.js-quickLinks').removeClass('stuck'); 139 $stickyForm = new Waypoint.Sticky({ 140 element: $('.js-quickLinks')[0], 141 offset: -offset, 142 handler: function(direction) { 143 if (direction === 'down') { 144 $('.js-quickLinks').css({ 145 'opacity': 0 146 }) 147 setTimeout(function () { 148 if ($.cookie('closePanel') == 'closed'){ 149 var shiftY = (stickyNavHeight - $('.header-content').outerHeight()) * -1 - 2; 150 $('.js-quickLinks').css({ 151 'transform': 'translateY(' + shiftY + 'px)', 152 'opacity': 1 153 }) 154 } else { 155 var shiftY = $('.header-content').outerHeight() - 2; 156 $('.js-quickLinks').css({ 157 'transform': 'translateY(' + shiftY + 'px)', 158 'opacity': 1 159 }) 160 } 161 }, 1000); 162 } else { 163 $('.js-quickLinks').css({ 164 'transform': '' 165 }) 166 } 167 } 168 }) 169 } 170 } else { 171 $('.js-quickLinks').addClass('stuck'); 172 } 173 if (windowWidth > templateOption.mobileMenuBreikpont) { 174 if ($('.header-content').length) { 175 $stickyNav = new Waypoint.Sticky({ 176 element: $('.header-content')[0], 177 offset: -48, 178 handler: function(direction) { 179 $('body').toggleClass('stickNav') 180 } 181 }) 182 } 183 } else { 184 if ($('.header-content').length) { 185 $stickyNav = new Waypoint.Sticky({ 186 element: $('.header-content')[0], 187 offset: -35, 188 handler: function(direction) { 189 $('body').toggleClass('stickNav') 190 } 191 }) 192 } 193 } 194 } 195 this.stickyEl.init(); 196 197 $.fn.stickyEl.destroy = function () { 198 $('body').removeClass('stickNav'); 199 if ($stickyNav) { 200 $stickyNav.destroy(); 201 } 202 if ($stickyForm) { 203 $stickyForm.destroy(); 204 } 205 } 206 $('.js-quickLinks-open').on('click touchstart', function (e) { 207 e.preventDefault(); 208 if ($stickyForm) { 209 var shiftY = $('.header-content').outerHeight() - 2; 210 $('.js-quickLinks').css({ 211 'transform': 'translateY(' + shiftY + 'px)' 212 }).removeClass('closed'); 213 $.cookie("closePanel", null, { 214 path: '/' 215 }); 216 } 217 }) 218 219 $('.js-quickLinks-close').on('click touchstart', function (e) { 220 e.preventDefault(); 221 if ($stickyForm) { 222 var shiftY = 0 - $('.js-quickLinks').height() + $('.header-content').outerHeight() - 2; 223 $('.js-quickLinks').css({ 224 'transform': 'translateY(' + shiftY + 'px)' 225 }) 226 } 227 $.cookie('closePanel', 'closed', { 228 expires: 1, 229 path: '/' 230 }); 231 setTimeout(function () { 232 $('.js-quickLinks').addClass('closed') 233 }, 500); 234 }) 235 } 236 237 // Count To 238 function count(options) { 239 var $this = $(this); 240 options = $.extend({}, options || {}, $this.data('countToOptions') || {}); 241 $this.countTo(options); 242 } 243 // number counter 244 if (blocks.counterBlock.length) { 245 blocks.counterBlock.each(function () { 246 var $this = $(this); 247 $this.waypoint(function () { 248 $('.counter-box-number > span', $this).each(count); 249 $this.addClass('counted') 250 this.destroy(); 251 }, { 252 triggerOnce: true, 253 offset: '80%' 254 }); 255 }) 256 } 257 258 // Slick Carousels Start 259 260 if (blocks.serviceBoxRotator.length) { 261 blocks.serviceBoxRotator.slick({ 262 mobileFirst: false, 263 slidesToShow: 1, 264 slidesToScroll: 1, 265 infinite: true, 266 autoplay: true, 267 autoplaySpeed: 1800,
268 arrows: false, 269 dots: false, 270 fade: true, 271 responsive: [{ 272 breakpoint: 575, 273 settings: { 274 dots: true 275 } 276 }] 277 }); 278 } 279 280 if (blocks.servicesCarousel.length) { 281 blocks.servicesCarousel.slick({ 282 mobileFirst: false, 283 slidesToShow: 1, 284 slidesToScroll: 1, 285 infinite: false, 286 arrows: false, 287 dots: true, 288 autoplay: true, 289 autoplaySpeed: 4000, 290 speed: 1600, 291 pauseOnHover: false 292 }); 293 blocks.servicesCarousel.slick('slickPause'); 294 blocks.servicesCarousel.waypoint({ 295 offset: 500, 296 handler: function () { 297 $(this.element).slick('slickPlay'); 298 this.destroy(); 299 } 300 }); 301 } 302 if (blocks.icnCarousel.length) { 303 slickicnCarousel(); 304 } 305 306 // icon carousel 307 function slickicnCarousel() { 308 if (blocks.icnCarousel.hasClass('slick-initialized')) { 309 blocks.icnCarousel.slick('unslick'); 310 } else { 311 if ($(window).width() > 768) { 312 blocks.icnCarousel.slick({ 313 //slidesToShow: 3, 314 slidesToScroll: 1, 315 infinite: true, 316 autoplay: true, 317 autoplaySpeed: 5000, 318 speed: 1200, 319 arrows: false, 320 dots: true, 321 pauseOnHover: false, 322 responsive: [ 323 { 324 breakpoint: 1024, 325 settings: { 326 slidesToShow: 2 327 } 328 }] 329 }); 330 } 331 } 332 } 333 334 if (blocks.counterCarousel.length) { 335 blocks.counterCarousel.slick({ 336 slidesToShow: 4, 337 slidesToScroll: 1, 338 infinite: true, 339 autoplay: true, 340 autoplaySpeed: 5000, 341 speed: 1200, 342 arrows: false, 343 dots: true, 344 pauseOnHover: false, 345 responsive: [ 346 { 347 breakpoint: 1024, 348 settings: { 349 slidesToShow: 4 350 } 351 }, 352 { 353 breakpoint: 767, 354 settings: { 355 slidesToShow: 2 356 } 357 }, 358 { 359 breakpoint: 575, 360 settings: { 361 slidesToShow: 1 362 } 363 }] 364 }); 365 blocks.counterCarousel.slick('slickPause'); 366 blocks.counterCarousel.waypoint({ 367 offset: 500, 368 handler: function () { 369 $(this.element).slick('slickPlay'); 370 this.destroy(); 371 } 372 }); 373 } 374 375 if (blocks.specialistCarousel.length) { 376 blocks.specialistCarousel.slick({ 377 slidesToShow: 3, 378 slidesToScroll: 1, 379 infinite: true, 380 autoplay: true, 381 autoplaySpeed: 5000, 382 speed: 1200, 383 arrows: false, 384 dots: true, 385 pauseOnHover: false, 386 responsive: [ 387 { 388 breakpoint: 1024, 389 settings: { 390 slidesToShow: 3 391 } 392 }, 393 { 394 breakpoint: 992, 395 settings: { 396 slidesToShow: 2 397 } 398 }, 399 { 400 breakpoint: 575, 401 settings: { 402 slidesToShow: 1 403 } 404 }] 405 }); 406 blocks.specialistCarousel.slick('slickPause'); 407 blocks.specialistCarousel.waypoint({ 408 offset: 500, 409 handler: function () { 410 $(this.element).slick('slickPlay'); 411 this.destroy(); 412 } 413 }); 414 } 415 if (blocks.icnAltCarousel.length) { 416 blocks.icnAltCarousel.slick({ 417 slidesToShow: 3, 418 slidesToScroll: 1, 419 infinite: true, 420 autoplay: true, 421 autoplaySpeed: 5000, 422 speed: 1200, 423 arrows: false, 424 dots: true, 425 pauseOnHover: false, 426 427 responsive: [ 428 { 429 breakpoint: 767, 430 settings: { 431 slidesToShow: 2 432 } 433 }, 434 { 435 breakpoint: 575, 436 settings: { 437 slidesToShow: 1 438 } 439 }] 440 }); 441 } 442 if (blocks.specialCarousel.length) { 443 blocks.specialCarousel.slick({ 444 mobileFirst: false, 445 slidesToShow: 2, 446 slidesToScroll: 1, 447 infinite: true, 448 autoplay: true, 449 autoplaySpeed: 3500, 450 arrows: false, 451 dots: true, 452 speed: 1500, 453 pauseOnHover: false, 454 responsive: [ 455 { 456 breakpoint: 575, 457 settings: { 458 slidesToShow: 1 459 } 460 }] 461 }); 462 blocks.specialCarousel.slick('slickPause'); 463 blocks.specialCarousel.waypoint({ 464 offset: 500, 465 handler: function () { 466 $(this.element).slick('slickPlay'); 467 this.destroy(); 468 } 469 }); 470 } 471 if (blocks.reviewsCarousel.length) { 472 blocks.reviewsCarousel.slick({ 473 mobileFirst: false, 474 slidesToShow: 1, 475 slidesToScroll: 1, 476 infinite: true, 477 autoplay: true, 478 autoplaySpeed: 5000, 479 arrows: true, 480 dots: false, 481 speed: 1200, 482 responsive: [ 483 { 484 breakpoint: 992, 485 settings: { 486 arrows: false, 487 dots: true, 488 } 489 }] 490 }); 491 blocks.reviewsCarousel.slick('slickPause'); 492 blocks.reviewsCarousel.waypoint({ 493 offset: 500, 494 handler: function () { 495 $(this.element).slick('slickPlay'); 496 this.destroy(); 497 } 498 }); 499 } 500 if (blocks.singleCarousel.length) { 501 blocks.singleCarousel.slick({ 502 mobileFirst: false, 503 slidesToShow: 1, 504 slidesToScroll: 1, 505 infinite: true, 506 arrows: true, 507 fade: true, 508 autoplay: true, 509 autoplaySpeed: 3000, 510 pauseOnHover: false 511 }); 512 blocks.singleCarousel.slick('slickPause'); 513 blocks.singleCarousel.waypoint({ 514 offset: 500, 515 handler: function () { 516 $(this.element).slick('slickPlay'); 517 this.destroy(); 518 } 519 }); 520 } 521 522 if (blocks.postCarousel.length) { 523 blocks.postCarousel.slick({ 524 mobileFirst: false, 525 slidesToShow: 1, 526 slidesToScroll: 1, 527 infinite: true, 528 autoplay: true, 529 autoplaySpeed: 4000, 530 arrows: true, 531 dots: false 532 }); 533 } 534 535 if (blocks.galleryHoverCarousel.length) { 536 blocks.galleryHoverCarousel.slick({ 537 mobileFirst: false, 538 slidesToShow: 1, 539 slidesToScroll: 1, 540 infinite: true, 541 autoplay: true, 542 autoplaySpeed: 4000, 543 speed: 1500,
544 arrows: false, 545 dots: true 546 }); 547 } 548 549 if (blocks.singleServiceCarousel.length) { 550 blocks.singleServiceCarousel.slick({ 551 mobileFirst: false, 552 slidesToShow: 1, 553 slidesToScroll: 1, 554 infinite: true, 555 autoplay: true, 556 autoplaySpeed: 8000, 557 speed: 2500, 558 arrows: true, 559 dots: true, 560 responsive: [ 561 { 562 breakpoint: 1024, 563 settings: { 564 arrows: false, 565 adaptiveHeight: true 566 } 567 }] 568 }); 569 } 570 571 if (blocks.blogCarousel.length) { 572 blocks.blogCarousel.slick({ 573 slidesToShow: 2, 574 slidesToScroll: 1, 575 infinite: true, 576 autoplay: true, 577 autoplaySpeed: 5000, 578 arrows: false, 579 dots: true, 580 responsive: [ 581 { 582 breakpoint: 767, 583 settings: { 584 slidesToShow: 1 585 } 586 }] 587 }); 588 } 589 590 if (blocks.blogCarouselFull.length) { 591 blocks.blogCarouselFull.slick({ 592 slidesToShow: 3, 593 slidesToScroll: 1, 594 infinite: true, 595 autoplay: true, 596 autoplaySpeed: 5000, 597 speed: 1500, 598 arrows: false, 599 dots: true, 600 responsive: [ 601 { 602 breakpoint: 1024, 603 settings: { 604 slidesToShow: 2 605 } 606 }, { 607 breakpoint: 575, 608 settings: { 609 slidesToShow: 1 610 } 611 }] 612 }); 613 } 614 615 if (blocks.testimonialCarousel.length) { 616 blocks.testimonialCarousel.slick({ 617 mobileFirst: false, 618 slidesToShow: 1, 619 slidesToScroll: 1, 620 infinite: true, 621 autoplay: true, 622 arrows: false, 623 autoplaySpeed: 5000, 624 speed: 1500, 625 dots: true 626 }); 627 } 628 629 if (blocks.reviewsTextCarousel.length) { 630 blocks.reviewsTextCarousel.slick({ 631 mobileFirst: false, 632 slidesToShow: 1, 633 slidesToScroll: 1, 634 infinite: true, 635 autoplay: true, 636 arrows: false, 637 autoplaySpeed: 6000, 638 speed: 1500, 639 dots: false 640 }); 641 } 642 643 if (blocks.service2Carousel.length) { 644 blocks.service2Carousel.slick({ 645 slidesToShow: 3, 646 slidesToScroll: 1, 647 infinite: true, 648 autoplay: true, 649 autoplaySpeed: 5000, 650 speed: 1200, 651 arrows: false, 652 dots: true, 653 pauseOnHover: false, 654 responsive: [ 655 { 656 breakpoint: 1024, 657 settings: { 658 slidesToShow: 2 659 } 660 }, 661 { 662 breakpoint: 575, 663 settings: { 664 slidesToShow: 1 665 } 666 }] 667 }); 668 } 669 // Slick Carousels End 670 671 // Post Isotope 672 if (blocks.postGallery.length) { 673 var $postgallery = $('.blog-isotope'); 674 $postgallery.imagesLoaded(function () { 675 $postgallery.isotope({ 676 itemSelector: '.blog-post', 677 masonry: { 678 gutter: 30, 679 columnWidth: '.blog-post' 680 } 681 }); 682 setTimeout(function () { 683 $postgallery.parent('.gallery-wrap').addClass('loaded'); 684 }, 500); 685 }); 686 } 687 688 // Isotope Gallery 689 if (blocks.isotopeGallery.length) { 690 var $gallery = blocks.isotopeGallery; 691 $gallery.imagesLoaded(function () { 692 $gallery.isotope({ 693 itemSelector: '.gallery-item', 694 masonry: { 695 columnWidth: '.gallery-item', 696 gutter: 30 697 } 698 }); 699 setTimeout(function () { 700 $gallery.isotope('layout'); 701 $gallery.parent('.gallery-wrap').addClass('loaded'); 702 }, 500); 703 }); 704 isotopeFilters($gallery); 705 } 706 707 // Isotope Filters (for Gallery Page) 708 function isotopeFilters(gallery) { 709 var $gallery = $(gallery); 710 if ($gallery.length) { 711 var container = $gallery; 712 var optionSets = $(".filters-by-category .option-set"), 713 optionLinks = optionSets.find("a"); 714 optionLinks.on('click', function (e) { 715 var thisLink = $(this); 716 if (thisLink.hasClass("selected")) return false; 717 var optionSet = thisLink.parents(".option-set"); 718 optionSet.find(".selected").removeClass("selected"); 719 thisLink.addClass("selected"); 720 var options = {}, 721 key = optionSet.attr("data-option-key"), 722 value = thisLink.attr("data-option-value"); 723 value = value === "false" ? false : value; 724 options[key] = value; 725 if (key === "layoutMode" && typeof changeLayoutMode === "function") changeLayoutMode($this, options); 726 else { 727 container.isotope(options); 728 } 729 return false 730 }) 731 } 732 } 733 734 // Syncronized Gallery 735 function sliderGallery(main, thumbs) { 736 $(main).slick({ 737 slidesToShow: 1, 738 slidesToScroll: 1, 739 fade: true, 740 asNavFor: thumbs 741 }); 742 $(thumbs).slick({ 743 slidesToShow: 5, 744 slidesToScroll: 1, 745 asNavFor: main, 746 centerMode: false, 747 focusOnSelect: true, 748 infinite: true, 749 arrows: true, 750 responsive: [ 751 { 752 breakpoint: 1024, 753 settings: { 754 slidesToShow: 4 755 } 756 }, {
757 breakpoint: 768, 758 settings: { 759 slidesToShow: 4 760 } 761 }, 762 { 763 breakpoint: 575, 764 settings: { 765 slidesToShow: 3 766 } 767 }] 768 }); 769 } 770 771 // popover Gallery 772 function popoverGallery() { 773 $('.gallery-popover-link').on('mouseover', function () { 774 $(this).closest('.container').find('.gallery-popover-link').not($(this)).addClass('darken') 775 }).on('mouseleave', function () { 776 $(this).closest('.container').find('.gallery-popover-link').removeClass('darken') 777 }) 778 $('.gallery-popover-link').popover({ 779 html: true, 780 placement: 'right', 781 trigger: 'hover', 782 delay: { 783 "show": 100, 784 "hide": 0 785 }, 786 offset: $(this).height(), 787 template: '<div class="smile-popover popover" role="tooltip"><div class="arrow"></div><div class="popover-body"></div><div class="inner-circles-loader"></div></div>', 788 content: function () { 789 var url = $(this).data('full'); 790 return '<img src="' + url + '">' 791 } 792 }) 793 } 794 795 // Pause Carousel (hover, modal) 796 function pauseCarousel(modal) { 797 $(modal).on('show.bs.modal', function (e) { 798 $('.paused-slick').slick('slickPause'); 799 }) 800 $(document).on('mouseenter', '.slick-slider', function () { 801 if ($(this).get(0).slick.options.paused) { 802 $(this).slick('slickPause'); 803 } 804 }).on('mouseleave', '.slick-slider', function () { 805 if ($(this).get(0).slick.options.autoplay && !$('body').hasClass('modal-open')) { 806 $(this).slick('slickPlay'); 807 } 808 }) 809 $('[data-toggle="modal"]').on('click', function (e) { 810 blocks.servicesCarousel.slick('slickPause'); 811 if ($(this).closest('.slick-slider').length) { 812 $(this).closest('.slick-slider').addClass('paused-slick'); 813 } 814 }) 815 } 816 817 // Mobile Menu Modal 818 function menuModal(modal) { 819 var menu = $('.js-main-menu').clone(); 820 $('#modalNavigation .modal-dialog').append(menu); 821 $(modal).on('shown.bs.modal', function (e) { 822 $('body').addClass('menu-open'); 823 }) 824 $(modal).on('hide.bs.modal', function (e) { 825 $('body').removeClass('menu-open'); 826 }) 827 }; 828 829 // Close DropMenu Button 830 function closeDrop(button) { 831 $(button).on('click', function (e) { 832 $(this).closest('.dropdown').find('.dropdown-toggle').trigger('click'); 833 e.preventDefault(); 834 }) 835 } 836 837 // Back To Top 838 function backToTop(button, flag) { 839 if (flag) { 840 var $button = $(button); 841 $(window).on('scroll', function () { 842 if ($(this).scrollTop() >= 500) { 843 $button.addClass('visible'); 844 } else { 845 $button.removeClass('visible'); 846 } 847 }); 848 $button.on('click', function () { 849 $('body,html').animate({ 850 scrollTop: 0 851 }, 1000); 852 }); 853 } else { 854 $(button).hide(); 855 } 856 } 857 858 // Slider Animation 859 function doAnimations(elements) { 860 var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; 861 elements.each(function () { 862 var $this = $(this); 863 var $animationDelay = $this.data('delay'); 864 var $animationType = 'animated ' + $this.data('animation'); 865 $this.css({ 866 'animation-delay': $animationDelay, 867 '-webkit-animation-delay': $animationDelay 868 }); 869 $this.addClass($animationType).one(animationEndEvents, function () { 870 $this.removeClass($animationType); 871 }); 872 if ($this.hasClass('animate')) { 873 $this.removeClass('animation'); 874 } 875 }); 876 } 877 878 // Google Map Start 879 var mapStyle = [ 880 { 881 "featureType": "road", 882 "elementType": "labels", 883 "stylers": [ 884 { 885 "visibility": "off" 886 } 887 ] 888 }, { 889 "featureType": "poi", 890 "elementType": "labels", 891 "stylers": [ 892 { 893 "visibility": "off" 894 } 895 ] 896 }, { 897 "featureType": "transit", 898 "elementType": "labels.text", 899 "stylers": [ 900 { 901 "visibility": "off" 902 } 903 ] 904 }]; 905 906 function createMap(id, mapZoom, lat, lng, markers) { 907 var mapOptions = { 908 zoom: mapZoom, 909 scrollwheel: false, 910 center: new google.maps.LatLng(lat, lng), 911 styles: mapStyle 912 }; 913 var mapHeader = new google.maps.Map(document.getElementById(id), mapOptions); 914 var count, 915 locations = markers; 916 for (count = 0; count < locations.length; count++) { 917 new google.maps.Marker({ 918 position: new google.maps.LatLng(locations[count][1], locations[count][2]), 919 map: mapHeader, 920 title: locations[count][0], 921 icon: locations[count][4] 922 }); 923 } 924 } 925 926 927 function footerMap(el, map) { 928 var $map = map; 929 $(el).on('click', function (e) { 930 e.preventDefault(); 931 $(this).toggleClass('opened'); 932 $map.toggleClass('opened'); 933 }) 934 } 935 // Google Map End 936 937 // Mobile Top Info 938 function mobileHeaderSlider(button) { 939 var button = button,
940 container = '.js-quickLinks-top'; 941 $(document).on('click', button, function (e) { 942 if (windowWidth <= templateOption.mobileMenuBreikpont) { 943 var $this = $(this), 944 $slide = $this.next('.link-drop'); 945 if (!$this.hasClass('active')) { 946 var backContainer = '.quickLinks .link.active'; 947 if ($(backContainer).length) { 948 $(container).children().detach().insertAfter(backContainer); 949 } 950 $(button).removeClass('active'); 951 $this.addClass('active'); 952 $slide.detach().appendTo(container); 953 } else { 954 var backContainer = '.quickLinks .link.active'; 955 $(container).children().detach().insertAfter(backContainer); 956 $this.removeClass('active'); 957 } 958 e.preventDefault(); 959 } 960 }) 961 } 962 963 // Panel Drop 964 function panelDrop(button) { 965 var button = button; 966 $(document).on('click', button, function (e) { 967 if (windowWidth > templateOption.mobileMenuBreikpont) { 968 if ($('body').hasClass('touch')) { 969 if ($(this).hasClass('active')) { 970 $(this).removeClass('active'); 971 $(this).parent().removeClass('hovered'); 972 } else { 973 $(button).removeClass('active'); 974 $(button).parent().removeClass('hovered'); 975 $(this).addClass('active'); 976 $(this).parent().addClass('hovered'); 977 } 978 } 979 e.preventDefault(); 980 } 981 }) 982 $(document).on('click', function (e) { 983 if (windowWidth > templateOption.mobileMenuBreikpont) { 984 if (!$(e.target).closest(button).length) { 985 $(button).removeClass('active'); 986 $(button).parent().removeClass('hovered'); 987 } 988 } 989 }); 990 } 991 // Header Language dropdown 992 function toggleLang(link, drop) { 993 if($(link).length){ 994 $('.header').addClass('has-lang') 995 } 996 $('> a', $(link)).on('click', function (e) { 997 e.preventDefault(); 998 $(link).toggleClass('opened'); 999 }); 1000 $(document).on('click', function (e) { 1001 if (!$(e.target).closest(link).length) { 1002 if ($(link).hasClass("opened")) { 1003 $(link).removeClass('opened'); 1004 } 1005 } 1006 }); 1007 } 1008 // header menu 1009 $.fn.headerMenu = function () { 1010 var that = this; 1011 $.fn.headerMenu.setToggler = function () { 1012 var togglerTop = $('.navbar-toggler').closest('.header-content').outerHeight()*.5 - $('.navbar-toggler').outerHeight()*.5; 1013 $('.navbar-toggler').css({'top': togglerTop + 'px'}); 1014 $('.cart-toggler').css({'top': togglerTop + 'px'}); 1015 $('.lang-toggler').css({'top': togglerTop + 'px'}); 1016 $('.header-search').css({'top': togglerTop + 'px'}); 1017 } 1018 $.fn.headerMenu.setHeight = function () { 1019 var h = $(window).height() - $('.header').height(); 1020 if ($('.header-content').hasClass('stuck')) { 1021 h = $(window).height() - $('.header-content').height(); 1022 } 1023 $('.header .navbar-collapse').css({ 1024 'max-height': h 1025 }) 1026 } 1027 $.fn.headerMenu.init = function () { 1028 $('.navbar-toggler').on('click', function (e) { 1029 that.headerMenu.setHeight(); 1030 $('body').toggleClass('noScroll'); 1031 $('.js-header-quickLinks .link.active').trigger('click'); 1032 }) 1033 $('.nav-item > a.dropdown-toggle').on('click', function (e) { 1034 if (!$('body').hasClass('touch')) { 1035 if (windowWidth > templateOption.mobileMenuBreikpont) { 1036 window.location.href = $(this).attr('href'); 1037 } 1038 } else { 1039 if ($(this).next().hasClass('show')) { 1040 window.location.href = $(this).attr('href'); 1041 } 1042 } 1043 }) 1044 $('.dropdown-menu a.dropdown-toggle').on('click', function (e) { 1045 var $el = $(this); 1046 var $parent = $(this).offsetParent('.dropdown-menu'); 1047 if (!$(this).next().hasClass('show')) { 1048 $(this).parents('.dropdown-menu').first().find('.show').removeClass('show'); 1049 } 1050 var $subMenu = $(this).next('.dropdown-menu'); 1051 $subMenu.toggleClass('show'); 1052 $(this).parent('li').toggleClass('show'); 1053 $(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function (e) { 1054 $('.dropdown-menu .show').removeClass('show'); 1055 }); 1056 if (!$parent.parent().hasClass('navbar-nav')) { 1057 $el.next().css({ 1058 "top": $el[0].offsetTop, 1059 "left": $parent.outerWidth() - 4 1060 }); 1061 } 1062 return false; 1063 }); 1064 } 1065 this.headerMenu.init(); 1066 this.headerMenu.setHeight(); 1067 this.headerMenu.setToggler(); 1068 } 1069 1070 function mobileInfoSlide() { 1071 var $toggle = $('.js-info-toggle'), 1072 $content = $('.js-info-content'); 1073 $toggle.on('click', function (e) { 1074 e.preventDefault(); 1075 $content.slideToggle(200); 1076 $toggle.toggleClass('opened'); 1077 }) 1078 } 1079 1080 // background image inline 1081 function dataBg(el) { 1082 $(el).each(function () { 1083 var $this = $(this), 1084 bg = $this.attr('data-bg'); 1085 $this.css({ 1086 'background-image': 'url(' + bg + ')' 1087 }); 1088 }); 1089 } 1090 1091 //scroll to ahchor 1092 function scrollTo() { 1093 $('a[href*="#"]').not('[href="#"]').not('.nav-link').not('[data-toggle]').on('click', function (event) { 1094 if (
1095 location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && 1096 location.hostname == this.hostname 1097 ) { 1098 var target = $(this.hash); 1099 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 1100 if (target.length) { 1101 event.preventDefault(); 1102 $('html, body').animate({ 1103 scrollTop: target.offset().top - 130 1104 }, 1000); 1105 } 1106 if (target.attr('id') == 'googleMapFooter') { 1107 $('.js-footer-map-toggle').trigger('click'); 1108 } 1109 } 1110 }); 1111 } 1112 1113 // reposition 1114 $.fn.repos = function () { 1115 var desktop = '.js-quickLinks-wrap-d', 1116 mobile = '.js-quickLinks-wrap-m', 1117 reposWidth = templateOption.mobileMenuBreikpont, 1118 windowW = windowW ? windowW : $window.width(), 1119 isMobile = windowW < reposWidth, 1120 that = this; 1121 $.fn.repos.init = function () { 1122 that.repos.reposition(isMobile); 1123 } 1124 $.fn.repos.reinit = function (windowW) { 1125 var windowW = windowW ? windowW : $window.width(), 1126 isMobile = windowW < reposWidth; 1127 that.repos.reposition(isMobile); 1128 }; 1129 $.fn.repos.reposition = function (isMobile) { 1130 var $desktop = $(desktop), 1131 $mobile = $(mobile); 1132 if (isMobile) { 1133 if ($desktop.length) { 1134 $desktop.children().detach().appendTo($mobile); 1135 } 1136 } else { 1137 if ($desktop.length) { 1138 $mobile.children().detach().appendTo($desktop); 1139 } 1140 } 1141 } 1142 this.repos.init(); 1143 }; 1144 1145 function fixedTable() { 1146 $('.js-fixed-table').each(function () { 1147 var $this = $(this), 1148 $parent = $this.closest('.table-scroll'); 1149 var table = $this.clone(true).addClass('clone'); 1150 $parent.append(table); 1151 }) 1152 1153 } 1154 1155 // landing 1156 $.fn.pageScroller = function (options) { 1157 1158 var settings = $.extend({ 1159 nav: $(this), 1160 links: $(this).find('.link-inside'), 1161 navActiveClass: 'active', 1162 scrollContainer: $('html, body'), 1163 scrollSpeed: 1000, 1164 section: $('div'), 1165 navHeight: 180, 1166 quickLinks: $('.quickLinks-wrap') 1167 }, options); 1168 1169 settings.links.each(function () { 1170 var link = $(this), 1171 targetSection = $(link.attr('href')), 1172 quickLinksH = 0; 1173 link.on('click', function (e) { 1174 e.preventDefault(); 1175 e.stopPropagation(); 1176 $('.navbar-nav').find('li').removeClass(settings.navActiveClass); 1177 link.closest('li').addClass(settings.navActiveClass); 1178 if(!$('.navbar-toggler').hasClass('collapsed')) { 1179 $(".navbar-toggler").trigger('click') 1180 } 1181 settings.scrollContainer.stop().animate({ 1182 scrollTop: targetSection.offset().top - settings.navHeight - quickLinksH 1183 }, settings.scrollSpeed); 1184 }); 1185 }); 1186 1187 $(window).on('scroll', function () { 1188 var wScroll = $(window).scrollTop() + settings.navHeight + 1; 1189 settings.section.each(function () { 1190 if ($(this).attr('id')) { 1191 var id = $(this).attr('id'), 1192 top = $(this).offset().top, 1193 secHeight = $(this).outerHeight(); 1194 if (top <= wScroll && (top + secHeight) > wScroll) { 1195 settings.links.parent('li').removeClass(settings.navActiveClass); 1196 settings.nav.find('a[href="#' + id + '"]').parent('li').addClass(settings.navActiveClass); 1197 } 1198 } 1199 }); 1200 }); 1201 }; 1202 // landing navigation 1203 function landingNav() { 1204 $('a[href*="#"].link-inside').on('click', function (event) { 1205 if ( 1206 location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && 1207 location.hostname == this.hostname 1208 ) { 1209 var target = $(this.hash); 1210 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 1211 if (target.length) { 1212 event.preventDefault(); 1213 $('html, body').animate({ 1214 scrollTop: target.offset().top - 130 1215 }, 1000); 1216 } 1217 if (target.attr('id') == 'googleMapFooter') { 1218 $('.js-footer-map-toggle').trigger('click'); 1219 } 1220 } 1221 }); 1222 } 1223 // video popup 1224 function videoPopup(button, modal) { 1225 var videoSrc; 1226 $(button).on('click', function() { 1227 videoSrc = $(this).data('src'); 1228 }); 1229 $(modal).on('shown.bs.modal', function () { 1230 $('.video', $(modal)).attr('src', videoSrc + '?autoplay=1&modestbranding=1&showinfo=0'); 1231 }) 1232 } 1233 1234 // department tabs 1235 function departmentTabs() { 1236 var $tabs = $('.js-department-tabs'),
1237 $departments = $('.js-department-carousel'); 1238 $tabs.children().each(function (i) { 1239 $(this).on('click', function () { 1240 $(this).siblings().removeClass('active'); 1241 $(this).addClass('active'); 1242 $departments.slick('slickGoTo', i); 1243 }) 1244 }); 1245 $departments.on('afterChange', function(){ 1246 $tabs.children().removeClass('active'); 1247 $tabs.children().eq($('.slick-active', $departments).attr('data-slick-index')).addClass('active'); 1248 }); 1249 $departments.slick({ 1250 mobileFirst: false, 1251 slidesToShow: 1, 1252 slidesToScroll: 1, 1253 infinite: false, 1254 fade: true, 1255 cssEase: 'cubic-bezier(0.7, 0, 0.3, 1)', 1256 speed: 300, 1257 arrows: true, 1258 autoplay: false, 1259 pauseOnHover: false, 1260 responsive: [ 1261 { 1262 breakpoint: 480, 1263 settings: { 1264 fade: false, 1265 dots: true 1266 } 1267 } 1268 ] 1269 }); 1270 } 1271 1272 function filterCarousel(filter, carousel){ 1273 $(filter).find('select').on('change', function() { 1274 var filterClass = $(this).val(); 1275 $(carousel).slick('slickUnfilter'); 1276 if (filterClass != 'all') { 1277 $(carousel).slick('slickFilter', filterClass); 1278 } 1279 }); 1280 } 1281 1282 // Functions Initializations 1283 $(document).stickyEl(); 1284 $(document).repos(); 1285 $(document).headerMenu(); 1286 popoverGallery(); 1287 menuModal('#modalNavigation'); 1288 pauseCarousel('.modal');
1289 mobileHeaderSlider('.js-header-quickLinks .link'); 1290 panelDrop('.js-quickLinks-wrap-d .link'); 1291 closeDrop('.js-drop-close'); 1292 backToTop('.js-backToTop', templateOption.backToTop); 1293 scrollTo(); 1294 dataBg('[data-bg]'); 1295 fixedTable(); 1296 mobileInfoSlide(); 1297 toggleLang('.header-lang', '.header-lang-dropdown'); 1298 1299 videoPopup('.video-btn','#videoModal'); 1300 departmentTabs(); 1301 filterCarousel('.filterCarousel','.js-specialist-carousel'); 1302 landingNav(); 1303 1304 $('.navbar-nav').pageScroller(); 1305 $('[data-toggle=tooltip]').tooltip(); 1306 if ($('.twentytwenty-container').length) { 1307 $('.twentytwenty-container').twentytwenty({ 1308 before_label: 'before', 1309 after_label: 'after' 1310 }); 1311 } 1312 if (templateOption.smoothScroll) { 1313 $('html').scrollWithEase(); 1314 } 1315 if ($(blocks.galleryMain.length) && $(blocks.galleryThumbs.length)) { 1316 sliderGallery(blocks.galleryMain, blocks.galleryThumbs); 1317 } 1318 1319 if ($("#" + blocks.googleMapHeader).length) { 1320 createMap(blocks.googleMapHeader, googleMapOption.zoom, googleMapOption.latitude, googleMapOption.longitude, googleMapOption.marker); 1321 } 1322 if ($("#" + blocks.googleMapContact).length) { 1323 createMap(blocks.googleMapContact, googleMapOption.zoom, googleMapOption.latitude, googleMapOption.longitude, googleMapOption.marker); 1324 } 1325 1326 // Resize Window Events 1327 $(window).on('orientationchange', function (e) { 1328 $(document).stickyEl.destroy(); 1329 }); 1330 $(window).on('orientationchange', debouncer(function (e) { 1331 windowWidth = $window.width(); 1332 $(document).stickyEl.init() 1333 $(document).headerMenu.setHeight(); 1334 $(document).headerMenu.setToggler(); 1335 $(document).repos.reinit(windowWidth); 1336 if (blocks.icnCarousel.length) { 1337 slickicnCarousel(); 1338 } 1339 })); 1340 $(window).on('resize', debouncer(function (e) { 1341 var windowWidthNew = $window.width(); 1342 if (windowWidthNew != windowWidth) { 1343 windowWidth = windowWidthNew; 1344 $(document).repos.reinit(windowWidthNew); 1345 if (blocks.icnCarousel.length) { 1346 slickicnCarousel(); 1347 } 1348 } 1349 if (!$('body').hasClass('touch')) { 1350 $(document).stickyEl.destroy(); 1351 $(document).stickyEl.init(); 1352 $(document).headerMenu.setHeight(); 1353 $(document).headerMenu.setToggler(); 1354 } 1355 })); 1356 1357})
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.