PageSourceSearch

https://www.ppc.go.jp/common_module/js/common.js

js ppc.go.jp collected 2026-09-24 08:24:06 UTC 43,979 bytes, 1,640 lines download raw bytes

1'use strict';
2
3(function($) {
4
5	/**
6	 *  GetUserAgent: IE/Edge判別
7	 */
8	var GetUserAgent = function(element, options) {
9		this.$window = $(window);
10		this.$html = $('html');
11		this.init(options);
12	};
13
14	GetUserAgent.prototype = {
15
16		defaults: {
17		},
18
19		init: function(options) {
20			this.options = $.extend({}, this.defaults, options);
21			this.initializeEvent();
22		},
23
24		initializeEvent: function() {
25			var _this = this;
26			var userAgent = window.navigator.userAgent.toLowerCase();
27
28			if(userAgent.indexOf('msie') !== -1 || userAgent.indexOf('trident') !== -1) {
29				_this.$html.addClass('ie');
30			} else if (userAgent.indexOf('edge') !== -1) {
31				_this.$html.addClass('edge');
32			}
33		}
34
35	};
36
37	$.fn.GetUserAgent = function(options) {
38		return this.each(function() {
39			new GetUserAgent(this, options);
40		});
41	};
42
43	/**
44	 * Responsive
45	 */
46	var Responsive = function(options) {
47		this.$window = $(window);
48		this.$html = $('html');
49		this.timer = false;
50		this.init(options);
51	}
52
53	Responsive.prototype = {
54		defaults: {
55			flg :true,
56			breakpoint: {
57				// tablet: 1109,
58				sp: 640
59			},
60			deviceClass: {
61				pc: 'is-pc',
62				// tablet: 'is-tablet',
63				sp: 'is-sp'
64			}
65		},
66
67		init: function(options) {
68			this.options = $.extend({}, this.defaults, options);
69			this.initializeEvent();
70		},
71
72		initializeEvent: function() {
73			var _this = this;
74
75			// if (!Modernizr.mediaqueries) {
76			// 	_this.setClassIE();
77			// } else {
78			_this.$window.on('resize', $.proxy(_this.resizeHandler, _this)).trigger('resize');
79			// }
80		},
81
82		resizeHandler: function() {
83			var _this = this;
84
85			if(_this.timer !== false) {
86				clearTimeout(_this.timer);
87			}
88
89			_this.timer = setTimeout(function() {
90				if (window.innerWidth <= _this.options.breakpoint.sp) {
91					_this.$html.removeClass(_this.options.deviceClass.pc).addClass(_this.options.deviceClass.sp);
92				} else {
93					_this.$html.removeClass(_this.options.deviceClass.sp).addClass(_this.options.deviceClass.pc);
94				}
95			}, 100);
96		// },
97
98		// setClassIE: function() {
99		// 	$('div.m_panel:nth-child(2n)').addClass('js-ie_2n');
100		}
101	};
102
103	$.fn.Responsive = function(options) {
104		return this.each(function() {
105			new Responsive(options);
106		});
107	};
108
109	/**
110	 * Init
111	 */
112	// $(function(){
113	// 	var page = new Responsive();
114	// });
115
116	/**
117	 *  FontResizer: フォントサイズ変更
118	 */
119	var FontResizer = function(element, options) {
120		this.$window = $(window);
121		this.$body = $('body');
122		this.$nav = $(element);
123		this.$trigger = $(element).find('a');
124		this.fontsize;
125		this.init(options);
126	};
127
128	FontResizer.prototype = {
129
130		defaults: {
131			dataName: 'size',
132			keyName: 'fontsize',
133			currentClass: 'font-current',
134			initSize: 'font-m'
135		},
136
137		init: function(options) {
138			this.options = $.extend({}, this.defaults, options);
139			this.initializeEvent();
140		},
141
142		initializeEvent: function() {
143			var _this = this,
144					fontsize = localStorage.getItem(_this.options.keyName);
145
146			// 文字サイズがlocalStorageに保存されていればフォントサイズを変更
147			if (fontsize) {
148				_this.fontsize = fontsize;
149				_this.$body.addClass(_this.fontsize);
150				$('.' + _this.options.currentClass).removeClass(_this.options.currentClass);
151				_this.$nav.find('[data-size="' + _this.fontsize + '"]').addClass(_this.options.currentClass);
152			} else {
153				_this.fontsize = _this.options.initSize;
154				_this.$body.addClass(_this.fontsize);
155				$('.' + _this.options.currentClass).removeClass(_this.options.currentClass);
156				_this.$nav.find('[data-size="' + _this.fontsize + '"]').addClass(_this.options.currentClass);
157			}
158
159			_this.$trigger.on('click', $.proxy(_this.clickHandler, _this));
160		},
161
162		clickHandler: function(e) {
163			var _this = this,
164					newSize = $(e.currentTarget).data(_this.options.dataName);
165
166			e.preventDefault();
167			_this.fontsize = localStorage.getItem(_this.options.keyName);
168
169			$('.' + _this.options.currentClass).removeClass(_this.options.currentClass);
170			$(e.currentTarget).addClass(_this.options.currentClass);
171
172			_this.$body.removeClass(_this.fontsize);
173			_this.$body.addClass(newSize);
174
175			localStorage.setItem(_this.options.keyName, newSize);
176
177			$.fn.matchHeight._update();
178			_this.$window.trigger('changeFontSize');
179		}
180	};
181
182	$.fn.FontResizer = function(options) {
183		return this.each(function() {
184			new FontResizer(this, options);
185		});
186	};
187
188	/**
189	 *  SmoothScroll: アンカーリンクのスムーススクロール
190	 */
191	var SmoothScroll = function(element, options) {
192		this.$window = $(window);
193		this.$html = $('html');
194		this.$trigger = $(element);
195		this.init(options);
196	};
197
198	SmoothScroll.prototype = {
199
200		defaults: {
201			easing: 'swing',
202			speed: 'normal',
203			fixedHeightPC: 0,
204			fixedHeightSP: 80,
205		},
206
207		init: function(options) {
208			this.options = $.extend({}, this.defaults, options);
209			this.initializeEvent();
210		},
211
212		initializeEvent: function() {
213			var _this = this;
214
215			_this.$trigger.on('click', $.proxy(_this.clickHandler, _this));
216		},
217
218		clickHandler: function(e) {
219			var _this = this;
220			var href = _this.getHref(),
221					data = _this.getData(),
222					tabContent = _this.getTabContent(),
223					scrollPos;
224
225			if (href === '#') {
226				scrollPos = 0;
227			} else {
228				if (data === 'scroll') {
229					if (_this.options.fixedHeightSP !== 0) {
230						if (_this.$html.hasClass('is-sp')) {
231							scrollPos = tabContent.scrollTop() + $(href).position().top - _this.options.fixedHeightSP - tabContent.position().top;
232						} else {
233							scrollPos = tabContent.scrollTop() + $(href).position().top - tabContent.position().top;
234						}
235					}
236					// scrollPos = tabContent.scrollTop() + $(href).position().top - tabContent.position().top;
237
238					tabContent.stop().animate(
239						{scrollTop: scrollPos},
240						_this.options.speed,
241						_this.options.easing,
242
243						setTimeout(function() {
244							location.hash = href;
245
246							if (_this.options.fixedHeightSP !== 0) {
247								if (_this.$html.hasClass('is-sp')) {
248									tabContent.stop().animate({scrollTop: scrollPos}, 0);
249									console.log(scrollPos);
250								}
251							}
252							return false;
253						}, 200)
254					);
255				} else {
256					if (_this.options.fixedHeightSP !== 0) {
257						if (_this.$html.hasClass('is-sp')) {
258							scrollPos = $(href).offset().top - _this.options.fixedHeightSP;
259						} else {
260							scrollPos = $(href).offset().top;
261						}
262					}
263					// scrollPos = $(href).offset().top;
264
265					$('html, body').animate(
266						{scrollTop: scrollPos},
267						_this.options.speed,
268						_this.options.easing,
269						function() {
270							setTimeout(function () {
271							location.hash = href;
272							if (_this.options.fixedHeightSP !== 0) {
273								if (_this.$html.hasClass('is-sp')) {
274									$('html, body').animate({scrollTop: scrollPos}, 0);
275								}
276							}
277
278							// var targetClass = $(e.currentTarget).attr('class');
279							var isBtnPageTop = $(e.currentTarget).hasClass('btn-pagetop');
280							// var navStatus = $('.l-navskip').hasClass('invalidated');
281							var navStatus = $('.l-navskip').hasClass('is-open');
282							if (isBtnPageTop) {
283								if (navStatus) {
284									$('.l-navskip').addClass('is-open');
285									$('.navskip-list a').first().focus();
286								} else {
287									$('#header .logo a').focus();
288								}
289							}
290
291							return false;
292							}
293						, 200);
294					}
295				);
296			}
297		}
298
299		return false;
300	},
301		getHref: function () {
302			var _this = this;
303
304			return _this.$trigger.attr('href') || _this.$trigger.data('href');
305		},
306
307		getData: function () {
308			var _this = this;
309
310			return _this.$trigger.data('box');
311		},
312
313		getTabContent: function () {
314			var _this = this;
315
316			return _this.$trigger.closest('.tab-anchor-list').next();
317		}
318
319	};
320
321	$.fn.SmoothScroll = function(options) {
322		return this.each(function() {
323			new SmoothScroll(this, options);
324		});
325	};
326
327		/**
328	 *  AnchorCurrent: アンカーリンクカレント表示
329	 */
330	var AnchorCurrent = function(element, options) {
331		this.$element = $(element);
332		this.$trigger = this.$element.find('a');
333		this.init(options);
334	};
335
336	AnchorCurrent.prototype = {
337
338		init: function(options) {
339			this.options = $.extend({}, this.defaults, options);
340			this.initializeEvent();
341		},
342
343		initializeEvent: function() {
344			var _this = this;
345
346			_this.$trigger.on('keypress', $.proxy(_this.keyHandler, _this));
347			_this.$trigger.on('click', $.proxy(_this.clickHandler, _this));
348		},
349
350		keyHandler: function(e) {
351			var _this = this;
352
353			if(e.keyCode === 13) {
354				$.proxy(_this.clickHandler, _this)(e);
355			}
356		},
357
358		clickHandler: function(e) {
359			var _this = this,
360					$target = $(e.currentTarget);
361
362			_this.$trigger.removeClass('is-current');
363			$target.addClass('is-current');
364		}
365
366	};
367
368	$.fn.AnchorCurrent = function(options) {
369		return this.each(function() {
370			new AnchorCurrent(this, options);
371		});
372	};
373
374	/**
375	 *  NavSkip: ナビゲーションスキップ
376	 */
377	var NavSkip = function(element, options) {
378		this.$window = $(window);
379		this.$element = $(element);
380		this.$link;
381		this.$document = $(document);
382		this.init(options);
383	};
384
385	NavSkip.prototype = {
386
387		defaults: {
388			easing: 'swing',
389			speed: 'normal',
390			closeBtn: '.navskip-close',
391			openClass: 'is-open'
392		},
393
394		init: function(options) {
395			this.options = $.extend({}, this.defaults, options);
396			this.$closeBtn = $(this.options.closeBtn);
397			this.$link = this.$element.find('a:not(' + this.options.closeBtn + ')');
398			this.initializeEvent();
399		},
400
401		initializeEvent: function() {
402			var _this = this;
403			_this.$document.on('keydown', $.proxy(_this.showNav, _this));
404			_this.$closeBtn.on('click', $.proxy(_this.hideNav, _this));
405			_this.$link.on('click', $.proxy(_this.clickHandler, _this));
406		},
407
408		showNav: function(e) {
409			var _this = this,
410					key = e.key;
411
412			if (e.key === 'Tab') {
413				// _this.$element.slideDown(_this.options.speed);
414				_this.$element.addClass(_this.options.openClass);
415				_this.$document.off('keydown', _this.showNav);
416			}
417		},
418
419		hideNav: function(e) {
420			var _this = this;
421
422			_this.$element.removeClass(_this.options.openClass).slideUp(_this.options.speed);
423			_this.$element.addClass('invalidated');
424			// _this.$document.off('keydown', $.proxy(_this.keydownHandler, _this));
425		},
426
427		clickHandler: function(e) {
428			var _this = this,
429					target = $(e.currentTarget).attr('href');
430
431			$(target).find('a, input, button').first().focus();
432		}
433
434	};
435
436	$.fn.NavSkip = function(options) {
437		return this.each(function() {
438			new NavSkip(this, options);
439		});
440	};
441
442	/**
443	 *  PagetopBtn: ページトップへ戻るボタンの位置調整
444	 */
445	var PagetopBtn = function(element, options) {
446		this.$window = $(window);
447		this.$document = $(document);
448		this.$element = $(element);
449		this.btnWidth = this.$element.outerWidth();
450		this.btnHeight = this.$element.outerHeight();
451		this.$footer;
452		this.$copyright;
453		this.fixedPos;
454		this.init(options);
455	};
456
457	PagetopBtn.prototype = {
458
459		defaults: {
460			baseWidth: 1000,
461			fixedClass: 'is-fixed',
462			footer: $('.l-footer-bottom'),
463			copyright: $('.l-copyright'),
464			btnMargin: 20,
465			btnPosX: 10,
466		},
467
468		init: function(options) {
469			this.options = $.extend({}, this.defaults, options);
470			this.$footer = this.options.footer;
471			this.$copyright = this.options.copyright;
472			this.initializeEvent();
473		},
474
475		initializeEvent: function() {
476			var _this = this;
477
478			_this.$window.on('resize', $.proxy(_this.resizeHandler, _this)).triggerHandler('resize');
479			_this.$window.on('scroll', $.proxy(_this.scrollHandler, _this));
480			_this.$window.on('changeFontSize', $.proxy(_this.pageTopBtnPos, _this)).triggerHandler('changeFontSize');
481		},
482
483		resizeHandler: function() {
484			var _this = this,
485					posX;
486
487			if(window.innerWidth < _this.options.baseWidth + (_this.btnWidth + _this.options.btnMargin + _this.options.btnPosX ) * 2) {
488				posX = _this.options.btnPosX;
489			} else {
490				posX = (window.innerWidth - (_this.options.baseWidth + (_this.btnWidth + _this.options.btnMargin + _this.options.btnPosX) * 2)) / 2;
491			}
492
493			_this.$element.css({
494				'right': posX,
495			});
496		},
497
498		scrollHandler: function() {
499			var _this = this,
500					documentHeight = _this.$document.height();
501
502			if (_this.$window.scrollTop() > 150) {
503				_this.$element.fadeIn(500);
504			} else {
505				_this.$element.fadeOut(500);
506			}
507
508			if ( _this.$window.scrollTop() > documentHeight - _this.$window.height() - _this.$footer.outerHeight() - _this.$copyright.outerHeight() - 0) {
509				_this.$element.addClass(_this.options.fixedClass);
510			} else {
511				_this.$element.removeClass(_this.options.fixedClass);
512			}
513
514			if (_this.$element.hasClass(_this.options.fixedClass) === true) {
515				_this.$element.css({
516					'margin-bottom' : _this.fixedPos
517				})
518			} else {
519				_this.$element.css({
520					'margin-bottom' : 0
521				})
522			}
523		},
524
525		pageTopBtnPos: function() {
526			var _this = this,
527					footerHeight = this.$footer.outerHeight(),
528					copyHeight = this.$copyright.outerHeight(),
529					margin = 15;
530			_this.fixedPos = footerHeight + copyHeight + margin + 'px';
531		}
532
533	};
534
535	$.fn.PagetopBtn = function(options) {
536		return this.each(function() {
537			new PagetopBtn(this, options);
538		});
539	};
540
541		/**
542	 *  Accordion: アコーディオン
543	 */
544	var Accordion = function(element, options) {
545		this.$element = $(element);
546		this.$trigger = this.$element.find('.accordion-ttl');
547		this.init(options);
548	};
549
550	Accordion.prototype = {
551
552		init: function(options) {
553			this.options = $.extend({}, this.defaults, options);
554			this.initializeEvent();
555		},
556
557		initializeEvent: function() {
558			var _this = this;
559
560			_this.$trigger.on('keypress', $.proxy(_this.keyHandler, _this));
561			_this.$trigger.on('click', $.proxy(_this.clickHandler, _this));
562
563		},
564
565		keyHandler: function(e) {
566			var _this = this;
567
568			if(e.keyCode === 13) {
569				$.proxy(_this.clickHandler, _this)(e);
570			}
571		},
572
573		clickHandler: function(e) {
574			var _this = this,
575					$target = $(e.currentTarget).next(),
576					$close = $(e.currentTarget).next().find('.accordion-close');
577
578			// $target.slideToggle();
579			$(e.currentTarget).toggleClass('is-opened');
580			$target.toggleClass('is-opened');
581
582			$close.on('click', function() {
583				$(e.currentTarget).removeClass('is-opened');
584				$target.removeClass('is-opened');
585			});
586		}
587
588	};
589
590	$.fn.Accordion = function(options) {
591		return this.each(function() {
592			new Accordion(this, options);
593		});
594	};
595
596	/**
597	 * ImageSwitcher: 画像切替
598	 */
599	var ImageSwitcher = function(element, options) {
600		this.$window = $(window);
601		this.$trigger = $(element);
602		this.init(options);
603	};
604
605	ImageSwitcher.prototype = {
606
607		defaults: {
608			pc: '_pc',
609			sp: '_sp',
610			replacepoint: 640
611		},
612
613		init: function(options) {
614			this.options = $.extend({}, this.defaults, options);
615			this.initialiseEvent();
616		},
617
618		initialiseEvent: function() {
619			var _this = this;
620			_this.$window.on('load resize', $.proxy(_this.switchHandler, _this));
621		},
622
623		switchHandler: function() {
624			var _this = this,
625				replaceWidth = _this.options.replacepoint,
626				pc = _this.options.pc,
627				sp = _this.options.sp,
628				windowWidth = _this.$window.outerWidth();
629
630			_this.$trigger.each(function(){
631				var $this = $(this);
632				if(windowWidth > replaceWidth) {
633					$this.attr('src', $this.attr('src').replace(sp, pc));
634				} else {
635					$this.attr('src', $this.attr('src').replace(pc, sp));
636				}
637			});
638		}
639
640	};
641
642	$.fn.ImageSwitcher = function(options) {
643		return this.each(function() {
644			new ImageSwitcher(this, options);
645		});
646	};
647
648	/**
649	 * TabSwitcher: 記事ページ内タブ切替
650	 */
651	var TabSwitcher = function(element, options) {
652		this.$window = $(window);
653		this.$element = $(element);
654		this.$target = this.$element.find('.tab');
655		// this.$parent = this.$target.closest('.block');
656		this.init(options);
657	};
658
659	TabSwitcher.prototype = {
660
661		defaults: {
662			openedClass: 'is-opened'
663		},
664
665		init: function(options) {
666			this.options = $.extend({}, this.defaults, options);
667			this.winWidth;
668			this.winResizeWidth;
669			this.initialiseEvent();
670		},
671
672		initialiseEvent: function() {
673			var _this = this;
674
675			$.proxy(_this.initHandler, _this)();
676			// _this.$window.on('load resize', $.proxy(_this.setHeightHandler, _this));
677			_this.$target.on('keypress', $.proxy(_this.keyHandler, _this));
678			_this.$target.on('click', $.proxy(_this.clickHandler, _this));
679		},
680
681		initHandler: function() {
682			var _this = this;
683
684			var $target = _this.$element.find('.block').first(),
685				$trigger = _this.$element.find('.tab').first();
686
687			$trigger.addClass(_this.options.openedClass);
688			$target.addClass(_this.options.openedClass);
689		},
690
691		// setHeightHandler: function(){
692		// 	var _this = this;
693
694		// 	_this.$target.css({'height': 'auto', 'top': '0px'});
695
696		// 	var array = [];
697		// 	_this.$target.each(function(i){
698		// 		var height = $(this).outerHeight() + (i + 1);
699		// 		array.push(height);
700		// 	});
701
702		// 	var maxHeight = Math.max.apply(null,array);
703		// 	_this.$target.css({'height':maxHeight+'px', 'top': -maxHeight +1 +'px'});
704		// 	var $wrapper = _this.$element.closest('.tab-unit-wrap');
705		// 	$wrapper.css({'margin-top':maxHeight+'px'});
706		// },
707
708		keyHandler: function(e) {
709			var _this = this;
710
711			if(e.keyCode === 13) {
712				$.proxy(_this.clickHandler, _this)(e);
713			}
714		},
715
716		clickHandler: function(e) {
717			var _this = this,
718				$self = $(e.currentTarget),
719				$contents = $self.closest(_this.$element).find('.block'),
720				tab = $self.data('tab');
721
722			_this.$target.removeClass(_this.options.openedClass);
723			_this.$target.attr("aria-selected", "false");
724			$self.addClass(_this.options.openedClass);
725			$self.attr("aria-selected", "true");
726
727			$contents.each(function() {
728				var content = $(this).data('tabcontent');
729
730				if (content === tab) {
731					$(this).addClass(_this.options.openedClass);
732				} else {
733					$(this).removeClass(_this.options.openedClass);
734				}
735			});
736		}
737
738	};
739
740	$.fn.TabSwitcher = function(options) {
741		return this.each(function() {
742			new TabSwitcher(this, options);
743		});
744	};
745
746	/**
747	 * NavLayouter: ナビレイアウト
748	 */
749	var NavLayouter = function(element, options) {
750		this.$window = $(window);
751		this.$container = $(element);
752		this.$trigger = $(element).find('.js-trigger-item');
753		this.$target1 = $(element).find('.js-target-item');
754		this.init(options);
755	};
756
757	NavLayouter.prototype = {
758
759		defaults: {
760		},
761
762		init: function(options) {
763			this.options = $.extend({}, this.defaults, options);
764			this.initializeEvent();
765		},
766
767		initializeEvent: function() {
768			var _this = this;
769			$.proxy(_this.setData, _this)();
770
771			_this.$window.on('resize', $.proxy(_this.setData, _this)).trigger('resize');
772			$('.js-fontsize a').on('click', $.proxy(_this.setData, _this));
773		},
774
775		setData: function() {
776			var _this = this,
777				// height = this.$container.height(),
778				top = _this.$target1.height();
779
780			// this.$container.css('height', height);
781			_this.$trigger.css('top', top);
782		}
783
784	};
785
786	$.fn.NavLayouter = function(options) {
787		return this.each(function() {
788			new NavLayouter(this, options);
789		});
790	};
791
792	/**
793	 * NavLayouter_ctm: カスタムナビレイアウト(SSC追加 サイトマップ表示_20230720)
794	 */
795	var NavLayouter_ctm = function(element, options) {
796		this.$window = $(window);
797		this.$container = $(element);
798		this.$trigger = $(element).find('.js-ctm-trigger-item');
799		this.$target1 = $(element).find('.js-ctm-target-item');
800		this.init(options);
801	};
802
803	NavLayouter_ctm.prototype = {
804
805		defaults: {
806		},
807
808		init: function(options) {
809			this.options = $.extend({}, this.defaults, options);
810			this.initializeEvent();
811		},
812
813		initializeEvent: function() {
814			var _this = this;
815			$.proxy(_this.setData, _this)();
816
817			_this.$window.on('resize', $.proxy(_this.setData, _this)).trigger('resize');
818			$('.js-fontsize a').on('click', $.proxy(_this.setData, _this));
819		},
820
821		setData: function() {
822			var _this = this,
823				// height = this.$container.height(),
824				top = _this.$target1.height();
825
826			// this.$container.css('height', height);
827			_this.$trigger.css('top', top);
828		}
829
830	};
831
832	$.fn.NavLayouter_ctm = function(options) {
833		return this.each(function() {
834			new NavLayouter_ctm(this, options);
835		});
836	};
837
838	/**
839	 * Truncater: 文字数トランケート
840	 */
841	var Truncater = function(element, options) {
842	this.$container = $(element);
843	this.init(options);
844	};
845
846	Truncater.prototype = {
847
848		defaults: {
849			count: 40,
850			insert: '…'
851		},
852
853		init: function(options) {
854			this.options = $.extend({}, this.defaults, options);
855			this.initializeEvent();
856		},
857
858		initializeEvent: function() {
859			var _this = this;
860			$.proxy(_this.setData, _this)();
861		},
862
863		setData: function() {
864			var _this = this,
865				text = _this.$container.text(),
866				length = text.length,
867				showText,
868				replaceText;
869
870			if (length > _this.options.count) {
871				showText = text.substring(0, _this.options.count);
872				replaceText = showText += _this.options.insert;
873				_this.$container.html(replaceText);
874			}
875		}
876
877	};
878
879	$.fn.Truncater = function(options) {
880		return this.each(function() {
881			new Truncater(this, options);
882		});
883	};
884
885		/**
886	 *  AccordionSP: アコーディオン(SPのみ)
887	 */
888	var AccordionSP = function(element, options) {
889		this.$window = $(window);
890		this.$html = $('html');
891		this.$element = $(element);
892		this.$trigger = this.$element.children('.js-accordion-head');
893		this.timer = false;
894		this.flag = false;
895		this.init(options);
896	};
897
898	AccordionSP.prototype = {
899
900		defaults: {
901			currentClass: 'is-opened'
902		},
903
904		init: function(options) {
905			this.options = $.extend({}, this.defaults, options);
906			this.initializeEvent();
907		},
908
909		initializeEvent: function() {
910			var _this = this;
911
912			_this.$window.on('load resize', $.proxy(_this.resizeHandler, _this)).trigger('resize');
913			_this.$trigger.on('keypress', $.proxy(_this.keyHandler, _this));
914			_this.$trigger.on('click', $.proxy(_this.clickHandler, _this));
915		},
916
917		keyHandler: function(e) {
918			var _this = this;
919
920			if(e.keyCode === 13) {
921				$.proxy(_this.clickHandler, _this)(e);
922			}
923		},
924
925		clickHandler: function(e) {
926			if (this.$html.hasClass('is-sp')) {
927				e.preventDefault();
928				// 2022 アクセシビリティ対応
929				var _this = this,
930					$link = $(e.currentTarget),
931					$expanded = $link.attr('aria-expanded') === 'true',
932					$target = $(e.currentTarget).next();
933					// $close = $(e.currentTarget).next().find('.accordion-close');
934
935				// $target.slideToggle();
936				$link.toggleClass(_this.options.currentClass);
937				// 2022 アクセシビリティ対応
938				$link.attr('aria-expanded', !$expanded);
939				if ($link.hasClass(_this.options.currentClass)) {
940					$target.slideDown().addClass(_this.options.currentClass);
941				} else {
942					$target.slideUp().removeClass(_this.options.currentClass);
943				}
944				// $target.slideToggle().toggleClass(_this.options.currentClass);
945			}
946		},
947
948		resizeHandler: function() {
949			var _this = this;
950
951			if(_this.timer !== false) {
952				clearTimeout(_this.timer);
953			}
954
955			_this.timer = setTimeout(function() {
956				if (_this.$html.hasClass('is-sp')) {
957					_this.flag = 1;
958					// 2022 アクセシビリティ対応
959					_this.$trigger.attr('aria-expanded', false);
960					if(_this.$trigger.hasClass('footer-sitemap-ttl')){
961						_this.$trigger.attr('aria-controls', _this.$trigger.next().attr('id'));
962					}
963				} else {
964					_this.flag = 0;
965					_this.$trigger.removeClass(_this.options.currentClass).removeAttr('style');
966					_this.$trigger.next().removeClass(_this.options.currentClasss).removeAttr('style');
967					// 2022 アクセシビリティ対応
968					if(_this.$trigger.hasClass('footer-sitemap-ttl')){
969						_this.$trigger.removeAttr('aria-expanded aria-controls');
970					}else{
971						_this.$trigger.attr('aria-expanded', false);
972					}
973				}
974			}, 100);
975		}
976
977	};
978
979	$.fn.AccordionSP = function(options) {
980		return this.each(function() {
981			new AccordionSP(this, options);
982		});
983	};
984
985		/**
986	 *  SearchSP: 検索窓アコーディオン(SPのみ)
987	 */
988	var SearchSP = function(element, options) {
989		this.$window = $(window);
990		this.$html = $('html');
991		this.$body = $('body');
992		this.$document = $(document);
993		this.$element = $(element);
994		this.$trigger = this.$element;
995		this.$overlay = $('.l-modal-overlay');
996		this.timer = false;
997		this.flag = false;
998		this.init(options);
999		this.topHeight = 95 + 65 + 30;
1000	};
1001
1002	SearchSP.prototype = {
1003
1004		defaults: {
1005			currentClass: 'is-opened'
1006		},
1007
1008		init: function(options) {
1009			this.options = $.extend({}, this.defaults, options);
1010			this.initializeEvent();
1011		},
1012
1013		initializeEvent: function() {
1014			var _this = this;
1015
1016			_this.$window.on('load resize', $.proxy(_this.resizeHandler, _this)).trigger('resize');
1017			_this.$trigger.on('keypress', $.proxy(_this.keyHandler, _this));
1018			_this.$trigger.on('click', $.proxy(_this.clickHandler, _this));
1019
1020			if (_this.$html.hasClass('is-sp')) {
1021				var windowSize = _this.$window.height();
1022				var maxHeight = windowSize - _this.topHeight;
1023
1024				if(maxHeight < 235){
1025					$('.search-body').css({
1026						'max-height':maxHeight+'px',
1027						'overflow-y':'scroll'
1028					});
1029				}
1030			}
1031		},
1032
1033		keyHandler: function(e) {
1034			var _this = this;
1035
1036			if(e.keyCode === 13) {
1037				$.proxy(_this.clickHandler, _this)(e);
1038			}
1039		},
1040
1041		clickHandler: function(e) {
1042			if (this.$html.hasClass('is-sp')) {
1043				e.preventDefault();
1044				// 2022 アクセシビリティ対応
1045				var _this = this,
1046					$button = $(e.currentTarget),
1047					$expanded = $button.attr('aria-expanded') === 'true',
1048					$target = $(e.currentTarget).next(),
1049					$close = $(e.currentTarget).next().find('.accordion-close'),
1050					_scrollY;
1051
1052				// $target.slideToggle();
1053				$button.toggleClass(_this.options.currentClass);
1054				$button.attr('aria-expanded', !$expanded);
1055				if ($button.hasClass(_this.options.currentClass)) {
1056					$target.slideDown().addClass(_this.options.currentClass);
1057					_scrollY = _this.$window.scrollTop();
1058					_this.$overlay.addClass('is-active');
1059					_this.$body.addClass('is-no-scroll');
1060					_this.$html.addClass('is-no-scroll');
1061					_this.$window.on('touchmove.noScroll', function(e) {
1062						e.preventDefault();
1063					});
1064					// console.log(_scrollY);
1065				} else {
1066					$target.hide().removeClass(_this.options.currentClass);
1067					// _this.$window.scrollTop(_scrollY);
1068					_this.$overlay.removeClass('is-active');
1069					_this.$body.removeClass('is-no-scroll');
1070					_this.$html.removeClass('is-no-scroll');
1071					_this.$window.off('.noScroll');
1072				}
1073				// $target.slideToggle().toggleClass(_this.options.currentClass);
1074
1075				$close.on('click', function() {
1076					// 2022 アクセシビリティ対応
1077					$button.removeClass(_this.options.currentClass).attr('aria-expanded', false);
1078					$target.hide().removeClass(_this.options.currentClass);
1079					_this.$overlay.removeClass('is-active');
1080					_this.$body.removeClass('is-no-scroll');
1081					_this.$html.removeClass('is-no-scroll');
1082					_this.$window.off('.noScroll');
1083				});
1084			}
1085		},
1086
1087		resizeHandler: function() {
1088			var _this = this;
1089
1090			if(_this.timer !== false) {
1091				clearTimeout(_this.timer);
1092			}
1093
1094			_this.timer = setTimeout(function() {
1095				if (_this.$html.hasClass('is-sp')) {
1096					_this.flag = 1;
1097					var windowSize = _this.$window.height();
1098					var maxHeight = windowSize - _this.topHeight;
1099	
1100					if(maxHeight >= 235){
1101						$('.search-body').css({
1102							'max-height':'100%',
1103							'overflow-y':'auto'
1104						});
1105					}else{
1106						$('.search-body').css({
1107							'max-height':maxHeight+'px',
1108							'overflow-y':'scroll'
1109						});
1110					}
1111				} else {
1112					_this.flag = 0;
1113					_this.$trigger.removeClass(_this.options.currentClass).removeAttr('style').attr('aria-expanded', false);
1114					_this.$trigger.next().removeClass(_this.options.currentClass).removeAttr('style');
1115					_this.$overlay.removeClass('is-active');
1116					_this.$body.removeClass('is-no-scroll');
1117					_this.$html.removeClass('is-no-scroll');
1118					$('.search-body').css({
1119						'max-height':'100%',
1120						'overflow-y':'auto'
1121					});
1122				}
1123			}, 100);
1124		}
1125
1126	};
1127
1128	$.fn.SearchSP = function(options) {
1129		return this.each(function() {
1130			new SearchSP(this, options);
1131		});
1132	};
1133
1134		/**
1135	 *  NavSP: SPナビゲーション(ドロワーメニュー)
1136	 */
1137	var NavSP = function(element, options) {
1138		this.$window = $(window);
1139		this.$html = $('html');
1140		this.$body = $('body');
1141		this.$document = $(document);
1142		this.$element = $(element);
1143		this.$trigger = this.$element;
1144		this.timer = false;
1145		this.flag = false;
1146		this.init(options);
1147	};
1148
1149	NavSP.prototype = {
1150
1151		defaults: {
1152			currentClass: 'is-opened'
1153		},
1154
1155		init: function(options) {
1156			this.options = $.extend({}, this.defaults, options);
1157
1158			// 初期状態でナビ内のフォーカス可能要素を非アクティブにする
1159			this.$element.next().find('a, button, input, select,\
1160				textarea, dt').attr('tabindex', '-1');
1161			// overflow: autoによりフォーカス対象となる.drawer-nav-scrollを除外(initでのみ実施)
1162			this.$element.next().find('.drawer-nav-scroll').attr('tabindex', '-1');
1163			// FocusTrapのインスタンス生成
1164			this.focusTrap = new FocusTrap(this.$element);
1165
1166			this.initializeEvent();
1167		},
1168
1169		initializeEvent: function() {
1170			var _this = this;
1171
1172			_this.$window.on('load resize', $.proxy(_this.resizeHandler, _this)).trigger('resize');
1173			_this.$trigger.on('keypress', $.proxy(_this.keyHandler, _this));
1174			_this.$trigger.on('click', $.proxy(_this.clickHandler, _this));
1175		},
1176
1177		keyHandler: function(e) {
1178			var _this = this;
1179
1180			if(e.keyCode === 13) {
1181				$.proxy(_this.clickHandler, _this)(e);
1182			}
1183		},
1184
1185		clickHandler: function(e) {
1186			if (this.$html.hasClass('is-sp')) {
1187				e.preventDefault();
1188				// 2022 アクセシビリティ対応
1189				var _this = this,
1190					$expanded = $(e.currentTarget).attr('aria-expanded') === 'true',
1191					$target = $(e.currentTarget).next(),
1192					$close = $(e.currentTarget).next().find('.drawer-close');
1193
1194				$(e.currentTarget).toggleClass(_this.options.currentClass);
1195				// 2022 アクセシビリティ対応
1196				$(e.currentTarget).attr('aria-expanded', !$expanded);
1197				if ($(e.currentTarget).hasClass(_this.options.currentClass)) {
1198					$target.addClass(_this.options.currentClass);
1199					_this.$body.addClass('is-no-scroll');
1200					_this.$html.addClass('is-no-scroll');
1201					// _this.$window.on('touchmove.noScroll', function(e) {
1202					// 	e.preventDefault();
1203					// });
1204					// console.log(_scrollY);
1205
1206					// フォーカス移動対象に追加
1207					$target.find('a, button, input, select, textarea, dt').attr('tabindex', '0');
1208					// FocusTrapを有効化
1209					_this.focusTrap.activate()
1210				} else {
1211					$target.removeClass(_this.options.currentClass);
1212					_this.$body.removeClass('is-no-scroll');
1213					_this.$html.removeClass('is-no-scroll');
1214					// _this.$window.off('.noScroll');
1215
1216					// フォーカス移動対象から除外
1217					$target.find('a, button, input, select, textarea, dt').attr('tabindex', '-1');
1218					// FocusTrapを無効化
1219					_this.focusTrap.deactivate()
1220				}
1221
1222				$close.on('click', function() {
1223					$(e.currentTarget).removeClass(_this.options.currentClass);
1224					$(e.currentTarget).attr('aria-expanded', false);
1225					$target.removeClass(_this.options.currentClass);
1226					_this.$body.removeClass('is-no-scroll');
1227					_this.$html.removeClass('is-no-scroll');
1228					// _this.$window.off('.noScroll');
1229
1230					// フォーカス移動対象から除外
1231					$target.find('a, button, input, select,\
1232						textarea, dt').attr('tabindex', '-1');
1233					// FocusTrapを無効化
1234					_this.focusTrap.deactivate()
1235				});
1236			}
1237		},
1238
1239		resizeHandler: function() {
1240			var _this = this;
1241
1242			if(_this.timer !== false) {
1243				clearTimeout(_this.timer);
1244			}
1245
1246			_this.timer = setTimeout(function() {
1247				if (_this.$html.hasClass('is-sp')) {
1248					_this.flag = 1;
1249				} else {
1250					_this.flag = 0;
1251					// 2022 アクセシビリティ対応
1252					_this.$trigger.removeClass(_this.options.currentClass).attr('aria-expanded', false);
1253					_this.$trigger.next().removeClass(_this.options.currentClass);
1254					_this.$body.removeClass('is-no-scroll');
1255					_this.$html.removeClass('is-no-scroll');
1256				}
1257			}, 100);
1258		}
1259
1260	};
1261
1262	$.fn.NavSP = function(options) {
1263		return this.each(function() {
1264			new NavSP(this, options);
1265		});
1266	};
1267
1268		/**
1269	 *  AccordionPC: アコーディオン(PCのみ)
1270	 */
1271	var AccordionPC = function(element, options) {
1272		this.$window = $(window);
1273		this.$html = $('html');
1274		this.$element = $(element);
1275		this.$trigger = this.$element.children('.js-accordion-head');
1276		this.timer = false;
1277		this.flag = false;
1278		this.init(options);
1279	};
1280
1281	AccordionPC.prototype = {
1282
1283		defaults: {
1284			currentClass: 'is-opened',
1285			itemgroup: false,
1286		},
1287
1288		init: function(options) {
1289			this.options = $.extend({}, this.defaults, options);
1290			this.initializeEvent();
1291		},
1292
1293		initializeEvent: function() {
1294			var _this = this;
1295
1296			_this.$window.on('load resize', $.proxy(_this.resizeHandler, _this)).trigger('resize');
1297			_this.$trigger.on('keypress', $.proxy(_this.keyHandler, _this));
1298			_this.$trigger.on('click', $.proxy(_this.clickHandler, _this));
1299
1300		},
1301
1302		keyHandler: function(e) {
1303			var _this = this;
1304
1305			if(e.keyCode === 13) {
1306				$.proxy(_this.clickHandler, _this)(e);
1307			}
1308		},
1309
1310		clickHandler: function(e) {
1311			if (this.$html.hasClass('is-pc')) {
1312				e.preventDefault();
1313				// 2022 アクセシビリティ対応
1314				var _this = this,
1315					$link = $(e.currentTarget),
1316					$expanded = $link.attr('aria-expanded') === 'true',
1317					$target = $link.next();
1318					// $close = $(e.currentTarget).next().find('.accordion-close');
1319
1320				// $target.slideToggle();
1321				if (!$link.hasClass(_this.options.currentClass) && _this.options.itemgroup) {
1322					var $group = $(_this.options.itemgroup),
1323							$currentItem = $group.children('.js-accordion-head.' + _this.options.currentClass);
1324
1325					if ($currentItem.length > 0) {
1326						$currentItem.removeClass(_this.options.currentClass);
1327						$currentItem.next().slideUp().removeClass(_this.options.currentClass);
1328						// 2022 アクセシビリティ対応
1329						$currentItem.attr('aria-expanded', false);
1330						$currentItem.next().find('.js-accordion-head.is-opened').triggerHandler('click');
1331					}
1332				}
1333				
1334				$link.toggleClass(_this.options.currentClass);
1335				// 2022 アクセシビリティ対応
1336				$link.attr('aria-expanded', !$expanded);
1337				if ($link.hasClass(_this.options.currentClass)) {
1338					$target.slideDown().addClass(_this.options.currentClass);
1339				} else {
1340					$target.slideUp().removeClass(_this.options.currentClass);
1341				}
1342				// $target.slideToggle().toggleClass(_this.options.currentClass);
1343			}
1344		},
1345
1346		resizeHandler: function() {
1347			var _this = this;
1348
1349			if(_this.timer !== false) {
1350				clearTimeout(_this.timer);
1351			}
1352
1353			_this.timer = setTimeout(function() {
1354				if (_this.$html.hasClass('is-pc')) {
1355					_this.flag = 1;
1356				} else {
1357					_this.flag = 0;
1358					// 2022 アクセシビリティ対応
1359					_this.$trigger.removeClass(_this.options.currentClass).removeAttr('style').attr('aria-expanded', false);
1360					_this.$trigger.next().removeClass(_this.options.currentClasss).removeAttr('style');
1361				}
1362			}, 100);
1363		}
1364
1365	};
1366
1367	$.fn.AccordionPC = function(options) {
1368		return this.each(function() {
1369			new AccordionPC(this, options);
1370		});
1371	};
1372
1373		/**
1374	 *  Submenu: PCメガメニュー
1375	 */
1376	var Submenu = function(element, options) {
1377		this.$window = $(window);
1378		this.$html = $('html');
1379		this.$element = $(element);
1380		this.$trigger = this.$element.find('.js-accordion-head');
1381		this.targetClass = '.js-accordion-body';
1382		this.currentTrigger = '.js-accordion-head.is-opened';
1383		this.currentTarget = '.js-accordion-body.is-opened';
1384		this.timer = false;
1385		this.flag = false;
1386		this.init(options);
1387	};
1388
1389	Submenu.prototype = {
1390
1391		defaults: {
1392			currentClass: 'is-opened',
1393		},
1394
1395		init: function(options) {
1396			this.options = $.extend({}, this.defaults, options);
1397			this.initializeEvent();
1398		},
1399
1400		initializeEvent: function() {
1401			var _this = this;
1402
1403			_this.$window.on('load resize', $.proxy(_this.resizeHandler, _this)).trigger('resize');
1404			_this.$trigger.on('keypress', $.proxy(_this.keyHandler, _this));
1405			_this.$trigger.on('click', $.proxy(_this.clickHandler, _this));
1406		},
1407
1408
1409		clickHandler: function(e) {
1410			var _this = this,
1411					$current = $(e.currentTarget),
1412					$target,
1413					flg = false;
1414
1415			e.preventDefault();
1416			// クリックされた行
1417			var index = $(e.currentTarget).closest('li').index(),
1418					row = Math.ceil((index + 1) / 3);
1419
1420			_this.$trigger.each(function(){
1421				if (e.currentTarget === this) {
1422					flg = true;
1423				}
1424			});
1425
1426			if (!flg) {
1427				return false;
1428			}
1429
1430			$target = $current.next(_this.targetClass);
1431			var targetHeight = $target.height(),
1432					marginBottom = targetHeight + 10;
1433
1434			// クリックした要素が閉じている場合(他の要素が開いている場合)
1435			if (!$current.hasClass(_this.options.currentClass)) {
1436
1437				if (_this.$element.find(_this.currentTrigger).length > 0) {
1438					var oldindex = _this.$element.find(_this.currentTrigger).closest('li').index(),
1439							oldrow = Math.ceil((oldindex + 1) / 3),
1440							oldtargetHeight = _this.$element.find(_this.currentTarget).height();
1441					_this.$element.find(_this.currentTrigger).removeClass(_this.options.currentClass);
1442
1443					for (var i = 3 * (oldrow - 1); i < 3 * oldrow; i++) {
1444						// クリックされた行の要素
1445						_this.$element.children('li').eq(i).animate({'marginBottom': '10px'}, 200);
1446						_this.$element.find(_this.currentTarget).slideUp(300, function() {
1447							$(this).css('opacity', 0).removeClass(_this.options.currentClass);
1448						});
1449					}
1450
1451					if(_this.timer !== false) {
1452						clearTimeout(_this.timer);
1453					}
1454
1455					_this.timer = setTimeout(function () {
1456						$current.addClass(_this.options.currentClass);
1457
1458						for (var j = 3 * (row - 1); j < 3 * row; j++) {
1459							// クリックされた行の要素
1460							_this.$element.children('li').eq(j).animate({'marginBottom': marginBottom + 'px'});
1461							$target.css('opacity', 1).slideDown().addClass(_this.options.currentClass);
1462						}
1463					}, 200);
1464
1465				} else {
1466					$current.addClass(_this.options.currentClass);
1467
1468					for (var j = 3 * (row - 1); j < 3 * row; j++) {
1469						// クリックされた行の要素
1470						_this.$element.children('li').eq(j).animate({'marginBottom': marginBottom + 'px'});
1471						$target.css('opacity', 1).slideDown().addClass(_this.options.currentClass);
1472					}
1473				}
1474
1475			} else {
1476				$current.removeClass(_this.options.currentClass);
1477				$target = $current.next(_this.targetClass);
1478
1479				for (var k = 3 * (row - 1); k < 3 * row; k++) {
1480					// クリックされた行の要素
1481					_this.$element.children('li').eq(k).animate({'marginBottom': '10px'}, 200);
1482					$target.slideUp(300, function() {
1483						$(this).css('opacity', 0).removeClass(_this.options.currentClass);
1484					});
1485				}
1486			}
1487		},
1488
1489		keyHandler: function(e) {
1490			var _this = this;
1491
1492			if(e.keyCode === 13) {
1493				$.proxy(_this.clickHandler, _this)(e);
1494			}
1495		},
1496
1497		resizeHandler: function() {
1498			var _this = this;
1499
1500			if(_this.timer !== false) {
1501				clearTimeout(_this.timer);
1502			}
1503
1504			_this.timer = setTimeout(function() {
1505				if (_this.$html.hasClass('is-pc')) {
1506					_this.flag = 1;
1507				} else {
1508					_this.flag = 0;
1509					_this.$trigger.removeClass(_this.options.currentClass).removeAttr('style');
1510					_this.$trigger.next().removeClass(_this.options.currentClasss).removeAttr('style');
1511				}
1512			}, 100);
1513		}
1514
1515	};
1516
1517	$.fn.Submenu = function(options) {
1518		return this.each(function() {
1519			new Submenu(this, options);
1520		});
1521	};
1522
1523		/**
1524	 *  FocusTrap: SPナビゲーション内のフォーカス移動
1525	 */
1526	var FocusTrap = function(container) {
1527		this.init(container);
1528	};
1529
1530	FocusTrap.prototype = {
1531		init: function(container) {
1532			// SPナビゲーション(タブ)開閉ボタン
1533			this.$first = $(container);
1534			// SPナビゲーション最下部の「閉じる」ボタン
1535			this.$last = $('.drawer-close');
1536			this.keyHandler = this.keyHandler.bind(this);
1537		},
1538
1539		activate: function() {
1540			this.$first.on('keydown', this.keyHandler);
1541			this.$last.on('keydown', this.keyHandler);
1542		},
1543
1544		deactivate: function() {
1545			this.$first.off('keydown', this.keyHandler);
1546			this.$last.off('keydown', this.keyHandler);
1547		},
1548
1549		keyHandler: function(e) {
1550			if (e.key != 'Tab') {
1551				return;
1552			}
1553
1554			const active = document.activeElement;
1555			if (e.shiftKey) {
1556				if (active === this.$first[0]) {
1557					// Shift + Tabで先頭から戻るとき
1558					e.preventDefault();
1559					this.$last.focus();
1560				}
1561			} else {
1562				if (active === this.$last[0]) {
1563					// Tabで末尾を越えたとき
1564					e.preventDefault();
1565					this.$first.focus();
1566				}
1567			}
1568		}
1569	};
1570
1571	$.fn.FocusTrap = function() {
1572		return this.each(function() {
1573				new FocusTrap(this);
1574			});
1575	};
1576
1577	$(function() {
1578		$(window).GetUserAgent();
1579		$(window).Responsive();
1580		$('.js-fontsize').FontResizer();
1581		$('a[href^="#"]').SmoothScroll();
1582		$('.l-pagetop-fixed').PagetopBtn();
1583		$('.l-navskip').NavSkip();
1584
1585		// $('.l-navbar').pcMegamenu();
1586
1587		// $('.l-navbar').accessibleMegaMenu({
1588		// 	menuClass: 'global-nav',
1589		// 	topNavItemClass: 'nav-item',
1590		// 	panelClass: 'sub-nav',
1591		// 	panelGroupClass: 'sub-nav-group',
1592		// 	hoverClass: 'is-hover',
1593		// 	focusClass: 'is-focus',
1594		// 	openClass: 'is-open',
1595		// 	closeDelay: '300',
1596		// 	openDelay: '200'
1597		// });
1598
1599		$('.tab .text').matchHeight();
1600		$('.field-title, .field-input').matchHeight();
1601		$('.js-mh-item').matchHeight();
1602
1603		$('.js-anchor').AnchorCurrent();
1604		$('.js-switch-image').ImageSwitcher();
1605		$('.js-tab').TabSwitcher();
1606		$('.js-accordion').Accordion();
1607		$('.js-accordion-sp').AccordionSP();
1608		$('.js-search-sp').SearchSP();
1609		$('.js-nav-sp').NavSP();
1610		$('.js-accordion-pc').AccordionPC();
1611		$('.js-accordion-megamenu').AccordionPC({
1612			itemgroup: '.js-accordion-megamenu'
1613		});
1614		$('.js-accordion-subnav').Submenu();
1615		$('.js-truncate').Truncater();
1616		$('.js-truncate-en').Truncater({
1617			count: 100,
1618			insert: '...'
1619		});
1620
1621		$('.js-nav-layout').NavLayouter();
1622
1623        /*SSC追加 サイトマップ表示_20230720*/
1624		$('.js-nav-layout').NavLayouter_ctm();
1625
1626		$('.js-megamenu-close').on('click', function(e) {
1627			e.preventDefault();
1628			var $currentMenu = $(e.currentTarget).closest('.js-accordion-megamenu'),
1629					$currentNav = $currentMenu.children('.js-accordion-head'),
1630					$currentTarget = $currentMenu.children('.js-accordion-body'),
1631					currentClass = 'is-opened';
1632			$currentNav.removeClass(currentClass);
1633			$currentTarget.slideUp().removeClass(currentClass);
1634
1635			// 2022アクセシビリティ対応
1636			$currentNav.attr("aria-expanded", false);
1637		});
1638	});
1639
1640})(jQuery, window, document);

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.