jQuery(document).ready(function ($) {$('nav.toggle,.main-overlay').on('click',function(e) {e.preventDefault(); $('body').toggleClass('toggle-global'); if($('body').hasClass('toggle-modal')){$('body').removeClass('toggle-modal').removeClass('toggle-global');}});  $('button.header-toggle').on('click',function(e) {e.preventDefault(); $('body').toggleClass('header-toggle');}); $('a[href$=".pdf"]').prop('target','_blank'); $('img').removeAttr('title');  $("a[href^=http]").not("a[href*='" + window.location.host + "']").attr("target","_blank").attr("rel","noopener noreferrer").addClass('tracking'); $(".tracking a,a.tracking").mouseup(function(){var event_name = $(this).data('name'); if (!event_name) {event_name = 'banner_click';} var event_category = $(this).data('event'); if (!event_category) {event_category = 'banner-click';} var page_location = document.location.href; var link_url = $(this).attr("href").toLowerCase(); if(link_url == "javascript:;"||link_url == "#") {return false;} if (typeof(gtag)!=='undefined') {gtag('event',event_name,{'event_category':event_category,'event_label':link_url,'page_location':page_location,'link_url':link_url});} console.log('event',event_name,{'event_category':event_category,'event_label':link_url,'page_location':page_location,'link_url':link_url});}); $("a[href*='#']").click(function(){if(location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'')&&location.hostname==this.hostname){var $target=$(this.hash);var url=this.hash.slice(1); $target=$target.length&&$target||$('[name="'+this.hash.slice(1)+'"]');if($target.length){var page_location = document.location.href+'#'+url; if (typeof(gtag)!=='undefined') {gtag('event','scroll_smooth',{'event_category':'smooth-scroll','event_label':page_location,'page_location':page_location});} console.log('event','scroll_smooth',{'event_category':'smooth-scroll','event_label':page_location}); var targetOffset=$target.offset().top-150;$('html,body').animate({scrollTop:targetOffset},700); return false;}}}); $("ul.analog a").click(function(a) {a.preventDefault(), window.open($(this).attr("href"),"sns-share","status=1,height=500,width=555,resizable=0")}); $(document).on('mouseup','ul.qanda h3',function(e) {e.preventDefault(); var li = $(this).parent();  if (li.hasClass('toggle')) {li.removeClass('toggle');} else { $('ul li').removeClass('toggle'); li.addClass('toggle');  var target = li.offset().top - 170; if (target < 0) {target = 0} $('html,body').animate({scrollTop: target},700); } });}); window.addEventListener("scroll", (event) => {let scroll = this.scrollY; if (scroll > 5) {if(!document.body.classList.contains('toggle-mobile')) {document.body.classList.add('toggle-mobile');}} else {if( document.body.classList.contains('toggle-mobile')) {document.body.classList.remove('toggle-mobile');}}}); const scrollIntersectionObserver = new IntersectionObserver( (entries) => {entries.forEach((entry, i) => {if (entry.isIntersecting) {entry.target.classList.add('is-visible'); scrollIntersectionObserver.unobserve(entry.target);}});} ); document.querySelectorAll(".scroll-fade-in").forEach((el, i) => {scrollIntersectionObserver.observe(el);}); const headingIntersectionObserver = new IntersectionObserver(  (entries) => { entries.forEach((entry, i) => { if (entry.isIntersecting) {replaceHash("heading-" + entry.target.dataset.id);} }); },  {rootMargin: "-29% 0px -70% 0px",} ); document.querySelectorAll(".the_content > h2").forEach((el, i) => { el.dataset.id = i + 1; headingIntersectionObserver.observe(el);}); const sectionIntersectionObserver = new IntersectionObserver(  (entries) => { entries.forEach((entry, i) => { if (entry.isIntersecting) {replaceHash(entry.target.dataset.name);} }); },  {rootMargin: "-39% 0px -60% 0px",} ); document.querySelectorAll(".the_content > .push, body.single-selector > main > .push").forEach((el, i) => { el.dataset.id = i + 1; sectionIntersectionObserver.observe(el);}); function replaceHash(hash) { const page_title = document.title; const path = location.pathname + '#' + hash;  const page_location = location.origin + location.pathname + '#' + hash;  history.replaceState(null,null,path); console.log('replaceState',page_location,page_title); if (typeof(gtag)!=='undefined') {gtag("config",google_analytics_tracking_id,{page_title:page_title,page_location: page_location});}} function pii_slider_pageview(fraction,action,swiper_id,realIndex,length,hash) { var slide_id = (realIndex+1); var hash = "swiper-" + swiper_id + "-slide-" + slide_id;  const page_title = document.title; const path = location.pathname + '#' + hash;  const page_location = location.origin + location.pathname + '#' + hash;  if (typeof(gtag)!=='undefined') {gtag("config", google_analytics_tracking_id,{page_title:page_title,page_location: page_location});}  console.log('pii_slider_pageview',page_location,page_title);} function getMailto(user,domain,subject,message){var mail = "mailto:"+user+"@"+domain+"?subject="+encodeURIComponent(subject)+"&body="+encodeURIComponent(message); window.location=mail;}