    jQuery(function ($) {
    // userAgent
    const ua = navigator.userAgent;
    const uaLowerCase = navigator.userAgent.toLowerCase();
    const isSp = ua.indexOf('iPhone') > 0 || ua.indexOf('iPod') > 0 || (ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0);
    const isTablet = ua.indexOf('iPad') > 0 || (ua.indexOf('Android') > 0 && ua.indexOf('Mobile') == -1) || ua.indexOf('A1_07') > 0 || ua.indexOf('SC-01C') > 0 || uaLowerCase.indexOf('macintosh') > 0 && 'ontouchend' in document;
    const isPc = (!isSp && !isTablet);

  // only IE
  if (ua.indexOf('Trident') !== -1) {
      $('#anews .sizes').each(function () {
          var objElement = $(this);
          var objOmg = new Image();
          objOmg.src = objElement.attr('src');
          if (objOmg.width != 0) {
              objElement.css({'width': objOmg.width / 2});
          }
      });
  }

        // VALIDATE
        $("#form11").validate({
            rules: {
                name: "required",
                katakana: "required",
                email: "required",
                phone: "required",
            },
            messages: {
                name: "必須項目に入力してください。",
                katakana: "必須項目に入力してください。",
                email: "必須項目に入力してください。",
                phone: "必須項目に入力してください。",
            }
        });




        // fadein
  $(document).ready(function() {
    $(window).scroll(function () {
      $('#anews .js-fadein').each(function () {
        var ptop = $(this).offset().top;
        var scroll = $(window).scrollTop();
        var windowHeight = $(window).height();
        if (scroll > ptop - windowHeight + 100) {
          $(this).addClass('scroll-in');
        }
      });
    });
   
    $('#anews .js-fadein').each(function(){
      var ptop = $(this).offset().top;
      var firstView = $(window).scrollTop();
      var windowHeight = $(window).height();
      if (firstView > ptop - windowHeight){
        $(this).addClass('scroll-in');
      }
    });


  });
  
  
    //scroll
    $(function(){
        $('.scroll').click(function(event){event.preventDefault();
            var url = $(this).attr('href');
            var dest = url.split('#');var target = dest[1];
            var target_offset = $('#'+target).offset();
            var target_top = target_offset.top;
            $('html, body').animate({scrollTop:target_top}, 500, 'swing');
            return false;});
    });

    // FAQ
    $("#anews .faq .faq__contents .accordion-header").click(function () {
        $(this).next().slideToggle();
        $(this).toggleClass("is-open");
    });



    /*↓jsはここに追記していく↓*/


    const swiper = new Swiper("#anews .swiper-slider", {
        centeredSlides: true,
        simulateTouch:true,
        slidesPerView: 1.253,
        grabCursor: true,
        freeMode: false,
        spaceBetween: 20,
        loop: true,
        mousewheel: false,
        keyboard: {
            enabled: true
        },

        autoplay: {
            delay: 3000,
            disableOnInteraction: false
        },

        pagination: {
            el: "#anews .swiper-pagination",
            dynamicBullets: false,
            clickable: true
        },


        breakpoints: {
            640: {
                slidesPerView: 1.25,
                spaceBetween: 20
            },
            1024: {
                slidesPerView: 1.8506,
                spaceBetween: 20
            },
        }
    });


    const swiper2 = new Swiper("#anews .swiper-slider2", {
        centeredSlides: true,
        simulateTouch:true,
        slidesPerView: 1.73,
        grabCursor: true,
        freeMode: false,
        spaceBetween: 15,
        loop: true,

        autoplay: {
            delay: 3000,
            disableOnInteraction: false
        },

        pagination: {
            el: "#anews .swiper-pagination",
            dynamicBullets: false,
            clickable: true
        },


        breakpoints: {
           768: {
                loop: false,
                slidesPerView: 5,
                spaceBetween: 15,
               centeredSlides: false,
            },
        }
    });



    if (isSp) {
        // only sp

    } else if (isTablet) {
        // only tablet

    } else if (isPc) {
        // only pc

    }


});