(function ($) {
  $(document).ready(function () {
    var $body = $('body');
    var $window = $(window);
    var swipe_wrapper = $("#swipe_wrapper");
    var menu = $('.menu-wrapper');
    var $html = $("html");
    var full_page_container = $('#fullpage');
    var header_menu_item = $('header ul li.has-dropdown, .sub-header ul li.has-dropdown');
    var show_data = $('.show-note, .show-socials');
    var services = $('.services');
    var archiveSlider = $('.single-archive-slider');

    $('.matchHeight').matchHeight();
    try {
      $('.matchHeight').matchHeight();
    } catch (err) { }

    resizeElements($('.column'));
    resizeElements($('.d-column'));
    resizeElements($('.skill-col'));
    resizeElementsDesctop($('.section-bamboo.fp-section .col-xs-12'));
    footerPadding();

    $window.resize(function () {
      resizeElements($('.column'));
      resizeElements($('.d-column'));
      resizeElements($('.skill-col'));
      resizeElementsDesctop($('.section-bamboo.fp-section .col-xs-12'));
      footerPadding();
    });

    $('.d-column img, .column img').on('load', function () {
      resizeElements($('.d-column'));
      resizeElements($('.column'));
    });
    $('footer img').on('load', function () {
      footerPadding();
    });

    //menu
    var headH = $('header').innerHeight();
    $('.sma-menu-main li.has-dropdown').hover(function () {
      var $ul = $(this).find('ul.subitems');
      // animate the whole list
      $ul.hide().height('auto');
      var fullHeight = $ul.height();
      $ul.height(0).show();
      var openAnimationDuration = 300;
      $('header').animate({ height: headH + fullHeight }, 0);
      $ul.animate({ height: fullHeight }, openAnimationDuration);
      // animate list items
      var index = 0;
      var total = $ul.find('li').size();
      $ul.find('li').each(function () {
        var $li = $(this);
        $li.css({ left: '-' + $li.width() + 'px' });
        var animationDelay = (openAnimationDuration / total) * (index++);
        $li.t = setTimeout((function () {
          $li.stop().animate({ left: 0 }, 300);
        }), animationDelay);
      });
    },
      function () {
        // animate the whole list (reverse)
        var $ul = $(this).find('ul.subitems');
        var closeAnimationDuration = 500;
        $ul.animate({ height: '0px' }, closeAnimationDuration);
        // animate list items (reverse)
        var index = 0;
        var total = $ul.find('li').size();
        $ul.find('li').each(function () {
          var $li = $(this);
          var animationDelay = (closeAnimationDuration / total) * (total - 3 - index++);
          $li.t = setTimeout((function () {
            $li.stop().animate({ left: '-' + $li.width() + 'px' }, 300);
          }), animationDelay);
        });
        console.log(headH);
        $('header').animate({ height: headH }, closeAnimationDuration);
      });


    // Click events
    $('.toggle-menu').on('click', function () {
      menu.fadeIn(200, function () {
        $body.addClass('menu-open');
      });
    });
    $('.close-menu').on('click', function () {
      menu.fadeOut(200, function () {
        $body.toggleClass('menu-open');
      });
    });
    $('.show-full').on('click', function (e) {
      $('.img-show-container').html('<p><span class="ov-qr__title">微信扫码关注</span></p><div class="qr-wrapper"><img src="' + $(this).attr('href') + '"></div><strong>Flow唯吾</strong>');

      $('.img-show-wrapper').addClass('open');
      e.preventDefault();
    });
    $('.close-img-show').on('click', function () {
      $('.img-show-wrapper').removeClass('open');
    });
    show_data.on('click', function () {
      $(this).toggleClass('open');
    });
    $('.scroll-to a').on('click', function (e) {
      var curSection = $('.current-section');
      if (curSection.length > 0) {
        curSection.removeClass('current-section');
        $($(this).attr('href')).addClass('current-section');
      }
      $("html, body").animate({ scrollTop: $($(this).attr('href')).offset().top }, 500);

      e.preventDefault();
    });
    $('.scroll-next a').on('click', function (e) {
      $("html, body").animate({ scrollTop: $('.dragend-page').eq(1).offset().top }, 500);
      e.preventDefault();
    });
    $('.scroll-top a').on('click', function () {
      $("html, body").animate({ scrollTop: 0 }, 500);
    });
    $('.mobile-menu li a').on('click', function (e) {
      if ($(this).closest('li').hasClass('has-dropdown')) {
        $(this).closest('li').toggleClass('open');
        e.preventDefault();
      }
    });
    $('.services-toggle').on('click', function () {
      services.slideToggle(300);
    });
    $('.filters-toggle').on('click', function () {
      $('.small-device-fix').toggleClass('open');
    });

    $('.all-project').click(function () {
      $('#secondPage')
      $('html, body').animate({
        scrollTop: $('#secondPage').offset().top
      }, 800);
      return false;
    });
    // full page scroll plugin
    if (full_page_container.length > 0) {
      var autoScrolling = true;
      var anchors = [];
      var slidesNavigation = false;
      var controlArrows = false;
      var scrollOverflow = true;
      var header = $('header');
      if (full_page_container.hasClass('expertises-project')) {
        anchors = [];
        slidesNavigation = true;
        controlArrows = true;
        scrollOverflow = true;
      }
      if (msieversion()) {
        autoScrolling = false;
        scrollOverflow = false;
        $html.addClass('ie-browser');
      }
      var idInterval;
      full_page_container.fullpage({
        //Navigation
        menu: '#menu',
        lockAnchors: false,
        anchors: anchors,
        navigation: false,
        navigationPosition: 'top',
        navigationTooltips: ['firstSlide', 'secondSlide'],
        showActiveTooltip: false,
        slidesNavigation: slidesNavigation,
        slidesNavPosition: 'right',

        //Scrolling
        css3: true,
        scrollingSpeed: 700,
        autoScrolling: autoScrolling,
        fitToSection: false,
        fitToSectionDelay: 1000,
        scrollBar: false,
        easing: 'easeInOutCubic',
        easingcss3: 'ease',
        loopBottom: false,
        loopTop: false,
        loopHorizontal: true,
        continuousVertical: false,
        // scrollOverflow: scrollOverflow,
        scrollOverflow: true,
        touchSensitivity: 15,
        normalScrollElementTouchThreshold: 5,

        //Accessibility
        keyboardScrolling: true,
        animateAnchor: true,
        recordHistory: false,

        //Design
        controlArrows: controlArrows,
        verticalCentered: true,
        resize: true,
        paddingTop: '0',
        paddingBottom: '0',
        responsiveWidth: 992,
        responsiveHeight: 620,

        lazyLoading: true,

        //Custom selectors
        sectionSelector: '.section',
        slideSelector: '.slide',

        //events
        onLeave: function (index, nextIndex, direction) {
          console.log('------------------');
          console.log({ "index": index, "nextIndex": nextIndex, "direction": direction });
          console.log($('section:nth(' + index + ')').is(':visible'));

          if ($(document).width() > 640) {
            if (!$('section:nth(' + index + ')').is(':visible')) {

              // console.log(nextIndex-1 + 'hidden');
              if (direction == 'down') {
                $.fn.fullpage.moveTo(nextIndex + 1);
              }
              if (direction == 'up' && (nextIndex - 1) != 0) {
                $.fn.fullpage.moveTo(nextIndex - 1);
              }
            }
          }
        },
        afterLoad: function (anchorLink, index) {

          if ($('.dragend-page.active').hasClass('theme-light')) {
            $body.addClass('light');
          } else {
            $body.removeClass('light');
          }
        },
        afterRender: function () {
          var page = 1;
          var swipeControl = $('.swipe-control');

          $('.dragend-page').each(function () {
            $('.swipe-control .dots ul').append('<li data-page="' + page++ + '" data-menuanchor="' + $(this).data('anchor') + '"><a href="#' + $(this).data('anchor') + '"></a></li>')
          });
          $('#menu').find('li').eq(0).addClass('active');
          footerPadding();

          if (window.location.hash && (window.location.hash.indexOf('#firstPage') === -1 || window.location.hash.indexOf('#homeMain') === -1)) {
            swipeControl.removeClass('swipe-control--invisible');
            header.addClass('header--blue').removeClass('header--transparent_blue');
          } else {
            $('.animated-menu-block').addClass('active');
          }

          $('.swipe-control .dots a').click(function () {
            if (window.location.hash.indexOf('#firstPage') !== -1 || window.location.hash.indexOf('#homeMain') !== -1) {
              swipeControl.addClass('swipe-control--invisible');
            } else {
              swipeControl.removeClass('swipe-control--invisible');
            }
          });

          $(window).on('hashchange', function () {
            if (window.location.hash.indexOf('#firstPage') !== -1 || window.location.hash.indexOf('#homeMain') !== -1) {
              swipeControl.addClass('swipe-control--invisible');
              //header.removeClass('header--blue').addClass('header--transparent_blue');
            } else {
              swipeControl.removeClass('swipe-control--invisible');
              header.addClass('header--blue').removeClass('header--transparent_blue');
              $('.animated-menu-block').addClass('active');
            }
          });

          $('.slide-nav .next').on('click', function () {
            $.fn.fullpage.moveSlideRight();
          });

          $('.slide-nav .prev').on('click', function () {
            $.fn.fullpage.moveSlideLeft();
          });
          $('.scroll-next a').on('click', function (e) {
            $.fn.fullpage.moveTo(1);
            e.preventDefault();
          });
          var slider_section = $('.slider-section');
          if (slider_section.length > 0) {
            slider_section.each(function () {
              $(this).find('.fp-controlArrow').detach().appendTo($(this).find('.fp-slidesNav'));
            });
          }
          resizeElementsDesctop($('.section-bamboo.fp-section .col-xs-12'));

          // Automatic slideshow

        },
        afterResize: function () {
        },
        afterSlideLoad: function (anchorLink, index, slideAnchor, slideIndex) {
          resizeElementsDesctop($('.section-bamboo.fp-section .col-xs-12'));
          if ($('.expertises-project, .section-bamboo').length && $('.section').eq(index - 1).find('.slide').length) {
            if (typeof (idInterval) == 'number') {
              clearInterval(idInterval);
            }
            idInterval = setInterval(function () {
              $.fn.fullpage.moveSlideRight();
            }, 10000);
          } else {
            clearInterval(idInterval);
          }
        },
        onSlideLeave: function (anchorLink, index, slideIndex, direction, nextSlideIndex) {
        }
      });
    }
    var isMobile = {
      Android: function () {
        return /Android/i.test(navigator.userAgent);
      },
      BlackBerry: function () {
        return /BlackBerry/i.test(navigator.userAgent);
      },
      iOS: function () {
        return /iPhone|iPad|iPod/i.test(navigator.userAgent);
      },
      Windows: function () {
        return /IEMobile/i.test(navigator.userAgent);
      },
      any: function () {
        return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());
      }
    };
    if (!isMobile.any()) {
      $html.niceScroll({
        scrollspeed: 60,
        mousescrollstep: 60
      });
      $html.addClass('nice-scroll-active');
    }
    menu.niceScroll();

    $window.on('scroll', function (event) {
      var header = $('header');
      //var scroll = $body.scrollTop();
      var scroll_w = $window.scrollTop();
      var height_h = $('#firstPage').outerHeight();
      var sections = $('.section');
      var firstSection = sections.first();

      var hg_scroll = jQuery(window).scrollTop();
      if (hg_scroll >= 1) {
        jQuery('.header--home').addClass('is-sticky-opening');
      } else {
        jQuery('.header--home').removeClass('is-sticky-opening');
      }

      if (scroll_w >= height_h) {
        $body.addClass('fixed-sub-header');
      } else {
        $body.removeClass('fixed-sub-header');
      }

      // if (sections.length > 1) {
      // 	if (header.hasClass('header--other')) {
      // 		if (scroll_w >= firstSection.outerHeight()) {
      // 			header.addClass('header--blue').removeClass('header--transparent_blue');
      // 		} else {
      // 			header.addClass('header--transparent_blue').removeClass('header--blue');
      // 		}
      // 	}
      // } else {
      // 	if (header.hasClass('header--other')) {
      // 		if (scroll_w >= header.height()) {
      // 			header.addClass('header--blue').removeClass('header--transparent_blue');
      // 		} else {
      // 			header.addClass('header--transparent_blue').removeClass('header--blue');
      // 		}
      // 	}
      // }
      if (sections.length > 1) {
        if (header.hasClass('header--other')) {
          if (scroll_w >= firstSection.outerHeight()) {
            header.addClass('header--blue').removeClass('header--transparent_blue');
          } else {
            //header.addClass('header--transparent_blue').removeClass('header--blue');
          }
        }
      } else {
        if (header.hasClass('header--other')) {
          if (scroll_w >= header.height()) {
            header.addClass('header--blue').removeClass('header--transparent_blue');
          } else {
            //header.addClass('header--transparent_blue').removeClass('header--blue');
          }
        }
      }

      //init_scroll(event, detectDirection());
    });

    $(document).bind('mousewheel DOMMouseScroll', function (event) {
      var delta = event.originalEvent.wheelDelta || -event.originalEvent.detail;
    });

    var lastScrollTop = 0,
      st,
      direction;

    function detectDirection () {
      st = window.pageYOffset;
      if (st > lastScrollTop) {
        direction = -1;
      } else {
        direction = 1;
      }
      lastScrollTop = st;
      return direction;
    }

    // Slick sliders init
    var slick_container = $('.slick-slider');
    if (slick_container.length > 0 && !$('body').hasClass('node-type-frontpage')) {
      var slick = slick_container.slick({
        slidesToShow: 1,
        slidesToScroll: 1,
        dots: false,
        arrows: false,
        //infinite: true,
        autoplay: true,
        autoplaySpeed: 10000,
        speed: 700,
        fade: false,
        cssEase: 'linear',
        adaptiveHeight: true
      });

      $('.slide-nav .next').on('click', function () {
        slick.slick('slickNext')
      });

      $('.slide-nav .prev').on('click', function () {
        slick.slick('slickPrev')
      });

    }

    if (archiveSlider.length > 0) {
      var slick_archive = archiveSlider.slick({
        dots: true,
        arrows: true,
        fade: true,
        adaptiveHeight: true
      });
    }


    var slick_list = $('.slick-list');
    // Resize event
    $window.resize(function () {
      header_menu_item.find('.dropdown').removeClass('open');
      show_data.removeClass('open');
      if (slick_list.length > 0) {
        $('.slick-list').removeAttr('style');
      }
      if (services.length > 0) {
        services.removeAttr('style');
      }
      dropdownFix();
    });


    dropdownFix();


    // Video settings

    var mediaPlayer = document.getElementById('bgvid');
    if (mediaPlayer) {
      //mediaPlayer.addEventListener('timeupdate', updateProgressBar, false);
      function updateProgressBar () {
        var progressBar = document.getElementById('progress-bar');
        var percentage = Math.floor((100 / mediaPlayer.duration) * mediaPlayer.currentTime);
        progressBar.value = percentage;
        var $el = $('#progress_bar');
        var progressBarWidth = percentage * $(progressBar).width() / 100;
        $el.animate({ width: progressBarWidth }, 500);
      }
    }
  });


  function init_scroll (event, delta) {
    var $body = $('html, body');
    var cur = $('.current-section');
    var curNext = cur.data('target_next');
    var curPrev = cur.data('target_prev');

    if ($(window).width() > 992 && $(window).height() > 620) {
      if (delta < 0) {
        if (curNext) {
          cur.removeClass('current-section');
          $body.animate({
            scrollTop: $("#" + curNext).offset().top
          }, 300, function () {
            $('#' + curNext).addClass('current-section');
          });
        }
      } else {
        if (curPrev) {
          if (cur.offset().top >= $(window).scrollTop()) {
            cur.removeClass('current-section');
            $body.animate({
              scrollTop: $("#" + curPrev).offset().top
            }, 300, function () {
              $('#' + curPrev).addClass('current-section');
            });
          }
        }
      }
    }
  }

  function resizeElements (elements) {
    var maxHeight = 0;
    elements.removeAttr('style');
    elements.each(function (index, single) {
      if (maxHeight < $(single).height()) {
        maxHeight = $(single).height();
      }
    });
    elements.each(function (index, single) {
      $(single).height(maxHeight)
    });
  }
  function resizeElementsDesctop (el) {
    el.removeAttr('style');
    if ($(window).width() > 1200) {
      resizeElements(el);
    }
  }

  function footerPadding () {
    var f_height = $('footer.footer').height();
    var contact_section = $('.section-contact');
    var contact_related = $('.section-related-products');
    if (contact_section.length > 0) {
      contact_section.find('.fp-tableCell').css({ paddingBottom: f_height + 20 });
    }
    if (contact_related.length > 0) {
      //contact_related.find('.fp-scrollable').css({paddingBottom: f_height + 20});
    }
  }

  function msieversion () {
    var ua = window.navigator.userAgent;
    var msie = ua.indexOf("MSIE ");

    return (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./));
  }


  // Header dropdown overflow fix
  function dropdownFix () {
    var $dropdown = $('header .dropdown, .sub-header .dropdown');
    var $window = $('html').width();
    $dropdown.removeClass('overfloved');
    if ($dropdown.length > 0) {
      $dropdown.each(function () {
        var leftOffset = $(this).offset().left;
        if ((leftOffset + $(this).width() + 20) > $window) {
          $(this).addClass('overfloved');
        } else {
          $(this).removeClass('overfloved');
        }
      })
    }
  }

  // IE9 Placeholder fix

  jQuery(function () {
    jQuery.support.placeholder = false;
    webkit_type = document.createElement('input');
    if ('placeholder' in webkit_type) jQuery.support.placeholder = true;
  });
  $(function () {

    if (!$.support.placeholder) {

      var active = document.activeElement;

      $(':text, textarea, :password').focus(function () {

        if (($(this).attr('placeholder')) && ($(this).attr('placeholder').length > 0) && ($(this).attr('placeholder') != '') && $(this).val() == $(this).attr('placeholder')) {
          $(this).val('').removeClass('hasPlaceholder');
        }
      }).blur(function () {
        if (($(this).attr('placeholder')) && ($(this).attr('placeholder').length > 0) && ($(this).attr('placeholder') != '') && ($(this).val() == '' || $(this).val() == $(this).attr('placeholder'))) {
          $(this).val($(this).attr('placeholder')).addClass('hasPlaceholder');
        }
      });

      $(':text, textarea, :password').blur();
      $(active).focus();
      $('form').submit(function () {
        $(this).find('.hasPlaceholder').each(function () {
          $(this).val('');
        });
      });
    }
  });




  /* add script for new about page */

  $(document).ready(function () {

    if ($('.container-experiance-content').length) {
      var curr = $('.slider-for');
      $('.slider-for').slick({
        dots: false,
        infinite: false,
        fade: true,
        autoplay: true,
        autoplaySpeed: 4000,
        speed: 1000,
        slidesToShow: 1,
        //adaptiveHeight: true,
        prevArrow: $('.arrows-for-slider .preww'),
        nextArrow: $('.arrows-for-slider .nextt')
      });


      curr.on('beforeChange', function (event, slick, currentSlide, nextSlide) {
        console.log(nextSlide);
        $('.slider-nav .item').removeClass('active');
        //if ( currentSlide > nextSlide ){
        $('.slider-nav').removeClass('active' + currentSlide);
        //}

        setTimeout(function () {
          $('.slider-nav').removeClass('fast-anim');
        }, 1200);

        $('.slider-nav').addClass('active' + nextSlide);
        $('.slider-nav .item').eq(nextSlide).addClass('active');
      });

      $('.slider-nav .item').on('click', function () {
        $('.slider-nav').addClass('fast-anim');
        curr.slick('slickGoTo', $(this).index());
      });

    }

    /* beutifull parser */
    if ($('.some-clients-block').length) {
      var list = $('.some-clients-block .item').length;
      var stack = '';
      var start = "<div class='slide'>";
      var end = "</div>";

      if ($(window).width() > 992) {

        for (var i = 0; i < list; i++) {
          if (i % 2 == 0) {
            stack += start;
          }
          stack += "<div class='item'>" + $('.some-clients-block .item').eq(i).html() + "</div>";
          if (i % 2 == 1 || i + 1 == list) {
            stack += end;
          }
        }

      } else {

        for (var i = 0; i < list; i++) {
          if (i % 3 == 0) {
            stack += start;
          }
          stack += "<div class='item'>" + $('.some-clients-block .item').eq(i).html() + "</div>";

          if (i % 3 == 2 || i + 1 == list) {
            stack += end;
          }
        }

      }

      $('.some-clients-block .slider-items').html(stack);

      $('.some-clients-block .slider-items').slick({
        dots: false,
        arrows: true,
        infinite: true,
        speed: 300,
        slidesToShow: 3,
        responsive: [
          {
            breakpoint: 992,
            settings: {
              slidesToShow: 1
            }
          }
        ]
      });
    }
    /* beutifull parser */

    if ($('.some-say-block').length) {
      $('.some-say-block .slider-items').slick({
        dots: false,
        arrows: true,
        infinite: true,
        speed: 300,
        //fade: true,
        slidesToShow: 1
      });
    }

    $('.pop-team .scrolling').niceScroll({
      scrollspeed: 60,
      mousescrollstep: 60
    });

    $('.closer').on('click', function () {
      $(this).closest('.pop-team').fadeOut(300);
    });

    $('.team-block .pluso').on('click', function (e) {
      e.preventDefault();
      var curr = $(this).attr('href');
      $(curr).fadeIn(300);
      $('.pop-team .scrolling').niceScroll({
        scrollspeed: 60,
        mousescrollstep: 60
      });
    });

    $('.special-wechat').on('click', function () {
      $('.hidden-content').fadeIn(300, function () {
        $(this).addClass('opened');
      });
    });

    $(document).on('click touchstart', function (event) {
      if ($('.hidden-content').hasClass('opened')) {
        if (!$('.hidden-content').is(event.target) && $('.hidden-content').has(event.target).length === 0) {
          $('.hidden-content').fadeOut(300, function () {
            $(this).removeClass('opened');
          });
        }
      }
    });



    $(window).scroll(function () {
      var animatedBlock = $('.animated-menu-block');
      if (!animatedBlock.length) {
        return;
      }
      if (animatedBlock.offset().top < ($(window).scrollTop() - animatedBlock.height() / 2 + $(window).height())) {
        animatedBlock.addClass('active');
        $('.animated-menu-block').addClass('active');
      }



    });


    if ($(window).width() < 992) {

      var curr = $(window).width();

      $('.animated-menu-block').css('height', curr);
      $('.animated-menu-block').css('margin-top', -curr / 2);

      $('.container-experiance-content').css('padding-bottom', curr / 2 + 40)

      var spar = 'scale(' + (curr / $('.animated-menu-block .convert').width()) + ')';

      $('.animated-menu-block .convert').css('transform', spar);

    }





  });

  $(window).resize(function () {

    if ($(window).width() < 992) {

      var curr = $(window).width();

      $('.animated-menu-block').css('height', curr);
      $('.animated-menu-block').css('margin-top', -curr / 2);

      $('.container-experiance-content').css('padding-bottom', curr / 2 + 40)

      var spar = 'scale(' + (curr / $('.animated-menu-block .convert').width()) + ')';

      $('.animated-menu-block .convert').css('transform', spar);

    }

  });


  // 建设专区JS
  $(function () {
    $('.sma-of-build').slick({
      dots: false,
      infinite: true,
      variableWidth: true,
      arrows: false,
      responsive: [
        {
          breakpoint: 767,
          settings: {
            variableWidth: false,
            slidesToShow: 1,
            dots: true,
          }
        }
      ]
    });
    $('.slider-prev-4').click(function () {
      $('.sma-of-build').slick('slickPrev');
    })

    $('.slider-next-4').click(function () {
      $('.sma-of-build').slick('slickNext');
    })

    $('.sma-of-partner-5').slick({
      dots: false,
      infinite: true,
      arrows: true,
      slidesToShow: 3,
      slidesToScroll: 1,
      responsive: [
        {
          breakpoint: 767,
          settings: {
            slidesToShow: 1,
          }
        }
      ]

    });

    $('.sma-of-slider-for').slick({
      slidesToShow: 1,
      slidesToScroll: 1,
      dots: false,
      variableWidth: true
    });
    $('.slider-prev').click(function () {
      $(this).parents('.sma-of-slider-for').slick('slickPrev');
    })

    $('.slider-next').click(function () {
      $(this).parents('.sma-of-slider-for').slick('slickNext');
    })

    // $('.sma-of-slider-nav').slick({
    //   slidesToShow: 6,
    //   slidesToScroll: 1,
    //   asNavFor: '.sma-of-slider-for, .sma-of-slider-info',
    //   dots: false,
    //   focusOnSelect: true,
    // });

    $('.sma-of-service-mb').slick({
      slidesToShow: 1,
      slidesToScroll: 1,
      dots: false,
      asNavFor: '.sma-of-service-nav',
      centerMode: true,
      centerPadding: '30px',
      arrows: false,
    });
    $('.sma-of-service-nav').slick({
      slidesToShow: 3,
      slidesToScroll: 1,
      dots: false,
      asNavFor: '.sma-of-service-mb',
      focusOnSelect: true,
      arrows: false,
    });

    $('.sma-of-service-mb').on('afterChange', function (event, slick, currentSlide, nextSlide) {
      $('.sma-of-service-nav .sma-of-service-nav-it').removeClass('slick-current');
      $('.sma-of-service-nav .sma-of-service-nav-it[data-slick-index=' + currentSlide + ']').addClass('slick-current');
    });

    $('.sma-of-nav-it-box > a').click(function () {
      var href = $(this).attr('href');
      $('html,body').animate({ scrollTop: $(href).offset().top - 115 }, 600);
      return false;
    });
    $('.section-main h5').addClass('show')
  });


  /* add script */
})(jQuery);

