// source --> https://tabi-rin.com/wp-content/themes/tabirin/js/script.js?ver=20180423 
(function ($) {
    $('#sidr-menu-button').click(function () {
        if ($(this).attr("class") == "headOpen") {
            $('body').animate({right: '0'}, 200);
            $('#sidr_btn').animate({right: '0'}, 200);
            $('nav').animate({right: '-260px'}, 200);
            $(this).removeClass("headOpen");
        } else {
            $('body').animate({right: '260px'}, 200);
            $('#sidr_btn').animate({right: '260px'}, 200);
            $('nav').animate({right: '0'}, 200);
            $(this).addClass("headOpen");
        }
    });

// course view
    $(document).ready(function () {
        $('#demoTab').easyResponsiveTabs({
            type: 'default', //Types: default, vertical, accordion
            width: 'auto', //auto or any width like 600px
            fit: true, // 100% fit in a container
            tabidentify: 'hor_1', // The tab groups identifier

        });
    });

//map archive
    $(document).ready(function () {
        $('.side-title').click(function () {
            $(this).next('.box').slideToggle();
            $(this).toggleClass("active");
        });

        // 子メニュー処理
        $('#map-side dt').click(function (e) {
            // メニュー表示/非表示
            $(this).next('dd').slideToggle();
            $(this).toggleClass("active");
            e.stopPropagation();
        });
    });

    $(function() {
    var topBtn = $('#pagetop_btn');
    topBtn.hide();
    //スクロールが100に達したらボタン表示
    $(window).scroll(function () {
        if ($(this).scrollTop() > 100) {
            topBtn.fadeIn();
        } else {
            topBtn.fadeOut();
        }
    });
    //スクロールしてトップ
    topBtn.click(function () {
        $('body,html').animate({
            scrollTop: 0
        }, 500);
        return false;
    });
});

//usemap
    $('img[usemap]').rwdImageMaps();



//change-search
	$(document).ready(function(){
		var flg = "open";
		$("#change-search").click(function(){
        if(flg == "open"){
            $(this).text('閉じる');
            flg = "close";
			$(this).removeClass().addClass("close")
        }else{
            $(this).text('検索条件を変更');
            flg = "open";
			$(this).removeClass().addClass("open")
        }
		$("#search-box").slideToggle();
    });
});


})(jQuery);


// コース検索の日本地図用（マップ表示を遅延させる）
(function ($) {
	$(window).load(function(){
		$('#map').css('visibility', 'inherit');
	});
})(jQuery);


//フォームのリセットボタン
jQuery(document).on('click', '.reset', function() {
    this.form.reset();
});