PageSourceSearch

https://takinoyu.co.jp/common/js/common.js

js takinoyu.co.jp collected 2026-09-25 04:26:37 UTC 34,210 bytes, 1,057 lines download raw bytes

1 /**
2 * メイン処理。
3 */
4$(function(){
5
6	// スマホ版の場合。
7	if (isSumaho()) {
8
9		setsumahomenu();
10
11		// 予約システムのリンクをスマホ用に書き換える。
12		var urlPC = 'https://asp.hotel-story.ne.jp/ver3d/planlist.asp?hcod1=62670&hcod2=001';
13		var planPC = 'https://asp.hotel-story.ne.jp/ver3d/ASPP0200.asp?hidSELECTCOD1=62670&hidSELECTCOD2=001&hidSELECTPLAN=';
14		var urlSumaho = 'http://asp.hotel-story.ne.jp/ktai/ZKETAI0000.asp?cod1=62670&cod2=001&guid=on';
15		var planSumaho = 'http://asp.hotel-story.ne.jp/ktai/ZKETAI0110.asp?cod1=62670&cod2=001&hcod=&reffrom=direct&guid=on&ppln=';
16		$('a[target="_blank"]').each(function(){
17			var href = $(this).attr('href');
18			if (href.startsWith(urlPC)) {
19				$(this).attr('href', href.replace(urlPC, urlSumaho));
20			} else if (href.startsWith(planPC)) {
21				$(this).attr('href', href.replace(planPC, planSumaho));
22			}
23		});
24
25/**
26 * [description]
27 * アコーディオン押下時
28 */
29		$('.sumaho-acc-wrap').on('click',function(){
30			$(this).children('.sumaho-acc').toggleClass('on');
31			$(this).next('.sumaho-acc-contents').slideToggle();
32		});
33
34
35		$('.header-menu').on('click', function () {
36			const icon = $(this);
37			const menu = $('.menu');
38
39			icon.toggleClass('on');
40
41			if (icon.hasClass('on')) {
42				menu.show();
43			} else {
44				menu.hide();
45			}
46		});
47
48	}
49
50	if (!isSumaho()) {
51		$('#image_path').after($('#topicpath'));
52	}
53
54	$('.lunchflexslider').flexslider({
55		selector:'.slider > li'
56	});
57
58	// スマホ版の場合。
59	/*
60	if (isSumaho()) {
61
62		// 画像リサイズを通す。
63		var w = (document.all ? document.body.clientWidth : window.innerWidth);
64		var iw = w * 1.5;
65		$('img.resize').each(function(){
66			var src = $(this).attr('src');
67			$(this).attr('src', '/image.php?width=' + iw + '&image=' + absolutePath(src));
68		});
69	}
70	*/
71
72	// 文字サイズメニューを追加する。
73	//createFontSizeMenu();
74	//setFontSize($.cookie('font-size'));
75
76	// ヘッダーを固定する。
77	fixedHeader();
78
79	var r = (document.all ? document.body.clientWidth : window.innerWidth);
80	if (isIE6() || isSumaho() || isTablet() || r <= 768) {
81	} else {
82		if (location.hash) {
83			setTimeout(function(){
84				window.scrollBy(0, -190);
85			},200);
86		}
87	}
88
89	// ホバーパネルを設定する。
90	//setHoverPane();
91	setTimeout("setHoverPane()", 500);
92
93	// サムネイルクリックで大きい画像を切替。
94	$('.thumb').each(function(){
95		var me = $(this);
96		var img = me.find('>.inimg img');
97		me.find('a').click(function(){
98			img.attr('src', $(this).attr('href'));
99			return false;
100		});
101	});
102
103// setSumahoReservation();
104
105$(window).on('resize',function(){
106	// setSumahoReservation();
107});
108
109	// 言語の選択メニューを追加する。
110	//setLangMenu();
111
112	// カルーセルを設定する。
113	setCarousel();
114
115	// スクロールペインを設定する。
116	setScrollPane();
117
118	// カルーセル付きギャラリーを設定する。
119	setGallery();
120
121	// スムーススクロールを設定する。
122	setSmoothScroll();
123
124	// 画像ホバーのハイライトを設定する。
125	setHighLight();
126
127	// fancyboxプラグインでポップアップ表示を設定する。
128	setFancybox();
129
130	// ロールオーバーの画像入替を設定する。
131	setRollover();
132
133	setTab();
134
135/*
136	if (isSumaho() && (!$('body').hasClass('home') || $('body').hasClass('blog'))) {
137		$('#sumaho_nav>ul').slideUp();
138		$('#footer_link').slideUp();
139		$('#sumaho_nav>div>a').click(function(){
140			$('#sumaho_nav>div>a img').toggle();
141			$('#sumaho_nav>ul').slideToggle();
142			$('#footer_link').slideToggle();
143			return false;
144		});
145	}
146*/
147
148	if (isSumaho()) {
149		$('table.oneline').each(function(){
150			var me = $(this);
151			me.find('tr').each(function(){
152				var tr = $(this);
153				tr.before($('<tr>').append(tr.find('th')));
154			});
155		});
156	}
157
158	$('input[type="submit"]').button();
159
160	// メガメニューを設置・設定する。
161	setMegaMenu();
162
163	// ページタイトル画像に文字を追加する。
164	//setPageTitle();
165
166	// 読み込み前の目隠しを消す。
167	setTimeout(function(){
168		$(window).resize();
169		$('#preloader').fadeOut(500, function() {
170					if (!(isSumaho() || isTablet())) {
171							if ($('#top_slide_movie').length) {
172								var v = document.getElementById('top_movie'),
173								h = $('#top_slide_movie').next().find('img').height();//動画高さ次のスライダー画像にあわせる
174								$('#slides video').height(h); //動画高さ設定
175								v.volume = 0; //初期ボリューム 0
176								v.play(); //動画再生
177							}
178					}
179		});
180	}, 500);
181
182	$('#movie_volume').on('click',function(){
183		var movie_el = document.getElementById('top_movie');
184		$(this).toggleClass('off');
185		movie_el.volume = $(this).hasClass('off') ?  0 : 1 ;
186	});
187
188/**
189 * [description]
190 * スライダーナビゲーション押下時一番目の動画を選択した時動画再実行
191 */
192	$('#slides').on('click','.flex-control-nav li',function(){
193		if($('#top_slide_movie').hasClass('flex-active-slide')){//選択したスライダーが動画の時
194			var v = document.getElementById('top_movie');
195			v.currentTime=0; //再生時間 0秒設定
196			v.play(); // 動画再実行
197		}
198	});
199
200});
201
202/*================================================================================*/
203
204// ホバーパネルを設定する。
205function setHoverPane() {
206
207	// アニメーションの速度と動作。
208	var duration = 'normal';
209	var easing = 'easeInOutQuad';
210	var tag = 0;
211
212	// カバー部分(色付きの背景)のdivを追加する。
213	$('div.pane-box').each(function(){
214		var me = $(this);
215		var pane = me.find('>div.pane');
216		var cover = $('<div class="cover"></div>');
217		pane.before(cover);
218		me.css({'overflow':'hidden'});
219		pane.css({'position':'absolute','background-color':'transparent'});
220	});
221
222	// カバーとパネルをフィットしたimgサイズに合わせる。
223	$(window).resize(function(){
224		$('div[class*=ani-]').each(function(){
225			var me = $(this);
226			var pane = me.find('>div.pane');
227			var cover = me.find('>div.cover');
228			var img = me.find('>img');
229			var ani = me.attr('class').match(/ani-(.{2,2})/);
230			var ani = ani[1];
231
232			me.height(img.height());
233			pane.width(img.width());
234			pane.height(img.height());
235			cover.width(img.width());
236			cover.height(img.height());
237
238			var css = {
239				'lr': {right: me.width() - tag},
240				'rl': {left: me.width() - tag},
241				'tb': {bottom: me.height() - tag},
242				'bt': {top: me.height() - tag}
243			};
244
245			pane.css(css[ani]);
246			cover.css(css[ani]);
247		});
248	}).resize();
249
250	// スライドアニメーションを設定する。
251	$('div[class*=ani-]').each(function(){
252		var me = $(this);
253		var pane = me.find('>div.pane');
254		var cover = me.find('>div.cover');
255		var img = me.find('>img');
256		var ani = me.attr('class').match(/ani-(.{2,2})/);
257		var ani = ani[1];
258
259		me.mouseenter(function(){
260			var css = {
261				'lr': {right:0},
262				'rl': {left:0},
263				'tb': {bottom:0},
264				'bt': {top:0}
265			};
266			pane.stop().animate(css[ani], duration, easing);
267			cover.stop().animate(css[ani], duration, easing);
268		});
269
270		me.mouseleave(function(){
271			var css = {
272				'lr': {right: me.width() - tag},
273				'rl': {left: me.width() - tag},
274				'tb': {bottom: me.height() - tag},
275				'bt': {top: me.height() - tag}
276			};
277			pane.stop().animate(css[ani], duration, easing);
278			cover.stop().animate(css[ani], duration, easing);
279		});
280	});
281
282}
283
284// 絶対パスを返す。
285var doc = document;
286function absolutePath(path){
287	var e = doc.createElement('span');
288	e.innerHTML = '<a href="' + path + '" />';
289	return e.firstChild.href;
290}
291
292// カルーセルを設定する。
293function setCarousel(){
294	if (typeof $.fn.bxSlider != 'function') return;
295	if (!isSumaho()) {
296		$('.carousel ul').bxSlider({ auto: true, minSlides: 4, maxSlides: 4, moveSlides: 1, slideWidth: 230, slideMargin: 20});
297	} else {
298		$('.carousel ul').bxSlider({ auto: true, minSlides: 1, maxSlides: 1, moveSlides: 1, slideWidth: 230, slideMargin: 20});
299	}
300}
301
302// スクロールペインを設定する。
303function setScrollPane(){
304	if (typeof $.fn.jScrollPane != 'function') return;
305	$('.scrollpane').jScrollPane().removeClass('scrollpane');
306}
307
308// カルーセル付きギャラリーを設定する。
309function setGallery(){
310	// スライドショー
311	$('.gallery').flexslider({
312		animation: 'slide',
313		directionNav: true,
314		controlNav: true,
315		prevText: '',
316		nextText: '',
317		//initDelay: 2000,
318		slideshowSpeed: 6000,
319		pauseOnHover: true
320	});
321	$('.gallery100p').flexslider({
322		animation: 'slide',
323		directionNav: true,
324		controlNav: true,
325		prevText: '',
326		nextText: '',
327		//initDelay: 2000,
328		slideshowSpeed: 6000,
329		pauseOnHover: true
330	});
331
332/*
333	if (typeof $.fn.bxSlider != 'function') return;
334	$('div.gallery ul').bxSlider({
335		auto: true, minSlides: 12, maxSlides: 12, moveSlides: 1, slideWidth: 100, slideMargin: 10,
336		onSlideBefore: function ($slideElement, oldIndex, newIndex) {
337			var a = $slideElement.children();
338			var src = a.attr('href');
339			var img = a.parents('div.gallery').find('div.mainimage img');
340			$('div.mainimage').css('background','url(' + src + ') no-repeat left top');
341			$('div.mainimage').css('background-size','100%');
342			img.fadeTo('slow', 0.01, function(){
343				img.attr('src', src);
344				img.fadeTo('fast', 1.00);
345			});
346		},
347		onSliderLoad: function(){
348			$('div.gallery .bx-viewport a').each(function(){
349				var a = $(this);
350				a.click(function(){
351					var src = a.attr('href');
352					var img = a.parents('div.gallery').find('div.mainimage img');
353					$('div.mainimage').css('background','url(' + src + ') no-repeat left top');
354					$('div.mainimage').css('background-size','100%');
355					img.fadeTo('fast', 0.01, function(){
356						img.attr('src', src);
357						img.fadeTo('fast', 1.00);
358					});
359					return false;
360				});
361			})
362		}
363	});
364*/
365}
366
367/*================================================================================*/
368
369// スマホからPCサイトの場合にURLパラメータ付与。
370function fromS(){
371	if (location.search == '?from=s') {
372		$('a').each(function(){
373			var me = $(this);
374			var href = me.attr('href');
375			if (href == null || href.startsWith('#') || href.endsWith('?from=s')) return;
376			me.attr('href', href + '?from=s');
377		});
378	}
379}
380
381// ヘッダーを固定する。
382function fixedHeader(){
383
384	var timer = false;
385	$(window).resize(function(){
386		if (timer !== false) clearTimeout(timer);
387		timer = setTimeout(function(){
388
389			// IE6、スマホ、タブレットは固定しない。
390			var r = (document.all ? document.body.clientWidth : window.innerWidth);
391			if (isIE6() || isSumaho() || isTablet() || r <= 768) {
392				$('body').removeClass('fixed');
393				$('#nav,#slides,#image_path').removeClass('fixed');
394				// $(window).unbind('scroll');
395			} else {
396				//$('body').addClass('fixed');
397				$('#nav,#slides,#image_path').addClass('fixed');
398
399				var body = $('body');
400				var nav = $('#nav');
401				/*
402				var offtop = nav.offset().top + 98;
403				offtop = 98;
404				*/
405				var offtop = 98;
406
407				$(window).scroll(function(e){
408					var top = $(this).scrollTop();
409					//console.info('top:' + top + ' > offtop:' + offtop);
410					if (top > offtop) {
411						body.addClass('fixed');
412					} else {
413						body.removeClass('fixed');
414					}
415				});
416
417			}
418
419			// $('#page_top').css('right', parseInt(($(window).width()-$('#footer_reservation_form').width())/2-$('#page_top').width()-20) + 'px');
420
421			if (!isSumaho()){
422				$('#weather').css('right', parseInt(($(window).width()-$('#header_inner').width())/2) + 'px');
423			}
424
425			// IEなら#imageの画像をリサイズする
426			var w = 1200,
427				h = 240;
428			if(_ua().indexOf('ie') >= 0 && $('#image').width(document.documentElement.clientWidth) < w){
429				$('#image').width(document.documentElement.clientWidth);
430				$('#image').height(parseInt(h * (document.documentElement.clientWidth / w)));
431				$('#image_page_title').width(document.documentElement.clientWidth);
432				$('#image_page_title').height(parseInt(h * (document.documentElement.clientWidth / w)));
433			}
434
435		},200);
436	}).resize();
437}
438
439// スマートフォン端末かどうか確認する。
440function isSumaho(){
441	var ua  = navigator.userAgent;
442	var ip  = ((ua.indexOf('iPhone') > 0 && ua.indexOf('iPad') == -1) || ua.indexOf('iPod') > 0);
443	var ad  = (ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0);
444	var etc = (ua.indexOf('Windows Phone') > 0 || ua.indexOf('BlackBerry') > 0);
445	var w = (document.all ? document.body.clientWidth : window.innerWidth);
446	return ip || ad || etc || w <= 598;
447}
448
449// タブレット端末かどうか確認する。
450function isTablet(){
451	var ua = navigator.userAgent;
452	var ip = (ua.indexOf('iPad') > 0);
453	var ad = (ua.indexOf('Android') > 0 && ua.indexOf('Mobile') == -1);
454	return ip || ad;
455}
456
457// iPadかどうか確認する。
458function isIpad(){
459	var ua = navigator.userAgent;
460	var ip = (ua.indexOf('iPad') > 0);
461	return ip;
462}
463
464// IE6かどうかを確認する。
465function isIE6(){
466	return !!$.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest;
467}
468
469/**
470 * JSONPラッパー。
471 */
472function jsonp(url, callback, ttl, encoding) {
473	// プロキシのURL。
474	//var proxy = 'http://www.omotenashi-contents.jp/' + 'proxy/index.php?';
475	var proxy = 'https://www.takinoyu.co.jp/' + 'proxy/index.php?';
476	ttl = ttl || 60;
477	encoding = encoding || 'UTF-8';
478	$.getJSON(proxy + 'callback=?', { 'url' : url, 'encoding' : encoding, 'ttl' : ttl, 'curl' : 1 }, callback);
479}
480
481/**
482 * 相対パスを返す。
483 */
484function getRelPath(){
485
486	var href = $('link[rel="shortcut icon"]').attr('href');
487	var path = '';
488
489	//console.info(href);
490	//console.info(location);
491
492	if (href.startsWith('http')) {
493		var s = location.pathname.split('/');
494		path = '../'.repeat(s.length - 2);
495	} else {
496		href.match(/^([\./]+)/);
497		path = RegExp.$1;
498	}
499
500	//console.info(path);
501	return path;
502}
503
504// Firefoxだけsrcとhrefにテンプレート変数を設定できない件の対応。
505function title2attr(){
506	$('[title^="@@"]').each(function(){
507		var me = $(this);
508		var url = me.attr('title').replace(/^@@/,'');
509		switch (me.get(0).tagName.toLowerCase()) {
510			case 'a':
511				me.get(0).href = url;
512				break;
513			case 'img':
514				me.get(0).src = url;
515				break;
516		}
517		me.removeAttr('title');
518	});
519}
520
521// 年月日の形式に変換する。
522function nengappi(val, day){
523	if (day) {
524		return Date.create(val).format('{yyyy}年{M}月{d}日({dow})', 'ja').replace('曜日','');
525	} else {
526		return Date.create(val).format('{yyyy}年{M}月{d}日', 'ja');
527	}
528}
529
530/**
531 * テンプレートを読み込む。
532 */
533function loadTemplate(id, cb){
534
535	// テンプレートのパスを設定する。
536	var tpldir = getRelPath() + 'common/js/' + id + '/';
537
538	// テンプレートを読み込む。
539	$.ajax({
540		url : tpldir + id + '.html', dataType : 'html',
541		error : function(XMLHttpRequest, textStatus, errorThrown){
542			//console.info(XMLHttpRequest);
543			//console.info(textStatus);
544			//console.info(errorThrown);
545			var errmsg = [
546				XMLHttpRequest.status,
547				XMLHttpRequest.statusText,
548				errorThrown.result,
549				errorThrown.name,
550				errorThrown.message
551			].join("\n");
552			//alert(errmsg);
553		},
554		success : cb
555	});
556}
557
558// テンプレートに再実行。
559function forTemplate(){
560	var isIE6 = !!$.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest;
561	if (isIE6) { DD_belatedPNG.fix('.png'); }
562	setHighLight();
563	setFancybox();
564	setRollover();
565}
566
567/**
568 * xml文字列をXMLドキュメントで返す。
569 */
570function parseFromString(xmlstr){
571
572	var isIE = /*@cc_on!@*/false;
573	var xml = null;
574	var xmldom;
575
576	if (!isIE && window.DOMParser) {
577
578		//alert('window.DOMParser');
579		xmldom = new DOMParser();
580		xmldom.async = false;
581		var dom = xmldom.parseFromString(xmlstr, 'application/xml');
582		if (!dom) return xml;
583		xml = dom.documentElement;
584
585	} else if (window.ActiveXObject) {
586
587		//alert('Microsoft.XMLDOM');
588		//xmldom = new ActiveXObject('Microsoft.XMLDOM');
589		//alert('MSXML2.DOMDocument');
590		xmldom = new ActiveXObject('MSXML2.DOMDocument');
591		//alert('Msxml2.DOMDocument.3.0');
592		//xmldom = new ActiveXObject('Msxml2.DOMDocument.3.0');
593
594		xmldom.async = false;
595		xmldom.loadXML(xmlstr);
596
597		if (xmldom.parseError.errorCode != 0) {
598			var xmlerr = xmldom.parseError;
599			//alert(xmlerr.reason);
600		} else {
601			xml = xmldom.documentElement;
602		}
603	}
604
605	return xml;
606}
607
608/**
609 * ロールオーバーで_onのファイルに差し替える。
610 */
611function setRollover()
612{
613	$('img.rollover').each(function(){
614		var me = $(this);
615		var src = me.attr('src');
616
617		if (!src) return;
618
619		var img = src.match(/(\w*\.\w*?)$/ig).pop();
620
621		//var on_src = src.replace(/\.(\w*?)$/, function(){ return '_on.' + RegExp.$1; });
622		var on_src = src.replace(img, img.replace('.','_on.'));
623
624		me.hover(function(){
625			$(this).attr('src', on_src);
626		},function(){
627			$(this).attr('src', src);
628		}).removeClass('rollover');
629	});
630}
631
632/**
633 * bodyタグ(ページ全体を意味する)の文字サイズを設定し、Cookieに保存する。
634 *
635 * @param size String: CSSのfont-sizeに指定する文字列。
636 */
637function setFontSize(size)
638{
639	size = size || '1.4em';
640	$('body').css('font-size', size);
641	$.cookie('font-size', size, {expires:365,path:'/'});
642	if (size == '1.4em') {
643		$('li#font_size_normal a').addClass('current');
644		$('li#font_size_zoom a').removeClass('current');
645	} else {
646		$('li#font_size_normal a').removeClass('current');
647		$('li#font_size_zoom a').addClass('current');
648	}
649	return false;
650};
651
652/**
653 * ヘッダーにフォントサイズのメニューを追加する。
654 */
655function createFontSizeMenu()
656{
657	var ul = $('<ul id="header_font_size" class="notablet"></ul>');
658	ul.append($('<li id="font_size"><span class="reader">フォントサイズ</span></li>'));
659	var a = $('<a href="index.html" class="noscroll"><span class="reader"></span></a>').css('cursor','pointer');
660	ul.append($('<li id="font_size_normal" class="btn"></li>').append(a.clone().find('span').text('標準').end().click(function(){ return setFontSize('1.4em'); })));
661	ul.append($('<li id="font_size_zoom" class="btn"></li>').append(a.clone().find('span').text('拡大').end().click(function(){ return setFontSize('1.6em'); })));
662	$('#header_inner').append(ul);
663}
664
665/**
666 * メガメニューを設置・設定する。
667 */
668function setMegaMenu()
669{
670	// メガメニュー設置
671	var rel = getRelPath();
672
673	var nav_menu = ([
674		'<div class="nav_menu_inner" id="menu_nav_meals">',
675		'	<div>',
676		'		<table summary="お食事">',
677		'			<tr>',
678		'				<td><a href="' + rel + 'meals/index.html"><img src="' + rel + 'common/img/menu_nav_meals_01.jpg" class="fit highlight" alt="お食事(TOP)" /></a></td>',
679		'				<td><a href="' + rel + 'meals/viking.html"><img src="' + rel + 'common/img/menu_nav_meals_02.jpg" class="fit highlight" alt="エルバージュ" /></a></td>',
680		'				<td><a href="' + rel + 'meals/japanese.html"><img src="' + rel + 'common/img/menu_nav_meals_03.jpg" class="fit highlight" alt="御堂小路" /></a></td>',
681		'				<td><a href="' + rel + 'cafebar/index.html"><img src="' + rel + 'common/img/menu_nav_meals_04.jpg" class="fit highlight" alt="カスケード" /></a></td>',
682		'				<td><a href="' + rel + 'meals/kaiseki.html"><img src="' + rel + 'common/img/menu_nav_meals_05.jpg" class="fit highlight" alt="宴会" /></a></td>',
683		'			</tr>',
684		'		</table>',
685		'	</div>',
686		'</div>'
687	].join(''));
688	$('#nav_meals').append(nav_menu);
689	nav_menu = '';
690
691	var nav_menu = ([
692		'<div class="nav_menu_inner" id="menu_nav_hotspa">',
693		'	<div>',
694		'		<table summary="温泉">',
695		'			<tr class="tc">',
696		'				<td><a href="' + rel + 'hotspa/index.html"><img src="' + rel + 'common/img/menu_nav_hotspa_01.jpg" class="fit highlight" alt="温泉(TOP)" /></a></td>',
697		'				<td><a href="' + rel + 'hotspa/keiryu.html"><img src="' + rel + 'common/img/menu_nav_hotspa_02.jpg" class="fit" alt="渓流露天風呂 棚湯" /></a></td>',
698//		'				<td><p><img src="' + rel + 'common/img/menu_nav_hotspa_03.jpg" class="fit" alt="信玄野天風呂" /></p></td>',
699		'				<td><a href="' + rel + 'hotspa/garden.html"><img src="' + rel + 'common/img/menu_nav_hotspa_03.jpg" class="fit highlight" alt="庭園大浴場" /></a></td>',
700		'				<td><a href="' + rel + 'hotspa/kashikiriroten.html"><img src="' + rel + 'common/img/menu_nav_hotspa_04.jpg" class="fit highlight" alt="貸切露天風呂" /></a></td>',
701		'				<td>
701<a href="' + rel + 'hotspa/dayuse.html"><img src="' + rel + 'common/img/menu_nav_hotspa_05.jpg" class="fit highlight" alt="日帰り入浴" /></a></td>',
702		'			</tr>',
703		'		</table>',
704		'	</div>',
705		'</div>'
706	].join(''));
707	$('#nav_hotspa').append(nav_menu);
708	nav_menu = '';
709
710	var nav_menu = ([
711		'<div class="nav_menu_inner" id="menu_nav_rooms">',
712		'	<div>',
713		'		<table summary="お部屋">',
714		'			<tr>',
715//		'				<!-- <td><a href="' + rel + 'rooms/index.html"><img src="' + rel + 'common/img/menu_nav_rooms_01.jpg" class="fit highlight" alt="お部屋(TOP)" /></a></td> -->',
716		'				<td><a href="' + rel + 'rooms/riverfront.html"><img src="' + rel + 'common/img/menu_nav_rooms_07.jpg" class="fit highlight" alt="リバーフロントテラス" /></a></td>',
717		'				<td><a href="' + rel + 'rooms/skyconfort.html"><img src="' + rel + 'common/img/menu_nav_rooms_08.jpg" class="fit highlight" alt="スカイコンフォートフロア" /></a></td>',
718		'				<td><a href="' + rel + 'rooms/children.html"><img src="' + rel + 'common/img/menu_nav_rooms_09.jpg" class="fit highlight" alt="お子様連れに" /></a></td>',
719		'				<td><a href="' + rel + 'rooms/couple.html"><img src="' + rel + 'common/img/menu_nav_rooms_02.jpg" class="fit highlight" alt="ご夫婦・カップルに" /></a></td>',
720		'				<td><a href="' + rel + 'rooms/family.html"><img src="' + rel + 'common/img/menu_nav_rooms_03.jpg" class="fit highlight" alt="ご家族・グループに" /></a></td>',
721//		'				<td><a href="' + rel + 'rooms/single.html"><img src="' + rel + 'common/img/menu_nav_rooms_05.jpg" class="fit highlight" alt="お一人さまに" /></a></td>',
722		'				<td><a href="' + rel + 'rooms/universal.html"><img src="' + rel + 'common/img/menu_nav_rooms_06.jpg" class="fit highlight" alt="アクセシブル" /></a></td>',
723		'			</tr>',
724		'		</table>',
725		'	</div>',
726		'</div>'
727	].join(''));
728	$('#nav_rooms').append(nav_menu);
729	nav_menu = '';
730
731	var nav_menu = ([
732		'<div class="nav_menu_inner" id="menu_nav_facilities">',
733		'	<div>',
734		'		<table summary="館内施設">',
735		'			<tr>',
736		'				<td><a href="' + rel + 'facilities/index.html"><img src="' + rel + 'common/img/menu_nav_facilities_01.jpg" class="fit highlight" alt="館内施設(TOP)" /></a></td>',
737		'				<td><a href="' + rel + 'facilities/relaxationsalon.html"><img src="' + rel + 'common/img/menu_nav_facilities_06.jpg?202606" class="fit highlight" alt="エステ" /></a></td>',
738//		'				<td><a href="' + rel + 'facilities/relaxationsalon.html"><img src="' + rel + 'common/img/menu_nav_facilities_02.jpg" class="fit highlight" alt="温泉通り" /></a></td>',
739		'				<td><a href="' + rel + 'facilities/relaxation.html"><img src="' + rel + 'common/img/menu_nav_facilities_05.jpg" class="fit highlight" alt="リラクゼーション" /></a></td>',
740		'				<td><a href="' + rel + 'kidspark/index.html"><img src="' + rel + 'common/img/menu_nav_facilities_04.jpg" class="fit highlight" alt="蓼科キッズパーク" /></a></td>',
741		'				<td><a href="' + rel + 'fishingpark/"><img src="' + rel + 'common/img/menu_nav_facilities_07.jpg" class="fit highlight" alt="蓼科フィッシングパーク" /></a></td>',
742		'				<td><a href="' + rel + 'facilities/baby.html"><img src="' + rel + 'common/img/menu_nav_facilities_03.jpg" class="fit highlight" alt="赤ちゃん向けサービス" /></a></td>',
743//	'				<td><a href="http://tateshinatakinoyu.blog.fc2.com/blog-category-11.html" target="_blank"><img src="' + rel + 'common/img/menu_nav_facilities_03.jpg" class="fit highlight" alt="売店ブログ~やまびこだより~" /></a></td>',
744		'			</tr>',
745		'		</table>',
746		'	</div>',
747		'</div>'
748	].join(''));
749	$('#nav_facilities').append(nav_menu);
750	nav_menu = '';
751
752	
753	var nav_menu = ([
754		'<div class="nav_menu_inner" id="menu_nav_sightseeing">',
755		'	<div>',
756		'		<table summary="観光情報">',
757		'			<tr>',
758//		'				<td><a href="' + rel + '100th/index.html"><img src="' + rel + 'common/img/menu_nav_sightseeing_002.jpg" class="fit highlight" alt="創業100周年記念" /></a></td>',
759		'				<td><a href="' + rel + 'event/index.html"><img src="' + rel + 'common/img/menu_nav_event_01.jpg" class="fit highlight" alt="ホテルイベント" /></a></td>',
760		'				<td><a href="' + rel + 'sightseeing/index.html"><img src="' + rel + 'common/img/menu_nav_event_02.jpg" class="fit highlight" alt="観光情報トップ" /></a></td>',
761//		'				<td><a href="' + rel + 'sightseeing/index.html#museum"><img src="' + rel + 'common/img/menu_nav_sightseeing_004.jpg" class="fit highlight" alt="ミュージアム" /></a></td>',
762		'				<td><a href="' + rel + 'activities/"><img src="' + rel + 'common/img/menu_nav_event_03.jpg" class="fit highlight" alt="アクティビティ" /></a></td>',
763//		'				<td><a href="' + rel + 'sightseeing/index.html#amusement_park"><img src="' + rel + 'common/img/menu_nav_sightseeing_005.jpg" class="fit highlight" alt="アミューズメントパーク" /></a></td>',
764//		'				<td><a href="' + rel + 'sightseeing/index.html#location"><img src="' + rel + 'common/img/menu_nav_sightseeing_06.jpg" class="fit highlight" alt="観光スポット NAGOMI" /></a></td>',
765		'			</tr>',
766		'		</table>',
767		'	</div>',
768		'</div>'
769	].join(''));
770	$('#nav_sightseeing').append(nav_menu);
771	nav_menu = '';
772
773	forTemplate();
774}
775
776/**
777 * スムーススクロールを設定する。
778 */
779function setSmoothScroll() {
780	$('a[href*=#],area[href*=#]').click(function () {
781		var a = $(this);
782		if (a.attr('href').indexOf('booking.iconia.co.jp') != -1) return;
783		if (a.hasClass('flex-prev')) return false;
784		if (a.hasClass('flex-next')) return false;
785
786		if (a.hasClass('noscroll')) return false;
787		var speed = 400;
788		var href= a.attr('href');
789		var target = $(href == '#' || href == '' ? 'html' : href);
790		var top = target.offset().top;
791		var position = top - (isIE6() || isSumaho() || isTablet() ? 10 : 190);// + (top == 0 ? 0 : 80));
792		$('body,html').animate({scrollTop:position}, speed, 'swing');
793		return false;
794	});
795}
796
797
798
799/**
800 * highlightクラスが設定された要素のマウスオーバー時のハイライトを設定する。
801 */
802function setHighLight()
803{
804	$('img.highlight,a.highlight,input.highlight').each(function(){
805		var me = $(this);
806		var el = me.parent();
807		el.css({
808			// 'background-color':'#ffffff',
809			//'background-color':'#94c4ea',
810			//'width': me.width() + 'px',
811			//'height': me.height() + 'px',
812			'display':'block'
813		});
814		$(el).hover(
815			function(){
816				me.fadeTo(100, 0.8);
817			 },
818			function(){ me.fadeTo(100, 1.0); }
819		);
820		me.removeClass('highlight');
821	});
822}
823
824/**
825 * fancyboxプラグインでポップアップ表示を設定する。
826 */
827function setFancybox()
828{
829
830	if (typeof $.fn.fancybox == 'function') {
831
832		// 通常のポップアップを設定する。
833		$('a.popup,a[rel^="popup"],area.popup,area[rel^="popup"]').each(function(){
834			var me = $(this);
835			me.fancybox({
836				'centerOnScroll' : true,
837				'cyclic' : true,
838				'overlayOpacity' : 0.7,
839				'overlayColor'   : '#000000'
840			}).removeClass('popup');
841		});
842
843		// 通常のポップアップを設定する。
844		$('a.popifame,a[rel^="popifame"],area.popifame,area[rel^="popifame"]').each(function(){
845			var me = $(this);
846			me.fancybox({
847				'type' : 'iframe',
848				'centerOnScroll' : true,
849				'cyclic' : true,
850				'overlayOpacity' : 0.7,
851				'overlayColor'   : '#000000'
852			}).removeClass('popifame');
853		});
854
855		// ポップアップウィンドウを指定のサイズで表示する。
856 		// classに「popwin-width-height#id」で指定する。
857 		var boxid_cnt = 0;
858		$('a[class*="popwin"],area[class*="popwin"]').each(function(){
859			var me = $(this);
860			var info = me.attr('class').match(/popwin-(\d+)-(\d+)(#[^ ]+|)/);
861			if (info == null) return;
862			var popcls = info[0];
863			var width = parseInt(info[1]);
864			var height = parseInt(info[2]);
865			var id = info.length > 2 ? info[3] : null;
866
867			if (width == 0) width = $(window).width() * 0.8;
868			if (height == 0) height = $(window).height() * 0.8;
869
870			var fboxopt = {
871				'padding'        : 10,
872				'titleShow'      : true,
873				'titlePosition'  : 'inside',
874				'autoScale'      : false,
875				'centerOnScroll' : true,
876				'transitionIn'   : 'fade',
877				'transitionOut'  : 'fade',
878				'width'          : width,
879				'height'         : height,
880				'overlayOpacity' : 0.9,
881				'overlayColor'   : '#ffffff'
882			};
883
884			if (id) {
885				var href = me.attr('href');
886				var boxid = 'box_' + Base64.encode(href + id).replace(/=/g,'');
887				if (!$('div').is('#' + boxid)) {
888					var div = $('<div></div>');
889					$('body').append(
890						div.clone().addClass('none').append(
891							div.clone().attr('id', boxid).css({
892								'text-align' : 'left',
893								'width'  : width  + 'px',
894								'height' : height + 'px'
895							})
896						)
897					);
898					$('#' + boxid).load(href + ' ' + id);
899				}
900				me.attr('href', '#' + boxid).fancybox(fboxopt).removeClass(popcls);
901			} else {
902				fboxopt.type = 'iframe';
903				me.fancybox(fboxopt).removeClass(popcls);
904			}
905		});
906
907	}
908}
909
910function _ua(){
911	var userAgent = window.navigator.userAgent.toLowerCase();
912	var appVersion = window.navigator.appVersion.toLowerCase();
913	if (userAgent.indexOf('msie') != -1) {
914		//IE全般
915		if (appVersion.indexOf("msie 6.") != -1) {
916			return "ie6";
917		}else if (appVersion.indexOf("msie 7.") != -1) {
918			return "ie7";
919		}else if (appVersion.indexOf("msie 8.") != -1) {
920			return "ie8";
921		}else if (appVersion.indexOf("msie 9.") != -1) {
922			return "ie9";
923		}else if (appVersion.indexOf("msie 10.") != -1) {
924			return "ie10";
925		}else{
926			return "ie";
927		}
928	}else if (userAgent.indexOf('chrome') != -1) {
929		return "chrome";
930	}else if (userAgent.indexOf('safari') != -1) {
931		return "safari";
932	}else if (userAgent.indexOf('firefox') != -1) {
933		return "firefox";
934	}else if (userAgent.indexOf('opera') != -1) {
935		return "opera";
936	}else{
937		return userAgent;
938	}
939};
940
941/**
942 * スマホ閲覧時 言語切替ボタン表示非表示
943 */
944$("#header_lang_icon").click(function () {
945		$("#header_language ul").slideToggle();
946		 $("#header_language ul").toggleClass("active");
947});
948	
949/**
950 * [setSumahoReservation description]
951 * スマホ閲覧時予約モジュール追加
952 */
953
954function setSumahoReservation() {
955		if($(window).width() <= 768 && !$('.sumahoreservation').length) {
956			$.ajax({
957				url:'common/sumahoreservation/index.html',
958				dataType:'html'
959			}).
960			done(function(data){
961				var today = Date.create(new Date(), 'ja'),
962				sumahoheader = $('#header_inner').outerHeight() + $('#sumaho_menu').outerHeight();
963
964				$('body').prepend(data);
965				$('.sumahoreservation').css({top:sumahoheader});
966				$('.sumahoreservation_calendar').datepicker({
967					minDate: today, // 今日から選択可。
968					maxDate: today.clone().addYears(1), // 今日から1年後まで選択可。
969					changeYear: true, // 年選択メニューを表示。
970					changeMonth: true, // 月選択メニューを表示。
971					showOn: 'both', // テキストボックスとカレンダーボタンの両方でカレンダーを表示する。
972					buttonImageOnly: true, // カレンダーアイコンのみ表示する。
973					buttonImage: getRelPath() + 'common/img/sumaho/calendar/icon.png', // カレンダーアイコンのイメージパス。
974					buttonText: 'カレンダー表示' // カレンダーアイコンのテキスト。
975			}).val(today.format('{yyyy}/{MM}/{dd}', 'ja')); // 今日の日付を初期値にする。
976
977
978				$('.sumaho_menu_reservationbtn').on('click',function(){
979					$('.sumahoreservation').stop().fadeToggle();
980					$(this).append($('<span>',{
981						class:'ripple'
982					}));
983
984					setTimeout(function(){
985						$('.sumaho_menu_reservationbtn').find('.ripple').remove();
986					},300);
987				});
988
989				$('.sumahoreservation_submit').on('click',function(){
990					$('.sumahoreservation').submit();
991				})
992
993				$('.sumahoreservation').on('submit',function(){
994				var linkerParam;
995				ga(function(tracker) {
996					linkerParam = '&' + tracker.get('linkerParam');
997				});
998				var frm = $('.sumahoreservation');
999				var url = 'https://asp.hotel-story.ne.jp/ver3d/planlist.asp?hcod1=62670&hcod2=001&hidmode=select&mode=seek';
1000
1001				frm.attr('action', url + '&hidSELECTARRYMD=' + $('.sumahoreservation_calendar').val() + '&hidSELECTHAKSU=' + $('.sumahoreservation_selectHakusu').val() + '&hidSELECTadult=' + $('.sumahoreservation_selectcmbADULT').val() + '&room=' + $('.sumahoreservation_selectcmbSUMROOM').val() + linkerParam);
1002				})
1003			});
1004		}
1005}
1006
1007// スマホ時、メイン画像をスマホ用画像に変える
1008if (isSumaho()) {
1009	$('.js_sumaho_img').each(function () {
1010		var sumahoImg = $(this).attr('data-sumaho-img');
1011		$(this).attr('src', sumahoImg);
1012		
1013	});
1014	}
1015
1016// 高さを合わせる
1017if (typeof matchHeight == 'function') {
1018  $('.match_hight').matchHeight();
1019	$('.mh').matchHeight();
1020}
1021
1022function setsumahomenu() {
1023	$('body').prepend(`
1024		<div class="menu">
1025		<div class="menu-outer">
1026			<div class="menu-inner">
1027				<a href="/plan/">宿泊</a>
1028				<a href="/hotspa/">温泉</a>
1029				<a href="/meals/">お食事</a>
1030				<a href="/rooms/">お部屋</a>
1031				<a href="/facilities/">施設</a>
1032				<a href="/access/">交通アクセス</a>
1033				<a href="/event/">ホテルイベント</a>
1034				<a href="/sightseeing/">観光情報</a>
1035				<a href="/activities/">アクティビティ</a>
1036				<a href="/100th/">創業100周年記念サイト</a>
1037				<a href="/topics/">お知らせ・新着情報</a>
1038			</div>
1039			<a href="https://booking.iconia.co.jp/#/booking/result?code=2a841adf09063a6ea6b9d3c2f24a5f35" class="menu-btn1" target="_blank"><span>空室検索・宿泊予約</span><em>はこちら</em></a>
1040		</div>
1041	</div>	
1042	`);
1043}
1044
1045function setTab() {
1046	$('.js-tab-trigger').on('click', (e) => {
1047    const tabWrap = $(e.currentTarget).parents('.tab-container');
1048    const tabBtn = tabWrap.find('.js-tab-trigger');
1049    const tabContents = tabWrap.find('.tab-contents');
1050    tabBtn.removeClass('on');
1051    $(e.currentTarget).addClass('on');
1052    const elmIndex = tabBtn.index($(e.currentTarget));
1053    tabContents.removeClass('is-show');
1054    tabContents.eq(elmIndex).addClass('is-show');
1055  });
1056	
1057}

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.